From f65c0a99583cfaa8119836b8691d3a79db21dbbf Mon Sep 17 00:00:00 2001 From: Amith Yamasani Date: Mon, 11 Nov 2013 11:44:37 -0800 Subject: [PATCH] Fix inconsistency in reporting device admin active state. When a device admin goes away due to a package change, only one of two lists was being updated, causing an inconsistency in the query for active admins depending on which API was being called. This makes sure that mAdminMap stays in sync with mAdminList so that isActiveAdmin() and getActiveAdmins() returns the same results. Bug: 11588094 Change-Id: I232608738249492d9fca7e4d7aa7566d96fccf46 --- services/java/com/android/server/DevicePolicyManagerService.java | 1 + 1 file changed, 1 insertion(+) diff --git a/services/java/com/android/server/DevicePolicyManagerService.java b/services/java/com/android/server/DevicePolicyManagerService.java index 8cc80f7d70d38..1c3b9bb234af3 100644 --- a/services/java/com/android/server/DevicePolicyManagerService.java +++ b/services/java/com/android/server/DevicePolicyManagerService.java @@ -522,6 +522,7 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub { || pm.getReceiverInfo(aa.info.getComponent(), 0, userHandle) == null) { removed = true; policy.mAdminList.remove(i); + policy.mAdminMap.remove(aa.info.getComponent()); } } catch (RemoteException re) { // Shouldn't happen