Merge "Add a LayerScreenshot" into ics-mr0
diff --git a/core/java/android/accounts/ChooseTypeAndAccountActivity.java b/core/java/android/accounts/ChooseTypeAndAccountActivity.java
index 5f38eb4..c3c9d16 100644
--- a/core/java/android/accounts/ChooseTypeAndAccountActivity.java
+++ b/core/java/android/accounts/ChooseTypeAndAccountActivity.java
@@ -72,7 +72,7 @@
      * This is passed as the requiredFeatures parameter in AccountManager.addAccount()
      * if it is called.
      */
-    public static final String EXTRA_ADD_ACCOUNT_REQUIRED_FEATURES_STRING_ARRAY = 
+    public static final String EXTRA_ADD_ACCOUNT_REQUIRED_FEATURES_STRING_ARRAY =
             "addAccountRequiredFeatures";
 
     /**
@@ -110,7 +110,6 @@
     private ArrayList<AccountInfo> mAccountInfos;
     private int mPendingRequest = REQUEST_NULL;
     private Parcelable[] mExistingAccounts = null;
-    private Parcelable[] mSavedAccounts = null;
 
     @Override
     public void onCreate(Bundle savedInstanceState) {
@@ -124,12 +123,10 @@
 
         if (savedInstanceState != null) {
             mPendingRequest = savedInstanceState.getInt(KEY_INSTANCE_STATE_PENDING_REQUEST);
-            mSavedAccounts =
+            mExistingAccounts =
                     savedInstanceState.getParcelableArray(KEY_INSTANCE_STATE_EXISTING_ACCOUNTS);
-            mExistingAccounts = null;
         } else {
             mPendingRequest = REQUEST_NULL;
-            mSavedAccounts = null;
             mExistingAccounts = null;
         }
 
@@ -246,7 +243,9 @@
     protected void onSaveInstanceState(final Bundle outState) {
         super.onSaveInstanceState(outState);
         outState.putInt(KEY_INSTANCE_STATE_PENDING_REQUEST, mPendingRequest);
-        outState.putParcelableArray(KEY_INSTANCE_STATE_EXISTING_ACCOUNTS, mExistingAccounts);
+        if (mPendingRequest == REQUEST_ADD_ACCOUNT) {
+            outState.putParcelableArray(KEY_INSTANCE_STATE_EXISTING_ACCOUNTS, mExistingAccounts);
+        }
     }
 
     // Called when the choose account type activity (for adding an account) returns.
@@ -264,7 +263,6 @@
 
         // we got our result, so clear the fact that we had a pending request
         mPendingRequest = REQUEST_NULL;
-        mExistingAccounts = null;
 
         if (resultCode == RESULT_CANCELED) {
             return;
@@ -293,7 +291,7 @@
                 if (accountName == null || accountType == null) {
                     Account[] currentAccounts = AccountManager.get(this).getAccounts();
                     Set<Account> preExistingAccounts = new HashSet<Account>();
-                    for (Parcelable accountParcel : mSavedAccounts) {
+                    for (Parcelable accountParcel : mExistingAccounts) {
                         preExistingAccounts.add((Account) accountParcel);
                     }
                     for (Account account : currentAccounts) {
diff --git a/core/java/android/hardware/Camera.java b/core/java/android/hardware/Camera.java
index d338764..caad6fd 100644
--- a/core/java/android/hardware/Camera.java
+++ b/core/java/android/hardware/Camera.java
@@ -116,6 +116,12 @@
  * auto-focus capabilities. In order for your application to be compatible with
  * more devices, you should not make assumptions about the device camera
  * specifications.</p>
+ *
+ * <div class="special reference">
+ * <h3>Developer Guides</h3>
+ * <p>For more information about using cameras, read the
+ * <a href="{@docRoot}guide/topics/media/camera.html">Camera</a> developer guide.</p>
+ * </div>
  */
 public class Camera {
     private static final String TAG = "Camera";
diff --git a/core/java/android/service/textservice/package.html b/core/java/android/service/textservice/package.html
new file mode 100644
index 0000000..89c6dbc
--- /dev/null
+++ b/core/java/android/service/textservice/package.html
@@ -0,0 +1,38 @@
+<HTML>
+<BODY>
+<p>Provides classes that allow you to create spell checkers in a manner similar to the
+input method framework (for IMEs).</p>
+
+<p>To create a new spell checker, you must implement a service that extends {@link
+android.service.textservice.SpellCheckerService} and extend the {@link
+android.service.textservice.SpellCheckerService.Session} class to provide spelling suggestions based
+on text provided by the interface's callback methods. In the {@link
+android.service.textservice.SpellCheckerService.Session} callback methods, you must return the
+spelling suggestions as {@link android.view.textservice.SuggestionsInfo} objects. </p>
+
+<p>Applications with a spell checker service must declare the {@link
+android.Manifest.permission#BIND_TEXT_SERVICE} permission as required by the service. The service
+must also declare an intent filter with {@code &lt;action
+android:name="android.service.textservice.SpellCheckerService" />} as the intent’s action and should
+include a {@code &lt;meta-data&gt;} element that declares configuration information for the spell
+checker. For example:</p>
+
+<pre>
+&lt;service
+    android:label="&#064;string/app_name"
+    android:name=".SampleSpellCheckerService"
+    android:permission="android.permission.BIND_TEXT_SERVICE" >
+    &lt;intent-filter >
+        &lt;action android:name="android.service.textservice.SpellCheckerService" />
+    &lt;/intent-filter>
+    &lt;meta-data
+        android:name="android.view.textservice.scs"
+        android:resource="&#064;xml/spellchecker" />
+&lt;/service>
+</pre>
+
+<p>For example code, see the <a
+href="{@docRoot}resources/samples/SampleSpellCheckerService/index.html">Spell
+Checker</a> sample app.</p>
+</BODY>
+</HTML>
diff --git a/core/java/android/view/ViewRootImpl.java b/core/java/android/view/ViewRootImpl.java
index 7eae739..081e267 100644
--- a/core/java/android/view/ViewRootImpl.java
+++ b/core/java/android/view/ViewRootImpl.java
@@ -108,6 +108,7 @@
     private static final boolean DEBUG_TRACKBALL = false || LOCAL_LOGV;
     private static final boolean DEBUG_IMF = false || LOCAL_LOGV;
     private static final boolean DEBUG_CONFIGURATION = false || LOCAL_LOGV;
+    private static final boolean DEBUG_FPS = false;
     private static final boolean WATCH_POINTER = false;
 
     /**
@@ -274,6 +275,11 @@
     private Thread mRenderProfiler;
     private volatile boolean mRenderProfilingEnabled;
 
+    // Variables to track frames per second, enabled via DEBUG_FPS flag
+    private long mFpsStartTime = -1;
+    private long mFpsPrevTime = -1;
+    private int mFpsNumFrames;
+
     /**
      * see {@link #playSoundEffect(int)}
      */
@@ -1766,12 +1772,42 @@
         }
     }
 
