merge in jb-mr2-release history after reset to master
diff --git a/core/build_id.mk b/core/build_id.mk
index 2d75cdb..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=JWQ43B
+# 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/HOST_linux-x86.mk b/core/combo/HOST_linux-x86.mk
index 3001f59..4f35ea7 100644
--- a/core/combo/HOST_linux-x86.mk
+++ b/core/combo/HOST_linux-x86.mk
@@ -24,7 +24,9 @@
 
 # Previously the prebiult host toolchain is used only for the sdk build,
 # that's why we have "sdk" in the path name.
+ifeq ($(strip $(HOST_TOOLCHAIN_PREFIX)),)
 HOST_TOOLCHAIN_PREFIX := prebuilts/tools/gcc-sdk
+endif
 # Don't do anything if the toolchain is not there
 ifneq (,$(strip $(wildcard $(HOST_TOOLCHAIN_PREFIX)/gcc)))
 HOST_CC  := $(HOST_TOOLCHAIN_PREFIX)/gcc
diff --git a/core/definitions.mk b/core/definitions.mk
index be26024..cb20d8f 100644
--- a/core/definitions.mk
+++ b/core/definitions.mk
@@ -828,7 +828,7 @@
 	$(PRIVATE_COMPILER_RT) \
 	-o $@ -L prebuilts/gcc/ \
 	-L $(TARGET_OUT_INTERMEDIATE_LIBRARIES) $(PRIVATE_LIBPATH) \
-	-lRSSupport -lm -lcompiler_rt
+	-lRSSupport -lm
 endef
 
 ###########################################################
diff --git a/core/java.mk b/core/java.mk
index b16038e..02cfad7 100644
--- a/core/java.mk
+++ b/core/java.mk
@@ -218,13 +218,11 @@
 endif # TARGET_BUILD_APPS
 rs_support_lib := $(TARGET_OUT_INTERMEDIATE_LIBRARIES)/libRSSupport.so
 rs_jni_lib := $(TARGET_OUT_INTERMEDIATE_LIBRARIES)/librsjni.so
-rs_compiler_rt_so := $(TARGET_OUT_INTERMEDIATE_LIBRARIES)/libcompiler_rt.so
 LOCAL_JNI_SHARED_LIBRARIES += libRSSupport librsjni libcompiler_rt
 
 $(rs_compatibility_jni_libs): $(RenderScript_file_stamp)
 $(rs_compatibility_jni_libs): $(BCC_COMPAT) $(rs_built_clcore)
 $(rs_compatibility_jni_libs): $(rs_support_lib) $(rs_jni_lib) $(rs_compiler_rt)
-$(rs_compatibility_jni_libs): $(rs_compiler_rt_so)
 $(rs_compatibility_jni_libs): PRIVATE_CXX := $(TARGET_CXX)
 $(rs_compatibility_jni_libs): PRIVATE_LIBCLCORE := $(rs_built_clcore)
 $(rs_compatibility_jni_libs): PRIVATE_COMPILER_RT := $(rs_compiler_rt)
diff --git a/core/prebuilt.mk b/core/prebuilt.mk
index c9e07ef..46771e4 100644
--- a/core/prebuilt.mk
+++ b/core/prebuilt.mk
@@ -33,14 +33,15 @@
   OVERRIDE_BUILT_MODULE_PATH := $($(my_prefix)OUT_INTERMEDIATE_LIBRARIES)
 endif
 
-# Deal with the OSX library timestamp issue when installing
-# a prebuilt simulator library.
 ifneq ($(filter STATIC_LIBRARIES SHARED_LIBRARIES,$(LOCAL_MODULE_CLASS)),)
   prebuilt_module_is_a_library := true
 else
   prebuilt_module_is_a_library :=
 endif
 
+# Install the shared libraries if necessary
+LOCAL_REQUIRED_MODULES += $(LOCAL_SHARED_LIBRARIES)
+
 # Don't install static libraries by default.
 ifndef LOCAL_UNINSTALLABLE_MODULE
 ifeq (STATIC_LIBRARIES,$(LOCAL_MODULE_CLASS))
