am a0f464a8: New PRODUCT_AAPT_PREF_CONFIG.

* commit 'a0f464a8e7f006177db084df7e925bbb8e5ffed3':
  New PRODUCT_AAPT_PREF_CONFIG.
diff --git a/core/definitions.mk b/core/definitions.mk
index 1a7cf4b..4e3a204 100644
--- a/core/definitions.mk
+++ b/core/definitions.mk
@@ -1586,10 +1586,9 @@
 define add-dex-to-package
 $(if $(filter classes.dex,$(notdir $(PRIVATE_DEX_FILE))),\
 $(hide) $(AAPT) add -k $@ $(PRIVATE_DEX_FILE),\
-$(eval _adtp_classes.dex := $(dir $(PRIVATE_DEX_FILE))/classes.dex)\
-$(hide) cp $(PRIVATE_DEX_FILE) $(_adtp_classes.dex) && \
-$(AAPT) add -k $@ $(_adtp_classes.dex) && \
-rm -f $(_adtp_classes.dex))
+$(hide) _adtp_classes_dex=$(dir $(PRIVATE_DEX_FILE))classes.dex; \
+cp $(PRIVATE_DEX_FILE) $$_adtp_classes_dex && \
+$(AAPT) add -k $@ $$_adtp_classes_dex && rm -f $$_adtp_classes_dex)
 endef
 
 define add-java-resources-to-package
diff --git a/core/main.mk b/core/main.mk
index 6841b36..5f01238 100644
--- a/core/main.mk
+++ b/core/main.mk
@@ -664,6 +664,11 @@
   $(info Removing from sdk:)$(foreach d,$(target_gnu_MODULES),$(info : $(d)))
   modules_to_install := \
               $(filter-out $(target_gnu_MODULES),$(modules_to_install))
+
+  # Ensure every module listed in PRODUCT_PACKAGES gets something installed
+  $(foreach m, $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_PACKAGES), \
+      $(if $(strip $(ALL_MODULES.$(m).INSTALLED)),,\
+          $(error Module '$(m)' in PRODUCT_PACKAGES has nothing to install!)))
 endif
 
 
diff --git a/core/package.mk b/core/package.mk
index 07cdbd0..c60558c 100644
--- a/core/package.mk
+++ b/core/package.mk
@@ -290,6 +290,18 @@
       $(addsuffix $(so_suffix), \
         $(LOCAL_JNI_SHARED_LIBRARIES)))
 
+# App explicitly requires the prebuilt NDK libstlport_shared.so.
+# libstlport_shared.so should never go to the system image.
+# Instead it should be packaged into the apk.
+ifeq (stlport_shared,$(LOCAL_NDK_STL_VARIANT))
+ifndef LOCAL_NDK_VERSION
+$(error LOCAL_NDK_VERSION has to be defined together with LOCAL_NDK_STL_VARIANT, \
+    LOCAL_PACKAGE_NAME=$(LOCAL_PACKAGE_NAME))
+endif
+jni_shared_libraries += \
+    $(HISTORICAL_NDK_VERSIONS_ROOT)/android-ndk-r$(LOCAL_NDK_VERSION)/sources/cxx-stl/stlport/libs/$(TARGET_CPU_ABI)/libstlport_shared.so
+endif
+
 # Set the abi directory used by the local JNI shared libraries.
 # (Doesn't change how the local shared libraries are compiled, just
 # sets where they are stored in the apk.)
diff --git a/core/product.mk b/core/product.mk
index 0ab9ae0..26f365d 100644
--- a/core/product.mk
+++ b/core/product.mk
@@ -77,7 +77,6 @@
     PRODUCT_EXTRA_RECOVERY_KEYS \
     PRODUCT_PACKAGE_OVERLAYS \
     DEVICE_PACKAGE_OVERLAYS \
-    PRODUCT_CONTRIBUTORS_FILE \
     PRODUCT_TAGS \
     PRODUCT_SDK_ADDON_NAME \
     PRODUCT_SDK_ADDON_COPY_FILES \
diff --git a/core/product_config.mk b/core/product_config.mk
index e063e42..c455723 100644
--- a/core/product_config.mk
+++ b/core/product_config.mk
@@ -286,10 +286,6 @@
 PRODUCT_COPY_FILES := \
     $(strip $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_COPY_FILES))
 
-# The HTML file containing the contributors to the project.
-PRODUCT_CONTRIBUTORS_FILE := \
-    $(strip $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_CONTRIBUTORS_FILE))
-
 # A list of property assignments, like "key = value", with zero or more
 # whitespace characters on either side of the '='.
 PRODUCT_PROPERTY_OVERRIDES := \
diff --git a/target/product/core.mk b/target/product/core.mk
index ca5858f..aac703e 100644
--- a/target/product/core.mk
+++ b/target/product/core.mk
@@ -26,7 +26,6 @@
     ApplicationsProvider \
     BackupRestoreConfirmation \
     Browser \
-    Bugreport \
     Contacts \
     ContactsProvider \
     DefaultContainerService \