+    /**
+     * Called from draw() when DEBUG_FPS is enabled
+     */
+    private void trackFPS() {
+        // Tracks frames per second drawn. First value in a series of draws may be bogus
+        // because it down not account for the intervening idle time
+        long nowTime = System.currentTimeMillis();
+        if (mFpsStartTime < 0) {
+            mFpsStartTime = mFpsPrevTime = nowTime;
+            mFpsNumFrames = 0;
+        } else {
+            ++mFpsNumFrames;
+            String thisHash = Integer.toHexString(System.identityHashCode(this));
+            long frameTime = nowTime - mFpsPrevTime;
+            long totalTime = nowTime - mFpsStartTime;
+            Log.v(TAG, "0x" + thisHash + "\tFrame time:\t" + frameTime);
+            mFpsPrevTime = nowTime;
+            if (totalTime > 1000) {
+                float fps = (float) mFpsNumFrames * 1000 / totalTime;
+                Log.v(TAG, "0x" + thisHash + "\tFPS:\t" + fps);
+                mFpsStartTime = nowTime;
+                mFpsNumFrames = 0;
+            }
+        }
+    }
+
     private void draw(boolean fullRedrawNeeded) {
         Surface surface = mSurface;
         if (surface == null || !surface.isValid()) {
             return;
         }
 
+        if (DEBUG_FPS) {
+            trackFPS();
+        }
+
         if (!sFirstDrawComplete) {
             synchronized (sFirstDrawHandlers) {
                 sFirstDrawComplete = true;
diff --git a/core/java/com/android/internal/widget/DigitalClock.java b/core/java/com/android/internal/widget/DigitalClock.java
index ac0dc35..18a4794 100644
--- a/core/java/com/android/internal/widget/DigitalClock.java
+++ b/core/java/com/android/internal/widget/DigitalClock.java
@@ -22,8 +22,6 @@
 import android.content.Context;
 import android.content.Intent;
 import android.content.IntentFilter;
-import android.content.res.AssetManager;
-import android.content.res.Resources;
 import android.database.ContentObserver;
 import android.graphics.Typeface;
 import android.os.Handler;
@@ -61,6 +59,14 @@
     private final Handler mHandler = new Handler();
     private BroadcastReceiver mIntentReceiver;
 
+    private static final Typeface sBackgroundFont;
+    private static final Typeface sForegroundFont;
+
+    static {
+        sBackgroundFont = Typeface.createFromFile(SYSTEM_FONT_TIME_BACKGROUND);
+        sForegroundFont = Typeface.createFromFile(SYSTEM_FONT_TIME_FOREGROUND);
+    }
+
     private static class TimeChangedReceiver extends BroadcastReceiver {
         private WeakReference<DigitalClock> mClock;
         private Context mContext;
@@ -159,13 +165,11 @@
     protected void onFinishInflate() {
         super.onFinishInflate();
 
-        AssetManager assets = mContext.getAssets();
-
         /* The time display consists of two tones. That's why we have two overlapping text views. */
         mTimeDisplayBackground = (TextView) findViewById(R.id.timeDisplayBackground);
-        mTimeDisplayBackground.setTypeface(Typeface.createFromFile(SYSTEM_FONT_TIME_BACKGROUND));
+        mTimeDisplayBackground.setTypeface(sBackgroundFont);
         mTimeDisplayForeground = (TextView) findViewById(R.id.timeDisplayForeground);
-        mTimeDisplayForeground.setTypeface(Typeface.createFromFile(SYSTEM_FONT_TIME_FOREGROUND));
+        mTimeDisplayForeground.setTypeface(sForegroundFont);
         mAmPm = new AmPm(this, null);
         mCalendar = Calendar.getInstance();
 
diff --git a/core/res/res/drawable-hdpi/ic_btn_find_next.png b/core/res/res/drawable-hdpi/ic_btn_find_next.png
deleted file mode 100644
index b696a6b..0000000
--- a/core/res/res/drawable-hdpi/ic_btn_find_next.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-hdpi/ic_btn_find_prev.png b/core/res/res/drawable-hdpi/ic_btn_find_prev.png
deleted file mode 100644
index 5550c5a..0000000
--- a/core/res/res/drawable-hdpi/ic_btn_find_prev.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-hdpi/ic_find_next_holo_dark.png b/core/res/res/drawable-hdpi/ic_find_next_holo_dark.png
new file mode 100644
index 0000000..2fe4f81
--- /dev/null
+++ b/core/res/res/drawable-hdpi/ic_find_next_holo_dark.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/ic_find_previous_holo_dark.png b/core/res/res/drawable-hdpi/ic_find_previous_holo_dark.png
new file mode 100644
index 0000000..d4e9bd1
--- /dev/null
+++ b/core/res/res/drawable-hdpi/ic_find_previous_holo_dark.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/ic_lockscreen_player_background.9.png b/core/res/res/drawable-hdpi/ic_lockscreen_player_background.9.png
index b187358..fbb75b5 100644
--- a/core/res/res/drawable-hdpi/ic_lockscreen_player_background.9.png
+++ b/core/res/res/drawable-hdpi/ic_lockscreen_player_background.9.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/ic_btn_find_next.png b/core/res/res/drawable-mdpi/ic_btn_find_next.png
deleted file mode 100644
index abdc247..0000000
--- a/core/res/res/drawable-mdpi/ic_btn_find_next.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-mdpi/ic_btn_find_prev.png b/core/res/res/drawable-mdpi/ic_btn_find_prev.png
deleted file mode 100644
index 4e3da1d..0000000
--- a/core/res/res/drawable-mdpi/ic_btn_find_prev.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-mdpi/ic_find_next_holo_dark.png b/core/res/res/drawable-mdpi/ic_find_next_holo_dark.png
new file mode 100644
index 0000000..c138916
--- /dev/null
+++ b/core/res/res/drawable-mdpi/ic_find_next_holo_dark.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/ic_find_previous_holo_dark.png b/core/res/res/drawable-mdpi/ic_find_previous_holo_dark.png
new file mode 100644
index 0000000..d239274
--- /dev/null
+++ b/core/res/res/drawable-mdpi/ic_find_previous_holo_dark.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/ic_lockscreen_player_background.9.png b/core/res/res/drawable-mdpi/ic_lockscreen_player_background.9.png
index 8cfd1af..17d97c4 100644
--- a/core/res/res/drawable-mdpi/ic_lockscreen_player_background.9.png
+++ b/core/res/res/drawable-mdpi/ic_lockscreen_player_background.9.png
Binary files differ
diff --git a/core/res/res/drawable-xhdpi/ic_btn_find_next.png b/core/res/res/drawable-xhdpi/ic_btn_find_next.png
deleted file mode 100644
index a334a5d..0000000
--- a/core/res/res/drawable-xhdpi/ic_btn_find_next.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-xhdpi/ic_btn_find_prev.png b/core/res/res/drawable-xhdpi/ic_btn_find_prev.png
deleted file mode 100644
index d7b3177..0000000
--- a/core/res/res/drawable-xhdpi/ic_btn_find_prev.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-xhdpi/ic_find_next_holo_dark.png b/core/res/res/drawable-xhdpi/ic_find_next_holo_dark.png
new file mode 100644
index 0000000..e822605
--- /dev/null
+++ b/core/res/res/drawable-xhdpi/ic_find_next_holo_dark.png
Binary files differ
diff --git a/core/res/res/drawable-xhdpi/ic_find_previous_holo_dark.png b/core/res/res/drawable-xhdpi/ic_find_previous_holo_dark.png
new file mode 100644
index 0000000..0ba45876c
--- /dev/null
+++ b/core/res/res/drawable-xhdpi/ic_find_previous_holo_dark.png
Binary files differ
diff --git a/core/res/res/drawable-xhdpi/ic_lockscreen_player_background.9.png b/core/res/res/drawable-xhdpi/ic_lockscreen_player_background.9.png
index 7fb0cbc..393bca6 100644
--- a/core/res/res/drawable-xhdpi/ic_lockscreen_player_background.9.png
+++ b/core/res/res/drawable-xhdpi/ic_lockscreen_player_background.9.png
Binary files differ
diff --git a/core/res/res/layout/keyguard_screen_password_landscape.xml b/core/res/res/layout/keyguard_screen_password_landscape.xml
index e34822d..803047e 100644
--- a/core/res/res/layout/keyguard_screen_password_landscape.xml
+++ b/core/res/res/layout/keyguard_screen_password_landscape.xml
@@ -206,7 +206,7 @@
 
     <!-- Area to overlay FaceLock -->
     <TextView android:id="@+id/faceLockAreaView"
-        android:visibility="gone"
+        android:visibility="invisible"
         android:layout_row="0"
         android:layout_column="2"
         android:layout_rowSpan="8"
diff --git a/core/res/res/layout/keyguard_screen_password_portrait.xml b/core/res/res/layout/keyguard_screen_password_portrait.xml
index e1280ba..6b03359 100644
--- a/core/res/res/layout/keyguard_screen_password_portrait.xml
+++ b/core/res/res/layout/keyguard_screen_password_portrait.xml
@@ -195,7 +195,7 @@
 
     <!-- Area to overlay FaceLock -->
     <TextView android:id="@+id/faceLockAreaView"
-        android:visibility="gone"
+        android:visibility="invisible"
         android:layout_row="3"
         android:layout_column="0"
         android:layout_rowSpan="2"
diff --git a/core/res/res/layout/keyguard_screen_unlock_landscape.xml b/core/res/res/layout/keyguard_screen_unlock_landscape.xml
index 2778f4e..1038657 100644
--- a/core/res/res/layout/keyguard_screen_unlock_landscape.xml
+++ b/core/res/res/layout/keyguard_screen_unlock_landscape.xml
@@ -162,7 +162,7 @@
 
     <!-- Area to overlay FaceLock -->
     <TextView android:id="@+id/faceLockAreaView"
-        android:visibility="gone"
+        android:visibility="invisible"
         android:layout_row="0"
         android:layout_column="1"
         android:layout_rowSpan="7"
diff --git a/core/res/res/layout/keyguard_screen_unlock_portrait.xml b/core/res/res/layout/keyguard_screen_unlock_portrait.xml
index 03fc79e..f286ccd 100644
--- a/core/res/res/layout/keyguard_screen_unlock_portrait.xml
+++ b/core/res/res/layout/keyguard_screen_unlock_portrait.xml
@@ -174,7 +174,7 @@
 
     <!-- Area to overlay FaceLock -->
     <TextView android:id="@+id/faceLockAreaView"
-        android:visibility="gone"
+        android:visibility="invisible"
         android:layout_row="4"
         android:layout_column="0"
         android:layout_rowSpan="1"
diff --git a/core/res/res/layout/keyguard_transport_control.xml b/core/res/res/layout/keyguard_transport_control.xml
index c951c45..7e2a31c 100644
--- a/core/res/res/layout/keyguard_transport_control.xml
+++ b/core/res/res/layout/keyguard_transport_control.xml
@@ -19,23 +19,28 @@
      but rather as include tags for this file or the layout will break. -->
 <com.android.internal.widget.TransportControlView
     xmlns:android="http://schemas.android.com/apk/res/android"
-    android:id="@+id/transport_controls"
-    android:background="@drawable/ic_lockscreen_player_background">
+    android:id="@+id/transport_controls">
 
-    <ImageView
-        android:id="@+id/albumart"
+    <!-- FrameLayout used as scrim to show between album art and buttons -->
+    <FrameLayout
         android:layout_width="match_parent"
         android:layout_height="match_parent"
-        android:layout_gravity="fill"
-        android:scaleType="centerCrop"
-        android:adjustViewBounds="false"
+        android:foreground="@drawable/ic_lockscreen_player_background">
+        <!-- We use ImageView for its cropping features, otherwise could be android:background -->
+        <ImageView
+            android:id="@+id/albumart"
+            android:layout_width="match_parent"
+            android:layout_height="match_parent"
+            android:layout_gravity="fill"
+            android:scaleType="centerCrop"
+            android:adjustViewBounds="false"
         />
+    </FrameLayout>
 
     <LinearLayout
         android:orientation="vertical"
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
-        android:background="#c8000000"
         android:layout_gravity="bottom">
         <TextView
             android:id="@+id/title"
diff --git a/core/res/res/menu/webview_find.xml b/core/res/res/menu/webview_find.xml
index 74a40aa..526b346 100644
--- a/core/res/res/menu/webview_find.xml
+++ b/core/res/res/menu/webview_find.xml
@@ -16,11 +16,11 @@
 
 <menu xmlns:android="http://schemas.android.com/apk/res/android">
     <item android:id="@+id/find_prev"
-        android:icon="@drawable/ic_btn_find_prev"
+        android:icon="@drawable/ic_find_previous_holo_dark"
         android:showAsAction="always"
         />
     <item android:id="@+id/find_next"
-        android:icon="@drawable/ic_btn_find_next"
+        android:icon="@drawable/ic_find_next_holo_dark"
         android:showAsAction="always"
         />
 </menu>
diff --git a/docs/html/guide/appendix/api-levels.jd b/docs/html/guide/appendix/api-levels.jd
index 7a0e17f..95542bc 100644
--- a/docs/html/guide/appendix/api-levels.jd
+++ b/docs/html/guide/appendix/api-levels.jd
@@ -84,6 +84,12 @@
 <table>
   <tr><th>Platform Version</th><th>API Level</th><th>VERSION_CODE</th><th>Notes</th></tr>
   
+    <tr><td><a href="{@docRoot}sdk/android-4.0.html">Android 4.0</a></td>
+    <td><a href="{@docRoot}sdk/api_diff/14/changes.html" title="Diff Report">14</a></td>
+    <td>{@link android.os.Build.VERSION_CODES#ICE_CREAM_SANDWICH}</td>
+    <td><a href="{@docRoot}sdk/android-4.0-highlights.html">Platform
+Highlights</a></td></tr>
+  
     <tr><td><a href="{@docRoot}sdk/android-3.2.html">Android 3.2</a></td>
     <td><a href="{@docRoot}sdk/api_diff/13/changes.html" title="Diff Report">13</a></td>
     <td>{@link android.os.Build.VERSION_CODES#HONEYCOMB_MR2}</td>
diff --git a/docs/html/guide/developing/projects/projects-cmdline.jd b/docs/html/guide/developing/projects/projects-cmdline.jd
index 08e0d9a..81c2c58 100644
--- a/docs/html/guide/developing/projects/projects-cmdline.jd
+++ b/docs/html/guide/developing/projects/projects-cmdline.jd
@@ -114,7 +114,7 @@
   <p class="caution"><strong>Caution:</strong> You should refrain from moving the location of the
   SDK directory, because this will break the SDK location property located in <code>local.properties</code>.
   If you need to update the SDK location, use the <code>android update project</code> command.
-  See <a href="UpdatingAProject">Updating a Project</a> for more information.</p>
+  See <a href="#UpdatingAProject">Updating a Project</a> for more information.</p>
 
   <h2 id="UpdatingAProject">Updating a Project</h2>
 
diff --git a/docs/html/guide/practices/optimizing-for-3.0.jd b/docs/html/guide/practices/optimizing-for-3.0.jd
index e968372..a24dba8f 100644
--- a/docs/html/guide/practices/optimizing-for-3.0.jd
+++ b/docs/html/guide/practices/optimizing-for-3.0.jd
@@ -411,8 +411,8 @@
 >Action Bar</a>: Samples that demonstrate various Action Bar features, such as tabs, logos, and
 action items.</li>
   <li><a
-href="{@docRoot}resources/samples/ApiDemos/src/com/example/android/apis/content/ClipboardSample.
-html">Clipboard</a>: An example of how to use the clipboard for copy and paste operations.</li>
+href="{@docRoot}resources/samples/ApiDemos/src/com/example/android/apis/content/ClipboardSample.html"
+>Clipboard</a>: An example of how to use the clipboard for copy and paste operations.</li>
   <li><a
 href="{@docRoot}resources/samples/ApiDemos/src/com/example/android/apis/view/DragAndDropDemo.html">
 Drag and Drop</a>: An example of how to perform drag and drop with new View events.</li>
@@ -427,11 +427,11 @@
 Property Animation</a>: Several samples using the new animation APIs to animate object
 properties.</li>
   <li><a
-href="{@docRoot}resources/samples/ApiDemos/src/com/example/android/apis/view/SearchViewActionBar.
-html">Search View Widget</a>: Example using the new search widget in the Action Bar (as an
+href="{@docRoot}resources/samples/ApiDemos/src/com/example/android/apis/view/SearchViewActionBar.html">
+Search View Widget</a>: Example using the new search widget in the Action Bar (as an
 "action view").</li>
   <li><a
-href="{@docRoot}resources/samples/Renderscript/index.html">Renderscript</a>: Contains several
+href="{@docRoot}resources/samples/RenderScript/index.html">Renderscript</a>: Contains several
 different applications that demonstrate using renderscript APIs for computations and 3D
 graphics.</li>
 </ul>
diff --git a/docs/html/guide/practices/screen-compat-mode.jd b/docs/html/guide/practices/screen-compat-mode.jd
index 6a77d60..7f10914 100644
--- a/docs/html/guide/practices/screen-compat-mode.jd
+++ b/docs/html/guide/practices/screen-compat-mode.jd
@@ -71,7 +71,7 @@
 android:minSdkVersion}</a> or <a
 href="{@docRoot}guide/topics/manifest/uses-sdk-element.html#target">{@code
 android:targetSdkVersion}</a> to {@code "4"} or higher, or set <a
-href="guide/topics/manifest/supports-screens-element.html#resizeable">{@code
+href="{@docRoot}guide/topics/manifest/supports-screens-element.html#resizeable">{@code
 android:resizeable}</a> to {@code "true"}.</p>
   </dd>
   
diff --git a/docs/html/guide/practices/screens_support.jd b/docs/html/guide/practices/screens_support.jd
index 6dec4b3..0c3c7d3 100644
--- a/docs/html/guide/practices/screens_support.jd
+++ b/docs/html/guide/practices/screens_support.jd
@@ -1111,7 +1111,7 @@
 <img src="{@docRoot}images/screens_support/scale-test.png" alt="" />
 <p class="img-caption"><strong>Figure 5.</strong> Comparison of pre-scaled and auto-scaled
 bitmaps, from <a
-href="resources/samples/ApiDemos/src/com/example/android/apis/graphics/DensityActivity.html">
+href="{@docRoot}resources/samples/ApiDemos/src/com/example/android/apis/graphics/DensityActivity.html">
 ApiDemos</a>.
 </p>
 </div>
@@ -1150,7 +1150,7 @@
 scaled bitmaps have slightly different appearances depending on whether they are pre-scaled or
 auto-scaled at draw time. You can find the source code for this sample application, which
 demonstrates using pre-scaled and auto-scaled bitmaps, in <a
-href="resources/samples/ApiDemos/src/com/example/android/apis/graphics/DensityActivity.html">
+href="{@docRoot}resources/samples/ApiDemos/src/com/example/android/apis/graphics/DensityActivity.html">
 ApiDemos</a>.</p>
 
 <p class="note"><strong>Note:</strong> In Android 3.0 and above, there should be no perceivable
diff --git a/docs/html/guide/topics/admin/device-admin.jd b/docs/html/guide/topics/admin/device-admin.jd
index 7dddd9a..7bbf5e6 100644
--- a/docs/html/guide/topics/admin/device-admin.jd
+++ b/docs/html/guide/topics/admin/device-admin.jd
@@ -619,8 +619,8 @@
 mDPM.setPasswordExpirationTimeout(mDeviceAdminSample, pwExpiration);
 </pre>
 
-<p>From the <a href="{@docRoot}resources/samples/ApiDemos/src/com/example/android/apis/app/
-DeviceAdminSample.html"> Device Administration API sample</a>, here is the code
+<p>From the <a href="{@docRoot}resources/samples/ApiDemos/src/com/example/android/apis/app/DeviceAdminSample.html"
+>Device Administration API sample</a>, here is the code
 that updates the password expiration status:</p>
 
 <pre>
diff --git a/docs/html/guide/topics/fundamentals/loaders.jd b/docs/html/guide/topics/fundamentals/loaders.jd
index d31f090..3aad204 100644
--- a/docs/html/guide/topics/fundamentals/loaders.jd
+++ b/docs/html/guide/topics/fundamentals/loaders.jd
@@ -32,7 +32,8 @@
     <h2>Related samples</h2>
    <ol>
      <li> <a
-href="{@docRoot}resources/samples/ApiDemos/src/com/example/android/apis/app/FragmentListCursorLoader.html">FragmentListCursorLoader</a></li>
+href="{@docRoot}resources/samples/ApiDemos/src/com/example/android/apis/app/LoaderCursor.html">
+LoaderCursor</a></li>
      <li> <a
 href="{@docRoot}resources/samples/ApiDemos/src/com/example/android/apis/app/LoaderThrottle.html">
 LoaderThrottle</a></li>
@@ -485,7 +486,9 @@
 <p>There are a few different samples in <strong>ApiDemos</strong> that
 illustrate how to use loaders:</p>
 <ul>
-  <li><a href="{@docRoot}resources/samples/ApiDemos/src/com/example/android/apis/app/FragmentListCursorLoader.html">FragmentListCursorLoader</a> &#8212; A complete version of the
+  <li><a
+href="{@docRoot}resources/samples/ApiDemos/src/com/example/android/apis/app/LoaderCursor.html">
+LoaderCursor</a> &#8212; A complete version of the
 snippet shown above.</li>
   <li><a href="{@docRoot}resources/samples/ApiDemos/src/com/example/android/apis/app/LoaderThrottle.html"> LoaderThrottle</a> &#8212; An example of how to use throttling to
 reduce the number of queries a content provider does then its data changes.</li>
diff --git a/docs/html/guide/topics/graphics/2d-graphics.jd b/docs/html/guide/topics/graphics/2d-graphics.jd
index ac2b47c..5abffb3 100644
--- a/docs/html/guide/topics/graphics/2d-graphics.jd
+++ b/docs/html/guide/topics/graphics/2d-graphics.jd
@@ -188,7 +188,7 @@
 
 <p>This document discusses the basics of using Drawable objects to draw graphics and how to use a
 couple subclasses of the Drawable class. For information on using Drawables to do frame-by-frame
-animation, see <a href="{@docRoot}guide/topics/animation/frame-animation.html">Frame-by-Frame
+animation, see <a href="{@docRoot}guide/topics/animation/drawable-animation.html">Drawable
 Animation</a>.</p>
 
 <p>A {@link android.graphics.drawable.Drawable} is a general abstraction for "something that can be
diff --git a/docs/html/guide/topics/graphics/animation.jd b/docs/html/guide/topics/graphics/animation.jd
index e8996f6..561369d 100644
--- a/docs/html/guide/topics/graphics/animation.jd
+++ b/docs/html/guide/topics/graphics/animation.jd
@@ -6,7 +6,8 @@
 
       <h2>See also</h2>
       <ol>
-        <li><a href="{@docRoot}guide/topics/graphics/property-animation.html">Property Animation</a></li>
+        <li><a href="{@docRoot}guide/topics/graphics/prop-animation.html">Property
+Animation</a></li>
         <li><a href="{@docRoot}guide/topics/graphics/view-animation.html">View Animation</a></li>
         <li><a href="{@docRoot}guide/topics/graphics/drawable-animation.html">Drawable Animation</a></li>
       <ol>
diff --git a/docs/html/guide/topics/graphics/index.jd b/docs/html/guide/topics/graphics/index.jd
index ffa9a39..ab623c2 100644
--- a/docs/html/guide/topics/graphics/index.jd
+++ b/docs/html/guide/topics/graphics/index.jd
@@ -5,7 +5,7 @@
   <div id="qv">
   <h2>Topics</h2>
   <ol>
-    <li><a href="{@docRoot}guide/topics/graphics/canvas.html">Canvas and Drawables</a></li>
+    <li><a href="{@docRoot}guide/topics/graphics/2d-graphics.html">Canvas and Drawables</a></li>
     <li><a href="{@docRoot}guide/topics/graphics/hardware-accel.html">Hardware Acceleration</a></li>
     <li><a href="{@docRoot}guide/topics/graphics/opengl.html">OpenGL</a></li>
   </ol>
diff --git a/docs/html/guide/topics/graphics/opengl.jd b/docs/html/guide/topics/graphics/opengl.jd
index 231f4ef..6a2a20f 100644
--- a/docs/html/guide/topics/graphics/opengl.jd
+++ b/docs/html/guide/topics/graphics/opengl.jd
@@ -40,14 +40,11 @@
     </ol>
     <h2>Related samples</h2>
     <ol>
-      <li><a href="{@docRoot}resources/samples/ApiDemos/src/com/example/android/apis/graphics/
-GLSurfaceViewActivity.html">GLSurfaceViewActivity</a></li>
-      <li><a href="{@docRoot}resources/samples/ApiDemos/src/com/example/android/apis/graphics/
-GLES20Activity.html">GLES20Activity</a></li>
-      <li><a href="{@docRoot}resources/samples/ApiDemos/src/com/example/android/apis/graphics/
-TouchRotateActivity.html">TouchRotateActivity</a></li>
-      <li><a href="{@docRoot}resources/samples/ApiDemos/src/com/example/android/apis/graphics/
-CompressedTextureActivity.html">Compressed Textures</a></li>
+      <li><a href="{@docRoot}resources/samples/ApiDemos/src/com/example/android/apis/graphics/GLSurfaceViewActivity.html">GLSurfaceViewActivity</a></li>
+      <li><a href="{@docRoot}resources/samples/ApiDemos/src/com/example/android/apis/graphics/GLES20Activity.html">GLES20Activity</a></li>
+      <li><a href="{@docRoot}resources/samples/ApiDemos/src/com/example/android/apis/graphics/TouchRotateActivity.html">TouchRotateActivity</a></li>
+      <li><a
+href="{@docRoot}resources/samples/ApiDemos/src/com/example/android/apis/graphics/CompressedTextureActivity.html">Compressed Textures</a></li>
     </ol>
     <h2>See also</h2>
     <ol>
@@ -94,8 +91,8 @@
     implement the touch listeners, as shown in OpenGL Tutorials for
     <a href="{@docRoot}resources/tutorials/opengl/opengl-es10.html#touch">ES 1.0</a>,
     <a href="{@docRoot}resources/tutorials/opengl/opengl-es20.html#touch">ES 2.0</a> and the <a
-href="{@docRoot}resources/samples/ApiDemos/src/com/example/android/apis/graphics/TouchRotateActivity
-.html">TouchRotateActivity</a> sample.</dd>
+href="{@docRoot}resources/samples/ApiDemos/src/com/example/android/apis/graphics/TouchRotateActivity.html"
+>TouchRotateActivity</a> sample.</dd>
 
   <dt><strong>{@link android.opengl.GLSurfaceView.Renderer}</strong></dt>
   <dd>This interface defines the methods required for drawing graphics in an OpenGL {@link
@@ -410,9 +407,8 @@
 android.opengl.ETC1Util} utility class and the {@code etc1tool} compression tool (located in the
 Android SDK at {@code &lt;sdk&gt;/tools/}). For an example of an Android application that uses
 texture compression, see the <a
-href="{@docRoot}resources/samples/ApiDemos/src/com/example/android/apis/graphics/
-CompressedTextureActivity.html">CompressedTextureActivity</a> code sample.
-</p>
+href="{@docRoot}resources/samples/ApiDemos/src/com/example/android/apis/graphics/CompressedTextureActivity.html"
+>CompressedTextureActivity</a> code sample.</p>
 
 <p>To check if the ETC1 format is supported on a device, call the {@link
 android.opengl.ETC1Util#isETC1Supported() ETC1Util.isETC1Supported()} method.</p>
diff --git a/docs/html/guide/topics/renderscript/compute.jd b/docs/html/guide/topics/renderscript/compute.jd
index e4c2283..8f08f59 100644
--- a/docs/html/guide/topics/renderscript/compute.jd
+++ b/docs/html/guide/topics/renderscript/compute.jd
@@ -1,6 +1,6 @@
 page.title=Compute
 parent.title=RenderScript
-parent.link=index.html 
+parent.link=index.html
 @jd:body
 
   <div id="qv-wrapper">
diff --git a/docs/html/guide/topics/renderscript/graphics.jd b/docs/html/guide/topics/renderscript/graphics.jd
index d8be85f..2fefecc 100644
--- a/docs/html/guide/topics/renderscript/graphics.jd
+++ b/docs/html/guide/topics/renderscript/graphics.jd
@@ -9,10 +9,26 @@
 
       <ol>
         <li>
-          <a href="#developing">Developing a RenderScript application</a>
-
+          <a href="#creating-graphics-rs">Creating a Graphics Renderscript</a>
           <ol>
-            <li><a href="#hello-graphics">The Hello Graphics application</a></li>
+            <li><a href="#creating-native">Creating the native Renderscript file</a></li>
+            <li><a href="#creating-entry">Creating the Renderscript entry point class</a></li>
+            <li><a href="#creating-view">Creating the surface view</a></li>
+            <li><a href="#creating-activity">Creating the activity</a></li>
+          </ol>
+        </li>
+        <li>
+          <a href="#drawing">Drawing</a>
+          <ol>
+            <li><a href="#drawing-rsg">Drawing using the rsgDraw functions</a></li>
+            <li><a href="#drawing-mesh">Drawing with a mesh</a></li>
+          </ol>
+        </li>
+        <li>
+          <a href="#shaders">Shaders</a>
+          <ol>
+            <li><a href="#shader-bindings">Shader bindings</a></li>
+            <li><a href="#shader-sampler">Defining a sampler</a></li>
           </ol>
         </li>
       </ol>
@@ -22,13 +38,13 @@
       <ol>
         <li><a href="{@docRoot}resources/samples/RenderScript/Balls/index.html">Balls</a></li>
 
-        <li><a href=
-        "{@docRoot}resources/samples/Renderscript/Fountain/index.html">Fountain</a></li>
+        <li><a href="{@docRoot}resources/samples/RenderScript/Fountain/index.html">Fountain</a></li>
 
         <li><a href="{@docRoot}resources/samples/RenderScript/HelloWorld/index.html">Hello
         World</a></li>
 
-        <li><a href="{@docRoot}resources/samples/RenderScript/Samples/index.html">Samples</a></li>
+        <li><a
+href="{@docRoot}resources/samples/RenderScript/MiscSamples/index.html">Misc Samples</a></li>
       </ol>
     </div>
   </div>
@@ -40,7 +56,7 @@
   will need to be familiar with APIs to appropriately render 3D graphics on an Android-powered
   device.</p>
 
-  <h2>Creating a Graphics RenderScript</h2>
+  <h2 id="creating-graphics-rs">Creating a Graphics RenderScript</h2>
 
   <p>Because of the various layers of code when writing a RenderScript application, it is useful to
   create the following files for a scene that you want to render:</p>
@@ -73,7 +89,7 @@
   RenderScript sample that is provided in the SDK as a guide (some code has been modified from its
   original form for simplicity).</p>
 
-  <h3>Creating the native RenderScript file</h3>
+  <h3 id="creating-native">Creating the native RenderScript file</h3>
 
   <p>Your native RenderScript code resides in a <code>.rs</code> file in the
   <code>&lt;project_root&gt;/src/</code> directory. You can also define <code>.rsh</code> header
@@ -102,8 +118,8 @@
       enough or more resources to do so, and renders as fast as it can if it does not.</p>
       
       <p>For more
-      information on using the RenderScript graphics functions, see <a href=
-      "using-graphics-api">Using the Graphics APIs</a>.</p>
+      information on using the RenderScript graphics functions, see the <a href=
+      "#drawing">Drawing</a> section.</p>
     </li>
 
     <li>An <code>init()</code> function. This allows you to do any initialization of your
@@ -153,7 +169,7 @@
 }
 </pre>
 
-  <h3>Creating the RenderScript entry point class</h3>
+  <h3 id="creating-entry">Creating the RenderScript entry point class</h3>
 
   <p>When you create a RenderScript (<code>.rs</code>) file, it is helpful to create a
   corresponding Android framework class that is an entry point into the <code>.rs</code> file. In
@@ -218,7 +234,7 @@
 
 </pre>
 
-  <h3>Creating the surface view</h3>
+  <h3 id="creating-view">Creating the surface view</h3>
 
   <p>To create a surface view to render graphics on, create a class that extends {@link
   android.renderscript.RSSurfaceView}. This class also creates a RenderScript context object
@@ -293,7 +309,7 @@
 
 </pre>
 
-  <h3>Creating the Activity</h3>
+  <h3 id="creating-activity">Creating the Activity</h3>
 
   <p>Applications that use RenderScript still adhere to activity lifecyle, and are part of the same
   view hierarchy as traditional Android applications, which is handled by the Android VM. This
@@ -329,9 +345,9 @@
 }
 </pre>
 
-  <h2>Drawing</h2>
-
-  <h3>Drawing using the rsgDraw functions</h3>
+  <h2 id="drawing">Drawing</h2>
+  <p>The following sections describe how to use the graphics functions to draw with Renderscript.</p>
+  <h3 id="drawing-rsg">Drawing using the rsgDraw functions</h3>
 
   <p>The native RenderScript APIs provide a few convenient functions to easily draw a polygon to
   the screen. You call these in your <code>root()</code> function to have them render to the
@@ -348,7 +364,7 @@
     the screen.</li>
   </ul>
 
-  <h3>Drawing with a mesh</h3>
+  <h3 id="drawing-mesh">Drawing with a mesh</h3>
 
   <p>When you want to draw complex shapes and textures to the screen, instantiate a {@link
   android.renderscript.Mesh} and draw it to the screen with <code>rsgDrawMesh()</code>. A {@link
@@ -559,7 +575,7 @@
   "{@docRoot}resources/samples/RenderScript/MiscSamples/src/com/example/android/rs/miscsamples/RsRenderStatesRS.html">
   RsRenderStatesRS</a> sample has many examples on how to create a shader without writing GLSL.</p>
 
-  <h3>Shader bindings</h3>
+  <h3 id="shader-bindings">Shader bindings</h3>
 
   <p>You can also set four pragmas that control the shaders' default bindings to the {@link
   android.renderscript.RenderScriptGL} context when the script is executing:</p>
@@ -599,7 +615,7 @@
 #pragma stateStore(parent)
 </pre>
 
-  <h3>Defining a sampler</h3>
+  <h3 id="shader-sampler">Defining a sampler</h3>
 
   <p>A {@link android.renderscript.Sampler} object defines how data is extracted from textures.
   Samplers are bound to Program objects (currently only a Fragment Program) alongside the texture
diff --git a/docs/html/guide/topics/resources/animation-resource.jd b/docs/html/guide/topics/resources/animation-resource.jd
index 480ca78..eaa698f 100644
--- a/docs/html/guide/topics/resources/animation-resource.jd
+++ b/docs/html/guide/topics/resources/animation-resource.jd
@@ -10,8 +10,8 @@
       <li><a href="#Property">Property Animation</a></li>
       <li><a href="#View">View Animation</a>
         <ol>
-          <li><a href="Tween">Tween animation</a></li>
-          <li><a href="Frame">Frame animation</a></li>
+          <li><a href="#Tween">Tween animation</a></li>
+          <li><a href="#Frame">Frame animation</a></li>
         </ol>      
       </li>
     </ol>
diff --git a/docs/html/guide/topics/search/search-dialog.jd b/docs/html/guide/topics/search/search-dialog.jd
index 27409d5..e06563d 100644
--- a/docs/html/guide/topics/search/search-dialog.jd
+++ b/docs/html/guide/topics/search/search-dialog.jd
@@ -807,8 +807,8 @@
 Bar</a> developer guide.</p>
 
 <p>Also see the <a
-href="{@docRoot}resources/samples/SearchableDictionary/src/com/example/android/searchabledict/
-SearchableDictionary.html">Searchable Dictionary</a> for an example implementation using
+href="{@docRoot}resources/samples/SearchableDictionary/src/com/example/android/searchabledict/SearchableDictionary.html"
+>Searchable Dictionary</a> for an example implementation using
 both the dialog and the widget.</p>
 
 
diff --git a/docs/html/guide/topics/usb/adk.jd b/docs/html/guide/topics/usb/adk.jd
index 120576b..6c7ab0d 100644
--- a/docs/html/guide/topics/usb/adk.jd
+++ b/docs/html/guide/topics/usb/adk.jd
@@ -396,7 +396,7 @@
 
     <li>Connect the ADK board (USB-A) to your Android-powered device (micro-USB). Ensure that the
     power cable to the accessory is plugged in or that the micro-USB port on the accesory is
-    connected to your computer for power (this also allows you to <a href="monitoring">monitor the
+    connected to your computer for power (this also allows you to <a href="#monitoring">monitor the
     ADK board</a>). When connected, accept the prompt that asks for whether or not to open the
     DemoKit application to connect to the accessory. If the prompt does not show up, connect and
     reconnect the accessory.</li>
@@ -625,8 +625,8 @@
   <code>AndroidAccessory::isAccessoryDevice()</code>. This method checks the vendor and product ID
   of the device descriptor. A device in accessory mode has a vendor ID of 0x18D1 and a product ID
   of 0x2D00 or 0x2D01. If the device is in accessory mode, then the ADK board can <a href=
-  "#establish-a">establish communication with the device</a>. If not, the board <a href=
-  "start-a">attempts to start the device in accessory mode</a>.</p>
+  "#establish">establish communication with the device</a>. If not, the board <a href=
+  "#start">attempts to start the device in accessory mode</a>.</p>
   <pre>
 bool AndroidAccessory::isConnected(void)
 {
@@ -699,7 +699,7 @@
 </pre>If this method returns false, the board waits until a new device is connected. If it is
 successful, the device displays itself on the USB bus as being in accessory mode when the ADK board
 re-enumerates the bus. When the device is in accessory mode, the accessory then <a href=
-"establish-a">establishes communication with the device</a>.
+"establish-adk">establishes communication with the device</a>.
 
   <h3 id="establish-adk">Establish communication with the device</h3>
 
diff --git a/docs/html/guide/topics/usb/index.jd b/docs/html/guide/topics/usb/index.jd
index 6dc8ec5..ef53bdf 100644
--- a/docs/html/guide/topics/usb/index.jd
+++ b/docs/html/guide/topics/usb/index.jd
@@ -42,8 +42,8 @@
   dependant on the device's hardware, regardless of platform level. You can filter for devices that
   support USB host and accessory through a <a href=
   "{@docRoot}guide/topics/manifest/uses-feature-element.html">&lt;uses-feature&gt;</a> element. See
-  the USB <a href="{@docRoot}guide/topics/USB/accessory.html">accessory</a> and <a href=
-  "{@docRoot}guide/topics/USB/host.html">host</a> documentation for more details.</p>
+  the USB <a href="{@docRoot}guide/topics/usb/accessory.html">accessory</a> and <a href=
+  "{@docRoot}guide/topics/usb/host.html">host</a> documentation for more details.</p>
 
   <h2>Debugging considerations</h2>
 
diff --git a/docs/html/index.jd b/docs/html/index.jd
index d412993..bb7721d 100644
--- a/docs/html/index.jd
+++ b/docs/html/index.jd
@@ -132,16 +132,14 @@
       'name':"Android 4.0",
       'img':"ics-android.png",
       'title':"Ice Cream Sandwich!",
-      'desc': "<br/><br/><br/><p>Oh my goodness, that looks tasty!</p>"
-/*
-+ "<p>For more information about all the changes in Android 3.2, read the "
-+ "<a href='{@docRoot}sdk/android-3.2.html'>version notes</a> and <a "
-+ "href='{@docRoot}sdk/api_diff/13/changes.html'>diff report</a>.</p>"
-+ "<p>If you have an existing SDK, add Android 3.0 as an "
-+ "<a href='{@docRoot}sdk/adding-components.html'>SDK "
-+ "component</a>. If you're new to Android, install the "
-+ "<a href='{@docRoot}sdk/index.html'>SDK starter package</a>."
-*/
+      'desc': "<p>Android 4.0 is here, delivering a unified UI for phones and tablets and "
++ "innovative features for users and developers. Check out the <a "
++ "href='http://developer.android.com/sdk/android-4.0-highlights.html'>Platform Highlights</a> "
++ "for an overview of the new features in Android 4.0.</p>"
++ "<p>For more information about API changes, read the "
++ "<a href='{@docRoot}sdk/android-4.0.html'>platform notes</a> and <a "
++ "href='{@docRoot}sdk/api_diff/14/changes.html'>diff report</a>. If you're new to Android, "
++ "get started with the <a href='/sdk/index.html'>SDK starter package</a>.</p>"
     },
 
     'tv': {
@@ -158,7 +156,7 @@
                 +  "<p><a href='http://code.google.com/tv'>Develop for Google TV &raquo;</a></p>"
     },
 
-
+/*
     'devphone': {
       'layout':"imgLeft",
       'icon':"devphone-small.png",
@@ -172,6 +170,7 @@
  + "<a href='http://market.android.com/publish'>Visit Android Market "
  + "to learn more &raquo;</a></p>"
     },
+    */
 
     'mapskey': {
       'layout':"imgLeft",
diff --git a/docs/html/sdk/android-4.0-highlights.jd b/docs/html/sdk/android-4.0-highlights.jd
new file mode 100644
index 0000000..fe69e12
--- /dev/null
+++ b/docs/html/sdk/android-4.0-highlights.jd
@@ -0,0 +1,995 @@
+page.title=Android 4.0 Platform Highlights
+
+@jd:body
+
+
+<style type="text/css">
+#jd-content {
+  max-width:1024px;
+}
+#jd-content div.screenshot {
+  float:left;
+  clear:left;
+  padding:15px 30px 15px 0;
+}
+#jd-content div.video {
+  float:right;
+  padding:0 60px 40px;
+  margin-top:-15px;
+}
+#jd-content table.columns {
+  margin:0 0 1em 0;
+}
+#jd-content table.columns td {
+  padding:0;
+}
+#jd-content table.columns td+td {
+  padding:0 2em;
+}
+#jd-content table.columns td img {
+  margin:0;
+}
+#jd-content table.columns td+td>*:first-child {
+  margin-top:-2em;
+}
+.green {
+  color:#8db529;
+  font-weight:bold;
+}
+</style>
+<!--
+<div class="video" style="border:1px solid gray;width:250px;height:180px;margin:1.5em">
+<object width="278" height="180">
+<xparam name="movie" value="http://www.youtube.com/v/Jx3pdWBlZ34?hl=en&fs=1"></param>
+<xparam name="allowFullScreen" value="true"></param><param name="allowscriptaccess"
+value="always"></param>
+ICS CONSUMER VIDEO [ziwang]
+<embed xsrc="http://www.youtube.com/v/Jx3pdWBlZ34?hl=en&fs=1" type="application/x-shockwave-flash"
+allowscriptaccess="always" allowfullscreen="true" width="278" height="180"></embed>
+</object>
+</div>
+-->
+<p>Welcome to Android 4.0!</p>
+
+<p>Android 4.0 delivers a refined, unified UI for phones and tablets and introduces innovative features for users and developers. This document provides a glimpse of the many new features and technologies that make Android 4.0 simple, beautiful, and beyond smart. <!--For technical details about
+new developer APIs described below, see the <a
+href="{@docRoot}sdk/android-4.0.html">Android 4.0 API Overview</a> document.--></p>
+
+<ul>
+  <li><a href="#UserFeatures">Android 4.0 for Users</a></li>
+  <li><a href="#DeveloperApis">Android 4.0 for Developers</a></li>
+</ul>
+
+<h2 id="UserFeatures" style="clear:right">Android 4.0 for Users</h2>
+
+<div style="padding-bottom:0em;">
+<a href="{@docRoot}sdk/images/4.0/home-lg.png" target="_android"><img style="float:right;xborder:1px solid #ddd;border-radius: 5px;" src="{@docRoot}sdk/images/4.0/home.png" alt="" height="300" width="180" /></a>
+<a href="{@docRoot}sdk/images/4.0/lock-lg.png" target="_android"><img style="float:right;border:1px solid #ddd;border-radius: 5px;" src="{@docRoot}sdk/images/4.0/lock.png" alt="" height="300"  width="180" /></a>
+</div>
+
+
+<h3 id="simple" style="color:#172861">Simple, beautiful, beyond smart</h3>
+
+<p>Android 4.0 builds on the things people love most about Android &mdash; easy
+multitasking, rich notifications, customizable home screens, resizable widgets,
+and deep interactivity &mdash; and adds powerful new ways of communicating and
+sharing.</p>
+
+<p style="margin-top:1em;margin-bottom:.75em;"><strong>Refined, evolved UI</strong></p>
+
+<p>Focused on bringing the power of Android to the surface, Android 4.0 makes
+<strong>common actions more visible</strong> and lets users navigate with
+simple, intuitive gestures. Refined <strong>animations</strong> and feedback
+throughout the system make interactions engaging and interesting. An entirely
+<strong>new typeface</strong> optimized for high-resolution screens improves
+readability and brings a polished, modern feel to the user interface.</p>
+
+<p>Virtual buttons in the System Bar let users navigate instantly to Back, Home,
+and Recent Apps. The <strong>System Bar</strong> and virtual buttons are present
+across all apps, but can be dimmed by applications for full-screen viewing.
+Users can access each application's contextual options in the <strong>Action
+Bar</strong>, displayed at the top (and sometimes also at the bottom) of the
+screen.</p>
+
+<p><strong>Multitasking</strong> is a key strength of Android and it's made even
+easier and more visual on Android 4.0. The Recent Apps button lets users jump
+instantly from one task to another using the list in the System Bar. The list
+pops up to show thumbnail images of apps used recently &mdash; tapping a
+thumbnail switches to the app.</p>
+
+<div  style="padding-top:0em;">
+<div style="margin-right:.5em;float:left;width:182px;padding-top:.5em;">
+<a href="{@docRoot}sdk/images/4.0/tasks-lg.png" target="_android">
+<img src="{@docRoot}sdk/images/4.0/tasks.png" alt="" height="240" width="144" style="border:1px solid #ddd;border-radius: 6px;" /></a>
+<div style="padding-left:1em;padding-bottom:1em;font-size:.9em;padding-right:1em;">The Recent Apps list makes multitasking simple.</div>
+<a href="{@docRoot}sdk/images/4.0/lock-camera-lg.png" target="_android">
+<img src="{@docRoot}sdk/images/4.0/lock-camera.png" alt="" height="240" width="144" style="border:1px solid #ddd;border-radius: 6px;" /></a>
+<div style="padding-left:1em;padding-bottom:1em;font-size:.9em;padding-right:1.75em;">Jump to the camera or see notifications without unlocking.</div>
+<a href="{@docRoot}sdk/images/4.0/contact-call-lg.png" target="_android">
+<img src="{@docRoot}sdk/images/4.0/contact-call.png" alt="" height="240" width="144" style="border:1px solid #ddd;border-radius: 6px;padding:0" /></a>
+<!--<a href="{@docRoot}sdk/images/4.0/quick-response-lg.png" target="_android">
+<img src="{@docRoot}sdk/images/4.0/quick-responses-new.png" alt="" height="240" width="144" style="border:1px solid #ddd;border-radius: 6px;" /></a>-->
+<div style="padding-left:1em;padding-bottom:.5em;font-size:.9em;padding-right:1.75em;">For incoming calls, you can respond instantly by&nbsp;text.</div>
+</div>
+</div>
+
+<p>Rich and interactive <strong>notifications</strong> let users keep in
+constant touch with incoming messages, play music tracks, see real-time updates
+from apps, and much more. On smaller-screen devices, notifications appear at the
+top of the screen, while on larger-screen devices they appear in the System
+Bar.</p>
+
+<div  style="padding-top:0em;">
+<div style="margin-right:1em;float:right;margin-left:1em;margin-top:.5em;margin-bottom:0;padding-bottom:0;width:326px">
+<a href="{@docRoot}sdk/images/4.0/allapps-lg.png" target="_android">
+<img src="{@docRoot}sdk/images/4.0/allapps.png" alt="" height="240" width="144" style="border:1px solid #ddd;border-radius: 6px;" /></a>
+<a href="{@docRoot}sdk/images/4.0/calendar-widget-lg.png" target="_android">
+<img src="{@docRoot}sdk/images/4.0/calendar-widget.png" alt="" height="240" width="144" style="border:1px solid #ddd;border-radius: 6px;" /></a>
+<div style="padding-left:1em;padding-bottom:1em;margin-top:0;padding-top:0;font-size:.9em"><!--<strong>Figure 3.</strong>-->The All Apps launcher (left) and resizable widgets (right) give you apps and rich content from the home screen.</div>
+</div>
+</div>
+
+
+<p style="margin-top:1em;margin-bottom:.75em;"><strong>Home screen folders and
+favorites tray</strong></p>
+
+<p>New <strong>home screen folders</strong> offer a new way for users to group
+their apps and shortcuts logically, just by dragging one onto another. From the
+All Apps launcher, users can now simply drag an app to get information about it
+or immediately uninstall it, or disable a pre-installed app.</p>
+
+<p>On smaller-screen devices, the home screen now includes a customizable
+<strong>favorites tray</strong> visible from all home screens. Users can drag
+apps, shortcuts, folders, and other priority items in or out of the favorites
+tray for instant access from any home screen.</p>
+
+
+<p style="margin-top:1em;margin-bottom:.75em;"><strong>Resizable
+widgets</strong></p>
+
+<p>Home screens in Android 4.0 are designed to be content-rich and customizable.
+Users can do much more than add shortcuts &mdash; they can embed live
+application content directly through interactive <strong>widgets</strong>.
+Widgets let users check email, flip through a calendar, play music, check social
+streams, and more &mdash; right from the home screen, without having to launch
+apps. Widgets are resizable, so users can expand them to show more content or
+shrink them to save space.</p>
+
+
+<p style="margin-top:1em;margin-bottom:.75em;"><strong>New lock screen
+actions</strong></p>
+
+<p>The lock screens now let users do more without unlocking. From the slide lock
+screen, users can <strong>jump directly to the camera</strong> for a picture or
+<strong>pull down the notifications window</strong> to check for messages. When
+listening to music, users can even manage music tracks and see album art. </p>
+
+
+<p style="margin-top:1em;margin-bottom:.75em;"><strong>Quick responses for
+incoming calls</strong></p>
+
+<p>When an incoming call arrives, users can now quickly <strong>respond by text
+message</strong>, without needing to pick up the call or unlock the device. On
+the incoming call screen, users simply slide a control to see a list of text
+responses and then tap to send and end the call. Users can add their own
+responses and manage the list from the Settings app.</p>
+
+
+<p style="margin-top:1em;margin-bottom:.75em;"><strong>Swipe to dismiss
+notifications, tasks, and browser tabs</strong></p>
+
+<p>Android 4.0 makes managing notifications, recent apps, and browoser tabs even
+easier. Users can now dismiss individual notifications, apps from the Recent
+Apps list, and browser tabs lists with a simple swipe of a finger. </p>
+
+<div  style="padding-top:0em;">
+<div style="margin-right:1em;float:right;margin-left:1em;margin-top:1.5em;margin-bottom:0;padding-bottom:0;width:200px">
+<a href="{@docRoot}sdk/images/4.0/text-replace-lg.png" target="_android">
+<img src="{@docRoot}sdk/images/4.0/text-replace.png" alt="" width="190" style="border:1px solid #ddd;border-radius: 6px;" /></a>
+<div style="padding-left:1em;padding-bottom:1.25em;margin-top:0;padding-top:0;font-size:.9em"><!--<strong>Figure 3.</strong>-->A spell-checker lets you find errors and fix them faster. </div>
+<a href="{@docRoot}sdk/images/4.0/tts-lg.png" target="_android">
+<img src="{@docRoot}sdk/images/4.0/tts.png" alt="" width="190" style="border:1px solid #ddd;border-radius: 6px;" /></a>
+<div style="padding-left:1em;padding-bottom:1.25em;margin-top:0;padding-top:0;font-size:.9em">A powerful voice input engine lets you dictate continously.</div>
+</div>
+</div>
+
+<p style="margin-top:1em;margin-bottom:.75em;"><strong>Improved text input and
+spell-checking</strong></p>
+  
+<p>The soft keyboard in Android 4.0 makes text input even faster and more
+accurate. Error correction and word suggestion are improved through a new set of
+default dictionaries and more accurate heuristics for handling cases such as
+double-typed characters, skipped letters, and omitted spaces. Word suggestion is
+also improved and the suggestion strip is simplified to show only three words at
+a time.</p>
+
+<p>To fix misspelled words more easily, Android 4.0 adds a spell-checker that
+locates and underlines errors and suggests replacement words. With one tap,
+users can choose from multiple spelling suggestions, delete a word, or add it to
+the dictionary. Users can even tap to see replacement suggestions for words that
+are spelled correctly. For specialized features or additional languages, users
+can now download and install third-party dictionaries, spell-checkers, and other
+text services.</p>
+
+
+<p style="margin-top:1em;margin-bottom:.75em;"><strong>Powerful voice input
+engine</strong></p>
+
+<p>Android 4.0 introduces a powerful new voice input engine that offers a
+continuous "open microphone" experience and streaming voice recognition. The new
+voice input engine lets users dictate the text they want, for as long as they
+want, using the language they want. Users can speak continously for a prolonged
+time, even pausing for intervals if needed, and dictate punctuation to create
+correct sentences. As the voice input engine enters text, it underlines possible
+dictation errors in gray. After dictating, users can tap the underlined words to
+quickly replace them from a list of suggestions.</p>
+
+<div  style="padding-top:0em;">
+<div style="margsin-right:.8em;float:left;width:350px;padding-top:1em;">
+<a href="{@docRoot}sdk/images/4.0/usage-all-lg.png" target="_android">
+<img src="{@docRoot}sdk/images/4.0/usage-all.png" alt="" height="240" width="144" style="border:1px solid #ddd;border-radius: 6px;" /></a>
+<a href="{@docRoot}sdk/images/4.0/usage-maps-lg.png" target="_android">
+<img src="{@docRoot}sdk/images/4.0/usage-maps.png" alt="" height="240" width="144" style="border:1px solid #ddd;border-radius: 6px;" /></a>
+<div style="padding-left:1em;padding-bottom:1em;font-size:.9em;padding-right:1.75em;"><!--<strong>Figure 3.</strong>--> Data usage controls let you monitor total usage by network type and application and then set limits if needed.</div>
+</div>
+</div>
+
+<p style="margin-top:1em;margin-bottom:.75em;"><strong>Control over network
+data</strong></p>
+
+<p>Mobile devices can make extensive use of network data for streaming content,
+synchronizing data, downloading apps, and more. To meet the needs of users with
+<strong>tiered or metered data plans</strong>, Android 4.0 adds new controls for
+managing network data usage.</p>
+
+<p>In the Settings app, colorful charts show the total data usage on each
+network type (mobile or Wi-Fi), as well as amount of data used by each running
+application. Based on their data plans, users can optionally set warning levels
+or hard limits on data usage or disable mobile data altogether. Users can also
+manage the background data used by individual applications as needed.</p>
+
+
+<p style="margin-top:1em;margin-bottom:.75em;"><strong>Designed for
+accessibility</strong></p>
+
+<p>A variety of new features greatly enhance the accessibility of Android 4.0
+for blind or visually impaired users. Most important is a new
+<strong>explore-by-touch mode</strong> that lets users navigate without having
+to see the screen. Touching the screen once triggers audible feedback that
+identifies the UI component below; a second touch in the same component
+activates it with a full touch event. The new mode is especially important to
+support users on new devices that use virtual buttons in the System Bar, rather
+than dedicated hardware buttons or trackballs. Also, standard apps are updated
+to offer an improved accessibility experience. The <strong>Browser</strong>
+supports a script-based screen reader for reading favorite web content and
+navigating sites. For improved readability, users can also increase the default
+font size used across&nbsp;the&nbsp;system.</p>
+
+<p>The accessibility experience begins at first setup &mdash; a simple
+<strong>touch gesture</strong> during setup (clockwise square from upper left)
+activates all accessibility features and loads a setup tutorial. Once
+accessibility features are active, everything visible on the screen can be
+spoken aloud by the standard screen reader.</p>
+
+
+<h3 id="comms" style="color:#172861">Communication and sharing</h3>
+
+<div  style="padding-top:0em;">
+<div style="margin-right:1em;float:right;margin-left:.5em;margin-top:1.5em;margin-bottom:0;padding-bottom:0;width:490px">
+<!--<img src="{@docRoot}sdk/images/4.0/contact-call.png" alt="" height="240" width="144" style="border:1px solid #ddd;border-radius: 6px;" />-->
+<a href="{@docRoot}sdk/images/4.0/contact-faves-lg.png" target="_android">
+<img src="{@docRoot}sdk/images/4.0/contact-faves.png" alt="" height="240" width="144" style="border:1px solid #ddd;border-radius: 6px;padding:0" /></a>
+<a href="{@docRoot}sdk/images/4.0/contact-connect-lg.png" target="_android">
+<img src="{@docRoot}sdk/images/4.0/contact-connect.png" alt="" height="240" width="144" style="border:1px solid #ddd;border-radius: 6px;padding:0" /></a>
+<a href="{@docRoot}sdk/images/4.0/contact-email-lg.png" target="_android">
+<img src="{@docRoot}sdk/images/4.0/contact-email.png" alt="" height="240" width="144" style="border:1px solid #ddd;border-radius: 6px;padding:0" /></a>
+
+<div style="padding-left:1em;padding-bottom:1.25em;margin-top:0;padding-top:0;font-size:.9em"><!--<strong>Figure 3.</strong>-->Contacts and profiles are integrated across apps and social networks, for a consistent, personal experience everywhere &mdash; from incoming calls to emails.</div>
+</div>
+</div>
+
+<p>Designed for the way people live, Android 4.0 integrates rich social
+communication and sharing touchpoints across the system, making it easy to talk,
+email, text, and share.</p>
+
+
+<p style="margin-top:1em;margin-bottom:.75em;"><strong>People and
+profiles</strong></p>
+
+<p>Throughout the system, a user’s social groups, profiles, and contacts are
+linked together and integrated for easy accessibility. At the center is a new
+<strong>People app</strong> that offers richer profile information, including a
+large profile picture, phone numbers, addresses and accounts, status updates,
+and a new button for connecting on integrated social networks. </p>
+
+<p>The user's own contact information is stored in a new <strong>"Me"
+profile</strong>, allowing easier sharing with apps and people. All of the
+user's integrated contacts are displayed in an easy to manage list, including
+controls over which contacts are shown from any integrated account or social
+network. Wherever the user navigates across the system, tapping a profile photo
+displays Quick Contacts, with shortcuts to phone numbers, text messaging, and
+more. </p>
+
+
+<p style="margin-top:1em;margin-bottom:.75em;"><strong>Unified calendar, visual
+voicemail</strong></p>
+
+<p>To help organize appointments and events, an updated <strong>Calendar
+app</strong> brings together personal, work, school, and social agendas. With
+user permission, other applications can contribute events to the calendar and
+manage reminders, for an integrated view across multiple calendar providers. The
+app is redesigned to let users manage events more easily. Calendars are
+color-coded and users can <strong>swipe left or right</strong> to change dates
+and pinch to zoom in or out agendas. </p>
+
+<p>In the phone app, a new <strong>visual voicemail</strong> features integrates
+incoming messages, voice transcriptions, and audio files from one or more
+providers. Third-party applications can integrate with the Phone app to add
+their own voice messages, transcriptions, and more to the visual voicemail
+inbox. </p>
+
+<div  style="padding-top:0em;">
+<div style="margsin-right:0em;float:left;width:282px;padding-top:1em;">
+<a href="{@docRoot}sdk/images/4.0/camera-lg.png" target="_android">
+<img src="{@docRoot}sdk/images/4.0/camera.png" alt="" width="240" height="144" style="border:1px solid #ddd;border-radius: 6px;" /></a>
+<a href="{@docRoot}sdk/images/4.0/gallery-edit-lg.png" target="_android">
+<img src="{@docRoot}sdk/images/4.0/gallery-edit.png" alt="" width="240" height="144" style="border:1px solid #ddd;border-radius: 6px;" /></a>
+<a href="{@docRoot}sdk/images/4.0/gallery-share-lg.png" target="_android">
+<img src="{@docRoot}sdk/images/4.0/gallery-share.png" alt="" width="240" height="144" style="border:1px solid #ddd;border-radius: 6px;" /></a>
+<div style="padding-left:1em;padding-bottom:1em;font-size:.9em;padding-right:2.75em;">Capture the picture you want, edit, and share instantly. </div>
+</div>
+</div>
+
+<p style="margin-top:1em;margin-bottom:.75em;"><strong>Rich and versatile camera
+capabilities</strong></p>
+
+<p>The Camera app includes many new features let users capture special moments
+with great photos and videos. After capturing images, they can edit and share
+them easily with friemds. </p>
+
+<p>When taking pictures, <strong>continuous focus</strong>, <strong>zero shutter
+lag exposure</strong>, and decreased shot-to-shot speed help capture clear,
+precise images. <strong>Stabilized image zoom</strong> lets users compose photos
+and video in the way they want, including while video is recording. For new
+flexibility and convenience while shooting video, users can now take
+<strong>snapshots at full video resolution</strong> just by tapping the screen
+as video continues to record.</p>
+
+<p>To make it easier to take great pictures of people, built-in <strong>face
+detection</strong> locates faces in the frame and automatically sets focus. For
+more control, users can <strong>tap to focus</strong> anywhere in the preview
+image. </p>
+
+<p>For capturing larger scenes, the Camera introduces a <strong>single-motion
+panorama</strong> mode. In this mode, the user starts an exposure and then
+slowly turns the Camera to encompass as wide a perspective as needed. The Camera
+assembles the full range of continuous imagery into a single panoramic
+photo.</p>
+
+<p>After taking a picture or video, users can quickly share it by email, text
+message, bluetooth, social networks, and more, just by tapping the thumbnail in
+the camera controls. </p>
+
+
+<div  style="padding-top:0em;">
+<div style="margin-right:1em;float:right;margin-left:1em;padding-top:1em;margin-bottom:1em;padding-bottom:0;width:160px">
+<img src="{@docRoot}sdk/images/4.0/gallery-widget.png" alt="" width="144" style="border:1px solid #ddd;border-radius: 6px;" />
+<div style="padding-left:1em;padding-bottom:1.25em;margin-top:0;padding-top:0;font-size:.9em">A Photo Gallery widget on the home screen.</div>
+</div>
+
+<p style="margin-top:1em;margin-bottom:.75em;"><strong>Redesigned Gallery app
+with photo editor</strong></p>
+
+<p>The Gallery app now makes it easier to manage, show, and share photos and
+videos. For managing collections, a <strong>redesigned album layout</strong>
+shows many more albums and offers larger thumbnails. There are many ways to sort
+albums, including by time, location, people, and tags. To help pictures look
+their best, the Gallery now includes a powerful <strong>photo editor</strong>.
+Users can crop and rotate pictures, set levels, remove red eyes, add effects,
+and much more. After retouching, users can select one or multiple pictures or
+videos to share instantly over email, text messaging, bluetooth, social
+networks, or other apps.</p>
+
+<p>An improved <strong>Picture Gallery widget</strong> lets users look at
+pictures directly on their home screen. The widget can display pictures from a
+selected album, shuffle pictures from all albums, or show a single image. After
+adding the widget to the home screen, users can flick through the photo stacks
+to locate the image they want, then tap to load it in Gallery. </p>
+
+<div  style="padding-top:0em;clear:right;">
+<div style="margin-right:1em;float:right;margin-left:1em;padding-top:1em;margin-bottom:1em;padding-bottom:0;width:320px">
+<img src="{@docRoot}sdk/images/4.0/live-effects.png" alt="" width="297" style="border:1px solid #ddd;border-radius: 6px;" />
+<div style="padding-left:1em;padding-bottom:1em;margin-top:0;padding-top:0;font-size:.9em">Live Effects let you change backgrounds and use Silly Faces during video.</div>
+</div>
+</div>
+
+<p style="margin-top:1em;margin-bottom:.75em;"><strong>Live Effects for transforming video</strong></p>
+
+<p>Live Effects is a collection of graphical transformations that add interest and fun to videos captured in the Camera app. For example, users can change the background behind them to any stock or custom image, for just the right setting when shooting video or using Google Talk video chat. Also available is Silly Faces, a set of morphing effects that use state-of-the-art face recognition and GPU filters to add great effects facial features during video capture. For example, you can use effects such as small eyes, big mouth, big nose, face squeeze, and more. Outside of the Camera app, Live Effects is available during video chat in the Google Talk app.</p>
+
+<div  style="padding-top:0em;">
+<div style="margsin-right:.8em;float:left;width:186px;padding-top:1em;">
+<a href="{@docRoot}sdk/images/4.0/screenshot-lg.png" target="_android">
+<img src="{@docRoot}sdk/images/4.0/screenshot.png" alt="" height="240"  width="144" style="border:1px solid #ddd;border-radius: 6px;" /></a>
+<div style="padding-left:1em;padding-bottom:1.25em;margin-top:0;padding-top:0;font-size:.9em"> Snapping a screenshot.</div>
+</div>
+</div>
+</div>
+
+<p style="margin-top:1em;margin-bottom:.75em;"><strong>Sharing with screenshots</strong></p>
+
+<p>Users can now share what's on their screens more easily by taking screenshots. Hardware buttons let them snap a <strong>screenshot</strong> and store it locally. Afterward, they can view, edit, and share the screen shot in Gallery or a similar app.</p>
+
+
+<h3 id="cloud" style="color:#172861">Cloud-connected experience</h3>
+
+<div  style="padding-top:0em;">
+<div style="margin-right:1em;float:right;margin-left:1em;padding-top:1em;margin-bottom:0;padding-bottom:0;width:326px">
+<a href="{@docRoot}sdk/images/4.0/browser-tabs-lg.png" target="_android">
+<img src="{@docRoot}sdk/images/4.0/browser-tabs.png" alt="" height="240" width="144" style="border:1px solid #ddd;border-radius: 6px;" /></a>
+<a href="{@docRoot}sdk/images/4.0/browser-lg.png" target="_android">
+<img src="{@docRoot}sdk/images/4.0/browser.png" alt="" height="240" width="144" style="border:1px solid #ddd;border-radius: 6px;" /></a>
+<div style="padding-left:1em;padding-bottom:1.25em;margin-top:0;padding-top:0;font-size:.9em"><!--<strong>Figure 3.</strong>-->The Browser tabs menu <em>(left)</em> lets you quickly switch browser tabs. The options menu <em>(right)</em> gives you new ways to manage your browsing experience.</div>
+<img src="{@docRoot}sdk/images/4.0/bbench.png" alt="" width="310" />
+<div style="padding-left:1em;padding-bottom:1em;margin-top:0;padding-top:0;font-size:.9em">Benchmark comparisons of Android Browser.</div>
+</div>
+</div>
+
+<p>Android has always been cloud-connected, letting users browse the web and sync photos, apps, games, email, and contacts &mdash; wherever they are and across all of their devices. Android 4.0 adds new browsing and email capabilities to let users take even more with them and keep communication organized.</p>
+
+
+<p style="margin-top:1em;margin-bottom:.75em;"><strong>Powerful web
+browsing</strong></p>
+
+<p>The Android Browser offers an experience that’s as rich and convenient as a
+desktop browser. It lets users instantly and manage <strong>sync Google Chrome
+bookmarks</strong> from all of their accounts, jump to their favorite content
+faster, and even save it for reading later in case there's no network
+available.</p>
+
+<p>To get the most out of web content, users can now request full
+<strong>desktop versions</strong> of web sites, rather than their mobile
+versions. Users can set their preference for web sites separately for each
+<strong>browser tab</strong>. For longer content, users can save a copy for
+<strong>offline reading</strong>. To find and open saved pages, users can browse
+a visual list that’s included with browser bookmarks and history.  For better
+readability and accessibility, users can increase the browser’s <strong>zoom
+levels</strong> and override the system default <strong>text sizes</strong>.</p>
+
+<p>Across all types of content, the Android Browser offers dramatically improved
+<strong>page rendering performance</strong> through updated versions of the
+WebKit core and the V8 Crankshaft compilation engine for JavaScript. In
+benchmarks run on a Nexus S device, the Android 4.0 browser showed an
+improvement of nearly 220% over the Android 2.3 browser in the V8 Benchmark
+Suite and more than 35% in the SunSpider 9.1 JavaScript Benchmark. When run on a
+Galaxy Nexus device, the Android 4.0 browser showed improvement of nearly 550%
+in the V8 benchmark and nearly 70% in the SunSpider benchmark.</p>
+
+
+<p style="margin-top:1em;margin-bottom:.75em;"><strong>Improved
+email</strong></p>
+
+<p>In Android 4.0, email is easier to send, read, and manage. For composing
+email, <strong>improved auto-completion</strong> of recipients helps with
+finding and adding frequent contacts more quickly. For easier input of frequent
+text, users can now create <strong>quick responses</strong> and store them in
+the app, then enter them from a convenient menu when composing. When replying to
+a message, users can now toggle the message to Reply All and Forward without
+changing screens.</p>
+
+<p>For easier browsing across accounts and labels, the app adds an
+<strong>integrated menu</strong> of accounts and recent labels. To help users
+locate and organize IMAP and Exchange email, the Email app now supports
+<strong>nested mail subfolders</strong>, each with synchronization rules. Users
+can also search across folders on the server, for faster results. </p>
+
+<p>For <strong>enterprises</strong>, the Email app supports EAS v14. It supports
+EAS certificate authentication, provides ABQ strings for device type and mode,
+and allows automatic sync to be disabled while roaming. Administrators can also
+limit attachment size or disable attachments.</p>
+
+<p>For keeping track of incoming email more easily, a <strong>resizable Email
+widget</strong> lets users flick through recent email right from the home
+screen, then jump into the Email app to compose or reply.</p>
+
+
+<div  style="padding-top:0em;">
+<div style="margsin-right:.8em;float:left;width:186px;padding-top:1em;">
+<a href="{@docRoot}sdk/images/4.0/beam-lg.png" target="_android">
+<img src="{@docRoot}sdk/images/4.0/beam.png" alt="" height="240" width="144" style="border:1px solid #ddd;border-radius: 6px;" /></a>
+<div style="padding-left:1em;padding-bottom:1em;margin-top:0;padding-top:0;font-size:.9em;padding-right:1.5em;">Android Beam lets users share what they are using with a single tap.</div>
+</div>
+</div>
+
+<h3 id="innovation" style="color:#172861">Innovation</h3>
+
+<p>Android is continously driving innovation forward, pushing the boundaries of
+communication and sharing with new capabilities and interactions.</p>
+
+<p style="margin-top:1em;margin-bottom:.75em;"><strong>Android Beam for
+NFC-based sharing</strong></p>
+
+<p>Android Beam is an innovative, convenient feature for sharing across two
+NFC-enabled devices, It lets people instantly exchange favorite apps, contacts,
+music, videos &mdash; almost anything. It’s incredibly simple and convenient to
+use &mdash; there’s no menu to open, application to launch, or pairing needed.
+Just touch one Android-powered phone to another, then tap to send.</p>
+
+<p>For sharing apps, Android Beam pushes a link to the app's details page in
+Android Market. On the other device, the Market app launches and loads the
+details page, for easy downloading of the app. Individual apps can build on
+Android Beam to add other types of interactions, such as passing game scores,
+initiating a multiplayer game or chat, and more.</p>
+
+<div  style="padding-top:0em;">
+<div style="margin-right:1em;float:right;margin-left:1em;margin-top:.5em;margin-bottom:0;padding-bottom:0;width:160px">
+<a href="{@docRoot}sdk/images/4.0/face-unlock-lg.png" target="_android">
+<img src="{@docRoot}sdk/images/4.0/face-unlock.png" alt="" height="240" width="144" style="border:1px solid #ddd;border-radius: 6px;" /></a>
+<div style="padding-left:1em;padding-bottom:1em;margin-top:0;padding-top:0;font-size:.9em">Face recognition lets you unlock your phone with your face.</div>
+</div>
+</div>
+
+<p style="margin-top:1em;margin-bottom:.75em;"><strong>Face Unlock</strong></p>
+
+<p>Android 4.0 introduces a completely new approach to securing a device, making
+it even more personal &mdash; Face Unlock is a new screen-lock option that lets
+users unlock their devices with their faces. It takes advantage of
+state-of-the-art facial recognition technology to register a face and to
+recognize it later when unlocking the device. Users just hold their devices in
+front of their faces to unlock, or use a backup PIN or pattern. </p>
+
+
+<p style="margin-top:1em;margin-bottom:.75em;"><strong>Wi-Fi Direct and Bluetooth HDP</strong></p>
+
+<p>Support for <strong>Wi-Fi Direct</strong> lets users connect directly to
+nearby peer devices over Wi-Fi, for more reliable, higher-speed communication.
+No internet connection or tethering is needed. Through third-party apps, users
+can connect to compatible devices to take advantage of new features such as
+instant sharing of files, photos, or other media; streaming video or audio from
+another device; or connecting to compatible printers or other devices.</p>
+
+<p>Android 4.0 also introduces built-in support for connecting to <strong>Bluetooth Health Device Profile (HDP)</strong> devices. With support from third-party apps, users can connect to wireless medical devices and sensors in hospitals, fitness centers, homes, and elsewhere. In addition, for connecting to higher quality Bluetooth audio devices, Android 4.0 adds support for Bluetooth Hands Free Profile (HFP) 1.6.</p>
+
+
+<h2 id="DeveloperApis" style="clear:right">New Developer Features</h2>
+
+<!-- <ul>
+<li><a href="#ui-dev">Unified UI framework for phones, tablets, and more</a></li>
+<li><a href="#communication-dev">Communication and sharing</a></li>
+<li><a href="#media-dev">New media capabilities</a></li>
+<li><a href="#connectivity-dev">New types of connectivity</a></li>
+<li><a href="#uicomp-dev">New UI components and capabilities</a></li>
+<li><a href="input-dev">New input types and text services</a></li>
+<li><a href="#accessibility-dev">Enhanced accessibility APIs</a></li>
+<li><a href="#data-dev">Efficient network usage</a></li>
+<li><a href="#security-dev">Security for apps and content</a></li>
+<li><a href="#enterprise-dev">Enhancements for Enterprise</a></li>
+</ul>-->
+
+<h3 id="ui-dev">Unified UI framework for phones, tablets, and more</h3>
+
+<p>Android 4.0 brings a unified UI framework that lets developers create
+elegant, innovative apps for phones, tablets, and more. It includes all of the
+familiar Android 3.x interface elements and APIs &mdash; fragments, content
+loaders, Action Bar, rich notifications, resizable home screen widgets, and more
+&mdash; as well as new elements and APIs.</p>
+
+<p>For developers, the unified UI framework in Android 4.0 means new UI tools,
+consistent design practices, simplified code and resources, and streamlined
+development across the range of Android-powered devices.</p>
+
+<div class="sidebox-wrapper">
+<div class="sidebox" style="border-left:1px solid #22a5ca;background-color:#fff;">
+  <h3>Key Android 3.x developer features, <br>now for phones too</h3>
+
+<p>Core UI</p>
+<ul>
+<li>Fragments and content loaders</li>
+<li>Resizeable home screen widgets</li>
+<li>Rich notifications</li>
+<li>Multi-selection, drag-drop, clipboard</li>
+<li>Improved screen-support API</li>
+<li>Hardware-accelerated 2D graphics</li>
+</ul>
+
+<p>Graphics and animation</p>
+<ul>
+<li>Property-based animation</li>
+<li>Renderscript 3D graphics</li>
+</ul>
+
+<p>Media and connectivity</p>
+<ul>
+<li>HTTP Live streaming</li>
+<li>Bluetooth A2DP and HSP devices</li>
+<li>Support for RTP</li>
+<li>MTP/PTP file transfer</li>
+<li>DRM framework</li>
+<li>Input from keyboard, mouse, gamepad, joystick</li>
+</ul>
+
+<p>Enterprise</p>
+<ul>
+<li>Full device encryption</li>
+<li>DPM policies for encrypted storage and passwords</li>
+</ul>
+</div>
+</div>
+
+<h3 id="communication-dev">Communication and sharing</h3>
+
+<p>Android 4.0 extends social and sharing features to any application on the
+device. Applications can integrate contacts, profile data, and calendar events
+from any of the user’s activities or social networks.</p>
+
+
+<p style="margin-top:1em;margin-bottom:.75em;"><strong>Social API</strong></p>
+
+<p>A shared social provider and API provide a new unified store for contacts,
+profile data, status updates, and photos. Any app or social network with user
+permission can contribute raw contacts and make them accessible to other apps
+and networks. Applications with user permission can also read profile data from
+the provider and display it in their applications.</p>
+
+<p>The social API lets applications store standard contact data as well as new
+types of content for any given contact, including large profile photos and
+recent activity feedback. Recent activity feedback is a standard way for
+applications to “tag” a contact with common activity, such as when the user
+calls the contact or sends an email or SMS message. The social provider uses the
+recent activity feedback as a new signal in ranking, such as for name
+auto-complete, to keep the most relevant contacts ranked closest to the top.</p>
+
+<p>Applications can also let users set up a social connection to a contact from
+the People app. When the user touches Add Connection in a contact, the app
+broadcasts a public intent that other apps can handle, displaying any UI needed
+to create the social connection.</p>
+
+<p>Building on the social API, developers can add powerful new interactions that
+span multiple social networks and contacts sources.</p>
+
+
+<p style="margin-top:1em;margin-bottom:.75em;"><strong>Calendar API</strong></p>
+
+<p>A shared calendar content provider and framework API make it easier for
+developers to add calendar services to their apps.</p>
+
+<p>With user permission, any application can add events to the shared database
+and manage dates, attendees, alerts, and reminders. Applications can also read
+entries from the database, including events contributed by other applications,
+and handle the display of event alerts and reminders. Using the calendar
+provider, applications can take advantage of event data sourced from a variety
+of apps and protocols, to offer innovative ways of viewing and managing a user’s
+events. Apps can also use of calendar data to improve the relevance of their
+other content.</p>
+
+<p>For lighter-weight access to calendar services, the Calendar app defines a
+set of public Intents for creating, viewing, and editing events. Rather than
+needing to implement a calendar UI and integrate directly with the calendar
+provider, applications can simply broadcast calendar Intents. When the Calendar
+app receives the Intents, it launches the appropriate UI and stores any event
+data entered. Using calendar Intents, for example, apps can let users add events
+directly from lists, dialogs, or home screen widgets, such as for making
+restaurant reservations or booking time with friends.</p>
+
+
+<p style="margin-top:1em;margin-bottom:.75em;"><strong>Visual voicemail
+API</strong></p>
+
+<p>A shared Voicemail provider and API allow developers to build applications
+that contribute to a unified voicemail store.  Voicemails are displayed and
+played in the call log tab of the platform’s Phone app.</p>
+
+
+<p style="margin-top:1em;margin-bottom:.75em;"><strong>Android Beam</strong></p>
+
+<p>Android Beam is an NFC-based feature that lets users instantly share
+information about the apps they are using, just by touching two NFC-enabled
+phones together. When the devices are in range &mdash; within a few centimeters
+&mdash; the system sets up an NFC connection and displays a sharing UI. To share
+whatever they are viewing with the other device, users just touch the screen.
+</p>
+
+<p>For developers, Android Beam is a new way of triggering almost any type of
+proximity-based interaction. For example, it can let users instantly exchange
+contacts, set up multiplayer gaming, join a chat or video call, share a photo or
+video, and more. The system provides the low-level NFC support and the sharing
+UI, while the foreground app provides lightweight data to transfer to the other
+device. Developers have complete control over the data that is shared and how it
+is handled, so almost any interaction is possible. For larger payloads,
+developers can even use Android Beam to initiate a connection and transfer the
+data over Bluetooth, without the need for user-visible pairing.</p>
+
+<p>Even if developers do not add custom interactions based on Android Beam they
+can still benefit from it being deeply integrated into Android. By default the
+system shares the app’s Android Market URL, so it’s easy for the user to
+download or purchase the app right away.</p>
+
+
+<p style="margin-top:1em;margin-bottom:.75em;"><strong>Modular sharing
+widget</strong></p>
+
+<p>The UI framework includes a new widget, ShareActionProvider, that lets
+developers quickly embed standard share functionality and UI in the Action Bar
+of their applications. Developers simply add ShareActionProvider to the menu and
+set an intent that describes the desired sharing action. The system handles the
+rest, building up the list of applications that can handle the share intent and
+dispatching the intent when the user chooses from the menu.</p>
+
+
+<h3 id="media-dev">New media capabilities</h3>
+
+<p style="margin-top:1em;margin-bottom:.75em;"><strong>Low-level streaming
+multimedia</strong></p>
+
+<p>Android 4.0 provides a direct, efficient path for low-level streaming
+multimedia. The new path is ideal for applications that need to maintain
+complete control over media data before passing it to the platform for
+presentation. For example, media applications can now retrieve data from any
+source, apply proprietary encryption/decryption, and then send the data to the
+platform for display.</p>
+
+<p>Applications can now send processed data to the platform as a multiplexed
+stream of audio/video content in MPEG-2 transport stream format. The platform
+de-muxes, decodes, and renders the content. The audio track is rendered to the
+active audio device, while the video track is rendered to either a Surface or a
+SurfaceTexture. When rendering to a SurfaceTexture, the application can apply
+subsequent graphics effects to each frame using OpenGL.</p>
+
+<p>To support this low-level streaming, the platform introduces a new native API
+based on <a href="http://www.khronos.org/openmax/al/" target="_top">Khronos
+OpenMAX AL 1.0.1</a>. The  API is implemented on the same underlying services as
+the platform’s existing OpenSL ES API, so developers can make use of both APIs
+together if needed. Tools support for low-level streaming multimedia will be
+available in an upcoming release of the Android NDK.</p>
+
+
+<p style="margin-top:1em;margin-bottom:.75em;"><strong>New camera
+capabilities</strong></p>
+
+<p>Developers can take advantage of a variety of new camera features in Android
+4.0. ZSL exposure, continuous focus, and image zoom let apps capture better
+still and video images, including during video capture. Apps can even capture
+full-resolution snapshots while shooting video. Apps can now set custom metering
+regions in a camera preview, then manage white balance and exposure dynamically
+for those regions. For easier focusing and image processing, a face-detection
+service identifies and tracks faces in a preview and returns their screen
+coordinates.</p>
+
+
+<p style="margin-top:1em;margin-bottom:.75em;"><strong>Media effects for
+transforming images and video</strong></p>
+
+<p>A set of high-performance transformation filters let developers apply rich
+effects to any image passed as an OpenGL ES 2.0 texture. Developers can adjust
+color levels and brightness, change backgrounds, sharpen, crop, rotate, add lens
+distortion, and apply other effects. The transformations are processed by the
+GPU, so they are fast enough for processing image frames loaded from disk,
+camera, or video stream.</p>
+
+
+<p style="margin-top:1em;margin-bottom:.75em;"><strong>Audio remote
+controls</strong></p>
+
+<p>Android 4.0 adds a new audio remote control API that lets media applications
+integrate with playback controls that are displayed in a remote view. Media
+applications can integrate with a remote music playback control that’s built
+into in the platform’s lock screen, allowing users to control song selection and
+playback without having to unlock and navigate to the music app.</p>
+
+<p>Using the audio remote control API, any music or media app can register to
+receive media button events from the remote control and then manage play state
+accordingly. The application can also supply metadata to the remote control,
+such as album art or image, play state, track number and description, duration,
+genre, and more.</p>
+
+
+<p style="margin-top:1em;margin-bottom:.75em;"><strong>New media codecs and
+containers</strong></p>
+
+<p>Android 4.0 adds support for additional media types and containers to give
+developers access to the formats they need. For high-quality compressed images,
+the media framework adds support for WebP content. For video, the framework now
+supports streaming VP8 content. For streaming multimedia, the framework supports
+HTTP Live streaming protocol version 3 and encoding of ADTS-contained AAC
+content. Additionally, developers can now use Matroska containers for Vorbis and
+VP8 content.</p>
+
+
+<h3 id="connectivity-dev">New types of connectivity</h3>
+
+<p style="margin-top:1em;margin-bottom:.75em;"><strong>Wi-Fi Direct</strong></p>
+
+<p>Developers can use a framework API to discover and connect directly to nearby
+devices over a high-performance, secure Wi-Fi Direct connection. No internet
+connection or hotspot is needed.</p>
+
+<p>Wi-Fi Direct opens new opportunities for developers to add innovative
+features to their applications. Applications can use Wi-Fi Direct to share
+files, photos, or other media between devices or between a desktop computer and
+an Android-powered device. Applications could also use Wi-Fi Direct to stream
+media content from a peer device such as a digital television or audio player,
+connect a group of users for gaming, print files, and more.</p>
+
+
+<p style="margin-top:1em;margin-bottom:.75em;"><strong>Bluetooth Health Device
+Profile (HDP)</strong></p>
+
+<p>Developers can now build powerful medical applications that use Bluetooth to
+communicate with wireless devices and sensors in hospitals, fitness centers,
+homes, and elsewhere. Applications can collect and manage data from HDP source
+devices and transmit it to backend medical applications such as records systems,
+data analysis services, and others.</p>
+
+<p>Using a framework API, applications can use Bluetooth to discover nearby
+devices, establish reliable or streaming data channels, and manage data
+transmission. Applications can supply any IEEE 11073 Manager to retrieve and
+interpret health data from Continua-certified devices such as heart-rate
+monitors, blood meters, thermometers, and scales. </p>
+
+
+<h3 id="uicomp-dev">New UI components and capabilities</h3>
+
+<p style="margin-top:1em;margin-bottom:.75em;"><strong>Layout
+enhancements</strong></p>
+
+<p>A new layout, GridLayout, improves the performance of Android applications by
+supporting flatter view hierarchies that are faster to layout and render.
+Because hierarchies are flatter, developers can also manage alignments between
+components that are visually related to each other even when they are not
+logically related, for precise control over application UI. GridLayout is also
+specifically designed to be configured by drag-and-drop design tools such as the
+ADT Plug-in for Eclipse.</p>
+
+
+<p style="margin-top:1em;margin-bottom:.75em;"><strong>OpenGL ES texture
+views</strong></p>
+
+<p>A new TextureView object lets developers directly integrate OpenGL ES
+textures as rendering targets in a UI hierarchy. The object lets developers
+display and manipulate OpenGL ES rendering just as they would a normal view
+object in the hierarchy, including moving, transforming, and animating the view
+as needed. The TextureView object makes it easy for developers to embed camera
+preview, decoded video, OpenGL game scenes, and more. TextureView can be viewed
+as a more powerful version of the existing SurfaceView object, since it offers
+the same benefits of access to a GL rendering surface, with the added advantage
+of having that surface participate fully in the normal view hierarchy.</p>
+
+
+<p style="margin-top:1em;margin-bottom:.75em;"><strong>Hardware-accelerated 2D
+drawing</strong></p>
+
+<p>All Android-powered devices running Android 4.0 are required to support
+hardware-accelerated 2D drawing. Developers can take advantage of this to add
+great UI effects while maintaining optimal performance on high-resolution
+screens, even on phones. For example, developers can rely on accelerated
+scaling, rotation, and other 2D operations, as well as accelerated UI components
+such as TextureView and compositing modes such as filtering, blending, and
+opacity.</p>
+
+
+<h3 id="input-dev">New input types and text services</h3>
+
+<p style="margin-top:1em;margin-bottom:.75em;"><strong>Stylus input, button
+support, hover events</strong></p>
+
+<p>Android 4.0 includes full support for stylus input events, including tilt and
+distance axes, pressure, and related motion event properties. To help
+applications distinguish motion events from different sources, the platform adds
+distinct tool types for stylus, finger, mouse, and eraser. For improved input
+from multi-button pointing devices, the platform now provides distinct primary,
+secondary, and tertiary buttons, as well as back and forward buttons.
+Hover-enter and hover-exit events are also added, for improved navigation and
+accessibility. Developers can build on these new input features to add powerful
+interactions to their apps, such as precise drawing and gesturing, handwriting
+and shape recognition, improved mouse input, and others.</p>
+
+
+<p style="margin-top:1em;margin-bottom:.75em;"><strong>Text services API for
+integrating spelling checkers</strong></p>
+
+<p>Android 4.0 lets applications query available text services such as
+dictionaries and spell checkers for word suggestions, corrections, and similar
+data. The text services are external to the active IME, so developers can create
+and distribute dictionaries and suggestion engines that plug into the platform.
+When an application receives results from a text service &mdash; for example,
+word suggestions &mdash; it can display them in a dedicated suggestion popup
+window directly inside the text view, rather than relying on the IME to display
+them. </p>
+
+
+<h3 id="accessibility-dev">Enhanced accessibility APIs</h3>
+
+<p>Android 4.0 adds new accessibility features and an enhanced API to let
+developers improve the user experience in their apps, especially on devices that
+don’t have hardware buttons. For accessibility services such as screen readers
+in particular, the platform offers new APIs to query window content, for easier
+navigation, better feedback, and richer user interfaces.</p>
+
+
+<p style="margin-top:1em;margin-bottom:.75em;"><strong>Accessibility
+API</strong></p>
+
+<p>To let applications manage interactions more effectively when accessibility
+features are enabled, the platform adds accessibility events for
+explore-by-touch mode, scrolling, and text selection. For these and other
+events, the platform can attach a new object called an accessibility record that
+provides extra information about the event context.</p>
+
+<p>Using the accessibility record and related APIs, applications can now access
+the view hierarchy associated with an event. Applications can query for key
+properties such as parent and child nodes, available states, supported actions,
+screen position, and more. Applications can also request changes to certain
+properties to help manage focus and selected state. For example, an
+accessibility service could use these new capabilities to add convenient
+features such as screen-search by text. </p> 
+
+
+<p style="margin-top:1em;margin-bottom:.75em;"><strong>Text-to-speech
+API</strong></p>
+
+<p>A new framework API lets developers write text-to-speech engines and make
+them available to any app requesting TTS capabilities.</p>
+
+
+<h3 id="data-dev">Efficient network usage</h3>
+
+<p>In Android 4.0, users can see how much network data their running apps are
+using. They can also set limits on data usage by network type and disable
+background data usage for specific applications. In this context, developers
+need to design their apps to run efficiently and follow best practices for
+checking the network connection. Android 4.0 provides network APIs to let
+applications meet those goals.</p>
+
+<p>As users move between networks or set limits on network data, the platform
+lets applications query for connection type and availability. Developers can use
+this information to dynamically manage network requests to ensure the best
+experience for users. Developers can also build custom network and data-usage
+options into their apps, then expose them to users directly from Settings by
+means of a new system Intent.</p>
+
+
+<h3 id="security-dev">Security for apps and content</h3>
+
+<p style="margin-top:1em;margin-bottom:.75em;"><strong>Secure management of
+credentials</strong></p>
+
+<p>Android 4.0 makes it easier for applications to manage authentication and
+secure sessions. A new keychain API and underlying encrypted storage let
+applications store and retrieve private keys and their corresponding certificate
+chains. Any application can use the keychain API to install and store user
+certificates and CAs securely.</p>
+
+
+<p style="margin-top:1em;margin-bottom:.75em;"><strong>Address Space Layout
+Randomization</strong></p>
+
+<p>Android 4.0 now provides address space layout randomization (ASLR) to help
+protect system and third party applications from exploitation due to
+memory-management issues.</p>
+
+
+<h3 id="enterprise-dev">Enhancements for Enterprise</h3>
+
+<p style="margin-top:1em;margin-bottom:.75em;"><strong>VPN client
+API</strong></p>
+
+<p>Developers can now build or extend their own VPN solutions on the platform
+using a new VPN API and underlying secure credential storage. With user
+permission, applications can configure addresses and routing rules, process
+outgoing and incoming packets, and establish secure tunnels to a remote server.
+Enterprises can also take advantage of a standard VPN client built into the
+platform that provides access to L2TP and IPSec protocols.</p>
+
+
+<p style="margin-top:1em;margin-bottom:.75em;"><strong>Device policy management
+for camera</strong></p>
+
+<p>The platform adds a new policy control for administrators who manage devices
+using an installed Device Policy Manager. Administrators can now remotely
+disable the camera on a managed device for users working in sensitive
+environments.</p>
+
+
+
+
+
diff --git a/docs/html/sdk/android-4.0.jd b/docs/html/sdk/android-4.0.jd
index 9a9f02a..da40d52 100644
--- a/docs/html/sdk/android-4.0.jd
+++ b/docs/html/sdk/android-4.0.jd
@@ -11,7 +11,6 @@
   <li><a href="#relnotes">Revisions</a></li>
   <li><a href="#api">API Overview</a></li>
   <li><a href="#Honeycomb">Previous APIs</a></li>
