Loading src/java/com/android/internal/telephony/MultiSimSettingController.java +17 −5 Original line number Diff line number Diff line Loading @@ -642,7 +642,7 @@ public class MultiSimSettingController extends Handler { if (DBG) log("updateDefaultValues: change: " + change); if (change == PRIMARY_SUB_NO_CHANGE) return; // If there's only one primary subscription active, we trigger PREFERRED_PICK_DIALOG // If there's only one primary subscription active, we trigger mobile data // dialog if and only if there were multiple primary SIM cards and one is removed. // Otherwise, if user just inserted their first SIM, or there's one primary and one // opportunistic subscription active (activeSubInfos.size() > 1), we automatically Loading @@ -658,7 +658,19 @@ public class MultiSimSettingController extends Handler { if (hasCalling()) mSubscriptionManagerService.setDefaultVoiceSubId(subId); if (hasMessaging()) mSubscriptionManagerService.setDefaultSmsSubId(subId); if (!mSubscriptionManagerService.isEsimBootStrapProvisioningActivated()) { sendDefaultSubConfirmedNotification(subId); // Determines the appropriate notification type // Preconditions: // - There is only one active primary subscription. // - The eSIM bootstrap is NOT activated. // Behavior: // - If the primary subscription is not deactivated OR the device is in single SIM // mode, send a notification to dismiss the SIM dialog. // - Otherwise, send a notification to trigger the preferred SIM/data pick dialog. @TelephonyManager.DefaultSubscriptionSelectType int type = (change != PRIMARY_SUB_REMOVED || mActiveModemCount == 1) ? EXTRA_DEFAULT_SUBSCRIPTION_SELECT_TYPE_DISMISS : EXTRA_DEFAULT_SUBSCRIPTION_SELECT_TYPE_ALL; sendDefaultSubConfirmedNotification(type, subId); } return; } Loading Loading @@ -770,14 +782,14 @@ public class MultiSimSettingController extends Handler { } } private void sendDefaultSubConfirmedNotification(int defaultSubId) { private void sendDefaultSubConfirmedNotification( @TelephonyManager.DefaultSubscriptionSelectType int type, int defaultSubId) { Intent intent = new Intent(); intent.setAction(ACTION_PRIMARY_SUBSCRIPTION_LIST_CHANGED); intent.setClassName("com.android.settings", "com.android.settings.sim.SimSelectNotification"); intent.putExtra(EXTRA_DEFAULT_SUBSCRIPTION_SELECT_TYPE, EXTRA_DEFAULT_SUBSCRIPTION_SELECT_TYPE_DISMISS); intent.putExtra(EXTRA_DEFAULT_SUBSCRIPTION_SELECT_TYPE, type); intent.putExtra(EXTRA_SUBSCRIPTION_ID, defaultSubId); mContext.sendBroadcast(intent); Loading Loading
src/java/com/android/internal/telephony/MultiSimSettingController.java +17 −5 Original line number Diff line number Diff line Loading @@ -642,7 +642,7 @@ public class MultiSimSettingController extends Handler { if (DBG) log("updateDefaultValues: change: " + change); if (change == PRIMARY_SUB_NO_CHANGE) return; // If there's only one primary subscription active, we trigger PREFERRED_PICK_DIALOG // If there's only one primary subscription active, we trigger mobile data // dialog if and only if there were multiple primary SIM cards and one is removed. // Otherwise, if user just inserted their first SIM, or there's one primary and one // opportunistic subscription active (activeSubInfos.size() > 1), we automatically Loading @@ -658,7 +658,19 @@ public class MultiSimSettingController extends Handler { if (hasCalling()) mSubscriptionManagerService.setDefaultVoiceSubId(subId); if (hasMessaging()) mSubscriptionManagerService.setDefaultSmsSubId(subId); if (!mSubscriptionManagerService.isEsimBootStrapProvisioningActivated()) { sendDefaultSubConfirmedNotification(subId); // Determines the appropriate notification type // Preconditions: // - There is only one active primary subscription. // - The eSIM bootstrap is NOT activated. // Behavior: // - If the primary subscription is not deactivated OR the device is in single SIM // mode, send a notification to dismiss the SIM dialog. // - Otherwise, send a notification to trigger the preferred SIM/data pick dialog. @TelephonyManager.DefaultSubscriptionSelectType int type = (change != PRIMARY_SUB_REMOVED || mActiveModemCount == 1) ? EXTRA_DEFAULT_SUBSCRIPTION_SELECT_TYPE_DISMISS : EXTRA_DEFAULT_SUBSCRIPTION_SELECT_TYPE_ALL; sendDefaultSubConfirmedNotification(type, subId); } return; } Loading Loading @@ -770,14 +782,14 @@ public class MultiSimSettingController extends Handler { } } private void sendDefaultSubConfirmedNotification(int defaultSubId) { private void sendDefaultSubConfirmedNotification( @TelephonyManager.DefaultSubscriptionSelectType int type, int defaultSubId) { Intent intent = new Intent(); intent.setAction(ACTION_PRIMARY_SUBSCRIPTION_LIST_CHANGED); intent.setClassName("com.android.settings", "com.android.settings.sim.SimSelectNotification"); intent.putExtra(EXTRA_DEFAULT_SUBSCRIPTION_SELECT_TYPE, EXTRA_DEFAULT_SUBSCRIPTION_SELECT_TYPE_DISMISS); intent.putExtra(EXTRA_DEFAULT_SUBSCRIPTION_SELECT_TYPE, type); intent.putExtra(EXTRA_SUBSCRIPTION_ID, defaultSubId); mContext.sendBroadcast(intent); Loading