merge in jb-mr2-release history after reset to master
diff --git a/core/build_id.mk b/core/build_id.mk
index 1318e5b..40bb35d 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 := MASTER
 
-export BUILD_ID=JWQ45B
+# 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/combo/TARGET_linux-arm.mk b/core/combo/TARGET_linux-arm.mk
index 278d5ee..172ed00 100644
--- a/core/combo/TARGET_linux-arm.mk
+++ b/core/combo/TARGET_linux-arm.mk
@@ -73,18 +73,11 @@
                         -fstrict-aliasing    \
                         -funswitch-loops
 
-# Modules can choose to compile some source as thumb. As
-# non-thumb enabled targets are supported, this is treated
-# as a 'hint'. If thumb is not enabled, these files are just
-# compiled as ARM.
-ifeq ($(ARCH_ARM_HAVE_THUMB_SUPPORT),true)
+# Modules can choose to compile some source as thumb.
 TARGET_thumb_CFLAGS :=  -mthumb \
                         -Os \
                         -fomit-frame-pointer \
                         -fno-strict-aliasing
-else
-TARGET_thumb_CFLAGS := $(TARGET_arm_CFLAGS)
-endif
 
 # Set FORCE_ARM_DEBUGGING to "true" in your buildspec.mk
 # or in your environment to force a full arm build, even for
@@ -144,15 +137,7 @@
 			-Wl,--icf=safe \
 			$(arch_variant_ldflags)
 
-# We only need thumb interworking in cases where thumb support
-# is available in the architecture, and just to be sure, (and
-# since sometimes thumb-interwork appears to be default), we
-# specifically disable when thumb support is unavailable.
-ifeq ($(ARCH_ARM_HAVE_THUMB_SUPPORT),true)
 TARGET_GLOBAL_CFLAGS += -mthumb-interwork
-else
-TARGET_GLOBAL_CFLAGS += -mno-thumb-interwork
-endif
 
 TARGET_GLOBAL_CPPFLAGS += -fvisibility-inlines-hidden
 
diff --git a/core/combo/arch/arm/armv5te.mk b/core/combo/arch/arm/armv5te.mk
index 1c25e36..88e57b7 100644
--- a/core/combo/arch/arm/armv5te.mk
+++ b/core/combo/arch/arm/armv5te.mk
@@ -1,10 +1,6 @@
 # Configuration for Linux on ARM.
 # Generating binaries for the ARMv5TE architecture and higher
 #
-ARCH_ARM_HAVE_THUMB_SUPPORT     := true
-ARCH_ARM_HAVE_FAST_INTERWORKING := true
-ARCH_ARM_HAVE_64BIT_DATA        := true
-ARCH_ARM_HAVE_HALFWORD_MULTIPLY := true
 
 # Note: Hard coding the 'tune' value here is probably not ideal,
 # and a better solution should be found in the future.
diff --git a/core/combo/arch/arm/armv7-a-neon.mk b/core/combo/arch/arm/armv7-a-neon.mk
index 305d590..a928fe1 100644
--- a/core/combo/arch/arm/armv7-a-neon.mk
+++ b/core/combo/arch/arm/armv7-a-neon.mk
@@ -1,12 +1,7 @@
 # Configuration for Linux on ARM.
 # Generating binaries for the ARMv7-a architecture and higher with NEON
 #
-ARCH_ARM_HAVE_THUMB_SUPPORT     := true
-ARCH_ARM_HAVE_FAST_INTERWORKING := true
-ARCH_ARM_HAVE_64BIT_DATA        := true
-ARCH_ARM_HAVE_HALFWORD_MULTIPLY := true
 ARCH_ARM_HAVE_ARMV7A            := true
-ARCH_ARM_HAVE_TLS_REGISTER      := true
 ARCH_ARM_HAVE_VFP               := true
 ARCH_ARM_HAVE_VFP_D32           := true
 ARCH_ARM_HAVE_NEON              := true