-  <li><a href="#api-diff">API Differences Report</a></li>
   <li><a href="#api-level">API Level</a></li>
   <li><a href="#apps">Built-in Applications</a></li>
   <li><a href="#locs">Locales</a></li>
@@ -31,14 +30,19 @@
 
 <p><em>API Level:</em>&nbsp;<strong>{@sdkPlatformApiLevel}</strong></p>
 
-<p>Android 4.0 (Ice Cream Sandwich) is a major platform release that adds new
-capabilities for users and developers. The sections below provide an overview
-of the new features and developer APIs.</p>
+<p>Android 4.0 is a major platform release that adds a variety of new features for users and app
+developers. Besides all the new features and APIs discussed below, Android 4.0 is an important
+platform release because it brings the extensive set of APIs and Holographic themes from Android 3.x
+to smaller screens. As an app developer, you now have a single platform and unified API framework
+that enables you to develop and publish your application with a single APK that provides an
+optimized user experience for handsets, tablets, and more, when running the same version of
+Android&mdash;Android 4.0 (API level 14) or greater. </p>
 
-<p>For developers, the Android {@sdkPlatformVersion} platform is available as a
-downloadable component for the Android SDK. The downloadable platform includes
+<p>The Android {@sdkPlatformVersion} platform is available as a
+downloadable component for the Android SDK so you can begin developing and testing your
+applications on Android 4.0 with the Android emulator. The downloadable platform includes
 an Android library and system image, as well as a set of emulator skins and
