diff options
author | Hai Zhang <zhanghai@google.com> | 2020-06-25 20:46:12 -0700 |
---|---|---|
committer | Hai Zhang <zhanghai@google.com> | 2020-06-26 19:16:54 -0700 |
commit | 3ba22246d4b1abb84390c00529221f2b89c25d85 (patch) | |
tree | 6828c20b351ec74d8e17c19e582962af3d86ddde /tools/aapt2/java/JavaClassGenerator.cpp | |
parent | 9e7c46190aa202c940a9175645592635ceafbab1 (diff) |
Skip updating flags for a permission that's not requested.
If a permission isn't requested, there shouldn't be a PermissionState
for it, however updatePermissionFlags() may create such a state and
confuse restorePermissionState() for what is a new implicit
permission. So don't allow adding a new PermissionState for a
permission that's not requested, and make it a no-op because the
caller might just have seen an older package and we shouldn't crash
them. Updating flags for a permission with an existing PermissionState
is still allowed so that a permission state can be erased by revoking
and clearing all its flags.
See also b/159585979#comment7.
Bug: 159585979
Bug: 152580253
Test: atest --rerun-until-failure 100 SplitPermissionTest
Test: The test above fails within 2 or 3 attempts without this fix,
but passes successfully for 100 times with this fix. Logcat
shows that the logic in the fix is hit multiple times during the
test.
Change-Id: I17d252bdc2cfa65485b7950da099dff73c4979a9
Diffstat (limited to 'tools/aapt2/java/JavaClassGenerator.cpp')
0 files changed, 0 insertions, 0 deletions