Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit 80fd09f1 authored by Lee Shombert's avatar Lee Shombert
Browse files

Separate permission notifications from cache updates

If the feature is enabled, the following behavior changes:

1. Caches that used CACHE_KEY_PACKAGE_INFO as a key now use
   CACHE_KEY_PACKAGE_INFO_CACHE.  This has a different value from the
   previous key, so it will be stored in shared memory, not in a
   sysprop.

2. CACHE_KEY_PACKAGE_INFO_CACHE caches do not use auto-corking.

3. AudioServer listens to changes on CACHE_KEY_PACKAGE_INFO_NOTIFY,
   sysprop, which has the same value as the legacy
   CACHE_KEY_PACKAGE_INFO.

4. A new Thread in AudioServer spins, waiting for changes on the
   CACHE_KEY_PACKAGE_INFO_CACHE nonce.  When the nonce changes, the
   CACHE_KEY_PACKAGE_INFO_NOTIFY sysprop is updated.  Updating is
   throttled using the same logic as auto-corking.

The net effect is that all cache operations take place through shared
memory. PackageManger cache invalidation never stalls behind a sysprop
set operation. An adapter in AudioServer generates the legacy sysprop
changes.

Tested with the flag enabled:
 * Verified that no cache uses "package_info" as its key
 * Verified that caches use "package_info_cache" as their key
 * Verified no regressions on UserLifecyceTest#switchUser

Flag: android.app.pic_separate_permission_notifications
Bug: 379699402
Bug: 360897450
Test: atest
 * FrameworksCoreTests:PropertyInvalidatedCacheTests
 * FrameworksCoreTests:IpcDataCacheTest
 * CtsOsTestCases:IpcDataCacheTest
 * ServiceBluetoothTests
 * android.app.appops.cts.AppOpsLoggingTest
 * android.media.audio.cts.AudioFocusTest
 * CtsMediaAudioPermissionTestCases
 * CtsMediaAudioTestCases:AudioRecordTest
Change-Id: I314e4ea32765ca22b8ecd23a1bde93ab2c828111
parent b41cf306
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment