Merge "build: Allow NFC stack to be delivered as a mainline module or APK" into main
diff --git a/target/product/base_system.mk b/target/product/base_system.mk
index 6a101da9..1a30fb7 100644
--- a/target/product/base_system.mk
+++ b/target/product/base_system.mk
@@ -94,7 +94,6 @@
framework-graphics \
framework-minus-apex \
framework-minus-apex-install-dependencies \
- framework-nfc \
framework-res \
framework-sysconfig.xml \
fsck.erofs \
@@ -302,6 +301,16 @@
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 55fcf2f..de2a9fc 100644
--- a/target/product/default_art_config.mk
+++ b/target/product/default_art_config.mk
@@ -50,7 +50,6 @@
PRODUCT_BOOT_JARS += \
framework-minus-apex \
framework-graphics \
- framework-nfc \
ext \
telephony-common \
voip-common \
@@ -88,6 +87,15 @@
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 3acf1e6..b5292d2 100644
--- a/target/product/handheld_system.mk
+++ b/target/product/handheld_system.mk
@@ -73,7 +73,6 @@
UserDictionaryProvider \
VpnDialogs \
vr \
- $(RELEASE_PACKAGE_NFC_STACK)
PRODUCT_SYSTEM_SERVER_APPS += \