Loading src/java/com/android/internal/telephony/subscription/SubscriptionManagerService.java +17 −3 Original line number Diff line number Diff line Loading @@ -933,8 +933,10 @@ public class SubscriptionManagerService extends ISub.Stub { .forEach(subInfo -> { mSubscriptionDatabaseManager.setSimSlotIndex(subInfo.getSubscriptionId(), SubscriptionManager.INVALID_SIM_SLOT_INDEX); // Sometime even though slot-port is inactive, proper iccid will be present, // hence retry the port index from UiccSlot. (Pre-U behavior) mSubscriptionDatabaseManager.setPortIndex(subInfo.getSubscriptionId(), TelephonyManager.INVALID_PORT_INDEX); getPortIndex(subInfo.getIccId())); }); updateGroupDisabled(); logl("markSubscriptionsInactive: current mapping " + slotMappingToString()); Loading Loading @@ -3813,11 +3815,12 @@ public class SubscriptionManagerService extends ISub.Stub { } /** * Called when eSIM becomes inactive. * Called when SIM becomes inactive. * * @param slotIndex The logical SIM slot index. * @param iccId iccId of the SIM in inactivate slot */ public void updateSimStateForInactivePort(int slotIndex) { public void updateSimStateForInactivePort(int slotIndex, String iccId) { mHandler.post(() -> { logl("updateSimStateForInactivePort: slotIndex=" + slotIndex); if (mSlotIndexToSubId.containsKey(slotIndex)) { Loading @@ -3827,6 +3830,17 @@ public class SubscriptionManagerService extends ISub.Stub { mSlotIndexToSubId.get(slotIndex), true); updateSubscription(slotIndex); } if (!TextUtils.isEmpty(iccId)) { // When port is inactive, sometimes valid iccid is present in the slot status, // hence update the portIndex. (Pre-U behavior) SubscriptionInfoInternal subInfo = mSubscriptionDatabaseManager .getSubscriptionInfoInternalByIccId(IccUtils.stripTrailingFs(iccId)); if (subInfo != null) { mSubscriptionDatabaseManager.setPortIndex(subInfo.getSubscriptionId(), getPortIndex(iccId)); } } }); } Loading src/java/com/android/internal/telephony/uicc/UiccController.java +1 −1 Original line number Diff line number Diff line Loading @@ -790,7 +790,7 @@ public class UiccController extends Handler { IccCardConstants.State.ABSENT.toString()); } SubscriptionManagerService.getInstance().updateSimStateForInactivePort(phoneId); SubscriptionManagerService.getInstance().updateSimStateForInactivePort(phoneId, iccId); }); } Loading tests/telephonytests/src/com/android/internal/telephony/subscription/SubscriptionManagerServiceTest.java +4 −2 Original line number Diff line number Diff line Loading @@ -1956,6 +1956,8 @@ public class SubscriptionManagerServiceTest extends TelephonyTest { EuiccService.RESULT_OK, new EuiccProfileInfo[0], false); doReturn(result).when(mEuiccController).blockingGetEuiccProfileInfoList(eq(1)); doReturn("").when(mUiccPort).getIccId(); doReturn(TelephonyManager.INVALID_PORT_INDEX) .when(mUiccSlot).getPortIndexFromIccId(anyString()); mSubscriptionManagerServiceUT.updateEmbeddedSubscriptions(List.of(1), null); mSubscriptionManagerServiceUT.updateSimState( Loading Loading @@ -2017,7 +2019,7 @@ public class SubscriptionManagerServiceTest extends TelephonyTest { .getSubscriptionInfoInternal(1); assertThat(subInfo.getSimSlotIndex()).isEqualTo( SubscriptionManager.INVALID_SUBSCRIPTION_ID); assertThat(subInfo.getPortIndex()).isEqualTo(TelephonyManager.INVALID_PORT_INDEX); assertThat(subInfo.getPortIndex()).isEqualTo(TelephonyManager.DEFAULT_PORT_INDEX); } @Test Loading Loading @@ -2166,7 +2168,7 @@ public class SubscriptionManagerServiceTest extends TelephonyTest { testSetUiccApplicationsEnabled(); mContextFixture.addCallingOrSelfPermission(Manifest.permission.READ_PRIVILEGED_PHONE_STATE); mSubscriptionManagerServiceUT.updateSimStateForInactivePort(0); mSubscriptionManagerServiceUT.updateSimStateForInactivePort(0, null); processAllMessages(); SubscriptionInfoInternal subInfo = mSubscriptionManagerServiceUT Loading Loading
src/java/com/android/internal/telephony/subscription/SubscriptionManagerService.java +17 −3 Original line number Diff line number Diff line Loading @@ -933,8 +933,10 @@ public class SubscriptionManagerService extends ISub.Stub { .forEach(subInfo -> { mSubscriptionDatabaseManager.setSimSlotIndex(subInfo.getSubscriptionId(), SubscriptionManager.INVALID_SIM_SLOT_INDEX); // Sometime even though slot-port is inactive, proper iccid will be present, // hence retry the port index from UiccSlot. (Pre-U behavior) mSubscriptionDatabaseManager.setPortIndex(subInfo.getSubscriptionId(), TelephonyManager.INVALID_PORT_INDEX); getPortIndex(subInfo.getIccId())); }); updateGroupDisabled(); logl("markSubscriptionsInactive: current mapping " + slotMappingToString()); Loading Loading @@ -3813,11 +3815,12 @@ public class SubscriptionManagerService extends ISub.Stub { } /** * Called when eSIM becomes inactive. * Called when SIM becomes inactive. * * @param slotIndex The logical SIM slot index. * @param iccId iccId of the SIM in inactivate slot */ public void updateSimStateForInactivePort(int slotIndex) { public void updateSimStateForInactivePort(int slotIndex, String iccId) { mHandler.post(() -> { logl("updateSimStateForInactivePort: slotIndex=" + slotIndex); if (mSlotIndexToSubId.containsKey(slotIndex)) { Loading @@ -3827,6 +3830,17 @@ public class SubscriptionManagerService extends ISub.Stub { mSlotIndexToSubId.get(slotIndex), true); updateSubscription(slotIndex); } if (!TextUtils.isEmpty(iccId)) { // When port is inactive, sometimes valid iccid is present in the slot status, // hence update the portIndex. (Pre-U behavior) SubscriptionInfoInternal subInfo = mSubscriptionDatabaseManager .getSubscriptionInfoInternalByIccId(IccUtils.stripTrailingFs(iccId)); if (subInfo != null) { mSubscriptionDatabaseManager.setPortIndex(subInfo.getSubscriptionId(), getPortIndex(iccId)); } } }); } Loading
src/java/com/android/internal/telephony/uicc/UiccController.java +1 −1 Original line number Diff line number Diff line Loading @@ -790,7 +790,7 @@ public class UiccController extends Handler { IccCardConstants.State.ABSENT.toString()); } SubscriptionManagerService.getInstance().updateSimStateForInactivePort(phoneId); SubscriptionManagerService.getInstance().updateSimStateForInactivePort(phoneId, iccId); }); } Loading
tests/telephonytests/src/com/android/internal/telephony/subscription/SubscriptionManagerServiceTest.java +4 −2 Original line number Diff line number Diff line Loading @@ -1956,6 +1956,8 @@ public class SubscriptionManagerServiceTest extends TelephonyTest { EuiccService.RESULT_OK, new EuiccProfileInfo[0], false); doReturn(result).when(mEuiccController).blockingGetEuiccProfileInfoList(eq(1)); doReturn("").when(mUiccPort).getIccId(); doReturn(TelephonyManager.INVALID_PORT_INDEX) .when(mUiccSlot).getPortIndexFromIccId(anyString()); mSubscriptionManagerServiceUT.updateEmbeddedSubscriptions(List.of(1), null); mSubscriptionManagerServiceUT.updateSimState( Loading Loading @@ -2017,7 +2019,7 @@ public class SubscriptionManagerServiceTest extends TelephonyTest { .getSubscriptionInfoInternal(1); assertThat(subInfo.getSimSlotIndex()).isEqualTo( SubscriptionManager.INVALID_SUBSCRIPTION_ID); assertThat(subInfo.getPortIndex()).isEqualTo(TelephonyManager.INVALID_PORT_INDEX); assertThat(subInfo.getPortIndex()).isEqualTo(TelephonyManager.DEFAULT_PORT_INDEX); } @Test Loading Loading @@ -2166,7 +2168,7 @@ public class SubscriptionManagerServiceTest extends TelephonyTest { testSetUiccApplicationsEnabled(); mContextFixture.addCallingOrSelfPermission(Manifest.permission.READ_PRIVILEGED_PHONE_STATE); mSubscriptionManagerServiceUT.updateSimStateForInactivePort(0); mSubscriptionManagerServiceUT.updateSimStateForInactivePort(0, null); processAllMessages(); SubscriptionInfoInternal subInfo = mSubscriptionManagerServiceUT Loading