From 4fd4f89591fe826cf26167bccaeb2802f14fbdc8 Mon Sep 17 00:00:00 2001 From: Tao Bao Date: Mon, 6 Aug 2018 16:16:14 -0700 Subject: Build and use minadbd as a shared library. The former `minadbd` module is now built as a shared library (`libminadbd_services.so`) that serves sideloading under recovery, with a dynamic dependency on `libadbd.so`. This allows sharing and reusing libadbd code on device (both of `adbd` and `recovery` now uses `libadbd.so`). As a result, it reduces the size of `recovery` binary from 1407360-byte to (1272880 + 33032)-byte (aosp_marlin-userdebug). Bug: 78793464 Test: `m -j bootimage` with aosp_marlin-userdebug Test: Run minadbd_test on marlin. Test: Boot into recovery and verify that sideloading still works. Change-Id: I6c2bc3d351d5af71220a9b9f956c8c039e52c781 --- minadbd/Android.bp | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'minadbd/Android.bp') diff --git a/minadbd/Android.bp b/minadbd/Android.bp index 432b2f0f5..8ccce4f42 100644 --- a/minadbd/Android.bp +++ b/minadbd/Android.bp @@ -26,8 +26,9 @@ cc_defaults { ], } -cc_library_static { - name: "libminadbd", +cc_library { + name: "libminadbd_services", + recovery_available: true, defaults: [ "minadbd_defaults", @@ -39,14 +40,14 @@ cc_library_static { "minadbd_services.cpp", ], - static_libs: [ - "libfusesideload", + shared_libs: [ + "libadbd", "libbase", "libcrypto", ], - whole_static_libs: [ - "libadbd", + static_libs: [ + "libfusesideload", ], } @@ -62,8 +63,9 @@ cc_test { ], static_libs: [ + "libminadbd_services", + "libadbd", "libBionicGtestMain", - "libminadbd", ], shared_libs: [ -- cgit v1.2.3