summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean-Baptiste Queru <jbq@google.com>2012-05-08 09:55:55 -0700
committerandroid code review <noreply-gerritcodereview@google.com>2012-05-08 09:55:56 -0700
commit5cf6325c91792dbb1bb08fa1958c1fc8a5b9c45d (patch)
tree26775166f46cbb10fd767dccc26b9ca06dd2b1fc
parent3ad9072a5d6f6bda32123b367545649364e3c11d (diff)
parent627366196859339d72ab9f68a817dd395a13468f (diff)
downloadandroid_system_vold-5cf6325c91792dbb1bb08fa1958c1fc8a5b9c45d.tar.gz
android_system_vold-5cf6325c91792dbb1bb08fa1958c1fc8a5b9c45d.tar.bz2
android_system_vold-5cf6325c91792dbb1bb08fa1958c1fc8a5b9c45d.zip
Merge "Unshare ums when SD card is removed"
-rw-r--r--DirectVolume.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/DirectVolume.cpp b/DirectVolume.cpp
index 4acee76..c745c93 100644
--- a/DirectVolume.cpp
+++ b/DirectVolume.cpp
@@ -275,6 +275,11 @@ void DirectVolume::handleDiskRemoved(const char *devpath, NetlinkEvent *evt) {
int major = atoi(evt->findParam("MAJOR"));
int minor = atoi(evt->findParam("MINOR"));
char msg[255];
+ bool enabled;
+
+ if (mVm->shareEnabled(getLabel(), "ums", &enabled) == 0 && enabled) {
+ mVm->unshareVolume(getLabel(), "ums");
+ }
SLOGD("Volume %s %s disk %d:%d removed\n", getLabel(), getMountpoint(), major, minor);
snprintf(msg, sizeof(msg), "Volume %s %s disk removed (%d:%d)",