File tree Expand file tree Collapse file tree 2 files changed +5
-2
lines changed
core/java/android/app/admin
services/java/com/android/server Expand file tree Collapse file tree 2 files changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -1008,13 +1008,15 @@ public void lockNow() {
10081008 /**
10091009 * Ask the user date be wiped. This will cause the device to reboot,
10101010 * erasing all user data while next booting up. External storage such
1011- * as SD cards will not be erased.
1011+ * as SD cards will be also erased if the flag {@link #WIPE_EXTERNAL_STORAGE}
1012+ * is set.
10121013 *
10131014 * <p>The calling device admin must have requested
10141015 * {@link DeviceAdminInfo#USES_POLICY_WIPE_DATA} to be able to call
10151016 * this method; if it has not, a security exception will be thrown.
10161017 *
1017- * @param flags Bit mask of additional options: currently must be 0.
1018+ * @param flags Bit mask of additional options: currently 0 and
1019+ * {@link #WIPE_EXTERNAL_STORAGE} are supported.
10181020 */
10191021 public void wipeData (int flags ) {
10201022 if (mService != null ) {
Original file line number Diff line number Diff line change @@ -1684,6 +1684,7 @@ void wipeDataLocked(int flags) {
16841684 // Note: we can only do the wipe via ExternalStorageFormatter if the volume is not emulated.
16851685 if ((forceExtWipe || wipeExtRequested ) && !Environment .isExternalStorageEmulated ()) {
16861686 Intent intent = new Intent (ExternalStorageFormatter .FORMAT_AND_FACTORY_RESET );
1687+ intent .putExtra (ExternalStorageFormatter .EXTRA_ALWAYS_RESET , true );
16871688 intent .setComponent (ExternalStorageFormatter .COMPONENT_NAME );
16881689 mWakeLock .acquire (10000 );
16891690 mContext .startService (intent );
You can’t perform that action at this time.
0 commit comments