Loading src/java/com/android/internal/telephony/SubscriptionController.java +10 −17 Original line number Diff line number Diff line Loading @@ -148,7 +148,6 @@ public class SubscriptionController extends ISub.Stub { @UnsupportedAppUsage private int[] colorArr; private long mLastISubServiceRegTime; private int mPreferredDataSubId = SubscriptionManager.DEFAULT_SUBSCRIPTION_ID; public static SubscriptionController init(Phone phone) { synchronized (SubscriptionController.class) { Loading Loading @@ -205,10 +204,7 @@ public class SubscriptionController extends ISub.Stub { mLastISubServiceRegTime = System.currentTimeMillis(); } /** * Switching between DSDS and single sim mode needs to clear the slot index of * subscription info. */ // clear SLOT_INDEX for all subs clearSlotIndexForSubInfoRecords(); if (DBG) logdl("[SubscriptionController] init by Context"); Loading Loading @@ -238,22 +234,22 @@ public class SubscriptionController extends ISub.Stub { } /** * Switching between DSDS and single sim mode needs to update the slot index of subscription * info into invalid if the slot index is not active. * This function marks SIM_SLOT_INDEX as INVALID for all subscriptions in the database. This * should be done as part of initialization. * * TODO: SIM_SLOT_INDEX is based on current state and should not even be persisted in the * database. */ private void clearSlotIndexForSubInfoRecords() { if (mTelephonyManager == null || mContext == null) { if (mContext == null) { logel("[clearSlotIndexForSubInfoRecords] TelephonyManager or mContext is null"); return; } int phoneCount = mTelephonyManager.getPhoneCount(); // Update simInfo db with invalid slot index ContentResolver resolver = mContext.getContentResolver(); // Update all subscriptions in simInfo db with invalid slot index ContentValues value = new ContentValues(1); value.put(SubscriptionManager.SIM_SLOT_INDEX, SubscriptionManager.INVALID_SIM_SLOT_INDEX); mContext.getContentResolver().update(SubscriptionManager.CONTENT_URI, value, SubscriptionManager.SIM_SLOT_INDEX + ">=" + phoneCount, null); mContext.getContentResolver().update(SubscriptionManager.CONTENT_URI, value, null, null); } private SubscriptionController(Phone phone) { Loading @@ -266,10 +262,7 @@ public class SubscriptionController extends ISub.Stub { migrateImsSettings(); /** * Switching between DSDS and single sim mode needs to clear the slot index of * subscription info. */ // clear SLOT_INDEX for all subs clearSlotIndexForSubInfoRecords(); if (DBG) logdl("[SubscriptionController] init by Phone"); Loading Loading
src/java/com/android/internal/telephony/SubscriptionController.java +10 −17 Original line number Diff line number Diff line Loading @@ -148,7 +148,6 @@ public class SubscriptionController extends ISub.Stub { @UnsupportedAppUsage private int[] colorArr; private long mLastISubServiceRegTime; private int mPreferredDataSubId = SubscriptionManager.DEFAULT_SUBSCRIPTION_ID; public static SubscriptionController init(Phone phone) { synchronized (SubscriptionController.class) { Loading Loading @@ -205,10 +204,7 @@ public class SubscriptionController extends ISub.Stub { mLastISubServiceRegTime = System.currentTimeMillis(); } /** * Switching between DSDS and single sim mode needs to clear the slot index of * subscription info. */ // clear SLOT_INDEX for all subs clearSlotIndexForSubInfoRecords(); if (DBG) logdl("[SubscriptionController] init by Context"); Loading Loading @@ -238,22 +234,22 @@ public class SubscriptionController extends ISub.Stub { } /** * Switching between DSDS and single sim mode needs to update the slot index of subscription * info into invalid if the slot index is not active. * This function marks SIM_SLOT_INDEX as INVALID for all subscriptions in the database. This * should be done as part of initialization. * * TODO: SIM_SLOT_INDEX is based on current state and should not even be persisted in the * database. */ private void clearSlotIndexForSubInfoRecords() { if (mTelephonyManager == null || mContext == null) { if (mContext == null) { logel("[clearSlotIndexForSubInfoRecords] TelephonyManager or mContext is null"); return; } int phoneCount = mTelephonyManager.getPhoneCount(); // Update simInfo db with invalid slot index ContentResolver resolver = mContext.getContentResolver(); // Update all subscriptions in simInfo db with invalid slot index ContentValues value = new ContentValues(1); value.put(SubscriptionManager.SIM_SLOT_INDEX, SubscriptionManager.INVALID_SIM_SLOT_INDEX); mContext.getContentResolver().update(SubscriptionManager.CONTENT_URI, value, SubscriptionManager.SIM_SLOT_INDEX + ">=" + phoneCount, null); mContext.getContentResolver().update(SubscriptionManager.CONTENT_URI, value, null, null); } private SubscriptionController(Phone phone) { Loading @@ -266,10 +262,7 @@ public class SubscriptionController extends ISub.Stub { migrateImsSettings(); /** * Switching between DSDS and single sim mode needs to clear the slot index of * subscription info. */ // clear SLOT_INDEX for all subs clearSlotIndexForSubInfoRecords(); if (DBG) logdl("[SubscriptionController] init by Phone"); Loading