Merge "Use "sys.isolated_storage_snapshot" prop to check for the feature."
diff --git a/Utils.cpp b/Utils.cpp
index 667d277..341c927 100644
--- a/Utils.cpp
+++ b/Utils.cpp
@@ -811,7 +811,7 @@
return -errno;
}
- status_t result;
+ status_t result = OK;
struct dirent* de;
while ((de = readdir(dir))) {
const char* name = de->d_name;
diff --git a/VolumeManager.cpp b/VolumeManager.cpp
index 32747d4..547c7ef 100644
--- a/VolumeManager.cpp
+++ b/VolumeManager.cpp
@@ -871,8 +871,8 @@
if (hasIsolatedStorage()) {
mUserPackages.erase(userId);
std::string mntTargetDir = StringPrintf("/mnt/user/%d", userId);
- if (android::vold::UnmountTree(mntTargetDir) != 0) {
- PLOG(ERROR) << "unmountTree on " << mntTargetDir << " failed";
+ if (android::vold::UnmountTreeWithPrefix(mntTargetDir) < 0) {
+ PLOG(ERROR) << "UnmountTreeWithPrefix on " << mntTargetDir << " failed";
return -errno;
}
if (android::vold::DeleteDirContentsAndDir(mntTargetDir) < 0) {
@@ -974,8 +974,8 @@
<< ", volLabel=" << volLabel;
std::string pkgSandboxTarget =
StringPrintf("/mnt/user/%d/package/%s", userId, packageName.c_str());
- if (android::vold::UnmountTree(pkgSandboxTarget)) {
- PLOG(ERROR) << "UnmountTree failed on " << pkgSandboxTarget;
+ if (android::vold::UnmountTreeWithPrefix(pkgSandboxTarget) < 0) {
+ PLOG(ERROR) << "UnmountTreeWithPrefix failed on " << pkgSandboxTarget;
}
std::string sandboxDir = StringPrintf("/mnt/runtime/write/%s", volLabel.c_str());
@@ -1075,8 +1075,8 @@
for (auto& packageName : packageNames) {
std::string volSandboxRoot = StringPrintf("/mnt/user/%d/package/%s/%s", userId,
packageName.c_str(), vol->getLabel().c_str());
- if (android::vold::UnmountTree(volSandboxRoot) != 0) {
- PLOG(ERROR) << "unmountTree on " << volSandboxRoot << " failed";
+ if (android::vold::UnmountTreeWithPrefix(volSandboxRoot) < 0) {
+ PLOG(ERROR) << "UnmountTreeWithPrefix on " << volSandboxRoot << " failed";
continue;
}
if (android::vold::DeleteDirContentsAndDir(volSandboxRoot) < 0) {
@@ -1288,7 +1288,7 @@
mVisibleVolumeIds.clear();
// For unmounting dirs under /mnt/user/<user-id>/package/<package-name>
- android::vold::UnmountTree("/mnt/user/");
+ android::vold::UnmountTreeWithPrefix("/mnt/user/");
return 0;
}