Merge "Improved logging when there's an error creating the directories in getFilesDir()"
diff --git a/core/jni/android_bluetooth_HeadsetBase.cpp b/core/jni/android_bluetooth_HeadsetBase.cpp
index b0b0cb8..3f14c3a 100644
--- a/core/jni/android_bluetooth_HeadsetBase.cpp
+++ b/core/jni/android_bluetooth_HeadsetBase.cpp
@@ -169,7 +169,7 @@
     // never receive non-ASCII UTF-8).
     // This was added because of the BMW 2005 E46 which sends binary junk.
     if (is_ascii(buf)) {
-        LOG(LOG_INFO, "Bluetooth AT recv", buf);
+        IF_LOGV() LOG(LOG_VERBOSE, "Bluetooth AT recv", buf);
     } else {
         LOGW("Ignoring invalid AT command: %s", buf);
         buf[0] = NULL;
@@ -494,7 +494,7 @@
             }
         }
     }
-    LOG(LOG_INFO, "Bluetooth AT sent", buf);
+    IF_LOGV() LOG(LOG_VERBOSE, "Bluetooth AT sent", buf);
 
     free(buf);
 }
diff --git a/docs/html/community/index.jd b/docs/html/community/index.jd
index 3e69de4..23203c1 100644
--- a/docs/html/community/index.jd
+++ b/docs/html/community/index.jd
@@ -4,10 +4,10 @@
 
 	<div id="mainBodyFluid">
 <h1>Community</h1>
-<p>Welcome to the Android developers community! We're glad you're here and invite you to participate in these discussions. Before posting, please read the <a href="http://source.android.com/discuss/android-discussion-groups-charter">Groups Charter</a> that covers the community guidelines.</p>
+<p>Welcome to the Android developers community! We're glad you're here and invite you to participate in these discussions. Before posting, please read the <a href="http://source.android.com/community/groups-charter.html">Groups Charter</a> that covers the community guidelines.</p>
 
 <p class="note"><strong>Note:</strong> If you are seeking discussion about Android source code (not application development),
-then please refer to the <a href="http://source.android.com/discuss">Open Source Project Mailing lists</a>.</p>
+then please refer to the <a href="http://source.android.com/community">Open Source Project Mailing lists</a>.</p>
 
 <p style="margin-bottom:.5em"><strong>Contents</strong></p>
 <ol class="toc">
@@ -31,7 +31,7 @@
 As you write your post, please do the following:
 <ol>
 <li><b>Read
-the <a href="http://sites.google.com/a/android.com/opensource/discuss/android-discussion-groups-charter">mailing list charter</a></b> that covers the community guidelines. 
+the <a href="http://source.android.com/community/groups-charter.html">mailing list charter</a></b> that covers the community guidelines. 
 </li>
 <li><b>Select the most appropriate mailing list for your question</b>. There are several different lists for 
 developers, described below.</li>
diff --git a/docs/html/guide/developing/tools/bmgr.jd b/docs/html/guide/developing/tools/bmgr.jd
index 2f49532..57deb25 100644
--- a/docs/html/guide/developing/tools/bmgr.jd
+++ b/docs/html/guide/developing/tools/bmgr.jd
@@ -15,6 +15,11 @@
 <li><a href="#other">Other Commands</a></li>
   </ol>
 
+  <h2>See also</h2>
+  <ol>
+    <li><a href="{@docRoot}guide/topics/data/backup.html">Data Backup</a></li>
+  </ol>
+
 </div>
 </div>
 
@@ -26,6 +31,9 @@
 intrusive steps in order to test your application's backup agent.  These commands are
 accessed via the <a href="{@docRoot}guide/developing/tools/adb.html">adb</a> shell.
 
+<p>For information about adding support for backup in your application, read <a
+href="{@docRoot}guide/topics/data/backup.html">Data Backup</a>, which includes a guide to testing
+your application using {@code bmgr}.</p>
 
 
 <h2 id="backup">Forcing a Backup Operation</h2>
@@ -90,6 +98,8 @@
 
 <h2 id="other">Other Commands</h2>
 
+<h3>Wiping data</h3>
+
 <p>The data for a single application can be erased from the active data set on demand.  This is
 very useful while you're developing a backup agent, in case bugs lead you to write corrupt data
 or saved state information. You can wipe an application's data with the <code>bmgr wipe</code>
@@ -102,6 +112,9 @@
 erase.  The next backup operation that the application's agent processes will look as
 though the application had never backed anything up before.
 
+
+<h3>Enabling and disabling backup</h3>
+
 <p>You can see whether the Backup Manager is operational at all with the <code>bmgr
 enabled</code> command:
 
diff --git a/docs/html/guide/topics/data/backup.jd b/docs/html/guide/topics/data/backup.jd
index aad0f92..4279d7d 100644
--- a/docs/html/guide/topics/data/backup.jd
+++ b/docs/html/guide/topics/data/backup.jd
@@ -15,6 +15,8 @@
   <h2>In this document</h2>
   <ol>
     <li><a href="#Basics">The Basics</a></li>
+    <li><a href="#BackupManifest">Declaring the Backup Agent in Your Manifest</a></li>
+    <li><a href="#BackupKey">Registering for Android Backup Service</a></li>
     <li><a href="#BackupAgent">Extending BackupAgent</a>
       <ol>
         <li><a href="#RequiredMethods">Required Methods</a></li>
@@ -31,7 +33,7 @@
     <li><a href="#RestoreVersion">Checking the Restore Data Version</a></li>
     <li><a href="#RequestingBackup">Requesting Backup</a></li>
     <li><a href="#RequestingRestore">Requesting Restore</a></li>
-    <li><a href="#DevelopingTesting">Developing and Testing Your Backup Agent</a></li>
+    <li><a href="#Testing">Testing Your Backup Agent</a></li>
   </ol>
 
   <h2>Key classes</h2>
