OSDN Git Service

DPMS shouldn't remove admins that aren't crypto aware.
authorKenny Guy <kennyguy@google.com>
Thu, 11 Feb 2016 17:11:14 +0000 (17:11 +0000)
committerKenny Guy <kennyguy@google.com>
Thu, 11 Feb 2016 17:48:43 +0000 (17:48 +0000)
DevicePolicyManagerService checks admins on boot
and removes ones that aren't found so it needs
to match crypto and non-crypto admins.
Match non-crypto aware apps when admin is enabling
system apps.

Bug: 27126412
Change-Id: Ibb20841679fb660de281782964b068d5a13b8fe9

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

index 2ed96c6..cf584bb 100644 (file)
@@ -1249,7 +1249,9 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub {
                     if (packageName == null || packageName.equals(adminPackage)) {
                         if (mIPackageManager.getPackageInfo(adminPackage, 0, userHandle) == null
                                 || mIPackageManager.getReceiverInfo(
-                                    aa.info.getComponent(), 0, userHandle) == null) {
+                                    aa.info.getComponent(),
+                                    PackageManager.MATCH_ENCRYPTION_AWARE_AND_UNAWARE,
+                                    userHandle) == null) {
                             removed = true;
                             policy.mAdminList.remove(i);
                             policy.mAdminMap.remove(aa.info.getComponent());
@@ -7104,7 +7106,7 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub {
                 List<ResolveInfo> activitiesToEnable = mIPackageManager.queryIntentActivities(
                         intent,
                         intent.resolveTypeIfNeeded(mContext.getContentResolver()),
-                        0, // no flags
+                        PackageManager.MATCH_ENCRYPTION_AWARE_AND_UNAWARE,
                         parentUserId);
 
                 if (VERBOSE_LOG) {