summaryrefslogtreecommitdiff
path: root/core/java/android
diff options
context:
space:
mode:
authorTreeHugger Robot <treehugger-gerrit@google.com>2018-01-23 03:41:43 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2018-01-23 03:41:43 +0000
commiteb6ae9e43eaa568388c3be47ac95aa91b9b928eb (patch)
tree2432ed004ea3ffa70db2cfea49185dfb69660896 /core/java/android
parent3bc6f794e6d83c45e1be76f141e7bd58b8ffabab (diff)
parentf4577a5c5c647a240e748871dcfacb91378e9faa (diff)
Merge "Remove all the implementation for keep eSIM profile during FDR"
Diffstat (limited to 'core/java/android')
-rw-r--r--core/java/android/os/RecoverySystem.java41
1 files changed, 10 insertions, 31 deletions
diff --git a/core/java/android/os/RecoverySystem.java b/core/java/android/os/RecoverySystem.java
index 57db9d19f42d..3e8e8854634d 100644
--- a/core/java/android/os/RecoverySystem.java
+++ b/core/java/android/os/RecoverySystem.java
@@ -755,7 +755,9 @@ public class RecoverySystem {
// Block until the ordered broadcast has completed.
condition.block();
- wipeEuiccData(context, wipeEuicc, PACKAGE_NAME_WIPING_EUICC_DATA_CALLBACK);
+ if (wipeEuicc) {
+ wipeEuiccData(context, PACKAGE_NAME_WIPING_EUICC_DATA_CALLBACK);
+ }
String shutdownArg = null;
if (shutdown) {
@@ -774,13 +776,11 @@ public class RecoverySystem {
/**
* Returns whether wipe Euicc data successfully or not.
*
- * @param isWipeEuicc whether we want to wipe Euicc data or not
* @param packageName the package name of the caller app.
*
* @hide
*/
- public static boolean wipeEuiccData(
- Context context, final boolean isWipeEuicc, final String packageName) {
+ public static boolean wipeEuiccData(Context context, final String packageName) {
ContentResolver cr = context.getContentResolver();
if (Settings.Global.getInt(cr, Settings.Global.EUICC_PROVISIONED, 0) == 0) {
// If the eUICC isn't provisioned, there's no reason to either wipe or retain profiles,
@@ -802,19 +802,10 @@ public class RecoverySystem {
if (getResultCode() != EuiccManager.EMBEDDED_SUBSCRIPTION_RESULT_OK) {
int detailedCode = intent.getIntExtra(
EuiccManager.EXTRA_EMBEDDED_SUBSCRIPTION_DETAILED_CODE, 0);
- if (isWipeEuicc) {
- Log.e(TAG, "Error wiping euicc data, Detailed code = "
- + detailedCode);
- } else {
- Log.e(TAG, "Error retaining euicc data, Detailed code = "
- + detailedCode);
- }
+ Log.e(TAG, "Error wiping euicc data, Detailed code = "
+ + detailedCode);
} else {
- if (isWipeEuicc) {
- Log.d(TAG, "Successfully wiped euicc data.");
- } else {
- Log.d(TAG, "Successfully retained euicc data.");
- }
+ Log.d(TAG, "Successfully wiped euicc data.");
wipingSucceeded.set(true /* newValue */);
}
euiccFactoryResetLatch.countDown();
@@ -833,11 +824,7 @@ public class RecoverySystem {
Handler euiccHandler = new Handler(euiccHandlerThread.getLooper());
context.getApplicationContext()
.registerReceiver(euiccWipeFinishReceiver, filterConsent, null, euiccHandler);
- if (isWipeEuicc) {
- euiccManager.eraseSubscriptions(callbackIntent);
- } else {
- euiccManager.retainSubscriptionsForFactoryReset(callbackIntent);
- }
+ euiccManager.eraseSubscriptions(callbackIntent);
try {
long waitingTimeMillis = Settings.Global.getLong(
context.getContentResolver(),
@@ -849,20 +836,12 @@ public class RecoverySystem {
waitingTimeMillis = MAX_EUICC_FACTORY_RESET_TIMEOUT_MILLIS;
}
if (!euiccFactoryResetLatch.await(waitingTimeMillis, TimeUnit.MILLISECONDS)) {
- if (isWipeEuicc) {
- Log.e(TAG, "Timeout wiping eUICC data.");
- } else {
- Log.e(TAG, "Timeout retaining eUICC data.");
- }
+ Log.e(TAG, "Timeout wiping eUICC data.");
return false;
}
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
- if (isWipeEuicc) {
- Log.e(TAG, "Wiping eUICC data interrupted", e);
- } else {
- Log.e(TAG, "Retaining eUICC data interrupted", e);
- }
+ Log.e(TAG, "Wiping eUICC data interrupted", e);
return false;
} finally {
context.getApplicationContext().unregisterReceiver(euiccWipeFinishReceiver);