Merge "Revert "Revert "Differentiate between runtime apex jars and framework jars."""
diff --git a/core/Makefile b/core/Makefile
index 646aaec..0bbaf12 100644
--- a/core/Makefile
+++ b/core/Makefile
@@ -2976,6 +2976,8 @@
 BOARD_AVB_MAKE_VBMETA_SYSTEM_IMAGE_ARGS += --padding_size 4096
 BOARD_AVB_MAKE_VBMETA_VENDOR_IMAGE_ARGS += --padding_size 4096
 
+BOARD_AVB_SYSTEM_ADD_HASHTREE_FOOTER_ARGS += --prop system_security_patch:$(PLATFORM_SECURITY_PATCH)
+
 ifeq (eng,$(filter eng, $(TARGET_BUILD_VARIANT)))
 # We only need the flag in top-level vbmeta.img.
 BOARD_AVB_MAKE_VBMETA_IMAGE_ARGS += --set_hashtree_disabled_flag
diff --git a/core/combo/arch/arm/armv7-a.mk b/core/combo/arch/arm/armv7-a.mk
deleted file mode 100644
index 0c2f04d..0000000
--- a/core/combo/arch/arm/armv7-a.mk
+++ /dev/null
@@ -1,5 +0,0 @@
-# Configuration for Linux on ARM.
-# Generating binaries for the ARMv7-a architecture and higher
-#
-ARCH_ARM_HAVE_ARMV7A            := true
-ARCH_ARM_HAVE_VFP               := true
diff --git a/core/config.mk b/core/config.mk
index 486193d..ab0ec6d 100644
--- a/core/config.mk
+++ b/core/config.mk
@@ -212,11 +212,6 @@
 HIDDENAPI_EXTRA_APP_USAGE_JARS := \
     core-oj-hiddenapi \
 
-# Default to remove the org.apache.http.legacy from bootclasspath
-ifeq ($(REMOVE_OAHL_FROM_BCP),)
-REMOVE_OAHL_FROM_BCP := true
-endif
-
 # ###############################################################
 # Broken build defaults
 # ###############################################################
diff --git a/core/envsetup.mk b/core/envsetup.mk
index 390a182..bd632bf 100644
--- a/core/envsetup.mk
+++ b/core/envsetup.mk
@@ -465,7 +465,7 @@
 endif
 
 BUILDING_PRODUCT_SERVICES_IMAGE :=
-ifeq ($(PRODUCT_SERVICES_BUILD_PRODUCT_SERVICES_IMAGE),)
+ifeq ($(PRODUCT_BUILD_PRODUCT_SERVICES_IMAGE),)
   ifdef BOARD_PRODUCT_SERVICESIMAGE_FILE_SYSTEM_TYPE
     BUILDING_PRODUCT_SERVICES_IMAGE := true
   endif
diff --git a/target/board/generic/BoardConfig.mk b/target/board/generic/BoardConfig.mk
index cdb1d29..b61a7fd 100644
--- a/target/board/generic/BoardConfig.mk
+++ b/target/board/generic/BoardConfig.mk
@@ -18,30 +18,13 @@
 
 # Note: Before P, we built the platform images for ARMv7-A _without_ NEON.
 # Note: Before Q, we built the CTS and SDK images for ARMv7-A _without_ NEON.
+# Note: Before Q, we built unbundled apps for ARMv7-A _without_ NEON.
 #
-ifneq ($(TARGET_BUILD_APPS),)
-# DO NOT USE
-#
-# This architecture variant should NOT be used for 32 bit arm platform
-# builds. It is the lowest common denominator required to build
-# an unbundled application for all supported 32 platforms.
-# cts for 32 bit arm is built using aosp_arm64 product.
-#
-# If you are building a 32 bit platform (and not an application),
-# you should set the following as 2nd arch variant:
-#
-# TARGET_ARCH_VARIANT := armv7-a-neon
-#
-# DO NOT USE
-TARGET_ARCH_VARIANT := armv7-a
-# DO NOT USE
-else
 # Starting from Pi, System image of aosp_arm products is the new GSI
 # for real devices newly launched for Pi. These devices are usualy not
 # as performant as the mainstream 64-bit devices and the performance
 # provided by NEON is important for them to pass related CTS tests.
 TARGET_ARCH_VARIANT := armv7-a-neon
-endif
 TARGET_CPU_VARIANT := generic
 TARGET_CPU_ABI := armeabi-v7a
 TARGET_CPU_ABI2 := armeabi