@@ -41,36 +43,62 @@
     <li>{@link android.app.backup.BackupAgentHelper}</li>
   </ol>
 
+  <h2>See also</h2>
+  <ol>
+    <li><a href="{@docRoot}guide/developing/tools/bmgr.html">{@code bmgr} tool</a></li>
+  </ol>
+
 </div>
 </div>
 
 <p>Android's {@link android.app.backup backup} service allows you to copy your persistent
-application data to a remote "cloud" storage, in order to provide a restore point for the
+application data to remote "cloud" storage, in order to provide a restore point for the
 application data and settings. If a user performs a factory reset or converts to a new
 Android-powered device, the system automatically restores your backup data when the application
-is re-installed. This way, your users are not required to reproduce their previous data or
+is re-installed. This way, your users don't need to reproduce their previous data or
 application settings. This process is completely transparent to the user and does not affect the
 functionality or user experience in your application.</p>
 
-<p>Android-powered devices that support the backup service provide a cloud storage area that
-saves your backup data and a backup transport that delivers your data to
-the storage area and back to the device. During a backup
-operation, Android's Backup Manager requests backup data from your application, then delivers it to
-the cloud storage using the backup transport. During a restore operation, the Backup Manager
-retrieves the backup data from the backup transport and returns it to your application
-so it can restore the data to the device. The backup service is <em>not</em> designed for data
-synchronization (you do not have access the backup data, except during a restore operation on the
-device).</p>
+<p>During a backup operation (which your application can request), Android's Backup Manager ({@link
+android.app.backup.BackupManager}) queries your application for backup data, then hands it to
+a backup transport, which then delivers the data to the cloud storage. During a
+restore operation, the Backup Manager retrieves the backup data from the backup transport and
+returns it to your application so your application can restore the data to the device. It's
+possible for your application to request a restore, but that shouldn't be necessary&mdash;Android
+automatically performs a restore operation when your application is installed and there exists
+backup data associated with the user. The primary scenario in which backup data is restored is when
+a user resets their device or upgrades to a new device and their previously installed
+applications are re-installed.</p>
 
-<p>The cloud storage used for backup won't necessarily be the same on all Android-powered devices.
-The cloud storage and backup transport may differ between devices and service providers.
-Where the backup data is stored is transparent to your application, but you are assured that your
-application data cannot be read by other applications.</p>
+<p class="note"><strong>Note:</strong> The backup service is <em>not</em> designed for
+synchronizing application data with other clients or saving data that you'd like to access during
+the normal application lifecycle. You cannot read or write backup data on demand and cannot access
+it in any way other than through the APIs provided by the Backup Manager.</p>
+
+<p>The backup transport is the client-side component of Android's backup framework, which is
+customizable by
+the device manufacturer and service provider. The backup transport may differ from device to device
+and which backup transport is available on any given device is transparent to your application. The
+Backup Manager APIs isolate your application from the actual backup transport available on a given
+device&mdash;your application communicates with the Backup Manager through a fixed set of APIs,
+regardless of the underlying transport.</p>
+
+<p>Data backup is <em>not</em> guaranteed to be available on all Android-powered
+devices. However, your application is not adversely affected in the event
+that a device does not provide a backup transport. If you believe that users will benefit from data
+backup in your application, then you can implement it as described in this document, test it, then
+publish your application without any concern about which devices actually perform backup. When your
+application runs on a device that does not provide a backup transport, your application operates
+normally, but will not receive callbacks from the Backup Manager to backup data.</p>
+
+<p>Although you cannot know what the current transport is, you are always assured that your
+backup data cannot be read by other applications on the device. Only the Backup Manager and backup
+transport have access to the data you provide during a backup operation.</p>
 
 <p class="caution"><strong>Caution:</strong> Because the cloud storage and transport service can
 differ from device to device, Android makes no guarantees about the security of your data while
-using backup. You should be cautious about using backup to store sensitive data, such as usernames
-and passwords.</p>
+using backup. You should always be cautious about using backup to store sensitive data, such as
+usernames and passwords.</p>
 
 
 <h2 id="Basics">The Basics</h2>
@@ -78,8 +106,8 @@
 <p>To backup your application data, you need to implement a backup agent. Your backup
 agent is called by the Backup Manager to provide the data you want to back up. It is also called
 to restore your backup data when the application is re-installed. The Backup Manager handles all
-your data transactions with the cloud storage and your backup agent handles all your data
-transactions on the device.</p>
+your data transactions with the cloud storage (using the backup transport) and your backup agent
+handles all your data transactions on the device.</p>
 
 <p>To implement a backup agent, you must:</p>
 
@@ -87,6 +115,11 @@
   <li>Declare your backup agent in your manifest file with the <a
 href="{@docRoot}guide/topics/manifest/application-element.html#agent">{@code
 android:backupAgent}</a> attribute.</li>
+  <li>Register your application with a backup service. Google offers <a
+href="http://code.google.com/android/backup/index.html">Android Backup Service</a> as a backup
+service for most Android-powered devices, which requires that you register your application in
+order for it to work. Any other backup services available might also require you to register
+in order to store your data on their servers.</li>
   <li>Define a backup agent by either:</p>
     <ol type="a">
       <li><a href="#backupAgent">Extending BackupAgent</a>
@@ -118,7 +151,6 @@
 
 
 
-
 <h2 id="BackupManifest">Declaring the Backup Agent in Your Manifest</h2>
 
 <p>This is the easiest step, so once you've decided on the class name for your backup agent, declare
@@ -160,6 +192,50 @@
 
 
 
