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/VoldNativeService.h b/VoldNativeService.h
index b6b5d75..a00010b 100644
--- a/VoldNativeService.h
+++ b/VoldNativeService.h
@@ -48,9 +48,11 @@
binder::Status mount(const std::string& volId, int32_t mountFlags, int32_t mountUserId);
binder::Status unmount(const std::string& volId);
binder::Status format(const std::string& volId, const std::string& fsType);
- binder::Status benchmark(const std::string& volId, int64_t* _aidl_return);
+ binder::Status benchmark(const std::string& volId,
+ const android::sp<android::os::IVoldTaskListener>& listener);
- binder::Status moveStorage(const std::string& fromVolId, const std::string& toVolId);
+ binder::Status moveStorage(const std::string& fromVolId, const std::string& toVolId,
+ const android::sp<android::os::IVoldTaskListener>& listener);
binder::Status remountUid(int32_t uid, int32_t remountMode);
@@ -60,7 +62,8 @@
int32_t ownerGid, std::string* _aidl_return);
binder::Status destroyObb(const std::string& volId);
- binder::Status fstrim(int32_t fstrimFlags);
+ binder::Status fstrim(int32_t fstrimFlags,
+ const android::sp<android::os::IVoldTaskListener>& listener);
binder::Status mountAppFuse(int32_t uid, int32_t pid, int32_t mountId,
android::base::unique_fd* _aidl_return);