Allow update_engine to communicate with apexd for size calculation
In this CL, we created a ApexHandlerAndroid that can communicate with
apexd via binders to get better estimate for how much space the
update_engine should reserve for capex decompression.
The size check is placed in update_attempter_android, which is also used
in binary for sideloading OTA. Sideloading binary runs during recovery
when binder calls, apexd and data parition are all not available. As
such, it doesn't make sense to reserve space when sideloading.
Bug: 172911822
Test: atest ApexHandlerAndroidTest
Test: atest UpdateAttempterAndroidTest
Test: manually served ota using `update_engine_client --allocate` and
observed full.tmp was written in /data/apex/ota_reserved
Change-Id: Iccf3d8c2db24e8d8f3406d0aaa65cbf707c9ae51
diff --git a/Android.bp b/Android.bp
index 4ec17f2..1658533 100644
--- a/Android.bp
+++ b/Android.bp
@@ -332,6 +332,7 @@
"PlatformProperties",
],
shared_libs: [
+ "apex_aidl_interface-cpp",
"libandroid_net",
"libbase",
"libbinder",
@@ -367,6 +368,7 @@
srcs: [
":libupdate_engine_aidl",
"common/system_state.cc",
+ "aosp/apex_handler_android.cc",
"aosp/binder_service_android.cc",
"aosp/binder_service_stable_android.cc",
"aosp/daemon_android.cc",
@@ -740,6 +742,7 @@
test_suites: ["device-tests"],
srcs: [
+ "aosp/apex_handler_android_unittest.cc",
"aosp/dynamic_partition_control_android_unittest.cc",
"aosp/update_attempter_android_unittest.cc",
"certificate_checker_unittest.cc",