+<h2 id="BackupKey">Registering for Android Backup Service</h2>
+
+<p>Google provides a backup transport with <a
+href="http://code.google.com/android/backup/index.html">Android Backup Service</a> for most
+Android-powered devices running Android 2.2 or greater.</p>
+
+<p>In order for you application to perform backup using Android Backup Service, you must
+register your application with the service to receive a Backup Service Key, then
+declare the Backup Service Key in your Android manifest.</p>
+
+<p>To get your Backup Service Key, <a
+href="http://code.google.com/android/backup/signup.html">register for Android Backup Service</a>.
+When you register, you will be provided a Backup Service Key and the appropriate {@code
+&lt;meta-data&gt;} XML code for your Android manifest file, which you must include as a child of the
+{@code &lt;application&gt;} element. For example:</p>
+
+<pre>
+&lt;application android:label="MyApplication"
+             android:backupAgent="MyBackupAgent"&gt;
+    ...
+    &lt;meta-data android:name="com.google.android.backup.api_key"
+        android:value="AEdPqrEAAAAIDaYEVgU6DJnyJdBmU7KLH3kszDXLv_4DIsEIyQ" /&gt;
+&lt;/application&gt;
+</pre>
+
+<p>The <code>android:name</code> must be <code>"com.google.android.backup.api_key"</code> and
+the <code>android:value</code> must be the Backup Service Key received from the Android Backup
+Service registration.</p>
+
+<p>If you have multiple applications, you must register each one, using the respective package
+name.</p>
+
+<p class="note"><strong>Note:</strong> The backup transport provided by Android Backup Service is
+not guaranteed to be available
+on all Android-powered devices that support backup. Some devices might support backup
+using a different transport, some devices might not support backup at all, and there is no way for
+your application to know what transport is used on the device. However, if you implement backup for
+your application, you should always include a Backup Service Key for Android Backup Service so
+your application can perform backup when the device uses the Android Backup Service transport. If
+the device does not use Android Backup Service, then the {@code &lt;meta-data&gt;} element with the
+Backup Service Key is ignored.</p>
+
+
+
 
 <h2 id="BackupAgent">Extending BackupAgent</h2>
 
@@ -237,7 +313,7 @@
 
 <p class="note"><strong>Tip:</strong> While developing your application, you can initiate an
 immediate backup operation from the Backup Manager with the <a
-href="{@docRoot}guide/developing/tools/bmgr.html">bmgr tool</a>.</p>
+href="{@docRoot}guide/developing/tools/bmgr.html">{@code bmgr} tool</a>.</p>
 
 <p>When the Backup Manager calls your {@link
 android.app.backup.BackupAgent#onBackup(ParcelFileDescriptor,BackupDataOutput,ParcelFileDescriptor)
@@ -381,7 +457,7 @@
 href="#RequestingRestore">Requesting restore</a> for more information).</p>
 
 <p class="note"><strong>Note:</strong> While developing your application, you can also request a
