Reconcile with ics-mr1-release

Change-Id: Id19190393a665dd1b07c073970925758aa383691
diff --git a/core/java/android/app/ActivityManager.java b/core/java/android/app/ActivityManager.java
index 4fe9cef..a8ed132 100644
--- a/core/java/android/app/ActivityManager.java
+++ b/core/java/android/app/ActivityManager.java
@@ -1442,9 +1442,10 @@
     public int getLauncherLargeIconDensity() {
         final Resources res = mContext.getResources();
         final int density = res.getDisplayMetrics().densityDpi;
+        final int sw = res.getConfiguration().smallestScreenWidthDp;
 
-        if ((res.getConfiguration().screenLayout & Configuration.SCREENLAYOUT_SIZE_MASK)
-                != Configuration.SCREENLAYOUT_SIZE_XLARGE) {
+        if (sw < 600) {
+            // Smaller than approx 7" tablets, use the regular icon size.
             return density;
         }
 
@@ -1458,7 +1459,9 @@
             case DisplayMetrics.DENSITY_XHIGH:
                 return DisplayMetrics.DENSITY_MEDIUM * 2;
             default:
-                return density;
+                // The density is some abnormal value.  Return some other
+                // abnormal value that is a reasonable scaling of it.
+                return (int)(density*1.5f);
         }
     }
 
@@ -1471,9 +1474,10 @@
     public int getLauncherLargeIconSize() {
         final Resources res = mContext.getResources();
         final int size = res.getDimensionPixelSize(android.R.dimen.app_icon_size);
+        final int sw = res.getConfiguration().smallestScreenWidthDp;
 
-        if ((res.getConfiguration().screenLayout & Configuration.SCREENLAYOUT_SIZE_MASK)
-                != Configuration.SCREENLAYOUT_SIZE_XLARGE) {
+        if (sw < 600) {
+            // Smaller than approx 7" tablets, use the regular icon size.
             return size;
         }
 
@@ -1489,7 +1493,9 @@
             case DisplayMetrics.DENSITY_XHIGH:
                 return (size * DisplayMetrics.DENSITY_MEDIUM * 2) / DisplayMetrics.DENSITY_XHIGH;
             default:
-                return size;
+                // The density is some abnormal value.  Return some other
+                // abnormal value that is a reasonable scaling of it.
+                return (int)(size*1.5f);
         }
     }
 
diff --git a/core/java/android/app/StatusBarManager.java b/core/java/android/app/StatusBarManager.java
index 5b8addf..dd9f337 100644
--- a/core/java/android/app/StatusBarManager.java
+++ b/core/java/android/app/StatusBarManager.java
@@ -56,6 +56,11 @@
             | DISABLE_NOTIFICATION_ALERTS | DISABLE_NOTIFICATION_TICKER
             | DISABLE_SYSTEM_INFO | DISABLE_RECENT | DISABLE_HOME | DISABLE_BACK | DISABLE_CLOCK;
 
+    public static final int NAVIGATION_HINT_BACK_NOP      = 1 << 0;
+    public static final int NAVIGATION_HINT_HOME_NOP      = 1 << 1;
+    public static final int NAVIGATION_HINT_RECENT_NOP    = 1 << 2;
+    public static final int NAVIGATION_HINT_BACK_ALT      = 1 << 3;
+
     private Context mContext;
     private IStatusBarService mService;
     private IBinder mToken = new Binder();
diff --git a/core/res/res/layout/preference_child_holo.xml b/core/res/res/layout/preference_child_holo.xml
index 4167862..3c6a12e 100644
--- a/core/res/res/layout/preference_child_holo.xml
+++ b/core/res/res/layout/preference_child_holo.xml
@@ -60,7 +60,7 @@
             android:layout_alignLeft="@android:id/title"
             android:textAppearance="?android:attr/textAppearanceSmall"
             android:textColor="?android:attr/textColorSecondary"
-            android:maxLines="10" />
+            android:maxLines="4" />
 
     </RelativeLayout>
 
diff --git a/core/res/res/layout/preference_holo.xml b/core/res/res/layout/preference_holo.xml
index e574219..48f483d 100644
--- a/core/res/res/layout/preference_holo.xml
+++ b/core/res/res/layout/preference_holo.xml
@@ -63,7 +63,7 @@
             android:layout_alignLeft="@android:id/title"
             android:textAppearance="?android:attr/textAppearanceSmall"
             android:textColor="?android:attr/textColorSecondary"
-            android:maxLines="10" />
+            android:maxLines="4" />
 
     </RelativeLayout>
 
diff --git a/core/res/res/layout/preference_information_holo.xml b/core/res/res/layout/preference_information_holo.xml
index 5e03cfb..e29ed03 100644
--- a/core/res/res/layout/preference_information_holo.xml
+++ b/core/res/res/layout/preference_information_holo.xml
@@ -61,7 +61,7 @@
             android:layout_alignLeft="@android:id/title"
             android:textAppearance="?android:attr/textAppearanceSmall"
             android:textColor="?android:attr/textColorSecondary"
-            android:maxLines="10" />
+            android:maxLines="2" />
 
     </RelativeLayout>
 
diff --git a/data/fonts/DroidSansFallback.ttf b/data/fonts/DroidSansFallback.ttf
index ff97670..cfbc66a 100644
--- a/data/fonts/DroidSansFallback.ttf
+++ b/data/fonts/DroidSansFallback.ttf
Binary files differ
diff --git a/data/fonts/DroidSansFallbackFull.ttf b/data/fonts/DroidSansFallbackFull.ttf
index 03ceae5..0cacabe 100644
--- a/data/fonts/DroidSansFallbackFull.ttf
+++ b/data/fonts/DroidSansFallbackFull.ttf
Binary files differ
diff --git a/docs/html/sdk/android-4.0.3.jd b/docs/html/sdk/android-4.0.3.jd
index 809c83c..c8563ac 100644
--- a/docs/html/sdk/android-4.0.3.jd
+++ b/docs/html/sdk/android-4.0.3.jd
@@ -68,15 +68,16 @@
   <p><a href="#" onclick="return toggleContent(this)">
     <img src="{@docRoot}assets/images/triangle-opened.png"
 class="toggle-content-img" alt="" />
-    Android {@sdkPlatformVersion}, Revision 2</a> <em>(January 2012)</em>
+    Revision 2</a> <em>(January 2012)</em>
   </a></p>
 
   <div class="toggle-content-toggleme" style="padding-left:2em;">
 
-<dl>
-<dt>Maintenance release. SDK Tools r14 or higher is required.
-</dt>
-</dl>
+    <p>Maintenance update. The system version is 4.0.3.</p>
+    <dl>
+      <dt>Dependencies:</dt>
+      <dd>SDK Tools r14 or higher is required.</dd>
+    </dl>
 
   </div>
 </div>
@@ -86,15 +87,16 @@
   <p><a href="#" onclick="return toggleContent(this)">
     <img src="{@docRoot}assets/images/triangle-closed.png"
 class="toggle-content-img" alt="" />
-    Android {@sdkPlatformVersion}, Revision 1</a> <em>(December 2011)</em>
+    Revision 1</a> <em>(December 2011)</em>
   </a></p>
 
   <div class="toggle-content-toggleme" style="padding-left:2em;">
 
-<dl>
-<dt>Initial release. SDK Tools r14 or higher is required.
-</dt>
-</dl>
+    <p>Initial release. The system version is 4.0.3.</p>
+    <dl>
+      <dt>Dependencies:</dt>
+      <dd>SDK Tools r14 or higher is required.</dd>
+    </dl>
 
   </div>
 </div>
diff --git a/docs/html/sdk/compatibility-library.jd b/docs/html/sdk/compatibility-library.jd
index df71552..30d807f 100644
--- a/docs/html/sdk/compatibility-library.jd
+++ b/docs/html/sdk/compatibility-library.jd
@@ -46,11 +46,40 @@
 <p>The sections below provide notes about successive releases of
 the Support Package, as denoted by revision number.</p>
 
-
 <div class="toggle-content open">
 
   <p><a href="#" onclick="return toggleContent(this)">
     <img src="{@docRoot}assets/images/triangle-opened.png" class="toggle-content-img" />
