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/Android.mk b/Android.mk
index ccbbb56..78d60df 100644
--- a/Android.mk
+++ b/Android.mk
@@ -26,7 +26,7 @@
model/ObbVolume.cpp \
Utils.cpp \
MoveTask.cpp \
- Benchmark.cpp \
+ BenchmarkTask.cpp \
TrimTask.cpp \
KeyBuffer.cpp \
Keymaster.cpp \
@@ -36,9 +36,16 @@
secontext.cpp \
EncryptInplace.cpp \
MetadataCrypt.cpp \
+ VoldNativeService.cpp \
+
+common_aidl_files := \
binder/android/os/IVold.aidl \
binder/android/os/IVoldListener.aidl \
- VoldNativeService.cpp \
+ binder/android/os/IVoldTaskListener.aidl \
+
+common_aidl_includes := \
+ $(LOCAL_PATH)/binder \
+ frameworks/native/aidl/binder \
common_c_includes := \
system/extras/f2fs_utils \
@@ -101,7 +108,7 @@
LOCAL_TIDY := $(common_local_tidy_enabled)
LOCAL_TIDY_FLAGS := $(common_local_tidy_flags)
LOCAL_TIDY_CHECKS := $(common_local_tidy_checks)
-LOCAL_SRC_FILES := $(common_src_files)
+LOCAL_SRC_FILES := $(common_src_files) $(common_aidl_files)
LOCAL_C_INCLUDES := $(common_c_includes)
LOCAL_SHARED_LIBRARIES := $(common_shared_libraries)
LOCAL_STATIC_LIBRARIES := $(common_static_libraries)
@@ -110,7 +117,7 @@
LOCAL_CONLYFLAGS := $(vold_conlyflags)
LOCAL_REQUIRED_MODULES := $(required_modules)
-LOCAL_AIDL_INCLUDES := $(LOCAL_PATH)/binder
+LOCAL_AIDL_INCLUDES := $(common_aidl_includes)
include $(BUILD_STATIC_LIBRARY)
@@ -124,7 +131,8 @@
LOCAL_TIDY_CHECKS := $(common_local_tidy_checks)
LOCAL_SRC_FILES := \
main.cpp \
- $(common_src_files)
+ $(common_src_files) \
+ $(common_aidl_files) \
LOCAL_INIT_RC := vold.rc
@@ -136,7 +144,7 @@
LOCAL_STATIC_LIBRARIES := $(common_static_libraries)
LOCAL_REQUIRED_MODULES := $(required_modules)
-LOCAL_AIDL_INCLUDES := $(LOCAL_PATH)/binder
+LOCAL_AIDL_INCLUDES := $(common_aidl_includes)
include $(BUILD_EXECUTABLE)
@@ -150,8 +158,7 @@
LOCAL_SRC_FILES := \
vdc.cpp \
- binder/android/os/IVold.aidl \
- binder/android/os/IVoldListener.aidl \
+ $(common_aidl_files) \
LOCAL_MODULE := vdc
LOCAL_SHARED_LIBRARIES := libbase libbinder libcutils libutils
@@ -159,7 +166,7 @@
LOCAL_CONLYFLAGS := $(vold_conlyflags)
LOCAL_INIT_RC := vdc.rc
-LOCAL_AIDL_INCLUDES := $(LOCAL_PATH)/binder
+LOCAL_AIDL_INCLUDES := $(common_aidl_includes)
include $(BUILD_EXECUTABLE)