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/Utils.h b/Utils.h
index f33a379..228727a 100644
--- a/Utils.h
+++ b/Utils.h
@@ -49,6 +49,9 @@
/* Really unmounts the path, killing active processes along the way */
status_t ForceUnmount(const std::string& path);
+/* Kills any processes using given path */
+status_t KillProcessesUsingPath(const std::string& path);
+
/* Creates bind mount from source to target */
status_t BindMount(const std::string& source, const std::string& target);