Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 75c84499 authored by Scott Mertz's avatar Scott Mertz
Browse files

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
parent 5d7b76ed
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -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);
    }

   /**
+1 −1
Original line number Diff line number Diff line
@@ -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) {