From 237574444b311f2f4d23c62f63162f77d34f10bc Mon Sep 17 00:00:00 2001 From: Andy Stadler Date: Thu, 2 Jun 2011 16:37:39 -0700 Subject: DO NOT MERGE Use unchecked admin lookup for getStorageEncryption() Due to a copy/paste typo, getStorageEncryption() was protected by getActiveAdminForCallerLocked(), which made the API unreadable if the caller is not an admin. This doesn't match the rest of the DPM API which allows the "get" calls to be made anonymously. This fix supercedes the proposed workaround CL in the DPM ApiDemo sample. Backport of: If1a6237634e97ced09a7c6a8876bb6b0f60c9be9 Change-Id: I728b2d85878b7c73a063c906529f0d973e166b49 --- services/java/com/android/server/DevicePolicyManagerService.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'services') diff --git a/services/java/com/android/server/DevicePolicyManagerService.java b/services/java/com/android/server/DevicePolicyManagerService.java index 3bd8215..3181a9d 100644 --- a/services/java/com/android/server/DevicePolicyManagerService.java +++ b/services/java/com/android/server/DevicePolicyManagerService.java @@ -1925,9 +1925,8 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub { // Check for permissions if a particular caller is specified if (who != null) { // When checking for a single caller, status is based on caller's request - ActiveAdmin ap = getActiveAdminForCallerLocked(who, - DeviceAdminInfo.USES_ENCRYPTED_STORAGE); - return ap.encryptionRequested; + ActiveAdmin ap = getActiveAdminUncheckedLocked(who); + return ap != null ? ap.encryptionRequested : false; } // If no particular caller is specified, return the aggregate set of requests. -- cgit v1.1