Merge "Suppress clang-tidy checks in frameworks/compile/mclinker." am: a9ee94f441
am: 5c2ca39c58

Change-Id: I99de763757298270f6ce4cc124cc6ead840ace02
diff --git a/core/version_defaults.mk b/core/version_defaults.mk
index 5dffcac..31decf1 100644
--- a/core/version_defaults.mk
+++ b/core/version_defaults.mk
@@ -113,7 +113,7 @@
   # Must be of the form "YYYY-MM-DD" on production devices.
   #
   # If there is no $PLATFORM_SECURITY_PATCH set, keep it empty.
-  PLATFORM_SECURITY_PATCH := 2016-08-05
+  PLATFORM_SECURITY_PATCH := 2016-10-05
 endif
 
 ifeq "" "$(PLATFORM_BASE_OS)"
diff --git a/tools/droiddoc/templates-sdk-dev/components/masthead.cs b/tools/droiddoc/templates-sdk-dev/components/masthead.cs
index b105b52..c1e2706 100644
--- a/tools/droiddoc/templates-sdk-dev/components/masthead.cs
+++ b/tools/droiddoc/templates-sdk-dev/components/masthead.cs
@@ -88,12 +88,12 @@
           <span class="dac-sprite dac-google-play"></span>
           <span class="dac-visible-desktop-inline">Developer</span>
           Console
-        </a><?cs /if ?>
+        </a><?cs /if ?><?cs
 
-        <?cs # ADD SEARCH AND MENU ?>
-        <?cs if:!ndk ?>
-        <?cs call:header_search_widget() ?>
-        <?cs /if ?>
+        # ADD SEARCH AND MENU ?><?cs
+        if:!ndk ?><?cs
+        call:header_search_widget() ?><?cs
+        /if ?>
       </div><!-- end header-wrap.wrap -->
     </div><!-- end header -->
   </div> <!--end header-wrapper -->
@@ -155,7 +155,7 @@
           <i class="dac-sprite dac-expand-more-black dac-nav-sub-slider"></i>
           <ul class="dac-nav-secondary about">
             <li class="dac-nav-item versions">
-              <a class="dac-nav-link" href="<?cs var:toroot ?>about/versions/marshmallow/index.html">Android</a>
+              <a class="dac-nav-link" href="<?cs var:toroot ?>about/versions/nougat/index.html">Android</a>
             </li>
             <li class="dac-nav-item wear">
               <a class="dac-nav-link" href="<?cs var:toroot ?>wear/index.html">Wear</a>
@@ -261,9 +261,9 @@
             </li>
           </ul>
         </li>
-        <li class="dac-nav-item preview">
+        <!--<li class="dac-nav-item preview">
           <a class="dac-nav-link" href="<?cs var:toroot ?>preview/index.html">Preview</a>
-        </li>
+        </li>-->
         </ul>
       </div>
     </div>
@@ -275,12 +275,11 @@
 <script>$('[data-dac-nav]').dacNav();</script>
 
 <?cs
-/def ?><?cs # end custom_masthead() ?>
+/def ?><?cs # end custom_masthead() ?><?cs
 
+def:toast() ?><?cs
 
-<?cs def:toast() ?>
-
-  <?cs # (UN)COMMENT TO TOGGLE VISIBILITY
+# (UN)COMMENT TO TOGGLE VISIBILITY
 
   <div class="dac-toast-group">
     <div class="dac-toast" data-toast>
@@ -290,6 +289,5 @@
     </div>
   </div>
 
-?>
-
-<?cs /def ?>
+?><?cs
+/def ?>
\ No newline at end of file
diff --git a/tools/droiddoc/templates-sdk-dev/customizations.cs b/tools/droiddoc/templates-sdk-dev/customizations.cs
index 44ae239..a747d3f 100644
--- a/tools/droiddoc/templates-sdk-dev/customizations.cs
+++ b/tools/droiddoc/templates-sdk-dev/customizations.cs
@@ -1,14 +1,14 @@
 <?cs def:body_content_wrap_start() ?>
   <div class="wrap clearfix" id="body-content">
-<?cs /def ?>
+<?cs /def ?><?cs
 
-<?cs def:fullpage() ?>
+def:fullpage() ?>
   <div id="body-content">
     <div>
