diff --git a/VolumeManager.cpp b/VolumeManager.cpp index c3c95f6..98f12e8 100644 --- a/VolumeManager.cpp +++ b/VolumeManager.cpp @@ -39,6 +39,7 @@ #include #include #include +#include #include #include @@ -751,9 +752,11 @@ int VolumeManager::unmountAll() { std::list toUnmount; mntent* mentry; while ((mentry = getmntent(fp)) != NULL) { - if (strncmp(mentry->mnt_dir, "/mnt/", 5) == 0 - || strncmp(mentry->mnt_dir, "/storage/", 9) == 0) { - toUnmount.push_front(std::string(mentry->mnt_dir)); + auto test = std::string(mentry->mnt_dir); + if ((android::base::StartsWith(test, "/mnt/") && + !android::base::StartsWith(test, "/mnt/vendor")) || + android::base::StartsWith(test, "/storage/")) { + toUnmount.push_front(test); } } endmntent(fp);