Reconcile with ics-mr1-release

Change-Id: Icc486a00d6c067c87364023fcf7226686dc0642a
diff --git a/core/Makefile b/core/Makefile
index a81c981..8d4278d 100644
--- a/core/Makefile
+++ b/core/Makefile
@@ -553,7 +553,7 @@
 # make the target NOTICE files depend on this particular file too, which will
 # then be in the right directory for the find in combine-notice-files to work.
 $(kernel_notice_file): \
-	    prebuilt/$(TARGET_PREBUILT_TAG)/kernel/LINUX_KERNEL_COPYING \
+	    prebuilts/qemu-kernel/arm/LINUX_KERNEL_COPYING \
 	    | $(ACP)
 	@echo Copying: $@
 	$(hide) mkdir -p $(dir $@)
@@ -1298,7 +1298,7 @@
 
 INTERNAL_EMULATOR_PACKAGE_FILES += \
         $(HOST_OUT_EXECUTABLES)/emulator$(HOST_EXECUTABLE_SUFFIX) \
-        prebuilt/android-$(TARGET_ARCH)/kernel/kernel-qemu \
+        prebuilts/qemu-kernel/$(TARGET_ARCH)/kernel-qemu \
         $(INSTALLED_RAMDISK_TARGET) \
 		$(INSTALLED_SYSTEMIMAGE) \
 		$(INSTALLED_USERDATAIMAGE_TARGET)
diff --git a/core/build_id.mk b/core/build_id.mk
index 8ba21a0..e954794 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 := OPENMASTER
 
-export BUILD_ID=IMM30B
+# 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_darwin-x86.mk b/core/combo/HOST_darwin-x86.mk
index 544a29e..54a64a3 100644
--- a/core/combo/HOST_darwin-x86.mk
+++ b/core/combo/HOST_darwin-x86.mk
@@ -53,7 +53,12 @@
 
 HOST_GLOBAL_CFLAGS += \
 	-include $(call select-android-config-h,darwin-x86)
-HOST_RUN_RANLIB_AFTER_COPYING := true
+ifneq ($(filter 10.7.%, $(build_mac_version)),)
+       HOST_RUN_RANLIB_AFTER_COPYING := false
+else
+       HOST_RUN_RANLIB_AFTER_COPYING := true
+       PRE_LION_DYNAMIC_LINKER_OPTIONS := -Wl,-dynamic
+endif
 HOST_GLOBAL_ARFLAGS := cqs
 
 HOST_CUSTOM_LD_COMMAND := true
@@ -78,7 +83,7 @@
 define transform-host-o-to-executable-inner
 $(hide) $(PRIVATE_CXX) \
         -o $@ \
-        -Wl,-dynamic -headerpad_max_install_names \
+        $(PRE_LION_DYNAMIC_LINKER_OPTIONS) -headerpad_max_install_names \
         $(HOST_GLOBAL_LD_DIRS) \
         $(HOST_GLOBAL_LDFLAGS) \
         $(call normalize-host-libraries,$(PRIVATE_ALL_SHARED_LIBRARIES)) \
diff --git a/core/combo/HOST_linux-x86.mk b/core/combo/HOST_linux-x86.mk
index 5ae4972..7df2893 100644
--- a/core/combo/HOST_linux-x86.mk
+++ b/core/combo/HOST_linux-x86.mk
@@ -53,6 +53,6 @@
 	-include $(call select-android-config-h,linux-x86)
 
 # Disable new longjmp in glibc 2.11 and later. See bug 2967937.
-HOST_GLOBAL_CFLAGS += -D_FORTIFY_SOURCE=0
+HOST_GLOBAL_CFLAGS += -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=0
 
 HOST_NO_UNDEFINED_LDFLAGS := -Wl,--no-undefined
diff --git a/core/combo/TARGET_linux-x86.mk b/core/combo/TARGET_linux-x86.mk
index 0fb6edc..3d09276 100644
--- a/core/combo/TARGET_linux-x86.mk
+++ b/core/combo/TARGET_linux-x86.mk
@@ -96,8 +96,25 @@
 			-fno-use-cxa-atexit
 
 ifeq ($(TARGET_ARCH_VARIANT),x86-atom)
-    TARGET_GLOBAL_CFLAGS += -march=atom -mstackrealign -DUSE_SSSE3 -DUSE_SSE2 -mfpmath=sse
+    # Basic ATOM flags.
+    TARGET_GLOBAL_CFLAGS += -march=atom -mstackrealign -mfpmath=sse
+
+    # There are various levels of ATOM processors out there. Different ones have different
+    # capabilities. This first define matches the NDK's minimum ABI requirements.
+    # Note: Not all of the flags set here are actually used in Android. They are provided
+    # to allow for the addition of corresponding optimizations.
+    TARGET_GLOBAL_CFLAGS += -DUSE_MMX -DUSE_SSE -DUSE_SSE2 -DUSE_SSE3
+
+    # If you wish to build a BSP that will only be used on hardware that has additional
+    # available instructions, enable them here. By default, this is commented off so that
+    # the default images can run on all processors that are NDK ABI compliant.
+    # TARGET_GLOBAL_CFLAGS += -DUSE_SSSE3
 else
+    # Plain 'x86' - lowest common denominator. This should run pretty much on any hardware.
+    #
+    # Note: The NDK's ABI (see the NDK ABI documentation) requires many of the more recent
+    # instruction set additions. You can build an "x86" BSP that will run on very old hardware,
+    # but it won't be able to run much of the x86 NDK compliant code.
     TARGET_GLOBAL_CFLAGS += -march=i686
 endif
 
diff --git a/core/definitions.mk b/core/definitions.mk
index 683ae16..3a5249c 100644
--- a/core/definitions.mk
+++ b/core/definitions.mk
@@ -691,7 +691,7 @@
 endef
 
 define get-package-overrides
-$(strip $(sort $(call _get-package-overrides,$(1))))
+$(sort $(strip $(call _get-package-overrides,$(1))))
 endef
 
 ###########################################################
@@ -890,7 +890,7 @@
 	$(PRIVATE_CFLAGS) \
 	$(PRIVATE_CPPFLAGS) \
 	$(PRIVATE_DEBUG_CFLAGS) \
-	-MD -o $@ $<
+	-MD -MF $(patsubst %.o,%.d,$@) -o $@ $<
 $(transform-d-to-p)
 endef
 
@@ -917,7 +917,7 @@
 	$(PRIVATE_CFLAGS) \
 	$(1) \
 	$(PRIVATE_DEBUG_CFLAGS) \
-	-MD -o $@ $<
+	-MD -MF $(patsubst %.o,%.d,$@) -o $@ $<
 endef
 
 define transform-c-to-o-no-deps
@@ -978,7 +978,7 @@
 	$(PRIVATE_CFLAGS) \
 	$(PRIVATE_CPPFLAGS) \
 	$(PRIVATE_DEBUG_CFLAGS) \
-	-MD -o $@ $<
+	-MD -MF $(patsubst %.o,%.d,$@) -o $@ $<
 $(transform-d-to-p)
 endef
 
@@ -1004,7 +1004,7 @@
 	$(PRIVATE_CFLAGS) \
 	$(1) \
 	$(PRIVATE_DEBUG_CFLAGS) \
-	-MD -o $@ $<
+	-MD -MF $(patsubst %.o,%.d,$@) -o $@ $<
 endef
 
 define transform-host-c-to-o-no-deps
@@ -1292,13 +1292,6 @@
 ifneq ($(HOST_CUSTOM_LD_COMMAND),true)
 define transform-host-o-to-executable-inner
 $(hide) $(PRIVATE_CXX) \
-	-Wl,-rpath-link=$(HOST_OUT_INTERMEDIATE_LIBRARIES) \
-	-Wl,-rpath,\$$ORIGIN/../lib \
-	$(HOST_GLOBAL_LD_DIRS) \
-	$(PRIVATE_LDFLAGS) \
-	$(if $(PRIVATE_NO_DEFAULT_COMPILER_FLAGS),, \
-		$(HOST_GLOBAL_LDFLAGS) \
-	) \
 	$(PRIVATE_ALL_OBJECTS) \
 	-Wl,--whole-archive \
 	$(call normalize-host-libraries,$(PRIVATE_ALL_WHOLE_STATIC_LIBRARIES)) \
@@ -1307,6 +1300,13 @@
 	$(call normalize-host-libraries,$(PRIVATE_ALL_STATIC_LIBRARIES)) \
 	$(if $(PRIVATE_GROUP_STATIC_LIBRARIES),-Wl$(comma)--end-group) \
 	$(call normalize-host-libraries,$(PRIVATE_ALL_SHARED_LIBRARIES)) \
+	-Wl,-rpath-link=$(HOST_OUT_INTERMEDIATE_LIBRARIES) \
+	-Wl,-rpath,\$$ORIGIN/../lib \
+	$(HOST_GLOBAL_LD_DIRS) \
+	$(PRIVATE_LDFLAGS) \
+	$(if $(PRIVATE_NO_DEFAULT_COMPILER_FLAGS),, \
+		$(HOST_GLOBAL_LDFLAGS) \
+	) \
 	-o $@ \
 	$(PRIVATE_LDLIBS)
 endef
diff --git a/core/dumpvar.mk b/core/dumpvar.mk
index e0de464..22c8daa 100644
--- a/core/dumpvar.mk
+++ b/core/dumpvar.mk
@@ -3,7 +3,11 @@
 # what to add to the path given the config we have chosen.
 ifeq ($(CALLED_FROM_SETUP),true)
 
+ifneq ($(filter /%,$(HOST_OUT_EXECUTABLES)),)
+ABP:=$(HOST_OUT_EXECUTABLES)
+else
 ABP:=$(PWD)/$(HOST_OUT_EXECUTABLES)
+endif
 
 # Add the toolchain bin dir if it actually exists
 ifneq ($(wildcard $(PWD)/prebuilt/$(HOST_PREBUILT_TAG)/toolchain/arm-linux-androideabi-4.4.x/bin),)
@@ -38,7 +42,11 @@
   absolute_dumpvar := $(strip $(filter abs-%,$(dumpvar_goals)))
   ifdef absolute_dumpvar
     dumpvar_goals := $(patsubst abs-%,%,$(dumpvar_goals))
-    DUMPVAR_VALUE := $(PWD)/$($(dumpvar_goals))
+    ifneq ($(filter /%,$($(dumpvar_goals))),)
+      DUMPVAR_VALUE := $($(dumpvar_goals))
+    else
+      DUMPVAR_VALUE := $(PWD)/$($(dumpvar_goals))
+    endif
     dumpvar_target := dumpvar-abs-$(dumpvar_goals)
   else
     DUMPVAR_VALUE := $($(dumpvar_goals))
@@ -72,5 +80,6 @@
 $(info   HOST_OS=$(HOST_OS))
 $(info   HOST_BUILD_TYPE=$(HOST_BUILD_TYPE))
 $(info   BUILD_ID=$(BUILD_ID))
+$(info   OUT_DIR=$(OUT_DIR))
 $(info ============================================)
 endif
diff --git a/core/envsetup.mk b/core/envsetup.mk
index c3ae3b0..e8c924e 100644
--- a/core/envsetup.mk
+++ b/core/envsetup.mk
@@ -133,7 +133,11 @@
 # figure out the output directories
 
 ifeq (,$(strip $(OUT_DIR)))
+ifeq (,$(strip $(OUT_DIR_COMMON_BASE)))
 OUT_DIR := $(TOPDIR)out
+else
+OUT_DIR := $(OUT_DIR_COMMON_BASE)/$(notdir $(PWD))
+endif
 endif
 
 DEBUG_OUT_DIR := $(OUT_DIR)/debug
diff --git a/core/find-jdk-tools-jar.sh b/core/find-jdk-tools-jar.sh
index e1278c3..f150a9a 100755
--- a/core/find-jdk-tools-jar.sh
+++ b/core/find-jdk-tools-jar.sh
@@ -1,3 +1,4 @@
+#!/bin/sh
 if [ "x$ANDROID_JAVA_HOME" != x ] && [ -e "$ANDROID_JAVA_HOME/lib/tools.jar" ] ; then
     echo $ANDROID_JAVA_HOME/lib/tools.jar
 else
