Merge "Teach the build system to reserve the last 16 Kbytes of /data for the crypto footer" into honeycomb
diff --git a/CleanSpec.mk b/CleanSpec.mk
index f9b2c56..0e89c6a 100644
--- a/CleanSpec.mk
+++ b/CleanSpec.mk
@@ -61,6 +61,9 @@
 $(call add-clean-step, rm -rf $(PRODUCT_OUT)/system/app/*)
 $(call add-clean-step, rm -rf $(PRODUCT_OUT)/data/app/*)
 $(call add-clean-step, rm -rf $(PRODUCT_OUT)/system/build.prop)
+$(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/*/LINKED)
 
 # ************************************************
 # NEWER CLEAN STEPS MUST BE AT THE END OF THE LIST
diff --git a/core/Makefile b/core/Makefile
index be15de9..e267fe0 100644
--- a/core/Makefile
+++ b/core/Makefile
@@ -1051,16 +1051,16 @@
 	$(hide) echo "blocksize=$(BOARD_FLASH_BLOCK_SIZE)" >> $(zip_root)/META/misc_info.txt
 endif
 ifdef BOARD_BOOTIMAGE_PARTITION_SIZE
-	$(hide) echo "boot_size=$(call image-size-from-data-size,$(BOARD_BOOTIMAGE_PARTITION_SIZE))" >> $(zip_root)/META/misc_info.txt
+	$(hide) echo "boot_size=$(BOARD_BOOTIMAGE_PARTITION_SIZE)" >> $(zip_root)/META/misc_info.txt
 endif
 ifdef BOARD_RECOVERYIMAGE_PARTITION_SIZE
-	$(hide) echo "recovery_size=$(call image-size-from-data-size,$(BOARD_RECOVERYIMAGE_PARTITION_SIZE))" >> $(zip_root)/META/misc_info.txt
+	$(hide) echo "recovery_size=$(BOARD_RECOVERYIMAGE_PARTITION_SIZE)" >> $(zip_root)/META/misc_info.txt
 endif
 ifdef BOARD_SYSTEMIMAGE_PARTITION_SIZE
-	$(hide) echo "system_size=$(call image-size-from-data-size,$(BOARD_SYSTEMIMAGE_PARTITION_SIZE))" >> $(zip_root)/META/misc_info.txt
+	$(hide) echo "system_size=$(BOARD_SYSTEMIMAGE_PARTITION_SIZE)" >> $(zip_root)/META/misc_info.txt
 endif
 ifdef BOARD_USERDATAIMAGE_PARTITION_SIZE
-	$(hide) echo "userdata_size=$(call image-size-from-data-size,$(BOARD_USERDATAIMAGE_PARTITION_SIZE))" >> $(zip_root)/META/misc_info.txt
+	$(hide) echo "userdata_size=$(BOARD_USERDATAIMAGE_PARTITION_SIZE)" >> $(zip_root)/META/misc_info.txt
 endif
 	$(hide) echo "tool_extensions=$(tool_extensions)" >> $(zip_root)/META/misc_info.txt
 ifdef mkyaffs2_extra_flags
diff --git a/core/base_rules.mk b/core/base_rules.mk
index d0af289..d0c4aaf 100644
--- a/core/base_rules.mk
+++ b/core/base_rules.mk
@@ -520,7 +520,7 @@
 ifneq ($(LOCAL_ACP_UNAVAILABLE),true)
 $(LOCAL_INSTALLED_MODULE): $(LOCAL_BUILT_MODULE) | $(ACP)
 	@echo "Install: $@"
-	$(copy-file-to-target)
+	$(copy-file-to-new-target)
 else
 $(LOCAL_INSTALLED_MODULE): $(LOCAL_BUILT_MODULE)
 	@echo "Install: $@"
@@ -534,7 +534,7 @@
 	@echo "Install: $@"
 	$(copy-file-to-target)
 
