From 33cbf8b14c9805c86a3db7361110d7188f7ad4b6 Mon Sep 17 00:00:00 2001 From: Orion Hodson Date: Mon, 8 Feb 2021 16:17:07 +0000 Subject: [PATCH] libandroid_runtime,libhwui: use libnativehelper_lazy This change updates the dependencies of bootanimation to use a new static library, libnativehelper_lazy, that loads libnativehelper on demand. This means boot animation no longer depends on libnativehelper.so. The affected frameworks libraries will load libnativehelper lazily as-needed. This change enables the removal of the ART APEX from the bootstrap APEXes. The ART APEX provides libnativehelper.so and this is no longer required during boot for bootanimation. Removing ART from the bootstrap APEXes allows for compressing the system installed ART APEX after an ART APEX update is applied and saves tens of megabytes of storage. Bug: 179115178 Test: TH Test: manual inspection of the transitive dependencies of bootanimation. Change-Id: I4fd3f34afc120462088e8f2c015d3cb19aca86dd --- core/jni/Android.bp | 10 ++++++---- libs/hwui/Android.bp | 3 ++- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/core/jni/Android.bp b/core/jni/Android.bp index 9510f2700fe22..841703ebf31d0 100644 --- a/core/jni/Android.bp +++ b/core/jni/Android.bp @@ -49,11 +49,12 @@ cc_library_shared { "libhwui", "liblog", "libminikin", - "libnativehelper", "libz", "libziparchive", ], + static_libs: ["libnativehelper_lazy"], + export_include_dirs: [ ".", "include", @@ -271,12 +272,13 @@ cc_library_shared { "libstatspull", ], export_shared_lib_headers: [ - // AndroidRuntime.h depends on nativehelper/jni.h - "libnativehelper", - // our headers include libnativewindow's public headers "libnativewindow", ], + export_static_lib_headers: [ + // AndroidRuntime.h depends on nativehelper/jni.h + "libnativehelper_lazy", + ], header_libs: [ "bionic_libc_platform_headers", "dnsproxyd_protocol_headers", diff --git a/libs/hwui/Android.bp b/libs/hwui/Android.bp index f481228582676..004d279923cc4 100644 --- a/libs/hwui/Android.bp +++ b/libs/hwui/Android.bp @@ -357,12 +357,13 @@ cc_defaults { "libharfbuzz_ng", "liblog", "libminikin", - "libnativehelper", "libz", "libziparchive", "libjpeg", ], + static_libs: ["libnativehelper_lazy"], + target: { android: { srcs: [ // sources that depend on android only libraries