+    Support Package, revision 7 (March 2012)
+  </a></p>
+
+  <div class="toggle-content-toggleme" style="padding-left:2em">
+    <dl>
+      <dt>Changes for v4 support library:</dt>
+      <dd>
+        <ul>
+          <li>Added {@link android.support.v4.app.ShareCompat}, which provides helper classes
+for sending and receiving content for social sharing applications, including new metadata for
+attributing shared data to the source app. This class also provides compatible integration with the
+new {@link android.widget.ShareActionProvider} in Android 4.0.</li>
+          <li>Added {@link android.support.v4.app.NavUtils} and {@link
+android.support.v4.app.TaskStackBuilder} to provide support for implementing the
+<a href="{@docRoot}design/index.html">Android Design</a> guidelines for navigation. These 
+additions include a way to implement the action bar's <em>Up</em> button across versions.
+For an example implementation of this pattern, see the AppNavigation sample in
+({@code <em>&lt;sdk&gt;</em>/samples/<em>&lt;platform&gt;</em>/AppNavigation}).</li>
+          <li>Added {@link android.support.v4.app.NotificationCompat.Builder} to provide a
+compatibility implementation of Android 3.0's {@link android.app.Notification.Builder} helper class
+for creating standardized system notifications.</li>
+        </ul>
+      </dd>
+    </dl>
+  </div>
+
+<div class="toggle-content closed">
+
+  <p><a href="#" onclick="return toggleContent(this)">
+    <img src="{@docRoot}assets/images/triangle-closed.png" class="toggle-content-img" />
     Support Package, revision 6 (December 2011)
   </a></p>
 
diff --git a/docs/html/sdk/eclipse-adt.jd b/docs/html/sdk/eclipse-adt.jd
index 30825ee..c8bf12d 100644
--- a/docs/html/sdk/eclipse-adt.jd
+++ b/docs/html/sdk/eclipse-adt.jd
@@ -1,8 +1,8 @@
 page.title=ADT Plugin for Eclipse
-adt.zip.version=16.0.1
-adt.zip.download=ADT-16.0.1.zip
-adt.zip.bytes=7000078
-adt.zip.checksum=03a2a23650ddac128c8b9e8aaf0aa433
+adt.zip.version=17.0.0
+adt.zip.download=ADT-17.0.0.zip
+adt.zip.bytes=12836115
+adt.zip.checksum=ecb12c07e534997cd32c66d57f21b770
 
 @jd:body
 
@@ -108,11 +108,109 @@
 }
 </style>
 
-
 <div class="toggleable opened">
   <a href="#" onclick="return toggleDiv(this)">
         <img src="{@docRoot}assets/images/triangle-opened.png" class="toggle-img" height="9px"
 width="9px" />
+ADT 17.0.0</a> <em>(March 2012)</em>
+  <div class="toggleme">
+<dl>
+  <dt>Dependencies:</dt>
+
+  <dd>
+    <ul>
+      <li>Java 1.6 or higher is required for ADT 17.0.0.</li>
+      <li>Eclipse Helios (Version 3.6.2) or higher is required for ADT 17.0.0.</li>
+      <li>ADT 17.0.0 is designed for use with <a href="{@docRoot}sdk/tools-notes.html">SDK Tools
+      r17</a>. If you haven't already installed SDK Tools r17 into your SDK, use the Android SDK
+      Manager to do so.</li>
+    </ul>
+  </dd>
+
+  <dt>General improvements:</dt>
+  <dd>
+    <ul>
+      <li>New build features
+        <ul>
+          <li>Added feature to automatically setup JAR dependencies. Any {@code .jar} files in the
+          {@code /libs} folder are added to the build configuration (similar to how the Ant build
+          system works). Also, {@code .jar} files needed by library projects are also automatically
+          added to projects that depend on those library projects.</li>
+          <li>Added a feature that allows you to run some code only in debug mode. Builds now
+generate a class called {@code BuildConfig} containing a {@code DEBUG} constant that is
+automatically set according to your build type. You can check the ({@code BuildConfig.DEBUG})
+constant in your code to run debug-only functions.</li>
+          <li>Added support for custom views with custom attributes in libraries. Layouts using
+custom attributes must use the namespace URI {@code http://schemas.android.com/apk/res-auto} instead
+of the URI that includes the app package name. This URI is replaced with the app specific one at
+build time.</li>
+        </ul>
+      </li>
+      <li>Improved Lint features. See the <a href="{@docRoot}sdk/tools-notes.html">SDK Tools r17</a>
+release notes.</li>
+      <li>Improved the Lint user interface
+        <ul>
+          <li>Added <strong>Run Lint</strong> toolbar action with a dropdown menu for selecting
+specific (or all) projects, clearing results and other actions.</li>
+          <li>Updated the results window to be organized as a tree rather than a flat list. Each
+issue type has a single top level item, which makes it easier to quickly scan through the reported
+issues and narrow down to the issues you are most interested in.</li>
+          <li>Added many new toolbar actions to the results window, including expand/collapse,
+ignore in file, ignore in project, ignore everywhere, show options, and configure columns.</li>
+          <li>Added new column options for the <strong>Lint Warnings</strong> tab, such as
+category, priority, project, file and line. The column selection (as well as the column sizes) are
+persisted. You can also click on columns to sort by those values.</li>
+          <li>Added Enable All and Disable All buttons to the Lint Options dialog, and a search
+filter textbox to filter by issue id, summary and severity.</li>
+        </ul>
+      </li>
+      <li>Added Quick Outline for XML editors (Ctrl-O, Command-O). This feature shows the structure
+of the current file including icons and ids, lets you filter and quickly jump to specific ids.</li>
+      <li>Updated the resource chooser to shows the resolved value for resources. For example,
+when selecting {@code @string/hello} the chooser displays a resolved value such as "Hello World").
+The resource chooser also now allows you to edit the chosen value directly.</li>
+      <li>Updated Layout Editor so that it does not assign default ids to layouts, includes and
+merge tags. This behavior tended to pollute the namespace with a lot of unused resources since
+layouts are not usually manipulated via code, or referenced from XML. (The RelativeLayout editor
+automatically assigns ids to views without ids when pointing to them.)</li>
+      <li>Added ability to export screenshots from the Layout Editor</li>
+    </ul>
+  </dd>
+
+  <dt>Bug fixes:</dt>
+  <dd>
+    <ul>
+      <li>Fixed problem using Layout Editor with {@link android.widget.SlidingDrawer} which could
+        not be dragged into the layout on some platforms.</li>
+      <li>Fixed preview rendering for {@link android.widget.SlidingDrawer} and 
+        {@link android.widget.TabHost}.
+        (<a href="http://code.google.com/p/android/issues/detail?id=23022">Issue 23022</a>).</li>
+      <li>Fixed issues that could prevent layout rendering due to unresolvable resources.
+        (<a href="http://code.google.com/p/android/issues/detail?id=21046">Issue 21046</a>,
+        <a href="http://code.google.com/p/android/issues/detail?id=21051">Issue 21051</a>)</li>
+      <li>Fixed a bug in resource chooser which made some types of framework resources impossible to
+select. (<a href="http://code.google.com/p/android/issues/detail?id=20589">Issue 20589</a>)</li>
+      <li>Fixed a bug in the formatter where a certain whitespace pattern could result in a
+        non-space character getting deleted.
+        (<a href="http://code.google.com/p/android/issues/detail?id=23940">Issue 23940</a>)</li>
+      <li>Fixed a locale bug affecting Turkish locales in particular.
+        (<a href="http://code.google.com/p/android/issues/detail?id=23747">Issue 23747</a>)</li>
+      <li>Fixed issue where dex complains about duplicate classes in cases where a Library
+        Project depends on the same jar files or Java-only projects.</li>
+      <li>Fixed issue where test projects had to independently reference the library projects used
+        by an app project. Now referencing only the app project is enough.</li>
+    </ul>
+  </dd>
+
+</dl>
+
+</div>
+</div>
+
+<div class="toggleable closed">
+  <a href="#" onclick="return toggleDiv(this)">
+        <img src="{@docRoot}assets/images/triangle-closed.png" class="toggle-img" height="9px"
+width="9px" />
 ADT 16.0.1</a> <em>(December 2011)</em>
   <div class="toggleme">
 <dl>