-more. The downloadable platform includes no external libraries.</p>
+more. The downloadable platform does not include any external libraries.</p>
 
 <p>To start developing or testing against Android {@sdkPlatformVersion},
 use the Android SDK Manager to download the platform into your SDK. For more
@@ -51,10 +55,11 @@
 soon as possible to be sure your application provides the best
 experience possible on the latest Android-powered devices.</p>
 
-<p>For a high-level introduction to the new user and developer features in Android 4.0, see the
+<p>For a high-level overview of the new user and developer features in Android 4.0, see the
 <a href="http://developer.android.com/sdk/android-4.0-highlights.html">Platform Highlights</a>.</p>
 
 
+
 <h2 id="relnotes">Revisions</h2>
 
 <p>To determine what revision of the Android {@sdkPlatformVersion} platform you
@@ -72,7 +77,12 @@
   <div class="toggle-content-toggleme" style="padding-left:2em;">
 
 <dl>
-<dt>Initial release. SDK Tools r14 or higher is recommended.</dt>
+<dt>Initial release. SDK Tools r14 or higher is required.
+  <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 and restart the Android SDK Manager. If you do not,
+  the Android 4.0 system components will not be available for download.</p>
+</dt>
 </dl>
 
   </div>
@@ -93,23 +103,24 @@
 
   <div class="toggle-content-toggleme" style="padding-left:2em;">
     <ol class="toc" style="margin-left:-1em">
-      <li><a href="#Contacts">Contact Provider</a></li>
+      <li><a href="#Contacts">Social APIs in Contacts Provider</a></li>
       <li><a href="#Calendar">Calendar Provider</a></li>
       <li><a href="#Voicemail">Voicemail Provider</a></li>
-      <li><a href="#Camera">Camera</a></li>
       <li><a href="#Multimedia">Multimedia</a></li>
-      <li><a href="#Bluetooth">Bluetooth</a></li>
+      <li><a href="#Camera">Camera</a></li>
       <li><a href="#AndroidBeam">Android Beam (NDEF Push with NFC)</a></li>
       <li><a href="#WiFiDirect">Wi-Fi Direct</a></li>
+      <li><a href="#Bluetooth">Bluetooth Health Devices</a></li>
+      <li><a href="#A11y">Accessibility</a></li>
+      <li><a href="#SpellChecker">Spell Checker Services</a></li>
+      <li><a href="#TTS">Text-to-speech Engines</a></li>
       <li><a href="#NetworkUsage">Network Usage</a></li>
       <li><a href="#RenderScript">RenderScript</a></li>
-      <li><a href="#A11y">Accessibility</a></li>
       <li><a href="#Enterprise">Enterprise</a></li>
       <li><a href="#Sensors">Device Sensors</a></li>
-      <li><a href="#TTS">Text-to-speech Engines</a></li>
-      <li><a href="#SpellChecker">Spell Checker Services</a></li>
       <li><a href="#ActionBar">Action Bar</a></li>
       <li><a href="#UI">User Interface and Views</a></li>
+      <li><a href="#Input">Input Framework</a></li>
       <li><a href="#Properties">Properties</a></li>
       <li><a href="#HwAccel">Hardware Acceleration</a></li>
       <li><a href="#Jni">JNI Changes</a></li>
@@ -124,12 +135,12 @@
 
 
 
-<h3 id="Contacts">Contact Provider</h3>
+<h3 id="Contacts">Social APIs in Contacts Provider</h3>
 
-<p>The contact APIs that are defined by the {@link android.provider.ContactsContract} provider have
-been extended to support new features such as a personal profile for the device owner, high
-resolution contact photos, and the ability for users to invite individual contacts to social
-networks that are installed on the device.</p>
+<p>The contact APIs defined by the {@link android.provider.ContactsContract} provider have been
+extended to support new social-oriented features such as a personal profile for the device owner and
+the ability for users to invite individual contacts to social networks that are installed on the
+device.</p>
 
 
 <h4>User Profile</h4>
@@ -152,17 +163,6 @@
 skeptical of apps that request it.</p>
 
 
