From 4f487c5b565717f64c91dcdabb9233324bf9a6ba Mon Sep 17 00:00:00 2001 From: Jiyong Park Date: Wed, 15 May 2024 03:21:26 +0900 Subject: Install jni symlinks in Soong The installation of the symlink (/app/MyApp/lib//libfoo.so) and its target (/system/lib64/libfoo.so) are now done int Soong. I gave up the idea of always embedding jni libs to apps, due to a hard-to-fix regression in storage usage. Specifically, consider this case. app --(jni_lib)--> libfoo --(jni_lib)--> libbar libfoo --(shared_lib)--> libbar Ideally, with the embedding idea, both libfoo and libbar should be embedded into the app and there should be no libfoo or libbar outside of the apk, unless there's no dependency to any of them from outside of the apk. However, the previous implementation installed libbar to /system/lib64, leading two copies of the lib; one in /system/lib64, the other in the apk. This was happening because libbar was also considered as a transitive dep of libfoo, and therefore a dependency to its installation path is added to the apk. The problem here is that the app doesn't know that libfoo depends on libbar. We in theory can write a very delicate dependency traverse routine which filters libbar out of the transitive deps, but that looked too complicated. Bug: 339923078 Bug: 330276359 Test: Build and watch any bloatbuster warning Test: m aosp_cf_system_x86_64 The following three files are found * system/lib64/libnfc_nci_jni.so * system/etc/libnfc-nci.conf * system/priv-app/NfcNci/lib/arm64/libnfc_nci_jni.so Change-Id: I0930cb1ebb8ca8a6efd64b1ce2cdfd1c47fe19ef --- java/java.go | 1 + 1 file changed, 1 insertion(+) (limited to 'java/java.go') diff --git a/java/java.go b/java/java.go index 0df96a3a5..249480428 100644 --- a/java/java.go +++ b/java/java.go @@ -491,6 +491,7 @@ type jniLib struct { coverageFile android.OptionalPath unstrippedFile android.Path partition string + installPaths android.InstallPaths } func sdkDeps(ctx android.BottomUpMutatorContext, sdkContext android.SdkContext, d dexer) { -- cgit v1.2.3-59-g8ed1b