From 32679a82d9542ec26ea8b4e32d29dd7b02202611 Mon Sep 17 00:00:00 2001 From: Jeff Sharkey Date: Tue, 21 Jul 2015 14:22:01 -0700 Subject: [PATCH] Create user directory on emulated storage. When mounting a primary external storage device that is multi-user aware, ensure that the user-specific directory actually exists before moving forward. Bug: 22472026 Change-Id: I33c8eed261a9c0d5acedd5be6133ed9990679d08 --- VolumeManager.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/VolumeManager.cpp b/VolumeManager.cpp index 6710b0c..ddb7517 100755 --- a/VolumeManager.cpp +++ b/VolumeManager.cpp @@ -416,6 +416,7 @@ int VolumeManager::linkPrimary(userid_t userId) { std::string source(mPrimary->getPath()); if (mPrimary->getType() == android::vold::VolumeBase::Type::kEmulated) { source = StringPrintf("%s/%d", source.c_str(), userId); + fs_prepare_dir(source.c_str(), 0755, AID_ROOT, AID_ROOT); } std::string target(StringPrintf("/mnt/user/%d/primary", userId));