Reconcile with ics-mr0-release ics-factoryrom-2-release

Change-Id: I76232373a2c25c0e18c27672ede2bb1b281e43f6
diff --git a/CleanSpec.mk b/CleanSpec.mk
index 62a3a09..ffe106c 100644
--- a/CleanSpec.mk
+++ b/CleanSpec.mk
@@ -103,6 +103,10 @@
 $(call add-clean-step, rm -rf $(PRODUCT_OUT)/obj/JAVA_LIBRARIES/*)
 $(call add-clean-step, rm -rf $(PRODUCT_OUT)/system/framework/*)
 $(call add-clean-step, rm -rf $(PRODUCT_OUT)/system/build.prop)
+$(call add-clean-step, rm -rf $(PRODUCT_OUT)/system/app/*)
+$(call add-clean-step, rm -rf $(PRODUCT_OUT)/obj/APPS/*)
+$(call add-clean-step, rm -rf $(PRODUCT_OUT)/system/build.prop)
+$(call add-clean-step, rm -rf $(PRODUCT_OUT)/obj/SHARED_LIBRARIES/libbcinfo_intermediates)
 
 # ************************************************
 # NEWER CLEAN STEPS MUST BE AT THE END OF THE LIST
diff --git a/core/build_id.mk b/core/build_id.mk
index 5c80bac..70bd235 100644
--- a/core/build_id.mk
+++ b/core/build_id.mk
@@ -1,4 +1,3 @@
-
 #
 # Copyright (C) 2008 The Android Open Source Project
 #
@@ -14,9 +13,20 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 #
+
+#
+# Defines branch-specific values.
+#
+
 # BUILD_ID is usually used to specify the branch name
 # (like "MAIN") or a branch name and a release candidate
-# (like "CRB01").  It must be a single word, and is
+# (like "TC1-RC5").  It must be a single word, and is
 # capitalized by convention.
+#
+BUILD_ID := MR1
 
-export BUILD_ID=ICL47
+# DISPLAY_BUILD_NUMBER should only be set for development branches,
+# If set, the BUILD_NUMBER (cl) is appended to the BUILD_ID for
+# a more descriptive BUILD_ID_DISPLAY, otherwise BUILD_ID_DISPLAY
+# is the same as BUILD_ID
+DISPLAY_BUILD_NUMBER := true
diff --git a/core/definitions.mk b/core/definitions.mk
index 1a7cf4b..683ae16 100644
--- a/core/definitions.mk
+++ b/core/definitions.mk
@@ -843,11 +843,13 @@
 @echo "Protoc: $@ <= $(PRIVATE_PROTO_SRC_FILES)"
 @rm -rf $(PRIVATE_PROTO_JAVA_OUTPUT_DIR)
 @mkdir -p $(PRIVATE_PROTO_JAVA_OUTPUT_DIR)
-$(hide) $(PROTOC) \
-	$(addprefix --proto_path=, $(PRIVATE_PROTO_INCLUDES)) \
-	$(PRIVATE_PROTO_JAVA_OUTPUT_OPTION)=$(PRIVATE_PROTO_JAVA_OUTPUT_DIR) \
-	$(PRIVATE_PROTOC_FLAGS) \
-	$(PRIVATE_PROTO_SRC_FILES)
+$(hide) for f in $(PRIVATE_PROTO_SRC_FILES); do \
+        $(PROTOC) \
+        $(addprefix --proto_path=, $(PRIVATE_PROTO_INCLUDES)) \
+        $(PRIVATE_PROTO_JAVA_OUTPUT_OPTION)=$(PRIVATE_PROTO_JAVA_OUTPUT_DIR) \
+        $(PRIVATE_PROTOC_FLAGS) \
+        $$f; \
+        done
 $(hide) touch $@
 endef
 
@@ -1586,10 +1588,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..569d4dc 100644
--- a/core/main.mk
+++ b/core/main.mk
@@ -444,6 +444,7 @@
 	sdk/layoutopt \
 	sdk/ninepatch \
 	sdk/rule_api \
+	sdk/lint \
 	sdk/sdkstats \
 	sdk/sdkmanager \
 	sdk/swtmenubar \
@@ -664,6 +665,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 0cca209..52d52a2 100644
--- a/core/package.mk
+++ b/core/package.mk
@@ -295,6 +295,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..f48d2be 100644
--- a/core/product.mk
+++ b/core/product.mk
@@ -77,12 +77,11 @@
     PRODUCT_EXTRA_RECOVERY_KEYS \
     PRODUCT_PACKAGE_OVERLAYS \
     DEVICE_PACKAGE_OVERLAYS \
-    PRODUCT_CONTRIBUTORS_FILE \
     PRODUCT_TAGS \
     PRODUCT_SDK_ADDON_NAME \
     PRODUCT_SDK_ADDON_COPY_FILES \
     PRODUCT_SDK_ADDON_COPY_MODULES \
-    PRODUCT_SDK_ADDON_DOC_MODULE \
+    PRODUCT_SDK_ADDON_DOC_MODULES \
     PRODUCT_DEFAULT_WIFI_CHANNELS \
     PRODUCT_DEFAULT_DEV_CERTIFICATE \
 
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/core/tasks/sdk-addon.mk b/core/tasks/sdk-addon.mk
index f3aec65..a864781 100644
--- a/core/tasks/sdk-addon.mk
+++ b/core/tasks/sdk-addon.mk
@@ -69,26 +69,21 @@
   $(eval sdk_addon_deps += $(_dest)) \
  )
 
-# We don't know about all of the docs files, so depend on the timestamp for
-# that, and record the directory, and the packaging rule will just copy the
+# We don't know about all of the docs files, so depend on the timestamps for
+# them, and record the directories, and the packaging rule will just copy the
 # whole thing.
-doc_module := $(strip $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_SDK_ADDON_DOC_MODULE))
-ifneq ($(doc_module),)
-  doc_timestamp := $(call doc-timestamp-for, $(doc_module))
-  sdk_addon_deps += $(doc_timestamp)
-  $(full_target): PRIVATE_DOCS_DIR := $(OUT_DOCS)/$(doc_module)
-else
-  $(full_target): PRIVATE_DOCS_DIR :=
-endif
+doc_modules := $(strip $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_SDK_ADDON_DOC_MODULES))
+sdk_addon_deps += $(foreach dm, $(doc_modules), $(call doc-timestamp-for, $(dm)))
+$(full_target): PRIVATE_DOCS_DIRS := $(addprefix $(OUT_DOCS)/, $(doc_modules))
 
 $(full_target): PRIVATE_STAGING_DIR := $(staging)
 
 $(full_target): $(sdk_addon_deps) | $(ACP)
 	@echo Packaging SDK Addon: $@
 	$(hide) mkdir -p $(PRIVATE_STAGING_DIR)/docs/reference
-	$(hide) if [ -n "$(PRIVATE_DOCS_DIR)" ] ; then \
-	    $(ACP) -r $(PRIVATE_DOCS_DIR)/* $(PRIVATE_STAGING_DIR)/docs/reference ;\
-	  fi
+	$(hide) for d in $(PRIVATE_DOCS_DIRS); do \
+	    $(ACP) -r $$d/* $(PRIVATE_STAGING_DIR)/docs/reference ;\
+	  done
 	$(hide) mkdir -p $(dir $@)
 	$(hide) ( F=$$(pwd)/$@ ; cd $(PRIVATE_STAGING_DIR)/.. && zip -rq $$F * )
 
diff --git a/core/version_defaults.mk b/core/version_defaults.mk
index 6773635..7f6db0c 100644
--- a/core/version_defaults.mk
+++ b/core/version_defaults.mk
@@ -41,7 +41,7 @@
   # which is the version that we reveal to the end user.
   # Update this value when the platform version changes (rather
   # than overriding it somewhere else).  Can be an arbitrary string.
-  PLATFORM_VERSION := 4.0.1
+  PLATFORM_VERSION := 4.1
 endif
 
 ifeq "" "$(PLATFORM_SDK_VERSION)"
@@ -53,7 +53,7 @@
   # intermediate builds).  During development, this number remains at the
   # SDK version the branch is based on and PLATFORM_VERSION_CODENAME holds
   # the code-name of the new development work.
-  PLATFORM_SDK_VERSION := 14
+  PLATFORM_SDK_VERSION := 15
 endif
 
 ifeq "" "$(PLATFORM_VERSION_CODENAME)"
diff --git a/target/product/core.mk b/target/product/core.mk
index 3b05659..abb2d9f 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,9 @@
     SettingsProvider \
     SharedStorageBackup \
     TelephonyProvider \
-    TtsService \
     UserDictionaryProvider \
     VpnDialogs \
     apache-xml \
-    bluetooth-health \
     bouncycastle \
     bu \
     cacerts \
@@ -63,7 +60,6 @@
     ext \
     filterfw \
     framework-res \
-    hostapd \
     hprof-conv \
     icu.dat \
     installd \
@@ -75,7 +71,6 @@
     libOpenSLES \
     libaudiopreprocessing \
     libcrypto \
-    libdex \
     libdvm \
     libexpat \
     libfilterfw \
@@ -83,7 +78,6 @@
     libgabi++ \
     libicui18n \
     libicuuc \
-    libjavacore \
     libnativehelper \
     libnfc_ndef \
     libpowermanager \
@@ -103,8 +97,7 @@
     libwilhelm \
     libz \
     screencap \
-    sensorservice \
-    wpa_supplicant.conf
+    sensorservice
 
 # host-only dependencies
 ifeq ($(WITH_HOST_DALVIK),true)
@@ -112,6 +105,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 416ab25..0d87fc3 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 \
@@ -43,7 +42,10 @@
     SystemUI \
     Updater \
     CalendarProvider \
-    SyncProvider
+    SyncProvider \
+    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/languages_full.mk b/target/product/languages_full.mk
index e494fad..35ab1f1 100644
--- a/target/product/languages_full.mk
+++ b/target/product/languages_full.mk
@@ -21,5 +21,4 @@
 
 # Those are all the locales that have translations and are displayable
 # by TextView in this branch.
-PRODUCT_LOCALES := en_US fr_FR it_IT es_ES de_DE nl_NL cs_CZ pl_PL ja_JP zh_TW zh_CN ru_RU ko_KR nb_NO es_US da_DK el_GR tr_TR pt_PT pt_BR rm_CH sv_SE bg_BG ca_ES en_GB fi_FI hi_IN hr_HR hu_HU in_ID iw_IL lt_LT lv_LV ro_RO sk_SK sl_SI sr_RS uk_UA vi_VN tl_PH ar_EG fa_IR th_TH sw_TZ ms_MY af_ZA zu_ZA
-# We don't have the fonts to display am_ET yet
+PRODUCT_LOCALES := en_US fr_FR it_IT es_ES de_DE nl_NL cs_CZ pl_PL ja_JP zh_TW zh_CN ru_RU ko_KR nb_NO es_US da_DK el_GR tr_TR pt_PT pt_BR rm_CH sv_SE bg_BG ca_ES en_GB fi_FI hi_IN hr_HR hu_HU in_ID iw_IL lt_LT lv_LV ro_RO sk_SK sl_SI sr_RS uk_UA vi_VN tl_PH ar_EG fa_IR th_TH sw_TZ ms_MY af_ZA zu_ZA am_ET hi_IN
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/locales_full.mk b/target/product/locales_full.mk
index cab2b91..1031303 100644
--- a/target/product/locales_full.mk
+++ b/target/product/locales_full.mk
@@ -1,3 +1,3 @@
-PRODUCT_LOCALES := cs_CZ da_DK de_AT de_CH de_DE de_LI el_GR en_AU en_CA en_GB en_NZ en_SG en_US es_ES fr_CA fr_CH fr_BE fr_FR it_CH it_IT ja_JP ko_KR nb_NO nl_BE nl_NL pl_PL pt_PT ru_RU sv_SE tr_TR zh_CN zh_HK zh_TW
+PRODUCT_LOCALES := cs_CZ da_DK de_AT de_CH de_DE de_LI el_GR en_AU en_CA en_GB en_NZ en_SG en_US es_ES fr_CA fr_CH fr_BE fr_FR it_CH it_IT ja_JP ko_KR nb_NO nl_BE nl_NL pl_PL pt_PT ru_RU sv_SE tr_TR zh_CN zh_HK zh_TW am_ET hi_IN
 
 $(call inherit-product, build/target/product/languages_full.mk)
diff --git a/target/product/sdk.mk b/target/product/sdk.mk
index f0142fa..ceb1898 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 \
@@ -84,6 +81,7 @@
 	traceview \
 	android \
 	dexdump \
+	lint \
 	monkeyrunner
 
 # Native host Java libraries that are parts of the SDK.
@@ -117,6 +115,7 @@
 	org.eclipse.jface_3.4.2.M20090107-0800 \
 	osgi \
 	layoutlib \
+	lint \
 	monkeyrunner \
 	guavalib \
 	jsr305lib \