-$(LOCAL_INSTALLED_MODULE) : | $(installed_odex)
+$(LOCAL_INSTALLED_MODULE) : $(installed_odex)
 endif
 
 endif # !LOCAL_UNINSTALLABLE_MODULE
diff --git a/core/definitions.mk b/core/definitions.mk
index 6ba7485..ea47f6b 100644
--- a/core/definitions.mk
+++ b/core/definitions.mk
@@ -1634,9 +1634,12 @@
 # Copy a single file from one place to another,
 # preserving permissions and overwriting any existing
 # file.
+# We disable the "-t" option for acp can not handle
+# high resolution timestamp correctly on file systems like ext4.
+# Therefore copy-file-to-target is the same as copy-file-to-new-target.
 define copy-file-to-target
 @mkdir -p $(dir $@)
-$(hide) $(ACP) -fpt $< $@
+$(hide) $(ACP) -fp $< $@
 endef
 
 # The same as copy-file-to-target, but use the local
@@ -1725,7 +1728,7 @@
 # Command to copy the file with acp, if proguard is disabled.
 define proguard-disabled-commands
 @echo Copying: $@
-$(hide) $(ACP) $< $@
+$(hide) $(ACP) -fp $< $@
 endef
 
 # Command to call Proguard
diff --git a/core/dex_preopt.mk b/core/dex_preopt.mk
index 6e0b093..4da2632 100644
--- a/core/dex_preopt.mk
+++ b/core/dex_preopt.mk
@@ -51,7 +51,7 @@
 	@echo "Dexpreopt Boot Jar: $$@"
 	$(hide) rm -f $$@
 	$(hide) mkdir -p $$(dir $$@)
-	$(hide) $(ACP) -fpt $$< $$(PRIVATE_DBJ_JAR)
+	$(hide) $(ACP) -fp $$< $$(PRIVATE_DBJ_JAR)
 	$$(call dexpreopt-one-file,$$(PRIVATE_DBJ_JAR),$$@)
 
 $(_dbj_jar_no_dex) : $(_dbj_src_jar) | $(ACP) $(AAPT)
@@ -60,6 +60,7 @@
 
 $(eval _dbj_jar :=)
 $(eval _dbj_odex :=)
+$(eval _dbj_jar_no_dex :=)
 $(eval _dbj_src_jar :=)
 endef
 
diff --git a/core/java.mk b/core/java.mk
index c4baff5..949af3c 100644
--- a/core/java.mk
+++ b/core/java.mk
@@ -136,8 +136,10 @@
 renderscript_intermediate := $(LOCAL_INTERMEDIATE_SOURCE_DIR)/renderscript
 
 # prepend the RenderScript system include path
-LOCAL_RENDERSCRIPT_INCLUDES := $(TOPDIR)frameworks/base/libs/rs/scriptc \
-    $(LOCAL_RENDERSCRIPT_INCLUDES)
+LOCAL_RENDERSCRIPT_INCLUDES := \
+     $(TOPDIR)external/clang/lib/Headers \
+     $(TOPDIR)frameworks/base/libs/rs/scriptc \
+     $(LOCAL_RENDERSCRIPT_INCLUDES)
 
 $(RenderScript_file_stamp): PRIVATE_RS_INCLUDES := $(LOCAL_RENDERSCRIPT_INCLUDES)
 $(RenderScript_file_stamp): PRIVATE_RS_SOURCE_FILES := $(renderscript_sources_fullpath)
@@ -235,7 +237,7 @@
 else
 $(full_classes_jarjar_jar): $(full_classes_compiled_jar) | $(ACP)
 	@echo Copying: $@
-	$(hide) $(ACP) $< $@
+	$(hide) $(ACP) -fp $< $@
 endif
 
 ifeq ($(LOCAL_IS_STATIC_JAVA_LIBRARY),true)
@@ -273,7 +275,7 @@
 # Keep a copy of the jar just before proguard processing.
 $(full_classes_jar): $(full_classes_emma_jar) | $(ACP)
 	@echo Copying: $@
