Don't return /data/data from BuildDataUserCePath()
There is no reason for this function to sometimes return the legacy
alias "/data/data" for /data/user/0. Just use /data/user/0 instead.
Bug: 156305599
Change-Id: I305a9463c1bf0a59495c34ef33430f92257c2f0d
diff --git a/Utils.cpp b/Utils.cpp
index ba6afd8..3757c1f 100644
--- a/Utils.cpp
+++ b/Utils.cpp
@@ -1160,14 +1160,6 @@
std::string BuildDataUserCePath(const std::string& volumeUuid, userid_t userId) {
// TODO: unify with installd path generation logic
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);
}