Skip to content
This repository has been archived by the owner on Oct 29, 2024. It is now read-only.

Commit

Permalink
Fix READ/WRITE operation access issues on Restricted appOps.
Browse files Browse the repository at this point in the history
Problems were identified around read and write access to the restricted appOps, this change includes:

- Filter out restricted appOps status for unprivileged readers.
- Allow additional privileged appOps permission holder reading restricted appOps status.

Bug: 336273802
Bug: 336323279
Test: Local test see b/336273802#comment3
Test: atest AppOpsTest#testRestrictedSettingsOpsRead
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:e31c33ea3586531ca99dd4c6d68a34ce07c1cebb)
Merged-In: I09008b365e36b2c20c9a1fe5a1d52699ddb17d35
Change-Id: I09008b365e36b2c20c9a1fe5a1d52699ddb17d35
  • Loading branch information
Hao Ke authored and thestinger committed Aug 6, 2024
1 parent 09e6958 commit af7c305
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1578,6 +1578,9 @@ private ArrayList<AppOpsManager.OpEntry> 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<>();
}
Expand Down

0 comments on commit af7c305

Please sign in to comment.