From dbaddabffbbc25d8df8fb13f51eaff7d1c9ec9f1 Mon Sep 17 00:00:00 2001 From: Roshan Pius Date: Fri, 12 Jan 2024 13:46:24 -0800 Subject: [PATCH] build: Allow NFC stack to be delivered as a mainline module or APK These changes are necessary to allow NFC stack delivery to be properly trunk stable flagged: 1. Delivered as NfcNci.apk and framework-nfc.jar for Android U based builds (existing). 2. Delivered as com.android.nfcservices.apex which embeds NfcNci.apk & framework-nfc.jar for Android V based builds (new). Bug: 303286040 Test: Device boots up after flashing Test: atest CtsNfcTestCases (cherry picked from https://googleplex-android-review.googlesource.com/q/commit:046c1816091f9150c91953b8571dc946b0a59f86) Merged-In: Ib2170146d07763ff6c852ce810497ebe1ac2eead Change-Id: Ib2170146d07763ff6c852ce810497ebe1ac2eead --- target/product/base_system.mk | 11 ++++++++++- target/product/default_art_config.mk | 10 +++++++++- target/product/handheld_system.mk | 1 - 3 files changed, 19 insertions(+), 3 deletions(-) diff --git a/target/product/base_system.mk b/target/product/base_system.mk index 6a101da9d4..1a30fb7e89 100644 --- a/target/product/base_system.mk +++ b/target/product/base_system.mk @@ -94,7 +94,6 @@ PRODUCT_PACKAGES += \ framework-graphics \ framework-minus-apex \ framework-minus-apex-install-dependencies \ - framework-nfc \ framework-res \ framework-sysconfig.xml \ fsck.erofs \ @@ -302,6 +301,16 @@ ifneq ($(PRODUCT_NO_DYNAMIC_SYSTEM_UPDATE),true) endif +# Check if the build supports NFC apex or not +ifeq ($(RELEASE_PACKAGE_NFC_STACK),NfcNci) + PRODUCT_PACKAGES += \ + framework-nfc \ + NfcNci +else + PRODUCT_PACKAGES += \ + com.android.nfcservices +endif + # VINTF data for system image PRODUCT_PACKAGES += \ system_manifest.xml \ diff --git a/target/product/default_art_config.mk b/target/product/default_art_config.mk index 55fcf2fc80..de2a9fccb0 100644 --- a/target/product/default_art_config.mk +++ b/target/product/default_art_config.mk @@ -50,7 +50,6 @@ PRODUCT_TEST_ONLY_ART_BOOT_IMAGE_JARS := \ PRODUCT_BOOT_JARS += \ framework-minus-apex \ framework-graphics \ - framework-nfc \ ext \ telephony-common \ voip-common \ @@ -88,6 +87,15 @@ PRODUCT_APEX_BOOT_JARS := \ com.android.virt:framework-virtualization \ com.android.wifi:framework-wifi \ +# Check if the build supports NFC apex or not +ifeq ($(RELEASE_PACKAGE_NFC_STACK),NfcNci) + PRODUCT_BOOT_JARS += \ + framework-nfc +else + PRODUCT_APEX_BOOT_JARS := \ + com.android.nfcservices:framework-nfc +endif + # TODO(b/308174306): Adjust this after multiple prebuilts version is supported. # APEX boot jars that are not in prebuilt apexes. # Keep the list sorted by module names and then library names. diff --git a/target/product/handheld_system.mk b/target/product/handheld_system.mk index 3acf1e6ded..b5292d206b 100644 --- a/target/product/handheld_system.mk +++ b/target/product/handheld_system.mk @@ -73,7 +73,6 @@ PRODUCT_PACKAGES += \ UserDictionaryProvider \ VpnDialogs \ vr \ - $(RELEASE_PACKAGE_NFC_STACK) PRODUCT_SYSTEM_SERVER_APPS += \