@@ -182,11 +280,11 @@
   <div class="toggleme">
 <dl>
   <dt>Dependencies:</dt>
-  
+
   <dd>ADT 15.0.1 is designed for use with <a href="{@docRoot}sdk/tools-notes.html">SDK Tools r15</a>.
   If you haven't already installed SDK Tools r15 into your SDK, use the Android SDK Manager to
   do so.</dd>
-  
+
   <dt>Bug fixes:</dt>
   <dd>
     <ul>
diff --git a/docs/html/sdk/index.jd b/docs/html/sdk/index.jd
index 5cf05e0..c09b3c2 100644
--- a/docs/html/sdk/index.jd
+++ b/docs/html/sdk/index.jd
@@ -2,21 +2,21 @@
 page.metaDescription=Download the official Android SDK to develop apps for Android-powered devices.
 sdk.redirect=0
 
-sdk.win_installer=installer_r16-windows.exe
-sdk.win_installer_bytes=29561554
-sdk.win_installer_checksum=3521dda4904886b05980590f83cf3469
+sdk.win_installer=installer_r17-windows.exe
+sdk.win_installer_bytes=37410775
+sdk.win_installer_checksum=5afaf6511ebaa52bd6d1dba4afc61e41
 
-sdk.win_download=android-sdk_r16-windows.zip
-sdk.win_bytes=29562413
-sdk.win_checksum=6b926d0c0a871f1a946e65259984701a
+sdk.win_download=android-sdk_r17-windows.zip
+sdk.win_bytes=37417953
+sdk.win_checksum=3af1baeb39707e54df068e939aea5a79
 
-sdk.mac_download=android-sdk_r16-macosx.zip
-sdk.mac_bytes=26158334
-sdk.mac_checksum=d1dc2b6f13eed5e3ce5cf26c4e4c47aa
+sdk.mac_download=android-sdk_r17-macosx.zip
+sdk.mac_bytes=33867836
+sdk.mac_checksum=52639aae036b7c2e47cf291696b23236
 
-sdk.linux_download=android-sdk_r16-linux.tgz
-sdk.linux_bytes=22048174
-sdk.linux_checksum=3ba457f731d51da3741c29c8830a4583
+sdk.linux_download=android-sdk_r17-linux.tgz
+sdk.linux_bytes=29706368
+sdk.linux_checksum=14e99dfa8eb1a8fadd2f3557322245c4
 
 @jd:body
 
diff --git a/docs/html/sdk/requirements.jd b/docs/html/sdk/requirements.jd
index c970f6c9..c76e8c8 100644
--- a/docs/html/sdk/requirements.jd
+++ b/docs/html/sdk/requirements.jd
@@ -24,7 +24,7 @@
 
 <h4 style="margin-top:.25em"><em>Eclipse IDE</em></h4>
     <ul>
-      <li>Eclipse 3.6 (Helios) or greater
+      <li>Eclipse 3.6.2 (Helios) or greater
 <p class="note"><strong>Note:</strong> Eclipse 3.5 (Galileo) is no longer
 supported with the latest version of ADT.</p></li>
       <li>Eclipse <a href="http://www.eclipse.org/jdt">JDT</a> plugin (included
@@ -41,8 +41,8 @@
            <li>Eclipse IDE for Java EE Developers</li>
          </ul>
       </li>
-      <li><a href="http://www.oracle.com/technetwork/java/javase/downloads/index.html">JDK 5 or JDK
-6</a> (JRE alone is not sufficient)</li>
+      <li><a href="http://www.oracle.com/technetwork/java/javase/downloads/index.html">JDK 6</a>
+        (JRE alone is not sufficient)</li>
       <li><a href="eclipse-adt.html">Android Development Tools plugin</a>
 (recommended)</li>
       <li><strong>Not</strong> compatible with Gnu Compiler for Java (gcj)</li>
@@ -51,8 +51,8 @@
 
 <h4><em>Other development environments or IDEs</em></h4>
     <ul>
-      <li><a href="http://www.oracle.com/technetwork/java/javase/downloads/index.html">JDK 5 or JDK
-6</a> (JRE alone is not sufficient)</li>
+      <li><a href="http://www.oracle.com/technetwork/java/javase/downloads/index.html">JDK 6</a>
+        (JRE alone is not sufficient)</li>
       <li><a href="http://ant.apache.org/">Apache Ant</a> 1.8 or later</li>
       <li><strong>Not</strong> compatible with Gnu Compiler for Java (gcj)</li>
     </ul>
diff --git a/docs/html/sdk/sdk_toc.cs b/docs/html/sdk/sdk_toc.cs
index f7541f7..5a5517c 100644
--- a/docs/html/sdk/sdk_toc.cs
+++ b/docs/html/sdk/sdk_toc.cs
@@ -81,7 +81,8 @@
         <div><a href="<?cs var:toroot ?>sdk/android-4.0-highlights.html">
         <span class="en">Android 4.0.x Platform</span></a> <span class="new">new!</span></div>
         <ul>
-          <li><a href="<?cs var:toroot ?>sdk/android-4.0.3.html">Android 4.0.3 Platform</a> <span class="new">new!</span></li>
+          <li><a href="<?cs var:toroot ?>sdk/android-4.0.3.html">Android 4.0.3 Platform</a>
+            <span class="new">new!</span></li>
           <li><a href="<?cs var:toroot ?>sdk/android-4.0.html">Android 4.0 Platform</a> </li>
         </ul>
       </li>
@@ -152,10 +153,10 @@
       </li>
     </ul>
     <ul>
-      <li><a href="<?cs var:toroot ?>sdk/tools-notes.html">SDK Tools, r16</a> <span
+      <li><a href="<?cs var:toroot ?>sdk/tools-notes.html">SDK Tools, r17</a> <span
 class="new">new!</span></li>
       <li><a href="<?cs var:toroot ?>sdk/win-usb.html">Google USB Driver, r4</a></li>
-      <li><a href="<?cs var:toroot ?>sdk/compatibility-library.html">Support Package, r6</a>
+      <li><a href="<?cs var:toroot ?>sdk/compatibility-library.html">Support Package, r7</a>
       <span class="new">new!</span></li>
     </ul>
   </li>
@@ -171,7 +172,7 @@
       <span style="display:none" class="zh-TW"></span>
     </span>
     <ul>
-      <li><a href="<?cs var:toroot ?>sdk/eclipse-adt.html">ADT 16.0.1
+      <li><a href="<?cs var:toroot ?>sdk/eclipse-adt.html">ADT 17.0.0
       <span style="display:none" class="de"></span>
       <span style="display:none" class="es"></span>
       <span style="display:none" class="fr"></span>
diff --git a/docs/html/sdk/tools-notes.jd b/docs/html/sdk/tools-notes.jd
index 91bcb7d..bbbca81 100644
--- a/docs/html/sdk/tools-notes.jd
+++ b/docs/html/sdk/tools-notes.jd
@@ -64,11 +64,112 @@
 }
 </style>
 
-
 <div class="toggleable opened">
   <a href="#" onclick="return toggleDiv(this)">
     <img src="{@docRoot}assets/images/triangle-opened.png" class="toggle-img" height="9px"
     width="9px" />
