Don't return /data/data from BuildDataUserCePath() am: aafc1bfb73 am: 50cfdadab0 am: e515951101 am: af5e9ca469

Original change: https://android-review.googlesource.com/c/platform/system/vold/+/2095483

Change-Id: I6796d564a245da1008532df086c6dbcf41b7bab3
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Eric Biggers 2022-05-12 20:33:32 +00:00 committed by Automerger Merge Worker
commit a7815b6ce4

View file

@ -1160,14 +1160,6 @@ std::string BuildDataMiscDePath(const std::string& volumeUuid, userid_t userId)
std::string BuildDataUserCePath(const std::string& volumeUuid, userid_t userId) { std::string BuildDataUserCePath(const std::string& volumeUuid, userid_t userId) {
// TODO: unify with installd path generation logic // TODO: unify with installd path generation logic
std::string data(BuildDataPath(volumeUuid)); std::string data(BuildDataPath(volumeUuid));
if (volumeUuid.empty() && userId == 0) {
std::string legacy = StringPrintf("%s/data", data.c_str());
struct stat sb;
if (lstat(legacy.c_str(), &sb) == 0 && S_ISDIR(sb.st_mode)) {
/* /data/data is dir, return /data/data for legacy system */
return legacy;
}
}
return StringPrintf("%s/user/%u", data.c_str(), userId); return StringPrintf("%s/user/%u", data.c_str(), userId);
} }