diff --git a/core/main.mk b/core/main.mk
index 569d4dc..348ee3b 100644
--- a/core/main.mk
+++ b/core/main.mk
@@ -39,13 +39,15 @@
 
 # check for broken versions of make
 ifeq (0,$(shell expr $$(echo $(MAKE_VERSION) | sed "s/[^0-9\.].*//") = 3.81))
+ifeq (0,$(shell expr $$(echo $(MAKE_VERSION) | sed "s/[^0-9\.].*//") = 3.82))
 $(warning ********************************************************************************)
 $(warning *  You are using version $(MAKE_VERSION) of make.)
-$(warning *  Android can only be built by version 3.81.)
+$(warning *  Android can only be built by versions 3.81 and 3.82.)
 $(warning *  see http://source.android.com/source/download.html)
 $(warning ********************************************************************************)
 $(error stopping)
 endif
+endif
 
 TOP := .
 TOPDIR :=
@@ -271,11 +273,13 @@
 
 ifeq ($(TARGET_BUILD_VARIANT),eng)
 tags_to_install := user debug eng
+ifneq ($(filter ro.setupwizard.mode=ENABLED, $(call collapse-pairs, $(ADDITIONAL_BUILD_PROPERTIES))),)
   # Don't require the setup wizard on eng builds
   ADDITIONAL_BUILD_PROPERTIES := $(filter-out ro.setupwizard.mode=%,\
           $(call collapse-pairs, $(ADDITIONAL_BUILD_PROPERTIES))) \
           ro.setupwizard.mode=OPTIONAL
 endif
+endif
 
 ## tests ##
 
@@ -441,7 +445,6 @@
 	sdk/ide_common \
 	sdk/jarutils \
 	sdk/layoutlib_api \
-	sdk/layoutopt \
 	sdk/ninepatch \
 	sdk/rule_api \
 	sdk/lint \
diff --git a/core/user_tags.mk b/core/user_tags.mk
index 2e7017e..b88e541 100644
--- a/core/user_tags.mk
+++ b/core/user_tags.mk
@@ -171,7 +171,6 @@
 	layoutlib_api \
 	layoutlib_create \
 	layoutlib_utils \
-	layoutopt \
 	liba2dp \
 	libabi \
 	libandroid \
@@ -494,7 +493,6 @@
 	traceview \
 	tune2fs \
 	tune2fs_host \
-	uix \
 	usbtest \
 	vdc \
 	vm-tests \
diff --git a/core/version_defaults.mk b/core/version_defaults.mk
index bff8ef9..bc6f47a 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.4
+  PLATFORM_VERSION := 4.0.3.0.2.0.1.0
 endif
 
 ifeq "" "$(PLATFORM_SDK_VERSION)"
@@ -59,7 +59,7 @@
 ifeq "" "$(PLATFORM_VERSION_CODENAME)"
   # This is the current development code-name, if the build is not a final
   # release build.  If this is a final release build, it is simply "REL".
-  PLATFORM_VERSION_CODENAME := REL
+  PLATFORM_VERSION_CODENAME := AOSP
 endif
 
 ifeq "" "$(DEFAULT_APP_TARGET_SDK)"
diff --git a/target/board/vbox_x86/device.mk b/target/board/vbox_x86/device.mk
index 66a6e84..07ebb1c 100644
--- a/target/board/vbox_x86/device.mk
+++ b/target/board/vbox_x86/device.mk
@@ -24,7 +24,7 @@
     ro.ril.gprsclass=10 \
     ro.adb.qemud=1
 
-LOCAL_KERNEL := prebuilt/android-x86/kernel/kernel-vbox
+LOCAL_KERNEL := prebuilts/qemu-kernel/x86/kernel-vbox
 
 PRODUCT_COPY_FILES := \
     development/data/etc/apns-conf.xml:system/etc/apns-conf.xml \
diff --git a/target/product/generic_no_telephony.mk b/target/product/generic_no_telephony.mk
index 0d87fc3..dbdc500 100644
--- a/target/product/generic_no_telephony.mk
+++ b/target/product/generic_no_telephony.mk
@@ -21,7 +21,6 @@
 
 PRODUCT_PACKAGES := \
     DeskClock \
-    AlarmProvider \
     Bluetooth \
     Calculator \
     Calendar \
diff --git a/target/product/large_emu_hw.mk b/target/product/large_emu_hw.mk
index 15b1bed..847e10a 100644
--- a/target/product/large_emu_hw.mk
+++ b/target/product/large_emu_hw.mk
@@ -22,7 +22,6 @@
 PRODUCT_PACKAGES := \
     CarHome \
     DeskClock \
-    AlarmProvider \
     Bluetooth \
     Calculator \
     Calendar \
diff --git a/target/product/locales_full.mk b/target/product/locales_full.mk
index 1031303..8b8ab05 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 am_ET hi_IN
+PRODUCT_LOCALES := en_US cs_CZ da_DK de_AT de_CH de_DE de_LI el_GR en_AU en_CA en_GB en_NZ en_SG 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 ceb1898..d2f4c09 100644
--- a/target/product/sdk.mk
+++ b/target/product/sdk.mk
@@ -77,7 +77,6 @@
 	ddms \
 	hierarchyviewer \
 	draw9patch \
-	layoutopt \
 	traceview \
 	android \
 	dexdump \
@@ -95,8 +94,6 @@
 	ddmuilib \
 	draw9patch \
 	hierarchyviewer \
-	layoutopt \
-	uix \
 	traceview \
 	anttasks \
 	sdklib \
diff --git a/tools/droiddoc/templates-sdk/assets/android-developer-docs.css b/tools/droiddoc/templates-sdk/assets/android-developer-docs.css
index 8e9e5bb..6cc4a97 100644
--- a/tools/droiddoc/templates-sdk/assets/android-developer-docs.css
+++ b/tools/droiddoc/templates-sdk/assets/android-developer-docs.css
@@ -72,7 +72,9 @@
   zoom:1;
 }
 
