From f56fe2c2a3c553994de604220f9c4038458040f1 Mon Sep 17 00:00:00 2001 From: "Philip P. Moltmann" Date: Wed, 30 Oct 2019 08:42:47 -0700 Subject: [PATCH] Correctly log op state if ops restriction is set If a restiction on the ops is set, we only want to log the requested ops. Fixes: 143488492 Test: WellbeingTest#testDigitalWellbeingHasCorrectUsageStatsMode Change-Id: I5689575186655f00e14db815f7bb65f7aacb7cc4 --- .../core/java/com/android/server/appop/AppOpsService.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/services/core/java/com/android/server/appop/AppOpsService.java b/services/core/java/com/android/server/appop/AppOpsService.java index 857506889033e..eecfdbded750a 100644 --- a/services/core/java/com/android/server/appop/AppOpsService.java +++ b/services/core/java/com/android/server/appop/AppOpsService.java @@ -1182,8 +1182,8 @@ public class AppOpsService extends IAppOpsService.Stub { } } else { for (int j=0; j= 0) { + int code = ops[j]; + if (uidState.opModes.indexOfKey(code) >= 0) { if (resOps == null) { resOps = new ArrayList<>(); }