-	$(hide) $(ACP) $< $@
+	$(hide) $(ACP) -fp $< $@
 
 # Run proguard if necessary, otherwise just copy the file.
 proguard_dictionary := $(intermediates.COMMON)/proguard_dictionary
@@ -335,7 +337,7 @@
 	$(transform-classes.jar-to-dex)
 $(built_dex): $(built_dex_intermediate) | $(ACP)
 	@echo Copying: $@
-	$(hide) $(ACP) $< $@
+	$(hide) $(ACP) -fp $< $@
 ifneq ($(GENERATE_DEX_DEBUG),)
 	$(install-dex-debug)
 endif
diff --git a/core/legacy_prebuilts.mk b/core/legacy_prebuilts.mk
index 821f12a..6a999c1 100644
--- a/core/legacy_prebuilts.mk
+++ b/core/legacy_prebuilts.mk
@@ -32,6 +32,7 @@
 	baseline8k.par \
 	baseline.par \
 	basic.ok \
+	batch \
 	bitmap_size.txt \
 	blacklist.conf \
 	bmgr \
diff --git a/core/prelink-linux-arm.map b/core/prelink-linux-arm.map
index 74d694d..86cec55 100644
--- a/core/prelink-linux-arm.map
+++ b/core/prelink-linux-arm.map
@@ -112,78 +112,78 @@
 # assorted system libraries
 libsqlite.so            0xA8B00000 # [~2M]
 libexpat.so             0xA8A00000 # [~1M]
-libwebcore.so           0xA8300000 # [~7M]
-libbinder.so            0xA8200000 # [~1M]
-libutils.so             0xA8100000 # [~1M]
-libcameraservice.so     0xA8000000 # [~1M]
-libhardware.so          0xA7F00000 # [<64K]
-libhardware_legacy.so   0xA7E00000 # [~1M]
-libapp_process.so       0xA7D00000 # [???]
-libsystem_server.so     0xA7C00000 # [~1M]
-libime.so               0xA7B00000 # [???]
-libgps.so               0xA7A00000 # [~1M]
-libcamera.so            0xA7900000 # [~1M]
-liboemcamera.so         0xA7700000 # [~2M]
-libdiskconfig.so        0xA7600000 # [<64K]
-libemoji.so             0xA7500000 # [<64K]
-libjni_latinime.so      0xA7400000 # [~1M]
-libjni_pinyinime.so     0xA7300000 # [~1M]
-libttssynthproxy.so     0xA7200000 # [~1M] for frameworks/base
-libttspico.so           0xA7000000 # [~2M] for external/svox
-libmtp.so               0xA6F00000 # [~1M]
-libusbhost.so           0xA6E00000 # [<64K]
-libinput.so             0xA6D00000 # [~1M]
+libwebcore.so           0xA8200000 # [~8M]
+libbinder.so            0xA8100000 # [~1M]
+libutils.so             0xA8000000 # [~1M]
+libcameraservice.so     0xA7F00000 # [~1M]
+libhardware.so          0xA7E00000 # [<64K]
+libhardware_legacy.so   0xA7D00000 # [~1M]
+libapp_process.so       0xA7C00000 # [???]
+libsystem_server.so     0xA7B00000 # [~1M]
+libime.so               0xA7A00000 # [???]
+libgps.so               0xA7900000 # [~1M]
+libcamera.so            0xA7800000 # [~1M]
+liboemcamera.so         0xA7600000 # [~2M]
+libdiskconfig.so        0xA7500000 # [<64K]
+libemoji.so             0xA7400000 # [<64K]
+libjni_latinime.so      0xA7300000 # [~1M]
+libjni_pinyinime.so     0xA7200000 # [~1M]
+libttssynthproxy.so     0xA7100000 # [~1M] for frameworks/base
+libttspico.so           0xA6F00000 # [~2M] for external/svox
+libmtp.so               0xA6E00000 # [~1M]
+libusbhost.so           0xA6D00000 # [<64K]
+libinput.so             0xA6C00000 # [~1M]
 
 # pv libraries
