Merge "Hide external storage from apps if it's not set as adoptable"
diff --git a/PublicVolume.cpp b/PublicVolume.cpp
index 2ec6736..8580da9 100644
--- a/PublicVolume.cpp
+++ b/PublicVolume.cpp
@@ -123,10 +123,7 @@
         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) ||
-            fs_prepare_dir(mFuseRead.c_str(), 0700, AID_ROOT, AID_ROOT) ||
-            fs_prepare_dir(mFuseWrite.c_str(), 0700, AID_ROOT, AID_ROOT)) {
+    if (fs_prepare_dir(mRawPath.c_str(), 0700, AID_ROOT, AID_ROOT)) {
         PLOG(ERROR) << getId() << " failed to create mount points";
         return -errno;
     }
@@ -146,6 +143,13 @@
         return OK;
     }
 
+    if (fs_prepare_dir(mFuseDefault.c_str(), 0700, AID_ROOT, AID_ROOT) ||
+            fs_prepare_dir(mFuseRead.c_str(), 0700, AID_ROOT, AID_ROOT) ||
+            fs_prepare_dir(mFuseWrite.c_str(), 0700, AID_ROOT, AID_ROOT)) {
+        PLOG(ERROR) << getId() << " failed to create FUSE mount points";
+        return -errno;
+    }
+
     dev_t before = GetDevice(mFuseWrite);
 
     if (!(mFusePid = fork())) {