Loading src/java/com/android/internal/telephony/euicc/EuiccController.java +20 −6 Original line number Diff line number Diff line Loading @@ -555,13 +555,19 @@ public class EuiccController extends IEuiccController.Stub { Bundle resolvedBundle, PendingIntent callbackIntent) { boolean callerCanWriteEmbeddedSubscriptions = callerCanWriteEmbeddedSubscriptions(); mAppOpsManager.checkPackage(Binder.getCallingUid(), callingPackage); // Don't try to resolve the port index for apps which are not targeting on T for backward // compatibility. instead always use default port 0. boolean shouldResolvePortIndex = isCompatChangeEnabled(callingPackage, EuiccManager.SHOULD_RESOLVE_PORT_INDEX_FOR_APPS); long token = Binder.clearCallingIdentity(); try { boolean isConsentNeededToResolvePortIndex = false; if (switchAfterDownload && portIndex == TelephonyManager.INVALID_PORT_INDEX) { // If switchAfterDownload is true, resolve the portIndex portIndex = getResolvedPortIndexForSubscriptionSwitch(cardId); portIndex = shouldResolvePortIndex ? getResolvedPortIndexForSubscriptionSwitch(cardId) : TelephonyManager.DEFAULT_PORT_INDEX; isConsentNeededToResolvePortIndex = (portIndex == TelephonyManager.INVALID_PORT_INDEX); } Loading @@ -569,7 +575,8 @@ public class EuiccController extends IEuiccController.Stub { + switchAfterDownload + " portIndex: " + portIndex + " forceDeactivateSim: " + forceDeactivateSim + " callingPackage: " + callingPackage + " isConsentNeededToResolvePortIndex: " + isConsentNeededToResolvePortIndex); + " isConsentNeededToResolvePortIndex: " + isConsentNeededToResolvePortIndex + " shouldResolvePortIndex:" + shouldResolvePortIndex); if (!isConsentNeededToResolvePortIndex && callerCanWriteEmbeddedSubscriptions) { // With WRITE_EMBEDDED_SUBSCRIPTIONS, we can skip profile-specific permission checks // and move straight to the profile download. Loading Loading @@ -1023,9 +1030,14 @@ public class EuiccController extends IEuiccController.Stub { boolean usePortIndex) { boolean callerCanWriteEmbeddedSubscriptions = callerCanWriteEmbeddedSubscriptions(); mAppOpsManager.checkPackage(Binder.getCallingUid(), callingPackage); // Resolve the portIndex internally if apps targeting T and beyond are calling // switchToSubscription API without portIndex. boolean shouldResolvePortIndex = isCompatChangeEnabled(callingPackage, EuiccManager.SHOULD_RESOLVE_PORT_INDEX_FOR_APPS); Log.d(TAG, " subId: " + subscriptionId + " portIndex: " + portIndex + " forceDeactivateSim: " + forceDeactivateSim + " usePortIndex: " + usePortIndex + " callingPackage: " + callingPackage); + " callingPackage: " + callingPackage + " shouldResolvePortIndex: " + shouldResolvePortIndex); long token = Binder.clearCallingIdentity(); try { if (callerCanWriteEmbeddedSubscriptions) { Loading Loading @@ -1096,9 +1108,11 @@ public class EuiccController extends IEuiccController.Stub { return; } } else { // Resolve the portIndex internally if apps are calling switchToSubscription // API without portIndex. portIndex = getResolvedPortIndexForSubscriptionSwitch(cardId); // Resolve the portIndex internally if apps targeting T and beyond are calling // switchToSubscription API without portIndex. portIndex = shouldResolvePortIndex ? getResolvedPortIndexForSubscriptionSwitch(cardId) : TelephonyManager.DEFAULT_PORT_INDEX; isConsentNeededToResolvePortIndex = (portIndex == TelephonyManager.INVALID_PORT_INDEX); usePortIndex = true; Loading tests/telephonytests/src/com/android/internal/telephony/euicc/EuiccControllerTest.java +32 −0 Original line number Diff line number Diff line Loading @@ -415,6 +415,7 @@ public class EuiccControllerTest extends TelephonyTest { } @Test @DisableCompatChanges({EuiccManager.SHOULD_RESOLVE_PORT_INDEX_FOR_APPS}) public void testDownloadSubscription_serviceUnavailable() throws Exception { setHasWriteEmbeddedPermission(true); setUpUiccSlotData(); Loading @@ -428,6 +429,7 @@ public class EuiccControllerTest extends TelephonyTest { } @Test @DisableCompatChanges({EuiccManager.SHOULD_RESOLVE_PORT_INDEX_FOR_APPS}) public void testDownloadSubscription_error() throws Exception { setHasWriteEmbeddedPermission(true); callDownloadSubscription(SUBSCRIPTION, false /* switchAfterDownload */, true /* complete */, Loading @@ -437,6 +439,7 @@ public class EuiccControllerTest extends TelephonyTest { } @Test @DisableCompatChanges({EuiccManager.SHOULD_RESOLVE_PORT_INDEX_FOR_APPS}) public void testDownloadSubscription_mustDeactivateSim() throws Exception { setHasWriteEmbeddedPermission(true); callDownloadSubscription(SUBSCRIPTION, false /* switchAfterDownload */, true /* complete */, Loading @@ -449,6 +452,7 @@ public class EuiccControllerTest extends TelephonyTest { } @Test @DisableCompatChanges({EuiccManager.SHOULD_RESOLVE_PORT_INDEX_FOR_APPS}) public void testDownloadSubscription_needConfirmationCode() throws Exception { setHasWriteEmbeddedPermission(true); callDownloadSubscription(SUBSCRIPTION, false /* switchAfterDownload */, true /* complete */, Loading @@ -461,6 +465,7 @@ public class EuiccControllerTest extends TelephonyTest { } @Test @DisableCompatChanges({EuiccManager.SHOULD_RESOLVE_PORT_INDEX_FOR_APPS}) public void testDownloadSubscription_success() throws Exception { setHasWriteEmbeddedPermission(true); setUpUiccSlotData(); Loading @@ -472,6 +477,7 @@ public class EuiccControllerTest extends TelephonyTest { } @Test @DisableCompatChanges({EuiccManager.SHOULD_RESOLVE_PORT_INDEX_FOR_APPS}) public void testDownloadSubscription_noSwitch_success() throws Exception { setHasWriteEmbeddedPermission(true); callDownloadSubscription(SUBSCRIPTION, false /* switchAfterDownload */, true /* complete */, Loading @@ -481,6 +487,7 @@ public class EuiccControllerTest extends TelephonyTest { } @Test @DisableCompatChanges({EuiccManager.SHOULD_RESOLVE_PORT_INDEX_FOR_APPS}) public void testDownloadSubscription_noPrivileges_getMetadata_serviceUnavailable() throws Exception { setHasWriteEmbeddedPermission(false); Loading @@ -495,6 +502,7 @@ public class EuiccControllerTest extends TelephonyTest { } @Test @DisableCompatChanges({EuiccManager.SHOULD_RESOLVE_PORT_INDEX_FOR_APPS}) public void testDownloadSubscription_noPrivileges_getMetadata_serviceUnavailable_canManageSim() throws Exception { setHasWriteEmbeddedPermission(false); Loading @@ -510,6 +518,7 @@ public class EuiccControllerTest extends TelephonyTest { } @Test @DisableCompatChanges({EuiccManager.SHOULD_RESOLVE_PORT_INDEX_FOR_APPS}) public void testDownloadSubscription_noPrivileges_getMetadata_error() throws Exception { setHasWriteEmbeddedPermission(false); Loading @@ -526,6 +535,7 @@ public class EuiccControllerTest extends TelephonyTest { } @Test @DisableCompatChanges({EuiccManager.SHOULD_RESOLVE_PORT_INDEX_FOR_APPS}) public void testDownloadSubscription_noPrivileges_getMetadata_error_canManageSim() throws Exception { setHasWriteEmbeddedPermission(false); Loading @@ -543,6 +553,7 @@ public class EuiccControllerTest extends TelephonyTest { } @Test @DisableCompatChanges({EuiccManager.SHOULD_RESOLVE_PORT_INDEX_FOR_APPS}) public void testDownloadSubscription_noPrivileges_getMetadata_mustDeactivateSim() throws Exception { setHasWriteEmbeddedPermission(false); Loading @@ -562,6 +573,7 @@ public class EuiccControllerTest extends TelephonyTest { } @Test @DisableCompatChanges({EuiccManager.SHOULD_RESOLVE_PORT_INDEX_FOR_APPS}) public void testDownloadSubscription_noPrivileges_getMetadata_mustDeactivateSim_canManageSim() throws Exception { setHasWriteEmbeddedPermission(false); Loading @@ -582,6 +594,7 @@ public class EuiccControllerTest extends TelephonyTest { } @Test @DisableCompatChanges({EuiccManager.SHOULD_RESOLVE_PORT_INDEX_FOR_APPS}) public void testDownloadSubscription_noPrivileges_hasCarrierPrivileges() throws Exception { setHasWriteEmbeddedPermission(false); setUpUiccSlotData(); Loading @@ -599,6 +612,7 @@ public class EuiccControllerTest extends TelephonyTest { } @Test @DisableCompatChanges({EuiccManager.SHOULD_RESOLVE_PORT_INDEX_FOR_APPS}) public void testDownloadSubscription_noPrivileges_hasCarrierPrivileges_multiSim() throws Exception { setHasWriteEmbeddedPermission(false); Loading @@ -617,6 +631,7 @@ public class EuiccControllerTest extends TelephonyTest { } @Test @DisableCompatChanges({EuiccManager.SHOULD_RESOLVE_PORT_INDEX_FOR_APPS}) public void testDownloadSubscription_noPrivileges_hasCarrierPrivileges_needsConsent() throws Exception { setHasWriteEmbeddedPermission(false); Loading @@ -638,6 +653,7 @@ public class EuiccControllerTest extends TelephonyTest { } @Test @DisableCompatChanges({EuiccManager.SHOULD_RESOLVE_PORT_INDEX_FOR_APPS}) public void testDownloadSubscription_noPrivileges_hasCarrierPrivileges_needsConsent_multiSim() throws Exception { setHasWriteEmbeddedPermission(false); Loading @@ -659,6 +675,7 @@ public class EuiccControllerTest extends TelephonyTest { } @Test @DisableCompatChanges({EuiccManager.SHOULD_RESOLVE_PORT_INDEX_FOR_APPS}) public void testDownloadSubscription_noPriv_hasCarrierPrivi_needsConsent_multiSim_targetPsim() throws Exception { setHasWriteEmbeddedPermission(false); Loading @@ -680,6 +697,7 @@ public class EuiccControllerTest extends TelephonyTest { } @Test @DisableCompatChanges({EuiccManager.SHOULD_RESOLVE_PORT_INDEX_FOR_APPS}) public void testDownloadSubscription_noPrivileges_noCarrierPrivileges() throws Exception { setHasWriteEmbeddedPermission(false); setUpUiccSlotData(); Loading @@ -701,6 +719,7 @@ public class EuiccControllerTest extends TelephonyTest { } @Test @DisableCompatChanges({EuiccManager.SHOULD_RESOLVE_PORT_INDEX_FOR_APPS}) public void testDownloadSubscription_noPrivileges_noCarrierPrivileges_canManagerTargetSim() throws Exception { setHasWriteEmbeddedPermission(false); Loading Loading @@ -790,6 +809,7 @@ public class EuiccControllerTest extends TelephonyTest { } @Test @DisableCompatChanges({EuiccManager.SHOULD_RESOLVE_PORT_INDEX_FOR_APPS}) public void testSwitchToSubscription_noSuchSubscription() throws Exception { setHasWriteEmbeddedPermission(true); callSwitchToSubscription( Loading @@ -802,6 +822,7 @@ public class EuiccControllerTest extends TelephonyTest { } @Test @DisableCompatChanges({EuiccManager.SHOULD_RESOLVE_PORT_INDEX_FOR_APPS}) public void testSwitchToSubscription_emptySubscription_noPrivileges() throws Exception { setHasWriteEmbeddedPermission(false); callSwitchToSubscription( Loading @@ -814,6 +835,7 @@ public class EuiccControllerTest extends TelephonyTest { } @Test @DisableCompatChanges({EuiccManager.SHOULD_RESOLVE_PORT_INDEX_FOR_APPS}) public void testSwitchToSubscription_serviceUnavailable() throws Exception { setHasWriteEmbeddedPermission(true); prepareOperationSubscription(false /* hasPrivileges */); Loading @@ -828,6 +850,7 @@ public class EuiccControllerTest extends TelephonyTest { } @Test @DisableCompatChanges({EuiccManager.SHOULD_RESOLVE_PORT_INDEX_FOR_APPS}) public void testSwitchToSubscription_error() throws Exception { setHasWriteEmbeddedPermission(true); prepareOperationSubscription(false /* hasPrivileges */); Loading @@ -840,6 +863,7 @@ public class EuiccControllerTest extends TelephonyTest { } @Test @DisableCompatChanges({EuiccManager.SHOULD_RESOLVE_PORT_INDEX_FOR_APPS}) public void testSwitchToSubscription_success() throws Exception { setHasWriteEmbeddedPermission(true); prepareOperationSubscription(false /* hasPrivileges */); Loading @@ -851,6 +875,7 @@ public class EuiccControllerTest extends TelephonyTest { } @Test @DisableCompatChanges({EuiccManager.SHOULD_RESOLVE_PORT_INDEX_FOR_APPS}) public void testSwitchToSubscription_emptySubscription_noActiveSubscription() throws Exception { setHasWriteEmbeddedPermission(true); callSwitchToSubscription( Loading @@ -863,6 +888,7 @@ public class EuiccControllerTest extends TelephonyTest { } @Test @DisableCompatChanges({EuiccManager.SHOULD_RESOLVE_PORT_INDEX_FOR_APPS}) public void testSwitchToSubscription_emptySubscription_success() throws Exception { setHasWriteEmbeddedPermission(true); setHasCarrierPrivilegesOnActiveSubscription(false); Loading @@ -873,6 +899,7 @@ public class EuiccControllerTest extends TelephonyTest { } @Test @DisableCompatChanges({EuiccManager.SHOULD_RESOLVE_PORT_INDEX_FOR_APPS}) public void testSwitchToSubscription_noPrivileges() throws Exception { setHasWriteEmbeddedPermission(false); prepareOperationSubscription(false /* hasPrivileges */); Loading @@ -886,6 +913,7 @@ public class EuiccControllerTest extends TelephonyTest { } @Test @DisableCompatChanges({EuiccManager.SHOULD_RESOLVE_PORT_INDEX_FOR_APPS}) public void testSwitchToSubscription_hasCarrierPrivileges() throws Exception { setHasWriteEmbeddedPermission(false); prepareOperationSubscription(true /* hasPrivileges */); Loading @@ -898,6 +926,7 @@ public class EuiccControllerTest extends TelephonyTest { } @Test @DisableCompatChanges({EuiccManager.SHOULD_RESOLVE_PORT_INDEX_FOR_APPS}) public void testSwitchToSubscription_hasCarrierPrivileges_multiSim() throws Exception { setHasWriteEmbeddedPermission(false); prepareOperationSubscription(true /* hasPrivileges */); Loading @@ -910,6 +939,7 @@ public class EuiccControllerTest extends TelephonyTest { } @Test @DisableCompatChanges({EuiccManager.SHOULD_RESOLVE_PORT_INDEX_FOR_APPS}) public void testSwitchToSubscription_hasCarrierPrivileges_needsConsent() throws Exception { setHasWriteEmbeddedPermission(false); prepareOperationSubscription(true /* hasPrivileges */); Loading @@ -927,6 +957,7 @@ public class EuiccControllerTest extends TelephonyTest { } @Test @DisableCompatChanges({EuiccManager.SHOULD_RESOLVE_PORT_INDEX_FOR_APPS}) public void testSwitchToSubscription_hasCarrierPrivileges_needsConsent_multiSim() throws Exception { setHasWriteEmbeddedPermission(false); Loading @@ -945,6 +976,7 @@ public class EuiccControllerTest extends TelephonyTest { } @Test @DisableCompatChanges({EuiccManager.SHOULD_RESOLVE_PORT_INDEX_FOR_APPS}) public void testSwitchToSubscription_hasCarrierPrivileges_needsConsent_multiSim_targetPsim() throws Exception { setHasWriteEmbeddedPermission(false); Loading Loading
src/java/com/android/internal/telephony/euicc/EuiccController.java +20 −6 Original line number Diff line number Diff line Loading @@ -555,13 +555,19 @@ public class EuiccController extends IEuiccController.Stub { Bundle resolvedBundle, PendingIntent callbackIntent) { boolean callerCanWriteEmbeddedSubscriptions = callerCanWriteEmbeddedSubscriptions(); mAppOpsManager.checkPackage(Binder.getCallingUid(), callingPackage); // Don't try to resolve the port index for apps which are not targeting on T for backward // compatibility. instead always use default port 0. boolean shouldResolvePortIndex = isCompatChangeEnabled(callingPackage, EuiccManager.SHOULD_RESOLVE_PORT_INDEX_FOR_APPS); long token = Binder.clearCallingIdentity(); try { boolean isConsentNeededToResolvePortIndex = false; if (switchAfterDownload && portIndex == TelephonyManager.INVALID_PORT_INDEX) { // If switchAfterDownload is true, resolve the portIndex portIndex = getResolvedPortIndexForSubscriptionSwitch(cardId); portIndex = shouldResolvePortIndex ? getResolvedPortIndexForSubscriptionSwitch(cardId) : TelephonyManager.DEFAULT_PORT_INDEX; isConsentNeededToResolvePortIndex = (portIndex == TelephonyManager.INVALID_PORT_INDEX); } Loading @@ -569,7 +575,8 @@ public class EuiccController extends IEuiccController.Stub { + switchAfterDownload + " portIndex: " + portIndex + " forceDeactivateSim: " + forceDeactivateSim + " callingPackage: " + callingPackage + " isConsentNeededToResolvePortIndex: " + isConsentNeededToResolvePortIndex); + " isConsentNeededToResolvePortIndex: " + isConsentNeededToResolvePortIndex + " shouldResolvePortIndex:" + shouldResolvePortIndex); if (!isConsentNeededToResolvePortIndex && callerCanWriteEmbeddedSubscriptions) { // With WRITE_EMBEDDED_SUBSCRIPTIONS, we can skip profile-specific permission checks // and move straight to the profile download. Loading Loading @@ -1023,9 +1030,14 @@ public class EuiccController extends IEuiccController.Stub { boolean usePortIndex) { boolean callerCanWriteEmbeddedSubscriptions = callerCanWriteEmbeddedSubscriptions(); mAppOpsManager.checkPackage(Binder.getCallingUid(), callingPackage); // Resolve the portIndex internally if apps targeting T and beyond are calling // switchToSubscription API without portIndex. boolean shouldResolvePortIndex = isCompatChangeEnabled(callingPackage, EuiccManager.SHOULD_RESOLVE_PORT_INDEX_FOR_APPS); Log.d(TAG, " subId: " + subscriptionId + " portIndex: " + portIndex + " forceDeactivateSim: " + forceDeactivateSim + " usePortIndex: " + usePortIndex + " callingPackage: " + callingPackage); + " callingPackage: " + callingPackage + " shouldResolvePortIndex: " + shouldResolvePortIndex); long token = Binder.clearCallingIdentity(); try { if (callerCanWriteEmbeddedSubscriptions) { Loading Loading @@ -1096,9 +1108,11 @@ public class EuiccController extends IEuiccController.Stub { return; } } else { // Resolve the portIndex internally if apps are calling switchToSubscription // API without portIndex. portIndex = getResolvedPortIndexForSubscriptionSwitch(cardId); // Resolve the portIndex internally if apps targeting T and beyond are calling // switchToSubscription API without portIndex. portIndex = shouldResolvePortIndex ? getResolvedPortIndexForSubscriptionSwitch(cardId) : TelephonyManager.DEFAULT_PORT_INDEX; isConsentNeededToResolvePortIndex = (portIndex == TelephonyManager.INVALID_PORT_INDEX); usePortIndex = true; Loading
tests/telephonytests/src/com/android/internal/telephony/euicc/EuiccControllerTest.java +32 −0 Original line number Diff line number Diff line Loading @@ -415,6 +415,7 @@ public class EuiccControllerTest extends TelephonyTest { } @Test @DisableCompatChanges({EuiccManager.SHOULD_RESOLVE_PORT_INDEX_FOR_APPS}) public void testDownloadSubscription_serviceUnavailable() throws Exception { setHasWriteEmbeddedPermission(true); setUpUiccSlotData(); Loading @@ -428,6 +429,7 @@ public class EuiccControllerTest extends TelephonyTest { } @Test @DisableCompatChanges({EuiccManager.SHOULD_RESOLVE_PORT_INDEX_FOR_APPS}) public void testDownloadSubscription_error() throws Exception { setHasWriteEmbeddedPermission(true); callDownloadSubscription(SUBSCRIPTION, false /* switchAfterDownload */, true /* complete */, Loading @@ -437,6 +439,7 @@ public class EuiccControllerTest extends TelephonyTest { } @Test @DisableCompatChanges({EuiccManager.SHOULD_RESOLVE_PORT_INDEX_FOR_APPS}) public void testDownloadSubscription_mustDeactivateSim() throws Exception { setHasWriteEmbeddedPermission(true); callDownloadSubscription(SUBSCRIPTION, false /* switchAfterDownload */, true /* complete */, Loading @@ -449,6 +452,7 @@ public class EuiccControllerTest extends TelephonyTest { } @Test @DisableCompatChanges({EuiccManager.SHOULD_RESOLVE_PORT_INDEX_FOR_APPS}) public void testDownloadSubscription_needConfirmationCode() throws Exception { setHasWriteEmbeddedPermission(true); callDownloadSubscription(SUBSCRIPTION, false /* switchAfterDownload */, true /* complete */, Loading @@ -461,6 +465,7 @@ public class EuiccControllerTest extends TelephonyTest { } @Test @DisableCompatChanges({EuiccManager.SHOULD_RESOLVE_PORT_INDEX_FOR_APPS}) public void testDownloadSubscription_success() throws Exception { setHasWriteEmbeddedPermission(true); setUpUiccSlotData(); Loading @@ -472,6 +477,7 @@ public class EuiccControllerTest extends TelephonyTest { } @Test @DisableCompatChanges({EuiccManager.SHOULD_RESOLVE_PORT_INDEX_FOR_APPS}) public void testDownloadSubscription_noSwitch_success() throws Exception { setHasWriteEmbeddedPermission(true); callDownloadSubscription(SUBSCRIPTION, false /* switchAfterDownload */, true /* complete */, Loading @@ -481,6 +487,7 @@ public class EuiccControllerTest extends TelephonyTest { } @Test @DisableCompatChanges({EuiccManager.SHOULD_RESOLVE_PORT_INDEX_FOR_APPS}) public void testDownloadSubscription_noPrivileges_getMetadata_serviceUnavailable() throws Exception { setHasWriteEmbeddedPermission(false); Loading @@ -495,6 +502,7 @@ public class EuiccControllerTest extends TelephonyTest { } @Test @DisableCompatChanges({EuiccManager.SHOULD_RESOLVE_PORT_INDEX_FOR_APPS}) public void testDownloadSubscription_noPrivileges_getMetadata_serviceUnavailable_canManageSim() throws Exception { setHasWriteEmbeddedPermission(false); Loading @@ -510,6 +518,7 @@ public class EuiccControllerTest extends TelephonyTest { } @Test @DisableCompatChanges({EuiccManager.SHOULD_RESOLVE_PORT_INDEX_FOR_APPS}) public void testDownloadSubscription_noPrivileges_getMetadata_error() throws Exception { setHasWriteEmbeddedPermission(false); Loading @@ -526,6 +535,7 @@ public class EuiccControllerTest extends TelephonyTest { } @Test @DisableCompatChanges({EuiccManager.SHOULD_RESOLVE_PORT_INDEX_FOR_APPS}) public void testDownloadSubscription_noPrivileges_getMetadata_error_canManageSim() throws Exception { setHasWriteEmbeddedPermission(false); Loading @@ -543,6 +553,7 @@ public class EuiccControllerTest extends TelephonyTest { } @Test @DisableCompatChanges({EuiccManager.SHOULD_RESOLVE_PORT_INDEX_FOR_APPS}) public void testDownloadSubscription_noPrivileges_getMetadata_mustDeactivateSim() throws Exception { setHasWriteEmbeddedPermission(false); Loading @@ -562,6 +573,7 @@ public class EuiccControllerTest extends TelephonyTest { } @Test @DisableCompatChanges({EuiccManager.SHOULD_RESOLVE_PORT_INDEX_FOR_APPS}) public void testDownloadSubscription_noPrivileges_getMetadata_mustDeactivateSim_canManageSim() throws Exception { setHasWriteEmbeddedPermission(false); Loading @@ -582,6 +594,7 @@ public class EuiccControllerTest extends TelephonyTest { } @Test @DisableCompatChanges({EuiccManager.SHOULD_RESOLVE_PORT_INDEX_FOR_APPS}) public void testDownloadSubscription_noPrivileges_hasCarrierPrivileges() throws Exception { setHasWriteEmbeddedPermission(false); setUpUiccSlotData(); Loading @@ -599,6 +612,7 @@ public class EuiccControllerTest extends TelephonyTest { } @Test @DisableCompatChanges({EuiccManager.SHOULD_RESOLVE_PORT_INDEX_FOR_APPS}) public void testDownloadSubscription_noPrivileges_hasCarrierPrivileges_multiSim() throws Exception { setHasWriteEmbeddedPermission(false); Loading @@ -617,6 +631,7 @@ public class EuiccControllerTest extends TelephonyTest { } @Test @DisableCompatChanges({EuiccManager.SHOULD_RESOLVE_PORT_INDEX_FOR_APPS}) public void testDownloadSubscription_noPrivileges_hasCarrierPrivileges_needsConsent() throws Exception { setHasWriteEmbeddedPermission(false); Loading @@ -638,6 +653,7 @@ public class EuiccControllerTest extends TelephonyTest { } @Test @DisableCompatChanges({EuiccManager.SHOULD_RESOLVE_PORT_INDEX_FOR_APPS}) public void testDownloadSubscription_noPrivileges_hasCarrierPrivileges_needsConsent_multiSim() throws Exception { setHasWriteEmbeddedPermission(false); Loading @@ -659,6 +675,7 @@ public class EuiccControllerTest extends TelephonyTest { } @Test @DisableCompatChanges({EuiccManager.SHOULD_RESOLVE_PORT_INDEX_FOR_APPS}) public void testDownloadSubscription_noPriv_hasCarrierPrivi_needsConsent_multiSim_targetPsim() throws Exception { setHasWriteEmbeddedPermission(false); Loading @@ -680,6 +697,7 @@ public class EuiccControllerTest extends TelephonyTest { } @Test @DisableCompatChanges({EuiccManager.SHOULD_RESOLVE_PORT_INDEX_FOR_APPS}) public void testDownloadSubscription_noPrivileges_noCarrierPrivileges() throws Exception { setHasWriteEmbeddedPermission(false); setUpUiccSlotData(); Loading @@ -701,6 +719,7 @@ public class EuiccControllerTest extends TelephonyTest { } @Test @DisableCompatChanges({EuiccManager.SHOULD_RESOLVE_PORT_INDEX_FOR_APPS}) public void testDownloadSubscription_noPrivileges_noCarrierPrivileges_canManagerTargetSim() throws Exception { setHasWriteEmbeddedPermission(false); Loading Loading @@ -790,6 +809,7 @@ public class EuiccControllerTest extends TelephonyTest { } @Test @DisableCompatChanges({EuiccManager.SHOULD_RESOLVE_PORT_INDEX_FOR_APPS}) public void testSwitchToSubscription_noSuchSubscription() throws Exception { setHasWriteEmbeddedPermission(true); callSwitchToSubscription( Loading @@ -802,6 +822,7 @@ public class EuiccControllerTest extends TelephonyTest { } @Test @DisableCompatChanges({EuiccManager.SHOULD_RESOLVE_PORT_INDEX_FOR_APPS}) public void testSwitchToSubscription_emptySubscription_noPrivileges() throws Exception { setHasWriteEmbeddedPermission(false); callSwitchToSubscription( Loading @@ -814,6 +835,7 @@ public class EuiccControllerTest extends TelephonyTest { } @Test @DisableCompatChanges({EuiccManager.SHOULD_RESOLVE_PORT_INDEX_FOR_APPS}) public void testSwitchToSubscription_serviceUnavailable() throws Exception { setHasWriteEmbeddedPermission(true); prepareOperationSubscription(false /* hasPrivileges */); Loading @@ -828,6 +850,7 @@ public class EuiccControllerTest extends TelephonyTest { } @Test @DisableCompatChanges({EuiccManager.SHOULD_RESOLVE_PORT_INDEX_FOR_APPS}) public void testSwitchToSubscription_error() throws Exception { setHasWriteEmbeddedPermission(true); prepareOperationSubscription(false /* hasPrivileges */); Loading @@ -840,6 +863,7 @@ public class EuiccControllerTest extends TelephonyTest { } @Test @DisableCompatChanges({EuiccManager.SHOULD_RESOLVE_PORT_INDEX_FOR_APPS}) public void testSwitchToSubscription_success() throws Exception { setHasWriteEmbeddedPermission(true); prepareOperationSubscription(false /* hasPrivileges */); Loading @@ -851,6 +875,7 @@ public class EuiccControllerTest extends TelephonyTest { } @Test @DisableCompatChanges({EuiccManager.SHOULD_RESOLVE_PORT_INDEX_FOR_APPS}) public void testSwitchToSubscription_emptySubscription_noActiveSubscription() throws Exception { setHasWriteEmbeddedPermission(true); callSwitchToSubscription( Loading @@ -863,6 +888,7 @@ public class EuiccControllerTest extends TelephonyTest { } @Test @DisableCompatChanges({EuiccManager.SHOULD_RESOLVE_PORT_INDEX_FOR_APPS}) public void testSwitchToSubscription_emptySubscription_success() throws Exception { setHasWriteEmbeddedPermission(true); setHasCarrierPrivilegesOnActiveSubscription(false); Loading @@ -873,6 +899,7 @@ public class EuiccControllerTest extends TelephonyTest { } @Test @DisableCompatChanges({EuiccManager.SHOULD_RESOLVE_PORT_INDEX_FOR_APPS}) public void testSwitchToSubscription_noPrivileges() throws Exception { setHasWriteEmbeddedPermission(false); prepareOperationSubscription(false /* hasPrivileges */); Loading @@ -886,6 +913,7 @@ public class EuiccControllerTest extends TelephonyTest { } @Test @DisableCompatChanges({EuiccManager.SHOULD_RESOLVE_PORT_INDEX_FOR_APPS}) public void testSwitchToSubscription_hasCarrierPrivileges() throws Exception { setHasWriteEmbeddedPermission(false); prepareOperationSubscription(true /* hasPrivileges */); Loading @@ -898,6 +926,7 @@ public class EuiccControllerTest extends TelephonyTest { } @Test @DisableCompatChanges({EuiccManager.SHOULD_RESOLVE_PORT_INDEX_FOR_APPS}) public void testSwitchToSubscription_hasCarrierPrivileges_multiSim() throws Exception { setHasWriteEmbeddedPermission(false); prepareOperationSubscription(true /* hasPrivileges */); Loading @@ -910,6 +939,7 @@ public class EuiccControllerTest extends TelephonyTest { } @Test @DisableCompatChanges({EuiccManager.SHOULD_RESOLVE_PORT_INDEX_FOR_APPS}) public void testSwitchToSubscription_hasCarrierPrivileges_needsConsent() throws Exception { setHasWriteEmbeddedPermission(false); prepareOperationSubscription(true /* hasPrivileges */); Loading @@ -927,6 +957,7 @@ public class EuiccControllerTest extends TelephonyTest { } @Test @DisableCompatChanges({EuiccManager.SHOULD_RESOLVE_PORT_INDEX_FOR_APPS}) public void testSwitchToSubscription_hasCarrierPrivileges_needsConsent_multiSim() throws Exception { setHasWriteEmbeddedPermission(false); Loading @@ -945,6 +976,7 @@ public class EuiccControllerTest extends TelephonyTest { } @Test @DisableCompatChanges({EuiccManager.SHOULD_RESOLVE_PORT_INDEX_FOR_APPS}) public void testSwitchToSubscription_hasCarrierPrivileges_needsConsent_multiSim_targetPsim() throws Exception { setHasWriteEmbeddedPermission(false); Loading