diff --git a/core/combo/arch/arm/armv7-a.mk b/core/combo/arch/arm/armv7-a.mk
index 7c33a5a..4a51977 100644
--- a/core/combo/arch/arm/armv7-a.mk
+++ b/core/combo/arch/arm/armv7-a.mk
@@ -1,12 +1,7 @@
 # Configuration for Linux on ARM.
 # Generating binaries for the ARMv7-a architecture and higher
 #
-ARCH_ARM_HAVE_THUMB_SUPPORT     := true
-ARCH_ARM_HAVE_FAST_INTERWORKING := true
-ARCH_ARM_HAVE_64BIT_DATA        := true
-ARCH_ARM_HAVE_HALFWORD_MULTIPLY := true
 ARCH_ARM_HAVE_ARMV7A            := true
-ARCH_ARM_HAVE_TLS_REGISTER      := true
 ARCH_ARM_HAVE_VFP               := true
 
 # Note: Hard coding the 'tune' value here is probably not ideal,
diff --git a/core/combo/arch/mips/mips32r2-fp.mk b/core/combo/arch/mips/mips32r2-fp.mk
index a407f00..08d91df 100644
--- a/core/combo/arch/mips/mips32r2-fp.mk
+++ b/core/combo/arch/mips/mips32r2-fp.mk
@@ -8,7 +8,8 @@
     -march=mips32r2 \
     -mtune=mips32r2 \
     -mips32r2 \
-    -mhard-float
+    -mhard-float \
+    -msynci
 
 arch_variant_ldflags := \
     -EL
diff --git a/core/combo/arch/mips/mips32r2.mk b/core/combo/arch/mips/mips32r2.mk
index 369d499..16ce76f 100644
--- a/core/combo/arch/mips/mips32r2.mk
+++ b/core/combo/arch/mips/mips32r2.mk
@@ -6,7 +6,8 @@
     -march=mips32r2 \
     -mtune=mips32r2 \
     -mips32r2 \
-    -msoft-float
+    -msoft-float \
+    -msynci
 
 arch_variant_ldflags := \
     -EL
diff --git a/core/combo/arch/mips/mips32r2dsp-fp.mk b/core/combo/arch/mips/mips32r2dsp-fp.mk
index 886872d..fe2b1fe 100644
--- a/core/combo/arch/mips/mips32r2dsp-fp.mk
+++ b/core/combo/arch/mips/mips32r2dsp-fp.mk
@@ -11,7 +11,8 @@
     -mtune=mips32r2 \
     -mips32r2 \
     -mhard-float \
-    -mdsp
+    -mdsp \
+    -msynci
 
 arch_variant_ldflags := \
     -EL
diff --git a/core/combo/arch/mips/mips32r2dsp.mk b/core/combo/arch/mips/mips32r2dsp.mk
index e67adc7..8a8976c 100644
--- a/core/combo/arch/mips/mips32r2dsp.mk
+++ b/core/combo/arch/mips/mips32r2dsp.mk
@@ -10,7 +10,8 @@
     -mtune=mips32r2 \
     -mips32r2 \
     -msoft-float \
-    -mdsp
+    -mdsp \
+    -msynci
 
 arch_variant_ldflags := \
     -EL
diff --git a/core/combo/arch/mips/mips32r2dspr2-fp.mk b/core/combo/arch/mips/mips32r2dspr2-fp.mk
index 27e090d..7e882b3 100644
--- a/core/combo/arch/mips/mips32r2dspr2-fp.mk
+++ b/core/combo/arch/mips/mips32r2dspr2-fp.mk
@@ -11,7 +11,8 @@
     -mtune=mips32r2 \
     -mips32r2 \
     -mhard-float \
-    -mdspr2
+    -mdspr2 \
+    -msynci
 
 arch_variant_ldflags := \
     -EL
diff --git a/core/combo/arch/mips/mips32r2dspr2.mk b/core/combo/arch/mips/mips32r2dspr2.mk
index c493d9a..c311523 100644
--- a/core/combo/arch/mips/mips32r2dspr2.mk
+++ b/core/combo/arch/mips/mips32r2dspr2.mk
@@ -10,7 +10,8 @@
     -mtune=mips32r2 \
     -mips32r2 \
     -msoft-float \
