summaryrefslogtreecommitdiff
path: root/rs/java/android/renderscript/ProgramVertexFixedFunction.java
diff options
context:
space:
mode:
authorLee Shombert <shombert@google.com>2021-02-08 14:14:00 -0800
committerLee Shombert <shombert@google.com>2021-02-08 14:14:35 -0800
commitc88f2e72e77288d80c3575710769be5e94959650 (patch)
treeaa85549dc36160288c5db89097222bb83bc3a72c /rs/java/android/renderscript/ProgramVertexFixedFunction.java
parent09b64443c8998368c765b30645e6cd12e827c6ad (diff)
Ensure PM watches all Watchables
Bug: 179388643 The bug occurs because two Watchables were not being observed by PackageManagerService. The two Watchables are mSettings and mInstantAppRegistry. The bug should have been detected by Watchable.verifyWatchedAttributes() but that, too had a bug: the PackageManagerService attributes were not visible to the Watchable package so the verification code got an IllegalAccessException, which caused the attributes to be silently ignored. The following changes are made: 1. PackageManagerService now registers with the missing Watchables. 2. Registration is moved to a function that is called in two places. 3. The verification code is enhanced to ensure fields are accessible. A RuntimeException is thrown if the field is still not accessible. Note that only fields annotated with @Watched can generate this exception. 4. PackageManagerVerification is skipped (log-only on errors) if it appears to be part of a mockito test. 4. Settings now registers with a missing Watchable. The Watchable is not actually used in Settings (see the TODO at the attribute declaration) but this CL assumes that it might be used in the future. 6. One import order violation was corrected. In addition to automated tests, the changes were tested with an instrumented PackageManagerService that enabled snapshots and skipped registration with one or more observers. All attributes were tested one by one. Test: atest * FrameworksServicesTests:UserSystemPackageInstallerTest * FrameworksServicesTests:PackageManagerSettingsTests * FrameworksServicesTests:PackageManagerServiceTest * FrameworksServicesTests:AppsFilterTest * FrameworksServicesTests:PackageInstallerSessionTest * FrameworksServicesTests:ScanTests * UserLifecycleTests#startUser * UserLifecycleTests#stopUser * UserLifecycleTests#switchUser * android.appsecurity.cts.EphemeralTest#testEphemeralStartExposed06 * android.appsecurity.cts.InstantAppUserTest#testStartExposed06 * com.android.server.pm.PackageManagerServiceBootTest Change-Id: Ib2b14c4745bd5e5ab2882ed6fe953d7da2df4087
Diffstat (limited to 'rs/java/android/renderscript/ProgramVertexFixedFunction.java')
0 files changed, 0 insertions, 0 deletions