summaryrefslogtreecommitdiff
path: root/libs/androidfw/ApkParsing.cpp
diff options
context:
space:
mode:
author Hai Zhang <zhanghai@google.com> 2023-05-17 01:30:20 -0700
committer Hai Zhang <zhanghai@google.com> 2023-05-18 20:59:44 +0000
commit98f78c885d2c9e5d88a4636b1ed36d723ca9261f (patch)
tree606784fd4b5141cbcdb069164e64ab35626b9fa3 /libs/androidfw/ApkParsing.cpp
parent81ebe9160933fc6d385dad07701cc9a68c425066 (diff)
Preserve flags for non-runtime permissions upon package update.
PermissionManagerServiceImpl.restorePermissionState() creates a new UID permission state for non-shared-UID packages that have been updated (i.e. replaced), however the existing logic for non-runtime permission never carried over the flags from the old state. This wasn't an issue for much older platforms because permission flags weren't used for non-runtime permissions, however since we are starting to use them for role protected permissions (ROLE_GRANTED) and app op permissions (USER_SET), we do need to preserver the permission flags. This change merges the logic for granting and revoking a non-runtime permission in restorePermissionState() into a single if branch, and appends the logic to copy the flag from the old state in that branch. Bug: 283006437 Test: PermissionFlagsTest#nonRuntimePermissionFlagsPreservedAfterReinstall Change-Id: Iea3c66710e7d28c6fc730b1939da64f1172b08db Merged-In: Iea3c66710e7d28c6fc730b1939da64f1172b08db
Diffstat (limited to 'libs/androidfw/ApkParsing.cpp')
0 files changed, 0 insertions, 0 deletions