Skip to content
Commit 6b086884 authored by Hai Zhang's avatar Hai Zhang
Browse files

Revert "Revert "Replace permissions API with onPackageInstalled().""

This reverts commit 84ee067a.

Reason for revert: Fixed the issue where allowlisted restricted
permissions were removed upon package update due to the original
CL. This was caused by the fact that previously the allowlisted
permissions passed in by installer are used to replace the set of
existing allowlisted permissions, and this is inconsistent with the
granted permissions passed in by installer where we simply grant the
specified permissions instead of revoking permissions that weren't in
the list passed in. So I believe making the allowlisted permissions an
addition instead of replacement makes more sense and also solves the
issue.

The other change is that onPackageInstalled() is now called on a
per-user basis, because permission allowlist addition has to be done
per-user unlike the previous replacement. This also gives us a cleaner
API.

Bug: 158736025
Test: RestrictedStoragePermissionTest

Change-Id: I7a47afebf88406dc16f64942db6dcaff4e18ab75
parent d2ff4867
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment