Loading src/com/android/settings/CryptKeeper.java +10 −3 Original line number Diff line number Diff line Loading @@ -190,7 +190,10 @@ public class CryptKeeper extends Activity implements TextView.OnEditorActionList hide(R.id.emergencyCallButton); } 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); Loading Loading @@ -549,7 +552,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); Loading @@ -560,7 +563,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); } }); Loading src/com/android/settings/MasterClearConfirm.java +5 −1 Original line number Diff line number Diff line Loading @@ -105,10 +105,14 @@ public class MasterClearConfirm extends Fragment { private void doMasterClear() { if (mEraseSdCard) { Intent intent = new Intent(ExternalStorageFormatter.FORMAT_AND_FACTORY_RESET); intent.putExtra(Intent.EXTRA_REASON, "MasterClearConfirm"); intent.setComponent(ExternalStorageFormatter.COMPONENT_NAME); getActivity().startService(intent); } else { getActivity().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, "MasterClearConfirm"); getActivity().sendBroadcast(intent); // Intent handling is asynchronous -- assume it will happen soon. } } Loading Loading
src/com/android/settings/CryptKeeper.java +10 −3 Original line number Diff line number Diff line Loading @@ -190,7 +190,10 @@ public class CryptKeeper extends Activity implements TextView.OnEditorActionList hide(R.id.emergencyCallButton); } 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); Loading Loading @@ -549,7 +552,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); Loading @@ -560,7 +563,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); } }); Loading
src/com/android/settings/MasterClearConfirm.java +5 −1 Original line number Diff line number Diff line Loading @@ -105,10 +105,14 @@ public class MasterClearConfirm extends Fragment { private void doMasterClear() { if (mEraseSdCard) { Intent intent = new Intent(ExternalStorageFormatter.FORMAT_AND_FACTORY_RESET); intent.putExtra(Intent.EXTRA_REASON, "MasterClearConfirm"); intent.setComponent(ExternalStorageFormatter.COMPONENT_NAME); getActivity().startService(intent); } else { getActivity().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, "MasterClearConfirm"); getActivity().sendBroadcast(intent); // Intent handling is asynchronous -- assume it will happen soon. } } Loading