Loading core/java/android/app/admin/DevicePolicyManager.java +4 −5 Original line number Diff line number Diff line Loading @@ -3450,15 +3450,14 @@ public class DevicePolicyManager { * @param flags Bit mask of additional options: currently supported flags are * {@link #WIPE_EXTERNAL_STORAGE} and {@link #WIPE_RESET_PROTECTION_DATA}. * @param reason a string that contains the reason for wiping data, which can be * presented to the user. * presented to the user. If the string is null or empty, user won't be notified. * @throws SecurityException if the calling application does not own an active administrator * that uses {@link DeviceAdminInfo#USES_POLICY_WIPE_DATA} * @throws IllegalArgumentException if the input reason string is null or empty. */ public void wipeData(int flags, @NonNull CharSequence reason) { public void wipeData(int flags, CharSequence reason) { throwIfParentInstance("wipeData"); Preconditions.checkNotNull(reason, "CharSequence is null"); wipeDataInternal(flags, reason.toString()); wipeDataInternal(flags, reason != null ? reason.toString() : null); } /** Loading @@ -3469,7 +3468,7 @@ public class DevicePolicyManager { * @see #wipeData(int, CharSequence) * @hide */ private void wipeDataInternal(int flags, @NonNull String wipeReasonForUser) { private void wipeDataInternal(int flags, String wipeReasonForUser) { if (mService != null) { try { mService.wipeDataWithReason(flags, wipeReasonForUser); Loading services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java +1 −2 Original line number Diff line number Diff line Loading @@ -6019,7 +6019,7 @@ public class DevicePolicyManagerService extends BaseIDevicePolicyManager { success = mUserManagerInternal.removeUserEvenWhenDisallowed(userId); if (!success) { Slog.w(LOG_TAG, "Couldn't remove user " + userId); } else if (isManagedProfile(userId)) { } else if (isManagedProfile(userId) && !TextUtils.isEmpty(wipeReasonForUser)) { sendWipeProfileNotification(wipeReasonForUser); } } catch (RemoteException re) { Loading @@ -6034,7 +6034,6 @@ public class DevicePolicyManagerService extends BaseIDevicePolicyManager { if (!mHasFeature) { return; } Preconditions.checkStringNotEmpty(wipeReasonForUser, "wipeReasonForUser is null or empty"); enforceFullCrossUsersPermission(mInjector.userHandleGetCallingUserId()); final ActiveAdmin admin; Loading Loading
core/java/android/app/admin/DevicePolicyManager.java +4 −5 Original line number Diff line number Diff line Loading @@ -3450,15 +3450,14 @@ public class DevicePolicyManager { * @param flags Bit mask of additional options: currently supported flags are * {@link #WIPE_EXTERNAL_STORAGE} and {@link #WIPE_RESET_PROTECTION_DATA}. * @param reason a string that contains the reason for wiping data, which can be * presented to the user. * presented to the user. If the string is null or empty, user won't be notified. * @throws SecurityException if the calling application does not own an active administrator * that uses {@link DeviceAdminInfo#USES_POLICY_WIPE_DATA} * @throws IllegalArgumentException if the input reason string is null or empty. */ public void wipeData(int flags, @NonNull CharSequence reason) { public void wipeData(int flags, CharSequence reason) { throwIfParentInstance("wipeData"); Preconditions.checkNotNull(reason, "CharSequence is null"); wipeDataInternal(flags, reason.toString()); wipeDataInternal(flags, reason != null ? reason.toString() : null); } /** Loading @@ -3469,7 +3468,7 @@ public class DevicePolicyManager { * @see #wipeData(int, CharSequence) * @hide */ private void wipeDataInternal(int flags, @NonNull String wipeReasonForUser) { private void wipeDataInternal(int flags, String wipeReasonForUser) { if (mService != null) { try { mService.wipeDataWithReason(flags, wipeReasonForUser); Loading
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java +1 −2 Original line number Diff line number Diff line Loading @@ -6019,7 +6019,7 @@ public class DevicePolicyManagerService extends BaseIDevicePolicyManager { success = mUserManagerInternal.removeUserEvenWhenDisallowed(userId); if (!success) { Slog.w(LOG_TAG, "Couldn't remove user " + userId); } else if (isManagedProfile(userId)) { } else if (isManagedProfile(userId) && !TextUtils.isEmpty(wipeReasonForUser)) { sendWipeProfileNotification(wipeReasonForUser); } } catch (RemoteException re) { Loading @@ -6034,7 +6034,6 @@ public class DevicePolicyManagerService extends BaseIDevicePolicyManager { if (!mHasFeature) { return; } Preconditions.checkStringNotEmpty(wipeReasonForUser, "wipeReasonForUser is null or empty"); enforceFullCrossUsersPermission(mInjector.userHandleGetCallingUserId()); final ActiveAdmin admin; Loading