diff --git a/services/core/java/com/android/server/appop/AppOpsService.java b/services/core/java/com/android/server/appop/AppOpsService.java index 17aa376f3981..df94f06a3674 100644 --- a/services/core/java/com/android/server/appop/AppOpsService.java +++ b/services/core/java/com/android/server/appop/AppOpsService.java @@ -1578,6 +1578,9 @@ private ArrayList collectOps(Ops pkgOps, int[] ops, for (int j = 0; j < ops.length; j++) { Op curOp = pkgOps.get(ops[j]); if (curOp != null) { + if (opRestrictsRead(curOp.op) && !shouldReturnRestrictedAppOps) { + continue; + } if (resOps == null) { resOps = new ArrayList<>(); }