-restore operation with the <a href="{@docRoot}guide/developing/tools/bmgr.html">bmgr
+restore operation with the <a href="{@docRoot}guide/developing/tools/bmgr.html">{@code bmgr}
 tool</a>.</p>
 
 <p>When the Backup Manager calls your {@link
@@ -742,7 +818,7 @@
 
 <p class="note"><strong>Note:</strong> While developing your application, you can request a
 backup and initiate an immediate backup operation with the <a
-href="{@docRoot}guide/developing/tools/bmgr.html">bmgr
+href="{@docRoot}guide/developing/tools/bmgr.html">{@code bmgr}
 tool</a>.</p>
 
 
@@ -757,25 +833,52 @@
 implementation, passing the data from the current set of backup data.</p>
 
 <p class="note"><strong>Note:</strong> While developing your application, you can request a
-restore operation with the <a href="{@docRoot}guide/developing/tools/bmgr.html">bmgr
+restore operation with the <a href="{@docRoot}guide/developing/tools/bmgr.html">{@code bmgr}
 tool</a>.</p>
 
 
-<h2 id="DevelopingTesting">Developing and Testing Your Backup Agent</h2>
+<h2 id="Testing">Testing Your Backup Agent</h2>
 
-<p>To develop and test your backup agent:</p>
-<ul>
-  <li>Set your build target to a platform using API Level 8 or higher</li>
-  <li>Run your application on a suitable Android system image:
+<p>Once you've implemented your backup agent, you can test the backup and restore functionality
+with the following procedure, using <a
+href="{@docRoot}guide/developing/tools/bmgr.html">{@code bmgr}</a>.</p>
+
+<ol>
+  <li>Install your application on a suitable Android system image
     <ul>
-      <li>If using the emulator, create and use an AVD with the Google APIs add-on (API Level
-8) &mdash; the Google APIs add-on is available as an SDK component through the SDK and AVD
-Manager</li>
+      <li>If using the emulator, create and use an AVD with Android 2.2 (API Level 8).</li>
       <li>If using a device, the device must be running Android 2.2 or greater and have Android
-Market built in</li>
+Market built in.</li>
     </ul>
   </li>
-  <li>Test your backup agent using the <a href="{@docRoot}guide/developing/tools/bmgr.html">{@code
-bmgr}</a> tool to initiate backup and restore operations</li>
-</ul>
+  <li>Ensure that backup is enabled
+    <ul>
+      <li>If using the emulator, you can enable backup with the following command from your SDK
+{@code tools/} path:
+<pre class="no-pretty-print">adb shell bmgr enable true</pre>
+      </li>
+      <li>If using a device, open the system <b>Settings</b>, select <b>Privacy</b>, then enable
+<b>Back up my data</b> and <b>Automatic restore</b>.
+    </ul>
+  </li>
+  <li>Open your application and initialize some data
+    <p>If you've properly implemented backup in your application, then it should request a
+backup each time the data changes. For example, each time the user changes some data, your app
+should call {@link android.app.backup.BackupManager#dataChanged()}, which adds a backup request to
+the Backup Manager queue. For testing purposes, you can also make a request with the following
+{@code bmgr} command:</p>
+<pre class="no-pretty-print">adb shell bmgr backup <em>your.package.name</em></pre>
+  </li>
+  <li>Initiate a backup operation:
+<pre class="no-pretty-print">adb shell bmgr run</pre>
+    <p>This forces the Backup Manager to perform all backup requests that are in its
+queue.</p>
+  <li>Uninstall your application:
+<pre class="no-pretty-print">adb uninstall <em>your.package.name</em></pre>
+  </li>
+  <li>Re-install your application.</li>
+</ol>
+
+<p>If your backup agent is successful, all the data you initialized in step 4 is restored.</p>
+
 
diff --git a/docs/html/intl/ja/community/index.jd b/docs/html/intl/ja/community/index.jd
index 659aee7..490b23f 100644
--- a/docs/html/intl/ja/community/index.jd
+++ b/docs/html/intl/ja/community/index.jd
@@ -4,9 +4,9 @@
 
 	<div id="mainBodyFluid">
 			<h1>コミュニティ</h1>
-			<p>Android デベロッパー コミュニティへようこそ。コミュニティでのディスカッションにぜひ参加してください。投稿する前に、コミュニティ ガイドラインが記載されている<a href="http://source.android.com/discuss/android-discussion-groups-charter">グループの趣意</a>をお読みください。</p>
+			<p>Android デベロッパー コミュニティへようこそ。コミュニティでのディスカッションにぜひ参加してください。投稿する前に、コミュニティ ガイドラインが記載されている<a href="http://source.android.com/community/groups-charter.html">グループの趣意</a>をお読みください。</p>
 
-<p class="note"><strong>注:</strong> Android ソース コード(アプリケーション開発ではなく)に関するディスカッションは、<a href="http://source.android.com/discuss">オープンソース プロジェクトのメーリング リスト</a>(英語)を参照してください。</p>
+<p class="note"><strong>注:</strong> Android ソース コード(アプリケーション開発ではなく)に関するディスカッションは、<a href="http://source.android.com/community">オープンソース プロジェクトのメーリング リスト</a>(英語)を参照してください。</p>
 
 <p style="margin-bottom:.5em"><strong>目次</strong></p>
 <ol class="toc">
@@ -28,7 +28,7 @@
 
 <p>質問への答えが見つからない場合、コミュニティで質問することをおすすめします。投稿する際は、次の手順に従ってください。
 <ol>
-<li>コミュニティ ガイドラインが記載されている<b><a href="http://sites.google.com/a/android.com/opensource/discuss/android-discussion-groups-charter">Android メーリングリストの趣意</a></b>をお読みください。 
+<li>コミュニティ ガイドラインが記載されている<b><a href="http://source.android.com/community/groups-charter.html">Android メーリングリストの趣意</a></b>をお読みください。 
 </li>
 <li><b>質問に最適なメーリング リストを選択してください</b>。後述するように、デベロッパー向けのメーリング リストは何種類かに分かれています。</li>
 <li>
diff --git a/docs/html/intl/ja/resources/community-groups.jd b/docs/html/intl/ja/resources/community-groups.jd
index c99b1f8..ecedde1 100644
--- a/docs/html/intl/ja/resources/community-groups.jd
+++ b/docs/html/intl/ja/resources/community-groups.jd
@@ -4,9 +4,9 @@
 
 	<div id="mainBodyFluid">
 			<h1>コミュニティ</h1>
-			<p>Android デベロッパー コミュニティへようこそ。コミュニティでのディスカッションにぜひ参加してください。投稿する前に、コミュニティ ガイドラインが記載されている<a href="http://source.android.com/discuss/android-discussion-groups-charter">グループの趣意</a>をお読みください。</p>
+			<p>Android デベロッパー コミュニティへようこそ。コミュニティでのディスカッションにぜひ参加してください。投稿する前に、コミュニティ ガイドラインが記載されている<a href="http://source.android.com/community/groups-charter.html">グループの趣意</a>をお読みください。</p>
 
-<p class="note"><strong>注:</strong> Android ソース コード(アプリケーション開発ではなく)に関するディスカッションは、<a href="http://source.android.com/discuss">オープンソース プロジェクトのメーリング リスト</a>(英語)を参照してください。</p>
+<p class="note"><strong>注:</strong> Android ソース コード(アプリケーション開発ではなく)に関するディスカッションは、<a href="http://source.android.com/community">オープンソース プロジェクトのメーリング リスト</a>(英語)を参照してください。</p>
 
 <p style="margin-bottom:.5em"><strong>目次</strong></p>
 <ol class="toc">
@@ -28,7 +28,7 @@
 
 <p>質問への答えが見つからない場合、コミュニティで質問することをおすすめします。投稿する際は、次の手順に従ってください。
 <ol>
-<li>コミュニティ ガイドラインが記載されている<b><a href="http://sites.google.com/a/android.com/opensource/discuss/android-discussion-groups-charter">Android メーリングリストの趣意</a></b>をお読みください。 
+<li>コミュニティ ガイドラインが記載されている<b><a href="http://source.android.com/community/groups-charter.html">Android メーリングリストの趣意</a></b>をお読みください。 
 </li>
 <li><b>質問に最適なメーリング リストを選択してください</b>。後述するように、デベロッパー向けのメーリング リストは何種類かに分かれています。</li>
 <li>
diff --git a/docs/html/license.jd b/docs/html/license.jd
index 88932b6..83cd470 100644
--- a/docs/html/license.jd
+++ b/docs/html/license.jd
@@ -74,7 +74,7 @@
 
 <li>The use of sample source code provided in the SDK or shown in this
 documentation is subject to the conditions detailed in the <a
-href="{@docRoot}sdk/terms.html">SDK Terms and Conditions</a>.</li>
+href="http://www.apache.org/licenses/LICENSE-2.0">Apache 2.0 license</a>.</li>
 </ul>
 </h3>
 
diff --git a/docs/html/resources/community-groups.jd b/docs/html/resources/community-groups.jd
index 72bdf7a..6d59648 100644
--- a/docs/html/resources/community-groups.jd
+++ b/docs/html/resources/community-groups.jd
@@ -22,7 +22,7 @@
 
 <p>Welcome to the Android developers community! We're glad you're here and invite you to participate in discussions with other Android application developers on topics that interest you.</p>
 
-<p>The lists on this page are primarily for discussion about Android application development. If you are seeking discussion about Android source code (not application development), then please refer to the <a href="http://source.android.com/discuss">Open Source Project Mailing lists</a>.</p>
+<p>The lists on this page are primarily for discussion about Android application development. If you are seeking discussion about Android source code (not application development), then please refer to the <a href="http://source.android.com/community">Open Source Project Mailing lists</a>.</p>
 
 <h2 id="StackOverflow">Stack Overflow</h2>
 
@@ -56,7 +56,7 @@
 As you write your post, please do the following:
 <ol>
 <li><strong>Read
-the <a href="http://source.android.com/discuss/android-discussion-groups-charter">mailing list charter</a></strong> that covers the community guidelines.
+the <a href="http://source.android.com/community/groups-charter.html">mailing list charter</a></strong> that covers the community guidelines.
 </li>
 <li><strong>Select the most appropriate mailing list for your question</strong>. There are several different lists for
 developers, described below.</li>
diff --git a/docs/html/sdk/download.jd b/docs/html/sdk/download.jd
deleted file mode 100644
index 029de21..0000000
--- a/docs/html/sdk/download.jd
+++ /dev/null
@@ -1,80 +0,0 @@
-page.title=Download the Android SDK
-hide_license_footer=true
-
-@jd:body
-
-<script type="text/javascript">
-  function verify() {
-    document.getElementById('download-button').disabled = !document.getElementById('checkbox').checked;
-  }
-  function submit() {
-    var location = window.location.href;
-    if (location.indexOf('?v=') != -1) {
-      var filename = location.substring(location.indexOf('=')+1,location.length);
-      if (document.getElementById('checkbox').checked) {
-        document.location = "http://dl.google.com/android/" + filename;
-      }
-      document.getElementById('click-download').setAttribute("href", "http://dl.google.com/android/" + filename);
-      $("#terms-form").hide(500);
-      $("#next-steps").show(500);
-      document.getElementById('checkbox').disabled=true;
-      document.getElementById('download-button').disabled=true;
-    } else {
-      alert("You have not selected an SDK version. Please return to the Download page");
-    }
-  }
-</script>
-
-<div id="terms-form">
-    <p>Please carefully review the Android SDK License Agreement before downloading the SDK.
-The License Agreement constitutes a contract between you and Google with respect to your use of the SDK.</p>
-
-  <iframe id="terms" style="border:1px solid #888;margin:0 0 1em;height:400px;width:95%;" src="terms_body.html">
-  </iframe>
-
-  <p>
-    <input type="checkbox" id="checkbox" onclick="verify()" />
-    <label for="checkbox">I agree to the terms of the Android SDK License Agreement.</label>
-  </p>
-  <p>
-    <input type="submit" value="Download" id="download-button" disabled="disabled" onclick="submit()" />
-  </p>
-  <p>
-  <script language="javascript">
-    var loc = window.location.href;
-    if (loc.indexOf('?v=') != -1) {
-      var filename = loc.substring(loc.indexOf('=')+1,loc.length);
-      document.write("File: " + filename);
-    }
-  </script>
-  </p>
-</div><!-- end terms-form -->
-
-<noscript>
-  <p><strong>Please enable Javascript in your browser in order to agree to the terms and download the SDK.</strong></p>
-</noscript>
-
-<div class="special" id="next-steps" style="display:none">
-  <h2>Thank you for downloading the Android SDK!</h2>
-  <p>Your download should be underway. If not, <a id="click-download">click here to start the download</a>.</p>
-  <p>To set up your Android development environment, please read the guide to
-    <a href="installing.html">Installing the Android SDK</a> and ensure that your development
-    machine meets the system requirements linked on that page.</p>
-</div>
-
-<script type="text/javascript">
-  var loc = window.location.href;
-  var filename = loc.substring(loc.indexOf('=')+1,loc.length);
-  version = filename.substring(filename.indexOf('.')-1,filename.lastIndexOf('.'));
-  $(".addVersionPath").each(function(i) {
-    var oldHref = $(this).attr("href");
-    $(this).attr({href: "/sdk/" + version + "/" + oldHref});
-  });
-</script>
-
-
-
-
-
-
-
diff --git a/docs/html/sdk/sdk_toc.cs b/docs/html/sdk/sdk_toc.cs
index 7438707..a80981ce 100644
--- a/docs/html/sdk/sdk_toc.cs
+++ b/docs/html/sdk/sdk_toc.cs
@@ -133,7 +133,6 @@
     </h2>
     <ul>
       <li><a href="<?cs var:toroot ?>sdk/requirements.html">SDK System Requirements</a></li>
-      <li><a href="<?cs var:toroot ?>sdk/terms.html">SDK Terms and Conditions</a></li>
       <!-- <li><a href="<?cs var:toroot ?>sdk/RELEASENOTES.html">SDK Release
             Notes</a></li> -->
       <li><a href="<?cs var:toroot ?>sdk/older_releases.html">SDK
diff --git a/docs/html/sdk/terms_body.html b/docs/html/sdk/terms_body.html
deleted file mode 100644
index 03e0906..0000000
--- a/docs/html/sdk/terms_body.html
+++ /dev/null
@@ -1,204 +0,0 @@
-
-<p>This is the Android Software Development Kit License Agreement.</p>
-
-<h2>
-	1. Introduction
-</h2>
-<p>
-	1.1 The Android Software Development Kit (referred to in this License Agreement as the "SDK" and specifically including the Android system files, packaged APIs, and Google APIs add-ons) is licensed to you subject to the terms of this License Agreement. This License Agreement forms a legally binding contract between you and Google in relation to your use of the SDK.
-
-</p>
-<p>
-	1.2 "Google" means Google Inc., a Delaware corporation with principal place of business at 1600 Amphitheatre Parkway, Mountain View, CA 94043, United States.
-</p>
-<h2>
-	2. Accepting this License Agreement
-</h2>
-<p>
-	2.1 In order to use the SDK, you must first agree to this License Agreement. You may not use the SDK if you do not accept this License Agreement.
-</p>
-<p>
-	2.2 You can accept this License Agreement by:
-</p>
-<p>
-	(A) clicking to accept or agree to this License Agreement, where this option is made available to you; or
-</p>
-<p>
-	(B) by actually using the SDK. In this case, you agree that use of the SDK constitutes acceptance of the Licensing Agreement from that point onwards.
-</p>
-<p>
-	2.3 You may not use the SDK and may not accept the Licensing Agreement if you are a person barred from receiving the SDK under the laws of the United States or other countries including the country in which you are resident or from which you use the SDK.
-</p>
-<p>
-	2.4 If you are agreeing to be bound by this License Agreement on behalf of your employer or other entity, you represent and warrant that you have full legal authority to bind your employer or such entity to this License Agreement. If you do not have the requisite authority, you may not accept the Licensing Agreement or use the SDK on behalf of your employer or other entity.
-</p>
-<h2>
-	3. SDK License from Google
-</h2>
-<p>
-	3.1 Subject to the terms of this License Agreement, Google grants you a limited, worldwide, royalty-free, non- assignable and non-exclusive license to use the SDK solely to develop applications to run on the Android platform.
-</p>
-<p>
-	3.2 You agree that Google or third parties own all legal right, title and interest in and to the SDK, including any Intellectual Property Rights that subsist in the SDK. "Intellectual Property Rights" means any and all rights under patent law, copyright law, trade secret law, trademark law, and any and all other proprietary rights. Google reserves all rights not expressly granted to you. 
-
-</p>
-<p>
-	3.3 Except to the extent required by applicable third party licenses, you may not copy (except for backup purposes), modify, adapt, redistribute, decompile, reverse engineer, disassemble, or create derivative works of the SDK or any part of the SDK. Except to the extent required by applicable third party licenses, you may not load any part of the SDK onto a mobile handset or any other hardware device except a personal computer, combine any part of the SDK with other software, or distribute any software or device incorporating a part of the SDK. 
-</p>
-<p>
-	3.4 Use, reproduction and distribution of components of the SDK licensed under an open source software license are governed solely by the terms of that open source software license and not this License Agreement.
-</p>
-<p>
-	3.5 You agree that the form and nature of the SDK that Google provides may change without prior notice to you and that future versions of the SDK may be incompatible with applications developed on previous versions of the SDK. You agree that Google may stop (permanently or temporarily) providing the SDK (or any features within the SDK) to you or to users generally at Google's sole discretion, without prior notice to you.
-</p>
-<p>
-	3.6 Nothing in this License Agreement gives you a right to use any of Google's trade names, trademarks, service marks, logos, domain names, or other distinctive brand features.
-</p>
-<p>
-	3.7 You agree that you will not remove, obscure, or alter any proprietary rights notices (including copyright and trademark notices) that may be affixed to or contained within the SDK.
-</p>
-<h2>
-	4. Use of the SDK by You
-</h2>
-<p>
-	4.1 Google agrees that it obtains no right, title or interest from you (or your licensors) under this License Agreement in or to any software applications that you develop using the SDK, including any intellectual property rights that subsist in those applications. 
-</p>
-<p>
-	4.2 You agree to use the SDK and write applications only for purposes that are permitted by (a) this License Agreement and (b) any applicable law, regulation or generally accepted practices or guidelines in the relevant jurisdictions (including any laws regarding the export of data or software to and from the United States or other relevant countries).
-</p>
-<p>
-	4.3 You agree that if you use the SDK to develop applications for general public users, you will protect the privacy and legal rights of those users. If the users provide you with user names, passwords, or other login information or personal information, your must make the users aware that the information will be available to your application, and you must provide legally adequate privacy notice and protection for those users. If your application stores personal or sensitive information provided by users, it must do so securely. If the user provides your application with Google Account information, your application may only use that information to access the user's Google Account when, and for the limited purposes for which, the user has given you permission to do so.
-</p>
-<p>
-	4.4 You agree that you will not engage in any activity with the SDK, including the development or distribution of an application, that interferes with, disrupts, damages, or accesses in an unauthorized manner the servers, networks, or other properties or services of any third party including, but not limited to, Google or any mobile communications carrier.
-</p>
-<p>
-	4.5 You agree that you are solely responsible for (and that Google has no responsibility to you or to any third party for) any data, content, or resources that you create, transmit or display through the Android platform and/or applications for the Android platform, and for the consequences of your actions (including any loss or damage which Google may suffer) by doing so.
-</p>
-<p>
-	4.6 You agree that you are solely responsible for (and that Google has no responsibility to you or to any third party for) any breach of your obligations under this License Agreement, any applicable third party contract or Terms of Service, or any applicable law or regulation, and for the consequences (including any loss or damage which Google or any third party may suffer) of any such breach.
-</p>
-<h2>
-	5. Your Developer Credentials
-</h2>
-<p>
-	5.1 You agree that you are responsible for maintaining the confidentiality of any developer credentials that may be issued to you by Google or which you may choose yourself and that you will be solely responsible for all applications that are developed under your developer credentials.
-</p>
-<h2>
-	6. Privacy and Information
-</h2>
-<p>
-	6.1 In order to continually innovate and improve the SDK, Google may collect certain usage statistics from the software including but not limited to a unique identifier, associated IP address, version number of the software, and information on which tools and/or services in the SDK are being used and how they are being used. Before any of this information is collected, the SDK will notify you and seek your consent. If you withhold consent, the information will not be collected.
-</p>
-<p>
-	6.2 The data collected is examined in the aggregate to improve the SDK and is maintained in accordance with Google's Privacy Policy.
-</p>
-<h2>
-	7. Third Party Applications for the Android Platform
-</h2>
-<p>
-	7.1 If you use the SDK to run applications developed by a third party or that access data, content or resources provided by a third party, you agree that Google is not responsible for those applications, data, content, or resources. You understand that all data, content or resources which you may access through such third party applications are the sole responsibility of the person from which they originated and that Google is not liable for any loss or damage that you may experience as a result of the use or access of any of those third party applications, data, content, or resources.
-</p>
-<p>
-	7.2 You should be aware the data, content, and resources presented to you through such a third party application may be protected by intellectual property rights which are owned by the providers (or by other persons or companies on their behalf). You may not modify, rent, lease, loan, sell, distribute or create derivative works based on these data, content, or resources (either in whole or in part) unless you have been specifically given permission to do so by the relevant owners.
-</p>
-<p>
-	7.3 You acknowledge that your use of such third party applications, data, content, or resources may be subject to separate terms between you and the relevant third party. In that case, this License Agreement does not affect your legal relationship with these third parties.
-</p>
-<h2>
-	8. Using Android APIs
-</h2>
-<p>
-	8.1 Google Data APIs
-</p>
-<p>
-	8.1.1 If you use any API to retrieve data from Google, you acknowledge that the data may be protected by intellectual property rights which are owned by Google or those parties that provide the data (or by other persons or companies on their behalf). Your use of any such API may be subject to additional Terms of Service. You may not modify, rent, lease, loan, sell, distribute or create derivative works based on this data (either in whole or in part) unless allowed by the relevant Terms of Service.
-</p>
-<p>
-	8.1.2 If you use any API to retrieve a user's data from Google, you acknowledge and agree that you shall retrieve data only with the user's explicit consent and only when, and for the limited purposes for which, the user has given you permission to do so. 
-
-</p>
-<h2>
-	9. Terminating this License Agreement
-</h2>
-<p>
-	9.1 This License Agreement will continue to apply until terminated by either you or Google as set out below.
-</p>
-<p>
-	9.2 If you want to terminate this License Agreement, you may do so by ceasing your use of the SDK and any relevant developer credentials.
-</p>
-<p>
-	9.3 Google may at any time, terminate this License Agreement with you if:
-</p>
-<p>
-	(A) you have breached any provision of this License Agreement; or
-</p>
-<p>
-	(B) Google is required to do so by law; or
-</p>
-<p>
-	(C) the partner with whom Google offered certain parts of SDK (such as APIs) to you has terminated its relationship with Google or ceased to offer certain parts of the SDK to you; or
-</p>
-<p>
-	(D) Google decides to no longer providing the SDK or certain parts of the SDK to users in the country in which you are resident or from which you use the service, or the provision of the SDK or certain SDK services to you by Google is, in Google's sole discretion, no longer commercially viable.
-</p>
-<p>
-	9.4 When this License Agreement comes to an end, all of the legal rights, obligations and liabilities that you and Google have benefited from, been subject to (or which have accrued over time whilst this License Agreement has been in force) or which are expressed to continue indefinitely, shall be unaffected by this cessation, and the provisions of paragraph 14.7 shall continue to apply to such rights, obligations and liabilities indefinitely.
-</p>
-<h2>
-	10. DISCLAIMER OF WARRANTIES
-</h2>
-<p>
-	10.1 YOU EXPRESSLY UNDERSTAND AND AGREE THAT YOUR USE OF THE SDK IS AT YOUR SOLE RISK AND THAT THE SDK IS PROVIDED "AS IS" AND "AS AVAILABLE" WITHOUT WARRANTY OF ANY KIND FROM GOOGLE.
-</p>
-<p>
-	10.2 YOUR USE OF THE SDK AND ANY MATERIAL DOWNLOADED OR OTHERWISE OBTAINED THROUGH THE USE OF THE SDK IS AT YOUR OWN DISCRETION AND RISK AND YOU ARE SOLELY RESPONSIBLE FOR ANY DAMAGE TO YOUR COMPUTER SYSTEM OR OTHER DEVICE OR LOSS OF DATA THAT RESULTS FROM SUCH USE.
-</p>
-<p>
-	10.3 GOOGLE FURTHER EXPRESSLY DISCLAIMS ALL WARRANTIES AND CONDITIONS OF ANY KIND, WHETHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO THE IMPLIED WARRANTIES AND CONDITIONS OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
-</p>
-<h2>
-	11. LIMITATION OF LIABILITY
-</h2>
-<p>
-	11.1 YOU EXPRESSLY UNDERSTAND AND AGREE THAT GOOGLE, ITS SUBSIDIARIES AND AFFILIATES, AND ITS LICENSORS SHALL NOT BE LIABLE TO YOU UNDER ANY THEORY OF LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL CONSEQUENTIAL OR EXEMPLARY DAMAGES THAT MAY BE INCURRED BY YOU, INCLUDING ANY LOSS OF DATA, WHETHER OR NOT GOOGLE OR ITS REPRESENTATIVES HAVE BEEN ADVISED OF OR SHOULD HAVE BEEN AWARE OF THE POSSIBILITY OF ANY SUCH LOSSES ARISING.
-</p>
-<h2>
-	12. Indemnification
-</h2>
-<p>
-	12.1 To the maximum extent permitted by law, you agree to defend, indemnify and hold harmless Google, its affiliates and their respective directors, officers, employees and agents from and against any and all claims, actions, suits or proceedings, as well as any and all losses, liabilities, damages, costs and expenses (including reasonable attorneys fees) arising out of or accruing from (a) your use of the SDK, (b) any application you develop on the SDK that infringes any copyright, trademark, trade secret, trade dress, patent or other intellectual property right of any person or defames any person or violates their rights of publicity or privacy, and (c) any non-compliance by you with this License Agreement.
-</p>
-<h2>
-	13. Changes to the License Agreement
-</h2>
-<p>
-	13.1 Google may make changes to the License Agreement as it distributes new versions of the SDK. When these changes are made, Google will make a new version of the License Agreement available on the website where the SDK is made available.
-</p>
-<h2>
-	14. General Legal Terms
-</h2>
-<p>
-	14.1 This License Agreement constitute the whole legal agreement between you and Google and govern your use of the SDK (excluding any services which Google may provide to you under a separate written agreement), and completely replace any prior agreements between you and Google in relation to the SDK.
-</p>
-<p>
-	14.2 You agree that if Google does not exercise or enforce any legal right or remedy which is contained in this License Agreement (or which Google has the benefit of under any applicable law), this will not be taken to be a formal waiver of Google's rights and that those rights or remedies will still be available to Google.
-</p>
-<p>
-	14.3 If any court of law, having the jurisdiction to decide on this matter, rules that any provision of this License Agreement is invalid, then that provision will be removed from this License Agreement without affecting the rest of this License Agreement. The remaining provisions of this License Agreement will continue to be valid and enforceable.
-</p>
-<p>
-	14.4 You acknowledge and agree that each member of the group of companies of which Google is the parent shall be third party beneficiaries to this License Agreement and that such other companies shall be entitled to directly enforce, and rely upon, any provision of this License Agreement that confers a benefit on (or rights in favor of) them. Other than this, no other person or company shall be third party beneficiaries to this License Agreement.
-</p>
-<p>
-	14.5 EXPORT RESTRICTIONS. THE SDK IS SUBJECT TO UNITED STATES EXPORT LAWS AND REGULATIONS. YOU MUST COMPLY WITH ALL DOMESTIC AND INTERNATIONAL EXPORT LAWS AND REGULATIONS THAT APPLY TO THE SDK. THESE LAWS INCLUDE RESTRICTIONS ON DESTINATIONS, END USERS AND END USE.
-</p>
-<p>
-	14.6 The rights granted in this License Agreement may not be assigned or transferred by either you or Google without the prior written approval of the other party. Neither you nor Google shall be permitted to delegate their responsibilities or obligations under this License Agreement without the prior written approval of the other party.
-</p>
-<p>
-	14.7 This License Agreement, and your relationship with Google under this License Agreement, shall be governed by the laws of the State of California without regard to its conflict of laws provisions. You and Google agree to submit to the exclusive jurisdiction of the courts located within the county of Santa Clara, California to resolve any legal matter arising from this License Agreement. Notwithstanding this, you agree that Google shall still be allowed to apply for injunctive remedies (or an equivalent type of urgent legal relief) in any jurisdiction.
-</p>
-<p>
-	<em>April 10, 2009</em>
-</p>
diff --git a/docs/html/sitemap.txt b/docs/html/sitemap.txt
index b0ec7c9..d5be8f1 100644
--- a/docs/html/sitemap.txt
+++ b/docs/html/sitemap.txt
@@ -7,7 +7,6 @@
 http://developer.android.com/videos/index.html
 http://developer.android.com/resources/dashboard/platform-versions.html
 http://developer.android.com/license.html
-http://developer.android.com/sdk/terms.html
 http://developer.android.com/resources/community-groups.html
 http://developer.android.com/resources/community-more.html
 http://developer.android.com/resources/articles/index.html
diff --git a/libs/rs/rsNoise.cpp b/libs/rs/rsNoise.cpp
index 764dc1a..4b67586 100644
--- a/libs/rs/rsNoise.cpp
+++ b/libs/rs/rsNoise.cpp
@@ -253,4 +253,4 @@
 }
 
 }
