From 8474ee323131fdadcc17f09eab25003a7ae934e0 Mon Sep 17 00:00:00 2001 From: Jeff Sharkey Date: Thu, 30 Jul 2015 16:54:23 -0700 Subject: [PATCH] Return useful path when not visible. This allows apps like ExternalStorageProvider to still read/write files on transient storage devices which aren't mounted as visible. Bug: 22545248 Change-Id: Idacb15f2233245a8e1861d9be977535a82b218ec --- PublicVolume.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/PublicVolume.cpp b/PublicVolume.cpp index 762eb04..2a93213 100644 --- a/PublicVolume.cpp +++ b/PublicVolume.cpp @@ -117,7 +117,11 @@ status_t PublicVolume::doMount() { mFuseWrite = StringPrintf("/mnt/runtime_write/%s", stableName.c_str()); setInternalPath(mRawPath); - setPath(StringPrintf("/storage/%s", stableName.c_str())); + if (getMountFlags() & MountFlags::kVisible) { + setPath(StringPrintf("/storage/%s", stableName.c_str())); + } else { + setPath(mRawPath); + } if (fs_prepare_dir(mRawPath.c_str(), 0700, AID_ROOT, AID_ROOT) || fs_prepare_dir(mFuseDefault.c_str(), 0700, AID_ROOT, AID_ROOT) ||