Mount /dev/fuse on /mnt/user/<userid>/<volumeid>
Since system_server cannot mount devices by itself,
add a binder interface to vold that system_server
can call to initiate this mount when required.
BUG: 135341433
Test: manual
Test: atest --test-mapping packages/providers/MediaProvider
Test: ExternalStorageHostTest DownloadProviderTests
Change-Id: If4fd02a1f1a8d921a3f96783d8c73e085c5b7ca1
diff --git a/model/VolumeBase.h b/model/VolumeBase.h
index 53eeb6f..fa9eee4 100644
--- a/model/VolumeBase.h
+++ b/model/VolumeBase.h
@@ -87,6 +87,7 @@
State getState() const { return mState; }
const std::string& getPath() const { return mPath; }
const std::string& getInternalPath() const { return mInternalPath; }
+ int getDeviceFd() const { return dup(mDeviceFd.get()); }
status_t setDiskId(const std::string& diskId);
status_t setPartGuid(const std::string& partGuid);
@@ -121,6 +122,7 @@
status_t setId(const std::string& id);
status_t setPath(const std::string& path);
status_t setInternalPath(const std::string& internalPath);
+ status_t setDeviceFd(int deviceFd);
android::sp<android::os::IVoldListener> getListener() const;
@@ -147,6 +149,8 @@
std::string mInternalPath;
/* Flag indicating that volume should emit no events */
bool mSilent;
+ /* The filedescriptor for the fuse device, if the volume uses fuse, or -1 otherwise */
+ android::base::unique_fd mDeviceFd;
/* Volumes stacked on top of this volume */
std::list<std::shared_ptr<VolumeBase>> mVolumes;