From 3a3d212a51974ccec6100c1e117225291edc83cc Mon Sep 17 00:00:00 2001 From: Amith Yamasani Date: Wed, 29 Oct 2014 11:41:31 -0700 Subject: Different messages when wiping user and not device There are 3 types of users 1. Primary - device will be wiped 2. Managed profile - profile will be removed 3. Secondary user - user will be removed Show different messages for almost wipe and wipe in each of these 3 cases. Bug: 16843155 Change-Id: Icecfe520622773da9e45465bf2217e8ed38b266e --- .../server/devicepolicy/DevicePolicyManagerService.java | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'services/devicepolicy/java') diff --git a/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java b/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java index b97f4f9..ac5fb18 100644 --- a/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java +++ b/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java @@ -2521,6 +2521,7 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub { } } + @Override public int getMaximumFailedPasswordsForWipe(ComponentName who, int userHandle) { if (!mHasFeature) { return 0; @@ -2533,6 +2534,18 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub { } } + @Override + public int getProfileWithMinimumFailedPasswordsForWipe(int userHandle) { + if (!mHasFeature) { + return UserHandle.USER_NULL; + } + enforceCrossUserPermission(userHandle); + synchronized (this) { + ActiveAdmin admin = getAdminWithMinimumFailedPasswordsForWipeLocked(userHandle); + return admin != null ? admin.getUserHandle().getIdentifier() : UserHandle.USER_NULL; + } + } + /** * Returns the admin with the strictest policy on maximum failed passwords for this user and all * profiles that are visible from this user. If the policy for the primary and any other profile -- cgit v1.1