diff options
| author | Jeff Sharkey <jsharkey@android.com> | 2014-09-24 13:57:07 -0700 |
|---|---|---|
| committer | Jeff Sharkey <jsharkey@android.com> | 2014-09-24 14:08:05 -0700 |
| commit | 1de688d911cf96eff39eddc5a7070e3c44efefc1 (patch) | |
| tree | 603ebeb7c21b11e2e2e856c62d61e87db989855a /src/com/android/settings/CryptKeeper.java | |
| parent | a1c6a0c895f6d580bebfb714c7930f5ec015770d (diff) | |
| download | packages_apps_Settings-1de688d911cf96eff39eddc5a7070e3c44efefc1.tar.gz packages_apps_Settings-1de688d911cf96eff39eddc5a7070e3c44efefc1.tar.bz2 packages_apps_Settings-1de688d911cf96eff39eddc5a7070e3c44efefc1.zip | |
Include reason when wiping data.
This will help us track down who requested a data wipe.
Bug: 17412160
Change-Id: I46b3f12a661a406450d23a7974513f40beb23c8d
Diffstat (limited to 'src/com/android/settings/CryptKeeper.java')
| -rw-r--r-- | src/com/android/settings/CryptKeeper.java | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/com/android/settings/CryptKeeper.java b/src/com/android/settings/CryptKeeper.java index 013fd3a78..560fe76f8 100644 --- a/src/com/android/settings/CryptKeeper.java +++ b/src/com/android/settings/CryptKeeper.java @@ -177,7 +177,10 @@ public class CryptKeeper extends Activity implements TextView.OnEditorActionList } } else if (failedAttempts == MAX_FAILED_ATTEMPTS) { // Factory reset the device. - sendBroadcast(new Intent("android.intent.action.MASTER_CLEAR")); + Intent intent = new Intent(Intent.ACTION_MASTER_CLEAR); + intent.addFlags(Intent.FLAG_RECEIVER_FOREGROUND); + intent.putExtra(Intent.EXTRA_REASON, "CryptKeeper.MAX_FAILED_ATTEMPTS"); + sendBroadcast(intent); } else if (failedAttempts == -1) { // Right password, but decryption failed. Tell user bad news ... setContentView(R.layout.crypt_keeper_progress); @@ -536,7 +539,7 @@ public class CryptKeeper extends Activity implements TextView.OnEditorActionList * @param corrupt true if userdata is corrupt, false if encryption failed * partway through */ - private void showFactoryReset(boolean corrupt) { + private void showFactoryReset(final boolean corrupt) { // Hide the encryption-bot to make room for the "factory reset" button findViewById(R.id.encroid).setVisibility(View.GONE); @@ -547,7 +550,11 @@ public class CryptKeeper extends Activity implements TextView.OnEditorActionList @Override public void onClick(View v) { // Factory reset the device. - sendBroadcast(new Intent("android.intent.action.MASTER_CLEAR")); + Intent intent = new Intent(Intent.ACTION_MASTER_CLEAR); + intent.addFlags(Intent.FLAG_RECEIVER_FOREGROUND); + intent.putExtra(Intent.EXTRA_REASON, + "CryptKeeper.showFactoryReset() corrupt=" + corrupt); + sendBroadcast(intent); } }); |