+#side-nav li span.heading,
 #side-nav li h2 {
+  display:block;
   font-size:12px;
   font-weight: bold;
   margin:.5em 0 0 0;
diff --git a/tools/droiddoc/templates-sdk/customizations.cs b/tools/droiddoc/templates-sdk/customizations.cs
index cfeab16..1285016 100644
--- a/tools/droiddoc/templates-sdk/customizations.cs
+++ b/tools/droiddoc/templates-sdk/customizations.cs
@@ -1,7 +1,7 @@
 <?cs 
 def:sdk_nav() ?>
   <div class="g-section g-tpl-240" id="body-content">
-    <div class="g-unit g-first" id="side-nav">
+    <div class="g-unit g-first" id="side-nav" itemscope itemtype="http://schema.org/SiteNavigationElement">
       <div id="devdoc-nav"><?cs 
         include:"../../../../frameworks/base/docs/html/sdk/sdk_toc.cs" ?>
       </div>
@@ -10,7 +10,7 @@
 <?cs 
 def:resources_tab_nav() ?>
   <div class="g-section g-tpl-200" id="body-content">
-    <div class="g-unit g-first" id="side-nav">
+    <div class="g-unit g-first" id="side-nav" itemscope itemtype="http://schema.org/SiteNavigationElement">
       <div id="devdoc-nav"><?cs 
         include:"../../../../frameworks/base/docs/html/resources/resources_toc.cs" ?>
       </div>
@@ -24,7 +24,7 @@
 <?cs 
 def:guide_nav() ?>
   <div class="g-section g-tpl-240" id="body-content">
-    <div class="g-unit g-first" id="side-nav">
+    <div class="g-unit g-first" id="side-nav" itemscope itemtype="http://schema.org/SiteNavigationElement">
       <div id="devdoc-nav"><?cs 
         include:"../../../../frameworks/base/docs/html/guide/guide_toc.cs" ?>
       </div>
@@ -39,7 +39,7 @@
 <?cs # The default side navigation for the reference docs ?><?cs 
 def:default_left_nav() ?>
   <div class="g-section g-tpl-240" id="body-content">
-    <div class="g-unit g-first" id="side-nav">
+    <div class="g-unit g-first" id="side-nav" itemscope itemtype="http://schema.org/SiteNavigationElement">
       <div id="swapper">
         <div id="nav-panels">
           <div id="resize-packages-nav">
@@ -138,9 +138,11 @@
 <?cs 
 def:custom_footerlinks() ?>
   <p>
