Move long-running calls to async with listeners.

Now that we're using Binder, we can have callers provide explicit
listeners for every request instead of trying to squeeze them all
into unsolicited socket events.

Move benchmarking to be async to avoid blocking other commands for
up to several minutes.  Remove post-trim benchmarking flag, since
benchmarking now requires a separate callback.  Will bring back in
a future CL.

Test: cts-tradefed run commandAndExit cts-dev -m CtsAppSecurityHostTestCases -t android.appsecurity.cts.AdoptableHostTest
Test: adb shell sm fstrim
Bug: 62201209, 13758960
Change-Id: I0f2ebf1ac3b4252ecd6b44303f2887adfdb58e86
diff --git a/binder/android/os/IVold.aidl b/binder/android/os/IVold.aidl
index 0a05e6e..1736829 100644
--- a/binder/android/os/IVold.aidl
+++ b/binder/android/os/IVold.aidl
@@ -17,6 +17,7 @@
 package android.os;
 
 import android.os.IVoldListener;
+import android.os.IVoldTaskListener;
 
 /** {@hide} */
 interface IVold {
@@ -37,9 +38,10 @@
     void mount(@utf8InCpp String volId, int mountFlags, int mountUserId);
     void unmount(@utf8InCpp String volId);
     void format(@utf8InCpp String volId, @utf8InCpp String fsType);
-    long benchmark(@utf8InCpp String volId);
+    void benchmark(@utf8InCpp String volId, IVoldTaskListener listener);
 
-    void moveStorage(@utf8InCpp String fromVolId, @utf8InCpp String toVolId);
+    void moveStorage(@utf8InCpp String fromVolId, @utf8InCpp String toVolId,
+            IVoldTaskListener listener);
 
     void remountUid(int uid, int remountMode);
 
@@ -49,7 +51,7 @@
             @utf8InCpp String sourceKey, int ownerGid);
     void destroyObb(@utf8InCpp String volId);
 
-    void fstrim(int fstrimFlags);
+    void fstrim(int fstrimFlags, IVoldTaskListener listener);
 
     FileDescriptor mountAppFuse(int uid, int pid, int mountId);
     void unmountAppFuse(int uid, int pid, int mountId);
@@ -98,7 +100,6 @@
     const int ENCRYPTION_STATE_ERROR_CORRUPT = -4;
 
     const int FSTRIM_FLAG_DEEP_TRIM = 1;
-    const int FSTRIM_FLAG_BENCHMARK_AFTER = 2;
 
     const int MOUNT_FLAG_PRIMARY = 1;
     const int MOUNT_FLAG_VISIBLE = 2;