summaryrefslogtreecommitdiff
path: root/libs/input/PointerController.cpp
diff options
context:
space:
mode:
author Yurii Zubrytskyi <zyy@google.com> 2024-11-11 16:04:13 -0800
committer Yurii Zubrytskyi <zyy@google.com> 2024-11-11 16:42:23 -0800
commit40c4f8c8a78afb29fd2fa8ab9dd876569cdab123 (patch)
tree814fa59eb63d34daeb8a095445ae08c85d4631e6 /libs/input/PointerController.cpp
parent536e0b47d827deacfbe4b70e81cdc80bbb6a48f4 (diff)
[res] Duplicate AssetManager when changes are needed
When adding new apk paths to the ResourcesImpl's AssetManager, we used to make it in a non-atomical way - first, the paths get added without recalculating the internal indices, then later it updates the indices and applies new configuration. This causes some lookups to fail until the index recalculation, as apk asset shift in the internal array, and the indices stop pointing to the correct apks. In this change, the asset paths update is now more parametrized: - When creating a ResourcesImpl we know it's not being used yet, so we just update the paths in place, and use the same non- atomic, but the fastest, code - When updating an existing object we instead create a new AssetManager object with the new paths, and then use that instead of the original one that could be in use - this helps to keep the currently running lookups to be consistent, as the object can't change under the caller and suddenly start returning different resources - an added bonus is that now we make sure that the paths actually change before running any update operations, potentially saving lots of time on heavy locking and JNI calls + Add a lock when accessing the registered shared libraries Bug: 362700391 Test: manual, run a test app with a resources getter in a loop and verify it doesn't get NotFoundException Flag: EXEMPT bugfix with no single point of entry Change-Id: If1890a62b34e504fd87dc27ef9dd27863cc718ee
Diffstat (limited to 'libs/input/PointerController.cpp')
0 files changed, 0 insertions, 0 deletions