Loading core/java/android/app/admin/DevicePolicyManager.java +12 −0 Original line number Diff line number Diff line Loading @@ -4247,6 +4247,12 @@ public class DevicePolicyManager { * device. After this method is called, the device must be unlocked using strong authentication * (PIN, pattern, or password). This API is intended for use only by device admins. * <p> * From version {@link android.os.Build.VERSION_CODES#R} onwards, the caller must either have * the LOCK_DEVICE permission or the device must have the device admin feature; if neither is * true, then the method will return without completing any action. Before version * {@link android.os.Build.VERSION_CODES#R}, the device needed the device admin feature, * regardless of the caller's permissions. * <p> * The calling device admin must have requested {@link DeviceAdminInfo#USES_POLICY_FORCE_LOCK} * to be able to call this method; if it has not, a security exception will be thrown. * <p> Loading Loading @@ -4274,6 +4280,12 @@ public class DevicePolicyManager { * device. After this method is called, the device must be unlocked using strong authentication * (PIN, pattern, or password). This API is intended for use only by device admins. * <p> * From version {@link android.os.Build.VERSION_CODES#R} onwards, the caller must either have * the LOCK_DEVICE permission or the device must have the device admin feature; if neither is * true, then the method will return without completing any action. Before version * {@link android.os.Build.VERSION_CODES#R}, the device needed the device admin feature, * regardless of the caller's permissions. * <p> * The calling device admin must have requested {@link DeviceAdminInfo#USES_POLICY_FORCE_LOCK} * to be able to call this method; if it has not, a security exception will be thrown. * <p> Loading services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java +3 −2 Original line number Diff line number Diff line Loading @@ -631,7 +631,7 @@ public class DevicePolicyManagerService extends BaseIDevicePolicyManager { /** * Whether or not device admin feature is supported. If it isn't return defaults for all * public methods. * public methods, unless the caller has the appropriate permission for a particular method. */ final boolean mHasFeature; Loading Loading @@ -6032,7 +6032,8 @@ public class DevicePolicyManagerService extends BaseIDevicePolicyManager { @Override public void lockNow(int flags, boolean parent) { if (!mHasFeature) { if (!mHasFeature && mContext.checkCallingPermission(android.Manifest.permission.LOCK_DEVICE) != PackageManager.PERMISSION_GRANTED) { return; } Loading Loading
core/java/android/app/admin/DevicePolicyManager.java +12 −0 Original line number Diff line number Diff line Loading @@ -4247,6 +4247,12 @@ public class DevicePolicyManager { * device. After this method is called, the device must be unlocked using strong authentication * (PIN, pattern, or password). This API is intended for use only by device admins. * <p> * From version {@link android.os.Build.VERSION_CODES#R} onwards, the caller must either have * the LOCK_DEVICE permission or the device must have the device admin feature; if neither is * true, then the method will return without completing any action. Before version * {@link android.os.Build.VERSION_CODES#R}, the device needed the device admin feature, * regardless of the caller's permissions. * <p> * The calling device admin must have requested {@link DeviceAdminInfo#USES_POLICY_FORCE_LOCK} * to be able to call this method; if it has not, a security exception will be thrown. * <p> Loading Loading @@ -4274,6 +4280,12 @@ public class DevicePolicyManager { * device. After this method is called, the device must be unlocked using strong authentication * (PIN, pattern, or password). This API is intended for use only by device admins. * <p> * From version {@link android.os.Build.VERSION_CODES#R} onwards, the caller must either have * the LOCK_DEVICE permission or the device must have the device admin feature; if neither is * true, then the method will return without completing any action. Before version * {@link android.os.Build.VERSION_CODES#R}, the device needed the device admin feature, * regardless of the caller's permissions. * <p> * The calling device admin must have requested {@link DeviceAdminInfo#USES_POLICY_FORCE_LOCK} * to be able to call this method; if it has not, a security exception will be thrown. * <p> Loading
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java +3 −2 Original line number Diff line number Diff line Loading @@ -631,7 +631,7 @@ public class DevicePolicyManagerService extends BaseIDevicePolicyManager { /** * Whether or not device admin feature is supported. If it isn't return defaults for all * public methods. * public methods, unless the caller has the appropriate permission for a particular method. */ final boolean mHasFeature; Loading Loading @@ -6032,7 +6032,8 @@ public class DevicePolicyManagerService extends BaseIDevicePolicyManager { @Override public void lockNow(int flags, boolean parent) { if (!mHasFeature) { if (!mHasFeature && mContext.checkCallingPermission(android.Manifest.permission.LOCK_DEVICE) != PackageManager.PERMISSION_GRANTED) { return; } Loading