-    -mdspr2
+    -mdspr2 \
+    -msynci
 
 arch_variant_ldflags := \
     -EL
diff --git a/core/llvm_config.mk b/core/llvm_config.mk
index 2018e31..2f59edd 100644
--- a/core/llvm_config.mk
+++ b/core/llvm_config.mk
@@ -61,7 +61,8 @@
     -march=mips32r2 \
     -mtune=mips32r2 \
     -march=mips32 \
-    -mtune=mips32
+    -mtune=mips32 \
+    -msynci
 endif
 ifeq ($(TARGET_ARCH),x86)
   CLANG_CONFIG_EXTRA_ASFLAGS += \
diff --git a/target/board/generic/BoardConfig.mk b/target/board/generic/BoardConfig.mk
index 7a25f30..3b03250 100644
--- a/target/board/generic/BoardConfig.mk
+++ b/target/board/generic/BoardConfig.mk
@@ -22,7 +22,6 @@
 TARGET_ARCH_VARIANT := armv7-a
 TARGET_CPU_ABI := armeabi-v7a
 TARGET_CPU_ABI2 := armeabi
-ARCH_ARM_HAVE_TLS_REGISTER := true
 
 HAVE_HTC_AUDIO_DRIVER := true
 BOARD_USES_GENERIC_AUDIO := true
diff --git a/target/board/generic_mips/BoardConfig.mk b/target/board/generic_mips/BoardConfig.mk
index 8c2371f..c3881b4 100644
--- a/target/board/generic_mips/BoardConfig.mk
+++ b/target/board/generic_mips/BoardConfig.mk
@@ -34,9 +34,6 @@
 # no hardware camera
 USE_CAMERA_STUB := true
 
-# Set /system/bin/sh to ash, not mksh, to make sure we can switch back.
-TARGET_SHELL := ash
-
 # Enable dex-preoptimization to speed up the first boot sequence
 # of an SDK AVD. Note that this operation only works on Linux for now
 ifeq ($(HOST_OS),linux)
diff --git a/target/product/core.mk b/target/product/core.mk
index ddeec0b..ef640b8 100644
--- a/target/product/core.mk
+++ b/target/product/core.mk
@@ -14,93 +14,42 @@
 # limitations under the License.
 #
 
-PRODUCT_BRAND := generic
-PRODUCT_DEVICE := generic
-PRODUCT_NAME := core
+# Base configuration for communication-oriented android devices
+# (phones, tablets, etc.).  If you want a change to apply to ALL
+# devices (including non-phones and non-tablets), modify
+# core_minimal.mk instead.
 
 PRODUCT_PROPERTY_OVERRIDES := \
     ro.config.notification_sound=OnTheHunt.ogg \
     ro.config.alarm_alert=Alarm_Classic.ogg
 
 PRODUCT_PACKAGES += \
-    ApplicationsProvider \
-    BackupRestoreConfirmation \
     BasicDreams \
     Browser \
     Contacts \
     ContactsProvider \
     DefaultContainerService \
-    DownloadProvider \
-    DownloadProviderUi \
-    HTMLViewer \
     Home \
     KeyChain \
-    MediaProvider \
-    PackageInstaller \
     PicoTts \
-    SettingsProvider \
     SharedStorageBackup \
-    Shell \
     TelephonyProvider \
     UserDictionaryProvider \
     VpnDialogs \
     abcc \
-    apache-xml \
     atrace \
-    bouncycastle \
-    bu \
-    cacerts \
-    com.android.location.provider \
-    com.android.location.provider.xml \
-    core \
-    core-junit \
-    dalvikvm \
-    dexdeps \
-    dexdump \
-    dexlist \
-    dexopt \
-    dmtracedump \
-    drmserver \
-    dx \
-    ext \
-    framework-res \
-    hprof-conv \
-    icu.dat \
-    installd \
-    ip \
-    ip-up-vpn \
-    ip6tables \
-    iptables \
-    keystore \
-    keystore.default \
     libandroidfw \
-    libOpenMAXAL \
-    libOpenSLES \
     libaudiopreprocessing \
     libaudioutils \
     libbcc \
