From 64e0dcb989f27fc9246f3b2f40accd261f574d7e Mon Sep 17 00:00:00 2001 From: Suprabh Shukla Date: Tue, 24 May 2016 16:23:11 -0700 Subject: [PATCH] Updating user restrictions when they are removed Local user restrictions were not being updated in AppOpsService#setUserRestrictions when a restriction was removed. Bug: 28908581 Change-Id: If22f5834fadca33ec8b80bc4fb3993c1e1c29824 --- services/core/java/com/android/server/AppOpsService.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/services/core/java/com/android/server/AppOpsService.java b/services/core/java/com/android/server/AppOpsService.java index dab7d706a6d2c..b5b0cd86f3972 100644 --- a/services/core/java/com/android/server/AppOpsService.java +++ b/services/core/java/com/android/server/AppOpsService.java @@ -2180,8 +2180,9 @@ public class AppOpsService extends IAppOpsService.Stub { Preconditions.checkNotNull(token); for (int i = 0; i < AppOpsManager._NUM_OP; i++) { String restriction = AppOpsManager.opToRestriction(i); - if (restriction != null && restrictions.getBoolean(restriction, false)) { - setUserRestrictionNoCheck(i, true, token, userHandle, null); + if (restriction != null) { + setUserRestrictionNoCheck(i, restrictions.getBoolean(restriction, false), token, + userHandle, null); } } }