summaryrefslogtreecommitdiff
path: root/libs/androidfw/ZipFileRO.cpp
diff options
context:
space:
mode:
author wilsonshih <wilsonshih@google.com> 2024-12-05 03:22:59 +0000
committer wilsonshih <wilsonshih@google.com> 2024-12-10 08:43:38 +0000
commitc262b2c1a98275b8fe15c8b762240ac2b5df6149 (patch)
tree8b6961fa96245481275e4c758ea9c877b25120c9 /libs/androidfw/ZipFileRO.cpp
parent174083284168ecb0386a59763492369656b76211 (diff)
Refactor snapshot access between from cache and disk.
1. Correct the scope of the lock in SnapshotCache. The lock is now held from the snapshot cache to allow adding an extra reference if the snapshot is used outside the Window Manager lock. This ensures proper synchronization and prevents premature release of the snapshot. 2. Allows adding a reference for restored snapshots. Snapshots restored from disk can now also have an extra reference added. This enables quicker release of the associated hardware buffer, improving memory management. 3. Separates snapshot retrieval methods. The `getSnapshot` method is split into `FromDisk` and `FromCache` variants. This clarifies when the WM lock/Cache lock should be held, improving code readability and maintainability. Bug: 238206323 Bug: 379546318 Flag: com.android.window.flags.release_snapshot_aggressively Test: atest TaskSnapshotLowResDisabledTest TaskSnapshotCacheTest Test: Verify the snapshot load from disk can be released after parcel. Change-Id: I1982f1eb3fdf65d942c6bfae9ecee977984a222e
Diffstat (limited to 'libs/androidfw/ZipFileRO.cpp')
0 files changed, 0 insertions, 0 deletions