Merge "Don't assume a default of 'false' for TwoStatePreference" into jb-mr1-dev
diff --git a/core/java/android/os/storage/StorageManager.java b/core/java/android/os/storage/StorageManager.java
index cb6c1dc..8a20a6e 100644
--- a/core/java/android/os/storage/StorageManager.java
+++ b/core/java/android/os/storage/StorageManager.java
@@ -56,7 +56,7 @@
     /*
      * Our internal MountService binder reference
      */
-    private IMountService mMountService;
+    final private IMountService mMountService;
 
     /*
      * The looper target for callbacks
@@ -304,8 +304,6 @@
             return;
         }
         mTgtLooper = tgtLooper;
-        mBinderListener = new MountServiceBinderListener();
-        mMountService.registerListener(mBinderListener);
     }
 
 
@@ -322,6 +320,15 @@
         }
 
         synchronized (mListeners) {
+            if (mBinderListener == null ) {
+                try {
+                    mBinderListener = new MountServiceBinderListener();
+                    mMountService.registerListener(mBinderListener);
+                } catch (RemoteException rex) {
+                    Log.e(TAG, "Register mBinderListener failed");
+                    return;
+                }
+            }
             mListeners.add(new ListenerDelegate(listener));
         }
     }
@@ -347,7 +354,15 @@
                     break;
                 }
             }
-        }
+            if (mListeners.size() == 0 && mBinderListener != null) {
+                try {
+                    mMountService.unregisterListener(mBinderListener);
+                } catch (RemoteException rex) {
+                    Log.e(TAG, "Unregister mBinderListener failed");
+                    return;
+                }
+            }
+       }
     }
 
     /**
diff --git a/core/res/res/values/styles.xml b/core/res/res/values/styles.xml
index a6236f7..74e2425 100644
--- a/core/res/res/values/styles.xml
+++ b/core/res/res/values/styles.xml
@@ -1259,7 +1259,7 @@
     </style>
 
     <style name="TextAppearance.Holo.Small.Inverse">
-        <item name="android:textColor">?textColorPrimaryInverse</item>
+        <item name="android:textColor">?textColorSecondaryInverse</item>
         <item name="android:textColorHint">?textColorHintInverse</item>
         <item name="android:textColorHighlight">?textColorHighlightInverse</item>
         <item name="android:textColorLink">?textColorLinkInverse</item>
@@ -1392,6 +1392,13 @@
     </style>
 
     <style name="TextAppearance.Holo.Widget.Switch" parent="TextAppearance.Holo.Small">
+        <!-- Switch thumb asset presents a dark background. -->
+        <item name="android:textColor">@android:color/secondary_text_holo_dark</item>
+    </style>
+
+    <style name="TextAppearance.Holo.Light.Widget.Switch" parent="TextAppearance.Holo.Small">
+        <!-- Switch thumb asset presents a dark background. -->
+        <item name="android:textColor">@android:color/primary_text_holo_dark</item>
     </style>
 
     <style name="TextAppearance.Holo.WindowTitle">
@@ -2317,7 +2324,7 @@
     <style name="Widget.Holo.Light.CompoundButton.Switch" parent="Widget.CompoundButton.Switch">
         <item name="android:track">@android:drawable/switch_track_holo_light</item>
         <item name="android:thumb">@android:drawable/switch_inner_holo_light</item>
-        <item name="android:switchTextAppearance">@android:style/TextAppearance.Holo.Widget.Switch</item>
+        <item name="android:switchTextAppearance">@android:style/TextAppearance.Holo.Light.Widget.Switch</item>
         <item name="android:textOn">@android:string/capital_on</item>
         <item name="android:textOff">@android:string/capital_off</item>
         <item name="android:thumbTextPadding">12dip</item>
diff --git a/docs/html/guide/components/bound-services.jd b/docs/html/guide/components/bound-services.jd
index 43e6e5e..8d2bba5 100644
--- a/docs/html/guide/components/bound-services.jd
+++ b/docs/html/guide/components/bound-services.jd
@@ -640,12 +640,6 @@
 
 <h2 id="Lifecycle">Managing the Lifecycle of a Bound Service</h2>
 
-<div class="figure" style="width:588px">
-<img src="{@docRoot}images/fundamentals/service_binding_tree_lifecycle.png" alt="" />
-<p class="img-caption"><strong>Figure 1.</strong> The lifecycle for a service that is started
-and also allows binding.</p>
-</div>
-
 <p>When a service is unbound from all clients, the Android system destroys it (unless it was also
 started with {@link android.app.Service#onStartCommand onStartCommand()}). As such, you don't have
 to manage the lifecycle of your service if it's purely a bound
@@ -667,6 +661,12 @@
 {@link android.content.ServiceConnection#onServiceConnected onServiceConnected()} callback.
 Below, figure 1 illustrates the logic for this kind of lifecycle.</p>
 
+
+<img src="{@docRoot}images/fundamentals/service_binding_tree_lifecycle.png" alt="" />
+<p class="img-caption"><strong>Figure 1.</strong> The lifecycle for a service that is started
+and also allows binding.</p>
+
+
 <p>For more information about the lifecycle of an started service, see the <a
 href="{@docRoot}guide/components/services.html#Lifecycle">Services</a> document.</p>
 
diff --git a/docs/html/guide/components/services.jd b/docs/html/guide/components/services.jd
index b89914a..6e5dfd2 100644
--- a/docs/html/guide/components/services.jd
+++ b/docs/html/guide/components/services.jd
@@ -755,15 +755,6 @@
 changes in the service's state and perform work at the appropriate times. The following skeleton
 service demonstrates each of the lifecycle methods:</p>
 
-
-<div class="figure" style="width:432px">
-<img src="{@docRoot}images/service_lifecycle.png" alt="" />
-<p class="img-caption"><strong>Figure 2.</strong> The service lifecycle. The diagram on the left
-shows the lifecycle when the service is created with {@link android.content.Context#startService
-startService()} and the diagram on the right shows the lifecycle when the service is created
-with {@link android.content.Context#bindService bindService()}.</p>
-</div>
-
 <pre>
 public class ExampleService extends Service {
     int mStartMode;       // indicates how to behave if the service is killed
@@ -804,6 +795,12 @@
 <p class="note"><strong>Note:</strong> Unlike the activity lifecycle callback methods, you are
 <em>not</em> required to call the superclass implementation of these callback methods.</p>
 
+<img src="{@docRoot}images/service_lifecycle.png" alt="" />
+<p class="img-caption"><strong>Figure 2.</strong> The service lifecycle. The diagram on the left
+shows the lifecycle when the service is created with {@link android.content.Context#startService
+startService()} and the diagram on the right shows the lifecycle when the service is created
+with {@link android.content.Context#bindService bindService()}.</p>
+
 <p>By implementing these methods, you can monitor two nested loops of the service's lifecycle: </p>
 
 <ul>
diff --git a/docs/html/guide/webapps/targeting.jd b/docs/html/guide/webapps/targeting.jd
index 46f769c..7410202 100644
--- a/docs/html/guide/webapps/targeting.jd
+++ b/docs/html/guide/webapps/targeting.jd
@@ -270,7 +270,7 @@
 
 <p>The density of a device's screen is based on the screen resolution, as defined by the number of
 dots per inch (dpi). There are three screen
-density categories supported by Android: low (ldpi), medium (mdpi), and high (mdpi). A screen
+density categories supported by Android: low (ldpi), medium (mdpi), and high (hdpi). A screen
 with low density has fewer available pixels per inch, whereas a screen with high density has more
 pixels per inch (compared to a medium density screen). The Android Browser and {@link
 android.webkit.WebView} target a medium density screen by default.</p>
diff --git a/docs/html/sdk/index.jd b/docs/html/sdk/index.jd
index df97855..cf85a34 100644
--- a/docs/html/sdk/index.jd
+++ b/docs/html/sdk/index.jd
@@ -2,21 +2,21 @@
 header.hide=1
 page.metaDescription=Download the official Android SDK to develop apps for Android-powered devices.
 
-sdk.win_installer=installer_r20.0.1-windows.exe
-sdk.win_installer_bytes=70486979
-sdk.win_installer_checksum=a8df28a29c7b8598e4c50f363692256d
+sdk.win_installer=installer_r20.0.3-windows.exe
+sdk.win_installer_bytes=70495456
+sdk.win_installer_checksum=cf23b95d0c9cd57fac3c3be253171af4
 
-sdk.win_download=android-sdk_r20.0.1-windows.zip
-sdk.win_bytes=90370975
-sdk.win_checksum=5774f536892036f87d3bf6502862cea5
+sdk.win_download=android-sdk_r20.0.3-windows.zip
+sdk.win_bytes=90379469
+sdk.win_checksum=cd895c79201f7f02507eb3c3868a1c5e
 
-sdk.mac_download=android-sdk_r20.0.1-macosx.zip
-sdk.mac_bytes=58217336
-sdk.mac_checksum=cc132d04bc551b23b0c507cf5943df57
+sdk.mac_download=android-sdk_r20.0.3-macosx.zip
+sdk.mac_bytes=58218455
+sdk.mac_checksum=07dc88ba2c0817ef178a665d002831bf
 
-sdk.linux_download=android-sdk_r20.0.1-linux.tgz
-sdk.linux_bytes=82607616
-sdk.linux_checksum=cd7176831087f53e46123dd91551be32
+sdk.linux_download=android-sdk_r20.0.3-linux.tgz
+sdk.linux_bytes=82616305
+sdk.linux_checksum=0d53c2c31d6b5d0cf7385bccd0b06c27
 
 @jd:body
 
@@ -141,3 +141,4 @@
     $('.reqs').show();
   }
 </script>
+
diff --git a/docs/html/sdk/installing/installing-adt.jd b/docs/html/sdk/installing/installing-adt.jd
index 414b97b..4fc2ca6 100644
--- a/docs/html/sdk/installing/installing-adt.jd
+++ b/docs/html/sdk/installing/installing-adt.jd
@@ -1,9 +1,9 @@
 page.title=Installing the Eclipse Plugin
 walkthru=1
-adt.zip.version=20.0.2
-adt.zip.download=ADT-20.0.2.zip
-adt.zip.bytes=12388464
-adt.zip.checksum=8e727bcdc9789c900784a82e6330ec22
+adt.zip.version=20.0.3
+adt.zip.download=ADT-20.0.3.zip
+adt.zip.bytes=12390954
+adt.zip.checksum=869a536b1c56d0cd920ed9ae259ae619
 
 @jd:body
 
@@ -11,7 +11,7 @@
 
 <p>Android offers a custom plugin for the Eclipse IDE, called Android
 Development Tools (ADT). This plugin is designed to give you a powerful, integrated
-environment in which to develop Android apps. It extends the capabilites
+environment in which to develop Android apps. It extends the capabilities
 of Eclipse to let you quickly set up new Android projects, build an app
 UI, debug your app, and export signed (or unsigned) app packages (APKs) for distribution.
 </p>
@@ -39,21 +39,21 @@
 
 <ol>
     <li>Start Eclipse, then select <strong>Help</strong> &gt; <strong>Install New
-Software...</strong>.</li>
+Software</strong>.</li>
     <li>Click <strong>Add</strong>, in the top-right corner.</li>
     <li>In the Add Repository dialog that appears, enter "ADT Plugin" for the <em>Name</em> and the
 following URL for the <em>Location</em>:
       <pre>https://dl-ssl.google.com/android/eclipse/</pre>
     </li>
-    <li>Click <strong>OK</strong>
-      <p>Note: If you have trouble acquiring the plugin, try using "http" in the Location URL,
+    <li>Click <strong>OK</strong>.
+      <p>If you have trouble acquiring the plugin, try using "http" in the Location URL,
 instead of "https" (https is preferred for security reasons).</p></li>
     <li>In the Available Software dialog, select the checkbox next to Developer Tools and click
 <strong>Next</strong>.</li>
     <li>In the next window, you'll see a list of the tools to be downloaded. Click
 <strong>Next</strong>. </li>
     <li>Read and accept the license agreements, then click <strong>Finish</strong>.
-      <p>Note: If you get a security warning saying that the authenticity or validity of
+      <p>If you get a security warning saying that the authenticity or validity of
 the software can't be established, click <strong>OK</strong>.</p></li>
     <li>When the installation completes, restart Eclipse. </li>
 </ol>
@@ -148,17 +148,15 @@
 manually install it:</p>
 
 <ol>
-  <li>Download the current ADT Plugin zip file from the table below (do not unpack it).
+  <li>Download the ADT Plugin zip file (do not unpack it):
 
   <table class="download">
     <tr>
-      <th>Name</th>
       <th>Package</th>
       <th>Size</th>
       <th>MD5 Checksum</th>
   </tr>
   <tr>
-    <td>ADT {@adtZipVersion}</td>
     <td>
       <a href="http://dl.google.com/android/{@adtZipDownload}">{@adtZipDownload}</a>
     </td>
@@ -169,16 +167,20 @@
 </li>
 
 </li>
-  <li>Follow steps 1 and 2 in the <a href="#installing">default install
-      instructions</a> (above).</li>
-  <li>In the Add Site dialog, click <strong>Archive</strong>.</li>
-  <li>Browse and select the downloaded zip file.</li>
-  <li>Enter a name for the local update site (e.g.,
-      "Android Plugin") in the "Name" field.</li>
-  <li>Click <strong>OK</strong>.
-  <li>Follow the remaining procedures as listed for
-      <a href="#installing">default installation</a> above,
-      starting from step 4.</li>
+  <li>Start Eclipse, then select <strong>Help</strong> &gt; <strong>Install New
+Software</strong>.</li>
+  <li>Click <strong>Add</strong>, in the top-right corner.</li>
+  <li>In the Add Repository dialog, click <strong>Archive</strong>.</li>
+  <li>Select the downloaded {@adtZipDownload} file and click <strong>OK</strong>.</li>
+  <li>Enter "ADT Plugin" for the name and click <strong>OK</strong>.
+  <li>In the Available Software dialog, select the checkbox next to Developer Tools and click
+<strong>Next</strong>.</li>
+  <li>In the next window, you'll see a list of the tools to be downloaded. Click
+<strong>Next</strong>. </li>
+  <li>Read and accept the license agreements, then click <strong>Finish</strong>.
+    <p>If you get a security warning saying that the authenticity or validity of
+the software can't be established, click <strong>OK</strong>.</p></li>
+  <li>When the installation completes, restart Eclipse. </li>
 </ol>
 
 <p>To update your plugin once you've installed using the zip file, you will have
@@ -204,3 +206,4 @@
 ...then your development machine lacks a suitable Java VM. Installing Sun
 Java 6 will resolve this issue and you can then reinstall the ADT
 Plugin.</p>
+
diff --git a/docs/html/tools/extras/support-library.jd b/docs/html/tools/extras/support-library.jd
index 869a15b..b1e2ea0 100644
--- a/docs/html/tools/extras/support-library.jd
+++ b/docs/html/tools/extras/support-library.jd
@@ -90,6 +90,24 @@
 <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"
+/>Support Package, revision 10</a> <em>(August 2012)</em>
+  <div class="toggleme">
+    <dl>
+      <dt>Changes for v4 support library:</dt>
+      <dd>
+        <ul>
+          <li>Added support for notification features introduced in Android 4.1 (API Level 16) with
+          additions to {@link android.support.v4.app.NotificationCompat}.</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"
 />Support Package, revision 9</a> <em>(June 2012)</em>
   <div class="toggleme">
     <dl>
@@ -589,3 +607,4 @@
 <p>Additionally, the <a href="http://code.google.com/p/iosched/">Google I/O App</a> is a complete
 application that uses the v4 support library to provide a single APK for both handsets and tablets
 and also demonstrates some of Android's best practices in Android UI design.</p>
+
diff --git a/docs/html/tools/help/adb.jd b/docs/html/tools/help/adb.jd
index 4e75f2e..d44d54b 100644
--- a/docs/html/tools/help/adb.jd
+++ b/docs/html/tools/help/adb.jd
@@ -88,13 +88,14 @@
 	<li>Serial number &mdash; A string created by adb to uniquely identify an emulator/device instance by its 
         console port number. The format of the serial number is <code>&lt;type&gt;-&lt;consolePort&gt;</code>. 
         Here's an example serial number: <code>emulator-5554</code></li>
-	<li>State &mdash; The connection state of the instance. Three states are supported: 
+	<li>State &mdash; The connection state of the instance may be one of the following:
 		<ul>
 		<li><code>offline</code> &mdash; the instance is not connected to adb or is not responding.</li>
 		<li><code>device</code> &mdash; the instance is now connected to the adb server. Note that this state does not 
                     imply that the Android system is fully booted and operational, since the instance connects to adb 
                     while the system is still booting. However, after boot-up, this is the normal operational state of 
                     an emulator/device instance.</li>
+                <li><code>no device</code> &mdash; there is no emulator/device connected.
 		</ul>
 	</li>
 </ul>
@@ -111,7 +112,6 @@
 emulator-5556&nbsp;&nbsp;device
 emulator-5558&nbsp;&nbsp;device</pre>
 
-<p>If there is no emulator/device running, adb returns <code>no device</code>.</p>
 
 
 <a name="directingcommands"></a>
diff --git a/docs/html/tools/sdk/eclipse-adt.jd b/docs/html/tools/sdk/eclipse-adt.jd
index bdb4a9e..10c622b 100644
--- a/docs/html/tools/sdk/eclipse-adt.jd
+++ b/docs/html/tools/sdk/eclipse-adt.jd
@@ -97,6 +97,39 @@
   <a href="#" onclick="return toggleDiv(this)">
   <img src="{@docRoot}assets/images/triangle-opened.png" class="toggle-img" height="9px"
     width="9px"/>
+ADT 20.0.3</a> <em>(August 2012)</em>
+  <div class="toggleme">
+<dl>
+  <dt>Dependencies:</dt>
+
+  <dd>
+    <ul>
+      <li>Java 1.6 or higher is required for ADT 20.0.3.</li>
+      <li>Eclipse Helios (Version 3.6.2) or higher is required for ADT 20.0.3.</li>
+      <li>ADT 20.0.3 is designed for use with <a href="{@docRoot}tools/sdk/tools-notes.html">SDK
+      Tools r20.0.3</a>. If you haven't already installed SDK Tools r20.0.3 into your SDK, use the
+      Android SDK Manager to do so.</li>
+    </ul>
+  </dd>
+
+  <dt>Bug fixes:</dt>
+  <dd>
+    <ul>
+      <li>Fixed issue with keyboard shortcuts for editors in Eclipse Juno (Version 4.x).</li>
+      <li>Fixed problem with cached download lists in SDK Manager.</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 20.0.2</a> <em>(July 2012)</em>
   <div class="toggleme">
 <dl>
diff --git a/docs/html/tools/sdk/tools-notes.jd b/docs/html/tools/sdk/tools-notes.jd
index 039c4b5..f8b5d25 100644
--- a/docs/html/tools/sdk/tools-notes.jd
+++ b/docs/html/tools/sdk/tools-notes.jd
@@ -28,6 +28,37 @@
 <div class="toggle-content opened">
   <p><a href="#" onclick="return toggleContent(this)">
     <img src="{@docRoot}assets/images/triangle-opened.png" class="toggle-content-img"
+      alt=""/>SDK Tools, Revision 20.0.3</a> <em>(August 2012)</em>
+  </p>
+
+  <div class="toggle-content-toggleme">
+
+    <dl>
+    <dt>Dependencies:</dt>
+    <dd>
+      <ul>
+        <li>Android SDK Platform-tools revision 12 or later.</li>
+        <li>If you are developing in Eclipse with ADT, note that the SDK Tools r20.0.3 is designed
+        for use with ADT 20.0.3 and later. If you haven't already, update your
+        <a href="{@docRoot}tools/sdk/eclipse-adt.html">ADT Plugin</a> to 20.0.3.</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>Bug fixes:</dt>
+    <dd>
+      <ul>
+        <li>Fixed problem with cached download lists in SDK Manager.</li>
+      </ul>
+    </dd>
+    </dl>
+  </div>
+</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"
       alt=""/>SDK Tools, Revision 20.0.1</a> <em>(July 2012)</em>
   </p>
 
@@ -942,3 +973,4 @@
 </dl>
  </div>
 </div>
+
diff --git a/docs/html/training/accessibility/service.jd b/docs/html/training/accessibility/service.jd
index 80ecbc7..373ddbb 100644
--- a/docs/html/training/accessibility/service.jd
+++ b/docs/html/training/accessibility/service.jd
@@ -175,7 +175,7 @@
 android.view.accessibility.AccessibilityEvent#getEventType} to determine the
 type of event, and {@link
 android.view.accessibility.AccessibilityEvent#getContentDescription} to extract
-any label text associated with the fiew that fired the event.</pre>
+any label text associated with the view that fired the event.</pre>
 
 <pre>
 &#64;Override
diff --git a/docs/html/training/basics/firstapp/starting-activity.jd b/docs/html/training/basics/firstapp/starting-activity.jd
index cbd063a..4d0a84a 100644
--- a/docs/html/training/basics/firstapp/starting-activity.jd
+++ b/docs/html/training/basics/firstapp/starting-activity.jd
@@ -226,7 +226,7 @@
 
 <p>Open the {@code DisplayMessageActivity.java} file. If you used Eclipse to create it, the class
 already includes an implementation of the required {@link android.app.Activity#onCreate onCreate()}
-method. There's also an implemtation of the {@link android.app.Activity#onCreateOptionsMenu
+method. There's also an implementation of the {@link android.app.Activity#onCreateOptionsMenu
 onCreateOptionsMenu()} method, but
 you won't need it for this app so you can remove it. The class should look like this:</p>
 
diff --git a/docs/html/training/basics/intents/sending.jd b/docs/html/training/basics/intents/sending.jd
index 77f0e1a..37a06f1 100644
--- a/docs/html/training/basics/intents/sending.jd
+++ b/docs/html/training/basics/intents/sending.jd
@@ -31,11 +31,11 @@
 <p>One of Android's most important features is an app's ability to send the user to another app
 based on an "action" it would like to perform. For example, if
 your app has the address of a business that you'd like to show on a map, you don't have to build
-an activity in your app that shows a map. Instead, you can send a out a request to view the address
-using an {@link android.content.Intent}. The Android system then starts an app that's able to view
+an activity in your app that shows a map. Instead, you can create a request to view the address
+using an {@link android.content.Intent}. The Android system then starts an app that's able to show
 the address on a map.</p>
 
-<p>As shown in the first class, <a href="{@docRoot}training/basics/firstapp/index.html">Building
+<p>As explained in the first class, <a href="{@docRoot}training/basics/firstapp/index.html">Building
 Your First App</a>, you must use intents to navigate between activities in your own app. You
 generally do so with an <em>explicit intent</em>, which defines the exact class name of the
 component you want to start. However, when you want to have a separate app perform an action, such
diff --git a/docs/html/training/basics/network-ops/managing.jd b/docs/html/training/basics/network-ops/managing.jd
index 33cb195..0f3d495 100644
--- a/docs/html/training/basics/network-ops/managing.jd
+++ b/docs/html/training/basics/network-ops/managing.jd
@@ -116,7 +116,7 @@
 follows. The method {@link
 android.net.ConnectivityManager#getActiveNetworkInfo() getActiveNetworkInfo()}
 returns a {@link android.net.NetworkInfo} instance representing the first
-connected network interface it can find, or <code>null</code> if none if the
+connected network interface it can find, or <code>null</code> if none of the
 interfaces is connected (meaning that an
 internet connection is not available):</p>
 
diff --git a/docs/html/training/cloudsync/gcm.jd b/docs/html/training/cloudsync/gcm.jd
index dcc1b6b..df26d34 100644
--- a/docs/html/training/cloudsync/gcm.jd
+++ b/docs/html/training/cloudsync/gcm.jd
@@ -37,8 +37,7 @@
 <p>This lesson covers some of the best practices
 for integrating GCM into your application, and assumes you are already familiar
 with basic implementation of this service.  If this is not the case, you can read the <a
-  href="http://developer.google.com/android/gcm/demo">GCM
-  Tutorial</a>.</p>
+  href="{@docRoot}guide/google/gcm/demo.html">GCM demo app tutorial</a>.</p>
 
 <h2 id="multicast">Send Multicast Messages Efficiently</h2>
 <p>One of the most useful features in GCM is support for up to 1,000 recipients for
diff --git a/docs/html/training/managing-audio/audio-focus.jd b/docs/html/training/managing-audio/audio-focus.jd
index 66649e8..33f04e9 100644
--- a/docs/html/training/managing-audio/audio-focus.jd
+++ b/docs/html/training/managing-audio/audio-focus.jd
@@ -135,7 +135,7 @@
 (pressing play in your app) to be required before you resume playing audio.</p>
 
 <p>In the following code snippet, we pause the playback or our media player object if the audio
-loss is transien and resume it when we have regained the focus. If the loss is permanent, it
+loss is transient and resume it when we have regained the focus. If the loss is permanent, it
 unregisters our media button event receiver and stops monitoring audio focus changes.<p>
 
 <pre>
@@ -169,7 +169,7 @@
 <pre>
 OnAudioFocusChangeListener afChangeListener = new OnAudioFocusChangeListener() {
     public void onAudioFocusChange(int focusChange) {
-        if (focusChange == AUDIOFOCUS_LOSS_TRANSIENT_CAN_DUCK
+        if (focusChange == AUDIOFOCUS_LOSS_TRANSIENT_CAN_DUCK) {
             // Lower the volume
         } else if (focusChange == AudioManager.AUDIOFOCUS_GAIN) {
             // Raise it back to normal
diff --git a/media/java/android/mtp/MtpStorage.java b/media/java/android/mtp/MtpStorage.java
index 2f47aad..9cf65a3 100644
--- a/media/java/android/mtp/MtpStorage.java
+++ b/media/java/android/mtp/MtpStorage.java
@@ -39,7 +39,7 @@
         mStorageId = volume.getStorageId();
         mPath = volume.getPath();
         mDescription = context.getResources().getString(volume.getDescriptionId());
-        mReserveSpace = volume.getMtpReserveSpace();
+        mReserveSpace = volume.getMtpReserveSpace() * 1024 * 1024;
         mRemovable = volume.isRemovable();
         mMaxFileSize = volume.getMaxFileSize();
     }
@@ -87,7 +87,7 @@
      * Returns the amount of space to reserve on the storage file system.
      * This can be set to a non-zero value to prevent MTP from filling up the entire storage.
      *
-     * @return the storage unit description
+     * @return reserved space in bytes.
      */
     public final long getReserveSpace() {
         return mReserveSpace;
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 c798d266..0ccc415 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
@@ -2118,8 +2118,11 @@
         updateCarrierLabelVisibility(false);
     }
 
+    // called by makeStatusbar and also by PhoneStatusBarView
     void updateDisplaySize() {
         mDisplay.getMetrics(mDisplayMetrics);
+        mGestureRec.tag("display", 
+                String.format("%dx%d", mDisplayMetrics.widthPixels, mDisplayMetrics.heightPixels));
     }
 
     void performDisableActions(int net) {