diff --git a/target/product/generic_no_telephony.mk b/target/product/generic_no_telephony.mk
index 0b65c35..b901104 100644
--- a/target/product/generic_no_telephony.mk
+++ b/target/product/generic_no_telephony.mk
@@ -86,6 +86,7 @@
 $(call inherit-product-if-exists, external/lohit-fonts/fonts.mk)
 $(call inherit-product-if-exists, external/naver-fonts/fonts.mk)
 $(call inherit-product-if-exists, frameworks/base/data/keyboards/keyboards.mk)
+$(call inherit-product-if-exists, frameworks/webview/chromium/chromium.mk)
 $(call inherit-product, $(SRC_TARGET_DIR)/product/core.mk)
 
 # Overrides
diff --git a/tools/droiddoc/templates-sdk/assets/js/docs.js b/tools/droiddoc/templates-sdk/assets/js/docs.js
index 394dbe4..ded3eaf 100644
--- a/tools/droiddoc/templates-sdk/assets/js/docs.js
+++ b/tools/droiddoc/templates-sdk/assets/js/docs.js
@@ -112,7 +112,7 @@
   if (pagePath.indexOf("/intl/") == 0) {
     pagePath = pagePath.substr(pagePath.indexOf("/",6)); // start after intl/ to get last /
   }
-  
+
   if (pagePath.indexOf(SITE_ROOT) == 0) {
     if (pagePath == '' || pagePath.charAt(pagePath.length - 1) == '/') {
       pagePath += 'index.html';
@@ -138,12 +138,47 @@
     // Otherwise the page path is already an absolute URL
   }
 
-  // select current page in sidenav and set up prev/next links if they exist
+  // Highlight the header tabs...
+  // highlight Design tab
+  if ($("body").hasClass("design")) {
+    $("#header li.design a").addClass("selected");
+
+  // highlight Develop tab
+  } else if ($("body").hasClass("develop") || $("body").hasClass("google")) {
+    $("#header li.develop a").addClass("selected");
+
+    // In Develop docs, also highlight appropriate sub-tab
+    var rootDir = pagePath.substring(1,pagePath.indexOf('/', 1));
+    if (rootDir == "training") {
+      $("#nav-x li.training a").addClass("selected");
+    } else if (rootDir == "guide") {
+      $("#nav-x li.guide a").addClass("selected");
+    } else if (rootDir == "reference") {
+      // If the root is reference, but page is also part of Google Services, select Google
+      if ($("body").hasClass("google")) {
+        $("#nav-x li.google a").addClass("selected");
+      } else {
+        $("#nav-x li.reference a").addClass("selected");
+      }
+    } else if ((rootDir == "tools") || (rootDir == "sdk")) {
+      $("#nav-x li.tools a").addClass("selected");
+    } else if ($("body").hasClass("google")) {
+      $("#nav-x li.google a").addClass("selected");
+    }
+
+  // highlight Distribute tab
+  } else if ($("body").hasClass("distribute")) {
+    $("#header li.distribute a").addClass("selected");
+  }
+
+
+  // select current page in sidenav and header, and set up prev/next links if they exist
   var $selNavLink = $('#nav').find('a[href="' + pagePath + '"]');
   var $selListItem;
   if ($selNavLink.length) {
-    $selListItem = $selNavLink.closest('li');
 
+    // Find this page's <li> in sidenav and set selected
+    $selListItem = $selNavLink.closest('li');
     $selListItem.addClass('selected');
     
     // Traverse up the tree and expand all parent nav-sections
@@ -151,7 +186,6 @@
       $(this).addClass('expanded');
       $(this).children('ul').show();
     });
-    
 
     // set up prev links
     var $prevLink = [];
diff --git a/tools/droiddoc/templates-sdk/components/masthead.cs b/tools/droiddoc/templates-sdk/components/masthead.cs
index fc16161..9f19906 100644
--- a/tools/droiddoc/templates-sdk/components/masthead.cs
+++ b/tools/droiddoc/templates-sdk/components/masthead.cs
@@ -13,8 +13,7 @@
           </div>
             <ul class="nav-x col-9">
                 <li class="design">
