diff --git a/system/vold/DirectVolume.cpp b/system/vold/DirectVolume.cpp old mode 100755 new mode 100644 index ec675e4a89..9cc0adb4d9 --- a/system/vold/DirectVolume.cpp +++ b/system/vold/DirectVolume.cpp @@ -746,6 +746,14 @@ void DirectVolume::handlePartitionRemoved(const char * /*devpath*/, */ bool providesAsec = (getFlags() & VOL_PROVIDES_ASEC) != 0; + if(providesAsec){ + + snprintf(msg, sizeof(msg), "Volume %s %s unmount (%d:%d)", + getLabel(), getMountpoint(), major, minor); + mVm->getBroadcaster()->sendBroadcast(ResponseCode::VolumeUnmount, + msg, false); + sleep(2); + } if (providesAsec && mVm->cleanupAsec(this, true)) { SLOGE("Failed to cleanup ASEC - unmount will probably fail!"); } diff --git a/system/vold/ResponseCode.h b/system/vold/ResponseCode.h old mode 100755 new mode 100644 index 25581efb31..859b79a0da --- a/system/vold/ResponseCode.h +++ b/system/vold/ResponseCode.h @@ -68,7 +68,7 @@ public: /* $_rbox_$_modify_$_huangyonglin: added for adding the partition command */ static const int VolumePartitionAdded = 633; /* $_rbox_$_modify_$ end */ - + static const int VolumeUnmount = 634; static int convertFromErrno(); }; #endif