OSDN Git Service

Fix SecurityException in getStorageEncryptionStatus
authorRubin Xu <rubinxu@google.com>
Tue, 29 Mar 2016 11:19:16 +0000 (12:19 +0100)
committerRubin Xu <rubinxu@google.com>
Tue, 29 Mar 2016 13:35:36 +0000 (14:35 +0100)
Bug: 27892709
Change-Id: Ic6a3ccb8d266cfb04708413b767fe4f284219e57

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

index d8b856b..b2cd69d 100644 (file)
@@ -4870,8 +4870,8 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub {
 
         final ApplicationInfo ai;
         try {
-            ai = mContext.getPackageManager().getApplicationInfo(callerPackage, 0);
-        } catch (NameNotFoundException e) {
+            ai = mIPackageManager.getApplicationInfo(callerPackage, 0, userHandle);
+        } catch (RemoteException e) {
             throw new SecurityException(e);
         }
 
@@ -4880,7 +4880,7 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub {
             legacyApp = true;
         } else if ("com.google.android.apps.enterprise.dmagent".equals(ai.packageName)
                 && ai.versionCode == 697) {
-            // TODO: remove this once a new prebuilt is dropped
+            // TODO: STOPSHIP remove this (revert ag/895987) once a new prebuilt is dropped
             legacyApp = true;
         }