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
This commit is contained in:
Philip P. Moltmann
2019-10-30 08:42:47 -07:00
parent a7f66b7ee8
commit f56fe2c2a3

View File

@@ -1182,8 +1182,8 @@ public class AppOpsService extends IAppOpsService.Stub {
}
} else {
for (int j=0; j<ops.length; j++) {
int code = uidState.opModes.keyAt(j);
if (code >= 0) {
int code = ops[j];
if (uidState.opModes.indexOfKey(code) >= 0) {
if (resOps == null) {
resOps = new ArrayList<>();
}