+    SDK Tools, Revision 17</a> <em>(March 2012)</em>
+
+  <div class="toggleme">
+    <p class="caution"><strong>Important:</strong> To download the new Android
+    4.0 system components from the Android SDK Manager, you must first update the
+    SDK tools to revision 14 or later and restart the Android SDK Manager. If you do not,
+    the Android 4.0 system components will not be available for download.</p>
+
+    <dl>
+    <dt>Dependencies:</dt>
+    <dd>
+      <ul>
+        <li>Android SDK Platform-tools revision 9 or later.</li>
+        <li>If you are developing in Eclipse with ADT, note that the SDK Tools r17 is designed for
+        use with ADT 17.0.0 and later. If you haven't already, we highly recommend updating your
+        <a href="{@docRoot}sdk/eclipse-adt.html">ADT Plugin</a> to 17.0.0.</li>
+        <li>If you are developing outside Eclipse, you must have
+          <a href="http://ant.apache.org/">Apache Ant</a> 1.8 or later.</li>
+    </ul>
+    </dd>
+    <dt>General notes:</dt>
+    <dd>
+      <ul>
+        <li>Emulator
+          <ul>
+            <li>Added support for hardware accelerated graphics rendering. This feature requires an
+API Level 15, Revision 3 or later system image.
+(<a href="{@docRoot}guide/developing/devices/emulator.html#accel-graphics">more info</a>)
+              <p class="note"><strong>Note:</strong> As of the SDK Tools Revision 17 release, the
+API Level 15, Revision 3 system image is not yet available.</p>
+            </li>
+            <li>Added support for running Android x86 system images in virtualization mode on
+Windows and Mac OS X.
+(<a href="{@docRoot}guide/developing/devices/emulator.html#accel-vm">more info</a>)</li>
+            <li>Added experimental support for multi-touch input by enabing the emulator to receive
+              touch input from a USB-tethered physical Android device.
+              (<a href="http://tools.android.com/tips/hardware-emulation">more info</a>)</li>
+          </ul>
+        </li>
+        <li>Added viewing of live detailed network usage of an app in DDMS. (<a
+    href="http://tools.android.com/recent/detailednetworkusageinddms">more info</a>)</li>
+        <li>ProGuard
+          <ul>
+            <li>Updated the bundled ProGuard tool to version 4.7. In addition to many new features,
+this update fixes the {@code Conversion to Dalvik format failed with error 1} error some users have
+experienced.</li>
+            <li>Updated the default {@code proguard.cfg} file with better default flags for
+              Android.</li>
+            <li>Split the ProGuard configuration file has been in half, with project specific flags
+kept in project and the generic Android flags distributed (and updated) with the tools
+themselves.</li>
+          </ul>
+        </li>
+        <li>Build
+          <ul>
+            <li>Added a feature that allows you to run some code only in debug mode. Builds now
+generate a class called {@code BuildConfig} containing a {@code DEBUG} constant that is
+automatically set according to your build type. You can check the ({@code BuildConfig.DEBUG})
+constant in your code to run debug-only functions.</li>
+            <li>Fixed issue when a project and its libraries include the same jar file in their libs
+              folder.</li>
+            <li>Added support for custom views with custom attributes in libraries. Layouts using
+custom attributes must use the namespace URI {@code http://schemas.android.com/apk/res-auto} instead
+of the URI that includes the app package name. This URI is replaced with the app specific one at
+build time.</li>
+          </ul>
+        </li>
+        <li>Lint
+          <ul>
+            <li>Updated Lint to check Android application code. Lint rules which previously
+performed pattern based searches in the application code (such as the unused resource check) have
+been rewritten to use the more accurate Java-style parse trees.</li>
+            <li>Added support for checking library projects. This change means that rules such as
+the unused resource check properly handle resources declared in a library project and referenced in
+a downstream project.</li>
+            <li>Added ability to suppress Lint warnings in Java code with the new
+{@code @SuppressLint} annotation, and in XML files with the new tools: namespace and
+ignore attribute. (<a
+    href="http://tools.android.com/recent/ignoringlintwarnings">more info</a>)</li>
+            <li>New Lint checks:
+              <ul>
+                <li>Added check for Android API calls that require a version of Android higher than
+                  the minimum supported version. You can use the new {@code @TargetApi} annotation
+                  to suppress warnings when the code is wrapped in a system version condition.
+                  (<a href="http://tools.android.com/recent/lintapicheck">more info</a>)</li>
+                <li>Added over 20 new Lint rules, including checks for
+                  <a href="http://tools.android.com/recent/lintperformancechecks">performance</a>,
+                  XML layouts, manifest and file handling.</li>
+              </ul>
+            </li>
+          </ul>
+        </li>
+      </ul>
+    </dd>
+    </dl>
+  </div>
+</div>
+
+<div class="toggleable closed">
+  <a href="#" onclick="return toggleDiv(this)">
+    <img src="{@docRoot}assets/images/triangle-closed.png" class="toggle-img" height="9px"
+    width="9px" />
     SDK Tools, Revision 16</a> <em>(December 2011)</em>
 
   <div class="toggleme">
@@ -92,10 +193,10 @@
 <dt>General notes:</dt>
 <dd>
   <ul>
-    <li>Added Lint tools to detect common errors in Android projects. 
+    <li>Added Lint tools to detect common errors in Android projects.
       (<a href="http://tools.android.com/recent/lint">more info</a>)</li>
     <li>Added sensor emulation support, which allows the emulator to read sensor data from a
-      physical Android device. 
+      physical Android device.
       (<a href="http://tools.android.com/recent/sensoremulation">more info</a>)</li>
     <li>Added support for using a webcam to emulate a camera on Mac OS X.</li>
   </ul>
diff --git a/packages/SystemUI/res/drawable-hdpi/ic_sysbar_back_ime_default.png b/packages/SystemUI/res/drawable-hdpi/ic_sysbar_back_ime.png
similarity index 100%
rename from packages/SystemUI/res/drawable-hdpi/ic_sysbar_back_ime_default.png
rename to packages/SystemUI/res/drawable-hdpi/ic_sysbar_back_ime.png
Binary files differ
diff --git a/packages/SystemUI/res/drawable-hdpi/ic_sysbar_back_ime_pressed.png b/packages/SystemUI/res/drawable-hdpi/ic_sysbar_back_ime_pressed.png
deleted file mode 100644
index 4757125..0000000
--- a/packages/SystemUI/res/drawable-hdpi/ic_sysbar_back_ime_pressed.png
+++ /dev/null
Binary files differ
diff --git a/packages/SystemUI/res/drawable-mdpi/ic_sysbar_back_ime_default.png b/packages/SystemUI/res/drawable-mdpi/ic_sysbar_back_ime.png
similarity index 100%
rename from packages/SystemUI/res/drawable-mdpi/ic_sysbar_back_ime_default.png
rename to packages/SystemUI/res/drawable-mdpi/ic_sysbar_back_ime.png
Binary files differ
diff --git a/packages/SystemUI/res/drawable-mdpi/ic_sysbar_back_ime_pressed.png b/packages/SystemUI/res/drawable-mdpi/ic_sysbar_back_ime_pressed.png
deleted file mode 100644
index 0cd05a30..0000000
--- a/packages/SystemUI/res/drawable-mdpi/ic_sysbar_back_ime_pressed.png
+++ /dev/null
Binary files differ
diff --git a/packages/SystemUI/res/drawable-xhdpi/ic_sysbar_back_ime_default.png b/packages/SystemUI/res/drawable-xhdpi/ic_sysbar_back_ime.png
similarity index 100%
rename from packages/SystemUI/res/drawable-xhdpi/ic_sysbar_back_ime_default.png
rename to packages/SystemUI/res/drawable-xhdpi/ic_sysbar_back_ime.png
Binary files differ
diff --git a/packages/SystemUI/res/drawable-xhdpi/ic_sysbar_back_ime_pressed.png b/packages/SystemUI/res/drawable-xhdpi/ic_sysbar_back_ime_pressed.png
deleted file mode 100644
index 3e59c8d..0000000
--- a/packages/SystemUI/res/drawable-xhdpi/ic_sysbar_back_ime_pressed.png
+++ /dev/null
Binary files differ
diff --git a/packages/SystemUI/res/drawable/ic_sysbar_back_ime.xml b/packages/SystemUI/res/drawable/ic_sysbar_back_ime.xml
deleted file mode 100644
index 248496d..0000000
--- a/packages/SystemUI/res/drawable/ic_sysbar_back_ime.xml
+++ /dev/null
@@ -1,21 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2008 The Android Open Source Project
-
-     Licensed under the Apache License, Version 2.0 (the "License");
-     you may not use this file except in compliance with the License.
-     You may obtain a copy of the License at
-
-          http://www.apache.org/licenses/LICENSE-2.0
-
-     Unless required by applicable law or agreed to in writing, software
-     distributed under the License is distributed on an "AS IS" BASIS,
-     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-     See the License for the specific language governing permissions and
-     limitations under the License.
--->
-
-<selector xmlns:android="http://schemas.android.com/apk/res/android">
-    <item android:state_pressed="true" android:drawable="@drawable/ic_sysbar_back_ime_pressed" />
-    <item android:drawable="@drawable/ic_sysbar_back_ime_default" />
-</selector>
-
diff --git a/packages/SystemUI/res/layout-sw600dp/status_bar.xml b/packages/SystemUI/res/layout-sw600dp/status_bar.xml
index b96c357..2308bf0 100644
--- a/packages/SystemUI/res/layout-sw600dp/status_bar.xml
+++ b/packages/SystemUI/res/layout-sw600dp/status_bar.xml
@@ -54,7 +54,7 @@
                 android:clipToPadding="false"
                 >
                 <com.android.systemui.statusbar.policy.KeyButtonView android:id="@+id/back"
-                    android:layout_width="80dip"
+                    android:layout_width="@dimen/navigation_key_width"
                     android:layout_height="match_parent"
                     android:src="@drawable/ic_sysbar_back"
                     systemui:keyCode="4"
@@ -62,7 +62,7 @@
                     systemui:glowBackground="@drawable/ic_sysbar_highlight"
                     />
                 <com.android.systemui.statusbar.policy.KeyButtonView android:id="@+id/home"
-                    android:layout_width="80dip"
+                    android:layout_width="@dimen/navigation_key_width"
                     android:layout_height="match_parent"
                     android:src="@drawable/ic_sysbar_home"
                     systemui:keyCode="3"
@@ -70,14 +70,14 @@
                     systemui:glowBackground="@drawable/ic_sysbar_highlight"
                     />
                 <com.android.systemui.statusbar.policy.KeyButtonView android:id="@+id/recent_apps"
-                    android:layout_width="80dip"
+                    android:layout_width="@dimen/navigation_key_width"
                     android:layout_height="match_parent"
                     android:src="@drawable/ic_sysbar_recent"
                     android:contentDescription="@string/accessibility_recent"
                     systemui:glowBackground="@drawable/ic_sysbar_highlight"
                     />
                 <com.android.systemui.statusbar.policy.KeyButtonView android:id="@+id/menu"
-                    android:layout_width="80dip"
+                    android:layout_width="@dimen/navigation_menu_key_width"
                     android:layout_height="match_parent"
                     android:src="@drawable/ic_sysbar_menu"
                     systemui:keyCode="82"
diff --git a/packages/SystemUI/res/layout-sw600dp/status_bar_recent_panel.xml b/packages/SystemUI/res/layout-sw600dp/status_bar_recent_panel.xml
index 111f9a4..8e231d0 100644
--- a/packages/SystemUI/res/layout-sw600dp/status_bar_recent_panel.xml
+++ b/packages/SystemUI/res/layout-sw600dp/status_bar_recent_panel.xml
@@ -32,7 +32,7 @@
         android:layout_width="wrap_content"
         android:layout_height="match_parent"
         android:layout_alignParentBottom="true"
-        android:paddingBottom="@*android:dimen/status_bar_height"
+        android:layout_marginBottom="@*android:dimen/status_bar_height"
         android:clipToPadding="false"
         android:clipChildren="false">
 
@@ -69,13 +69,12 @@
 
     </FrameLayout>
 
-    <View android:id="@+id/recents_dismiss_button"
-        android:layout_width="80px"
+    <com.android.systemui.recent.StatusBarTouchProxy
+        android:id="@+id/status_bar_touch_proxy"
+        android:layout_width="match_parent"
         android:layout_height="@*android:dimen/status_bar_height"
         android:layout_alignParentBottom="true"
         android:layout_alignParentLeft="true"
-        android:background="@drawable/ic_sysbar_back_ime"
-        android:contentDescription="@string/status_bar_accessibility_dismiss_recents"
     />
 
 
diff --git a/packages/SystemUI/res/layout/navigation_bar.xml b/packages/SystemUI/res/layout/navigation_bar.xml
index d19fd81..ef2996e 100644
--- a/packages/SystemUI/res/layout/navigation_bar.xml
+++ b/packages/SystemUI/res/layout/navigation_bar.xml
@@ -49,7 +49,7 @@
                 android:visibility="invisible"
                 />
             <com.android.systemui.statusbar.policy.KeyButtonView android:id="@+id/back"
-                android:layout_width="80dp"
+                android:layout_width="@dimen/navigation_key_width"
                 android:layout_height="match_parent"
                 android:src="@drawable/ic_sysbar_back"
                 systemui:keyCode="4"
@@ -64,7 +64,7 @@
                 android:visibility="invisible"
                 />
             <com.android.systemui.statusbar.policy.KeyButtonView android:id="@+id/home"
-                android:layout_width="80dp"
+                android:layout_width="@dimen/navigation_key_width"
                 android:layout_height="match_parent"
                 android:src="@drawable/ic_sysbar_home"
                 systemui:keyCode="3"
@@ -80,7 +80,7 @@
                 android:visibility="invisible"
                 />
             <com.android.systemui.statusbar.policy.KeyButtonView android:id="@+id/recent_apps"
-                android:layout_width="80dp"
+                android:layout_width="@dimen/navigation_key_width"
                 android:layout_height="match_parent"
                 android:src="@drawable/ic_sysbar_recent"
                 android:layout_weight="0"
@@ -88,7 +88,7 @@
                 android:contentDescription="@string/accessibility_recent"
                 />
             <com.android.systemui.statusbar.policy.KeyButtonView android:id="@+id/menu"
-                android:layout_width="40dp"
+                android:layout_width="@dimen/navigation_menu_key_width"
                 android:layout_height="match_parent"
                 android:src="@drawable/ic_sysbar_menu"
                 systemui:keyCode="82"
diff --git a/packages/SystemUI/res/values-sw600dp-port/dimens.xml b/packages/SystemUI/res/values-sw600dp-port/dimens.xml
index b8a6cfe..39eade6 100644
--- a/packages/SystemUI/res/values-sw600dp-port/dimens.xml
+++ b/packages/SystemUI/res/values-sw600dp-port/dimens.xml
@@ -18,5 +18,11 @@
 <resources>
     <!-- gap on either side of status bar notification icons -->
     <dimen name="status_bar_icon_padding">0dp</dimen>
+
+    <!-- The width of the view containing non-menu status bar icons -->
+    <dimen name="navigation_key_width">70dip</dimen>
+
+    <!-- The width of the view containing the menu status bar icon -->
+    <dimen name="navigation_menu_key_width">40dip</dimen>
 </resources>
 
diff --git a/packages/SystemUI/res/values-sw600dp/dimens.xml b/packages/SystemUI/res/values-sw600dp/dimens.xml
index f522285..ba1cdfa 100644
--- a/packages/SystemUI/res/values-sw600dp/dimens.xml
+++ b/packages/SystemUI/res/values-sw600dp/dimens.xml
@@ -67,4 +67,10 @@
 
     <!-- opacity at which Notification icons will be drawn in the status bar -->
     <item type="dimen" name="status_bar_icon_drawing_alpha">100%</item>
+
+    <!-- The width of the view containing non-menu status bar icons -->
+    <dimen name="navigation_key_width">80dip</dimen>
+
+    <!-- The width of the view containing the menu status bar icon -->
+    <dimen name="navigation_menu_key_width">40dip</dimen>
 </resources>
diff --git a/packages/SystemUI/res/values-sw720dp/dimens.xml b/packages/SystemUI/res/values-sw720dp/dimens.xml
index 6736c1a..b16b1e8 100644
--- a/packages/SystemUI/res/values-sw720dp/dimens.xml
+++ b/packages/SystemUI/res/values-sw720dp/dimens.xml
@@ -21,5 +21,11 @@
 
     <!-- opacity at which Notification icons will be drawn in the status bar -->
     <item type="dimen" name="status_bar_icon_drawing_alpha">100%</item>
+
+    <!-- The width of the view containing non-menu status bar icons -->
+    <dimen name="navigation_key_width">80dip</dimen>
+
+    <!-- The width of the view containing the menu status bar icon -->
+    <dimen name="navigation_menu_key_width">80dip</dimen>
 </resources>
 
diff --git a/packages/SystemUI/res/values/dimens.xml b/packages/SystemUI/res/values/dimens.xml
index 8fba86a..2c22e3c 100644
--- a/packages/SystemUI/res/values/dimens.xml
+++ b/packages/SystemUI/res/values/dimens.xml
@@ -91,4 +91,9 @@
     <!-- The padding on the global screenshot background image -->
     <dimen name="global_screenshot_bg_padding">20dp</dimen>
 
+    <!-- The width of the view containing non-menu status bar icons -->
+    <dimen name="navigation_key_width">80dip</dimen>
+
+    <!-- The width of the view containing the menu status bar icon -->
+    <dimen name="navigation_menu_key_width">40dip</dimen>
 </resources>
diff --git a/packages/SystemUI/src/com/android/systemui/recent/RecentsPanelView.java b/packages/SystemUI/src/com/android/systemui/recent/RecentsPanelView.java
index 8bfd711..4aec22c 100644
--- a/packages/SystemUI/src/com/android/systemui/recent/RecentsPanelView.java
+++ b/packages/SystemUI/src/com/android/systemui/recent/RecentsPanelView.java
@@ -68,10 +68,11 @@
     private View mRecentsScrim;
     private View mRecentsNoApps;
     private ViewGroup mRecentsContainer;
+    private StatusBarTouchProxy mStatusBarTouchProxy;
 
     private boolean mShowing;
     private Choreographer mChoreo;
-    private View mRecentsDismissButton;
+    OnRecentsPanelVisibilityChangedListener mVisibilityChangedListener;
 
     private RecentTasksLoader mRecentTasksLoader;
     private ArrayList<TaskDescription> mRecentTaskDescriptions;
@@ -81,8 +82,8 @@
     private int mThumbnailWidth;
     private boolean mFitThumbnailToXY;
 
-    public void setRecentTasksLoader(RecentTasksLoader loader) {
-        mRecentTasksLoader = loader;
+    public static interface OnRecentsPanelVisibilityChangedListener {
+        public void onRecentsPanelVisibilityChanged(boolean visible);
     }
 
     private final class OnLongClickDelegate implements View.OnLongClickListener {
@@ -171,15 +172,18 @@
         return super.onKeyUp(keyCode, event);
     }
 
-    public boolean isInContentArea(int x, int y) {
-        // use mRecentsContainer's exact bounds to determine horizontal position
-        final int l = mRecentsContainer.getLeft();
-        final int r = mRecentsContainer.getRight();
-        final int t = mRecentsContainer.getTop();
-        final int b = mRecentsContainer.getBottom();
+    private boolean pointInside(int x, int y, View v) {
+        final int l = v.getLeft();
+        final int r = v.getRight();
+        final int t = v.getTop();
+        final int b = v.getBottom();
         return x >= l && x < r && y >= t && y < b;
     }
 
+    public boolean isInContentArea(int x, int y) {
+        return pointInside(x, y, mRecentsContainer) || pointInside(x, y, mStatusBarTouchProxy);
+    }
+
     public void show(boolean show, boolean animate) {
         show(show, animate, null);
     }
@@ -278,7 +282,6 @@
     public void onAnimationStart(Animator animation) {
     }
 
-
     /**
      * We need to be aligned at the bottom.  LinearLayout can't do this, so instead,
      * let LinearLayout do all the hard work, and then shift everything down to the bottom.
@@ -312,6 +315,29 @@
 
     public void setBar(StatusBar bar) {
         mBar = bar;
+
+    }
+
+    public void setStatusBarView(View statusBarView) {
+        if (mStatusBarTouchProxy != null) {
+            mStatusBarTouchProxy.setStatusBar(statusBarView);
+        }
+    }
+
+    public void setRecentTasksLoader(RecentTasksLoader loader) {
+        mRecentTasksLoader = loader;
+    }
+
+    public void setOnVisibilityChangedListener(OnRecentsPanelVisibilityChangedListener l) {
+        mVisibilityChangedListener = l;
+
+    }
+
+    public void setVisibility(int visibility) {
+        if (mVisibilityChangedListener != null) {
+            mVisibilityChangedListener.onRecentsPanelVisibilityChanged(visibility == VISIBLE);
+        }
+        super.setVisibility(visibility);
     }
 
     public RecentsPanelView(Context context, AttributeSet attrs) {
@@ -335,6 +361,7 @@
         super.onFinishInflate();
         mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
         mRecentsContainer = (ViewGroup) findViewById(R.id.recents_container);
+        mStatusBarTouchProxy = (StatusBarTouchProxy) findViewById(R.id.status_bar_touch_proxy);
         mListAdapter = new TaskDescriptionAdapter(mContext);
         if (mRecentsContainer instanceof RecentsHorizontalScrollView){
             RecentsHorizontalScrollView scrollView
@@ -355,14 +382,6 @@
         mRecentsScrim = findViewById(R.id.recents_bg_protect);
         mRecentsNoApps = findViewById(R.id.recents_no_apps);
         mChoreo = new Choreographer(this, mRecentsScrim, mRecentsContainer, mRecentsNoApps, this);
-        mRecentsDismissButton = findViewById(R.id.recents_dismiss_button);
-        if (mRecentsDismissButton != null) {
-            mRecentsDismissButton.setOnClickListener(new OnClickListener() {
-                public void onClick(View v) {
-                    hide(true);
-                }
-            });
-        }
 
         // In order to save space, we make the background texture repeat in the Y direction
         if (mRecentsScrim != null && mRecentsScrim.getBackground() instanceof BitmapDrawable) {
diff --git a/packages/SystemUI/src/com/android/systemui/recent/StatusBarTouchProxy.java b/packages/SystemUI/src/com/android/systemui/recent/StatusBarTouchProxy.java
new file mode 100644
index 0000000..ded114f
--- /dev/null
+++ b/packages/SystemUI/src/com/android/systemui/recent/StatusBarTouchProxy.java
@@ -0,0 +1,40 @@
+/*
+ * Copyright (C) 2011 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.systemui.recent;
+
+import android.content.Context;
+import android.util.AttributeSet;
+import android.view.MotionEvent;
+import android.view.View;
+import android.widget.FrameLayout;
+
+public class StatusBarTouchProxy extends FrameLayout {
+
+    private View mStatusBar;
+
+    public StatusBarTouchProxy(Context context, AttributeSet attrs) {
+        super(context, attrs);
+    }
+
+    public void setStatusBar(View statusBar) {
+        mStatusBar = statusBar;
+    }
+
+    public boolean onTouchEvent (MotionEvent event) {
+        return mStatusBar.dispatchTouchEvent(event);
+    }
+}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/CommandQueue.java b/packages/SystemUI/src/com/android/systemui/statusbar/CommandQueue.java
index bf2d5e8..f8dfa8f 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/CommandQueue.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/CommandQueue.java
@@ -62,6 +62,8 @@
     
     private static final int MSG_TOGGLE_RECENT_APPS       = 11 << MSG_SHIFT;
 
+    private static final int MSG_SET_NAVIGATION_ICON_HINTS = 13 << MSG_SHIFT;
+
     private StatusBarIconList mList;
     private Callbacks mCallbacks;
     private Handler mHandler = new H();
@@ -90,6 +92,7 @@
         public void setImeWindowStatus(IBinder token, int vis, int backDisposition);
         public void setHardKeyboardStatus(boolean available, boolean enabled);
         public void toggleRecentApps();
+        public void setNavigationIconHints(int hints);
     }
 
     public CommandQueue(Callbacks callbacks, StatusBarIconList list) {
@@ -196,6 +199,13 @@
         }
     }
 
+    public void setNavigationIconHints(int hints) {
+        synchronized (mList) {
+            mHandler.removeMessages(MSG_SET_NAVIGATION_ICON_HINTS);
+            mHandler.obtainMessage(MSG_SET_NAVIGATION_ICON_HINTS, hints, 0, null).sendToTarget();
+        }
+    }
+
     private final class H extends Handler {
         public void handleMessage(Message msg) {
             final int what = msg.what & MSG_MASK;
@@ -265,6 +275,9 @@
                 case MSG_TOGGLE_RECENT_APPS:
                     mCallbacks.toggleRecentApps();
                     break;
+                case MSG_SET_NAVIGATION_ICON_HINTS:
+                    mCallbacks.setNavigationIconHints(msg.arg1);
+                    break;
             }
         }
     }
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarView.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarView.java
index 005d12f..6574c7d 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarView.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarView.java
@@ -18,6 +18,8 @@
 
 import android.animation.Animator;
 import android.animation.AnimatorListenerAdapter;
+import android.animation.ObjectAnimator;
+import android.app.StatusBarManager;
 import android.content.Context;
 import android.content.res.Resources;
 import android.graphics.Rect;
@@ -33,6 +35,7 @@
 import android.view.ViewGroup;
 import android.view.Surface;
 import android.view.WindowManager;
+import android.widget.ImageView;
 import android.widget.LinearLayout;
 
 import java.io.FileDescriptor;
@@ -63,6 +66,7 @@
 
     boolean mHidden, mLowProfile, mShowMenu;
     int mDisabledFlags = 0;
+    int mNavigationIconHints = 0;
 
     // workaround for LayoutTransitions leaving the nav buttons in a weird state (bug 5549288)
     final static boolean WORKAROUND_INVALID_LAYOUT = true;
@@ -143,6 +147,34 @@
         }
     };
 
+    public void setNavigationIconHints(int hints) {
+        setNavigationIconHints(hints, false);
+    }
+
+    public void setNavigationIconHints(int hints, boolean force) {
+        if (!force && hints == mNavigationIconHints) return;
+
+        if (DEBUG) {
+            android.widget.Toast.makeText(mContext,
+                "Navigation icon hints = " + hints,
+                500).show();
+        }
+
+        mNavigationIconHints = hints;
+
+        getBackButton().setAlpha(
+            (0 != (hints & StatusBarManager.NAVIGATION_HINT_BACK_NOP)) ? 0.5f : 1.0f);
+        getHomeButton().setAlpha(
+            (0 != (hints & StatusBarManager.NAVIGATION_HINT_HOME_NOP)) ? 0.5f : 1.0f);
+        getRecentsButton().setAlpha(
+            (0 != (hints & StatusBarManager.NAVIGATION_HINT_RECENT_NOP)) ? 0.5f : 1.0f);
+
+        ((ImageView)getBackButton()).setImageResource(
+            (0 != (hints & StatusBarManager.NAVIGATION_HINT_BACK_ALT))
+                ? R.drawable.ic_sysbar_back_ime
+                : R.drawable.ic_sysbar_back);
+    }
+
     public void setDisabledFlags(int disabledFlags) {
         setDisabledFlags(disabledFlags, false);
     }
@@ -272,6 +304,8 @@
         if (DEBUG) {
             Slog.d(TAG, "reorient(): rot=" + mDisplay.getRotation());
         }
+
+        setNavigationIconHints(mNavigationIconHints, true);
     }
 
     @Override
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
index 3c9d12c..5a1e3f4 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
@@ -32,6 +32,7 @@
 import android.content.pm.PackageManager.NameNotFoundException;
 import android.content.res.Resources;
 import android.content.res.Configuration;
+import android.inputmethodservice.InputMethodService;
 import android.graphics.PixelFormat;
 import android.graphics.Rect;
 import android.graphics.drawable.Drawable;
@@ -229,6 +230,8 @@
 
     DisplayMetrics mDisplayMetrics = new DisplayMetrics();
 
+    private int mNavigationIconHints = 0;
+
     private class ExpandedDialog extends Dialog {
         ExpandedDialog(Context context) {
             super(context, com.android.internal.R.style.Theme_Translucent_NoTitleBar);
@@ -1541,6 +1544,17 @@
     }
 
     @Override // CommandQueue
+    public void setNavigationIconHints(int hints) {
+        if (hints == mNavigationIconHints) return;
+
+        mNavigationIconHints = hints;
+
+        if (mNavigationBarView != null) {
+            mNavigationBarView.setNavigationIconHints(hints);
+        }
+    }
+
+    @Override // CommandQueue
     public void setSystemUiVisibility(int vis) {
         final int old = mSystemUiVisibility;
         final int diff = vis ^ old;
@@ -1590,8 +1604,16 @@
         if (showMenu) setLightsOn(true);
     }
 
-    // Not supported
-    public void setImeWindowStatus(IBinder token, int vis, int backDisposition) { }
+    @Override
+    public void setImeWindowStatus(IBinder token, int vis, int backDisposition) {
+        boolean altBack = (backDisposition == InputMethodService.BACK_DISPOSITION_WILL_DISMISS)
+            || ((vis & InputMethodService.IME_VISIBLE) != 0);
+
+        mCommandQueue.setNavigationIconHints(
+                altBack ? (mNavigationIconHints | StatusBarManager.NAVIGATION_HINT_BACK_ALT)
+                        : (mNavigationIconHints & ~StatusBarManager.NAVIGATION_HINT_BACK_ALT));
+    }
+
     @Override
     public void setHardKeyboardStatus(boolean available, boolean enabled) { }
 
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBar.java
index 6913239..09e38ff 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBar.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBar.java
@@ -88,7 +88,8 @@
 
 public class TabletStatusBar extends StatusBar implements
         HeightReceiver.OnBarHeightChangedListener,
-        InputMethodsPanel.OnHardKeyboardEnabledChangeListener {
+        InputMethodsPanel.OnHardKeyboardEnabledChangeListener,
+        RecentsPanelView.OnRecentsPanelVisibilityChangedListener {
     public static final boolean DEBUG = false;
     public static final boolean DEBUG_COMPAT_HELP = false;
     public static final String TAG = "TabletStatusBar";
@@ -121,6 +122,8 @@
     int mNaturalBarHeight = -1;
     int mIconSize = -1;
     int mIconHPadding = -1;
+    int mNavIconWidth = -1;
+    int mMenuNavIconWidth = -1;
     private int mMaxNotificationIcons = 5;
 
     H mHandler = new H();
@@ -143,6 +146,7 @@
     View mHomeButton;
     View mMenuButton;
     View mRecentButton;
+    private boolean mAltBackButtonEnabledForIme;
 
     ViewGroup mFeedbackIconArea; // notification icons, IME icon, compat icon
     InputMethodButton mInputMethodSwitchButton;
@@ -193,6 +197,8 @@
     // used to notify status bar for suppressing notification LED
     private boolean mPanelSlightlyVisible;
 
+    private int mNavigationIconHints = 0;
+
     public Context getContext() { return mContext; }
 
     protected void addPanelWindows() {
@@ -305,12 +311,11 @@
         mRecentsPanel = (RecentsPanelView) View.inflate(context,
                 R.layout.status_bar_recent_panel, null);
         mRecentsPanel.setVisibility(View.GONE);
-        mRecentsPanel.setSystemUiVisibility(View.STATUS_BAR_DISABLE_BACK);
         mRecentsPanel.setOnTouchListener(new TouchOutsideListener(MSG_CLOSE_RECENTS_PANEL,
                 mRecentsPanel));
+        mRecentsPanel.setOnVisibilityChangedListener(this);
         mRecentsPanel.setRecentTasksLoader(mRecentTasksLoader);
         mRecentTasksLoader.setRecentsPanel(mRecentsPanel);
-        mStatusBarView.setIgnoreChildren(2, mRecentButton, mRecentsPanel);
 
         lp = new WindowManager.LayoutParams(
                 (int) res.getDimension(R.dimen.status_bar_recents_width),
@@ -329,6 +334,7 @@
 
         WindowManagerImpl.getDefault().addView(mRecentsPanel, lp);
         mRecentsPanel.setBar(this);
+        mRecentsPanel.setStatusBarView(mStatusBarView);
 
         // Input methods Panel
         mInputMethodsPanel = (InputMethodsPanel) View.inflate(context,
@@ -337,7 +343,7 @@
         mInputMethodsPanel.setOnTouchListener(new TouchOutsideListener(
                 MSG_CLOSE_INPUT_METHODS_PANEL, mInputMethodsPanel));
         mInputMethodsPanel.setImeSwitchButton(mInputMethodSwitchButton);
-        mStatusBarView.setIgnoreChildren(3, mInputMethodSwitchButton, mInputMethodsPanel);
+        mStatusBarView.setIgnoreChildren(2, mInputMethodSwitchButton, mInputMethodsPanel);
         lp = new WindowManager.LayoutParams(
                 ViewGroup.LayoutParams.WRAP_CONTENT,
                 ViewGroup.LayoutParams.WRAP_CONTENT,
@@ -360,7 +366,7 @@
                 MSG_CLOSE_COMPAT_MODE_PANEL, mCompatModePanel));
         mCompatModePanel.setTrigger(mCompatModeButton);
         mCompatModePanel.setVisibility(View.GONE);
-        mStatusBarView.setIgnoreChildren(4, mCompatModeButton, mCompatModePanel);
+        mStatusBarView.setIgnoreChildren(3, mCompatModeButton, mCompatModePanel);
         lp = new WindowManager.LayoutParams(
                 250,
                 ViewGroup.LayoutParams.WRAP_CONTENT,
@@ -410,6 +416,26 @@
             com.android.internal.R.dimen.system_bar_icon_size);
         int newIconHPadding = res.getDimensionPixelSize(
             R.dimen.status_bar_icon_padding);
+        int newNavIconWidth = res.getDimensionPixelSize(R.dimen.navigation_key_width);
+        int newMenuNavIconWidth = res.getDimensionPixelSize(R.dimen.navigation_menu_key_width);
+
+        if (mNavigationArea != null && newNavIconWidth != mNavIconWidth) {
+            mNavIconWidth = newNavIconWidth;
+
+            LinearLayout.LayoutParams lp = new LinearLayout.LayoutParams(
+                     mNavIconWidth, ViewGroup.LayoutParams.MATCH_PARENT);
+            mBackButton.setLayoutParams(lp);
+            mHomeButton.setLayoutParams(lp);
+            mRecentButton.setLayoutParams(lp);
+        }
+
+        if (mNavigationArea != null && newMenuNavIconWidth != mMenuNavIconWidth) {
+            mMenuNavIconWidth = newMenuNavIconWidth;
+
+            LinearLayout.LayoutParams lp = new LinearLayout.LayoutParams(
+                     mMenuNavIconWidth, ViewGroup.LayoutParams.MATCH_PARENT);
+            mMenuButton.setLayoutParams(lp);
+        }
 
         if (newIconHPadding != mIconHPadding || newIconSize != mIconSize) {
 //            Slog.d(TAG, "size=" + newIconSize + " padding=" + newIconHPadding);
@@ -426,6 +452,10 @@
         }
     }
 
+    public View getStatusBarView() {
+        return mStatusBarView;
+    }
+
     protected View makeStatusBarView() {
         final Context context = mContext;
 
@@ -1087,6 +1117,31 @@
         }
     }
 
+    @Override // CommandQueue
+    public void setNavigationIconHints(int hints) {
+        if (hints == mNavigationIconHints) return;
+
+        if (DEBUG) {
+            android.widget.Toast.makeText(mContext,
+                "Navigation icon hints = " + hints,
+                500).show();
+        }
+
+        mNavigationIconHints = hints;
+
+        mBackButton.setAlpha(
+            (0 != (hints & StatusBarManager.NAVIGATION_HINT_BACK_NOP)) ? 0.5f : 1.0f);
+        mHomeButton.setAlpha(
+            (0 != (hints & StatusBarManager.NAVIGATION_HINT_HOME_NOP)) ? 0.5f : 1.0f);
+        mRecentButton.setAlpha(
+            (0 != (hints & StatusBarManager.NAVIGATION_HINT_RECENT_NOP)) ? 0.5f : 1.0f);
+
+        mBackButton.setImageResource(
+            (0 != (hints & StatusBarManager.NAVIGATION_HINT_BACK_ALT))
+                ? R.drawable.ic_sysbar_back_ime
+                : R.drawable.ic_sysbar_back);
+    }
+
     private void notifyUiVisibilityChanged() {
         try {
             mWindowManager.statusBarVisibilityChanged(mSystemUiVisibility);
@@ -1190,24 +1245,15 @@
                 (vis & InputMethodService.IME_ACTIVE) != 0);
         updateNotificationIcons();
         mInputMethodsPanel.setImeToken(token);
-        int res;
-        switch (backDisposition) {
-            case InputMethodService.BACK_DISPOSITION_WILL_NOT_DISMISS:
-                res = R.drawable.ic_sysbar_back;
-                break;
-            case InputMethodService.BACK_DISPOSITION_WILL_DISMISS:
-                res = R.drawable.ic_sysbar_back_ime;
-                break;
-            case InputMethodService.BACK_DISPOSITION_DEFAULT:
-            default:
-                if ((vis & InputMethodService.IME_VISIBLE) != 0) {
-                    res = R.drawable.ic_sysbar_back_ime;
-                } else {
-                    res = R.drawable.ic_sysbar_back;
-                }
-                break;
-        }
-        mBackButton.setImageResource(res);
+
+        boolean altBack = (backDisposition == InputMethodService.BACK_DISPOSITION_WILL_DISMISS)
+            || ((vis & InputMethodService.IME_VISIBLE) != 0);
+        mAltBackButtonEnabledForIme = altBack;
+
+        mCommandQueue.setNavigationIconHints(
+                altBack ? (mNavigationIconHints | StatusBarManager.NAVIGATION_HINT_BACK_ALT)
+                        : (mNavigationIconHints & ~StatusBarManager.NAVIGATION_HINT_BACK_ALT));
+
         if (FAKE_SPACE_BAR) {
             mFakeSpaceBar.setVisibility(((vis & InputMethodService.IME_VISIBLE) != 0)
                     ? View.VISIBLE : View.GONE);
@@ -1215,6 +1261,14 @@
     }
 
     @Override
+    public void onRecentsPanelVisibilityChanged(boolean visible) {
+        boolean altBack = visible || mAltBackButtonEnabledForIme;
+        mCommandQueue.setNavigationIconHints(
+                altBack ? (mNavigationIconHints | StatusBarManager.NAVIGATION_HINT_BACK_ALT)
+                        : (mNavigationIconHints & ~StatusBarManager.NAVIGATION_HINT_BACK_ALT));
+    }
+
+    @Override
     public void setHardKeyboardStatus(boolean available, boolean enabled) {
         if (DEBUG) {
             Slog.d(TAG, "Set hard keyboard status: available=" + available
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBarView.java b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBarView.java
index 7d11251..877a40e 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBarView.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBarView.java
@@ -46,10 +46,11 @@
             if (TabletStatusBar.DEBUG) {
                 Slog.d(TabletStatusBar.TAG, "TabletStatusBarView intercepting touch event: " + ev);
             }
+            // do not close the recents panel here- the intended behavior is that recents is dismissed
+            // on touch up when clicking on status bar buttons
+            // TODO: should we be closing the notification panel and input methods panel?
             mHandler.removeMessages(TabletStatusBar.MSG_CLOSE_NOTIFICATION_PANEL);
             mHandler.sendEmptyMessage(TabletStatusBar.MSG_CLOSE_NOTIFICATION_PANEL);
-            mHandler.removeMessages(TabletStatusBar.MSG_CLOSE_RECENTS_PANEL);
-            mHandler.sendEmptyMessage(TabletStatusBar.MSG_CLOSE_RECENTS_PANEL);
             mHandler.removeMessages(TabletStatusBar.MSG_CLOSE_INPUT_METHODS_PANEL);
             mHandler.sendEmptyMessage(TabletStatusBar.MSG_CLOSE_INPUT_METHODS_PANEL);
             mHandler.removeMessages(TabletStatusBar.MSG_STOP_TICKER);
diff --git a/services/audioflinger/AudioFlinger.cpp b/services/audioflinger/AudioFlinger.cpp
index ce701ca..05d6d72 100644
--- a/services/audioflinger/AudioFlinger.cpp
+++ b/services/audioflinger/AudioFlinger.cpp
@@ -794,7 +794,8 @@
             // indicate output device change to all input threads for pre processing
             AudioParameter param = AudioParameter(keyValuePairs);
             int value;
-            if (param.getInt(String8(AudioParameter::keyRouting), value) == NO_ERROR) {
+            if ((param.getInt(String8(AudioParameter::keyRouting), value) == NO_ERROR) &&
+                    (value != 0)) {
                 for (size_t i = 0; i < mRecordThreads.size(); i++) {
                     mRecordThreads.valueAt(i)->setParameters(keyValuePairs);
                 }