system/core
リビジョン | c6ca823710d49754c3717e9cf3ba11b9c2648825 (tree) |
---|---|
日時 | 2019-05-23 23:09:54 |
作者 | Narayan Kamath <narayan@goog...> |
コミッター | Anton Hansson |
rootdir / sdcard : Stop creating /data/media/obb.
This directory is no longer used. OBB content is
placed in /data/media/$user/Android.
Test: make
Test: manually verify the path doesn't exist.
Bug: 129167772
Change-Id: I8549826586b9a68c8cfa3fe2e51295363f9b4e11
@@ -586,7 +586,6 @@ on post-fs-data | ||
586 | 586 | symlink /data/data /data/user/0 |
587 | 587 | |
588 | 588 | mkdir /data/media 0770 media_rw media_rw |
589 | - mkdir /data/media/obb 0770 media_rw media_rw | |
590 | 589 | |
591 | 590 | mkdir /data/cache 0770 system cache |
592 | 591 | mkdir /data/cache/recovery 0770 system cache |
@@ -214,7 +214,14 @@ static void run_sdcardfs(const std::string& source_path, const std::string& labe | ||
214 | 214 | |
215 | 215 | if (multi_user) { |
216 | 216 | std::string obb_path = source_path + "/obb"; |
217 | - fs_prepare_dir(obb_path.c_str(), 0775, uid, gid); | |
217 | + // Only attempt to prepare the /obb dir if it already exists. We want | |
218 | + // the legacy obb path "/data/media/obb" to be fixed up so that we can | |
219 | + // migrate it to its new location, but we don't want the directory to be | |
220 | + // created if it doesn't already exist. | |
221 | + struct stat sb; | |
222 | + if (TEMP_FAILURE_RETRY(lstat(obb_path.c_str(), &sb)) == 0) { | |
223 | + fs_prepare_dir(obb_path.c_str(), 0775, uid, gid); | |
224 | + } | |
218 | 225 | } |
219 | 226 | |
220 | 227 | exit(0); |