Merge "Enable query highlighting and result ranking for search autocomplete on d.a.c. Also make it case-insensitive."
diff --git a/core/cleanspec.mk b/core/cleanspec.mk
index 1da984e..d3fc9a4 100644
--- a/core/cleanspec.mk
+++ b/core/cleanspec.mk
@@ -181,6 +181,9 @@
 $(call add-clean-step, rm -rf $(PRODUCT_OUT)/obj/APPS)
 $(call add-clean-step, rm -rf $(PRODUCT_OUT)/system/*)
 $(call add-clean-step, rm -rf $(OUT_DIR)/target/common/obj/APPS)
+$(call add-clean-step, rm -rf $(PRODUCT_OUT)/obj/APPS)
+$(call add-clean-step, rm -rf $(PRODUCT_OUT)/system/*)
+$(call add-clean-step, rm -rf $(OUT_DIR)/target/common/obj/APPS)
 
 # ************************************************
 # NEWER CLEAN STEPS MUST BE AT THE END OF THE LIST
diff --git a/core/main.mk b/core/main.mk
index 7553ede..014c050 100644
--- a/core/main.mk
+++ b/core/main.mk
@@ -196,6 +196,9 @@
   ifeq ($(user_variant),userdebug)
     # Pick up some extra useful tools
     tags_to_install += debug
+
+    # Enable Dalvik lock contention logging for userdebug builds.
+    ADDITIONAL_BUILD_PROPERTIES += dalvik.vm.lockprof.threshold=500
   else
     # Disable debugging in plain user builds.
     enable_target_debugging :=
diff --git a/core/version_defaults.mk b/core/version_defaults.mk
index ec5dcd4..d609cee 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 := 2.2
+  PLATFORM_VERSION := Kraken
 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 := Kraken
 endif
 
 ifeq "" "$(DEFAULT_APP_TARGET_SDK)"
diff --git a/envsetup.sh b/envsetup.sh
index 85465b1..8798344 100644
--- a/envsetup.sh
+++ b/envsetup.sh
@@ -29,8 +29,8 @@
         echo "Couldn't locate the top of the tree.  Try setting TOP." >&2
         return
     fi
-    CALLED_FROM_SETUP=true BUILD_SYSTEM=build/core \
-      make --no-print-directory -C "$T" -f build/core/config.mk dumpvar-abs-$1
+    (cd $T; CALLED_FROM_SETUP=true BUILD_SYSTEM=build/core \
+      make --no-print-directory -C "$T" -f build/core/config.mk dumpvar-abs-$1)
 }
 
 # Get the exact value of a build variable.
diff --git a/tools/droiddoc/src/LinkReference.java b/tools/droiddoc/src/LinkReference.java
index bbcd4db..b1f998a 100644
--- a/tools/droiddoc/src/LinkReference.java
+++ b/tools/droiddoc/src/LinkReference.java
@@ -59,6 +59,12 @@
                               Pattern.CASE_INSENSITIVE);
 
     /**
+     * regex pattern to use when matching double-quoted reference text
+     */
+    private static final Pattern QUOTE_PATTERN
+            = Pattern.compile("^\"([^\"]*)\"[ \n\r\t]*$");
+
+    /**
      * Parse and resolve a link string.
      *
      * @param text the original text
@@ -321,15 +327,15 @@
 
         if (text.startsWith("\"")) {
             // literal quoted reference (e.g., a book title)
-            result.label = text.substring(1);
-            skipHref = true;
-            if (!result.label.endsWith("\"")) {
+            Matcher matcher = QUOTE_PATTERN.matcher(text);
+            if (! matcher.matches()) {
                 Errors.error(Errors.UNRESOLVED_LINK, pos,
                         "unbalanced quoted link/see tag: " + text.trim());
                 result.makeError();
                 return result;
             }
-            result.label = result.label.substring(0, result.label.length() - 1);
+            skipHref = true;
+            result.label = matcher.group(1);
             result.kind = "@seeJustLabel";
         }
         else if (text.startsWith("<")) {
diff --git a/tools/droiddoc/templates-pdk/customization.cs b/tools/droiddoc/templates-pdk/customization.cs
index 3e9be06..3d80cc8 100644
--- a/tools/droiddoc/templates-pdk/customization.cs
+++ b/tools/droiddoc/templates-pdk/customization.cs
@@ -11,7 +11,6 @@
                       elif:doc.type == "source" ?>source<?cs
                       elif:doc.type == "porting" ?>porting<?cs
                       elif:doc.type == "compatibility" ?>compatibility<?cs
-                      elif:doc.type == "downloads" ?>downloads<?cs
                       elif:doc.type == "community" ?>community<?cs
                       elif:doc.type == "about" ?>about<?cs /if ?>">
               <li id="home-link"><a href="<?cs var:toroot ?>index.html"><span>Home</span></a></li>
@@ -23,8 +22,6 @@
                                   onClick="return loadLast('compatibility')"><span>Compatibility</span></a></li>
               <li id="community-link"><a href="<?cs var:toroot ?>community/index.html"
                                   onClick="return loadLast('community')"><span>Community</span></a></li>
-              <li id="downloads-link"><a href="<?cs var:toroot ?>downloads/index.html"
-                                  onClick="return loadLast('downloads')"><span>Downloads</span></a></li>
               <li id="about-link"><a href="<?cs var:toroot ?>about/index.html"
                                   onClick="return loadLast('about')"><span>About</span></a></li>
           </ul> 
@@ -102,21 +99,6 @@
   </div>
 <?cs /def ?>
 
-<?cs def:downloads_nav() ?>
-  <div class="g-section g-tpl-240" id="body-content">
-    <div class="g-unit g-first side-nav-resizable" id="side-nav">
-      <div id="devdoc-nav"><?cs
-        include:"../../../../development/pdk/docs/downloads/downloads_toc.cs" ?>
-      </div>
-    </div> <!-- end side-nav -->
-    <script>
-      addLoadEvent(function() {
-        scrollIntoView("devdoc-nav");
-        });
-    </script>
-  </div>
-<?cs /def ?>
-
 <?cs def:compatibility_nav() ?>
   <div class="g-section g-tpl-240" id="body-content">
     <div class="g-unit g-first side-nav-resizable" id="side-nav">
@@ -140,8 +122,6 @@
       <?cs call:porting_nav() ?>
     <?cs elif:doc.type == "compatibility" ?>
       <?cs call:compatibility_nav() ?>
-    <?cs elif:doc.type == "downloads" ?>
-      <?cs call:downloads_nav() ?>
     <?cs elif:doc.type == "community" ?>
       <?cs call:community_nav() ?>
     <?cs elif:doc.type == "about" ?>
diff --git a/tools/droiddoc/templates-pdk/head_tag.cs b/tools/droiddoc/templates-pdk/head_tag.cs
index 915dc0e..cccbb14 100644
--- a/tools/droiddoc/templates-pdk/head_tag.cs
+++ b/tools/droiddoc/templates-pdk/head_tag.cs
@@ -1,6 +1,6 @@
 <head>
 <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
-<link rel="shortcut icon" type="image/x-icon" href="<?cs var:toroot ?>assets-pdk/favicon.ico" />
+<link rel="shortcut icon" type="image/x-icon" href="<?cs var:toroot ?>assets/favicon.ico" />
 <title><?cs 
   if:page.title ?><?cs 
     var:page.title ?><?cs
@@ -9,7 +9,7 @@
     /if ?> | <?cs
   /if ?>Android Open Source</title>
 <link href="<?cs var:toroot ?>assets/android-developer-docs-devguide.css" rel="stylesheet" type="text/css" />
-<link href="<?cs var:toroot ?>assets-pdk/pdk-local.css" rel="stylesheet" type="text/css" />
+<!-- <link href="<?cs var:toroot ?>assets-pdk/pdk-local.css" rel="stylesheet" type="text/css" /> -->
 <script src="<?cs var:toroot ?>assets/search_autocomplete.js" type="text/javascript"></script>
 <script src="<?cs var:toroot ?>assets/jquery-resizable.min.js" type="text/javascript"></script>
 <script src="<?cs var:toroot ?>assets/android-developer-docs.js" type="text/javascript"></script>
@@ -28,7 +28,7 @@
 	}
 }
 </script>
-<script type="text/javascript>
+<script type="text/javascript">
   jQuery(document).ready(function() {
         jQuery("pre").addClass("prettyprint");
   });