Move PM cache invalidate inside mlock
Bug: 181992565 Ensure that the PM cache invalidation occurs inside regions protected by the PM mlock. Recent changes guard the invalidation so that it occurs only if something really changed - this limits the number of invalidation calls and makes it lower overhead. Create a new marker class for the PM lock, similar to the marker class ActivityManagerGlobalLock. The marker class has no performance impact but it enables future snapshot improvements using lock injection. The result is tested with a special build that checks the snapshot invalidation flag every time the PM lock is taken. The test verifies that the invalidation flag is false (meaning the snapshot is valid) every time the lock is taken, which means that invalidation occurs only under control of mLock. Test: atest * FrameworksServicesTests:AppsFilterTest * FrameworksServicesTests:PackageInstallerSessionTest * FrameworksServicesTests:PackageManagerServiceTest * FrameworksServicesTests:PackageManagerSettingsTests * FrameworksServicesTests:ScanTests * FrameworksServicesTests:UserSystemPackageInstallerTest * PackageManagerServiceBootTest * UserLifecycleTests#startUser * UserLifecycleTests#stopUser * UserLifecycleTests#switchUser * android.appsecurity.cts.EphemeralTest * android.appsecurity.cts.InstantAppUserTest Change-Id: I96154fbee78b620c76a2b7d8614bc433fc61e911
Loading
Please register or sign in to comment