Merge "x86: Use GCC 4.4.3"
diff --git a/core/Makefile b/core/Makefile
index e577063..ec3cc02 100644
--- a/core/Makefile
+++ b/core/Makefile
@@ -906,7 +906,9 @@
 	  $(HOST_OUT_EXECUTABLES)/bsdiff \
 	  $(HOST_OUT_EXECUTABLES)/imgdiff \
 	  $(HOST_OUT_JAVA_LIBRARIES)/dumpkey.jar \
-	  $(HOST_OUT_JAVA_LIBRARIES)/signapk.jar
+	  $(HOST_OUT_JAVA_LIBRARIES)/signapk.jar \
+	  $(HOST_OUT_EXECUTABLES)/mkuserimg.sh \
+	  $(HOST_OUT_EXECUTABLES)/make_ext4fs
 
 .PHONY: otatools
 otatools: $(OTATOOLS)
diff --git a/core/base_rules.mk b/core/base_rules.mk
index 6c06528..54bbb68 100644
--- a/core/base_rules.mk
+++ b/core/base_rules.mk
@@ -57,8 +57,12 @@
 
 LOCAL_MODULE_TAGS := $(sort $(LOCAL_MODULE_TAGS))
 ifeq (,$(LOCAL_MODULE_TAGS))
-# Modules without tags fall back to user (which is changed to user eng below)
+ifeq (true,$(LOCAL_UNINSTALLABLE_MODULE))
+LOCAL_MODULE_TAGS := optional
+else
+# Installable modules without tags fall back to user (which is changed to user eng below)
 LOCAL_MODULE_TAGS := user
+endif
 #$(warning default tags: $(lastword $(filter-out config/% out/%,$(MAKEFILE_LIST))))
 endif
 
diff --git a/core/cleanbuild.mk b/core/cleanbuild.mk
index cf25ce1..821b03a 100644
--- a/core/cleanbuild.mk
+++ b/core/cleanbuild.mk
@@ -160,8 +160,6 @@
 
 # The files/dirs to delete during an installclean.  This includes the
 # non-common APPS directory, which may contain the wrong resources.
-# Use "./" in front of the paths to avoid accidentally deleting random
-# parts of the filesystem if any of the *_OUT vars resolve to blank.
 #
 # Deletes all of the files that change between different build types,
 # like "make user" vs. "make sdk".  This lets you work with different
@@ -174,28 +172,34 @@
 #     $ make -j8 sdk
 #
 installclean_files := \