-libpvasf.so                    0xA6C00000 # [???]
-libpvasfreg.so                 0xA6B00000 # [???]
-libomx_sharedlibrary.so        0xA6A00000 # [~1M]
-libopencore_download.so        0xA6900000 # [~1M]
-libopencore_downloadreg.so     0xA6800000 # [~1M]
-libopencore_net_support.so     0xA6500000 # [~3M]
-libopencore_rtsp.so            0xA5F00000 # [~6M]
-libopencore_rtspreg.so         0xA5E00000 # [~1M]
-libopencore_author.so          0xA5A00000 # [~4M]
-libomx_aacdec_sharedlibrary.so 0xA5800000 # [~2M]
-libomx_amrdec_sharedlibrary.so 0xA5700000 # [~1M]
-libomx_amrenc_sharedlibrary.so 0xA5600000 # [~1M]
-libomx_avcdec_sharedlibrary.so 0xA5500000 # [~1M]
-libomx_avcenc_sharedlibrary.so 0xA5400000 # [???]
-libomx_m4vdec_sharedlibrary.so 0xA5300000 # [~1M]
-libomx_m4venc_sharedlibrary.so 0xA5200000 # [???]
-libomx_mp3dec_sharedlibrary.so 0xA5100000 # [~1M]
-libopencore_mp4local.so        0xA4F00000 # [~2M]
-libopencore_mp4localreg.so     0xA4E00000 # [~1M]
-libopencore_player.so          0xA4500000 # [~9M]
+libpvasf.so                    0xA6B00000 # [???]
+libpvasfreg.so                 0xA6A00000 # [???]
+libomx_sharedlibrary.so        0xA6900000 # [~1M]
+libopencore_download.so        0xA6800000 # [~1M]
+libopencore_downloadreg.so     0xA6700000 # [~1M]
+libopencore_net_support.so     0xA6400000 # [~3M]
+libopencore_rtsp.so            0xA5E00000 # [~6M]
+libopencore_rtspreg.so         0xA5D00000 # [~1M]
+libopencore_author.so          0xA5900000 # [~4M]
+libomx_aacdec_sharedlibrary.so 0xA5700000 # [~2M]
+libomx_amrdec_sharedlibrary.so 0xA5600000 # [~1M]
+libomx_amrenc_sharedlibrary.so 0xA5500000 # [~1M]
+libomx_avcdec_sharedlibrary.so 0xA5400000 # [~1M]
+libomx_avcenc_sharedlibrary.so 0xA5300000 # [???]
+libomx_m4vdec_sharedlibrary.so 0xA5200000 # [~1M]
+libomx_m4venc_sharedlibrary.so 0xA5100000 # [???]
+libomx_mp3dec_sharedlibrary.so 0xA5000000 # [~1M]
+libopencore_mp4local.so        0xA4E00000 # [~2M]
+libopencore_mp4localreg.so     0xA4D00000 # [~1M]
+libopencore_player.so          0xA4400000 # [~9M]
 
 # opencore hardware support
-libmm-adspsvc.so              0xA4400000 # [<64K]
-libOmxCore.so                 0xA4300000 # [<64K]
-libOmxMpeg4Dec.so             0xA4200000 # [~1M]
-libOmxH264Dec.so              0xA4100000 # [~1M]
-libOmxVidEnc.so               0xA4000000 # [~1M]
-libopencorehw.so              0xA3F00000 # [~1M]
-libOmxVdec.so                 0xA3E00000 # [~1M]
-libmm-omxcore.so              0xA3D00000 # [<64K]
+libmm-adspsvc.so              0xA4300000 # [<64K]
+libOmxCore.so                 0xA4200000 # [<64K]
+libOmxMpeg4Dec.so             0xA4100000 # [~1M]
+libOmxH264Dec.so              0xA4000000 # [~1M]
+libOmxVidEnc.so               0xA3F00000 # [~1M]
+libopencorehw.so              0xA3E00000 # [~1M]
+libOmxVdec.so                 0xA3D00000 # [~1M]
+libmm-omxcore.so              0xA3C00000 # [<64K]
 
 # pv libraries
