From 1010fff193519427379f2d4909ac45e41dba887a Mon Sep 17 00:00:00 2001 From: Jiyong Park Date: Tue, 12 Oct 2021 16:50:21 +0900 Subject: [PATCH] Add NEED_AIDL_NDK_PLATFORM_BACKEND The config variable is used to force the generation of the AIDL ndk_platform backend which will eventually be removed in favor of the ndk backend. The switch is needed as an escape hatch for some devices whose BSP (outsourced and thus hardly modifiable) depends on the ndk_backend libraries. Bug: 161456198 Test: m Merged-In: I62c995642b820419eaeedeee616c47aee1da251d Change-Id: I62c995642b820419eaeedeee616c47aee1da251d (cherry picked from commit ee29502db26a8835980403ef37564beb6c5a0a1c) --- core/soong_config.mk | 2 ++ target/product/gsi/Android.mk | 24 +++++++++++++++++++----- target/product/gsi/current.txt | 31 ------------------------------- 3 files changed, 21 insertions(+), 36 deletions(-) diff --git a/core/soong_config.mk b/core/soong_config.mk index 49994646d4..837ed4f071 100644 --- a/core/soong_config.mk +++ b/core/soong_config.mk @@ -271,6 +271,8 @@ $(call add_json_bool, SepolicySplit, $(filter true,$(PRODUCT_SEPOLICY_SPLIT))) $(call add_json_list, SepolicyFreezeTestExtraDirs, $(SEPOLICY_FREEZE_TEST_EXTRA_DIRS)) $(call add_json_list, SepolicyFreezeTestExtraPrebuiltDirs, $(SEPOLICY_FREEZE_TEST_EXTRA_PREBUILT_DIRS)) +$(call add_json_bool, GenerateAidlNdkPlatformBackend, $(filter true,$(NEED_AIDL_NDK_PLATFORM_BACKEND))) + $(call json_end) $(file >$(SOONG_VARIABLES).tmp,$(json_contents)) diff --git a/target/product/gsi/Android.mk b/target/product/gsi/Android.mk index 39848e534a..0d788fad44 100644 --- a/target/product/gsi/Android.mk +++ b/target/product/gsi/Android.mk @@ -50,11 +50,21 @@ else _vndk_check_failure_message += " Run \`update-vndk-list.sh\` to update $(LATEST_VNDK_LIB_LIST)" endif +# The *-ndk_platform.so libraries no longer exist and are removed from the VNDK set. However, they +# can exist if NEED_AIDL_NDK_PLATFORM_BACKEND is set to true for legacy devices. Don't be bothered +# with the extraneous libraries. +ifeq ($(NEED_AIDL_NDK_PLATFORM_BACKEND),true) + _READ_INTERNAL_VNDK_LIB_LIST := sed /ndk_platform.so/d $(INTERNAL_VNDK_LIB_LIST) +else + _READ_INTERNAL_VNDK_LIB_LIST := cat $(INTERNAL_VNDK_LIB_LIST) +endif + $(check-vndk-list-timestamp): $(INTERNAL_VNDK_LIB_LIST) $(LATEST_VNDK_LIB_LIST) $(HOST_OUT_EXECUTABLES)/update-vndk-list.sh - $(hide) ( diff --old-line-format="Removed %L" \ + $(hide) ($(_READ_INTERNAL_VNDK_LIB_LIST) | \ + diff --old-line-format="Removed %L" \ --new-line-format="Added %L" \ --unchanged-line-format="" \ - $(LATEST_VNDK_LIB_LIST) $(INTERNAL_VNDK_LIB_LIST) \ + $(LATEST_VNDK_LIB_LIST) - \ || ( echo -e $(_vndk_check_failure_message); exit 1 )) $(hide) mkdir -p $(dir $@) $(hide) touch $@ @@ -84,9 +94,13 @@ else echo " echo Run lunch or choosecombo first" >> $@; \ echo " exit 1" >> $@; \ echo "fi" >> $@; \ - echo "cd \$${ANDROID_BUILD_TOP}" >> $@; \ - echo "cp $(PRIVATE_INTERNAL_VNDK_LIB_LIST) $(PRIVATE_LATEST_VNDK_LIB_LIST)" >> $@; \ - echo "echo $(PRIVATE_LATEST_VNDK_LIB_LIST) updated." >> $@ + echo "cd \$${ANDROID_BUILD_TOP}" >> $@ +ifeq ($(NEED_AIDL_NDK_PLATFORM_BACKEND),true) + $(hide) echo "sed /ndk_platform.so/d $(PRIVATE_INTERNAL_VNDK_LIB_LIST) > $(PRIVATE_LATEST_VNDK_LIB_LIST)" >> $@ +else + $(hide) echo "cp $(PRIVATE_INTERNAL_VNDK_LIB_LIST) $(PRIVATE_LATEST_VNDK_LIB_LIST)" >> $@ +endif + $(hide) echo "echo $(PRIVATE_LATEST_VNDK_LIB_LIST) updated." >> $@ endif @chmod a+x $@ diff --git a/target/product/gsi/current.txt b/target/product/gsi/current.txt index 285c8c7c2f..1e6a128fe5 100644 --- a/target/product/gsi/current.txt +++ b/target/product/gsi/current.txt @@ -19,11 +19,8 @@ LLNDK: libsync.so LLNDK: libvndksupport.so LLNDK: libvulkan.so VNDK-SP: android.hardware.common-V2-ndk.so -VNDK-SP: android.hardware.common-V2-ndk_platform.so VNDK-SP: android.hardware.common.fmq-V1-ndk.so -VNDK-SP: android.hardware.common.fmq-V1-ndk_platform.so VNDK-SP: android.hardware.graphics.common-V2-ndk.so -VNDK-SP: android.hardware.graphics.common-V2-ndk_platform.so VNDK-SP: android.hardware.graphics.common@1.0.so VNDK-SP: android.hardware.graphics.common@1.1.so VNDK-SP: android.hardware.graphics.common@1.2.so @@ -61,78 +58,50 @@ VNDK-SP: libutilscallstack.so VNDK-SP: libz.so VNDK-core: android.hardware.audio.common@2.0.so VNDK-core: android.hardware.authsecret-V1-ndk.so -VNDK-core: android.hardware.authsecret-V1-ndk_platform.so VNDK-core: android.hardware.automotive.occupant_awareness-V1-ndk.so -VNDK-core: android.hardware.automotive.occupant_awareness-V1-ndk_platform.so VNDK-core: android.hardware.configstore-utils.so VNDK-core: android.hardware.configstore@1.0.so VNDK-core: android.hardware.configstore@1.1.so VNDK-core: android.hardware.confirmationui-support-lib.so VNDK-core: android.hardware.gnss-V1-ndk.so -VNDK-core: android.hardware.gnss-V1-ndk_platform.so VNDK-core: android.hardware.graphics.allocator@2.0.so VNDK-core: android.hardware.graphics.allocator@3.0.so VNDK-core: android.hardware.graphics.allocator@4.0.so VNDK-core: android.hardware.graphics.bufferqueue@1.0.so VNDK-core: android.hardware.graphics.bufferqueue@2.0.so VNDK-core: android.hardware.health.storage-V1-ndk.so -VNDK-core: android.hardware.health.storage-V1-ndk_platform.so VNDK-core: android.hardware.identity-V3-ndk.so -VNDK-core: android.hardware.identity-V3-ndk_platform.so VNDK-core: android.hardware.keymaster-V3-ndk.so -VNDK-core: android.hardware.keymaster-V3-ndk_platform.so VNDK-core: android.hardware.light-V1-ndk.so -VNDK-core: android.hardware.light-V1-ndk_platform.so VNDK-core: android.hardware.media.bufferpool@2.0.so VNDK-core: android.hardware.media.omx@1.0.so VNDK-core: android.hardware.media@1.0.so VNDK-core: android.hardware.memtrack-V1-ndk.so -VNDK-core: android.hardware.memtrack-V1-ndk_platform.so VNDK-core: android.hardware.memtrack@1.0.so VNDK-core: android.hardware.oemlock-V1-ndk.so -VNDK-core: android.hardware.oemlock-V1-ndk_platform.so VNDK-core: android.hardware.power-V2-ndk.so -VNDK-core: android.hardware.power-V2-ndk_platform.so VNDK-core: android.hardware.power.stats-V1-ndk.so -VNDK-core: android.hardware.power.stats-V1-ndk_platform.so VNDK-core: android.hardware.radio-V1-ndk.so -VNDK-core: android.hardware.radio-V1-ndk_platform.so VNDK-core: android.hardware.radio.config-V1-ndk.so -VNDK-core: android.hardware.radio.config-V1-ndk_platform.so VNDK-core: android.hardware.radio.data-V1-ndk.so -VNDK-core: android.hardware.radio.data-V1-ndk_platform.so VNDK-core: android.hardware.radio.messaging-V1-ndk.so -VNDK-core: android.hardware.radio.messaging-V1-ndk_platform.so VNDK-core: android.hardware.radio.modem-V1-ndk.so -VNDK-core: android.hardware.radio.modem-V1-ndk_platform.so VNDK-core: android.hardware.radio.network-V1-ndk.so -VNDK-core: android.hardware.radio.network-V1-ndk_platform.so VNDK-core: android.hardware.radio.sim-V1-ndk.so -VNDK-core: android.hardware.radio.sim-V1-ndk_platform.so VNDK-core: android.hardware.radio.voice-V1-ndk.so -VNDK-core: android.hardware.radio.voice-V1-ndk_platform.so VNDK-core: android.hardware.rebootescrow-V1-ndk.so -VNDK-core: android.hardware.rebootescrow-V1-ndk_platform.so VNDK-core: android.hardware.security.keymint-V1-ndk.so -VNDK-core: android.hardware.security.keymint-V1-ndk_platform.so VNDK-core: android.hardware.security.secureclock-V1-ndk.so -VNDK-core: android.hardware.security.secureclock-V1-ndk_platform.so VNDK-core: android.hardware.security.sharedsecret-V1-ndk.so -VNDK-core: android.hardware.security.sharedsecret-V1-ndk_platform.so VNDK-core: android.hardware.soundtrigger@2.0-core.so VNDK-core: android.hardware.soundtrigger@2.0.so VNDK-core: android.hardware.vibrator-V2-ndk.so -VNDK-core: android.hardware.vibrator-V2-ndk_platform.so VNDK-core: android.hardware.weaver-V1-ndk.so -VNDK-core: android.hardware.weaver-V1-ndk_platform.so VNDK-core: android.hardware.wifi.hostapd-V1-ndk.so -VNDK-core: android.hardware.wifi.hostapd-V1-ndk_platform.so VNDK-core: android.hidl.token@1.0-utils.so VNDK-core: android.hidl.token@1.0.so VNDK-core: android.system.keystore2-V1-ndk.so -VNDK-core: android.system.keystore2-V1-ndk_platform.so VNDK-core: android.system.suspend-V1-ndk.so -VNDK-core: android.system.suspend-V1-ndk_platform.so VNDK-core: android.system.suspend@1.0.so VNDK-core: libaudioroute.so VNDK-core: libaudioutils.so