-    <a href="http://www.android.com/terms.html">Site Terms of Service</a> -
-    <a href="http://www.android.com/privacy.html">Privacy Policy</a> -
-    <a href="http://www.android.com/branding.html">Brand Guidelines</a>
+    <a href="http://www.google.com/intl/en/policies/" target="_blank">Privacy &amp; Terms</a> -
+    <a href="http://www.android.com/branding.html" target="_blank">Brand Guidelines</a> -
+    <a
+href="http://code.google.com/p/android/issues/entry?template=Developer%20Documentation"
+target="_blank">Report Document Issues</a>
   </p><?cs 
 /def ?>
 
diff --git a/tools/droiddoc/templates-sdk/docpage.cs b/tools/droiddoc/templates-sdk/docpage.cs
index 3c11865..c9ced96 100644
--- a/tools/droiddoc/templates-sdk/docpage.cs
+++ b/tools/droiddoc/templates-sdk/docpage.cs
@@ -2,19 +2,19 @@
 <?cs include:"macros.cs" ?>
 <html>
 <?cs include:"head_tag.cs" ?>
-<body class="gc-documentation">
+<body class="gc-documentation" itemscope itemtype="http://schema.org/Article">
 <?cs include:"header.cs" ?>
 
 <div class="g-unit" id="doc-content"><a name="top"></a>
 
 <div id="jd-header" class="guide-header">
-  <span class="crumb">
+  <span class="crumb" itemprop="breadcrumb">
     <?cs if:parent.link ?>
       <a href="<?cs var:parent.link ?>"><?cs var:parent.title ?></a>:
     <?cs else ?>&nbsp;
     <?cs /if ?>
   </span>
-<h1><?cs var:page.title ?></h1>
+<h1 itemprop="name"><?cs var:page.title ?></h1>
 </div>
 
   <?cs # THIS IS THE MAIN DOC CONTENT ?>
@@ -61,7 +61,7 @@
     <?cs /if ?><?cs # end if trainingnavtop ?>
 
 
-    <div class="jd-descr">
+    <div class="jd-descr" itemprop="articleBody">
     <?cs call:tag_list(root.descr) ?>
     </div>
 
diff --git a/tools/droiddoc/templates-sdk/head_tag.cs b/tools/droiddoc/templates-sdk/head_tag.cs
index fd8aad6..0ecda7b 100644
--- a/tools/droiddoc/templates-sdk/head_tag.cs
+++ b/tools/droiddoc/templates-sdk/head_tag.cs
@@ -1,5 +1,8 @@
 <head>
 <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<?cs if:page.metaDescription ?>
+<meta name="Description" content="<?cs var:page.metaDescription ?>">
+<?cs /if ?>
 <link rel="shortcut icon" type="image/x-icon" href="<?cs var:toroot ?>favicon.ico" />
 <title><?cs 
   if:page.title ?><?cs 
diff --git a/tools/droiddoc/templates-sdk/sdkpage.cs b/tools/droiddoc/templates-sdk/sdkpage.cs
index 331411f..f6c7cfa 100644
--- a/tools/droiddoc/templates-sdk/sdkpage.cs
+++ b/tools/droiddoc/templates-sdk/sdkpage.cs
@@ -12,7 +12,7 @@
 <?cs else ?>
   <?cs include:"head_tag.cs" ?>
 <?cs /if ?>
-<body class="gc-documentation">
+<body class="gc-documentation" itemscope itemtype="http://schema.org/CreativeWork">
 <a name="top"></a>
 <?cs call:custom_masthead() ?>
 
@@ -42,10 +42,11 @@
 <div class="g-unit" id="doc-content" >
   <div id="jd-header" class="guide-header" >
     <span class="crumb">&nbsp;</span>
-    <h1><?cs if:android.whichdoc == "online" ?>Download the <?cs /if ?><?cs var:page.title ?></h1>
+    <h1 itemprop="name"><?cs if:android.whichdoc == "online" ?>Download the <?cs /if ?><?cs
+var:page.title ?></h1>
   </div>
 
-  <div id="jd-content">
+  <div id="jd-content" itemprop="description">
 
 <?cs if:sdk.not_latest_version ?>
   <div class="special">