diff --git a/target/board/generic_arm64/BoardConfig.mk b/target/board/generic_arm64/BoardConfig.mk
index 3331d18..3f83edb 100644
--- a/target/board/generic_arm64/BoardConfig.mk
+++ b/target/board/generic_arm64/BoardConfig.mk
@@ -41,11 +41,7 @@
 #
 # DO NOT USE
 # DO NOT USE
-ifneq ($(filter cts sdk vts,$(MAKECMDGOALS)),)
 TARGET_2ND_ARCH_VARIANT := armv7-a-neon
-else
-TARGET_2ND_ARCH_VARIANT := armv7-a
-endif
 # DO NOT USE
 # DO NOT USE
 TARGET_2ND_CPU_VARIANT := generic
diff --git a/target/board/generic_x86_arm/BoardConfig.mk b/target/board/generic_x86_arm/BoardConfig.mk
index 8e70b25..ab2089d 100644
--- a/target/board/generic_x86_arm/BoardConfig.mk
+++ b/target/board/generic_x86_arm/BoardConfig.mk
@@ -21,7 +21,7 @@
 TARGET_2ND_ARCH := arm
 TARGET_2ND_CPU_ABI := armeabi-v7a
 TARGET_2ND_CPU_ABI2 := armeabi
-TARGET_2ND_ARCH_VARIANT := armv7-a
+TARGET_2ND_ARCH_VARIANT := armv7-a-neon
 TARGET_2ND_CPU_VARIANT := generic
 
 TARGET_CPU_ABI_LIST := x86 armeabi-v7a armeabi
diff --git a/target/product/base_system.mk b/target/product/base_system.mk
index 4a3ae4d..d6c8421 100644
--- a/target/product/base_system.mk
+++ b/target/product/base_system.mk
@@ -290,15 +290,6 @@
     /apex/com.android.conscrypt/javalib/conscrypt.jar
 
 
-# Add the compatibility library that is needed when org.apache.http.legacy
-# is removed from the bootclasspath.
-ifeq ($(REMOVE_OAHL_FROM_BCP),true)
-PRODUCT_PACKAGES += framework-oahl-backward-compatibility
-PRODUCT_BOOT_JARS += framework-oahl-backward-compatibility
-else
-PRODUCT_BOOT_JARS += org.apache.http.legacy
-endif
-
 PRODUCT_COPY_FILES += \
     system/core/rootdir/init.usb.rc:root/init.usb.rc \
     system/core/rootdir/init.usb.configfs.rc:root/init.usb.configfs.rc \
diff --git a/target/product/gsi/current.txt b/target/product/gsi/current.txt
index 9eff6b6..e70ab5b 100644
--- a/target/product/gsi/current.txt
+++ b/target/product/gsi/current.txt
@@ -43,6 +43,7 @@
 VNDK-SP: libhwbinder_noltopgo.so
 VNDK-SP: libion.so
 VNDK-SP: liblzma.so
+VNDK-SP: libprocessgroup.so
 VNDK-SP: libunwindstack.so
 VNDK-SP: libutils.so
 VNDK-SP: libutilscallstack.so
diff --git a/target/product/handheld_product.mk b/target/product/handheld_product.mk
index 063b951..758fa9b 100644
--- a/target/product/handheld_product.mk
+++ b/target/product/handheld_product.mk
@@ -33,7 +33,6 @@
     Launcher3QuickStep \
     Music \
     OneTimeInitializer \
-    PrintRecommendationService \
     Provision \
     QuickSearchBox \
     Settings \
diff --git a/target/product/handheld_system.mk b/target/product/handheld_system.mk
index 0a763fb..a4dd6d7 100644
--- a/target/product/handheld_system.mk
+++ b/target/product/handheld_system.mk
@@ -57,6 +57,7 @@
     MusicFX \
     NfcNci \
     PacProcessor \
+    PrintRecommendationService \
     PrintSpooler \
     ProxyHandler \
     screenrecord \
diff --git a/target/product/mainline_arm64.mk b/target/product/mainline_arm64.mk
index c876636..904bd26 100644
--- a/target/product/mainline_arm64.mk
+++ b/target/product/mainline_arm64.mk
@@ -45,7 +45,6 @@
   system/app/LatinIME/oat/arm64/LatinIME.odex \
   system/app/LatinIME/oat/arm64/LatinIME.vdex \
   system/app/Music/Music.apk \
-  system/app/PrintRecommendationService/PrintRecommendationService.apk \
   system/app/QuickSearchBox/QuickSearchBox.apk \
   system/app/webview/webview.apk \
   system/bin/healthd \