From 75c84499bde3e8e0555cd9fda1cde5d758a8b8d4 Mon Sep 17 00:00:00 2001 From: Scott Mertz Date: Mon, 25 Jul 2016 11:13:15 -0700 Subject: Factory reset: Wipe media by default These hidden APIs are called from some public APIs (DevicePolicyManager), so we shouldn't change the default behavior. The intent API should also be considered public, so change that as well. FEIJ-1610 Change-Id: Ib9591c122dbe6168e7e237444c754b9608be0953 --- core/java/android/os/RecoverySystem.java | 6 +++--- services/core/java/com/android/server/MasterClearReceiver.java | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/core/java/android/os/RecoverySystem.java b/core/java/android/os/RecoverySystem.java index a10b1ec..d277e65 100644 --- a/core/java/android/os/RecoverySystem.java +++ b/core/java/android/os/RecoverySystem.java @@ -377,18 +377,18 @@ public class RecoverySystem { * @throws SecurityException if the current user is not allowed to wipe data. */ public static void rebootWipeUserData(Context context) throws IOException { - rebootWipeUserData(context, false, context.getPackageName(), false); + rebootWipeUserData(context, false, context.getPackageName(), true); } /** {@hide} */ public static void rebootWipeUserData(Context context, String reason) throws IOException { - rebootWipeUserData(context, false, reason, false); + rebootWipeUserData(context, false, reason, true); } /** {@hide} */ public static void rebootWipeUserData(Context context, boolean shutdown) throws IOException { - rebootWipeUserData(context, shutdown, context.getPackageName(), false); + rebootWipeUserData(context, shutdown, context.getPackageName(), true); } /** diff --git a/services/core/java/com/android/server/MasterClearReceiver.java b/services/core/java/com/android/server/MasterClearReceiver.java index 23556c0..3fa02ba 100644 --- a/services/core/java/com/android/server/MasterClearReceiver.java +++ b/services/core/java/com/android/server/MasterClearReceiver.java @@ -57,7 +57,7 @@ public class MasterClearReceiver extends BroadcastReceiver { @Override public void run() { try { - boolean wipeMedia = intent.getBooleanExtra(EXTRA_WIPE_MEDIA, false); + boolean wipeMedia = intent.getBooleanExtra(EXTRA_WIPE_MEDIA, true); RecoverySystem.rebootWipeUserData(context, shutdown, reason, wipeMedia); Log.wtf(TAG, "Still running after master clear?!"); } catch (IOException e) { -- cgit v1.1