Loading src/java/com/android/internal/telephony/euicc/EuiccController.java +45 −57 Original line number Diff line number Diff line Loading @@ -1939,10 +1939,13 @@ public class EuiccController extends IEuiccController.Stub { @Override public boolean isSimPortAvailable(int cardId, int portIndex, String callingPackage) { mAppOpsManager.checkPackage(Binder.getCallingUid(), callingPackage); List<UiccCardInfo> cardInfos; final long token = Binder.clearCallingIdentity(); try { List<UiccCardInfo> cardInfos = mTelephonyManager.getUiccCardsInfo(); cardInfos = mTelephonyManager.getUiccCardsInfo(); } finally { Binder.restoreCallingIdentity(token); } for (UiccCardInfo info : cardInfos) { if (info == null || info.getCardId() != cardId) { continue; Loading @@ -1957,21 +1960,9 @@ public class EuiccController extends IEuiccController.Stub { if (portInfo == null || portInfo.getPortIndex() != portIndex) { continue; } // Return false if port is not active. if (!portInfo.isActive()) { // port is inactive, check whether the caller can activate a new profile // seamlessly. This is possible in below condition: // 1. Device in DSDS Mode(P+E). // 2. pSIM slot is active but no active subscription. // 3. Caller has carrier privileges on any phone boolean hasActiveRemovableNonEuiccSlot = getRemovableNonEuiccSlot() != null && getRemovableNonEuiccSlot().isActive(); boolean hasCarrierPrivileges = mTelephonyManager .checkCarrierPrivilegesForPackageAnyPhone(callingPackage) == TelephonyManager.CARRIER_PRIVILEGE_STATUS_HAS_ACCESS; return mTelephonyManager.isMultiSimEnabled() && hasActiveRemovableNonEuiccSlot && !isRemovalNonEuiccSlotHasActiveSubscription() && hasCarrierPrivileges; return false; } // A port is available if it has no profiles enabled on it or calling app has // Carrier privilege over the profile installed on the selected port. Loading Loading @@ -2002,9 +1993,6 @@ public class EuiccController extends IEuiccController.Stub { == TelephonyManager.CARRIER_PRIVILEGE_STATUS_HAS_ACCESS); } } } finally { Binder.restoreCallingIdentity(token); } return false; } Loading Loading
src/java/com/android/internal/telephony/euicc/EuiccController.java +45 −57 Original line number Diff line number Diff line Loading @@ -1939,10 +1939,13 @@ public class EuiccController extends IEuiccController.Stub { @Override public boolean isSimPortAvailable(int cardId, int portIndex, String callingPackage) { mAppOpsManager.checkPackage(Binder.getCallingUid(), callingPackage); List<UiccCardInfo> cardInfos; final long token = Binder.clearCallingIdentity(); try { List<UiccCardInfo> cardInfos = mTelephonyManager.getUiccCardsInfo(); cardInfos = mTelephonyManager.getUiccCardsInfo(); } finally { Binder.restoreCallingIdentity(token); } for (UiccCardInfo info : cardInfos) { if (info == null || info.getCardId() != cardId) { continue; Loading @@ -1957,21 +1960,9 @@ public class EuiccController extends IEuiccController.Stub { if (portInfo == null || portInfo.getPortIndex() != portIndex) { continue; } // Return false if port is not active. if (!portInfo.isActive()) { // port is inactive, check whether the caller can activate a new profile // seamlessly. This is possible in below condition: // 1. Device in DSDS Mode(P+E). // 2. pSIM slot is active but no active subscription. // 3. Caller has carrier privileges on any phone boolean hasActiveRemovableNonEuiccSlot = getRemovableNonEuiccSlot() != null && getRemovableNonEuiccSlot().isActive(); boolean hasCarrierPrivileges = mTelephonyManager .checkCarrierPrivilegesForPackageAnyPhone(callingPackage) == TelephonyManager.CARRIER_PRIVILEGE_STATUS_HAS_ACCESS; return mTelephonyManager.isMultiSimEnabled() && hasActiveRemovableNonEuiccSlot && !isRemovalNonEuiccSlotHasActiveSubscription() && hasCarrierPrivileges; return false; } // A port is available if it has no profiles enabled on it or calling app has // Carrier privilege over the profile installed on the selected port. Loading Loading @@ -2002,9 +1993,6 @@ public class EuiccController extends IEuiccController.Stub { == TelephonyManager.CARRIER_PRIVILEGE_STATUS_HAS_ACCESS); } } } finally { Binder.restoreCallingIdentity(token); } return false; } Loading