Properly target the factory-reset broadcasts
Bug 34587823 Test: attempt factory reset from UI Change-Id: I4ba65f4b7e07792b37e7587008ad0ab1bc6c1fb0
This commit is contained in:
committed by
Chris Tate
parent
37326a6023
commit
1e99f0ce41
@@ -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);
|
||||
|
@@ -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);
|
||||
|
Reference in New Issue
Block a user