-                  <a href="<?cs var:toroot ?>design/index.html" <?cs
-                  if:design ?>class="selected"<?cs /if ?>
+                  <a href="<?cs var:toroot ?>design/index.html"
                   zh-TW-lang="設計"
                   zh-CN-lang="设计"
                   ru-lang="Проектирование"
@@ -22,8 +21,7 @@
                   ja-lang="設計"
                   es-lang="Diseñar"               
                   >Design</a></li>
-                <li class="develop"><a href="<?cs var:toroot ?>develop/index.html" <?cs
-                  if:training || guide || reference || tools || develop || google ?>class="selected"<?cs /if ?>
+                <li class="develop"><a href="<?cs var:toroot ?>develop/index.html"
                   zh-TW-lang="開發"
                   zh-CN-lang="开发"
                   ru-lang="Разработка"
@@ -31,8 +29,7 @@
                   ja-lang="開発"
                   es-lang="Desarrollar"               
                   >Develop</a></li>
-                <li class="distribute last"><a href="<?cs var:toroot ?>distribute/index.html" <?cs
-                  if:distribute ?>class="selected"<?cs /if ?>
+                <li class="distribute last"><a href="<?cs var:toroot ?>distribute/index.html"
                   zh-TW-lang="發佈"
                   zh-CN-lang="分发"
                   ru-lang="Распространение"
@@ -203,8 +200,7 @@
     <div id="nav-x">
         <div class="wrap">
             <ul class="nav-x col-9 develop" style="width:100%">
-                <li><a href="<?cs var:toroot ?>training/index.html" <?cs
-                  if:training ?>class="selected"<?cs /if ?>
+                <li class="training"><a href="<?cs var:toroot ?>training/index.html"
                   zh-TW-lang="訓練課程"
                   zh-CN-lang="培训"
                   ru-lang="Курсы"
@@ -212,8 +208,7 @@
                   ja-lang="トレーニング"
                   es-lang="Capacitación"               
                   >Training</a></li>
-                <li><a href="<?cs var:toroot ?>guide/components/index.html" <?cs
-                  if:guide ?>class="selected"<?cs /if ?>
+                <li class="guide"><a href="<?cs var:toroot ?>guide/components/index.html"
                   zh-TW-lang="API 指南"
                   zh-CN-lang="API 指南"
                   ru-lang="Руководства по API"
@@ -221,8 +216,7 @@
                   ja-lang="API ガイド"
                   es-lang="Guías de la API"               
                   >API Guides</a></li>
-                <li><a href="<?cs var:toroot ?>reference/packages.html" <?cs
-                  if:reference && !(reference.gcm || reference.gms) ?>class="selected"<?cs /if ?>
+                <li class="reference"><a href="<?cs var:toroot ?>reference/packages.html"
                   zh-TW-lang="參考資源"
                   zh-CN-lang="参考"
                   ru-lang="Справочник"
@@ -230,8 +224,7 @@
                   ja-lang="リファレンス"
                   es-lang="Referencia"               
                   >Reference</a></li>
-                <li><a href="<?cs var:toroot ?>tools/index.html" <?cs
-                  if:tools ?>class="selected"<?cs /if ?>
+                <li class="tools"><a href="<?cs var:toroot ?>tools/index.html"
                   zh-TW-lang="相關工具"
                   zh-CN-lang="工具"
                   ru-lang="Инструменты"
@@ -239,8 +232,7 @@
                   ja-lang="ツール"
                   es-lang="Herramientas"
                   >Tools</a></li>
-                <li><a href="<?cs var:toroot ?>google/index.html" <?cs
-                  if:google || reference.gcm || reference.gms?>class="selected"<?cs /if ?>
+                <li class="google"><a href="<?cs var:toroot ?>google/index.html"
                   >Google Services</a>
                 </li>
             </ul>