@@ -41,11 +40,8 @@
     SettingsProvider \
     SharedStorageBackup \
     TelephonyProvider \
-    TtsService \
     UserDictionaryProvider \
-    VpnServices \
     apache-xml \
-    bluetooth-health \
     bouncycastle \
     bu \
     cacerts \
@@ -63,7 +59,6 @@
     ext \
     filterfw \
     framework-res \
-    hostapd \
     hprof-conv \
     icu.dat \
     installd \
@@ -75,7 +70,6 @@
     libOpenSLES \
     libaudiopreprocessing \
     libcrypto \
-    libdex \
     libdvm \
     libexpat \
     libfilterfw \
@@ -83,7 +77,6 @@
     libgabi++ \
     libicui18n \
     libicuuc \
-    libjavacore \
     libnativehelper \
     libnfc_ndef \
     libpowermanager \
@@ -92,7 +85,6 @@
     libssl \
     libstagefright_soft_aacdec \
     libstagefright_soft_amrdec \
-    libstagefright_soft_avcdec \
     libstagefright_soft_g711dec \
     libstagefright_soft_mp3dec \
     libstagefright_soft_mpeg4dec \
@@ -103,8 +95,7 @@
     libwilhelm \
     libz \
     screencap \
-    sensorservice \
-    wpa_supplicant.conf
+    sensorservice
 
 # host-only dependencies
 ifeq ($(WITH_HOST_DALVIK),true)
@@ -112,6 +103,5 @@
         apache-xml-hostdex \
         bouncycastle-hostdex \
         core-hostdex \
-        libjavacore-host \
         dalvik
 endif
diff --git a/target/product/generic_armv5.mk b/target/product/generic_armv5.mk
index d419e70..daa321a 100644
--- a/target/product/generic_armv5.mk
+++ b/target/product/generic_armv5.mk
@@ -18,7 +18,6 @@
 # It includes the base Android platform.
 
 $(call inherit-product, $(SRC_TARGET_DIR)/product/generic.mk)
-$(call inherit-product, $(SRC_TARGET_DIR)/product/core.mk)
 
 # Overrides
 PRODUCT_BRAND := generic_armv5
diff --git a/target/product/generic_no_telephony.mk b/target/product/generic_no_telephony.mk
index a1cce72..d165b0f 100644
--- a/target/product/generic_no_telephony.mk
+++ b/target/product/generic_no_telephony.mk
@@ -20,7 +20,6 @@
 PRODUCT_POLICY := android.policy_phone
 
 PRODUCT_PACKAGES := \
-    AccountAndSyncSettings \
     DeskClock \
     AlarmProvider \
     Bluetooth \
@@ -44,7 +43,10 @@
     Updater \
     CalendarProvider \
     SyncProvider \
-    VpnDialogs
+    VpnDialogs \
+    bluetooth-health \
+    hostapd \
+    wpa_supplicant.conf
 
 PRODUCT_PACKAGES += \
     icu.dat
diff --git a/target/product/generic_x86.mk b/target/product/generic_x86.mk
index 7e77a27..86710c4 100644
--- a/target/product/generic_x86.mk
+++ b/target/product/generic_x86.mk
@@ -18,7 +18,6 @@
 # It includes the base Android platform.
 
 $(call inherit-product, $(SRC_TARGET_DIR)/product/generic.mk)
-$(call inherit-product, $(SRC_TARGET_DIR)/product/core.mk)
 
 # Overrides
 PRODUCT_BRAND := generic_x86
diff --git a/target/product/large_emu_hw.mk b/target/product/large_emu_hw.mk
index 9224130..15b1bed 100644
--- a/target/product/large_emu_hw.mk
+++ b/target/product/large_emu_hw.mk
@@ -20,7 +20,6 @@
 PRODUCT_POLICY := android.policy_mid
 
 PRODUCT_PACKAGES := \
-    AccountAndSyncSettings \
     CarHome \
     DeskClock \
     AlarmProvider \
@@ -42,7 +41,11 @@
     Sync \
     Updater \
     CalendarProvider \
-    SyncProvider
+    SyncProvider \
+    bluetooth-health \
+    hostapd \
+    wpa_supplicant.conf
+
 
 $(call inherit-product, $(SRC_TARGET_DIR)/product/core.mk)
 
diff --git a/target/product/sdk.mk b/target/product/sdk.mk
index f0142fa..c4abc51 100644
--- a/target/product/sdk.mk
+++ b/target/product/sdk.mk
@@ -30,21 +30,18 @@
 	libWnnEngDic \
 	libWnnJpnDic \
 	libwnndict \
-    Phone \
+	Phone \
 	PinyinIME \
 	Protips \
 	SoftKeyboard \
 	SystemUI \
 	Launcher2 \
-	AccountAndSyncSettings \
 	Development \
 	DrmProvider \
 	Fallback \
-	GPSEnable \
 	Settings \
 	SdkSetup \
 	CustomLocale \
-	gpstest \
 	sqlite3 \
 	LatinIME \
 	CertInstaller \