-libopencore_common.so         0xA3600000 # [~7M]
-libqcomm_omx.so               0xA3500000 # [<64K]
+libopencore_common.so         0xA3500000 # [~7M]
+libqcomm_omx.so               0xA3400000 # [<64K]
 
 # stagefright libraries
-libstagefright_amrnb_common.so     0xA3400000 # [~1M]
-libstagefright_avc_common.so       0xA3300000 # [~1M]
-libstagefright_color_conversion.so 0xA3200000 # [<64K]
-libstagefright_omx.so              0xA3100000 # [~1M]
-libstagefrighthw.so                0xA3000000 # [~1M]
-libstagefright.so                  0xA2C00000 # [~4M]
+libstagefright_amrnb_common.so     0xA3300000 # [~1M]
+libstagefright_avc_common.so       0xA3200000 # [~1M]
+libstagefright_color_conversion.so 0xA3100000 # [<64K]
+libstagefright_omx.so              0xA3000000 # [~1M]
+libstagefrighthw.so                0xA2F00000 # [~1M]
+libstagefright.so                  0xA2B00000 # [~4M]
 
 # libraries for specific hardware
-libgsl.so               0xA2B00000 # [~1M]
-libhtc_acoustic.so      0xA2A00000 # [<64K]
-libhtc_ril.so           0xA2900000 # [~1M]
-liblvmxipc.so           0xA2800000 # [~1M] for vendor/nxp
-libreference-cdma-sms.so 0xA2700000 # [<64K] for hardware/ril
+libgsl.so               0xA2A00000 # [~1M]
+libhtc_acoustic.so      0xA2900000 # [<64K]
+libhtc_ril.so           0xA2800000 # [~1M]
+liblvmxipc.so           0xA2700000 # [~1M] for vendor/nxp
+libreference-cdma-sms.so 0xA2600000 # [<64K] for hardware/ril
 
 # libraries for specific apps or temporary libraries
 libcam_ipl.so           0x9F000000 # [???]
diff --git a/core/user_tags.mk b/core/user_tags.mk
index 39c66da1..1b4ef65 100644
--- a/core/user_tags.mk
+++ b/core/user_tags.mk
@@ -192,7 +192,6 @@
 	libaudiointerface \
 	libaudiopolicy \
 	libaudiopolicybase \
-	libbcc \
 	libbinder \
 	libbluedroid \
 	libbluetooth \
@@ -265,35 +264,6 @@
 	libjpeg \
 	libjs \
 	liblinenoise \
-	libLLVMAnalysis \
-	libLLVMARMAsmPrinter \
-	libLLVMARMCodeGen \
-	libLLVMARMDisassembler \
-	libLLVMARMInfo \
-	libLLVMAsmParser \
-	libLLVMAsmPrinter \
-	libLLVMBitReader \
-	libLLVMBitWriter \
-	libLLVMCodeGen \
-	libLLVMCore \
-	libLLVMInstCombine \
-	libLLVMInstrumentation \
-	libLLVMipa \
-	libLLVMipo \
-	libLLVMJIT \
-	libLLVMLinker \
-	libLLVMMC \
-	libLLVMMCParser \
-	libLLVMScalarOpts \
-	libLLVMSelectionDAG \
-	libLLVMSupport \
-	libLLVMSystem \
-	libLLVMTarget \
-	libLLVMTransformUtils \
-	libLLVMX86AsmPrinter \
-	libLLVMX86CodeGen \
-	libLLVMX86Disassembler \
-	libLLVMX86Info \
 	libloc_api-rpc \
 	liblog \
 	libm \