-}
\ No newline at end of file
+}
diff --git a/opengl/tests/gl_jni/jni/gl_code.cpp b/opengl/tests/gl_jni/jni/gl_code.cpp
index f031c79..ef66841 100644
--- a/opengl/tests/gl_jni/jni/gl_code.cpp
+++ b/opengl/tests/gl_jni/jni/gl_code.cpp
@@ -181,4 +181,3 @@
 {
     background = 1.0f - background;
 }
-
diff --git a/services/java/com/android/server/BackupManagerService.java b/services/java/com/android/server/BackupManagerService.java
index d67dde0..6e307a5 100644
--- a/services/java/com/android/server/BackupManagerService.java
+++ b/services/java/com/android/server/BackupManagerService.java
@@ -1313,7 +1313,7 @@
                 // If everything actually went through and this is the first time we've
                 // done a backup, we can now record what the current backup dataset token
                 // is.
-                if ((mCurrentToken == 0) && (status != BackupConstants.TRANSPORT_OK)) {
+                if ((mCurrentToken == 0) && (status == BackupConstants.TRANSPORT_OK)) {
                     try {
                         mCurrentToken = mTransport.getCurrentRestoreSet();
                     } catch (RemoteException e) { /* cannot happen */ }
diff --git a/telephony/java/com/android/internal/telephony/gsm/GsmDataConnectionTracker.java b/telephony/java/com/android/internal/telephony/gsm/GsmDataConnectionTracker.java
index f6d4491..5f651e7 100644
--- a/telephony/java/com/android/internal/telephony/gsm/GsmDataConnectionTracker.java
+++ b/telephony/java/com/android/internal/telephony/gsm/GsmDataConnectionTracker.java
@@ -442,7 +442,8 @@
         if ((state == State.IDLE || state == State.SCANNING)
                 && (gprsState == ServiceState.STATE_IN_SERVICE || noAutoAttach)
                 && mGsmPhone.mSIMRecords.getRecordsLoaded()
-                && phone.getState() == Phone.State.IDLE
+                && (mGsmPhone.mSST.isConcurrentVoiceAndData() ||
+                        phone.getState() == Phone.State.IDLE )
                 && isDataAllowed()
                 && !mIsPsRestricted
                 && desiredPowerState ) {