-<?cs /def ?>
+<?cs /def ?><?cs
 
-<?cs # The default side navigation for the reference docs ?>
-<?cs def:reference_default_nav() ?>
+# The default side navigation for the reference docs ?><?cs
+def:reference_default_nav() ?>
   <!-- Fullscreen toggler -->
   <button data-fullscreen class="dac-nav-fullscreen">
     <i class="dac-sprite dac-fullscreen"></i>
@@ -73,9 +73,8 @@
       </div>
     </div>
   <?cs /if ?>
-<?cs /def ?>
+<?cs /def ?><?cs
 
-<?cs
 def:ndk_nav() ?>
   <div class="wrap clearfix" id="body-content"><div class="cols">
     <div class="col-3 dac-toggle dac-mobile" id="side-nav" itemscope itemtype="http://schema.org/SiteNavigationElement">
@@ -91,9 +90,9 @@
         </div>
       </div>
     </div> <!-- end side-nav -->
-<?cs /def ?>
+<?cs /def ?><?cs
 
-<?cs def:header_search_widget() ?>
+def:header_search_widget() ?>
   <form data-search class="dac-header-search">
     <button class="dac-header-search-close" data-search-close>
       <i class="dac-sprite dac-back-arrow"></i>
@@ -107,9 +106,9 @@
       </button>
     </div>
   </form>
-<?cs /def ?>
+<?cs /def ?><?cs
 
-<?cs def:search_results() ?>
+def:search_results() ?>
   <div id="search-results" class="dac-search-results">
     <div id="dac-search-results-history" class="dac-search-results-history">
       <div class="wrap dac-search-results-history-wrap">
@@ -148,9 +147,9 @@
 
     </div>
   </div>
-<?cs /def ?>
+<?cs /def ?><?cs
 
-<?cs def:custom_left_nav() ?>
+def:custom_left_nav() ?>
   <?cs if:(!fullpage && !nonavpage) || forcelocalnav ?>
     <a class="dac-nav-back-button dac-swap-section dac-up dac-no-anim" data-swap-button href="javascript:;">
       <i class="dac-sprite dac-nav-back"></i> <span class="dac-nav-back-title">Back</span>
@@ -209,37 +208,37 @@
       <?cs /if ?>
     </div>
   <?cs /if ?>
-<?cs /def ?>
+<?cs /def ?><?cs
 
-<?cs # appears at the bottom of every page ?>
-<?cs def:custom_cc_copyright() ?>
+# appears at the bottom of every page ?><?cs
+def:custom_cc_copyright() ?>
   Except as noted, this content is
   licensed under <a href="http://creativecommons.org/licenses/by/2.5/">
   Creative Commons Attribution 2.5</a>. For details and
   restrictions, see the <a href="<?cs var:toroot ?>license.html">Content
   License</a>.
-<?cs /def ?>
+<?cs /def ?><?cs
 
-<?cs def:custom_copyright() ?>
+def:custom_copyright() ?>
   Except as noted, this content is licensed under <a
   href="http://www.apache.org/licenses/LICENSE-2.0">Apache 2.0</a>.
   For details and restrictions, see the <a href="<?cs var:toroot ?>license.html">
   Content License</a>.
-<?cs /def ?>
+<?cs /def ?><?cs
 
-<?cs def:custom_footerlinks() ?>
+def:custom_footerlinks() ?>
   <a href="<?cs var:toroot ?>about/android.html">About Android</a>
   <a href="<?cs var:toroot ?>auto/index.html">Auto</a>
   <a href="<?cs var:toroot ?>tv/index.html">TV</a>
   <a href="<?cs var:toroot ?>wear/index.html">Wear</a>
   <a href="<?cs var:toroot ?>legal.html">Legal</a>
-<?cs /def ?>
+<?cs /def ?><?cs
 
-<?cs # appears on the right side of the blue bar at the bottom off every page ?>
-<?cs def:custom_buildinfo() ?>
+# appears on the right side of the blue bar at the bottom off every page ?><?cs
+def:custom_buildinfo() ?>
   <?cs if:!google && !reference.gcm && !reference.gms ?>
     Android <?cs var:sdk.version ?>&nbsp;r<?cs var:sdk.rel.id ?> &mdash;
   <?cs /if ?>
   <script src="<?cs var:toroot ?>timestamp.js" type="text/javascript"></script>
   <script>document.write(BUILD_TIMESTAMP)</script>
