Fix multi-user and multi-storage with FUSE
Up until now, the FUSE mount logic has made two assumptions:
1. The primary external volume is an emulated volume on /data/media
2. Only the primary user is running, as user zero
These assumptions are fixed by the following changes
creating an EmulatedVolume per Android user and changing the
VolumeBase id format to append the user to the id, so
s/emulated/emulated-0/. This allows us mount separate volumes per user
Some additional refactorings to re-use/clean up code.
Test: adb shell sm set-virtual-disk and partition disk operations work
even after setting up a work profile
Bug: 135341433
Change-Id: Ifabaa12368e5a591fbcdce4ee71c83ff35fdac6b
diff --git a/Utils.h b/Utils.h
index f607c81..375e175 100644
--- a/Utils.h
+++ b/Utils.h
@@ -151,8 +151,10 @@
bool writeStringToFile(const std::string& payload, const std::string& filename);
-int MountUserFuse(userid_t user_id, const std::string& relative_path,
- android::base::unique_fd* fuse_fd);
+status_t MountUserFuse(userid_t user_id, const std::string& absolute_lower_path,
+ const std::string& relative_upper_path, android::base::unique_fd* fuse_fd);
+
+status_t UnmountUserFuse(const std::string& pass_through_path, const std::string& fuse_path);
} // namespace vold
} // namespace android