-	./$(HOST_OUT)/obj/NOTICE_FILES \
-	./$(HOST_OUT)/sdk \
-	./$(PRODUCT_OUT)/*.img \
-	./$(PRODUCT_OUT)/*.txt \
-	./$(PRODUCT_OUT)/*.xlb \
-	./$(PRODUCT_OUT)/*.zip \
-	./$(PRODUCT_OUT)/data \
-	./$(PRODUCT_OUT)/obj/APPS \
-	./$(PRODUCT_OUT)/obj/NOTICE_FILES \
-	./$(PRODUCT_OUT)/obj/PACKAGING \
-	./$(PRODUCT_OUT)/recovery \
-	./$(PRODUCT_OUT)/root \
-	./$(PRODUCT_OUT)/system \
-	./$(PRODUCT_OUT)/dex_bootjars \
-	./$(PRODUCT_OUT)/obj/JAVA_LIBRARIES
+	$(HOST_OUT)/obj/NOTICE_FILES \
+	$(HOST_OUT)/sdk \
+	$(PRODUCT_OUT)/*.img \
+	$(PRODUCT_OUT)/*.txt \
+	$(PRODUCT_OUT)/*.xlb \
+	$(PRODUCT_OUT)/*.zip \
+	$(PRODUCT_OUT)/data \
+	$(PRODUCT_OUT)/obj/APPS \
+	$(PRODUCT_OUT)/obj/NOTICE_FILES \
+	$(PRODUCT_OUT)/obj/PACKAGING \
+	$(PRODUCT_OUT)/recovery \
+	$(PRODUCT_OUT)/root \
+	$(PRODUCT_OUT)/system \
+	$(PRODUCT_OUT)/dex_bootjars \
+	$(PRODUCT_OUT)/obj/JAVA_LIBRARIES
 
 # The files/dirs to delete during a dataclean, which removes any files
 # in the staging and emulator data partitions.
 dataclean_files := \
-	./$(PRODUCT_OUT)/data/* \
-	./$(PRODUCT_OUT)/data-qemu/* \
-	./$(PRODUCT_OUT)/userdata-qemu.img
+	$(PRODUCT_OUT)/data/* \
+	$(PRODUCT_OUT)/data-qemu/* \
+	$(PRODUCT_OUT)/userdata-qemu.img
+
+# make sure *_OUT is set so that we won't result in deleting random parts
+# of the filesystem.
+ifneq (2,$(words $(HOST_OUT) $(PRODUCT_OUT)))
+  $(error both HOST_OUT and PRODUCT_OUT should be set at this point.)
+endif
 
 # Define the rules for commandline invocation.
 .PHONY: dataclean
@@ -212,6 +216,7 @@
 
 ifeq "$(force_installclean)" "true"
   $(info *** Forcing "make installclean"...)
+  $(info *** rm -rf $(dataclean_files) $(installclean_files))
   $(shell rm -rf $(dataclean_files) $(installclean_files))
   $(info *** Done with the cleaning, now starting the real build.)
 endif
diff --git a/core/main.mk b/core/main.mk
index 0a7d3bf..3877bb2 100644
--- a/core/main.mk
+++ b/core/main.mk
@@ -450,6 +450,8 @@
 subdirs := \
 	bionic \
 	system/core \
+	system/extras/ext4_utils \
+	system/extras/su \
 	build/libs \
 	build/target \
 	build/tools/acp \
diff --git a/core/tasks/sdk-addon.mk b/core/tasks/sdk-addon.mk
index 62adeee..9133312 100644
--- a/core/tasks/sdk-addon.mk
+++ b/core/tasks/sdk-addon.mk
@@ -27,10 +27,23 @@
 sdk_addon_deps :=
 files_to_copy :=
 
+define stub-addon-jar-file
+$(subst .jar,_stub-addon.jar,$(1))
+endef
+
+define stub-addon-jar
+$(call stub-addon-jar-file,$(1)): $(1) | mkstubs
+	$(info Stubbing addon jar using $(PRODUCT_SDK_ADDON_STUB_DEFS))
+	$(hide) java -jar $(call module-installed-files,mkstubs) $(if $(hide),,--v) \
+		"$$<" "$$@" @$(PRODUCT_SDK_ADDON_STUB_DEFS)
+endef
+
 # Files that are built and then copied into the sdk-addon
 ifneq ($(strip $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_SDK_ADDON_COPY_MODULES)),)
 $(foreach cf,$(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_SDK_ADDON_COPY_MODULES), \
   $(eval _src := $(call module-stubs-files,$(call word-colon,1,$(cf)))) \
+  $(eval $(call stub-addon-jar,$(_src))) \
+  $(eval _src := $(call stub-addon-jar-file,$(_src))) \
   $(if $(_src),,$(eval $(error Unknown or unlinkable module: $(call word-colon,1,$(cf)). Requested by $(INTERNAL_PRODUCT)))) \
   $(eval _dest := $(call word-colon,2,$(cf))) \
   $(eval files_to_copy += $(_src):$(_dest)) \
diff --git a/core/version_defaults.mk b/core/version_defaults.mk
index 5618d78..2f57cf7 100644
--- a/core/version_defaults.mk
+++ b/core/version_defaults.mk
@@ -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 := 9
+  PLATFORM_SDK_VERSION := 10
 endif
 
 ifeq "" "$(PLATFORM_VERSION_CODENAME)"
@@ -96,4 +96,3 @@
   # anyone trying to parse it as an integer will probably get "0".
   BUILD_NUMBER := eng.$(USER).$(shell date +%Y%m%d.%H%M%S)
 endif
-
diff --git a/target/product/languages_full.mk b/target/product/languages_full.mk
index 6c49c79..236dfa2 100644
--- a/target/product/languages_full.mk
+++ b/target/product/languages_full.mk
@@ -15,9 +15,13 @@
 #
 
 # This is a build configuration that just contains a list of languages.
-# It helps in situations where laugnages must come first in the list,
+# It helps in situations where languages must come first in the list,
 # mostly because screen densities interfere with the list of locales and
 # the system misbehaves when a density is the first locale.
 
-# Those are all the locales that have translations.
-PRODUCT_LOCALES := en_US en_GB fr_FR it_IT es_ES es_US de_DE nl_NL cs_CZ pl_PL zh_TW zh_CN ru_RU ko_KR nb_NO pt_PT pt_BR da_DK el_GR sv_SE tr_TR ja_JP
+# 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 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
+
+# Not currently usable:
+# ar, fa, th
diff --git a/tools/droiddoc/src/DocFile.java b/tools/droiddoc/src/DocFile.java
index cc7a8cf..180fdcd 100644
--- a/tools/droiddoc/src/DocFile.java
+++ b/tools/droiddoc/src/DocFile.java
@@ -129,7 +129,7 @@
         } else {
             if (outfile.indexOf("sdk/") != -1) {
                 hdf.setValue("sdk", "true");
-                if ((outfile.indexOf("index.html") != -1) || (outfile.indexOf("features.html") != -1)) {
+                if ((outfile.indexOf("index.html") != -1) && (outfile.indexOf("preview/") == -1)) {
                     ClearPage.write(hdf, "sdkpage.cs", outfile);
                 } else {
                     ClearPage.write(hdf, "docpage.cs", outfile);
diff --git a/tools/droiddoc/templates-sdk/sdkpage.cs b/tools/droiddoc/templates-sdk/sdkpage.cs
index 77bb959..6c35b81 100644
--- a/tools/droiddoc/templates-sdk/sdkpage.cs
+++ b/tools/droiddoc/templates-sdk/sdkpage.cs
@@ -29,7 +29,16 @@
       if:sdk.redirect.path ?><?cs var:sdk.redirect.path ?><?cs
       else ?>Download the SDK<?cs /if ?>
     </a> ...</p>
+
 <?cs else ?>
+<?cs # else, if NOT redirect ...
+#
+#
+# The following is for SDK/NDK pages
+#
+#
+?>
+
 <div class="g-unit" id="doc-content" >
   <div id="jd-header" class="guide-header" >
     <span class="crumb">&nbsp;</span>
@@ -37,13 +46,6 @@
   </div>
 
   <div id="jd-content">
-    <?cs
-    if:ndk ?><?cs
-    else ?><?cs
-      if:android.whichdoc == "online" ?><p><em><?cs
-      var:sdk.date ?></em></p><?cs
-      /if ?><?cs
-    /if ?>
 
 <?cs if:sdk.not_latest_version ?>
   <div class="special">
@@ -52,12 +54,23 @@
   </div>
 <?cs /if ?>
 
-<?cs if:android.whichdoc != "online" && !android.preview ?>
 
-<!-- <p>The sections below provide an overview of how to install the SDK package. </p> -->
-
-<?cs else ?>
-  <?cs if:ndk ?>
+<?cs if:ndk ?>
+<?cs #
+#
+#
+#
+#
+#
+#
+# the following is for the NDK
+#
+# (nested in if/else redirect)
+#
+#
+#
+#
+?>
 
 <p>The Android NDK is a companion tool to the Android SDK that lets you build
 performance-critical portions of your apps in native code. It provides headers and
@@ -113,54 +126,23 @@
   </tr>
   </table>
 
-  <?cs else ?><?cs if:android.whichdoc == "online" ?>
-
-  <?cs if:sdk.preview ?>
-  <p>Welcome developers! The next release of the Android platform will be
-  Android 1.6 and we are pleased to announce the availability of an early look
-  SDK to give you a head-start on developing applications for it. </p>
-
-  <p>The Android <?cs var:sdk.preview.version ?> platform includes a variety of
-  improvements and new features for users and developers. Additionally, the SDK
-  itself introduces several new capabilities that enable you to develop
-  applications more efficiently. See the <a href="features.html">Android <?cs
-  var:sdk.preview.version ?> Platform Highlights</a> document for a list of
-  highlights.</p>
-<?cs /if ?>
-<?cs # end if NDK ... the following is for the SDK ?>
-
-<?cs #
-    <div class="toggle-content special">
-    <p>The Android SDK has changed! If you've worked with the Android SDK before,
-    you will notice several important differences:</p>
-
-    <div class="toggle-content-toggleme" style="display:none">
-    <ul style="padding-bottom:.0;">
-    <li style="margin-top:.5em">The SDK downloadable package includes <em>only</em>
-    the latest version of the Android SDK Tools.</li>
-    <li>Once you've installed the SDK, you now use the Android SDK and AVD Manager
-    to download all of the SDK components that you need, such as Android platforms,
-    SDK add-ons, tools, and documentation. </li>
-    <li>The new approach is modular &mdash; you can install only the components you
-    need and update any or all components without affecting other parts of your
-    development environment.</li>
-    <li>In short, once you've installed the new SDK, you will not need to download
-    an SDK package again. Instead, you will use the Android SDK and AVD Manager to
-    keep your development environment up-to-date. </li>
-    </ul>
-    <p style="margin-top:0">If you are currently using the Android 1.6 SDK, you
-    do not need to install the new SDK, because your existing SDK already
-    includes the Android SDK and AVD Manager tool. To develop against Android
-    2.0.1, for example, you can just download the Android 2.0.1 platform (and
-    updated SDK Tools) into your existing SDK. Refer to <a
-    href="adding-components.html">Adding SDK Components</a>.</p>
-    </div>
-
-    <a href='#' class='toggle-content-button show' onclick="toggleContent(this,true);return false;">
-      <span>show more</span><span style='display:none'>show less</span>
-    </a>
-  </div>
+  <?cs else ?>
+<?cs # end if NDK ... 
+#
+#
+#
+#
+#
+#
+# the following is for the SDK
+#
+# (nested in if/else redirect and if/else NDK)
+#
+#
+#
+#
 ?>
+  <?cs if:android.whichdoc == "online" ?>
 
   <p>Welcome Developers! If you are new to the Android SDK, please read the steps below, for an
 overview of how to set up the SDK. </p>
@@ -168,7 +150,7 @@
   <p>If you're already using the Android SDK, you should
 update to the latest tools or platform using the <em>Android SDK and AVD Manager</em>, rather than
 downloading a new SDK starter package. See <a
-href="{@docRoot}sdk/adding-components.html">Adding SDK Components</a>.</p>
+href="<?cs var:toroot ?>sdk/adding-components.html">Adding SDK Components</a>.</p>
 
   <table class="download">
     <tr>
@@ -213,16 +195,6 @@
     <td><?cs var:sdk.linux_bytes ?> bytes</td>
     <td><?cs var:sdk.linux_checksum ?></td>
   </tr>
-  <?cs if:adt.zip_download ?>
-  <tr class="alt-color">
-    <td>ADT Plugin for Eclipse <?cs var:adt.zip_version ?></td>
-    <td>
-  <a href="http://dl.google.com/android/<?cs var:adt.zip_download ?>"><?cs var:adt.zip_download ?></a>
-    </td>
-    <td><?cs var:adt.zip_bytes ?> bytes</td>
-    <td><?cs var:adt.zip_checksum ?></td>
-  </tr>
-  <?cs /if ?>
   </table>
 
 
@@ -237,36 +209,21 @@
   $("#next-steps").show();
 }
 </script>
+  <?cs /if ?> <?cs # end if online ?>
 
-  <?cs /if ?>
- <?cs /if ?>
-<?cs /if ?>
+<?cs /if ?> <?cs # end if/else NDK ?>
 
-<?cs if:android.whichdoc != "online" && sdk.preview ?>
-  <p>Welcome developers! The next release of the Android platform will be
-Android <?cs var:sdk.preview.version ?> and we are pleased to announce the
-availability of an early look SDK to give you a head-start on developing
-applications for it. </p>
+<?cs /if ?> <?cs # end if/else redirect ?>
 
-  <p>The Android <?cs var:sdk.preview.version ?> platform includes a variety of
-improvements and new features for users and developers. Additionally, the SDK
-itself introduces several new capabilities that enable you to develop
-applications more efficiently. See the <a
-href="http://developer.android.com/sdk/preview/features.html">Android
-<?cs var:sdk.preview.version ?> Highlights</a> document for a list of
-highlights.</p>
-<?cs /if ?>
+<?cs call:tag_list(root.descr) ?>
 
-      <?cs call:tag_list(root.descr) ?>
-
-<?cs /if ?>
 </div><!-- end jd-content -->
 
 <?cs if:!sdk.redirect ?>
-     <?cs include:"footer.cs" ?>
+<?cs include:"footer.cs" ?>
 <?cs /if ?>
 
-</div><!-- end doc-content -->
+</div><!-- end g-unit -->
 
 <?cs include:"trailer.cs" ?>
 
diff --git a/tools/droiddoc/templates/assets/android-developer-docs.css b/tools/droiddoc/templates/assets/android-developer-docs.css
index a574237..1672c93 100644
--- a/tools/droiddoc/templates/assets/android-developer-docs.css
+++ b/tools/droiddoc/templates/assets/android-developer-docs.css
@@ -726,34 +726,36 @@
   padding:0;
 }
 
-p.note, p.caution, p.warning {
+p.note, div.note,
+p.caution, div.caution,
+p.warning, div.warning {
   margin: 1em;
   padding: 0 0 0 .5em;
   border-left: 4px solid;
 }
 
-p.special-note {
+p.special-note,
+div.special-note {
   background-color:#EBF3DB;
   padding:10px 20px;
   margin:0 0 1em;
 }
 
-p.note {
+p.note,
+div.note {
  border-color: #99aacc;
 }
 
-p.warning {
+p.warning,
+div.warning {
   border-color: #aa0033;
 }
 
-p.caution {
+p.caution,
+div.caution {
   border-color: #ffcf00;
 }
 
-p.warning b, p.warning strong {
-  font-weight: bold;
-}
-
 li p.note, li p.warning {
   margin: .5em 0 0 0;
   padding: .2em .5em .2em .9em;
diff --git a/tools/droiddoc/templates/assets/android-developer-reference.js b/tools/droiddoc/templates/assets/android-developer-reference.js
index daddde0..31a702b 100644
--- a/tools/droiddoc/templates/assets/android-developer-reference.js
+++ b/tools/droiddoc/templates/assets/android-developer-reference.js
@@ -56,7 +56,7 @@
   if (userApiLevelEnabled == 0) {
     toggleVisisbleApis(selectedLevel, "body");
   } else {
-    selectedLevel = $("#apiLevelSelector option:selected").val();
+    selectedLevel = parseInt($("#apiLevelSelector option:selected").val());
     toggleVisisbleApis(selectedLevel, "body");
     
     var date = new Date();