Skip to content

Commit fd63c85

Browse files
Jean-Baptiste Queruandroid code review
authored andcommitted
Merge "Wipe the user data out in any case."
2 parents d4cb08d + f535cb0 commit fd63c85

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

core/java/android/app/admin/DevicePolicyManager.java

100644100755
Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff 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) {

services/java/com/android/server/DevicePolicyManagerService.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff 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);

0 commit comments

Comments
 (0)