summaryrefslogtreecommitdiffstats
path: root/telecomm/java/android/telecom/TelecomManager.java
diff options
context:
space:
mode:
Diffstat (limited to 'telecomm/java/android/telecom/TelecomManager.java')
-rw-r--r--telecomm/java/android/telecom/TelecomManager.java32
1 files changed, 32 insertions, 0 deletions
diff --git a/telecomm/java/android/telecom/TelecomManager.java b/telecomm/java/android/telecom/TelecomManager.java
index 067e734..673adb2 100644
--- a/telecomm/java/android/telecom/TelecomManager.java
+++ b/telecomm/java/android/telecom/TelecomManager.java
@@ -22,6 +22,7 @@ import android.net.Uri;
import android.os.Bundle;
import android.os.RemoteException;
import android.os.ServiceManager;
+import android.telephony.SubscriptionManager;
import android.telephony.TelephonyManager;
import android.text.TextUtils;
import android.util.Log;
@@ -1039,6 +1040,37 @@ public class TelecomManager {
}
/**
+ * Returns current active subscription.
+ * Active subscription is the one from which calls are displayed to user when there are actve
+ * calls on both subscriptions.
+ * @hide
+ */
+ public int getActiveSubscription() {
+ try {
+ if (isServiceConnected()) {
+ return getTelecomService().getActiveSubscription();
+ }
+ } catch (RemoteException e) {
+ Log.e(TAG, "RemoteException attempting to get the active subsription.", e);
+ }
+ return SubscriptionManager.INVALID_SUBSCRIPTION_ID;
+ }
+
+ /**
+ * switches to other active subscription.
+ * @hide
+ */
+ public void switchToOtherActiveSub(int subId) {
+ try {
+ if (isServiceConnected()) {
+ getTelecomService().switchToOtherActiveSub(subId);
+ }
+ } catch (RemoteException e) {
+ Log.e(TAG, "RemoteException attempting to switchToOtherActiveSub.", e);
+ }
+ }
+
+ /**
* Registers a new incoming call. A {@link ConnectionService} should invoke this method when it
* has an incoming call. The specified {@link PhoneAccountHandle} must have been registered
* with {@link #registerPhoneAccount}. Once invoked, this method will cause the system to bind