Kill apps using storage through bind mounts.
When unmounting an emulated volume, look for apps with open files
using the final published volume path.
Without this change, we were only looking at the internal paths
used for runtime permissions, which apps never use directly. This
meant we'd always fail to unmount the volume if apps didn't respect
the EJECTING broadcast, and volume migration would end up wedged
until the device rebooted.
Bug: 24863778
Change-Id: Ibda484e66ab95744c304c344b226caa5b10b7e2e
diff --git a/EmulatedVolume.cpp b/EmulatedVolume.cpp
index 6e440cc..80ef3e2 100644
--- a/EmulatedVolume.cpp
+++ b/EmulatedVolume.cpp
@@ -113,6 +113,7 @@
mFusePid = 0;
}
+ KillProcessesUsingPath(getPath());
ForceUnmount(mFuseDefault);
ForceUnmount(mFuseRead);
ForceUnmount(mFuseWrite);