Merge "BuildDataUserCePath always use dir instead of symbolic link"
am: fed8ab1d76
Change-Id: I98b7b11905f94c6576c268cfe950ed092b5e74d8
This commit is contained in:
commit
7dc93304c8
1 changed files with 7 additions and 7 deletions
14
Utils.cpp
14
Utils.cpp
|
@ -608,15 +608,15 @@ std::string BuildDataMediaCePath(const char* volumeUuid, userid_t userId) {
|
|||
std::string BuildDataUserCePath(const char* volumeUuid, userid_t userId) {
|
||||
// TODO: unify with installd path generation logic
|
||||
std::string data(BuildDataPath(volumeUuid));
|
||||
if (volumeUuid == nullptr) {
|
||||
if (userId == 0) {
|
||||
return StringPrintf("%s/data", data.c_str());
|
||||
} else {
|
||||
return StringPrintf("%s/user/%u", data.c_str(), userId);
|
||||
if (volumeUuid == nullptr && 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;
|
||||
}
|
||||
} else {
|
||||
return StringPrintf("%s/user/%u", data.c_str(), userId);
|
||||
}
|
||||
return StringPrintf("%s/user/%u", data.c_str(), userId);
|
||||
}
|
||||
|
||||
std::string BuildDataUserDePath(const char* volumeUuid, userid_t userId) {
|
||||
|
|
Loading…
Reference in a new issue