vold: Ensure we cleanup secure containers on card removal.

Fixes bug: http://b/issue?id=2567572

Note: The framework will still likely restart since the system_server
is holding references to assets on the card which are mmaped, but
at least now storage will be available when a new card is re-inserted.

Change-Id: I4e195c0c666426b93da47198fa826a6f58d855a9
Signed-off-by: San Mehat <san@google.com>
diff --git a/DirectVolume.cpp b/DirectVolume.cpp
index c269303..1f9f084 100644
--- a/DirectVolume.cpp
+++ b/DirectVolume.cpp
@@ -284,6 +284,11 @@
                  getLabel(), getMountpoint(), major, minor);
         mVm->getBroadcaster()->sendBroadcast(ResponseCode::VolumeBadRemoval,
                                              msg, false);
+
+	if (mVm->cleanupAsec(this, true)) {
+            SLOGE("Failed to cleanup ASEC - unmount will probably fail!");
+        }
+
         if (Volume::unmountVol(true)) {
             SLOGE("Failed to unmount volume on bad removal (%s)", 
                  strerror(errno));