Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit cc11522b authored by Xiangyu/Malcolm Chen's avatar Xiangyu/Malcolm Chen Committed by Automerger Merge Worker
Browse files

Merge "Add default actions of DSDS switch and slot switch when eSIM is not...

Merge "Add default actions of DSDS switch and slot switch when eSIM is not available." into rvc-dev am: 9e11310f

Change-Id: I7874372f6b1c1a532ab5a0ed7e63ed19a43d4a81
parents edf6f19f 9e11310f
Loading
Loading
Loading
Loading
+17 −1
Original line number Original line Diff line number Diff line
@@ -17,6 +17,7 @@
package com.android.internal.telephony;
package com.android.internal.telephony;


import static android.content.pm.PackageManager.PERMISSION_GRANTED;
import static android.content.pm.PackageManager.PERMISSION_GRANTED;
import static android.telephony.TelephonyManager.MULTISIM_ALLOWED;
import static android.telephony.TelephonyManager.SET_OPPORTUNISTIC_SUB_REMOTE_SERVICE_EXCEPTION;
import static android.telephony.TelephonyManager.SET_OPPORTUNISTIC_SUB_REMOTE_SERVICE_EXCEPTION;
import static android.telephony.UiccSlotInfo.CARD_STATE_INFO_PRESENT;
import static android.telephony.UiccSlotInfo.CARD_STATE_INFO_PRESENT;


@@ -3725,7 +3726,22 @@ public class SubscriptionController extends ISub.Stub {
            // We need to send intents to Euicc if we are turning on an inactive slot.
            // We need to send intents to Euicc if we are turning on an inactive slot.
            // Euicc will decide whether to ask user to switch to DSDS, or change SIM
            // Euicc will decide whether to ask user to switch to DSDS, or change SIM
            // slot mapping.
            // slot mapping.
            EuiccManager euiccManager =
                    (EuiccManager) mContext.getSystemService(Context.EUICC_SERVICE);
            if (euiccManager != null && euiccManager.isEnabled()) {
                enableSubscriptionOverEuiccManager(subId, enable, physicalSlotIndex);
                enableSubscriptionOverEuiccManager(subId, enable, physicalSlotIndex);
            } else {
                // Enable / disable uicc applications.
                if (!info.areUiccApplicationsEnabled()) setUiccApplicationsEnabled(enable, subId);
                // If euiccManager is not enabled, we try to switch to DSDS if possible,
                // or switch slot if not.
                if (mTelephonyManager.isMultiSimSupported() == MULTISIM_ALLOWED) {
                    PhoneConfigurationManager.getInstance().switchMultiSimConfig(
                            mTelephonyManager.getSupportedModemCount());
                } else {
                    UiccController.getInstance().switchSlots(new int[]{physicalSlotIndex}, null);
                }
            }
            return true;
            return true;
        } else {
        } else {
            // Enable / disable uicc applications.
            // Enable / disable uicc applications.