-<?cs /def ?>
+<?cs /def ?>
\ No newline at end of file
diff --git a/tools/droiddoc/templates-sdk-dev/docpage.cs b/tools/droiddoc/templates-sdk-dev/docpage.cs
index 0f1d4e0..e8a5ba3 100644
--- a/tools/droiddoc/templates-sdk-dev/docpage.cs
+++ b/tools/droiddoc/templates-sdk-dev/docpage.cs
@@ -1,10 +1,10 @@
-<?cs include:"doctype.cs" ?>
-<?cs include:"macros.cs" ?>
-<html<?cs if:devsite ?> devsite<?cs /if ?>>
+<?cs if:!devsite ?><?cs
+  include:"doctype.cs" ?><?cs /if ?><?cs
+  include:"macros.cs" ?><html<?cs if:devsite ?> devsite<?cs /if ?>>
 <?cs include:"head_tag.cs" ?>
-<body class="gc-documentation
-
-<?cs # add document classes for navigation header selection (and other stuff) ?>
+<body<?cs
+if:!devsite ?> class="gc-documentation<?cs
+# add document classes for navigation header selection (and other stuff) ?>
 <?cs
   if:(google || reference.gms || reference.gcm) ?>google <?cs /if ?><?cs
   if:ndk ?>ndk<?cs
@@ -39,14 +39,15 @@
     elif:(preview) ?> preview<?cs
     /if ?><?cs
     if:page.trainingcourse ?> trainingcourse<?cs /if ?><?cs
-/if ?>" itemscope itemtype="http://schema.org/Article"><?cs
-include:"header.cs" ?>
+  /if ?>" itemscope itemtype="http://schema.org/Article"><?cs
+/if ?>><?cs
+include:"header.cs" ?><?cs
 
-<?cs if:(design||training||walkthru) && !page.trainingcourse && !page.article ?><?cs
-# header logic for docs that provide previous/next buttons ?>
-  <?cs if:(header.hide||devsite) ?>
-  <?cs else ?>
-  <div class="content-header <?cs if:header.justLinks ?>just-links<?cs /if ?>">
+if:(design||training||walkthru) && !page.trainingcourse && !page.article ?><?cs
+# header logic for docs that provide previous/next buttons ?><?cs
+  if:(header.hide||devsite) ?><?cs
+  else ?>
+    <div class="content-header <?cs if:header.justLinks ?>just-links<?cs /if ?>">
       <?cs if:header.justLinks ?>&nbsp;
       <?cs else ?>
         <ul class="dac-header-crumbs">
@@ -57,9 +58,9 @@
         <script>$('.dac-nav-list').dacCurrentPage().dacCrumbs();</script>
 
         <h1 itemprop="name"><?cs var:page.title ?>
-      </h1>
-      <?cs /if ?>
-    <?cs if:training ?>
+      </h1><?cs
+      /if ?><?cs
+      if:training ?>
       <div class="training-nav-top" itemscope itemtype="http://schema.org/SiteNavigationElement">
         <a href="#" class="prev-page-link hide"
             zh-tw-lang="上一堂課"
@@ -85,8 +86,8 @@
             ja-lang="開始する"
             es-lang="Empezar"
             >Get started</a>
-      </div>
-    <?cs elif:!page.trainingcourse ?>
+      </div><?cs
+      elif:!page.trainingcourse ?>
       <?cs # <div class="paging-linkss" itemscope itemtype="http://schema.org/SiteNavigationElement">
         <a href="#" class="prev-page-link hide"
             zh-tw-lang="上一堂課"
@@ -104,12 +105,12 @@
             ja-lang="次へ"
             es-lang="Siguiente"
             >Next</a>
-      </div> ?>
-    <?cs /if ?><?cs # end if training ?>
+      </div> ?><?cs
+      /if ?><?cs # end if training ?>
   </div>
-  <?cs /if ?><?cs # end if header.hide ?>
+  <?cs /if ?><?cs # end if header.hide ?><?cs
 
-<?cs elif:samplesProjectIndex ?>
+elif:samplesProjectIndex ?>
   <div id="api-info-block">
   <div class="sum-details-links">
   Overview
