am 17a4a0bd: am 9bbbac75: Merge "Change aapt flag to use new name"

* commit '17a4a0bd410f6133fd9088828f27e598ec9d268b':
diff --git a/CleanSpec.mk b/CleanSpec.mk
index 129b19b..46e652b 100644
--- a/CleanSpec.mk
+++ b/CleanSpec.mk
@@ -1,4 +1,4 @@
-
+# Copyright (C) 2007 The Android Open Source Project
 #
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
diff --git a/core/Makefile b/core/Makefile
index 83a9684..8611468 100644
--- a/core/Makefile
+++ b/core/Makefile
@@ -684,28 +684,32 @@
 recovery_binary := $(call intermediates-dir-for,EXECUTABLES,recovery)/recovery
 recovery_resources_common := $(call include-path-for, recovery)/res
 
-ifneq (,$(filter xxxhdpi,$(PRODUCT_AAPT_CONFIG_SP)))
-recovery_resources_common := $(recovery_resources_common)-xxxhdpi
-else ifneq (,$(filter xxhdpi,$(PRODUCT_AAPT_CONFIG_SP)))
-recovery_resources_common := $(recovery_resources_common)-xxhdpi
-else ifneq (,$(filter xhdpi,$(PRODUCT_AAPT_CONFIG_SP)))
-recovery_resources_common := $(recovery_resources_common)-xhdpi
-else ifneq (,$(filter hdpi,$(PRODUCT_AAPT_CONFIG_SP)))
-recovery_resources_common := $(recovery_resources_common)-hdpi
-else ifneq (,$(filter mdpi,$(PRODUCT_AAPT_CONFIG_SP)))
-recovery_resources_common := $(recovery_resources_common)-mdpi
+# Set recovery_density to the density bucket of the device.
+recovery_density := unknown
+ifneq (,$(PRODUCT_AAPT_PREF_CONFIG))
+# If PRODUCT_AAPT_PREF_CONFIG includes a dpi bucket, then use that value.
+recovery_density := $(filter %dpi,$(PRODUCT_AAPT_PREF_CONFIG))
 else
-# xhdpi is closest in size to the single set of resources we had
-# before, so make that the default if PRODUCT_AAPT_CONFIG doesn't
-# specify a dpi we have.
+# Otherwise, use the highest density that appears in PRODUCT_AAPT_CONFIG.
+# Order is important here; we'll take the first one that's found.
+recovery_densities := $(filter $(PRODUCT_AAPT_CONFIG_SP),xxxhdpi xxhdpi xhdpi hdpi mdpi ldpi)
+ifneq (,$(recovery_densities))
+recovery_density := $(word 1,$(recovery_densities))
+endif
+endif
+
+ifneq (,$(wildcard $(recovery_resources_common)-$(recovery_density)))
+recovery_resources_common := $(recovery_resources_common)-$(recovery_density)
+else
 recovery_resources_common := $(recovery_resources_common)-xhdpi
 endif
 
-# Select the 18x32 font on high-density devices; and the 12x22 font on
-# other devices.  Note that the font selected here can be overridden
-# for a particular device by putting a font.png in its private
-# recovery resources.
-ifneq (,$(filter xxhdpi xhdpi,$(subst $(comma),$(space),$(PRODUCT_AAPT_CONFIG))))
+# Select the 18x32 font on high-density devices (xhdpi and up); and
+# the 12x22 font on other devices.  Note that the font selected here
+# can be overridden for a particular device by putting a font.png in
+# its private recovery resources.
+
+ifneq (,$(filter xxxhdpi xxhdpi xhdpi,$(recovery_density)))
 recovery_font := $(call include-path-for, recovery)/fonts/18x32.png
 else
 recovery_font := $(call include-path-for, recovery)/fonts/12x22.png
diff --git a/core/dex_preopt_libart.mk b/core/dex_preopt_libart.mk
index 73e8494..7f3285c 100644
--- a/core/dex_preopt_libart.mk
+++ b/core/dex_preopt_libart.mk
@@ -23,9 +23,9 @@
 
 PRELOADED_CLASSES := frameworks/base/preloaded-classes
 
-LIBART_BOOT_IMAGE := /$(DEXPREOPT_BOOT_JAR_DIR)/boot.art
+LIBART_BOOT_IMAGE := /$(DEXPREOPT_BOOT_JAR_DIR)/boot-$(DEX2OAT_TARGET_ARCH).art
 
-DEFAULT_DEX_PREOPT_BUILT_IMAGE := $(DEXPREOPT_BOOT_JAR_DIR_FULL_PATH)/boot.art
+DEFAULT_DEX_PREOPT_BUILT_IMAGE := $(DEXPREOPT_BOOT_JAR_DIR_FULL_PATH)/boot-$(DEX2OAT_TARGET_ARCH).art
 
 DEFAULT_DEX_PREOPT_INSTALLED_IMAGE :=
 ifneq ($(PRODUCT_DEX_PREOPT_IMAGE_IN_DATA),true)