From a206b8cbf4f1fcbecde649c62aba42ef2b66620a Mon Sep 17 00:00:00 2001 From: Jiyong Park Date: Sat, 7 Mar 2020 16:36:09 +0900 Subject: [PATCH 1/5] Set apex_available property The marked library(ies) were available to the APEXes via the hand-written whitelist in build/soong/apex/apex.go. Trying to remove the whitelist by adding apex_available property to the Android.bp of the libraries. In this change, following libs were made available to all apexes because their usage is quite common and there is no reason to restrict them to some APEXes. * libbase_headers * libcutils, libcutils_headers * libutils_headers, libsystem_headers * liblog_headers * libbacktrace, libbacktrace_headers * libcrypto_utils Exempt-From-Owner-Approval: cherry-pick from aosp Bug: 150999716 Test: m Merged-In: If3d3652e6604ed4f6d7694fe7ac61ae496621026 (cherry picked from commit 8bf9b1632e4fadc6e960fa6697037c8fc6401a5c) Change-Id: If3d3652e6604ed4f6d7694fe7ac61ae496621026 --- base/Android.bp | 4 ++++ libbacktrace/Android.bp | 8 ++++++++ libcrypto_utils/Android.bp | 4 ++++ libcutils/Android.bp | 8 ++++++++ liblog/Android.bp | 4 ++++ libsystem/Android.bp | 4 ++++ libutils/Android.bp | 4 ++++ 7 files changed, 36 insertions(+) diff --git a/base/Android.bp b/base/Android.bp index 3702b43db..5b91078ba 100644 --- a/base/Android.bp +++ b/base/Android.bp @@ -47,6 +47,10 @@ cc_library_headers { enabled: true, }, }, + apex_available: [ + "//apex_available:anyapex", + "//apex_available:platform", + ], } cc_defaults { diff --git a/libbacktrace/Android.bp b/libbacktrace/Android.bp index aa18c4247..dc989a0a8 100644 --- a/libbacktrace/Android.bp +++ b/libbacktrace/Android.bp @@ -44,6 +44,10 @@ cc_library_headers { recovery_available: true, native_bridge_supported: true, export_include_dirs: ["include"], + apex_available: [ + "//apex_available:platform", + "//apex_available:anyapex", + ], } cc_defaults { @@ -92,6 +96,10 @@ cc_library { name: "libbacktrace", vendor_available: false, recovery_available: true, + apex_available: [ + "//apex_available:platform", + "//apex_available:anyapex", + ], vndk: { enabled: true, support_system_process: true, diff --git a/libcrypto_utils/Android.bp b/libcrypto_utils/Android.bp index e47560f79..d7175e0be 100644 --- a/libcrypto_utils/Android.bp +++ b/libcrypto_utils/Android.bp @@ -38,4 +38,8 @@ cc_library { enabled: true, }, }, + apex_available: [ + "//apex_available:platform", + "com.android.adbd", + ], } diff --git a/libcutils/Android.bp b/libcutils/Android.bp index c9eebfe7a..9ed7927e9 100644 --- a/libcutils/Android.bp +++ b/libcutils/Android.bp @@ -29,6 +29,10 @@ cc_library_headers { vendor_available: true, recovery_available: true, host_supported: true, + apex_available: [ + "//apex_available:platform", + "//apex_available:anyapex", + ], native_bridge_supported: true, export_include_dirs: ["include"], target: { @@ -134,6 +138,10 @@ cc_library { }, recovery_available: true, host_supported: true, + apex_available: [ + "//apex_available:platform", + "//apex_available:anyapex", + ], native_bridge_supported: true, srcs: [ "config_utils.cpp", diff --git a/liblog/Android.bp b/liblog/Android.bp index 841037066..0b98e1add 100644 --- a/liblog/Android.bp +++ b/liblog/Android.bp @@ -38,6 +38,10 @@ cc_library_headers { vendor_available: true, ramdisk_available: true, recovery_available: true, + apex_available: [ + "//apex_available:platform", + "//apex_available:anyapex", + ], native_bridge_supported: true, export_include_dirs: ["include"], system_shared_libs: [], diff --git a/libsystem/Android.bp b/libsystem/Android.bp index b265b61eb..ff886fd18 100644 --- a/libsystem/Android.bp +++ b/libsystem/Android.bp @@ -4,6 +4,10 @@ cc_library_headers { recovery_available: true, host_supported: true, native_bridge_supported: true, + apex_available: [ + "//apex_available:platform", + "//apex_available:anyapex", + ], export_include_dirs: ["include"], target: { diff --git a/libutils/Android.bp b/libutils/Android.bp index 33117936c..7405c9647 100644 --- a/libutils/Android.bp +++ b/libutils/Android.bp @@ -18,6 +18,10 @@ cc_library_headers { recovery_available: true, host_supported: true, native_bridge_supported: true, + apex_available: [ + "//apex_available:platform", + "//apex_available:anyapex", + ], header_libs: [ "liblog_headers", From 137fb1ff1e430e9e86b829b8a89bf06ae3362956 Mon Sep 17 00:00:00 2001 From: Jiyong Park Date: Tue, 10 Mar 2020 18:31:02 +0900 Subject: [PATCH 2/5] Set apex_available property The marked library(ies) were available to the adbd APEX via the hand-written whitelist in build/soong/apex/apex.go. Trying to remove the whitelist by adding apex_available property to the Android.bp of the libraries. Exempt-From-Owner-Approval: already +2'ed by the owner (enh) Bug: 150999716 Bug: 151398197 Test: m Merged-In: I8b572e3c4e76bd10c0443a6c08b72e9519243ab5 (cherry picked from commit d25bb60e056b2b68aaeead3025d8024eaf8e8b8d) Change-Id: I8b572e3c4e76bd10c0443a6c08b72e9519243ab5 --- adb/Android.bp | 2 ++ adb/libs/adbconnection/Android.bp | 5 +++++ diagnose_usb/Android.bp | 5 +++++ libasyncio/Android.bp | 4 ++++ qemu_pipe/Android.bp | 5 +++++ 5 files changed, 21 insertions(+) diff --git a/adb/Android.bp b/adb/Android.bp index 0af82e1d1..d3656485b 100644 --- a/adb/Android.bp +++ b/adb/Android.bp @@ -498,6 +498,7 @@ cc_library { name: "libadbd", defaults: ["adbd_defaults", "host_adbd_supported"], recovery_available: true, + apex_available: ["com.android.adbd"], // avoid getting duplicate symbol of android::build::getbuildnumber(). use_version_lib: false, @@ -550,6 +551,7 @@ cc_binary { defaults: ["adbd_defaults", "host_adbd_supported", "libadbd_binary_dependencies"], stl: "libc++_static", recovery_available: true, + apex_available: ["com.android.adbd"], srcs: [ "daemon/main.cpp", diff --git a/adb/libs/adbconnection/Android.bp b/adb/libs/adbconnection/Android.bp index f6b0a4239..ce2ab51ef 100644 --- a/adb/libs/adbconnection/Android.bp +++ b/adb/libs/adbconnection/Android.bp @@ -18,6 +18,11 @@ cc_library { use_version_lib: false, recovery_available: true, + apex_available: [ + "com.android.adbd", + // TODO(b/151398197) remove the below + "//apex_available:platform", + ], compile_multilib: "both", } diff --git a/diagnose_usb/Android.bp b/diagnose_usb/Android.bp index 6bee28c10..93d13bd56 100644 --- a/diagnose_usb/Android.bp +++ b/diagnose_usb/Android.bp @@ -3,6 +3,11 @@ cc_library_static { cflags: ["-Wall", "-Wextra", "-Werror"], host_supported: true, recovery_available: true, + apex_available: [ + "com.android.adbd", + // TODO(b/151398197) remove the below + "//apex_available:platform", + ], target: { windows: { enabled: true, diff --git a/libasyncio/Android.bp b/libasyncio/Android.bp index 4ab439d57..44e7933c3 100644 --- a/libasyncio/Android.bp +++ b/libasyncio/Android.bp @@ -28,6 +28,10 @@ cc_library { defaults: ["libasyncio_defaults"], vendor_available: true, recovery_available: true, + apex_available: [ + "//apex_available:platform", + "com.android.adbd", + ], host_supported: true, srcs: [ "AsyncIO.cpp", diff --git a/qemu_pipe/Android.bp b/qemu_pipe/Android.bp index c6bda4a28..ad86a4e6d 100644 --- a/qemu_pipe/Android.bp +++ b/qemu_pipe/Android.bp @@ -4,6 +4,11 @@ cc_library_static { name: "libqemu_pipe", vendor_available: true, recovery_available: true, + apex_available: [ + "com.android.adbd", + // TODO(b/151398197) remove the below + "//apex_available:platform", + ], sanitize: { misc_undefined: ["integer"], }, From 5390bee3f409c863af3ebf344344b2d7c5b22257 Mon Sep 17 00:00:00 2001 From: Jiyong Park Date: Wed, 8 Apr 2020 22:37:42 +0900 Subject: [PATCH 3/5] Set apex_available property The marked library(ies) were available to the APEXes via the hand-written whitelist in build/soong/apex/apex.go. Trying to remove the whitelist by adding apex_available property to the Android.bp of the libraries. Exempt-From-Owner-Approval: cherry-pick from AOSP Bug: 150999716 Test: m Merged-In: Id08058f3105463558c6c82298344a33af0efb2d3 (cherry picked from commit e3d371e319d93e415c729d6feb6fb0ee2562816f) Change-Id: Id08058f3105463558c6c82298344a33af0efb2d3 --- libprocessgroup/Android.bp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/libprocessgroup/Android.bp b/libprocessgroup/Android.bp index 618a5c57a..2c1b25558 100644 --- a/libprocessgroup/Android.bp +++ b/libprocessgroup/Android.bp @@ -13,6 +13,10 @@ cc_library_headers { enabled: true, }, }, + apex_available: [ + "//apex_available:platform", + "//apex_available:anyapex", + ], } cc_library { @@ -52,4 +56,8 @@ cc_library { "-Werror", "-Wexit-time-destructors", ], + apex_available: [ + "//apex_available:platform", + "//apex_available:anyapex", + ], } From a6bcd4817c494672f95aa39cddda28fc7f6ded91 Mon Sep 17 00:00:00 2001 From: Jiyong Park Date: Wed, 8 Apr 2020 23:40:03 +0900 Subject: [PATCH 4/5] Set apex_available property The marked library(ies) were available to the APEXes via the hand-written whitelist in build/soong/apex/apex.go. Trying to remove the whitelist by adding apex_available property to the Android.bp of the libraries. Exempt-From-Owner-Approval: cherry-pick from AOSP Bug: 150999716 Test: m Merged-In: I8fd2a3c9b69454c6018c72f5198898bc90dc4d0d (cherry picked from commit 937b4bf173caa185ff437ca2c7b4030b5c8aa056) Change-Id: I8fd2a3c9b69454c6018c72f5198898bc90dc4d0d --- libstats/push_compat/Android.bp | 1 + libstats/socket/Android.bp | 1 + 2 files changed, 2 insertions(+) diff --git a/libstats/push_compat/Android.bp b/libstats/push_compat/Android.bp index f0fcff604..2f7212fed 100644 --- a/libstats/push_compat/Android.bp +++ b/libstats/push_compat/Android.bp @@ -49,6 +49,7 @@ cc_library { "libstatssocket_headers", ], static_libs: ["libgtest_prod"], + apex_available: ["com.android.resolv"], } cc_test { diff --git a/libstats/socket/Android.bp b/libstats/socket/Android.bp index c86d65031..8c12fe0c4 100644 --- a/libstats/socket/Android.bp +++ b/libstats/socket/Android.bp @@ -85,6 +85,7 @@ cc_library_headers { name: "libstatssocket_headers", export_include_dirs: ["include"], host_supported: true, + apex_available: ["com.android.resolv"], } cc_benchmark { From d11e67d88d8335f8aa29d845e7d88752486dfaf0 Mon Sep 17 00:00:00 2001 From: Josh Gao Date: Mon, 16 Mar 2020 12:48:18 -0700 Subject: [PATCH 5/5] adbd: add apex_available and visibility for internal libs. abb links against libadbd_core for the shell protocol, and must be on the system image because it links against cmd, so let's just expose it to abb for now. Exempt-From-Owner-Approval: cherry-pick from AOSP Bug: http://b/151398197 Test: treehugger Merged-In: Id926bc4324d3259def21ea19d3bd72320311a6e3 (cherry picked from commit b56730333007c59689e43f65383f2728556926b7) Change-Id: Id926bc4324d3259def21ea19d3bd72320311a6e3 --- adb/Android.bp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/adb/Android.bp b/adb/Android.bp index d3656485b..7eb0839b1 100644 --- a/adb/Android.bp +++ b/adb/Android.bp @@ -425,6 +425,15 @@ cc_library_static { ], } }, + + apex_available: [ + "//apex_available:platform", + "com.android.adbd", + ], + visibility: [ + "//bootable/recovery/minadbd", + "//system/core/adb", + ], } cc_library { @@ -492,6 +501,15 @@ cc_library { ], }, }, + + apex_available: [ + "//apex_available:platform", + "com.android.adbd", + ], + visibility: [ + "//system/core/adb", + ], + } cc_library {