Move enabling sdcardfs behind a property
This allows devices that have sdcardfs enabled in the kernel to not use
it. When external_storage.sdcardfs.enabled=0, sdcardfs will not be
mounted. This is treated as default true to not affect upgrading
devices. It does not use the old ro.sys.sdcardfs as that has been
repurposed over time and no longer can be relied on to turn off
sdcardfs. This is included within emulated_storage.mk
Bug: 155222498
Test: mount|grep "type sdcardfs" should find nothing after boot complete
if external_storage.sdcardfs.enabled=0
Change-Id: I23d75fb1225aeabbcb1a035ad62fd042b6b3c7b5
diff --git a/VolumeManager.cpp b/VolumeManager.cpp
index f64f5f6..f42f3e7 100644
--- a/VolumeManager.cpp
+++ b/VolumeManager.cpp
@@ -83,6 +83,7 @@
using android::vold::DeleteDirContentsAndDir;
using android::vold::EnsureDirExists;
using android::vold::IsFilesystemSupported;
+using android::vold::IsSdcardfsUsed;
using android::vold::IsVirtioBlkDevice;
using android::vold::PrepareAndroidDirs;
using android::vold::PrepareAppDirFromRoot;
@@ -780,7 +781,7 @@
static std::string getStorageDirSrc(userid_t userId, const std::string& dirName,
const std::string& packageName) {
- if (IsFilesystemSupported("sdcardfs")) {
+ if (IsSdcardfsUsed()) {
return StringPrintf("/mnt/runtime/default/emulated/%d/%s/%s",
userId, dirName.c_str(), packageName.c_str());
} else {
@@ -1049,7 +1050,7 @@
}
int VolumeManager::fixupAppDir(const std::string& path, int32_t appUid) {
- if (IsFilesystemSupported("sdcardfs")) {
+ if (IsSdcardfsUsed()) {
//sdcardfs magically does this for us
return OK;
}