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

Commit 1e99f0ce authored by Christopher Tate's avatar Christopher Tate Committed by Chris Tate
Browse files

Properly target the factory-reset broadcasts

Bug 34587823
Test: attempt factory reset from UI

Change-Id: I4ba65f4b7e07792b37e7587008ad0ab1bc6c1fb0
parent 37326a60
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -210,6 +210,7 @@ public class CryptKeeper extends Activity implements TextView.OnEditorActionList
            } else if (failedAttempts == MAX_FAILED_ATTEMPTS) {
                // Factory reset the device.
                Intent intent = new Intent(Intent.ACTION_MASTER_CLEAR);
                intent.setPackage("android");
                intent.addFlags(Intent.FLAG_RECEIVER_FOREGROUND);
                intent.putExtra(Intent.EXTRA_REASON, "CryptKeeper.MAX_FAILED_ATTEMPTS");
                sendBroadcast(intent);
@@ -612,6 +613,7 @@ public class CryptKeeper extends Activity implements TextView.OnEditorActionList
            public void onClick(View v) {
                // Factory reset the device.
                Intent intent = new Intent(Intent.ACTION_MASTER_CLEAR);
                intent.setPackage("android");
                intent.addFlags(Intent.FLAG_RECEIVER_FOREGROUND);
                intent.putExtra(Intent.EXTRA_REASON,
                        "CryptKeeper.showFactoryReset() corrupt=" + corrupt);
+1 −0
Original line number Diff line number Diff line
@@ -121,6 +121,7 @@ public class MasterClearConfirm extends OptionsMenuFragment {

    private void doMasterClear() {
        Intent intent = new Intent(Intent.ACTION_MASTER_CLEAR);
        intent.setPackage("android");
        intent.addFlags(Intent.FLAG_RECEIVER_FOREGROUND);
        intent.putExtra(Intent.EXTRA_REASON, "MasterClearConfirm");
        intent.putExtra(Intent.EXTRA_WIPE_EXTERNAL_STORAGE, mEraseSdCard);