@@ -119,9 +120,9 @@
   </div><!-- end breadcurmb block -->
   <h1 itemprop="name"><?cs var:projectDir ?></h1>
 
-<?cs else ?>
-  <?cs if:(!fullpage && !header.hide && !devsite) ?>
-    <?cs if:page.landing ?><?cs # header logic for docs that are landing pages ?>
+<?cs else ?><?cs
+  if:(!fullpage && !header.hide && !devsite) ?><?cs
+    if:page.landing ?><?cs # header logic for docs that are landing pages ?>
       <div class="landing-banner">
         <?cs if:page.landing.image ?><?cs # use two-column layout only if there is an image ?>
         <div class="cols">
@@ -139,8 +140,8 @@
         </div>
         <?cs /if ?>
       </div>
-    <?cs else ?>
-      <?cs if:tab1 ?><div id="title-tabs-wrapper"><?cs /if ?>
+    <?cs else ?><?cs
+      if:tab1 ?><div id="title-tabs-wrapper"><?cs /if ?>
         <ul class="dac-header-crumbs">
           <?cs # More <li> elements added here with javascript ?>
         </ul>
@@ -157,30 +158,32 @@
               <li><a href="<?cs var:tab3.link ?>"><?cs var:tab3 ?></a></li><?cs /if ?>
             </ul>
           <?cs /if ?>
-      <?cs if:tab1 ?></div><!-- end tab-wrapper --><?cs /if ?>
-    <?cs /if ?>
-  <?cs /if ?>
-<?cs /if ?><?cs # end if design ?>
+      <?cs if:tab1 ?></div><!-- end tab-wrapper --><?cs /if ?><?cs
+    /if ?><?cs
+  /if ?><?cs
+/if ?><?cs # end if design ?><?cs
 
-  <?cs if devsite ?>
-    <?cs if:tab1 ?>
-    <div id="title-tabs-wrapper">
-      <ul id="title-tabs">
-        <li class="selected"><a href="<?cs var:tab1.link ?>"><?cs var:tab1 ?></a></li>
-        <?cs if:tab2 ?>
-        <li><a href="<?cs var:tab2.link ?>"><?cs var:tab2 ?></a></li><?cs /if ?>
-        <?cs if:tab3 ?>
-        <li><a href="<?cs var:tab3.link ?>"><?cs var:tab3 ?></a></li><?cs /if ?>
-      </ul>
-    </div><!-- end tab-wrapper -->
-    <?cs /if ?>
-  <?cs /if ?>
+if devsite ?><?cs
+  if:tab1 ?>
+  <div id="title-tabs-wrapper">
+    <ul id="title-tabs">
+      <li class="selected"><a href="<?cs var:tab1.link ?>"><?cs var:tab1 ?></a></li>
+      <?cs if:tab2 ?>
+      <li><a href="<?cs var:tab2.link ?>"><?cs var:tab2 ?></a></li><?cs /if ?>
+      <?cs if:tab3 ?>
+      <li><a href="<?cs var:tab3.link ?>"><?cs var:tab3 ?></a></li><?cs /if ?>
+    </ul>
+  </div><!-- end tab-wrapper --><?cs
+  /if ?><?cs
+/if ?><?cs
 
-  <?cs # THIS IS THE MAIN DOC CONTENT ?>
+# THIS IS THE MAIN DOC CONTENT ?><?cs
+  if:!devsite ?>
   <div id="jd-content">
-    <div class="jd-descr" itemprop="articleBody">
-    <?cs if:(!fullpage && !header.hide && devsite) ?>
-      <?cs if:page.landing ?><?cs # header logic for docs that are landing pages ?>
+    <div class="jd-descr" itemprop="articleBody"><?cs
+  /if ?><?cs
+  if:(!fullpage && !header.hide && devsite) ?><?cs
+    if:page.landing ?><?cs # header logic for docs that are landing pages ?>
         <div class="landing-banner">
           <?cs if:page.landing.image ?><?cs # use two-column layout only if there is an image ?>
           <div class="cols">
@@ -192,19 +195,22 @@
             <h1 itemprop="name" style="margin-bottom:0;"><?cs var:page.title ?></h1>
             <p itemprop="description"><?cs var:page.landing.intro ?></p>
 