diff --git a/core/version_defaults.mk b/core/version_defaults.mk
index 5d2867a..8feff2b 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)"
diff --git a/target/product/generic_no_telephony.mk b/target/product/generic_no_telephony.mk
index cd79125..db74a7f 100644
--- a/target/product/generic_no_telephony.mk
+++ b/target/product/generic_no_telephony.mk
@@ -48,6 +48,13 @@
 PRODUCT_PACKAGES += \
     icu.dat
 
+PRODUCT_PACKAGES += \
+    librs_jni \
+    libvideoeditor_jni \
+    libvideoeditorplayer \
+    libvideoeditor_core
+
+
 PRODUCT_COPY_FILES := \
         system/bluetooth/data/audio.conf:system/etc/bluetooth/audio.conf \
         system/bluetooth/data/auto_pairing.conf:system/etc/bluetooth/auto_pairing.conf \
diff --git a/target/product/sdk.mk b/target/product/sdk.mk
index b856b11..72ed8b3 100644
--- a/target/product/sdk.mk
+++ b/target/product/sdk.mk
@@ -18,6 +18,20 @@
 PRODUCT_PROPERTY_OVERRIDES :=
 
 PRODUCT_PACKAGES := \
+	Calculator \
+	Camera \
+	DeskClock \
+	Email \
+	Gallery \
+	Music \
+	Mms \
+	OpenWnn \
+	libWnnEngDic \
+	libWnnJpnDic \
+	libwnndict \
+	PinyinIME \
+	Protips \
+	SoftKeyboard \
 	SystemUI \
 	Launcher2 \
 	AccountAndSyncSettings \
@@ -37,27 +51,15 @@
 	GestureBuilder \
 	CubeLiveWallpapers \
 	QuickSearchBox \
+	WidgetPreview \
 	monkeyrunner \
 	guavalib \
 	jsr305lib \
 	jython \
-	jsilver
+	jsilver \
+	librs_jni
 
-#	Calculator \
-#	Camera \
-#	DeskClock \
-#	Email \
-#	Gallery \
-#	Music \
-#	Mms \
-#	OpenWnn \
-#	libWnnEngDic \
-#	libWnnJpnDic \
-#	libwnndict \
 #	Phone \
-#	PinyinIME \
-#	Protips \
-#	SoftKeyboard \
 
 
 # Host tools that are parts of the SDK.
@@ -87,8 +89,8 @@
 	ddms \
 	ddmlib \
 	ddmuilib \
-	hierarchyviewer \
 	draw9patch \
+	hierarchyviewer \
 	layoutopt \
 	uix \
 	traceview \
diff --git a/tools/droiddoc/templates-sdk/sdkpage.cs b/tools/droiddoc/templates-sdk/sdkpage.cs
index 298e882..7756440 100644
--- a/tools/droiddoc/templates-sdk/sdkpage.cs
+++ b/tools/droiddoc/templates-sdk/sdkpage.cs
@@ -4,8 +4,8 @@
 <?cs if:sdk.redirect ?>
   <head>
     <title>Redirecting...</title>
-    <meta http-equiv="refresh" content="0;url=<?cs var:toroot ?>sdk/<?cs 
-      if:sdk.redirect.path ?><?cs var:sdk.redirect.path ?><?cs 
+    <meta http-equiv="refresh" content="0;url=<?cs var:toroot ?>sdk/<?cs
+      if:sdk.redirect.path ?><?cs var:sdk.redirect.path ?><?cs
       else ?>index.html<?cs /if ?>">
     <link href="<?cs var:toroot ?>assets/android-developer-docs.css" rel="stylesheet" type="text/css" />
   </head>
@@ -22,14 +22,23 @@
 
 <div class="g-unit">
   <div id="jd-content">
-    <p>Redirecting to 
-    <a href="<?cs var:toroot ?>sdk/<?cs 
+    <p>Redirecting to
+    <a href="<?cs var:toroot ?>sdk/<?cs
       if:sdk.redirect.path ?><?cs var:sdk.redirect.path ?><?cs
       else ?>index.html<?cs /if ?>"><?cs
       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" && !sdk.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
