Bind mount Android/data and Android/obb individually.
Because we want all other paths (in particular Android/media) to go
through FUSE.
Also use scope_guard to make unwinding some failures easier.
Bug: 151272568
Test: atest AdoptableHostTest
Change-Id: Ib487b9071b5b212c7bb12ce54f80c96d98acaef5
diff --git a/model/EmulatedVolume.h b/model/EmulatedVolume.h
index 9bff0ca..1d2385d 100644
--- a/model/EmulatedVolume.h
+++ b/model/EmulatedVolume.h
@@ -48,6 +48,7 @@
status_t doUnmount() override;
private:
+ status_t unmountSdcardFs();
status_t mountFuseBindMounts();
status_t unmountFuseBindMounts();
@@ -63,9 +64,6 @@
/* Whether we mounted FUSE for this volume */
bool mFuseMounted;
- /* Whether we mounted Android/ for this volume */
- bool mAndroidMounted;
-
/* Whether to use sdcardfs for this volume */
bool mUseSdcardFs;