-            <p><a class="next-page-link topic-start-link"></a></p>
-          <?cs if:page.landing.image ?>
+            <p><a class="next-page-link topic-start-link"></a></p><?cs
+            if:page.landing.image ?>
             </div>
-          </div>
-          <?cs /if ?>
-        </div>
-      <?cs /if ?>
-    <?cs /if ?>
+          </div><?cs
+          /if ?>
+        </div><?cs
+    /if ?><?cs
+  /if ?>
 
-    <?cs call:tag_list(root.descr) ?>
-    </div>
+<?cs call:tag_list(root.descr) ?><?cs
 
-    <?cs if:!fullscreen && (design||training||walkthru) && !page.landing && !page.trainingcourse
+if:!devsite ?>
+    </div><!-- end jd-descr --><?cs
+/if ?><?cs
+
+if:!fullscreen && (design||training||walkthru) && !page.landing && !page.trainingcourse
       && !footer.hide && !devsite?>
       <div class="content-footer <?cs
                     if:fullpage ?>wrap<?cs /if ?>"
@@ -240,14 +246,16 @@
               <span class="page-link-caption">Next class</span>
             </a>
           </div>
-      </div>
-    <?cs /if ?>
+      </div><?cs
+    /if ?><?cs
+if:!devsite ?>
+  </div> <!-- end jd-content --><?cs
+/if ?><?cs
 
-  </div> <!-- end jd-content -->
-
-<?cs if:!devsite ?>
+if:!devsite ?>
 <?cs include:"footer.cs" ?>
 <?cs include:"trailer.cs" ?>
 <?cs /if ?>
+
 </body>
 </html>
diff --git a/tools/droiddoc/templates-sdk-dev/head_tag.cs b/tools/droiddoc/templates-sdk-dev/head_tag.cs
index 52ad968..64e8e7e 100644
--- a/tools/droiddoc/templates-sdk-dev/head_tag.cs
+++ b/tools/droiddoc/templates-sdk-dev/head_tag.cs
@@ -1,12 +1,22 @@
 <head>
-<?cs
-  ####### If building devsite, add some meta data needed for when generating the top nav ######### ?>
-  <?cs
-    if:devsite ?>
-    <meta name="top_category" value="<?cs
+  <title><?cs
+if:devsite ?><?cs
+  if:page.title ?><?cs
+    var:html_strip(page.title) ?><?cs
+  else ?>Android Developers<?cs
+  /if ?><?cs
+else ?><?cs
+  if:page.title ?><?cs
+    var:page.title ?> | <?cs
+  /if ?>Android Developers
+<?cs /if ?><?cs
+# END if/else devsite ?></title><?cs
+  ####### If building devsite, add some meta data needed for when generating the top nav ######### ?><?cs
+if:devsite ?>
+  <meta name="top_category" value="<?cs
       if:ndk ?>ndk<?cs
       elif:(guide||develop||training||reference||tools||sdk||google||reference.gms||reference.gcm||samples) ?>develop<?cs
-      elif:(topic||libraries||instantapps) ?>develop<?cs
+      elif:(topic||libraries||instantapps||perf||arc) ?>develop<?cs
       elif:(distribute||googleplay||essentials||users||engage||monetize||disttools||stories||analyze) ?>distribute<?cs
       elif:(design||vision||material||patterns||devices||designdownloads) ?>design<?cs
       elif:(about||versions||wear||tv||auto) ?>about<?cs
@@ -14,9 +24,8 @@
       elif:work ?>about<?cs
       elif:preview ?>preview<?cs
       else ?>none<?cs
-      /if ?>" />
-    <?cs set:dac_subcategory_set = #1 ?>
-    <meta name="subcategory" value="<?cs
+      /if ?>" /><?cs set:dac_subcategory_set = #1 ?>
+  <meta name="subcategory" value="<?cs
       if:ndk ?><?cs
         if:guide ?>guide<?cs
         elif:samples ?>samples<?cs
@@ -35,9 +44,11 @@
             if:(samplesDocPage&&!samplesProjectIndex) ?> samples-docpage<?cs /if ?><?cs
           else ?>none<?cs set:dac_subcategory_set = #0 ?><?cs /if ?><?cs
         elif:(google||reference.gms||reference.gcm) ?>google<?cs