@@ -80,7 +93,6 @@
 do so before downloading the NDK. 
 </p>
 
-  <?cs if:sdk.whichdoc == "online" ?>
   <table class="download">
     <tr>
       <th>Platform</th>
@@ -113,24 +125,25 @@
     <td><?cs var:ndk.linux_checksum ?></td>
   </tr>
   </table>
-  <?cs /if ?><?cs # END if online ?>
 
- <?cs else ?><?cs # END if ndk ?>
+  <?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" ?>
 
-  <?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 preview ?>
-
   <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>
 
@@ -147,7 +160,7 @@
       <th>MD5 Checksum</th>
   </tr>
   <tr>
-    <td>Windows</td>
+    <td rowspan="2">Windows</td>
     <td>
   <a onclick="onDownload(this)" href="http://dl.google.com/android/<?cs var:sdk.win_download
 ?>"><?cs var:sdk.win_download ?></a>
@@ -155,6 +168,15 @@
     <td><?cs var:sdk.win_bytes ?> bytes</td>
     <td><?cs var:sdk.win_checksum ?></td>
   </tr>
+  <tr>
+    <!-- blank TD from Windows rowspan -->
+    <td>
+  <a onclick="onDownload(this)" href="http://dl.google.com/android/<?cs var:sdk.win_installer
+?>"><?cs var:sdk.win_installer ?></a> (Recommended)
+    </td>
+    <td><?cs var:sdk.win_installer_bytes ?> bytes</td>
+    <td><?cs var:sdk.win_installer_checksum ?></td>
+  </tr>
   <tr class="alt-color">
     <td>Mac OS X (intel)</td>
     <td>
@@ -173,60 +195,49 @@
     <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>
 
 
 <div id="next-steps" style="display:none">
-  <p><b>Your download of <em><span id="filename"></span></em> has begun!</b></p>
+  <p><b><em><span id="filename"></span></em> is now downloading. Follow the steps below to
+get started.</b></p>
 </div>
 
 <script type="text/javascript">
 function onDownload(link) {
-  $(link).parent().parent().children().css('background', '#fff');
   $("#filename").text($(link).html());
   $("#next-steps").show();
 }
 </script>
+  <?cs else ?> <?cs # end if online ?>
 
-  <?cs /if ?><?cs # END if online ?>
- <?cs /if ?><?cs # END if/else ndk/sdk ?>
-<?cs /if ?><?cs # END if/else redirect ?>
+    <?cs if:sdk.preview ?>
+      <p>Welcome developers! We are pleased to provide you with a preview SDK for the upcoming
+    Android 3.0 release, to give you a head-start on developing applications for it.
+    </p>
+    
+      <p>See the <a
+    href="<?cs var:toroot ?>sdk/preview/start.html">Getting Started</a> document for more information
+    about how to set up the preview SDK and get started.</p>
+    <style type="text/css">
+    .non-preview { display:none; }
+    </style>
+    <?cs /if ?>
+  <?cs /if ?> <?cs # end if/else online ?>
+  
+<?cs /if ?> <?cs # end if/else NDK ?>
 
-<?cs if:android.whichdoc != "online" && sdk.preview && !ndk ?>
-  <p>Welcome developers! We are pleased to provide you with a preview SDK for the upcoming <?cs
-var:sdk.preview.version ?> release, to give you a head-start on developing applications for it.
-</p>
+<?cs /if ?> <?cs # end if/else redirect ?>
 
-  <p>See the <a
-href="<?cs var:toroot ?>sdk/preview/features.html">Introduction to
-<?cs var:sdk.preview.version ?></a> document for more information about new features and
-the <a href="<?cs var:toroot ?>sdk/preview/features.html">Getting Started</a> guide for
-information about how to setup the preview SDK.</p>
-<style type="text/css">
-.non-preview { display:none; }
-</style>
-<?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" ?>