diff options
author | Adnan Begovic <adnan@cyngn.com> | 2015-11-25 17:18:16 -0800 |
---|---|---|
committer | Adnan Begovic <adnan@cyngn.com> | 2015-11-29 14:55:36 -0800 |
commit | 4ae9604b1815880f6ff5234a6b89d622fc03a446 (patch) | |
tree | 9e2050dbe978a139c0c52f3439fc33e998010aab /cm/lib | |
parent | c2219591678ebc7ed9001611d03e77dd13883a6f (diff) | |
download | vendor_cmsdk-4ae9604b1815880f6ff5234a6b89d622fc03a446.zip vendor_cmsdk-4ae9604b1815880f6ff5234a6b89d622fc03a446.tar.gz vendor_cmsdk-4ae9604b1815880f6ff5234a6b89d622fc03a446.tar.bz2 |
cmsdk: Reimplement helper methods for secondary telephony service.
Change-Id: If126936f788d398c53dca21297cd7d69f9d933b8
Diffstat (limited to 'cm/lib')
-rw-r--r-- | cm/lib/main/java/org/cyanogenmod/platform/internal/CMTelephonyManagerService.java | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/cm/lib/main/java/org/cyanogenmod/platform/internal/CMTelephonyManagerService.java b/cm/lib/main/java/org/cyanogenmod/platform/internal/CMTelephonyManagerService.java index 03f4fe6..739722e 100644 --- a/cm/lib/main/java/org/cyanogenmod/platform/internal/CMTelephonyManagerService.java +++ b/cm/lib/main/java/org/cyanogenmod/platform/internal/CMTelephonyManagerService.java @@ -201,10 +201,11 @@ public class CMTelephonyManagerService extends SystemService { } private boolean isSubActive(int subId) { - /* boolean validSubscriptionId = SubscriptionManager.isValidSubscriptionId(subId); + boolean validSubscriptionId = SubscriptionManager.isValidSubscriptionId(subId); if (validSubscriptionId) { - int simState = SubscriptionManager.getSimStateForSubscriber(subId); + int simState = SubscriptionManager.getSimStateForSlotIdx( + SubscriptionManager.getSlotId(subId)); switch (simState) { case TelephonyManager.SIM_STATE_ABSENT: case TelephonyManager.SIM_STATE_CARD_IO_ERROR: @@ -223,12 +224,11 @@ public class CMTelephonyManagerService extends SystemService { } else { Log.w(TAG, "Invalid subscription identifier: " + subId); return false; - } */ - return false; + } } private void setSubState(int subId, boolean state) { - /* if (localLOGD) { + if (localLOGD) { Log.d(TAG, "Setting the subscription " + subId + " to inactive (false) or active (true): " + state); } @@ -236,7 +236,7 @@ public class CMTelephonyManagerService extends SystemService { SubscriptionManager.activateSubId(subId); } else { SubscriptionManager.deactivateSubId(subId); - } */ + } } private boolean isDataConnectionSelectedOnSub(int subId) { @@ -296,12 +296,12 @@ public class CMTelephonyManagerService extends SystemService { } private void setDefaultPhoneSub(int subId) { - /* if (localLOGD) { + if (localLOGD) { Log.d(TAG, "Setting the SIM for phone calls on subscription " + subId); } SubscriptionManager subscriptionManager = SubscriptionManager.from(mContext); - if (subId == CMTelephonyManager.ASK_FOR_SUBSCRIPTION_ID) { + /*if (subId == CMTelephonyManager.ASK_FOR_SUBSCRIPTION_ID) { if (localLOGD) { Log.d(TAG, "Activates the prompt for phone calls"); } @@ -309,16 +309,17 @@ public class CMTelephonyManagerService extends SystemService { } else { SubscriptionManager.setVoicePromptEnabled(false); subscriptionManager.setDefaultVoiceSubId(subId); - } */ + }*/ + subscriptionManager.setDefaultVoiceSubId(subId); } private void setDefaultSmsSub(int subId) { - /* if (localLOGD) { + if (localLOGD) { Log.d(TAG, "Setting the SIM for phone calls on subscription " + subId); } SubscriptionManager subscriptionManager = SubscriptionManager.from(mContext); - if (subId == CMTelephonyManager.ASK_FOR_SUBSCRIPTION_ID) { + /*if (subId == CMTelephonyManager.ASK_FOR_SUBSCRIPTION_ID) { if (localLOGD) { Log.d(TAG, "Activates the prompt for SMS"); } @@ -326,7 +327,8 @@ public class CMTelephonyManagerService extends SystemService { } else { SubscriptionManager.setSMSPromptEnabled(false); subscriptionManager.setDefaultSmsSubId(subId); - } */ + }*/ + subscriptionManager.setDefaultSmsSubId(subId); } private void enforceTelephonyReadPermission() { |