Loading src/java/com/android/internal/telephony/euicc/EuiccConnector.java +6 −4 Original line number Diff line number Diff line Loading @@ -253,7 +253,8 @@ public class EuiccConnector extends StateMachine implements ServiceConnection { @VisibleForTesting(visibility = PACKAGE) public interface GetDefaultListCommandCallback extends BaseEuiccCommandCallback { /** Called when the list has completed (though it may have failed). */ void onGetDefaultListComplete(GetDefaultDownloadableSubscriptionListResult result); void onGetDefaultListComplete(int cardId, GetDefaultDownloadableSubscriptionListResult result); } /** Callback class for {@link #getEuiccInfo}. */ Loading Loading @@ -674,7 +675,8 @@ public class EuiccConnector extends StateMachine implements ServiceConnection { } else if (isEuiccCommand(message.what)) { final BaseEuiccCommandCallback callback = getCallback(message); onCommandStart(callback); final int slotId = getSlotIdFromCardId(message.arg1); final int cardId = message.arg1; final int slotId = getSlotIdFromCardId(cardId); try { switch (message.what) { case CMD_GET_EID: { Loading Loading @@ -702,7 +704,7 @@ public class EuiccConnector extends StateMachine implements ServiceConnection { GetDownloadableSubscriptionMetadataResult result) { sendMessage(CMD_COMMAND_COMPLETE, (Runnable) () -> { ((GetMetadataCommandCallback) callback) .onGetMetadataComplete(slotId, result); .onGetMetadataComplete(cardId, result); onCommandEnd(callback); }); } Loading Loading @@ -754,7 +756,7 @@ public class EuiccConnector extends StateMachine implements ServiceConnection { ) { sendMessage(CMD_COMMAND_COMPLETE, (Runnable) () -> { ((GetDefaultListCommandCallback) callback) .onGetDefaultListComplete(result); .onGetDefaultListComplete(cardId, result); onCommandEnd(callback); }); } Loading src/java/com/android/internal/telephony/euicc/EuiccController.java +22 −12 Original line number Diff line number Diff line Loading @@ -291,7 +291,8 @@ public class EuiccController extends IEuiccController.Stub { mCallingPackage, 0 /* resolvableErrors */, false /* confirmationCodeRetried */, getOperationForDeactivateSim()); getOperationForDeactivateSim(), cardId); break; default: resultCode = ERROR; Loading Loading @@ -376,7 +377,8 @@ public class EuiccController extends IEuiccController.Stub { false /* confirmationCodeRetried */, EuiccOperation.forDownloadNoPrivileges( mCallingToken, mSubscription, mSwitchAfterDownload, mCallingPackage)); mCallingPackage), cardId); sendResult(mCallbackIntent, RESOLVABLE_ERROR, extrasIntent); return; } Loading Loading @@ -431,7 +433,8 @@ public class EuiccController extends IEuiccController.Stub { false /* confirmationCodeRetried */, EuiccOperation.forDownloadNoPrivileges( mCallingToken, subscription, mSwitchAfterDownload, mCallingPackage)); mCallingPackage), cardId); sendResult(mCallbackIntent, RESOLVABLE_ERROR, extrasIntent); return; } Loading Loading @@ -491,7 +494,8 @@ public class EuiccController extends IEuiccController.Stub { false /* confirmationCodeRetried */, EuiccOperation.forDownloadDeactivateSim( callingToken, subscription, switchAfterDownload, callingPackage)); callingPackage), cardId); break; case EuiccService.RESULT_RESOLVABLE_ERRORS: // Same value as the deprecated Loading @@ -511,7 +515,8 @@ public class EuiccController extends IEuiccController.Stub { retried, EuiccOperation.forDownloadResolvableErrors( callingToken, subscription, switchAfterDownload, callingPackage, result.getResolvableErrors())); callingPackage, result.getResolvableErrors()), cardId); } else { // Deprecated case addResolutionIntent(extrasIntent, EuiccService.ACTION_RESOLVE_CONFIRMATION_CODE, Loading @@ -520,7 +525,8 @@ public class EuiccController extends IEuiccController.Stub { retried /* confirmationCodeRetried */, EuiccOperation.forDownloadConfirmationCode( callingToken, subscription, switchAfterDownload, callingPackage)); callingPackage), cardId); } break; default: Loading Loading @@ -610,7 +616,8 @@ public class EuiccController extends IEuiccController.Stub { } @Override public void onGetDefaultListComplete(GetDefaultDownloadableSubscriptionListResult result) { public void onGetDefaultListComplete(int cardId, GetDefaultDownloadableSubscriptionListResult result) { Intent extrasIntent = new Intent(); final int resultCode; switch (result.getResult()) { Loading @@ -631,7 +638,8 @@ public class EuiccController extends IEuiccController.Stub { 0 /* resolvableErrors */, false /* confirmationCodeRetried */, EuiccOperation.forGetDefaultListDeactivateSim( mCallingToken, mCallingPackage)); mCallingToken, mCallingPackage), cardId); break; default: resultCode = ERROR; Loading Loading @@ -786,7 +794,8 @@ public class EuiccController extends IEuiccController.Stub { 0 /* resolvableErrors */, false /* confirmationCodeRetried */, EuiccOperation.forSwitchNoPrivileges( token, subscriptionId, callingPackage)); token, subscriptionId, callingPackage), cardId); sendResult(callbackIntent, RESOLVABLE_ERROR, extrasIntent); return; } Loading Loading @@ -834,7 +843,8 @@ public class EuiccController extends IEuiccController.Stub { 0 /* resolvableErrors */, false /* confirmationCodeRetried */, EuiccOperation.forSwitchDeactivateSim( callingToken, subscriptionId, callingPackage)); callingToken, subscriptionId, callingPackage), cardId); break; default: resultCode = ERROR; Loading Loading @@ -1010,13 +1020,13 @@ public class EuiccController extends IEuiccController.Stub { @VisibleForTesting(visibility = VisibleForTesting.Visibility.PRIVATE) public void addResolutionIntent(Intent extrasIntent, String resolutionAction, String callingPackage, int resolvableErrors, boolean confirmationCodeRetried, EuiccOperation op) { EuiccOperation op, int cardId) { Intent intent = new Intent(EuiccManager.ACTION_RESOLVE_ERROR); intent.putExtra(EuiccManager.EXTRA_EMBEDDED_SUBSCRIPTION_RESOLUTION_ACTION, resolutionAction); intent.putExtra(EuiccService.EXTRA_RESOLUTION_CALLING_PACKAGE, callingPackage); // TODO(jiuyu): Also pass cardId in the intent. intent.putExtra(EuiccService.EXTRA_RESOLVABLE_ERRORS, resolvableErrors); intent.putExtra(EuiccService.EXTRA_RESOLUTION_CARD_ID, cardId); intent.putExtra(EuiccService.EXTRA_RESOLUTION_CONFIRMATION_CODE_RETRIED, confirmationCodeRetried); intent.putExtra(EXTRA_OPERATION, op); Loading tests/telephonytests/src/com/android/internal/telephony/euicc/EuiccControllerTest.java +3 −2 Original line number Diff line number Diff line Loading @@ -142,7 +142,8 @@ public class EuiccControllerTest extends TelephonyTest { @Override public void addResolutionIntent( Intent extrasIntent, String resolutionAction, String callingPackage, int resolvableErrors, boolean confirmationCodeRetried, EuiccOperation op) { int resolvableErrors, boolean confirmationCodeRetried, EuiccOperation op, int cardId) { mResolutionAction = resolutionAction; mOp = op; } Loading Loading @@ -984,7 +985,7 @@ public class EuiccControllerTest extends TelephonyTest { EuiccConnector.GetDefaultListCommandCallback cb = invocation .getArgument(2 /* resultCallBack */); if (complete) { cb.onGetDefaultListComplete(result); cb.onGetDefaultListComplete(CARD_ID, result); } else { cb.onEuiccServiceUnavailable(); } Loading Loading
src/java/com/android/internal/telephony/euicc/EuiccConnector.java +6 −4 Original line number Diff line number Diff line Loading @@ -253,7 +253,8 @@ public class EuiccConnector extends StateMachine implements ServiceConnection { @VisibleForTesting(visibility = PACKAGE) public interface GetDefaultListCommandCallback extends BaseEuiccCommandCallback { /** Called when the list has completed (though it may have failed). */ void onGetDefaultListComplete(GetDefaultDownloadableSubscriptionListResult result); void onGetDefaultListComplete(int cardId, GetDefaultDownloadableSubscriptionListResult result); } /** Callback class for {@link #getEuiccInfo}. */ Loading Loading @@ -674,7 +675,8 @@ public class EuiccConnector extends StateMachine implements ServiceConnection { } else if (isEuiccCommand(message.what)) { final BaseEuiccCommandCallback callback = getCallback(message); onCommandStart(callback); final int slotId = getSlotIdFromCardId(message.arg1); final int cardId = message.arg1; final int slotId = getSlotIdFromCardId(cardId); try { switch (message.what) { case CMD_GET_EID: { Loading Loading @@ -702,7 +704,7 @@ public class EuiccConnector extends StateMachine implements ServiceConnection { GetDownloadableSubscriptionMetadataResult result) { sendMessage(CMD_COMMAND_COMPLETE, (Runnable) () -> { ((GetMetadataCommandCallback) callback) .onGetMetadataComplete(slotId, result); .onGetMetadataComplete(cardId, result); onCommandEnd(callback); }); } Loading Loading @@ -754,7 +756,7 @@ public class EuiccConnector extends StateMachine implements ServiceConnection { ) { sendMessage(CMD_COMMAND_COMPLETE, (Runnable) () -> { ((GetDefaultListCommandCallback) callback) .onGetDefaultListComplete(result); .onGetDefaultListComplete(cardId, result); onCommandEnd(callback); }); } Loading
src/java/com/android/internal/telephony/euicc/EuiccController.java +22 −12 Original line number Diff line number Diff line Loading @@ -291,7 +291,8 @@ public class EuiccController extends IEuiccController.Stub { mCallingPackage, 0 /* resolvableErrors */, false /* confirmationCodeRetried */, getOperationForDeactivateSim()); getOperationForDeactivateSim(), cardId); break; default: resultCode = ERROR; Loading Loading @@ -376,7 +377,8 @@ public class EuiccController extends IEuiccController.Stub { false /* confirmationCodeRetried */, EuiccOperation.forDownloadNoPrivileges( mCallingToken, mSubscription, mSwitchAfterDownload, mCallingPackage)); mCallingPackage), cardId); sendResult(mCallbackIntent, RESOLVABLE_ERROR, extrasIntent); return; } Loading Loading @@ -431,7 +433,8 @@ public class EuiccController extends IEuiccController.Stub { false /* confirmationCodeRetried */, EuiccOperation.forDownloadNoPrivileges( mCallingToken, subscription, mSwitchAfterDownload, mCallingPackage)); mCallingPackage), cardId); sendResult(mCallbackIntent, RESOLVABLE_ERROR, extrasIntent); return; } Loading Loading @@ -491,7 +494,8 @@ public class EuiccController extends IEuiccController.Stub { false /* confirmationCodeRetried */, EuiccOperation.forDownloadDeactivateSim( callingToken, subscription, switchAfterDownload, callingPackage)); callingPackage), cardId); break; case EuiccService.RESULT_RESOLVABLE_ERRORS: // Same value as the deprecated Loading @@ -511,7 +515,8 @@ public class EuiccController extends IEuiccController.Stub { retried, EuiccOperation.forDownloadResolvableErrors( callingToken, subscription, switchAfterDownload, callingPackage, result.getResolvableErrors())); callingPackage, result.getResolvableErrors()), cardId); } else { // Deprecated case addResolutionIntent(extrasIntent, EuiccService.ACTION_RESOLVE_CONFIRMATION_CODE, Loading @@ -520,7 +525,8 @@ public class EuiccController extends IEuiccController.Stub { retried /* confirmationCodeRetried */, EuiccOperation.forDownloadConfirmationCode( callingToken, subscription, switchAfterDownload, callingPackage)); callingPackage), cardId); } break; default: Loading Loading @@ -610,7 +616,8 @@ public class EuiccController extends IEuiccController.Stub { } @Override public void onGetDefaultListComplete(GetDefaultDownloadableSubscriptionListResult result) { public void onGetDefaultListComplete(int cardId, GetDefaultDownloadableSubscriptionListResult result) { Intent extrasIntent = new Intent(); final int resultCode; switch (result.getResult()) { Loading @@ -631,7 +638,8 @@ public class EuiccController extends IEuiccController.Stub { 0 /* resolvableErrors */, false /* confirmationCodeRetried */, EuiccOperation.forGetDefaultListDeactivateSim( mCallingToken, mCallingPackage)); mCallingToken, mCallingPackage), cardId); break; default: resultCode = ERROR; Loading Loading @@ -786,7 +794,8 @@ public class EuiccController extends IEuiccController.Stub { 0 /* resolvableErrors */, false /* confirmationCodeRetried */, EuiccOperation.forSwitchNoPrivileges( token, subscriptionId, callingPackage)); token, subscriptionId, callingPackage), cardId); sendResult(callbackIntent, RESOLVABLE_ERROR, extrasIntent); return; } Loading Loading @@ -834,7 +843,8 @@ public class EuiccController extends IEuiccController.Stub { 0 /* resolvableErrors */, false /* confirmationCodeRetried */, EuiccOperation.forSwitchDeactivateSim( callingToken, subscriptionId, callingPackage)); callingToken, subscriptionId, callingPackage), cardId); break; default: resultCode = ERROR; Loading Loading @@ -1010,13 +1020,13 @@ public class EuiccController extends IEuiccController.Stub { @VisibleForTesting(visibility = VisibleForTesting.Visibility.PRIVATE) public void addResolutionIntent(Intent extrasIntent, String resolutionAction, String callingPackage, int resolvableErrors, boolean confirmationCodeRetried, EuiccOperation op) { EuiccOperation op, int cardId) { Intent intent = new Intent(EuiccManager.ACTION_RESOLVE_ERROR); intent.putExtra(EuiccManager.EXTRA_EMBEDDED_SUBSCRIPTION_RESOLUTION_ACTION, resolutionAction); intent.putExtra(EuiccService.EXTRA_RESOLUTION_CALLING_PACKAGE, callingPackage); // TODO(jiuyu): Also pass cardId in the intent. intent.putExtra(EuiccService.EXTRA_RESOLVABLE_ERRORS, resolvableErrors); intent.putExtra(EuiccService.EXTRA_RESOLUTION_CARD_ID, cardId); intent.putExtra(EuiccService.EXTRA_RESOLUTION_CONFIRMATION_CODE_RETRIED, confirmationCodeRetried); intent.putExtra(EXTRA_OPERATION, op); Loading
tests/telephonytests/src/com/android/internal/telephony/euicc/EuiccControllerTest.java +3 −2 Original line number Diff line number Diff line Loading @@ -142,7 +142,8 @@ public class EuiccControllerTest extends TelephonyTest { @Override public void addResolutionIntent( Intent extrasIntent, String resolutionAction, String callingPackage, int resolvableErrors, boolean confirmationCodeRetried, EuiccOperation op) { int resolvableErrors, boolean confirmationCodeRetried, EuiccOperation op, int cardId) { mResolutionAction = resolutionAction; mOp = op; } Loading Loading @@ -984,7 +985,7 @@ public class EuiccControllerTest extends TelephonyTest { EuiccConnector.GetDefaultListCommandCallback cb = invocation .getArgument(2 /* resultCallBack */); if (complete) { cb.onGetDefaultListComplete(result); cb.onGetDefaultListComplete(CARD_ID, result); } else { cb.onEuiccServiceUnavailable(); } Loading