-        elif:(topic||libraries) ?><?cs
+        elif:(topic||libraries||perf||arc) ?><?cs
           if:libraries ?>libraries<?cs
           elif:instantapps ?>instantapps<?cs
+          elif:perf ?>perf<?cs
+          elif:arc ?>arc<?cs
           else ?>none<?cs set:dac_subcategory_set = #0 ?><?cs /if ?><?cs
         elif:(distribute||googleplay||essentials||users||engage||monetize||disttools||stories||analyze) ?><?cs
           if:googleplay ?>googleplay<?cs
@@ -56,12 +67,11 @@
         elif:design ?>design<?cs
         elif:walkthru ?>walkthru<?cs
         else ?>none<?cs set:dac_subcategory_set = #0 ?><?cs /if ?><?cs
-      /if ?>" />
-
-    <?cs if:nonavpage ?>
-      <meta name="hide_toc" value='True' />
-    <?cs elif: !nonavpage && dac_subcategory_set && !tools && !sdk ?>
-      <meta name="book_path" value="<?cs
+      /if ?>" /><?cs
+      if:nonavpage ?>
+  <meta name="hide_toc" value='True' /><?cs
+      elif: !nonavpage && dac_subcategory_set && !tools && !sdk ?>
+  <meta name="book_path" value="<?cs
         if:ndk ?>/ndk<?cs
           if:guide ?>/guides<?cs
           elif:samples ?>/samples<?cs
@@ -74,16 +84,18 @@
             elif:reference ?>/reference<?cs
             elif:samples ?>/samples<?cs /if ?><?cs
           elif:(google||reference.gms||reference.gcm) ?>/google<?cs
-          elif:(topic||libraries) ?>/topic<?cs
+          elif:(topic||libraries||perf) ?>/topic<?cs
             if:libraries ?>/libraries<?cs
-            elif:instantapps ?>/instant-apps<?cs /if ?><?cs
+            elif:instantapps ?>/instant-apps<?cs
+            elif:perf ?>/performance<?cs
+            elif:arc ?>/arc<?cs /if ?><?cs
           elif:(distribute||googleplay||essentials||users||engage||monetize||disttools||stories||analyze) ?>/distribute<?cs
             if:googleplay ?>/googleplay<?cs
             elif:essentials ?>/essentials<?cs
             elif:users ?>/users<?cs
             elif:engage ?>/engage<?cs
             elif:monetize ?>/monetize<?cs
-            elif:disttools ?>/disttools<?cs
+            elif:disttools ?>/tools<?cs
             elif:stories ?>/stories<?cs
             elif:analyze ?>/analyze<?cs /if ?><?cs
           elif:(about||versions||wear||tv||auto) ?>/about<?cs
@@ -94,32 +106,52 @@
           elif:reference.testSupport ?>/reference/android/support/test<?cs
           elif:reference.wearableSupport ?>/reference/android/support/wearable<?cs
           elif:walkthru ?>/walkthru<?cs /if ?><?cs
-        /if ?>/_book.yaml" />
-    <?cs /if ?>
+        /if ?>/_book.yaml" /><?cs
+        /if ?>
+  <meta name="project_path" value="<?cs
+      if:(guide||develop||training||reference||tools||sdk||samples) ?><?cs
+        if:guide ?>/guide<?cs
+        elif:training ?>/training<?cs
+        elif:reference ?>/reference<?cs
+        elif:samples ?>/samples<?cs /if ?><?cs
+      elif:(google||reference.gms||reference.gcm) ?>/google<?cs
+      elif:(topic||libraries) ?>/develop<?cs
+      elif:(distribute||googleplay||essentials||users||engage||monetize||disttools||stories||analyze) ?>/distribute<?cs
+        if:googleplay ?>/googleplay<?cs
+        elif:essentials ?>/essentials<?cs
+        elif:users ?>/users<?cs
+        elif:engage ?>/engage<?cs
+        elif:monetize ?>/monetize<?cs
+        elif:disttools ?>/tools<?cs
+        elif:stories ?>/stories<?cs
+        elif:analyze ?>/analyze<?cs
+        else ?><?cs /if ?><?cs
+      elif:(about||versions||wear||tv||auto) ?>/about<?cs
+      elif:wearpreview ?>/wear<?cs
+      elif:work ?>/work<?cs
+      elif:preview ?>/preview<?cs
+      elif:design ?>/design<?cs /if ?>/_project.yaml" /><?cs
 
