OSDN Git Service

Introduce postMount() VolumeBase helper.
authorMartijn Coenen <maco@google.com>
Mon, 4 May 2020 12:57:35 +0000 (14:57 +0200)
committerMartijn Coenen <maco@google.com>
Mon, 4 May 2020 13:09:32 +0000 (15:09 +0200)
commit5ec8658abcb5be66a380190d7e4aa39510f3b1af
tree4ea5be17a9998a3c0333886b9de15a851d71940a
parentfc7b6697b40076f8fd67f6fbc805812c9fd07369
Introduce postMount() VolumeBase helper.

When we're mounting a private volume, we create stacked emulated volumes
on top of it. Due to the ordering there, we would broadcast the emulated
volumes being created *before* the "mounted" status update. This in turn
could cause us to try and mount these emulated volumes before the
underlying private volume is really mounted. This is problematic in
particular on devices that support a filesystem keyring, where we need
to do some additional setup before the devices can be used.

While we could modify StorageManagerService to delay the mount, a safer
fix at this stage of the release is to just fix the ordering of these
events. To achieve that, add a simple postMount() helper, that is called
after a succesful mount. This allows us to setup the volume properly
before trying to mount any stacked volumes.

Bug: 151079464
Test: atest AdoptableHostTest
Change-Id: I2cc4113d4d71d89aa629bb9c0fa9be441355c079
model/PrivateVolume.cpp
model/PrivateVolume.h
model/VolumeBase.cpp
model/VolumeBase.h