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

Skip to content
Commit 90243296 authored by Martijn Coenen's avatar Martijn Coenen
Browse files

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
parent 93d7e93f
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