summaryrefslogtreecommitdiff
path: root/tools/aapt2/java/JavaClassGenerator.cpp
diff options
context:
space:
mode:
authorMartijn Coenen <maco@google.com>2020-10-06 12:30:58 +0200
committerMartijn Coenen <maco@google.com>2020-11-26 11:17:41 +0000
commitb2842cac584c87ab514c4f8d6c12dce543bb08c7 (patch)
treeb92d67ffdafadcc3b4f0c6d1569621617d741e3f /tools/aapt2/java/JavaClassGenerator.cpp
parentb72c8a096b7479c3c2bb1374e091b277fd765f90 (diff)
Make sure we preserve preserveLegacyExternalStorage.
This could be lost after a reboot, due to the following sequence of events: 1) App targets SDK 29 and has LEGACY_STORAGE 2) App updates to a version with targetSdk30 and preserveLegacyExternalStorage 3) App maintains LEGACY_STORAGE, because we currently have it and preserve was requested 4) We reboot 5) When evaluating the READ_EXTERNAL_STORAGE permission, we check whether we should grant the LEGACY_STORAGE extra app-op by calling mayAllowExtraAppOp(); this call returns false, because there's a check whether the app *currently* has LEGACY_STORAGE, which isn't true. 6) We then check whether we should deny LEGACY_STORAGE if it was previously granted; this returns true, because it was implemented as the inverse of 5) 7) LEGACY_STORAGE is denied Fix this by more explicitly coding what allows us to get the appop, and how it can be removed once we already have it. Bug: 169943139 Test: atest RestrictedStoragePermissionTest Test: atest PreserveLegacyStorageHostTest Change-Id: Ic24372348118ad9ed818a28f377e0decc78b9ecc Merged-In: Ic24372348118ad9ed818a28f377e0decc78b9ecc (cherry picked from commit c57e3455ff29b0a15a8781a34c19c6ded196f69e)
Diffstat (limited to 'tools/aapt2/java/JavaClassGenerator.cpp')
0 files changed, 0 insertions, 0 deletions