Loading core/java/android/content/Intent.java +8 −0 Original line number Diff line number Diff line Loading @@ -6545,6 +6545,14 @@ public class Intent implements Parcelable, Cloneable { @SystemApi public static final String EXTRA_REASON = "android.intent.extra.REASON"; /** * Intent extra: Whether to show the wipe progress UI or to skip it. * * <p>Type: boolean * @hide */ public static final String EXTRA_SHOW_WIPE_PROGRESS = "android.intent.extra.SHOW_WIPE_PROGRESS"; /** * {@hide} * This extra will be send together with {@link #ACTION_FACTORY_RESET} Loading services/core/java/com/android/server/MasterClearReceiver.java +18 −7 Original line number Diff line number Diff line Loading @@ -49,6 +49,7 @@ public class MasterClearReceiver extends BroadcastReceiver { private static final String TAG = "MasterClear"; private boolean mWipeExternalStorage; private boolean mWipeEsims; private boolean mShowWipeProgress = true; @Override public void onReceive(final Context context, final Intent intent) { Loading Loading @@ -77,8 +78,12 @@ public class MasterClearReceiver extends BroadcastReceiver { return; } final boolean shutdown = intent.getBooleanExtra("shutdown", false); final String reason = intent.getStringExtra(Intent.EXTRA_REASON); // Factory reset dialog has its own UI for the reset process, so suppress ours if indicated. mShowWipeProgress = intent.getBooleanExtra(Intent.EXTRA_SHOW_WIPE_PROGRESS, true); final boolean shutdown = intent.getBooleanExtra("shutdown", false); mWipeExternalStorage = intent.getBooleanExtra(Intent.EXTRA_WIPE_EXTERNAL_STORAGE, false); mWipeEsims = intent.getBooleanExtra(Intent.EXTRA_WIPE_ESIMS, false); final boolean forceWipe = intent.getBooleanExtra(Intent.EXTRA_FORCE_MASTER_CLEAR, false) Loading Loading @@ -190,16 +195,20 @@ public class MasterClearReceiver extends BroadcastReceiver { public WipeDataTask(Context context, Thread chainedTask) { mContext = context; mChainedTask = chainedTask; mProgressDialog = new ProgressDialog(context, R.style.Theme_DeviceDefault_System); mProgressDialog = mShowWipeProgress ? new ProgressDialog(context, R.style.Theme_DeviceDefault_System) : null; } @Override protected void onPreExecute() { if (mProgressDialog != null) { mProgressDialog.setIndeterminate(true); mProgressDialog.getWindow().setType(WindowManager.LayoutParams.TYPE_SYSTEM_ALERT); mProgressDialog.setMessage(mContext.getText(R.string.progress_erasing)); mProgressDialog.show(); } } @Override protected Void doInBackground(Void... params) { Loading @@ -214,7 +223,9 @@ public class MasterClearReceiver extends BroadcastReceiver { @Override protected void onPostExecute(Void result) { if (mProgressDialog != null && mProgressDialog.isShowing()) { mProgressDialog.dismiss(); } mChainedTask.start(); } Loading Loading
core/java/android/content/Intent.java +8 −0 Original line number Diff line number Diff line Loading @@ -6545,6 +6545,14 @@ public class Intent implements Parcelable, Cloneable { @SystemApi public static final String EXTRA_REASON = "android.intent.extra.REASON"; /** * Intent extra: Whether to show the wipe progress UI or to skip it. * * <p>Type: boolean * @hide */ public static final String EXTRA_SHOW_WIPE_PROGRESS = "android.intent.extra.SHOW_WIPE_PROGRESS"; /** * {@hide} * This extra will be send together with {@link #ACTION_FACTORY_RESET} Loading
services/core/java/com/android/server/MasterClearReceiver.java +18 −7 Original line number Diff line number Diff line Loading @@ -49,6 +49,7 @@ public class MasterClearReceiver extends BroadcastReceiver { private static final String TAG = "MasterClear"; private boolean mWipeExternalStorage; private boolean mWipeEsims; private boolean mShowWipeProgress = true; @Override public void onReceive(final Context context, final Intent intent) { Loading Loading @@ -77,8 +78,12 @@ public class MasterClearReceiver extends BroadcastReceiver { return; } final boolean shutdown = intent.getBooleanExtra("shutdown", false); final String reason = intent.getStringExtra(Intent.EXTRA_REASON); // Factory reset dialog has its own UI for the reset process, so suppress ours if indicated. mShowWipeProgress = intent.getBooleanExtra(Intent.EXTRA_SHOW_WIPE_PROGRESS, true); final boolean shutdown = intent.getBooleanExtra("shutdown", false); mWipeExternalStorage = intent.getBooleanExtra(Intent.EXTRA_WIPE_EXTERNAL_STORAGE, false); mWipeEsims = intent.getBooleanExtra(Intent.EXTRA_WIPE_ESIMS, false); final boolean forceWipe = intent.getBooleanExtra(Intent.EXTRA_FORCE_MASTER_CLEAR, false) Loading Loading @@ -190,16 +195,20 @@ public class MasterClearReceiver extends BroadcastReceiver { public WipeDataTask(Context context, Thread chainedTask) { mContext = context; mChainedTask = chainedTask; mProgressDialog = new ProgressDialog(context, R.style.Theme_DeviceDefault_System); mProgressDialog = mShowWipeProgress ? new ProgressDialog(context, R.style.Theme_DeviceDefault_System) : null; } @Override protected void onPreExecute() { if (mProgressDialog != null) { mProgressDialog.setIndeterminate(true); mProgressDialog.getWindow().setType(WindowManager.LayoutParams.TYPE_SYSTEM_ALERT); mProgressDialog.setMessage(mContext.getText(R.string.progress_erasing)); mProgressDialog.show(); } } @Override protected Void doInBackground(Void... params) { Loading @@ -214,7 +223,9 @@ public class MasterClearReceiver extends BroadcastReceiver { @Override protected void onPostExecute(Void result) { if (mProgressDialog != null && mProgressDialog.isShowing()) { mProgressDialog.dismiss(); } mChainedTask.start(); } Loading