-    <?cs if:page.tags && page.tags != "" ?>
-      <meta name="keywords" value='<?cs var:page.tags ?>' />
-    <?cs /if ?>
+      if:page.tags && page.tags != "" ?>
+  <meta name="keywords" value='<?cs var:page.tags ?>' /><?cs
+      /if ?><?cs
+      if:meta.tags && meta.tags != "" ?>
+  <meta name="meta_tags" value='<?cs var:meta.tags ?>' /><?cs
+      /if ?><?cs
+      if:fullpage ?>
+  <meta name="full_width" value="True" /><?cs
+      /if ?><?cs
+      if:page.landing ?>
+  <meta name="page_type" value="landing" /><?cs
+      /if ?><?cs
+      if:page.article ?>
+  <meta name="page_type" value="article" /><?cs
+      /if ?><?cs
+      if:page.image ?>
+  <meta name="image_path" value='/<?cs var:page.image ?>' /><?cs
+      /if ?><?cs
+/if ?><?cs # END if/else devsite ?><?cs
 
-    <?cs if:meta.tags && meta.tags != "" ?>
-      <meta name="meta_tags" value='<?cs var:meta.tags ?>' />
-    <?cs /if ?>
-
-    <?cs if:fullpage ?>
-      <meta name="full_width" value="True" />
-    <?cs /if ?>
-
-    <?cs if:page.landing ?>
-      <meta name="page_type" value="landing" />
-    <?cs /if ?>
-
-    <?cs if:page.article ?>
-      <meta name="page_type" value="article" />
-    <?cs /if ?>
-
-    <?cs /if ?><?cs
-    # END if/else devsite ?>
-<?cs
   if:!devsite ?>
 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
 <meta name="viewport" content="width=device-width,initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
@@ -136,25 +168,11 @@
 <link rel="alternate" href="http://developer.android.com/intl/zh-cn/<?cs var:path.canonical ?>" hreflang="zh-cn" />
 <link rel="alternate" href="http://developer.android.com/intl/zh-tw/<?cs var:path.canonical ?>" hreflang="zh-tw" />
 <?cs /if ?><?cs
-# END if/else !devsite ?>
+# END if/else !devsite ?><?cs
 
-<title><?cs
-if:devsite ?><?cs
-  if:page.title ?><?cs
-    var:html_strip(page.title) ?><?cs
-  else ?>Android Developers<?cs
-  /if ?><?cs
-else ?><?cs
-  if:page.title ?><?cs
-    var:page.title ?> | <?cs
-  /if ?>Android Developers
-<?cs /if ?><?cs
-# END if/else devsite ?></title>
-<?cs
-  if:page.metaDescription ?>
-<meta name="description" content="<?cs var:page.metaDescription ?>"><?cs
-  /if ?>
-<?cs
+      if:page.metaDescription ?>
+  <meta name="description" content="<?cs var:page.metaDescription ?>"><?cs
+      /if ?><?cs
   if:!devsite ?>
 <!-- STYLESHEETS -->
 <link rel="stylesheet"
@@ -196,7 +214,6 @@
   ga('create', 'UA-49880327-2', 'android.com', {'name': 'universal'});  // New tracker);
   ga('send', 'pageview');
   ga('universal.send', 'pageview'); // Send page view for new tracker.
-</script>
-<?cs /if ?><?cs
+</script><?cs /if ?><?cs
 # END if/else !devsite ?>
-</head>
+</head>
\ No newline at end of file
diff --git a/tools/droiddoc/templates-sdk-dev/header.cs b/tools/droiddoc/templates-sdk-dev/header.cs
index 8c67138..a927393 100644
--- a/tools/droiddoc/templates-sdk-dev/header.cs
+++ b/tools/droiddoc/templates-sdk-dev/header.cs
@@ -8,4 +8,4 @@
   <?cs /if ?>
 
   <?cs call:search_results() ?>
-<?cs /if ?><?cs # end if/else !devsite ?>
+<?cs /if ?><?cs # end if/else !devsite ?>
\ No newline at end of file