diff options
author | 2025-01-17 04:39:00 -0800 | |
---|---|---|
committer | 2025-01-23 10:33:36 +0000 | |
commit | 902432960f5f0ffea36c5a2e19ba1e6bfc17e284 (patch) | |
tree | d1a2285cd42a4893b3af2a32a87c053f949dfb03 /libs/androidfw/misc.cpp | |
parent | 93d7e93fb9769acc5f69eb8a01302f9f4aef4ae7 (diff) |
Create WatchableVolumeInfo object.
In preparation of caching the getVolumeList() API, create a new
WatchableVolumeInfo object that wraps VolumeInfo. Unfortunately it is
not possible to safely make VolumeInfo itself Watchable, because it
exposes public members that are also tagged @UnsupportedAppUsage, which
means we cannot safely change their visibility. This allows VolumeInfo
objects being modified without notifying the watchers. Since this can
lead to very obscure bugs when caching volumes, instead wrap VolumeInfo
in a new WatchableVolumeInfo class, which does safely implement
Watchable. Change StorageManagerService to use it; the only place where
we still allow a WatchableVolumeInfo to be converted into a VolumeInfo
object is when return a list of volumes to other processes, in
getVolumeList() itself.
Bug: 323574186
Test: N/A, refactoring code
Flag: EXEMPT refactoring
Change-Id: Idda040f28df2e3656014d710280706ccfbc6158c
Diffstat (limited to 'libs/androidfw/misc.cpp')
0 files changed, 0 insertions, 0 deletions