Create Android/media dirs
I3a879089422c7fc449b6a3e6f1c4b386b86687a4 enforces some gids on the
Android/ dirs but left out Android/media. We now create it
Test: atest FuseDaemonHostTest#testListFilesFromExternalMediaDirectory
Bug: 149072341
Change-Id: I260c414906cd491a6bdd83522ff45f8663e15604
diff --git a/Utils.cpp b/Utils.cpp
index dc1c593..5dde4b0 100644
--- a/Utils.cpp
+++ b/Utils.cpp
@@ -1188,6 +1188,7 @@
std::string androidDir = volumeRoot + kAndroidDir;
std::string androidDataDir = volumeRoot + kAppDataDir;
std::string androidObbDir = volumeRoot + kAppObbDir;
+ std::string androidMediaDir = volumeRoot + kAppMediaDir;
bool useSdcardFs = IsFilesystemSupported("sdcardfs");
@@ -1208,6 +1209,11 @@
return -errno;
}
+ if (fs_prepare_dir(androidMediaDir.c_str(), 0771, AID_MEDIA_RW, AID_MEDIA_RW) != 0) {
+ PLOG(ERROR) << "Failed to create " << androidMediaDir;
+ return -errno;
+ }
+
return OK;
}
} // namespace vold