Install jni symlinks in Soong
The installation of the symlink (<partition>/app/MyApp/lib/<arch>/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
This commit is contained in:
@@ -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) {
|
||||
|
Reference in New Issue
Block a user