Merge "Fix the error that the broadcast receiver cannot be registered" into oc-dr1-dev

This commit is contained in:
Qingxi Li
2017-07-13 19:02:24 +00:00
committed by Android (Google) Code Review

View File

@@ -808,7 +808,8 @@ public class RecoverySystem {
HandlerThread euiccHandlerThread = new HandlerThread("euiccWipeFinishReceiverThread"); HandlerThread euiccHandlerThread = new HandlerThread("euiccWipeFinishReceiverThread");
euiccHandlerThread.start(); euiccHandlerThread.start();
Handler euiccHandler = new Handler(euiccHandlerThread.getLooper()); Handler euiccHandler = new Handler(euiccHandlerThread.getLooper());
context.registerReceiver(euiccWipeFinishReceiver, filterConsent, null, euiccHandler); context.getApplicationContext()
.registerReceiver(euiccWipeFinishReceiver, filterConsent, null, euiccHandler);
if (isWipeEuicc) { if (isWipeEuicc) {
euiccManager.eraseSubscriptions(callbackIntent); euiccManager.eraseSubscriptions(callbackIntent);
} else { } else {
@@ -831,7 +832,7 @@ public class RecoverySystem {
Log.e(TAG, "Timeout retaining eUICC data."); Log.e(TAG, "Timeout retaining eUICC data.");
} }
} }
context.unregisterReceiver(euiccWipeFinishReceiver); context.getApplicationContext().unregisterReceiver(euiccWipeFinishReceiver);
} catch (InterruptedException e) { } catch (InterruptedException e) {
Thread.currentThread().interrupt(); Thread.currentThread().interrupt();
if (isWipeEuicc) { if (isWipeEuicc) {