Add the immutable flag to EuiccManager calls in RecoverySystem

Bug: 170432460
Test: refactoring CL. Existing unit tests still pass
Change-Id: Ibce939eec341cb9f572d13a33762cc5bc6e2ef42
This commit is contained in:
Jiashen Wang
2020-10-26 16:39:57 -07:00
parent f339931699
commit a24192a749

View File

@@ -908,7 +908,11 @@ public class RecoverySystem {
Intent intent = new Intent(ACTION_EUICC_FACTORY_RESET); Intent intent = new Intent(ACTION_EUICC_FACTORY_RESET);
intent.setPackage(packageName); intent.setPackage(packageName);
PendingIntent callbackIntent = PendingIntent.getBroadcastAsUser( PendingIntent callbackIntent = PendingIntent.getBroadcastAsUser(
context, 0, intent, PendingIntent.FLAG_UPDATE_CURRENT, UserHandle.SYSTEM); context,
0,
intent,
PendingIntent.FLAG_IMMUTABLE | PendingIntent.FLAG_UPDATE_CURRENT,
UserHandle.SYSTEM);
IntentFilter filterConsent = new IntentFilter(); IntentFilter filterConsent = new IntentFilter();
filterConsent.addAction(ACTION_EUICC_FACTORY_RESET); filterConsent.addAction(ACTION_EUICC_FACTORY_RESET);
HandlerThread euiccHandlerThread = new HandlerThread("euiccWipeFinishReceiverThread"); HandlerThread euiccHandlerThread = new HandlerThread("euiccWipeFinishReceiverThread");
@@ -1002,7 +1006,11 @@ public class RecoverySystem {
Intent intent = new Intent(ACTION_EUICC_REMOVE_INVISIBLE_SUBSCRIPTIONS); Intent intent = new Intent(ACTION_EUICC_REMOVE_INVISIBLE_SUBSCRIPTIONS);
intent.setPackage(PACKAGE_NAME_EUICC_DATA_MANAGEMENT_CALLBACK); intent.setPackage(PACKAGE_NAME_EUICC_DATA_MANAGEMENT_CALLBACK);
PendingIntent callbackIntent = PendingIntent.getBroadcastAsUser( PendingIntent callbackIntent = PendingIntent.getBroadcastAsUser(
context, 0, intent, PendingIntent.FLAG_UPDATE_CURRENT, UserHandle.SYSTEM); context,
0,
intent,
PendingIntent.FLAG_IMMUTABLE | PendingIntent.FLAG_UPDATE_CURRENT,
UserHandle.SYSTEM);
IntentFilter intentFilter = new IntentFilter(); IntentFilter intentFilter = new IntentFilter();
intentFilter.addAction(ACTION_EUICC_REMOVE_INVISIBLE_SUBSCRIPTIONS); intentFilter.addAction(ACTION_EUICC_REMOVE_INVISIBLE_SUBSCRIPTIONS);
HandlerThread euiccHandlerThread = HandlerThread euiccHandlerThread =