-    libcrypto \
-    libdownmix \
-    libdvm \
-    libdrmframework \
-    libdrmframework_jni \
-    libexpat \
-    libfilterfw \
     libfilterpack_imageproc \
     libgabi++ \
-    libicui18n \
-    libicuuc \
-    libjavacore \
     libkeystore \
     libmdnssd \
-    libnativehelper \
     libnfc_ndef \
     libportable \
     libpowermanager \
     libspeexresampler \
-    libsqlite_jni \
-    libssl \
-    libstagefright \
     libstagefright_chromium_http \
     libstagefright_soft_aacdec \
     libstagefright_soft_aacenc \
@@ -115,32 +64,18 @@
     libstagefright_soft_mp3dec \
     libstagefright_soft_mpeg4dec \
     libstagefright_soft_mpeg4enc \
+    libstagefright_soft_rawdec \
     libstagefright_soft_vorbisdec \
     libstagefright_soft_vpxdec \
     libstagefright_soft_vpxenc \
-    libstagefright_soft_rawdec \
     libvariablespeed \
     libwebrtc_audio_preprocessing \
-    libwilhelm \
-    libz \
-    make_ext4fs \
-    mdnsd \
-    requestsync \
-    screencap \
-    sensorservice \
     lint \
-    uiautomator \
+    mdnsd \
+    mms-common \
+    requestsync \
     telephony-common \
-    voip-common \
-    mms-common
-
-# SELinux packages
-PRODUCT_PACKAGES += \
-    sepolicy \
-    file_contexts \
-    seapp_contexts \
-    property_contexts \
-    mac_permissions.xml
+    voip-common
 
 # host-only dependencies
 ifeq ($(WITH_HOST_DALVIK),true)
@@ -158,4 +93,4 @@
         dalvik
 endif
 
-$(call inherit-product, $(SRC_TARGET_DIR)/product/base.mk)
+$(call inherit-product, $(SRC_TARGET_DIR)/product/core_minimal.mk)
diff --git a/target/product/core_minimal.mk b/target/product/core_minimal.mk
new file mode 100644
index 0000000..96a8592
--- /dev/null
+++ b/target/product/core_minimal.mk
@@ -0,0 +1,84 @@
+#
+# Copyright (C) 2013 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.
+# You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+# Base configuration for most consumer android devices.  Do not put
+# things that are specific to communication devices (phones, tables,
+# etc.) here -- for that, use core.mk.
+
+PRODUCT_BRAND := generic
+PRODUCT_DEVICE := generic
+PRODUCT_NAME := core
+
+PRODUCT_PACKAGES += \
+    ApplicationsProvider \
+    BackupRestoreConfirmation \
+    DownloadProvider \
+    DownloadProviderUi \
+    HTMLViewer \
+    MediaProvider \
+    PackageInstaller \
+    SettingsProvider \
+    Shell \
+    apache-xml \
+    bouncycastle \
+    bu \
+    cacerts \
+    com.android.location.provider \
+    com.android.location.provider.xml \
+    core \
+    core-junit \
+    dalvikvm \
+    dexdeps \
+    dexdump \
+    dexlist \
+    dexopt \
+    dmtracedump \
+    drmserver \
+    dx \
+    ext \
+    framework-res \
+    hprof-conv \
+    icu.dat \
+    installd \
+    ip \
+    ip-up-vpn \
+    ip6tables \
+    iptables \
+    keystore \
+    keystore.default \
+    libOpenMAXAL \
+    libOpenSLES \
+    libcrypto \
+    libdownmix \
+    libdvm \
+    libdrmframework \
+    libdrmframework_jni \
+    libexpat \
+    libfilterfw \
+    libicui18n \
+    libicuuc \
+    libjavacore \
+    libnativehelper \
+    libsqlite_jni \
+    libssl \
+    libwilhelm \
+    libz \
+    make_ext4fs \
+    screencap \
+    sensorservice \
+    uiautomator
+
+$(call inherit-product, $(SRC_TARGET_DIR)/product/base.mk)