-<h4>Large photos</h4>
-
-<p>Android now supports high resolution photos for contacts. Now, when you push a photo into a
-contact record, the system processes it into both a 96x96 thumbnail (as it has previously) and a
-256x256 "display photo" that's stored in a new file-based photo store (the exact dimensions that the
-system chooses may vary in the future). You can add a large photo to a contact by putting a large
-photo in the usual {@link android.provider.ContactsContract.CommonDataKinds.Photo#PHOTO} column of a
-data row, which the system will then process into the appropriate thumbnail and display photo
-records.</p>
-
-
 <h4>Invite Intent</h4>
 
 <p>The {@link android.provider.ContactsContract.Intents#INVITE_CONTACT} intent action allows an app
@@ -187,6 +187,17 @@
 file).</p>
 
 
+<h4>Large photos</h4>
+
+<p>Android now supports high resolution photos for contacts. Now, when you push a photo into a
+contact record, the system processes it into both a 96x96 thumbnail (as it has previously) and a
+256x256 "display photo" that's stored in a new file-based photo store (the exact dimensions that the
+system chooses may vary in the future). You can add a large photo to a contact by putting a large
+photo in the usual {@link android.provider.ContactsContract.CommonDataKinds.Photo#PHOTO} column of a
+data row, which the system will then process into the appropriate thumbnail and display photo
+records.</p>
+
+
 <h4>Contact Usage Feedback</h4>
 
 <p>The new {@link android.provider.ContactsContract.DataUsageFeedback} APIs allow you to  help track
@@ -287,20 +298,23 @@
 
 <h3 id="Voicemail">Voicemail Provider</h3>
 
-<p>The new voicemail APIs allows applications to add voicemails to a content provider on the device.
-Because the APIs currently do not allow third party apps to read all the voicemails from the system,
-the only third-party apps that should use the voicemail APIs are those that have voicemail to
-deliver to the user. For instance, it’s possible that a user has multiple voicemail sources, such as
-one provided by the phone’s service provider and others from VoIP or other alternative voice
-services. These apps can use the APIs to add their voicemails to the system for quick playback. The
-built-in Phone application presents all voicemails from the Voicemail Provider with a single list.
+<p>The new Voicemail Provider allows applications to add voicemails to the
+device, in order to present all the user's voicemails in a single visual presentation. For instance,
+it’s possible that a user has multiple voicemail sources, such as
+one from the phone’s service provider and others from VoIP or other alternative voice
+services. These apps can use the Voicemail Provider APIs to add their voicemails to the device. The
+built-in Phone application then presents all voicemails to the user in a unified presentation.
 Although the system’s Phone application is the only application that can read all the voicemails,
 each application that provides voicemails can read those that it has added to the system (but cannot
 read voicemails from other services).</p>
 
+<p>Because the APIs currently do not allow third-party apps to read all the voicemails from the
+system, the only third-party apps that should use the voicemail APIs are those that have voicemail
+to deliver to the user.</p>
+
 <p>The {@link android.provider.VoicemailContract} class defines the content provider for the
-voicemail APIs. The subclasses {@link android.provider.VoicemailContract.Voicemails} and {@link
-android.provider.VoicemailContract.Status} provide tables in which the Voicemail Providers can
+Voicemail Provder. The subclasses {@link android.provider.VoicemailContract.Voicemails} and {@link
+android.provider.VoicemailContract.Status} provide tables in which apps can
 insert voicemail data for storage on the device. For an example of a voicemail provider app, see the
 <a href="{@docRoot}resources/samples/VoicemailProviderDemo/index.html">Voicemail Provider
 Demo</a>.</p>
@@ -308,6 +322,142 @@
 
 
 
+
+<h3 id="Multimedia">Multimedia</h3>
+
+<p>Android 4.0 adds several new APIs for applications that interact with media such as photos,
+videos, and music.</p>
+
+
+<h4>Media Effects</h4>
+
+<p>A new media effects framework allows you to apply a variety of visual effects to images and
+videos. For example, image effects allow you to easily fix red-eye, convert an image to grayscale,
+adjust brightness, adjust saturation, rotate an image, apply a fisheye effect, and much more. The
+system performs all effects processing on the GPU to obtain maximum performance.</p>
+
+<p>For maximum performance, effects are applied directly to OpenGL textures, so your application
+must have a valid OpenGL context before it can use the effects APIs. The textures to which you apply
+effects may be from bitmaps, videos or even the camera. However, there are certain restrictions that
+textures must meet:</p>
+<ol>
+<li>They must be bound to a {@link android.opengl.GLES20#GL_TEXTURE_2D} texture image</li>
+<li>They must contain at least one mipmap level</li>
+</ol>
+
+<p>An {@link android.media.effect.Effect} object defines a single media effect that you can apply to
+an image frame. The basic workflow to create an {@link android.media.effect.Effect} is:</p>
+
+<ol>
+<li>Call {@link android.media.effect.EffectContext#createWithCurrentGlContext
+EffectContext.createWithCurrentGlContext()} from your OpenGL ES 2.0 context.</li>
+<li>Use the returned {@link android.media.effect.EffectContext} to call {@link
+android.media.effect.EffectContext#getFactory EffectContext.getFactory()}, which returns an instance
+of {@link android.media.effect.EffectFactory}.</li>
+<li>Call {@link android.media.effect.EffectFactory#createEffect createEffect()}, passing it an
+effect name from @link android.media.effect.EffectFactory}, such as {@link
+android.media.effect.EffectFactory#EFFECT_FISHEYE} or {@link
+android.media.effect.EffectFactory#EFFECT_VIGNETTE}.</li>
+</ol>
+
+<p>You can adjust an effect’s parameters by calling {@link android.media.effect.Effect#setParameter
+setParameter()} and passing a parameter name and parameter value. Each type of effect accepts
+different parameters, which are documented with the effect name. For example, {@link
+android.media.effect.EffectFactory#EFFECT_FISHEYE} has one parameter for the {@code scale} of the
+distortion.</p>
+
+<p>To apply an effect on a texture, call {@link android.media.effect.Effect#apply apply()} on the
+{@link
+android.media.effect.Effect} and pass in the input texture, it’s width and height, and the output
+texture. The input texture  must be bound to a {@link android.opengl.GLES20#GL_TEXTURE_2D} texture
+image (usually done by calling the {@link android.opengl.GLES20#glTexImage2D glTexImage2D()}
+function). You may provide multiple mipmap levels. If the output texture has not been bound to a
+texture image, it will be automatically bound by the effect as a {@link
+android.opengl.GLES20#GL_TEXTURE_2D} and with one mipmap level (0), which will have the same
+size as the input.</p> 
+
+<p>All effects listed in {@link android.media.effect.EffectFactory} are guaranteed to be supported.
+However, some additional effects available from external libraries are not supported by all devices,
+so you must first check if the desired effect from the external library is supported by calling
+{@link android.media.effect.EffectFactory#isEffectSupported isEffectSupported()}.</p>
+
+
+<h4>Remote control client</h4>
+
+<p>The new {@link android.media.RemoteControlClient} allows media players to enable playback
+controls from remote control clients such as the device lock screen. Media players can also expose
+information about the media currently playing for display on the remote control, such as track
+information and album art.</p>
+
+<p>To enable remote control clients for your media player, instantiate a {@link
+android.media.RemoteControlClient} with its constructor, passing it a {@link
+android.app.PendingIntent} that broadcasts {@link
+android.content.Intent#ACTION_MEDIA_BUTTON}. The intent must also declare the explicit {@link
+android.content.BroadcastReceiver} component in your app that handles the {@link
+android.content.Intent#ACTION_MEDIA_BUTTON} event.</p>
+
+<p>To declare which media control inputs your player can handle, you must call {@link
+android.media.RemoteControlClient#setTransportControlFlags setTransportControlFlags()} on your
+{@link android.media.RemoteControlClient}, passing a set of {@code FLAG_KEY_MEDIA_*} flags, such as
+{@link android.media.RemoteControlClient#FLAG_KEY_MEDIA_PREVIOUS} and {@link
+android.media.RemoteControlClient#FLAG_KEY_MEDIA_NEXT}.</p>
+
+<p>You must then register your {@link android.media.RemoteControlClient} by passing it to {@link
+android.media.AudioManager#registerRemoteControlClient MediaManager.registerRemoteControlClient()}.
+Once registered, the broadcast receiver you declared when you instantiated the {@link
+android.media.RemoteControlClient} will receive {@link android.content.Intent#ACTION_MEDIA_BUTTON}
+events when a button is pressed from a remote control. The intent you receive includes the {@link
+android.view.KeyEvent} for the media key pressed, which you can retrieve from the intent with {@link
+android.content.Intent#getParcelableExtra getParcelableExtra(Intent.EXTRA_KEY_EVENT)}.</p>
+
+<p>To display information on the remote control about the media playing, call {@link
+android.media.RemoteControlClient#editMetadata editMetaData()} and add metadata to the returned
+{@link android.media.RemoteControlClient.MetadataEditor}. You can supply a bitmap for media artwork,
+numerical information such as elapsed time, and text information such as the track title. For
+information on available keys see the {@code METADATA_KEY_*} flags in {@link
+android.media.MediaMetadataRetriever}.</p>
+
+<p>For a sample implementation, see the <a
+href="{@docRoot}resources/samples/RandomMusicPlayer/index.html">Random Music Player</a>, which
+provides compatibility logic such that it enables the remote control client on Android 4.0
+devices while continuing to support devices back to Android 2.1.</p>
+
+
+<h4>Media player</h4>
+
+<ul>
+<li>Streaming online media from {@link android.media.MediaPlayer} now requires the {@link
+android.Manifest.permission#INTERNET} permission. If you use {@link android.media.MediaPlayer} to
+play content from the Internet, be sure to add the {@link android.Manifest.permission#INTERNET}
+permission to your manifest or else your media playback will not work beginning with Android
+4.0.</li>
+
+<li>{@link android.media.MediaPlayer#setSurface(Surface) setSurface()} allows you define a {@link
+android.view.Surface} to behave as the video sink.</li>
+
+<li>{@link android.media.MediaPlayer#setDataSource(Context,Uri,Map) setDataSource()} allows you to
+send additional HTTP headers with your request, which can be useful for HTTP(S) live streaming</li>
+
+<li>HTTP(S) live streaming now respects HTTP cookies across requests</li>
+</ul>
+
+
+<h4>Media types</h4>
+
+<p>Android 4.0 adds support for:</p>
+<ul>
+<li>HTTP/HTTPS live streaming protocol version 3 </li>
+<li>ADTS raw AAC audio encoding</li>
+<li>WEBP images</li>
+<li>Matroska video</li>
+</ul>
+<p>For more info, see <a href="{@docRoot}guide/appendix/media-formats.html">Supported Media
+Formats</a>.</p>
+
+
+
+
+
 <h3 id="Camera">Camera</h3>
 
 <p>The {@link android.hardware.Camera} class now includes APIs for detecting faces and controlling
@@ -382,7 +532,7 @@
 to {@link android.hardware.Camera.Parameters#setFocusMode setFocusMode()}. When ready to capture
 a photo, call {@link android.hardware.Camera#autoFocus autoFocus()}. Your {@link
 android.hardware.Camera.AutoFocusCallback} immediately receives a callback to indicate whether
-focus was acheived. To resume CAF after receiving the callback, you must call {@link
+focus was achieved. To resume CAF after receiving the callback, you must call {@link
 android.hardware.Camera#cancelAutoFocus()}.</p>
 
 <p class="note"><strong>Note:</strong> Continuous auto focus is also supported when capturing
@@ -426,173 +576,6 @@
 
 
 
-<h3 id="Multimedia">Multimedia</h3>
-
-<p>Android 4.0 adds several new APIs for applications that interact with media such as photos,
-videos, and music.</p>
-
-
-<h4>Media player</h4>
-
-<ul>
-<li>Streaming online media from {@link android.media.MediaPlayer} now requires the {@link
-android.Manifest.permission#INTERNET} permission. If you use {@link android.media.MediaPlayer} to
-play content from the Internet, be sure to add the {@link android.Manifest.permission#INTERNET}
-permission to your manifest or else your media playback will not work beginning with Android
-4.0.</li>
-
-<li>{@link android.media.MediaPlayer#setSurface(Surface) setSurface()} allows you define a {@link
-android.view.Surface} to behave as the video sink.</li>
-
-<li>{@link android.media.MediaPlayer#setDataSource(Context,Uri,Map) setDataSource()} allows you to
-send additional HTTP headers with your request, which can be useful for HTTP(S) live streaming</li>
-
-<li>HTTP(S) live streaming now respects HTTP cookies across requests</li>
-</ul>
-
-
-<h4>Media types</h4>
-
-<p>Android 4.0 adds support for:</p>
-<ul>
-<li>HTTP/HTTPS live streaming protocol version 3 </li>
-<li>ADTS raw AAC audio encoding</li>
-<li>WEBP images</li>
-<li>Matroska video</li>
-</ul>
-<p>For more info, see <a href="{@docRoot}guide/appendix/media-formats.html">Supported Media
-Formats</a>.</p>
-
-
-
-<h4>Remote control client</h4>
-
-<p>The new {@link android.media.RemoteControlClient} allows media players to enable playback
-controls from remote control clients such as the device lock screen. Media players can also expose
-information about the media currently playing for display on the remote control, such as track
-information and album art.</p>
-
-<p>To enable remote control clients for your media player, instantiate a {@link
-android.media.RemoteControlClient} with its constructor, passing it a {@link
-android.app.PendingIntent} that broadcasts {@link
-android.content.Intent#ACTION_MEDIA_BUTTON}. The intent must also declare the explicit {@link
-android.content.BroadcastReceiver} component in your app that handles the {@link
-android.content.Intent#ACTION_MEDIA_BUTTON} event.</p>
-
-<p>To declare which media control inputs your player can handle, you must call {@link
-android.media.RemoteControlClient#setTransportControlFlags setTransportControlFlags()} on your
-{@link android.media.RemoteControlClient}, passing a set of {@code FLAG_KEY_MEDIA_*} flags, such as
-{@link android.media.RemoteControlClient#FLAG_KEY_MEDIA_PREVIOUS} and {@link
-android.media.RemoteControlClient#FLAG_KEY_MEDIA_NEXT}.</p>
-
-<p>You must then register your {@link android.media.RemoteControlClient} by passing it to {@link
-android.media.AudioManager#registerRemoteControlClient MediaManager.registerRemoteControlClient()}.
-Once registered, the broadcast receiver you declared when you instantiated the {@link
-android.media.RemoteControlClient} will receive {@link android.content.Intent#ACTION_MEDIA_BUTTON}
-events when a button is pressed from a remote control. The intent you receive includes the {@link
-android.view.KeyEvent} for the media key pressed, which you can retrieve from the intent with {@link
-android.content.Intent#getParcelableExtra getParcelableExtra(Intent.EXTRA_KEY_EVENT)}.</p>
-
-<p>To display information on the remote control about the media playing, call {@link
-android.media.RemoteControlClient#editMetadata editMetaData()} and add metadata to the returned
-{@link android.media.RemoteControlClient.MetadataEditor}. You can supply a bitmap for media artwork,
-numerical information such as elapsed time, and text information such as the track title. For
-information on available keys see the {@code METADATA_KEY_*} flags in {@link
-android.media.MediaMetadataRetriever}.</p>
-
-<p>For a sample implementation, see the <a
-href="{@docRoot}resources/samples/RandomMusicPlayer/index.html">Random Music Player</a>, which
-provides compatibility logic such that it enables the remote control client on Android 4.0
-devices while continuing to support devices back to Android 2.1.</p>
-
-
-<h4>Media Effects</h4>
-
-<p>A new media effects framework allows you to apply a variety of visual effects to images and
-videos. For example, image effects allow you to easily fix red-eye, convert an image to grayscale,
-adjust brightness, adjust saturation, rotate an image, apply a fisheye effect, and much more. The
-system performs all effects processing on the GPU to obtain maximum performance.</p>
-
-<p>For maximum performance, effects are applied directly to OpenGL textures, so your application
-must have a valid OpenGL context before it can use the effects APIs. The textures to which you apply
-effects may be from bitmaps, videos or even the camera. However, there are certain restrictions that
-textures must meet:</p>
-<ol>
-<li>They must be bound to a {@link android.opengl.GLES20#GL_TEXTURE_2D} texture image</li>
-<li>They must contain at least one mipmap level</li>
-</ol>
-
-<p>An {@link android.media.effect.Effect} object defines a single media effect that you can apply to
-an image frame. The basic workflow to create an {@link android.media.effect.Effect} is:</p>
-
-<ol>
-<li>Call {@link android.media.effect.EffectContext#createWithCurrentGlContext
-EffectContext.createWithCurrentGlContext()} from your OpenGL ES 2.0 context.</li>
-<li>Use the returned {@link android.media.effect.EffectContext} to call {@link
-android.media.effect.EffectContext#getFactory EffectContext.getFactory()}, which returns an instance
-of {@link android.media.effect.EffectFactory}.</li>
-<li>Call {@link android.media.effect.EffectFactory#createEffect createEffect()}, passing it an
-effect name from @link android.media.effect.EffectFactory}, such as {@link
-android.media.effect.EffectFactory#EFFECT_FISHEYE} or {@link
-android.media.effect.EffectFactory#EFFECT_VIGNETTE}.</li>
-</ol>
-
-<p>Not all devices support all effects, so you must first check if the desired effect is supported
-by calling {@link android.media.effect.EffectFactory#isEffectSupported isEffectSupported()}.</p>
-
-<p>You can adjust an effect’s parameters by calling {@link android.media.effect.Effect#setParameter
-setParameter()} and passing a parameter name and parameter value. Each type of effect accepts
-different parameters, which are documented with the effect name. For example, {@link
-android.media.effect.EffectFactory#EFFECT_FISHEYE} has one parameter for the {@code scale} of the
-distortion.</p>
-
-<p>To apply an effect on a texture, call {@link android.media.effect.Effect#apply apply()} on the
-{@link
-android.media.effect.Effect} and pass in the input texture, it’s width and height, and the output
-texture. The input texture  must be bound to a {@link android.opengl.GLES20#GL_TEXTURE_2D} texture
-image (usually done by calling the {@link android.opengl.GLES20#glTexImage2D glTexImage2D()}
-function). You may provide multiple mipmap levels. If the output texture has not been bound to a
-texture image, it will be automatically bound by the effect as a {@link
-android.opengl.GLES20#GL_TEXTURE_2D} and with one mipmap level (0), which will have the same
-size as the input.</p> 
-
-
-
-
-
-
-
-<h3 id="Bluetooth">Bluetooth</h3>
-
-<p>Android now supports Bluetooth Health Profile devices, so you can create applications that use
-Bluetooth to communicate with health devices that support Bluetooth, such as heart-rate monitors,
-blood meters, thermometers, and scales.</p>
-
-<p>Similar to regular headset and A2DP profile devices, you must call {@link
-android.bluetooth.BluetoothAdapter#getProfileProxy getProfileProxy()} with a {@link
-android.bluetooth.BluetoothProfile.ServiceListener} and the {@link
-android.bluetooth.BluetoothProfile#HEALTH} profile type to establish a connection with the profile
-proxy object.</p>
-
-<p>Once you’ve acquired the Health Profile proxy (the {@link android.bluetooth.BluetoothHealth}
-object), connecting to and communicating with paired health devices involves the following new
-Bluetooth classes:</p>
-<ul>
-<li>{@link android.bluetooth.BluetoothHealthCallback}: You must extend this class and implement the
-callback methods to receive updates about changes in the application’s registration state and
-Bluetooth channel state.</li>
-<li>{@link android.bluetooth.BluetoothHealthAppConfiguration}: During callbacks to your {@link
-android.bluetooth.BluetoothHealthCallback}, you’ll receive an instance of this object, which
-provides configuration information about the available Bluetooth health device, which you must use
-to perform various operations such as initiate and terminate connections with the {@link
-android.bluetooth.BluetoothHealth} APIs.</li>
-</ul>
-
-<p>For more information about using the Bluetooth Health Profile, see the documentation for {@link
-android.bluetooth.BluetoothHealth}.</p>
-
-
-
 <h3 id="AndroidBeam">Android Beam (NDEF Push with NFC)</h3>
 
 <p>Android Beam is a new NFC feature that allows you to send NDEF messages from one device to
@@ -670,9 +653,12 @@
 application installed, the system launches it; if it’s not installed, Android Market opens and takes
 the user to your application in order to install it.</p>
 
-<p>For some example code, see the <a
+<p>You can read more about Android Beam and other NFC features in the <a
+href="{@docRoot}guide/topics/nfc/nfc.html">NFC Basics</a> developer guide. For some example code
+using Android Beam, see the <a
 href="{@docRoot}resources/samples/AndroidBeamDemo/src/com/example/android/beam/Beam.html">Android
-Beam Demo</a> sample app.</p>
+Beam Demo</a>.</p>
+
 
 
 
@@ -763,85 +749,34 @@
 
 
 
-<h3 id="NetworkUsage">Network Usage</h3>
+<h3 id="Bluetooth">Bluetooth Health Devices</h3>
 
-<p>Android 4.0 gives users precise visibility of how much network data their applications are using.
-The Settings app provides controls that allow users to manage set limits for network data usage and
-even disable the use of background data for individual apps. In order to avoid users disabling your
-app’s access to data from the background, you should develop strategies to use use the data
-connection efficiently and adjust your usage depending on the type of connection available.</p>
+<p>Android now supports Bluetooth Health Profile devices, so you can create applications that use
+Bluetooth to communicate with health devices that support Bluetooth, such as heart-rate monitors,
+blood meters, thermometers, and scales.</p>
 
-<p>If your application performs a lot of network transactions, you should provide user settings that
-allow users to control your app’s data habits, such as how often your app syncs data, whether to
-perform uploads/downloads only when on Wi-Fi, whether to use data while roaming, etc. With these
-controls available to them, users are much less likely to disable your app’s access to data when
-they approach their limits, because they can instead precisely control how much data your app uses.
-If you provide a preference activity with these settings, you should include in its manifest
-declaration an intent filter for the {@link android.content.Intent#ACTION_MANAGE_NETWORK_USAGE}
-action. For example:</p>
+<p>Similar to regular headset and A2DP profile devices, you must call {@link
+android.bluetooth.BluetoothAdapter#getProfileProxy getProfileProxy()} with a {@link
+android.bluetooth.BluetoothProfile.ServiceListener} and the {@link
+android.bluetooth.BluetoothProfile#HEALTH} profile type to establish a connection with the profile
+proxy object.</p>
 
-<pre>
-&lt;activity android:name="DataPreferences" android:label="@string/title_preferences">
-    &lt;intent-filter>
-       &lt;action android:name="android.intent.action.MANAGE_NETWORK_USAGE" />
-       &lt;category android:name="android.intent.category.DEFAULT" />
-    &lt;/intent-filter>
-&lt;/activity>
-</pre>
-
-<p>This intent filter indicates to the system that this is the activity that controls your
-application’s data usage. Thus, when the user inspects how much data your app is using from the
-Settings app, a “View application settings" button is available that launches your
-preference activity so the user can refine how much data your app uses.</p>
-
-<p>Also beware that {@link android.net.ConnectivityManager#getBackgroundDataSetting()} is now
-deprecated and always returns true&mdash;use  {@link
-android.net.ConnectivityManager#getActiveNetworkInfo()} instead. Before you attempt any network
-transactions, you should always call {@link android.net.ConnectivityManager#getActiveNetworkInfo()}
-to get the {@link android.net.NetworkInfo} that represents the current network and query {@link
-android.net.NetworkInfo#isConnected()} to check whether the device has a
-connection. You can then check other connection properties, such as whether the device is
-roaming or connected to Wi-Fi.</p>
-
-
-
-
-
-
-
-
-<h3 id="RenderScript">RenderScript</h3>
-
-<p>Three major features have been added to RenderScript:</p>
-
+<p>Once you’ve acquired the Health Profile proxy (the {@link android.bluetooth.BluetoothHealth}
+object), connecting to and communicating with paired health devices involves the following new
+Bluetooth classes:</p>
 <ul>
-  <li>Off-screen rendering to a framebuffer object</li>
-  <li>Rendering inside a view</li>
-  <li>RS for each from the framework APIs</li>
+<li>{@link android.bluetooth.BluetoothHealthCallback}: You must extend this class and implement the
+callback methods to receive updates about changes in the application’s registration state and
+Bluetooth channel state.</li>
+<li>{@link android.bluetooth.BluetoothHealthAppConfiguration}: During callbacks to your {@link
+android.bluetooth.BluetoothHealthCallback}, you’ll receive an instance of this object, which
+provides configuration information about the available Bluetooth health device, which you must use
+to perform various operations such as initiate and terminate connections with the {@link
+android.bluetooth.BluetoothHealth} APIs.</li>
 </ul>
 
-<p>The {@link android.renderscript.Allocation} class now supports a {@link
-android.renderscript.Allocation#USAGE_GRAPHICS_RENDER_TARGET} memory space, which allows you to
-render things directly into the {@link android.renderscript.Allocation} and use it as a framebuffer
-object.</p>
-
-<p>{@link android.renderscript.RSTextureView} provides a means to display RenderScript graphics
-inside of a {@link android.view.View},  unlike {@link android.renderscript.RSSurfaceView}, which
-creates a separate window. This key difference allows you to do things such as move, transform, or
-animate an {@link android.renderscript.RSTextureView} as well as draw RenderScript graphics inside
-a view that lies within an activity layout.</p>
-
-<p>The {@link android.renderscript.Script#forEach Script.forEach()} method allows you to call
-RenderScript compute scripts from the VM level and have them automatically delegated to available
-cores on the device. You do not use this method directly, but any compute RenderScript that you
-write will have a {@link android.renderscript.Script#forEach forEach()}  method that you can call in
-the reflected RenderScript class. You can call the reflected {@link
-android.renderscript.Script#forEach forEach()} method by passing in an input {@link
-android.renderscript.Allocation} to process, an output {@link android.renderscript.Allocation} to
-write the result to, and a {@link android.renderscript.FieldPacker} data structure in case the
-RenderScript needs more information. Only one of the {@link android.renderscript.Allocation}s is
-necessary and the data structure is optional.</p>
-
+<p>For more information about using the Bluetooth Health Profile, see the documentation for {@link
+android.bluetooth.BluetoothHealth}.</p>
 
 
 
@@ -939,6 +874,7 @@
 
 
 
+
 <h4>Accessibility services</h4>
 
 <p>If you're developing an accessibility service, the information about various accessibility events
@@ -1000,78 +936,29 @@
 
 
 
-<h3 id="Enterprise">Enterprise</h3>
-
-<p>Android 4.0 expands the capabilities for enterprise application with the following features.</p>
-
-<h4>VPN services</h4>
-
-<p>The new {@link android.net.VpnService} allows applications to build their own VPN (Virtual
-Private Network), running as a {@link android.app.Service}. A VPN service creates an interface for a
-virtual network with its own address and routing rules and performs all reading and writing with a
-file descriptor.</p>
-
-<p>To create a VPN service, use {@link android.net.VpnService.Builder}, which allows you to specify
-the network address, DNS server, network route, and more. When complete, you can establish the
-interface by calling {@link android.net.VpnService.Builder#establish()}, which returns a {@link
-android.os.ParcelFileDescriptor}. </p>
-
-<p>Because  a VPN service can intercept packets, there are security implications.  As such, if you
-implement {@link android.net.VpnService}, then your service must require the {@link
-android.Manifest.permission#BIND_VPN_SERVICE} to ensure that only the system can bind to it (only
-the system is granted this permission&mdash;apps cannot request it). To then use your VPN service,
-users must manually enable it in the system settings.</p>
-
-
-<h4>Device restrictions</h4>
-
-<p>Applications that manage the device restrictions can now disable the camera using {@link
-android.app.admin.DevicePolicyManager#setCameraDisabled setCameraDisabled()} and the {@link
-android.app.admin.DeviceAdminInfo#USES_POLICY_DISABLE_CAMERA} property (applied with a {@code
-&lt;disable-camera /&gt;} element in the policy configuration file).</p>
-
-
-<h4>Certificate management</h4>
-
-<p>The new {@link android.security.KeyChain} class provides APIs that allow you to import and access
-certificates in the system key store. Certificates streamline the installation of both client
-certificates (to validate the identity of the user) and certificate authority certificates (to
-verify server identity). Applications such as web browsers or email clients can access the installed
-certificates to authenticate users to servers. See the {@link android.security.KeyChain}
-documentation for more information.</p>
 
 
 
+<h3 id="SpellChecker">Spell Checker Services</h3>
 
+<p>A new spell checker framework allows apps to create spell checkers in a manner similar to the
+input method framework (for IMEs). To create a new spell checker, you must implement a service that
+extends
+{@link android.service.textservice.SpellCheckerService} and extend the {@link
+android.service.textservice.SpellCheckerService.Session} class to provide spelling suggestions based
+on text provided by the interface's callback methods. In the {@link
+android.service.textservice.SpellCheckerService.Session} callback methods, you must return the
+spelling suggestions as {@link android.view.textservice.SuggestionsInfo} objects. </p>
 
+<p>Applications with a spell checker service must declare the {@link
+android.Manifest.permission#BIND_TEXT_SERVICE} permission as required by the service.
+The service must also declare an intent filter with {@code &lt;action
+android:name="android.service.textservice.SpellCheckerService" />} as the intent’s action and should
+include a {@code &lt;meta-data&gt;} element that declares configuration information for the spell
+checker. </p>
 
-
-<h3 id="Sensors">Device Sensors</h3>
-
-<p>Two new sensor types have been added in Android 4.0:</p>
-
-<ul>
-  <li>{@link android.hardware.Sensor#TYPE_AMBIENT_TEMPERATURE}: A temperature sensor that provides
-the ambient (room) temperature in degrees Celsius.</li>
-  <li>{@link android.hardware.Sensor#TYPE_RELATIVE_HUMIDITY}: A humidity sensor that provides the
-relative ambient (room) humidity as a percentage.</li>
-</ul>
-
-<p>If a device has both {@link android.hardware.Sensor#TYPE_AMBIENT_TEMPERATURE} and  {@link
-android.hardware.Sensor#TYPE_RELATIVE_HUMIDITY} sensors, you can use them to calculate the dew point
-and the absolute humidity.</p>
-
-<p>The previous temperature sensor, {@link android.hardware.Sensor#TYPE_TEMPERATURE}, has been
-deprecated. You should use the {@link android.hardware.Sensor#TYPE_AMBIENT_TEMPERATURE} sensor
-instead.</p>
-
-<p>Additionally, Android’s three synthetic sensors have been improved so they now have lower latency
-and smoother output. These sensors include the gravity sensor ({@link
-android.hardware.Sensor#TYPE_GRAVITY}), rotation vector sensor ({@link
-android.hardware.Sensor#TYPE_ROTATION_VECTOR}), and linear acceleration sensor ({@link
-android.hardware.Sensor#TYPE_LINEAR_ACCELERATION}). The improved sensors rely on the gyroscope
-sensor to improve their output, so the sensors appear only on devices that have a gyroscope.</p>
-
+<p>See the <a href="{@docRoot}resources/samples/SampleSpellCheckerService/index.html">Spell
+Checker</a> sample app for example code.</p>
 
 
 
@@ -1133,23 +1020,45 @@
 
 
 
-<h3 id="SpellChecker">Spell Checker Services</h3>
+<h3 id="NetworkUsage">Network Usage</h3>
 
-<p>A new spell checker framework allows apps to create spell checkers in a manner similar to the
-input method framework. To create a new spell checker, you must implement a service that extends
-{@link android.service.textservice.SpellCheckerService} and extend the {@link
-android.service.textservice.SpellCheckerService.Session} class to provide spelling suggestions based
-on text provided by interface callback methods. In the {@link
-android.service.textservice.SpellCheckerService.Session} callback methods, you must return the
-spelling suggestions as {@link android.view.textservice.SuggestionsInfo} objects. </p>
+<p>Android 4.0 gives users precise visibility of how much network data their applications are using.
+The Settings app provides controls that allow users to manage set limits for network data usage and
+even disable the use of background data for individual apps. In order to avoid users disabling your
+app’s access to data from the background, you should develop strategies to use use the data
+connection efficiently and adjust your usage depending on the type of connection available.</p>
 
-<p>Applications with a spell checker service must declare the {@link
-android.Manifest.permission#BIND_TEXT_SERVICE} permission as required by the service, such that
-other services must have this permission in order for them to bind with the spell checker service.
-The service must also declare an intent filter with {@code &lt;action
-android:name="android.service.textservice.SpellCheckerService" />} as the intent’s action and should
-include a {@code &lt;meta-data&gt;} element that declares configuration information for the spell
-checker. </p>
+<p>If your application performs a lot of network transactions, you should provide user settings that
+allow users to control your app’s data habits, such as how often your app syncs data, whether to
+perform uploads/downloads only when on Wi-Fi, whether to use data while roaming, etc. With these
+controls available to them, users are much less likely to disable your app’s access to data when
+they approach their limits, because they can instead precisely control how much data your app uses.
+If you provide a preference activity with these settings, you should include in its manifest
+declaration an intent filter for the {@link android.content.Intent#ACTION_MANAGE_NETWORK_USAGE}
+action. For example:</p>
+
+<pre>
+&lt;activity android:name="DataPreferences" android:label="@string/title_preferences">
+    &lt;intent-filter>
+       &lt;action android:name="android.intent.action.MANAGE_NETWORK_USAGE" />
+       &lt;category android:name="android.intent.category.DEFAULT" />
+    &lt;/intent-filter>
+&lt;/activity>
+</pre>
+
+<p>This intent filter indicates to the system that this is the activity that controls your
+application’s data usage. Thus, when the user inspects how much data your app is using from the
+Settings app, a “View application settings" button is available that launches your
+preference activity so the user can refine how much data your app uses.</p>
+
+<p>Also beware that {@link android.net.ConnectivityManager#getBackgroundDataSetting()} is now
+deprecated and always returns true&mdash;use  {@link
+android.net.ConnectivityManager#getActiveNetworkInfo()} instead. Before you attempt any network
+transactions, you should always call {@link android.net.ConnectivityManager#getActiveNetworkInfo()}
+to get the {@link android.net.NetworkInfo} that represents the current network and query {@link
+android.net.NetworkInfo#isConnected()} to check whether the device has a
+connection. You can then check other connection properties, such as whether the device is
+roaming or connected to Wi-Fi.</p>
 
 
 
@@ -1158,6 +1067,121 @@
 
 
 
+<h3 id="RenderScript">RenderScript</h3>
+
+<p>Three major features have been added to RenderScript:</p>
+
+<ul>
+  <li>Off-screen rendering to a framebuffer object</li>
+  <li>Rendering inside a view</li>
+  <li>RS for each from the framework APIs</li>
+</ul>
+
+<p>The {@link android.renderscript.Allocation} class now supports a {@link
+android.renderscript.Allocation#USAGE_GRAPHICS_RENDER_TARGET} memory space, which allows you to
+render things directly into the {@link android.renderscript.Allocation} and use it as a framebuffer
+object.</p>
+
+<p>{@link android.renderscript.RSTextureView} provides a means to display RenderScript graphics
+inside of a {@link android.view.View},  unlike {@link android.renderscript.RSSurfaceView}, which
+creates a separate window. This key difference allows you to do things such as move, transform, or
+animate an {@link android.renderscript.RSTextureView} as well as draw RenderScript graphics inside
+a view that lies within an activity layout.</p>
+
+<p>The {@link android.renderscript.Script#forEach Script.forEach()} method allows you to call
+RenderScript compute scripts from the VM level and have them automatically delegated to available
+cores on the device. You do not use this method directly, but any compute RenderScript that you
+write will have a {@link android.renderscript.Script#forEach forEach()}  method that you can call in
+the reflected RenderScript class. You can call the reflected {@link
+android.renderscript.Script#forEach forEach()} method by passing in an input {@link
+android.renderscript.Allocation} to process, an output {@link android.renderscript.Allocation} to
+write the result to, and a {@link android.renderscript.FieldPacker} data structure in case the
+RenderScript needs more information. Only one of the {@link android.renderscript.Allocation}s is
+necessary and the data structure is optional.</p>
+
+
+
+
+
+
+
+
+
+<h3 id="Enterprise">Enterprise</h3>
+
+<p>Android 4.0 expands the capabilities for enterprise application with the following features.</p>
+
+<h4>VPN services</h4>
+
+<p>The new {@link android.net.VpnService} allows applications to build their own VPN (Virtual
+Private Network), running as a {@link android.app.Service}. A VPN service creates an interface for a
+virtual network with its own address and routing rules and performs all reading and writing with a
+file descriptor.</p>
+
+<p>To create a VPN service, use {@link android.net.VpnService.Builder}, which allows you to specify
+the network address, DNS server, network route, and more. When complete, you can establish the
+interface by calling {@link android.net.VpnService.Builder#establish()}, which returns a {@link
+android.os.ParcelFileDescriptor}. </p>
+
+<p>Because  a VPN service can intercept packets, there are security implications.  As such, if you
+implement {@link android.net.VpnService}, then your service must require the {@link
+android.Manifest.permission#BIND_VPN_SERVICE} to ensure that only the system can bind to it (only
+the system is granted this permission&mdash;apps cannot request it). To then use your VPN service,
+users must manually enable it in the system settings.</p>
+
+
+<h4>Device policies</h4>
+
+<p>Applications that manage the device restrictions can now disable the camera using {@link
+android.app.admin.DevicePolicyManager#setCameraDisabled setCameraDisabled()} and the {@link
+android.app.admin.DeviceAdminInfo#USES_POLICY_DISABLE_CAMERA} property (applied with a {@code
+&lt;disable-camera /&gt;} element in the policy configuration file).</p>
+
+
+<h4>Certificate management</h4>
+
+<p>The new {@link android.security.KeyChain} class provides APIs that allow you to import and access
+certificates in the system key store. Certificates streamline the installation of both client
+certificates (to validate the identity of the user) and certificate authority certificates (to
+verify server identity). Applications such as web browsers or email clients can access the installed
+certificates to authenticate users to servers. See the {@link android.security.KeyChain}
+documentation for more information.</p>
+
+
+
+
+
+
+
+<h3 id="Sensors">Device Sensors</h3>
+
+<p>Two new sensor types have been added in Android 4.0:</p>
+
+<ul>
+  <li>{@link android.hardware.Sensor#TYPE_AMBIENT_TEMPERATURE}: A temperature sensor that provides
+the ambient (room) temperature in degrees Celsius.</li>
+  <li>{@link android.hardware.Sensor#TYPE_RELATIVE_HUMIDITY}: A humidity sensor that provides the
+relative ambient (room) humidity as a percentage.</li>
+</ul>
+
+<p>If a device has both {@link android.hardware.Sensor#TYPE_AMBIENT_TEMPERATURE} and  {@link
+android.hardware.Sensor#TYPE_RELATIVE_HUMIDITY} sensors, you can use them to calculate the dew point
+and the absolute humidity.</p>
+
+<p>The previous temperature sensor, {@link android.hardware.Sensor#TYPE_TEMPERATURE}, has been
+deprecated. You should use the {@link android.hardware.Sensor#TYPE_AMBIENT_TEMPERATURE} sensor
+instead.</p>
+
+<p>Additionally, Android’s three synthetic sensors have been greatly improved so they now have lower
+latency and smoother output. These sensors include the gravity sensor ({@link
+android.hardware.Sensor#TYPE_GRAVITY}), rotation vector sensor ({@link
+android.hardware.Sensor#TYPE_ROTATION_VECTOR}), and linear acceleration sensor ({@link
+android.hardware.Sensor#TYPE_LINEAR_ACCELERATION}). The improved sensors rely on the gyroscope
+sensor to improve their output, so the sensors appear only on devices that have a gyroscope.</p>
+
+
+
+
 
 <h3 id="ActionBar">Action Bar</h3>
 
@@ -1177,8 +1201,10 @@
 allows you to enable “split action bar" so that more action items can appear on the screen in a
 separate bar at the bottom of the screen. To enable split action bar, add {@link
 android.R.attr#uiOptions android:uiOptions} with {@code "splitActionBarWhenNarrow"} to either your
-<a href="guide/topics/manifest/application-element.html">{@code &lt;application&gt;}</a> tag or
-individual <a href="guide/topics/manifest/activity-element.html">{@code &lt;activity&gt;}</a> tags
+<a href="{@docRoot}guide/topics/manifest/application-element.html">{@code &lt;application&gt;}</a>
+tag or
+individual <a href="{@docRoot}guide/topics/manifest/activity-element.html">{@code
+&lt;activity&gt;}</a> tags
 in your manifest file. When enabled, the system will add an additional bar at the bottom of the
 screen for all action items when the screen is narrow (no action items will appear in the primary
 action bar).</p>
@@ -1248,9 +1274,8 @@
 </pre>
 
 <p>For an example using the {@link android.widget.ShareActionProvider}, see the <a
-href="{@docRoot}resources/samples/ApiDemos/src/com/example/android/apis/app/
-ActionBarActionProviderActivity.html">ActionBarActionProviderActivity</a>
-class in ApiDemos.</p>
+href="{@docRoot}resources/samples/ApiDemos/src/com/example/android/apis/app/ActionBarActionProviderActivity.html"
+>ActionBarActionProviderActivity</a> class in ApiDemos.</p>
 
 
 <h4>Collapsible action views</h4>
@@ -1313,56 +1338,6 @@
 <p>Android 4.0 introduces a variety of new views and other UI components.</p>
 
 
-<h4>System UI</h4>
-
-<p>Since the early days of Android, the system has managed a UI component known as the <em>status
-bar</em>, which resides at the top of handset devices to deliver information such as the carrier
-signal, time, notifications, and so on. Android 3.0 added the <em>system bar</em> for tablet
-devices, which resides at the bottom of the screen to provide system navigation controls (Home,
-Back, and so forth) and also an interface for elements traditionally provided by the status bar.  In
-Android 4.0, the system provides a new type of system UI called the <em>navigation bar</em>. The
-navigation bar shares some qualities with the system bar, because it provides navigation controls
-for devices that don’t have hardware counterparts for navigating the system, but the navigation
-controls is all that the navigation bar offers (a device with the navigation bar, thus, also
-includes the status bar at the top of the screen).</p>
-
-<p>To this day, you can hide the status bar on handsets using the {@link
-android.view.WindowManager.LayoutParams#FLAG_FULLSCREEN} flag. In Android 4.0, the APIs that control
-the system bar’s visibility have been updated to better reflect the behavior of both the system bar
-and navigation bar:</p>
-<ul>
-<li>The {@link android.view.View#SYSTEM_UI_FLAG_LOW_PROFILE} flag replaces View.STATUS_BAR_HIDDEN
-flag. When set, this flag enables “low profile" mode for the system bar or
-navigation bar. Navigation buttons dim and other elements in the system bar also hide.</li>
-
-<li>The {@link android.view.View#SYSTEM_UI_FLAG_VISIBLE} flag replaces the {@code
-STATUS_BAR_VISIBLE} flag to request the system bar or navigation bar be visible.</li>
-
-<li>The {@link android.view.View#SYSTEM_UI_FLAG_HIDE_NAVIGATION} is a new flag that requests that
-the navigation bar hide completely. Take note that this works only for the <em>navigation bar</em>
-used by some handsets (it does <strong>not</strong> hide the system bar on tablets). The navigation
-bar returns as soon as the system receives user input. As such, this mode is generally used for
-video playback or other cases in which the whole screen is needed but user input is not
-required.</li>
-</ul>
-
-<p>You can set each of these flags for the system bar and navigation bar by calling {@link
-android.view.View#setSystemUiVisibility setSystemUiVisibility()} on any view in your activity. The
-window manager will combine (OR-together) all flags from all views in your window and
-apply them to the system UI as long as your window has input focus. When your window loses input
-focus (the user navigates away from your app, or a dialog appears), your flags cease to have effect.
-Similarly, if you remove those views from the view hierarchy their flags no longer apply.</p>
-
-<p>To synchronize other events in your activity with visibility changes to the system UI (for
-example, hide the action bar or other UI controls when the system UI hides), you should register a
-{@link android.view.View.OnSystemUiVisibilityChangeListener} to be notified when the visibility
-of the system bar or navigation bar changes.</p>
-
-<p>See the <a
-href="{@docRoot}resources/samples/ApiDemos/src/com/example/android/apis/view/OverscanActivity.html">
-OverscanActivity</a> class for a demonstration of different system UI options.</p>
-
-
 <h4>GridLayout</h4>
 
 <p>{@link android.widget.GridLayout} is a new view group that places child views in a rectangular
@@ -1437,6 +1412,102 @@
 android.preference.SwitchPreference} for the Wi-Fi and Bluetooth settings.</p>
 
 
+
+<h4>System themes</h4>
+
+<p>The default theme for all applications that target Android 4.0 (by setting either <a
+href="{@docRoot}guide/topics/manifest/uses-sdk-element.html#target">{@code targetSdkVersion}</a> or
+<a href="{@docRoot}guide/topics/manifest/uses-sdk-element.html#min">{@code minSdkVersion}</a> to
+{@code “14"} or higher) is now the
+"device default" theme: {@link android.R.style#Theme_DeviceDefault Theme.DeviceDefault}. This may be
+the dark Holo theme or a different dark theme defined by the specific device.</p>
+
+<p>The {@link android.R.style#Theme_Holo Theme.Holo} family of themes are guaranteed to not change
+from one device to another when running the same version of Android. If you explicitly
+apply any of the {@link android.R.style#Theme_Holo Theme.Holo} themes to your activities, you can
+rest assured that these themes will not change character on different devices within the same
+platform version.</p>
+
+<p>If you wish for your app to blend in with the overall device theme (such as when different OEMs
+provide different default themes for the system), you should explicitly apply themes from the {@link
+android.R.style#Theme_DeviceDefault Theme.DeviceDefault} family.</p>
+
+
+<h4>Options menu button</h4>
+
+<p>Beginning with Android 4.0, you'll notice that handsets no longer require a Menu hardware button.
+However, there's no need for you to worry about this if your existing application provides an <a
+href="{@docRoot}guide/topics/ui/menus.html#options-menu">options menu</a> and expects there to be a
+Menu button. To ensure that existing apps continue to work as they expect, the system provides an
+on-screen Menu button for apps that were designed for older versions of Android.</p>
+
+<p>For the best user experience, new and updated apps should instead use the {@link
+android.app.ActionBar} to provide access to menu items and set <a
+href="{@docRoot}guide/topics/manifest/uses-sdk-element.html#target">{@code targetSdkVersion}</a> to
+{@code "14"} to take advantage of the latest framework default behaviors.</p>
+
+
+
+<h4>Controls for system UI visibility</h4>
+
+<p>Since the early days of Android, the system has managed a UI component known as the <em>status
+bar</em>, which resides at the top of handset devices to deliver information such as the carrier
+signal, time, notifications, and so on. Android 3.0 added the <em>system bar</em> for tablet
+devices, which resides at the bottom of the screen to provide system navigation controls (Home,
+Back, and so forth) and also an interface for elements traditionally provided by the status bar.  In
+Android 4.0, the system provides a new type of system UI called the <em>navigation bar</em>. You
+might consider the navigation bar a re-tuned version of the system bar designed for
+handsets&mdash;it provides navigation controls
+for devices that don’t have hardware counterparts for navigating the system, but it leaves out the
+system bar's notification UI and setting controls. As such, a device that provides the navigation
+bar also has the status bar at the top.</p>
+
+<p>To this day, you can hide the status bar on handsets using the {@link
+android.view.WindowManager.LayoutParams#FLAG_FULLSCREEN} flag. In Android 4.0, the APIs that control
+the system bar’s visibility have been updated to better reflect the behavior of both the system bar
+and navigation bar:</p>
+<ul>
+<li>The {@link android.view.View#SYSTEM_UI_FLAG_LOW_PROFILE} flag replaces the {@code
+STATUS_BAR_HIDDEN} flag. When set, this flag enables “low profile" mode for the system bar or
+navigation bar. Navigation buttons dim and other elements in the system bar also hide. Enabling
+this is useful for creating more immersive games without distraction for the system navigation
+buttons.</li>
+
+<li>The {@link android.view.View#SYSTEM_UI_FLAG_VISIBLE} flag replaces the {@code
+STATUS_BAR_VISIBLE} flag to request the system bar or navigation bar be visible.</li>
+
+<li>The {@link android.view.View#SYSTEM_UI_FLAG_HIDE_NAVIGATION} is a new flag that requests
+the navigation bar hide completely. Be aware that this works only for the <em>navigation bar</em>
+used by some handsets (it does <strong>not</strong> hide the system bar on tablets). The navigation
+bar returns to view as soon as the system receives user input. As such, this mode is useful
+primarily for video playback or other cases in which the whole screen is needed but user input is
+not required.</li>
+</ul>
+
+<p>You can set each of these flags for the system bar and navigation bar by calling {@link
+android.view.View#setSystemUiVisibility setSystemUiVisibility()} on any view in your activity. The
+window manager combines (OR-together) all flags from all views in your window and
+apply them to the system UI as long as your window has input focus. When your window loses input
+focus (the user navigates away from your app, or a dialog appears), your flags cease to have effect.
+Similarly, if you remove those views from the view hierarchy their flags no longer apply.</p>
+
+<p>To synchronize other events in your activity with visibility changes to the system UI (for
+example, hide the action bar or other UI controls when the system UI hides), you should register a
+{@link android.view.View.OnSystemUiVisibilityChangeListener} to be notified when the visibility
+of the system bar or navigation bar changes.</p>
+
+<p>See the <a
+href="{@docRoot}resources/samples/ApiDemos/src/com/example/android/apis/view/OverscanActivity.html">
+OverscanActivity</a> class for a demonstration of different system UI options.</p>
+
+
+
+
+
+<h3 id="Input">Input Framework</h3>
+
+<p>Android 4.0 adds support for cursor hover events and new stylus and mouse button events.</p>
+
 <h4>Hover events</h4>
 
 <p>The {@link android.view.View} class now supports “hover" events to enable richer interactions
@@ -1465,7 +1536,7 @@
 provide a different background drawable when a cursor hovers over the view.</p>
 
 <p>For a demonstration of the new hover events, see the <a
-href="{@docRoot}samples/ApiDemos/src/com/example/android/apis/view/Hover.html">Hover</a> class in
+href="{@docRoot}resources/samples/ApiDemos/src/com/example/android/apis/view/Hover.html">Hover</a> class in
 ApiDemos.</p>
 
 
@@ -1506,7 +1577,7 @@
 android.view.MotionEvent#AXIS_ORIENTATION}.</p>
 
 <p>For a demonstration of tool types, button states and the new axis codes, see the <a
-href="{@docRoot}samples/ApiDemos/src/com/example/android/apis/graphics/TouchPaint.html">TouchPaint
+href="{@docRoot}resources/samples/ApiDemos/src/com/example/android/apis/graphics/TouchPaint.html">TouchPaint
 </a> class in ApiDemos.</p>
 
 
@@ -1666,11 +1737,17 @@
 </ul>
 
 
+<div class="special" style="margin-top:3em">
+<p>For a detailed view of all API changes in Android {@sdkPlatformVersion} (API Level
+{@sdkPlatformApiLevel}), see the <a
+href="{@docRoot}sdk/api_diff/{@sdkPlatformApiLevel}/changes.html">API Differences Report</a>.</p>
+</div>
+
 
 <h2 id="Honeycomb">Previous APIs</h2>
 
 <p>In addition to everything above, Android 4.0 naturally supports all APIs from previous releases.
-Because the Android 3.x (Honeycomb) platform is available only for large-screen devices, if you've
+Because the Android 3.x platform is available only for large-screen devices, if you've
 been developing primarily for handsets, then you might not be aware of all the APIs added to Android
 in these recent releases.</p>
 
@@ -1688,7 +1765,7 @@
 the activity window. It includes the application logo in the left corner and provides a new
 interface for menu items. See the
 <a href="{@docRoot}guide/topics/ui/actionbar.html">Action Bar</a> developer guide.</li>
-      <li>{@link android.content.Loader}: A framework component that facilitates asynchronour
+      <li>{@link android.content.Loader}: A framework component that facilitates asynchronous
 loading of data in combination with UI components to dynamically load data without blocking the
 main thread. See the
 <a href="{@docRoot}guide/topics/fundamentals/loaders.html">Loaders</a> developer guide.</li>
@@ -1702,7 +1779,7 @@
 object (View, Drawable, Fragment, Object, or anything else) and define animation aspects such
 as duration, interpolation, repeat and more. The new framework makes Animations in Android
 simpler than ever. See the
-<a href="{@docRoot}guide/topics/graphics/property-animation.html">Property Animation</a> developer
+<a href="{@docRoot}guide/topics/graphics/prop-animation.html">Property Animation</a> developer
 guide.</li>
       <li>RenderScript graphics and compute engine: RenderScript offers a high performance 3D
 graphics rendering and compute API at the native level, which you write in the C (C99 standard),
@@ -1780,16 +1857,6 @@
 
 
 
-
-
-<h2 id="api-diff">API Differences Report</h2>
-
-<p>For a detailed view of all API changes in Android {@sdkPlatformVersion} (API Level
-{@sdkPlatformApiLevel}), see the <a
-href="{@docRoot}sdk/api_diff/{@sdkPlatformApiLevel}/changes.html">API Differences Report</a>.</p>
-
-
-
 <h2 id="api-level">API Level</h2>
 
 <p>The Android {@sdkPlatformVersion} API is assigned an integer
diff --git a/docs/html/sdk/compatibility-library.jd b/docs/html/sdk/compatibility-library.jd
index c8cd5b2..8b19fb47 100644
--- a/docs/html/sdk/compatibility-library.jd
+++ b/docs/html/sdk/compatibility-library.jd
@@ -1,4 +1,4 @@
-page.title=Compatibility Package
+page.title=Support Package
 
 @jd:body
 
@@ -8,7 +8,7 @@
 <h2>In this document</h2>
 <ol>
   <li><a href="#Notes">Revisions</a></li>
-  <li><a href="#Downloading">Downloading the Compatibility Package</a></li>
+  <li><a href="#Downloading">Downloading the Support Package</a></li>
   <li><a href="#SettingUp">Setting Up a Project to Use a Library</a></li>
   <li><a href="#Using">Using the v4 Library APIs</a></li>
   <li><a href="#Docs">Reference Docs</a></li>
@@ -27,28 +27,118 @@
 
 <p><em>Minimum API level supported:</em> <b>4</b></p>
 
-<p>The Compatibility Package includes static "support libraries" that you can add to your Android
+<p>The Support Package includes static "support libraries" that you can add to your Android
 application in order to use APIs that are either not available for older platform versions or that
 offer "utility" APIs that aren't a part of the framework APIs. The goal is to simplify your
 development by offering more APIs that you can bundle with your application so you can
 worry less about platform versions.</p>
 
-<p class="note"><strong>Note:</strong> The Compatibility Package includes more than one support
+<p class="note"><strong>Note:</strong> The Support Package includes more than one support
 library. Each one has a different <em>minimum API level</em>. For example, one library requires API
-level 4 or higher, while another requires API level 13 or higher. The minimum version is indicated
+level 4 or higher, while another requires API level 13 or higher (v13 is a superset of v4 and includes additional
+support classes to work with v13 APIs). The minimum version is indicated
 by the directory name, such as {@code v4/} and {@code v13/}.</p>
 
 
 <h2 id="Notes">Revisions</h2>
 
 <p>The sections below provide notes about successive releases of
-the Compatibility Package, as denoted by revision number.</p>
+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 4 (October 2011)
+  </a></p>
+
+  <div class="toggle-content-toggleme" style="padding-left:2em">
+    <dl>
+      <dt>Changes for v4 support library:</dt>
+      <dd>
+        <ul>
+          <li>Support for Accessiblity APIs:
+            <ul>
+              <li>Added <code>AccessibilityDelegateCompat</code> to support
+              {@link android.view.View.AccessibilityDelegate}.</li>
+
+              <li>Added <code>AccessibilityEventCompat</code> to support
+              {@link android.view.accessibility.AccessibilityEvent}.</li>
+
+              <li>Added <code>AccessibilityManagerCompat</code> to support
+              {@link android.view.accessibility.AccessibilityManager}.</li>
+
+              <li>Added <code>AccessibilityNodeInfoCompat</code> to support
+              {@link android.view.accessibility.AccessibilityNodeInfo}.</li>
+
+              <li>Added <code>AccessibilityRecordCompat</code> to support
+              {@link android.view.accessibility.AccessibilityRecord}.</li>
+
+              <li>Added <code>AccessibilityServiceInfoCompat</code> to support
+              {@link android.accessibilityservice.AccessibilityServiceInfo}.</li>
+
+              <li>Added <code>ViewGroupCompat</code>
+              to support accessibility features in {@link android.view.ViewGroup}.
+              </li>
+
+              <li>Modified <code>ViewCompat</code>
+              to support accessibility features in {@link android.view.View}.</li>
+            </ul>
+          </li>
+
+          <li>Added <code>EdgeEffectCompat</code> to
+          support {@link android.widget.EdgeEffect}.</li>
+          
+          <li>Added <code>LocalBroadcastManager</code> to allow applications to easily
+            register for and receive intents within a single application without
+            broadcasting them globally.</li>
+
+          <li>Added support in <code>ViewCompat</code> to check for and set overscroll
+          modes for {@link android.view.View}s on Android 2.3 and later.</li>
+          <li>Changes to Fragment APIs:
+            <ul>
+              <li>Added new APIs to control the visibility of new menus.</li>
+              <li>Added custom animation APIs.</li>
+              <li>Added APIs in <code>FragmentActivity</code> to retain custom,
+              non-configuration instance data.</li>
+              <li>Various bug fixes.</li>
+            </ul>
+          </li>
+          <li>Changes to <code>ViewPager</code>:
+            <ul>
+              <li>Added support for margins between pages.
+              An optional {@link android.graphics.drawable.Drawable} can be provided
+              to fill the margins.</li>
+              <li>Added support for {@link android.widget.EdgeEffect}.</li>
+              <li>Added support for keyboard navigation</li>
+              <li>Added support to control how many pages are kept to either side
+              of the current page.</li>
+              <li>Improved touch physics.</li>
+            </ul>
+          </li>
+
+          <li>Fixed a {@link android.content.Loader} bug that caused issues in
+          canceling {@link android.os.AsyncTask}s when running on Froyo and older
+          versions of the platform. The support
+          code now uses its own version of {@link android.os.AsyncTask} to keep the same
+          behavior on all platform versions.</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" />
     Compatibility Package, revision 3 (July 2011)
   </a></p>
 
@@ -136,9 +226,9 @@
 
 
 
-<h2 id="Downloading">Downloading the Compatibility Package</h2>
+<h2 id="Downloading">Downloading the Support Package</h2>
 
-<p>The Compatibility Package is provided as a downloadable package from the Android SDK and AVD
+<p>The Support Package is provided as a downloadable package from the Android SDK and AVD
 Manager. To install:</p>
 
 <ol>
@@ -147,13 +237,13 @@
 &gt; <strong>Android SDK and AVD Manager</strong>. Or, launch {@code SDK Manager.exe} from
 the {@code &lt;sdk&gt;/} directory (on Windows only) or {@code android} from the {@code
 &lt;sdk&gt;/tools/} directory.</p></li>
-  <li>Expand the Android Repository, check <strong>Android Compatibility package</strong>
+  <li>Expand the Android Repository, check <strong>Android Support package</strong>
 and click <strong>Install selected</strong>.</li>
   <li>Proceed to install the package.</li>
 </ol>
 
 <p>When done, all files (including source code, samples, and the {@code .jar} files) are saved
-into the <code>&lt;sdk&gt;/extras/android/compatibility/</code> directory. This directory contains
+into the <code>&lt;sdk&gt;/extras/android/support/</code> directory. This directory contains
 each of the different support libraries, such as the library for API level 4 and up and the library
 for API level 13 and up, each named with the respective version (such as {@code v4/}).</p>
 
@@ -167,7 +257,7 @@
   <li>Locate the JAR file for the library you want to use and copy it into the {@code
 libs/} directory.
     <p>For example, the library that supports API level 4 and up is located at {@code
-&lt;sdk&gt;/extras/android/compatibility/v4/android-support-v4.jar}.</p>
+&lt;sdk&gt;/extras/android/support/v4/android-support-v4.jar}.</p>
   </li>
   <li>Add the JAR to your project build path. 
     <p>In Eclipse, right-click the JAR file in the Package Explorer, select <strong>Build
@@ -181,7 +271,7 @@
 example, {@code android.support.v4}).</p>
 
 <p class="note"><strong>Tip:</strong> To see the library APIs in action, take a look at the sample
-apps in {@code extras/android/compatibility/&lt;version&gt;/samples/}.</p>
+apps in {@code extras/android/support/&lt;version&gt;/samples/}.</p>
 
 <p class="warning"><strong>Warning:</strong> Be certain that you not confuse the standard
 {@code android} packages with those in {@code android.support} library. Some code completion tools
@@ -265,7 +355,7 @@
 library:</p>
 
 <pre class="no-pretty-print">
-cd &lt;sdk&gt;/extras/android/compatibility/v4/
+cd &lt;sdk&gt;/extras/android/support/v4/
 mkdir docs
 javadoc -sourcepath src/java/ -subpackages android.support.v4 -d docs
 </pre>
@@ -275,8 +365,8 @@
 <h2 id="Samples">Samples</h2>
 
 <p>If you want to see some code that uses the support libraries, samples are included with the
-Compatibility Package, inside each support library directory. For example, at {@code
-extras/android/compatibility/v4/samples/}.</p>
+Support Package, inside each support library directory. For example, at {@code
+extras/android/support/v4/samples/}.</p>
 
 <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
diff --git a/docs/html/sdk/images/4.0/allapps-lg.png b/docs/html/sdk/images/4.0/allapps-lg.png
new file mode 100644
index 0000000..f5eba3c
--- /dev/null
+++ b/docs/html/sdk/images/4.0/allapps-lg.png
Binary files differ
diff --git a/docs/html/sdk/images/4.0/allapps.png b/docs/html/sdk/images/4.0/allapps.png
new file mode 100644
index 0000000..317a49a
--- /dev/null
+++ b/docs/html/sdk/images/4.0/allapps.png
Binary files differ
diff --git a/docs/html/sdk/images/4.0/bbench.png b/docs/html/sdk/images/4.0/bbench.png
new file mode 100644
index 0000000..f113092
--- /dev/null
+++ b/docs/html/sdk/images/4.0/bbench.png
Binary files differ
diff --git a/docs/html/sdk/images/4.0/beam-lg.png b/docs/html/sdk/images/4.0/beam-lg.png
new file mode 100644
index 0000000..608fc94
--- /dev/null
+++ b/docs/html/sdk/images/4.0/beam-lg.png
Binary files differ
diff --git a/docs/html/sdk/images/4.0/beam-maps-lg.png b/docs/html/sdk/images/4.0/beam-maps-lg.png
new file mode 100644
index 0000000..96ac235
--- /dev/null
+++ b/docs/html/sdk/images/4.0/beam-maps-lg.png
Binary files differ
diff --git a/docs/html/sdk/images/4.0/beam-maps.png b/docs/html/sdk/images/4.0/beam-maps.png
new file mode 100644
index 0000000..63b6756
--- /dev/null
+++ b/docs/html/sdk/images/4.0/beam-maps.png
Binary files differ
diff --git a/docs/html/sdk/images/4.0/beam.png b/docs/html/sdk/images/4.0/beam.png
new file mode 100644
index 0000000..0eb7d26
--- /dev/null
+++ b/docs/html/sdk/images/4.0/beam.png
Binary files differ
diff --git a/docs/html/sdk/images/4.0/browser-lg.png b/docs/html/sdk/images/4.0/browser-lg.png
new file mode 100644
index 0000000..fe3fe81
--- /dev/null
+++ b/docs/html/sdk/images/4.0/browser-lg.png
Binary files differ
diff --git a/docs/html/sdk/images/4.0/browser-tabs-lg.png b/docs/html/sdk/images/4.0/browser-tabs-lg.png
new file mode 100644
index 0000000..0ea8f10
--- /dev/null
+++ b/docs/html/sdk/images/4.0/browser-tabs-lg.png
Binary files differ
diff --git a/docs/html/sdk/images/4.0/browser-tabs.png b/docs/html/sdk/images/4.0/browser-tabs.png
new file mode 100644
index 0000000..413b0c6
--- /dev/null
+++ b/docs/html/sdk/images/4.0/browser-tabs.png
Binary files differ
diff --git a/docs/html/sdk/images/4.0/browser.png b/docs/html/sdk/images/4.0/browser.png
new file mode 100644
index 0000000..4bc8179
--- /dev/null
+++ b/docs/html/sdk/images/4.0/browser.png
Binary files differ
diff --git a/docs/html/sdk/images/4.0/calendar-widget-lg.png b/docs/html/sdk/images/4.0/calendar-widget-lg.png
new file mode 100644
index 0000000..39fc986
--- /dev/null
+++ b/docs/html/sdk/images/4.0/calendar-widget-lg.png
Binary files differ
diff --git a/docs/html/sdk/images/4.0/calendar-widget.png b/docs/html/sdk/images/4.0/calendar-widget.png
new file mode 100644
index 0000000..80a57f7
--- /dev/null
+++ b/docs/html/sdk/images/4.0/calendar-widget.png
Binary files differ
diff --git a/docs/html/sdk/images/4.0/camera-lg.png b/docs/html/sdk/images/4.0/camera-lg.png
new file mode 100644
index 0000000..7d96a4f
--- /dev/null
+++ b/docs/html/sdk/images/4.0/camera-lg.png
Binary files differ
diff --git a/docs/html/sdk/images/4.0/camera.png b/docs/html/sdk/images/4.0/camera.png
new file mode 100644
index 0000000..7454549
--- /dev/null
+++ b/docs/html/sdk/images/4.0/camera.png
Binary files differ
diff --git a/docs/html/sdk/images/4.0/contact-call-lg.png b/docs/html/sdk/images/4.0/contact-call-lg.png
new file mode 100644
index 0000000..40b1f40
--- /dev/null
+++ b/docs/html/sdk/images/4.0/contact-call-lg.png
Binary files differ
diff --git a/docs/html/sdk/images/4.0/contact-call.png b/docs/html/sdk/images/4.0/contact-call.png
new file mode 100644
index 0000000..5550b57
--- /dev/null
+++ b/docs/html/sdk/images/4.0/contact-call.png
Binary files differ
diff --git a/docs/html/sdk/images/4.0/contact-call.xcf b/docs/html/sdk/images/4.0/contact-call.xcf
new file mode 100644
index 0000000..3046e92
--- /dev/null
+++ b/docs/html/sdk/images/4.0/contact-call.xcf
Binary files differ
diff --git a/docs/html/sdk/images/4.0/contact-connect-lg.png b/docs/html/sdk/images/4.0/contact-connect-lg.png
new file mode 100644
index 0000000..ad0d04c
--- /dev/null
+++ b/docs/html/sdk/images/4.0/contact-connect-lg.png
Binary files differ
diff --git a/docs/html/sdk/images/4.0/contact-connect.png b/docs/html/sdk/images/4.0/contact-connect.png
new file mode 100644
index 0000000..d958206
--- /dev/null
+++ b/docs/html/sdk/images/4.0/contact-connect.png
Binary files differ
diff --git a/docs/html/sdk/images/4.0/contact-email-lg.png b/docs/html/sdk/images/4.0/contact-email-lg.png
new file mode 100644
index 0000000..db75a46
--- /dev/null
+++ b/docs/html/sdk/images/4.0/contact-email-lg.png
Binary files differ
diff --git a/docs/html/sdk/images/4.0/contact-email.png b/docs/html/sdk/images/4.0/contact-email.png
new file mode 100644
index 0000000..9e5460d
--- /dev/null
+++ b/docs/html/sdk/images/4.0/contact-email.png
Binary files differ
diff --git a/docs/html/sdk/images/4.0/contact-faves-lg.png b/docs/html/sdk/images/4.0/contact-faves-lg.png
new file mode 100644
index 0000000..1ec3fd0
--- /dev/null
+++ b/docs/html/sdk/images/4.0/contact-faves-lg.png
Binary files differ
diff --git a/docs/html/sdk/images/4.0/contact-faves.png b/docs/html/sdk/images/4.0/contact-faves.png
new file mode 100644
index 0000000..57e4ca6
--- /dev/null
+++ b/docs/html/sdk/images/4.0/contact-faves.png
Binary files differ
diff --git a/docs/html/sdk/images/4.0/face-unlock-lg.png b/docs/html/sdk/images/4.0/face-unlock-lg.png
new file mode 100644
index 0000000..3fd1695
--- /dev/null
+++ b/docs/html/sdk/images/4.0/face-unlock-lg.png
Binary files differ
diff --git a/docs/html/sdk/images/4.0/face-unlock.png b/docs/html/sdk/images/4.0/face-unlock.png
new file mode 100644
index 0000000..00afb83
--- /dev/null
+++ b/docs/html/sdk/images/4.0/face-unlock.png
Binary files differ
diff --git a/docs/html/sdk/images/4.0/folders.xcf b/docs/html/sdk/images/4.0/folders.xcf
new file mode 100644
index 0000000..66cc02c
--- /dev/null
+++ b/docs/html/sdk/images/4.0/folders.xcf
Binary files differ
diff --git a/docs/html/sdk/images/4.0/gallery-edit-lg.png b/docs/html/sdk/images/4.0/gallery-edit-lg.png
new file mode 100644
index 0000000..3d6688f
--- /dev/null
+++ b/docs/html/sdk/images/4.0/gallery-edit-lg.png
Binary files differ
diff --git a/docs/html/sdk/images/4.0/gallery-edit.png b/docs/html/sdk/images/4.0/gallery-edit.png
new file mode 100644
index 0000000..69744ec
--- /dev/null
+++ b/docs/html/sdk/images/4.0/gallery-edit.png
Binary files differ
diff --git a/docs/html/sdk/images/4.0/gallery-share-lg.png b/docs/html/sdk/images/4.0/gallery-share-lg.png
new file mode 100644
index 0000000..749f51e
--- /dev/null
+++ b/docs/html/sdk/images/4.0/gallery-share-lg.png
Binary files differ
diff --git a/docs/html/sdk/images/4.0/gallery-share.png b/docs/html/sdk/images/4.0/gallery-share.png
new file mode 100644
index 0000000..443a70c
--- /dev/null
+++ b/docs/html/sdk/images/4.0/gallery-share.png
Binary files differ
diff --git a/docs/html/sdk/images/4.0/gallery-widget.png b/docs/html/sdk/images/4.0/gallery-widget.png
new file mode 100644
index 0000000..e72fd0d
--- /dev/null
+++ b/docs/html/sdk/images/4.0/gallery-widget.png
Binary files differ
diff --git a/docs/html/sdk/images/4.0/home-lg.png b/docs/html/sdk/images/4.0/home-lg.png
new file mode 100644
index 0000000..5b9021d
--- /dev/null
+++ b/docs/html/sdk/images/4.0/home-lg.png
Binary files differ
diff --git a/docs/html/sdk/images/4.0/home.png b/docs/html/sdk/images/4.0/home.png
new file mode 100644
index 0000000..cd24732
--- /dev/null
+++ b/docs/html/sdk/images/4.0/home.png
Binary files differ
diff --git a/docs/html/sdk/images/4.0/live-effects.png b/docs/html/sdk/images/4.0/live-effects.png
new file mode 100644
index 0000000..11a0122
--- /dev/null
+++ b/docs/html/sdk/images/4.0/live-effects.png
Binary files differ
diff --git a/docs/html/sdk/images/4.0/lock-camera-lg.png b/docs/html/sdk/images/4.0/lock-camera-lg.png
new file mode 100644
index 0000000..2a169b3
--- /dev/null
+++ b/docs/html/sdk/images/4.0/lock-camera-lg.png
Binary files differ
diff --git a/docs/html/sdk/images/4.0/lock-camera.png b/docs/html/sdk/images/4.0/lock-camera.png
new file mode 100644
index 0000000..a5c63c3
--- /dev/null
+++ b/docs/html/sdk/images/4.0/lock-camera.png
Binary files differ
diff --git a/docs/html/sdk/images/4.0/lock-lg.png b/docs/html/sdk/images/4.0/lock-lg.png
new file mode 100644
index 0000000..b859e11
--- /dev/null
+++ b/docs/html/sdk/images/4.0/lock-lg.png
Binary files differ
diff --git a/docs/html/sdk/images/4.0/lock.png b/docs/html/sdk/images/4.0/lock.png
new file mode 100644
index 0000000..d168826
--- /dev/null
+++ b/docs/html/sdk/images/4.0/lock.png
Binary files differ
diff --git a/docs/html/sdk/images/4.0/quick-responses-lg.png b/docs/html/sdk/images/4.0/quick-responses-lg.png
new file mode 100644
index 0000000..39cea9a
--- /dev/null
+++ b/docs/html/sdk/images/4.0/quick-responses-lg.png
Binary files differ
diff --git a/docs/html/sdk/images/4.0/quick-responses.png b/docs/html/sdk/images/4.0/quick-responses.png
new file mode 100644
index 0000000..d43f348
--- /dev/null
+++ b/docs/html/sdk/images/4.0/quick-responses.png
Binary files differ
diff --git a/docs/html/sdk/images/4.0/screenshot-lg.png b/docs/html/sdk/images/4.0/screenshot-lg.png
new file mode 100644
index 0000000..30ac339
--- /dev/null
+++ b/docs/html/sdk/images/4.0/screenshot-lg.png
Binary files differ
diff --git a/docs/html/sdk/images/4.0/screenshot.png b/docs/html/sdk/images/4.0/screenshot.png
new file mode 100644
index 0000000..b23c913
--- /dev/null
+++ b/docs/html/sdk/images/4.0/screenshot.png
Binary files differ
diff --git a/docs/html/sdk/images/4.0/tasks-lg.png b/docs/html/sdk/images/4.0/tasks-lg.png
new file mode 100644
index 0000000..58b5c5d
--- /dev/null
+++ b/docs/html/sdk/images/4.0/tasks-lg.png
Binary files differ
diff --git a/docs/html/sdk/images/4.0/tasks.png b/docs/html/sdk/images/4.0/tasks.png
new file mode 100644
index 0000000..34a9d4a
--- /dev/null
+++ b/docs/html/sdk/images/4.0/tasks.png
Binary files differ
diff --git a/docs/html/sdk/images/4.0/text-replace-lg.png b/docs/html/sdk/images/4.0/text-replace-lg.png
new file mode 100644
index 0000000..047d802
--- /dev/null
+++ b/docs/html/sdk/images/4.0/text-replace-lg.png
Binary files differ
diff --git a/docs/html/sdk/images/4.0/text-replace.png b/docs/html/sdk/images/4.0/text-replace.png
new file mode 100644
index 0000000..d2bda3e
--- /dev/null
+++ b/docs/html/sdk/images/4.0/text-replace.png
Binary files differ
diff --git a/docs/html/sdk/images/4.0/tts-lg.png b/docs/html/sdk/images/4.0/tts-lg.png
new file mode 100644
index 0000000..2f49051
--- /dev/null
+++ b/docs/html/sdk/images/4.0/tts-lg.png
Binary files differ
diff --git a/docs/html/sdk/images/4.0/tts.png b/docs/html/sdk/images/4.0/tts.png
new file mode 100644
index 0000000..3eae634
--- /dev/null
+++ b/docs/html/sdk/images/4.0/tts.png
Binary files differ
diff --git a/docs/html/sdk/images/4.0/usage-all-lg.png b/docs/html/sdk/images/4.0/usage-all-lg.png
new file mode 100644
index 0000000..fd7eeba
--- /dev/null
+++ b/docs/html/sdk/images/4.0/usage-all-lg.png
Binary files differ
diff --git a/docs/html/sdk/images/4.0/usage-all.png b/docs/html/sdk/images/4.0/usage-all.png
new file mode 100644
index 0000000..048db83
--- /dev/null
+++ b/docs/html/sdk/images/4.0/usage-all.png
Binary files differ
diff --git a/docs/html/sdk/images/4.0/usage-maps-lg.png b/docs/html/sdk/images/4.0/usage-maps-lg.png
new file mode 100644
index 0000000..b144370
--- /dev/null
+++ b/docs/html/sdk/images/4.0/usage-maps-lg.png
Binary files differ
diff --git a/docs/html/sdk/images/4.0/usage-maps.png b/docs/html/sdk/images/4.0/usage-maps.png
new file mode 100644
index 0000000..a6dcd21
--- /dev/null
+++ b/docs/html/sdk/images/4.0/usage-maps.png
Binary files differ
diff --git a/docs/html/sdk/sdk_toc.cs b/docs/html/sdk/sdk_toc.cs
index 9bc9b9a..a33bbca 100644
--- a/docs/html/sdk/sdk_toc.cs
+++ b/docs/html/sdk/sdk_toc.cs
@@ -79,7 +79,7 @@
         <div><a href="<?cs var:toroot ?>sdk/android-4.0.html">
         <span class="en">Android 4.0 Platform</span></a> <span class="new">new!</span></div>
         <ul>
-          <!-- <li><a href="<?cs var:toroot ?>sdk/android-4.0-highlights.html">Platform Highlights</a></li> -->
+          <li><a href="<?cs var:toroot ?>sdk/android-4.0-highlights.html">Platform Highlights</a></li>
           <li><a href="<?cs var:toroot ?>sdk/api_diff/14/changes.html">API Differences Report &raquo;</a></li>
         </ul>
       </li>
@@ -150,11 +150,11 @@
       </li>
     </ul>
     <ul>
-      <li><a href="<?cs var:toroot ?>sdk/tools-notes.html">SDK Tools, r14</a> <span
-class="new">new!</span></li>
+      <li><a href="<?cs var:toroot ?>sdk/tools-notes.html">SDK Tools, r14</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">Compatibility Package,
-r3</a></li>
+      <li><a href="<?cs var:toroot ?>sdk/compatibility-library.html">Support Package, r4</a>
+      <span class="new">new!</span></li>
     </ul>
   </li>
   <li>
diff --git a/media/libstagefright/OMXCodec.cpp b/media/libstagefright/OMXCodec.cpp
index 7c34257..7b7078a 100755
--- a/media/libstagefright/OMXCodec.cpp
+++ b/media/libstagefright/OMXCodec.cpp
@@ -52,6 +52,13 @@
 // buffers after 3 seconds.
 const static int64_t kBufferFilledEventTimeOutNs = 3000000000LL;
 
+// OMX Spec defines less than 50 color formats. If the query for
+// color format is executed for more than kMaxColorFormatSupported,
+// the query will fail to avoid looping forever.
+// 1000 is more than enough for us to tell whether the omx
+// component in question is buggy or not.
+const static uint32_t kMaxColorFormatSupported = 1000;
+
 struct CodecInfo {
     const char *mime;
     const char *codec;
@@ -818,6 +825,11 @@
         }
 
         ++index;
+        if (index >= kMaxColorFormatSupported) {
+            CODEC_LOGE("color format %d or compression format %d is not supported",
+                colorFormat, compressionFormat);
+            return UNKNOWN_ERROR;
+        }
     }
 
     if (!found) {
@@ -901,22 +913,19 @@
         // the incremented index (bug 2897413).
         CHECK_EQ(index, portFormat.nIndex);
         if (portFormat.eColorFormat == colorFormat) {
-            LOGV("Found supported color format: %d", portFormat.eColorFormat);
+            CODEC_LOGV("Found supported color format: %d", portFormat.eColorFormat);
             return OK;  // colorFormat is supported!
         }
         ++index;
         portFormat.nIndex = index;
 
-        // OMX Spec defines less than 50 color formats
-        // 1000 is more than enough for us to tell whether the omx
-        // component in question is buggy or not.
-        if (index >= 1000) {
-            LOGE("More than %ld color formats are supported???", index);
+        if (index >= kMaxColorFormatSupported) {
+            CODEC_LOGE("More than %ld color formats are supported???", index);
             break;
         }
     }
 
-    LOGE("color format %d is not supported", colorFormat);
+    CODEC_LOGE("color format %d is not supported", colorFormat);
     return UNKNOWN_ERROR;
 }
 
diff --git a/packages/SystemUI/res/values/strings.xml b/packages/SystemUI/res/values/strings.xml
index a717b57..b26709d 100644
--- a/packages/SystemUI/res/values/strings.xml
+++ b/packages/SystemUI/res/values/strings.xml
@@ -169,19 +169,19 @@
     <string name="compat_mode_help_body">When an app was designed for a smaller screen, a zoom control will appear by the clock.</string>
 
     <!-- Notification ticker displayed when a screenshot is being saved to the Gallery. [CHAR LIMIT=30] -->
-    <string name="screenshot_saving_ticker">Saving...</string>
+    <string name="screenshot_saving_ticker">Saving screenshot\u2026</string>
     <!-- Notification title displayed when a screenshot is being saved to the Gallery. [CHAR LIMIT=50] -->
-    <string name="screenshot_saving_title">Saving screenshot...</string>
+    <string name="screenshot_saving_title">Saving screenshot\u2026</string>
     <!-- Notification text displayed when a screenshot is being saved to the Gallery. [CHAR LIMIT=100] -->
-    <string name="screenshot_saving_text">Please wait for screenshot to be saved</string>
+    <string name="screenshot_saving_text">Screenshot is being saved.</string>
     <!-- Notification title displayed when a screenshot is saved to the Gallery. [CHAR LIMIT=50] -->
-    <string name="screenshot_saved_title">Screenshot captured</string>
+    <string name="screenshot_saved_title">Screenshot captured.</string>
     <!-- Notification text displayed when a screenshot is saved to the Gallery. [CHAR LIMIT=100] -->
-    <string name="screenshot_saved_text">Touch to view your screenshot</string>
+    <string name="screenshot_saved_text">Touch to view your screenshot.</string>
     <!-- Notification title displayed when we fail to take a screenshot. [CHAR LIMIT=50] -->
-    <string name="screenshot_failed_title">Screenshot failed</string>
+    <string name="screenshot_failed_title">Couldn\'t capture screenshot.</string>
     <!-- Notification text displayed when we fail to take a screenshot. [CHAR LIMIT=100] -->
-    <string name="screenshot_failed_text">Failed to save screenshot. External storage may be in use.</string>
+    <string name="screenshot_failed_text">Couldn\'t save screenshot. Storage may be in use.</string>
 
     <!-- Title for the USB function chooser in UsbPreferenceActivity. [CHAR LIMIT=30] -->
     <string name="usb_preference_title">USB file transfer options</string>
diff --git a/packages/SystemUI/src/com/android/systemui/SwipeHelper.java b/packages/SystemUI/src/com/android/systemui/SwipeHelper.java
index 07281d4..14ce266 100644
--- a/packages/SystemUI/src/com/android/systemui/SwipeHelper.java
+++ b/packages/SystemUI/src/com/android/systemui/SwipeHelper.java
@@ -17,6 +17,7 @@
 package com.android.systemui;
 
 import android.animation.Animator;
+import android.animation.AnimatorListenerAdapter;
 import android.animation.ObjectAnimator;
 import android.animation.Animator.AnimatorListener;
 import android.animation.ValueAnimator;
@@ -40,6 +41,8 @@
     public static final int X = 0;
     public static final int Y = 1;
 
+    private static LinearInterpolator sLinearInterpolator = new LinearInterpolator();
+
     private float SWIPE_ESCAPE_VELOCITY = 100f; // dp/sec
     private int DEFAULT_ESCAPE_ANIMATION_DURATION = 200; // ms
     private int MAX_ESCAPE_ANIMATION_DURATION = 400; // ms
@@ -199,6 +202,10 @@
         return mDragging;
     }
 
+    /**
+     * @param view The view to be dismissed
+     * @param velocity The desired pixels/second speed at which the view should move
+     */
     public void dismissChild(final View view, float velocity) {
         final View animView = mCallback.getChildContentView(view);
         final boolean canAnimViewBeDismissed = mCallback.canChildBeDismissed(view);
@@ -221,22 +228,14 @@
             duration = DEFAULT_ESCAPE_ANIMATION_DURATION;
         }
 
+        animView.setLayerType(View.LAYER_TYPE_HARDWARE, null);
         ObjectAnimator anim = createTranslationAnimation(animView, newPos);
-        anim.setInterpolator(new LinearInterpolator());
+        anim.setInterpolator(sLinearInterpolator);
         anim.setDuration(duration);
-        anim.addListener(new AnimatorListener() {
-            public void onAnimationStart(Animator animation) {
-            }
-
-            public void onAnimationRepeat(Animator animation) {
-            }
-
+        anim.addListener(new AnimatorListenerAdapter() {
             public void onAnimationEnd(Animator animation) {
                 mCallback.onChildDismissed(view);
-            }
-
-            public void onAnimationCancel(Animator animation) {
-                mCallback.onChildDismissed(view);
+                animView.setLayerType(View.LAYER_TYPE_NONE, null);
             }
         });
         anim.addUpdateListener(new AnimatorUpdateListener() {
diff --git a/packages/SystemUI/src/com/android/systemui/screenshot/GlobalScreenshot.java b/packages/SystemUI/src/com/android/systemui/screenshot/GlobalScreenshot.java
index 181cc98..301ae73 100644
--- a/packages/SystemUI/src/com/android/systemui/screenshot/GlobalScreenshot.java
+++ b/packages/SystemUI/src/com/android/systemui/screenshot/GlobalScreenshot.java
@@ -38,6 +38,7 @@
 import android.net.Uri;
 import android.os.AsyncTask;
 import android.os.Environment;
+import android.os.Process;
 import android.os.ServiceManager;
 import android.provider.MediaStore;
 import android.util.DisplayMetrics;
@@ -54,7 +55,6 @@
 import android.widget.FrameLayout;
 import android.widget.ImageView;
 
-import com.android.server.wm.WindowManagerService;
 import com.android.systemui.R;
 
 import java.io.File;
@@ -68,6 +68,7 @@
 class SaveImageInBackgroundData {
     Context context;
     Bitmap image;
+    Uri imageUri;
     Runnable finisher;
     int iconSize;
     int result;
@@ -128,9 +129,6 @@
                 (iconHeight - data.iconSize) / 2, data.iconSize, data.iconSize);
 
         // Show the intermediate notification
-        mLaunchIntent = new Intent(Intent.ACTION_VIEW);
-        mLaunchIntent.setDataAndType(Uri.fromFile(new File(mImageFilePath)), "image/png");
-        mLaunchIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
         mTickerAddSpace = !mTickerAddSpace;
         mNotificationId = nId;
         mNotificationBuilder = new Notification.Builder(context)
@@ -152,6 +150,10 @@
     protected SaveImageInBackgroundData doInBackground(SaveImageInBackgroundData... params) {
         if (params.length != 1) return null;
 
+        // By default, AsyncTask sets the worker thread to have background thread priority, so bump
+        // it back up so that we save a little quicker.
+        Process.setThreadPriority(Process.THREAD_PRIORITY_FOREGROUND);
+
         Context context = params[0].context;
         Bitmap image = params[0].image;
 
@@ -178,6 +180,7 @@
             values.put(MediaStore.Images.ImageColumns.SIZE, new File(mImageFilePath).length());
             resolver.update(uri, values, null, null);
 
+            params[0].imageUri = uri;
             params[0].result = 0;
         } catch (Exception e) {
             // IOException/UnsupportedOperationException may be thrown if external storage is not
@@ -197,6 +200,11 @@
             // Show the final notification to indicate screenshot saved
             Resources r = params.context.getResources();
 
+            // Create the intent to show the screenshot in gallery
+            mLaunchIntent = new Intent(Intent.ACTION_VIEW);
+            mLaunchIntent.setDataAndType(params.imageUri, "image/png");
+            mLaunchIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
+
             mNotificationBuilder
                 .setContentTitle(r.getString(R.string.screenshot_saved_title))
                 .setContentText(r.getString(R.string.screenshot_saved_text))
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 4e9b411..b724552 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
@@ -50,7 +50,6 @@
 import android.view.KeyEvent;
 import android.view.LayoutInflater;
 import android.view.MotionEvent;
-import android.view.Surface;
 import android.view.VelocityTracker;
 import android.view.View;
 import android.view.ViewGroup;
@@ -213,6 +212,8 @@
     boolean mAnimatingReveal = false;
     int mViewDelta;
     int[] mAbsPos = new int[2];
+    Runnable mPostCollapseCleanup = null;
+
 
     // for disabling the status bar
     int mDisabled = 0;
@@ -1238,6 +1239,10 @@
             return;
         }
         mExpanded = false;
+        if (mPostCollapseCleanup != null) {
+            mPostCollapseCleanup.run();
+            mPostCollapseCleanup = null;
+        }
     }
 
     void doAnimation() {
@@ -2066,49 +2071,67 @@
         }
         public void onClick(View v) {
             synchronized (mNotificationData) {
-                // let's also queue up 400ms worth of animated dismissals
-                final int N = mini(5, mPile.getChildCount());
+                // animate-swipe all dismissable notifications, then animate the shade closed
+                int numChildren = mPile.getChildCount();
 
-                final ArrayList<View> snapshot = new ArrayList<View>(N);
-                for (int i=0; i<N; i++) {
+                int scrollTop = mScrollView.getScrollY();
+                int scrollBottom = scrollTop + mScrollView.getHeight();
+                final ArrayList<View> snapshot = new ArrayList<View>(numChildren);
+                for (int i=0; i<numChildren; i++) {
                     final View child = mPile.getChildAt(i);
-                    if (mPile.canChildBeDismissed(child)) snapshot.add(child);
+                    if (mPile.canChildBeDismissed(child) && child.getBottom() > scrollTop &&
+                            child.getTop() < scrollBottom) {
+                        snapshot.add(child);
+                    }
                 }
+                final int N = snapshot.size();
                 new Thread(new Runnable() {
                     @Override
                     public void run() {
-                        final int ROW_DELAY = 100;
+                        // Decrease the delay for every row we animate to give the sense of
+                        // accelerating the swipes
+                        final int ROW_DELAY_DECREMENT = 10;
+                        int currentDelay = 140;
+                        int totalDelay = 0;
 
-                        mHandler.postDelayed(new Runnable() {
-                            public void run() {
-                                animateCollapse(false, 0f);
-                            }
-                        }, (N-1) * ROW_DELAY);
+                        // Set the shade-animating state to avoid doing other work during
+                        // all of these animations. In particular, avoid layout and
+                        // redrawing when collapsing the shade.
+                        mPile.setViewRemoval(false);
 
-                        mHandler.postDelayed(new Runnable() {
+                        mPostCollapseCleanup = new Runnable() {
                             public void run() {
                                 try {
+                                    mPile.setViewRemoval(true);
                                     mBarService.onClearAllNotifications();
-                                } catch (RemoteException ex) { }
+                                } catch (Exception ex) { }
                             }
-                        }, N * ROW_DELAY + 500);
+                        };
 
-                        mPile.setAnimateBounds(false); // temporarily disable some re-layouts
-
+                        View sampleView = snapshot.get(0);
+                        int width = sampleView.getWidth();
+                        final int velocity = (int)(width * 8); // 1000/8 = 125 ms duration
                         for (View v : snapshot) {
                             final View _v = v;
-                            mHandler.post(new Runnable() {
+                            mHandler.postDelayed(new Runnable() {
                                 @Override
                                 public void run() {
-                                    mPile.dismissRowAnimated(_v, (int)(ROW_DELAY*0.25f));
+                                    mPile.dismissRowAnimated(_v, velocity);
                                 }
-                            });
-                            try {
-                                Thread.sleep(ROW_DELAY);
-                            } catch (InterruptedException ex) { }
+                            }, totalDelay);
+                            currentDelay = Math.max(50, currentDelay - ROW_DELAY_DECREMENT);
+                            totalDelay += currentDelay;
                         }
-                        
-                        mPile.setAnimateBounds(true); // reenable layout animation
+                        // Delay the collapse animation until after all swipe animations have
+                        // finished. Provide some buffer because there may be some extra delay
+                        // before actually starting each swipe animation. Ideally, we'd
+                        // synchronize the end of those animations with the start of the collaps
+                        // exactly.
+                        mHandler.postDelayed(new Runnable() {
+                            public void run() {
+                                animateCollapse(false);
+                            }
+                        }, totalDelay + 225);
                     }
                 }).start();
             }
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/NotificationRowLayout.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/NotificationRowLayout.java
index a7342dc..3649f75e 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/NotificationRowLayout.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/NotificationRowLayout.java
@@ -18,7 +18,6 @@
 
 import android.animation.Animator;
 import android.animation.AnimatorListenerAdapter;
-import android.animation.AnimatorSet;
 import android.animation.ObjectAnimator;
 import android.animation.ValueAnimator;
 import android.content.Context;
@@ -29,7 +28,6 @@
 import android.util.Log;
 import android.util.Slog;
 import android.view.MotionEvent;
-import android.view.VelocityTracker;
 import android.view.View;
 import android.view.ViewConfiguration;
 import android.view.ViewGroup;
@@ -59,6 +57,10 @@
 
     private SwipeHelper mSwipeHelper;
 
+    // Flag set during notification removal animation to avoid causing too much work until
+    // animation is done
+    boolean mRemoveViews = true;
+
     public NotificationRowLayout(Context context, AttributeSet attrs) {
         this(context, attrs, 0);
     }
@@ -117,7 +119,7 @@
 
     public void onChildDismissed(View v) {
         final View veto = v.findViewById(R.id.veto);
-        if (veto != null && veto.getVisibility() != View.GONE) {
+        if (veto != null && veto.getVisibility() != View.GONE && mRemoveViews) {
             veto.performClick();
         }
     }
@@ -170,7 +172,6 @@
         final View childF = child;
 
         if (mAnimateBounds) {
-            child.setPivotY(0);
             final ObjectAnimator alphaFade = ObjectAnimator.ofFloat(child, "alpha", 0f, 1f);
             alphaFade.setDuration(APPEAR_ANIM_LEN);
             alphaFade.addListener(new AnimatorListenerAdapter() {
@@ -189,6 +190,16 @@
         }
     }
 
+    /**
+     * Sets a flag to tell us whether to actually remove views. Removal is delayed by setting this
+     * to false during some animations to smooth out performance. Callers should restore the
+     * flag to true after the animation is done, and then they should make sure that the views
+     * get removed properly.
+     */
+    public void setViewRemoval(boolean removeViews) {
+        mRemoveViews = removeViews;
+    }
+
     public void dismissRowAnimated(View child) {
         dismissRowAnimated(child, 0);
     }
@@ -199,16 +210,34 @@
 
     @Override
     public void removeView(View child) {
-        final View childF = child;
+        if (!mRemoveViews) {
+            // This flag is cleared during an animation that removes all notifications. There
+            // should be a call to remove all notifications when the animation is done, at which
+            // time the view will be removed.
+            return;
+        }
         if (mAnimateBounds) {
             if (mAppearingViews.containsKey(child)) {
                 mAppearingViews.remove(child);
             }
-            child.setPivotY(0);
 
-            final ObjectAnimator alphaFade = ObjectAnimator.ofFloat(child, "alpha", 0f);
-            alphaFade.setDuration(DISAPPEAR_ANIM_LEN);
-            alphaFade.addListener(new AnimatorListenerAdapter() {
+            // Don't fade it out if it already has a low alpha value, but run a non-visual
+            // animation which is used by onLayout() to animate shrinking the gap that it left
+            // in the list
+            ValueAnimator anim;
+            float currentAlpha = child.getAlpha();
+            if (currentAlpha > .1) {
+                anim = ObjectAnimator.ofFloat(child, "alpha", currentAlpha, 0);
+            } else {
+                if (currentAlpha > 0) {
+                    // Just make it go away - no need to render it anymore
+                    child.setAlpha(0);
+                }
+                anim = ValueAnimator.ofFloat(0, 1);
+            }
+            anim.setDuration(DISAPPEAR_ANIM_LEN);
+            final View childF = child;
+            anim.addListener(new AnimatorListenerAdapter() {
                 @Override
                 public void onAnimationEnd(Animator animation) {
                     if (DEBUG) Slog.d(TAG, "actually removing child: " + childF);
@@ -218,9 +247,8 @@
                 }
             });
 
-            alphaFade.start();
-
-            mDisappearingViews.put(child, alphaFade);
+            anim.start();
+            mDisappearingViews.put(child, anim);
 
             requestLayout(); // start the container animation
         } else {
diff --git a/policy/src/com/android/internal/policy/impl/LockPatternKeyguardView.java b/policy/src/com/android/internal/policy/impl/LockPatternKeyguardView.java
index 96998af..7a72dcf 100644
--- a/policy/src/com/android/internal/policy/impl/LockPatternKeyguardView.java
+++ b/policy/src/com/android/internal/policy/impl/LockPatternKeyguardView.java
@@ -42,8 +42,10 @@
 import android.content.ServiceConnection;
 import android.graphics.Bitmap;
 import android.graphics.Canvas;
+import android.graphics.Color;
 import android.graphics.ColorFilter;
 import android.graphics.PixelFormat;
+import android.graphics.drawable.ColorDrawable;
 import android.graphics.drawable.Drawable;
 import android.os.Bundle;
 import android.os.Handler;
@@ -241,6 +243,9 @@
 
             // TODO: examine all widgets to derive clock status
             mUpdateMonitor.reportClockVisible(false);
+
+            // TODO: We should disable the wallpaper instead
+            setBackgroundColor(0xff000000);
         }
 
         public void requestHide(View view) {
@@ -249,6 +254,7 @@
 
             // TODO: examine all widgets to derive clock status
             mUpdateMonitor.reportClockVisible(true);
+            setBackgroundDrawable(null);
         }
 
         public boolean isVisible(View self) {
@@ -421,16 +427,20 @@
                         Slog.i(TAG, "Too many unlock attempts; device will be wiped!");
                         showWipeDialog(failedAttempts);
                     }
-                } else if (usingPattern && mEnableFallback) {
-                    if (failedAttempts == failedAttemptWarning) {
-                        showAlmostAtAccountLoginDialog();
-                    } else if (failedAttempts >= LockPatternUtils.FAILED_ATTEMPTS_BEFORE_RESET) {
-                        mLockPatternUtils.setPermanentlyLocked(true);
-                        updateScreen(mMode, false);
-                    }
                 } else {
-                    final boolean showTimeout =
+                    boolean showTimeout =
                         (failedAttempts % LockPatternUtils.FAILED_ATTEMPTS_BEFORE_TIMEOUT) == 0;
+                    if (usingPattern && mEnableFallback) {
+                        if (failedAttempts == failedAttemptWarning) {
+                            showAlmostAtAccountLoginDialog();
+                            showTimeout = false; // don't show both dialogs
+                        } else if (failedAttempts >= LockPatternUtils.FAILED_ATTEMPTS_BEFORE_RESET) {
+                            mLockPatternUtils.setPermanentlyLocked(true);
+                            updateScreen(mMode, false);
+                            // don't show timeout dialog because we show account unlock screen next
+                            showTimeout = false;
+                        }
+                    }
                     if (showTimeout) {
                         showTimeoutDialog();
                     }
@@ -1136,14 +1146,25 @@
 
     // Everything below pertains to FaceLock - might want to separate this out
 
-    // Only pattern and pin unlock screens actually have a view for the FaceLock area, so it's not
-    // uncommon for it to not exist.  But if it does exist, we need to make sure it's shown (hiding
-    // the fallback) if FaceLock is enabled, and make sure it's hidden (showing the unlock) if
-    // FaceLock is disabled
+    // Take care of FaceLock area when layout is created
     private void initializeFaceLockAreaView(View view) {
-        mFaceLockAreaView = view.findViewById(R.id.faceLockAreaView);
-        if (mFaceLockAreaView == null) {
-            if (DEBUG) Log.d(TAG, "Layout does not have faceLockAreaView");
+        if (mLockPatternUtils.usingBiometricWeak() &&
+                mLockPatternUtils.isBiometricWeakInstalled()) {
+            mFaceLockAreaView = view.findViewById(R.id.faceLockAreaView);
+            if (mFaceLockAreaView == null) {
+                Log.e(TAG, "Layout does not have faceLockAreaView and FaceLock is enabled");
+            } else {
+                if (mBoundToFaceLockService) {
+                    // If we are creating a layout when we are already bound to FaceLock, then we
+                    // are undergoing an orientation change.  Stop FaceLock and restart it in the
+                    // new location.
+                    if (DEBUG) Log.d(TAG, "Restarting FL - creating view while already bound");
+                    stopAndUnbindFromFaceLock();
+                    activateFaceLockIfAble();
+                }
+            }
+        } else {
+            mFaceLockAreaView = null; // Set to null if not using FaceLock
         }
     }
 
@@ -1160,7 +1181,7 @@
             break;
         case MSG_HIDE_FACELOCK_AREA_VIEW:
             if (mFaceLockAreaView != null) {
-                mFaceLockAreaView.setVisibility(View.GONE);
+                mFaceLockAreaView.setVisibility(View.INVISIBLE);
             }
             break;
         default:
@@ -1196,7 +1217,8 @@
         mHandler.sendEmptyMessageDelayed(MSG_HIDE_FACELOCK_AREA_VIEW, timeoutMillis);
     }
 
-    // Binds to FaceLock service, but does not tell it to start
+    // Binds to FaceLock service.  This call does not tell it to start, but it causes the service
+    // to call the onServiceConnected callback, which then starts FaceLock.
     public void bindToFaceLock() {
         if (mLockPatternUtils.usingBiometricWeak() &&
                 mLockPatternUtils.isBiometricWeakInstalled()) {
@@ -1232,9 +1254,10 @@
                 if (DEBUG) Log.d(TAG, "after unbind from FaceLock service");
                 mBoundToFaceLockService = false;
             } else {
-                // This could probably happen after the session when someone activates FaceLock
-                // because it wasn't active when the phone was turned on
-                Log.w(TAG, "Attempt to unbind from FaceLock when not bound");
+                // This is usually not an error when this happens.  Sometimes we will tell it to
+                // unbind multiple times because it's called from both onWindowFocusChanged and
+                // onDetachedFromWindow.
+                if (DEBUG) Log.d(TAG, "Attempt to unbind from FaceLock when not bound");
             }
         }
     }
diff --git a/services/audioflinger/AudioFlinger.cpp b/services/audioflinger/AudioFlinger.cpp
index ab49f93..3e0304f 100644
--- a/services/audioflinger/AudioFlinger.cpp
+++ b/services/audioflinger/AudioFlinger.cpp
@@ -1832,7 +1832,9 @@
     size_t mixBufferSize = mFrameCount * mFrameSize;
     // FIXME: Relaxed timing because of a certain device that can't meet latency
     // Should be reduced to 2x after the vendor fixes the driver issue
-    nsecs_t maxPeriod = seconds(mFrameCount) / mSampleRate * 3;
+    // increase threshold again due to low power audio mode. The way this warning threshold is
+    // calculated and its usefulness should be reconsidered anyway.
+    nsecs_t maxPeriod = seconds(mFrameCount) / mSampleRate * 15;
     nsecs_t lastWarning = 0;
     bool longStandbyExit = false;
     uint32_t activeSleepTime = activeSleepTimeUs();
@@ -1886,7 +1888,9 @@
                 mixBufferSize = mFrameCount * mFrameSize;
                 // FIXME: Relaxed timing because of a certain device that can't meet latency
                 // Should be reduced to 2x after the vendor fixes the driver issue
-                maxPeriod = seconds(mFrameCount) / mSampleRate * 3;
+                // increase threshold again due to low power audio mode. The way this warning
+                // threshold is calculated and its usefulness should be reconsidered anyway.
+                maxPeriod = seconds(mFrameCount) / mSampleRate * 15;
                 activeSleepTime = activeSleepTimeUs();
                 idleSleepTime = idleSleepTimeUs();
             }
@@ -1983,7 +1987,7 @@
             mInWrite = false;
             nsecs_t now = systemTime();
             nsecs_t delta = now - mLastWriteTime;
-            if (delta > maxPeriod) {
+            if (!mStandby && delta > maxPeriod) {
                 mNumDelayedWrites++;
                 if ((now - lastWarning) > kWarningThrottle) {
                     LOGW("write blocked for %llu msecs, %d delayed writes, thread %p",
diff --git a/services/java/com/android/server/am/ActivityManagerService.java b/services/java/com/android/server/am/ActivityManagerService.java
index 55fb371..0d6f405 100644
--- a/services/java/com/android/server/am/ActivityManagerService.java
+++ b/services/java/com/android/server/am/ActivityManagerService.java
@@ -165,7 +165,7 @@
     static final boolean DEBUG_URI_PERMISSION = localLOGV || false;
     static final boolean DEBUG_USER_LEAVING = localLOGV || false;
     static final boolean DEBUG_RESULTS = localLOGV || false;
-    static final boolean DEBUG_BACKUP = localLOGV || true;
+    static final boolean DEBUG_BACKUP = localLOGV || false;
     static final boolean DEBUG_CONFIGURATION = localLOGV || false;
     static final boolean DEBUG_POWER = localLOGV || false;
     static final boolean DEBUG_POWER_QUICK = DEBUG_POWER || false;
@@ -2607,9 +2607,18 @@
                 TAG, "Record #" + i + " " + r + ": app=" + r.app);
             if (r.app == app) {
                 if ((!r.haveState && !r.stateNotNeeded) || r.finishing) {
-                    if (localLOGV) Slog.v(
-                        TAG, "Removing this entry!  frozen=" + r.haveState
-                        + " finishing=" + r.finishing);
+                    if (ActivityStack.DEBUG_ADD_REMOVE) {
+                        RuntimeException here = new RuntimeException("here");
+                        here.fillInStackTrace();
+                        Slog.i(TAG, "Removing activity " + r + " from stack at " + i
+                                + ": haveState=" + r.haveState
+                                + " stateNotNeeded=" + r.stateNotNeeded
+                                + " finishing=" + r.finishing
+                                + " state=" + r.state, here);
+                    }
+                    if (!r.finishing) {
+                        Slog.w(TAG, "Force removing " + r + ": app died, no saved state");
+                    }
                     r.makeFinishing();
                     mMainStack.mHistory.remove(i);
                     r.takeFromHistory();
@@ -2630,6 +2639,8 @@
                     r.app = null;
                     r.nowVisible = false;
                     if (!r.haveState) {
+                        if (ActivityStack.DEBUG_SAVED_STATE) Slog.i(TAG,
+                                "App died, clearing saved state of " + r);
                         r.icicle = null;
                     }
                 }
@@ -4479,7 +4490,7 @@
             }
         }
         if (pi == null) {
-            Slog.w(TAG, "No content provider found for: " + name);
+            Slog.w(TAG, "No content provider found for permission check: " + uri.toSafeString());
             return -1;
         }
 
@@ -4735,7 +4746,7 @@
             }
         }
         if (pi == null) {
-            Slog.w(TAG, "No content provider found for: " + authority);
+            Slog.w(TAG, "No content provider found for permission revoke: " + uri.toSafeString());
             return;
         }
 
@@ -4829,7 +4840,8 @@
                 }
             }
             if (pi == null) {
-                Slog.w(TAG, "No content provider found for: " + authority);
+                Slog.w(TAG, "No content provider found for permission revoke: "
+                        + uri.toSafeString());
                 return;
             }
 
@@ -13054,11 +13066,13 @@
             if (app.foregroundServices) {
                 // The user is aware of this app, so make it visible.
                 adj = ProcessList.PERCEPTIBLE_APP_ADJ;
+                app.hidden = false;
                 app.adjType = "foreground-service";
                 schedGroup = Process.THREAD_GROUP_DEFAULT;
             } else if (app.forcingToForeground != null) {
                 // The user is aware of this app, so make it visible.
                 adj = ProcessList.PERCEPTIBLE_APP_ADJ;
+                app.hidden = false;
                 app.adjType = "force-foreground";
                 app.adjSource = app.forcingToForeground;
                 schedGroup = Process.THREAD_GROUP_DEFAULT;
@@ -13069,6 +13083,7 @@
             // We don't want to kill the current heavy-weight process.
             adj = ProcessList.HEAVY_WEIGHT_APP_ADJ;
             schedGroup = Process.THREAD_GROUP_BG_NONINTERACTIVE;
+            app.hidden = false;
             app.adjType = "heavy";
         }
 
@@ -13077,11 +13092,13 @@
             // home app, so we don't want to let it go into the background.
             adj = ProcessList.HOME_APP_ADJ;
             schedGroup = Process.THREAD_GROUP_BG_NONINTERACTIVE;
+            app.hidden = false;
             app.adjType = "home";
         }
-        
-        //Slog.i(TAG, "OOM " + app + ": initial adj=" + adj);
-        
+
+        if (false) Slog.i(TAG, "OOM " + app + ": initial adj=" + adj
+                + " reason=" + app.adjType);
+
         // By default, we use the computed adjustment.  It may be changed if
         // there are applications dependent on our services or providers, but
         // this gives us a baseline and makes sure we don't get into an
@@ -13108,7 +13125,7 @@
             while (jt.hasNext() && adj > ProcessList.FOREGROUND_APP_ADJ) {
                 ServiceRecord s = jt.next();
                 if (s.startRequested) {
-                    if (app.hasShownUi) {
+                    if (app.hasShownUi && app != mHomeProcess) {
                         // If this process has shown some UI, let it immediately
                         // go to the LRU list because it may be pretty heavy with
                         // UI stuff.  We'll tag it with a label just to help
@@ -13169,7 +13186,7 @@
                                 if ((cr.flags&Context.BIND_ALLOW_OOM_MANAGEMENT) != 0) {
                                     // Not doing bind OOM management, so treat
                                     // this guy more like a started service.
-                                    if (app.hasShownUi) {
+                                    if (app.hasShownUi && app != mHomeProcess) {
                                         // If this process has shown some UI, let it immediately
                                         // go to the LRU list because it may be pretty heavy with
                                         // UI stuff.  We'll tag it with a label just to help
@@ -13177,6 +13194,7 @@
                                         if (adj > clientAdj) {
                                             adjType = "bound-bg-ui-services";
                                         }
+                                        app.hidden = false;
                                         clientAdj = adj;
                                     } else {
                                         if (now >= (s.lastActivity+MAX_SERVICE_INACTIVITY)) {
@@ -13200,7 +13218,8 @@
                                     // about letting this process get into the LRU
                                     // list to be killed and restarted if needed for
                                     // memory.
-                                    if (app.hasShownUi && clientAdj > ProcessList.PERCEPTIBLE_APP_ADJ) {
+                                    if (app.hasShownUi && app != mHomeProcess
+                                            && clientAdj > ProcessList.PERCEPTIBLE_APP_ADJ) {
                                         adjType = "bound-bg-ui-services";
                                     } else {
                                         if ((cr.flags&(Context.BIND_ABOVE_CLIENT
@@ -13294,7 +13313,8 @@
                         int clientAdj = computeOomAdjLocked(
                             client, myHiddenAdj, TOP_APP, true);
                         if (adj > clientAdj) {
-                            if (app.hasShownUi && clientAdj > ProcessList.PERCEPTIBLE_APP_ADJ) {
+                            if (app.hasShownUi && app != mHomeProcess
+                                    && clientAdj > ProcessList.PERCEPTIBLE_APP_ADJ) {
                                 app.adjType = "bg-ui-provider";
                             } else {
                                 adj = clientAdj > ProcessList.FOREGROUND_APP_ADJ
diff --git a/services/java/com/android/server/am/ActivityStack.java b/services/java/com/android/server/am/ActivityStack.java
index 1aed7fe0..28c3bae 100644
--- a/services/java/com/android/server/am/ActivityStack.java
+++ b/services/java/com/android/server/am/ActivityStack.java
@@ -87,6 +87,8 @@
     static final boolean DEBUG_TASKS = ActivityManagerService.DEBUG_TASKS;
     
     static final boolean DEBUG_STATES = false;
+    static final boolean DEBUG_ADD_REMOVE = false;
+    static final boolean DEBUG_SAVED_STATE = false;
 
     static final boolean VALIDATE_TOKENS = ActivityManagerService.VALIDATE_TOKENS;
     
@@ -653,6 +655,9 @@
             }
             completeResumeLocked(r);
             checkReadyForSleepLocked();
+            if (DEBUG_SAVED_STATE) Slog.i(TAG, "Launch completed; removing icicle of " + r.icicle);
+            r.icicle = null;
+            r.haveState = false;
         } else {
             // This activity is not starting in the resumed state... which
             // should look like we asked it to pause+stop (but remain visible),
@@ -664,9 +669,6 @@
             r.stopped = true;
         }
 
-        r.icicle = null;
-        r.haveState = false;
-
         // Launch the new version setup screen if needed.  We do this -after-
         // launching the initial activity (that is, home), so that it can have
         // a chance to initialize itself while in the background, making the
@@ -936,6 +938,7 @@
 
     final void activityStoppedLocked(ActivityRecord r, Bundle icicle, Bitmap thumbnail,
             CharSequence description) {
+        if (DEBUG_SAVED_STATE) Slog.i(TAG, "Saving icicle of " + r + ": " + icicle);
         r.icicle = icicle;
         r.haveState = true;
         r.updateThumbnail(thumbnail, description);
@@ -1544,6 +1547,7 @@
             }
 
             // Didn't need to use the icicle, and it is now out of date.
+            if (DEBUG_SAVED_STATE) Slog.i(TAG, "Resumed activity; didn't need icicle of: " + next);
             next.icicle = null;
             next.haveState = false;
             next.stopped = false;
@@ -1590,6 +1594,12 @@
                     // get started when the user navigates back to it.
                     addPos = i+1;
                     if (!startIt) {
+                        if (DEBUG_ADD_REMOVE) {
+                            RuntimeException here = new RuntimeException("here");
+                            here.fillInStackTrace();
+                            Slog.i(TAG, "Adding activity " + r + " to stack at " + addPos,
+                                    here);
+                        }
                         mHistory.add(addPos, r);
                         r.putInHistory();
                         mService.mWindowManager.addAppToken(addPos, r, r.task.taskId,
@@ -1622,6 +1632,11 @@
         }
         
         // Slot the activity into the history stack and proceed
+        if (DEBUG_ADD_REMOVE) {
+            RuntimeException here = new RuntimeException("here");
+            here.fillInStackTrace();
+            Slog.i(TAG, "Adding activity " + r + " to stack at " + addPos, here);
+        }
         mHistory.add(addPos, r);
         r.putInHistory();
         r.frontOfTask = newTask;
@@ -1818,6 +1833,12 @@
                                     + " out to target's task " + target.task);
                             p.setTask(target.task, curThumbHolder, false);
                             curThumbHolder = p.thumbHolder;
+                            if (DEBUG_ADD_REMOVE) {
+                                RuntimeException here = new RuntimeException("here");
+                                here.fillInStackTrace();
+                                Slog.i(TAG, "Removing and adding activity " + p + " to stack at "
+                                        + dstPos, here);
+                            }
                             mHistory.remove(srcPos);
                             mHistory.add(dstPos, p);
                             mService.mWindowManager.moveAppToken(dstPos, p);
@@ -1945,6 +1966,12 @@
                         } else {
                             lastReparentPos--;
                         }
+                        if (DEBUG_ADD_REMOVE) {
+                            RuntimeException here = new RuntimeException("here");
+                            here.fillInStackTrace();
+                            Slog.i(TAG, "Removing and adding activity " + p + " to stack at "
+                                    + lastReparentPos, here);
+                        }
                         mHistory.remove(srcPos);
                         p.setTask(task, null, false);
                         mHistory.add(lastReparentPos, p);
@@ -2143,6 +2170,12 @@
         ActivityRecord newTop = mHistory.remove(where);
         int top = mHistory.size();
         ActivityRecord oldTop = mHistory.get(top-1);
+        if (DEBUG_ADD_REMOVE) {
+            RuntimeException here = new RuntimeException("here");
+            here.fillInStackTrace();
+            Slog.i(TAG, "Removing and adding activity " + newTop + " to stack at "
+                    + top, here);
+        }
         mHistory.add(top, newTop);
         oldTop.frontOfTask = false;
         newTop.frontOfTask = true;
@@ -2183,7 +2216,7 @@
         if (resultTo != null) {
             int index = indexOfTokenLocked(resultTo);
             if (DEBUG_RESULTS) Slog.v(
-                TAG, "Sending result to " + resultTo + " (index " + index + ")");
+                TAG, "Will send result to " + resultTo + " (index " + index + ")");
             if (index >= 0) {
                 sourceRecord = mHistory.get(index);
                 if (requestCode >= 0 && !sourceRecord.finishing) {
@@ -3279,34 +3312,15 @@
      */
     final boolean requestFinishActivityLocked(IBinder token, int resultCode,
             Intent resultData, String reason) {
-        if (DEBUG_RESULTS) Slog.v(
-            TAG, "Finishing activity: token=" + token
-            + ", result=" + resultCode + ", data=" + resultData);
-
         int index = indexOfTokenLocked(token);
+        if (DEBUG_RESULTS) Slog.v(
+                TAG, "Finishing activity @" + index + ": token=" + token
+                + ", result=" + resultCode + ", data=" + resultData);
         if (index < 0) {
             return false;
         }
         ActivityRecord r = mHistory.get(index);
 
-        // Is this the last activity left?
-        boolean lastActivity = true;
-        for (int i=mHistory.size()-1; i>=0; i--) {
-            ActivityRecord p = mHistory.get(i);
-            if (!p.finishing && p != r) {
-                lastActivity = false;
-                break;
-            }
-        }
-        
-        // If this is the last activity, but it is the home activity, then
-        // just don't finish it.
-        if (lastActivity) {
-            if (r.intent.hasCategory(Intent.CATEGORY_HOME)) {
-                return false;
-            }
-        }
-        
         finishActivityLocked(r, index, resultCode, resultData, reason);
         return true;
     }
@@ -3538,6 +3552,11 @@
     private final void removeActivityFromHistoryLocked(ActivityRecord r) {
         if (r.state != ActivityState.DESTROYED) {
             r.makeFinishing();
+            if (DEBUG_ADD_REMOVE) {
+                RuntimeException here = new RuntimeException("here");
+                here.fillInStackTrace();
+                Slog.i(TAG, "Removing activity " + r + " from stack");
+            }
             mHistory.remove(r);
             r.takeFromHistory();
             if (DEBUG_STATES) Slog.v(TAG, "Moving to DESTROYED: " + r
@@ -3769,6 +3788,11 @@
                 TAG, "At " + pos + " ckp " + r.task + ": " + r);
             if (r.task.taskId == task) {
                 if (localLOGV) Slog.v(TAG, "Removing and adding at " + top);
+                if (DEBUG_ADD_REMOVE) {
+                    RuntimeException here = new RuntimeException("here");
+                    here.fillInStackTrace();
+                    Slog.i(TAG, "Removing and adding activity " + r + " to stack at " + top, here);
+                }
                 mHistory.remove(pos);
                 mHistory.add(top, r);
                 moved.add(0, r);
@@ -3858,6 +3882,12 @@
                 TAG, "At " + pos + " ckp " + r.task + ": " + r);
             if (r.task.taskId == task) {
                 if (localLOGV) Slog.v(TAG, "Removing and adding at " + (N-1));
+                if (DEBUG_ADD_REMOVE) {
+                    RuntimeException here = new RuntimeException("here");
+                    here.fillInStackTrace();
+                    Slog.i(TAG, "Removing and adding activity " + r + " to stack at "
+                            + bottom, here);
+                }
                 mHistory.remove(pos);
                 mHistory.add(bottom, r);
                 moved.add(r);
diff --git a/telephony/java/com/android/internal/telephony/DataConnectionTracker.java b/telephony/java/com/android/internal/telephony/DataConnectionTracker.java
index 759a84b..97e7aa3 100644
--- a/telephony/java/com/android/internal/telephony/DataConnectionTracker.java
+++ b/telephony/java/com/android/internal/telephony/DataConnectionTracker.java
@@ -676,6 +676,15 @@
         return result;
     }
 
+    protected boolean isEmergency() {
+        final boolean result;
+        synchronized (mDataEnabledLock) {
+            result = mPhone.isInEcm() || mPhone.isInEmergencyCall();
+        }
+        log("isEmergency: result=" + result);
+        return result;
+    }
+
     protected int apnTypeToId(String type) {
         if (TextUtils.equals(type, Phone.APN_TYPE_DEFAULT)) {
             return APN_DEFAULT_ID;
@@ -981,17 +990,14 @@
 
     protected void onSetInternalDataEnabled(boolean enabled) {
         synchronized (mDataEnabledLock) {
-            final boolean prevEnabled = getAnyDataEnabled();
-            if (mInternalDataEnabled != enabled) {
-                mInternalDataEnabled = enabled;
-                if (prevEnabled != getAnyDataEnabled()) {
-                    if (!prevEnabled) {
-                        resetAllRetryCounts();
-                        onTrySetupData(Phone.REASON_DATA_ENABLED);
-                    } else {
-                        cleanUpAllConnections(null);
-                    }
-                }
+            mInternalDataEnabled = enabled;
+            if (enabled) {
+                log("onSetInternalDataEnabled: changed to enabled, try to setup data call");
+                resetAllRetryCounts();
+                onTrySetupData(Phone.REASON_DATA_ENABLED);
+            } else {
+                log("onSetInternalDataEnabled: changed to disabled, cleanUpAllConnections");
+                cleanUpAllConnections(null);
             }
         }
     }
diff --git a/telephony/java/com/android/internal/telephony/PhoneBase.java b/telephony/java/com/android/internal/telephony/PhoneBase.java
index a7a4908..10121dd 100644
--- a/telephony/java/com/android/internal/telephony/PhoneBase.java
+++ b/telephony/java/com/android/internal/telephony/PhoneBase.java
@@ -832,6 +832,22 @@
         mNotifier.notifyOtaspChanged(this, otaspMode);
     }
 
+    /**
+     * @return true if a mobile originating emergency call is active
+     */
+    public boolean isInEmergencyCall() {
+        return false;
+    }
+
+    /**
+     * @return true if we are in the emergency call back mode. This is a period where
+     * the phone should be using as little power as possible and be ready to receive an
+     * incoming call from the emergency operator.
+     */
+    public boolean isInEcm() {
+        return false;
+    }
+
     public abstract String getPhoneName();
 
     public abstract int getPhoneType();
diff --git a/telephony/java/com/android/internal/telephony/cdma/CDMAPhone.java b/telephony/java/com/android/internal/telephony/cdma/CDMAPhone.java
index 09ee28c..58e3e5f 100755
--- a/telephony/java/com/android/internal/telephony/cdma/CDMAPhone.java
+++ b/telephony/java/com/android/internal/telephony/cdma/CDMAPhone.java
@@ -848,6 +848,14 @@
         mUnknownConnectionRegistrants.notifyResult(this);
     }
 
+    public boolean isInEmergencyCall() {
+        return mCT.isInEmergencyCall();
+    }
+
+    public boolean isInEcm() {
+        return mIsPhoneInEcmState;
+    }
+
     void sendEmergencyCallbackModeChange(){
         //Send an Intent
         Intent intent = new Intent(TelephonyIntents.ACTION_EMERGENCY_CALLBACK_MODE_CHANGED);
diff --git a/telephony/java/com/android/internal/telephony/cdma/CdmaDataConnectionTracker.java b/telephony/java/com/android/internal/telephony/cdma/CdmaDataConnectionTracker.java
index 3c7ff05..f5d05a1 100644
--- a/telephony/java/com/android/internal/telephony/cdma/CdmaDataConnectionTracker.java
+++ b/telephony/java/com/android/internal/telephony/cdma/CdmaDataConnectionTracker.java
@@ -248,7 +248,7 @@
         boolean desiredPowerState = mCdmaPhone.mSST.getDesiredPowerState();
 
         if ((mState == State.IDLE || mState == State.SCANNING) &&
-                isDataAllowed() && getAnyDataEnabled()) {
+                isDataAllowed() && getAnyDataEnabled() && !isEmergency()) {
             boolean retValue = setupData(reason);
             notifyOffApnsOfAvailability(reason);
             return retValue;
diff --git a/telephony/java/com/android/internal/telephony/gsm/GsmDataConnectionTracker.java b/telephony/java/com/android/internal/telephony/gsm/GsmDataConnectionTracker.java
index 5497b7f..e166401 100644
--- a/telephony/java/com/android/internal/telephony/gsm/GsmDataConnectionTracker.java
+++ b/telephony/java/com/android/internal/telephony/gsm/GsmDataConnectionTracker.java
@@ -273,7 +273,14 @@
                 break;
             case ConnectivityManager.TYPE_MOBILE_HIPRI:
                 apnContext = addApnContext(Phone.APN_TYPE_HIPRI);
-                break;
+                ApnContext defaultContext = mApnContexts.get(Phone.APN_TYPE_DEFAULT);
+                if (defaultContext != null) {
+                    applyNewState(apnContext, apnContext.isEnabled(),
+                            defaultContext.getDependencyMet());
+                } else {
+                    // the default will set the hipri dep-met when it is created
+                }
+                continue;
             case ConnectivityManager.TYPE_MOBILE_FOTA:
                 apnContext = addApnContext(Phone.APN_TYPE_FOTA);
                 break;
@@ -686,7 +693,7 @@
         boolean desiredPowerState = mPhone.getServiceStateTracker().getDesiredPowerState();
 
         if ((apnContext.getState() == State.IDLE || apnContext.getState() == State.SCANNING) &&
-                isDataAllowed(apnContext) && getAnyDataEnabled()) {
+                isDataAllowed(apnContext) && getAnyDataEnabled() && !isEmergency()) {
 
             if (apnContext.getState() == State.IDLE) {
                 ArrayList<ApnSetting> waitingApns = buildWaitingApns(apnContext.getApnType());