Merge "Updates to "Displaying Bitmaps Efficiently" class. Changes:  -Updated code sample (see http://ag/214812)  -Updated code snippets to match updated sample  -Fixed <> in code snippets  -Updated disk cache section  -Some other minor updates" into jb-dev
diff --git a/core/java/android/app/Notification.java b/core/java/android/app/Notification.java
index b2e69de..cb83dc2 100644
--- a/core/java/android/app/Notification.java
+++ b/core/java/android/app/Notification.java
@@ -897,12 +897,16 @@
      * Builder class for {@link Notification} objects.
      * 
      * Provides a convenient way to set the various fields of a {@link Notification} and generate
-     * content views using the platform's notification layout template. 
+     * content views using the platform's notification layout template. If your app supports
+     * versions of Android as old as API level 4, you can instead use
+     * {@link android.support.v4.app.NotificationCompat.Builder NotificationCompat.Builder},
+     * available in the <a href="{@docRoot}tools/extras/support-library.html">Android Support
+     * library</a>.
      * 
-     * Example:
+     * <p>Example:
      * 
      * <pre class="prettyprint">
-     * Notification noti = new Notification.Builder()
+     * Notification noti = new Notification.Builder(mContext)
      *         .setContentTitle(&quot;New mail from &quot; + sender.toString())
      *         .setContentText(subject)
      *         .setSmallIcon(R.drawable.new_mail)
diff --git a/core/java/android/content/res/Resources.java b/core/java/android/content/res/Resources.java
index c630bb5..ab2fe1c 100755
--- a/core/java/android/content/res/Resources.java
+++ b/core/java/android/content/res/Resources.java
@@ -1120,8 +1120,8 @@
          * Return a StyledAttributes holding the values defined by
          * <var>Theme</var> which are listed in <var>attrs</var>.
          * 
-         * <p>Be sure to call StyledAttributes.recycle() when you are done with
-         * the array.
+         * <p>Be sure to call {@link TypedArray#recycle() TypedArray.recycle()} when you are done
+         * with the array.
          * 
          * @param attrs The desired attributes.
          *
@@ -1148,8 +1148,8 @@
          * Return a StyledAttributes holding the values defined by the style
          * resource <var>resid</var> which are listed in <var>attrs</var>.
          * 
-         * <p>Be sure to call StyledAttributes.recycle() when you are done with
-         * the array.
+         * <p>Be sure to call {@link TypedArray#recycle() TypedArray.recycle()} when you are done
+         * with the array.
          * 
          * @param resid The desired style resource.
          * @param attrs The desired attributes in the style.
@@ -1208,8 +1208,8 @@
          * AttributeSet specifies a style class (through the "style" attribute),
          * that style will be applied on top of the base attributes it defines.
          * 
-         * <p>Be sure to call StyledAttributes.recycle() when you are done with
-         * the array.
+         * <p>Be sure to call {@link TypedArray#recycle() TypedArray.recycle()} when you are done
+         * with the array.
          * 
          * <p>When determining the final value of a particular attribute, there
          * are four inputs that come into play:</p>
diff --git a/core/java/android/content/res/TypedArray.java b/core/java/android/content/res/TypedArray.java
index 2df492e..2968fbb 100644
--- a/core/java/android/content/res/TypedArray.java
+++ b/core/java/android/content/res/TypedArray.java
@@ -684,7 +684,7 @@
     }
 
     /**
-     * Give back a previously retrieved StyledAttributes, for later re-use.
+     * Give back a previously retrieved array, for later re-use.
      */
     public void recycle() {
         synchronized (mResources.mTmpValue) {
diff --git a/core/java/android/view/GestureDetector.java b/core/java/android/view/GestureDetector.java
index 0114a41..4bbdd4e 100644
--- a/core/java/android/view/GestureDetector.java
+++ b/core/java/android/view/GestureDetector.java
@@ -226,17 +226,12 @@
      */
     private boolean mIsDoubleTapping;
 
-    private float mLastMotionY;
-    private float mLastMotionX;
+    private float mLastFocusX;
+    private float mLastFocusY;
+    private float mDownFocusX;
+    private float mDownFocusY;
 
     private boolean mIsLongpressEnabled;
-    
-    /**
-     * True if we are at a target API level of >= Froyo or the developer can
-     * explicitly set it. If true, input events with > 1 pointer will be ignored
-     * so we can work side by side with multitouch gesture detectors.
-     */
-    private boolean mIgnoreMultitouch;
 
     /**
      * Determines speed during touch scrolling
@@ -349,8 +344,16 @@
      * @throws NullPointerException if {@code listener} is null.
      */
     public GestureDetector(Context context, OnGestureListener listener, Handler handler) {
-        this(context, listener, handler, context != null &&
-                context.getApplicationInfo().targetSdkVersion >= Build.VERSION_CODES.FROYO);
+        if (handler != null) {
+            mHandler = new GestureHandler(handler);
+        } else {
+            mHandler = new GestureHandler();
+        }
+        mListener = listener;
+        if (listener instanceof OnDoubleTapListener) {
+            setOnDoubleTapListener((OnDoubleTapListener) listener);
+        }
+        init(context);
     }
     
     /**
@@ -362,31 +365,19 @@
      * @param listener the listener invoked for all the callbacks, this must
      * not be null.
      * @param handler the handler to use
-     * @param ignoreMultitouch whether events involving more than one pointer should
-     * be ignored.
      *
      * @throws NullPointerException if {@code listener} is null.
      */
     public GestureDetector(Context context, OnGestureListener listener, Handler handler,
-            boolean ignoreMultitouch) {
-        if (handler != null) {
-            mHandler = new GestureHandler(handler);
-        } else {
-            mHandler = new GestureHandler();
-        }
-        mListener = listener;
-        if (listener instanceof OnDoubleTapListener) {
-            setOnDoubleTapListener((OnDoubleTapListener) listener);
-        }
-        init(context, ignoreMultitouch);
+            boolean unused) {
+        this(context, listener, handler);
     }
 
-    private void init(Context context, boolean ignoreMultitouch) {
+    private void init(Context context) {
         if (mListener == null) {
             throw new NullPointerException("OnGestureListener must not be null");
         }
         mIsLongpressEnabled = true;
-        mIgnoreMultitouch = ignoreMultitouch;
 
         // Fallback to support pre-donuts releases
         int touchSlop, doubleTapSlop, doubleTapTouchSlop;
@@ -456,34 +447,41 @@
         }
 
         final int action = ev.getAction();
-        final float y = ev.getY();
-        final float x = ev.getX();
 
         if (mVelocityTracker == null) {
             mVelocityTracker = VelocityTracker.obtain();
         }
         mVelocityTracker.addMovement(ev);
 
+        final boolean pointerUp =
+                (action & MotionEvent.ACTION_MASK) == MotionEvent.ACTION_POINTER_UP;
+        final int skipIndex = pointerUp ? ev.getActionIndex() : -1;
+
+        // Determine focal point
+        float sumX = 0, sumY = 0;
+        final int count = ev.getPointerCount();
+        for (int i = 0; i < count; i++) {
+            if (skipIndex == i) continue;
+            sumX += ev.getX(i);
+            sumY += ev.getY(i);
+        }
+        final int div = pointerUp ? count - 1 : count;
+        final float focusX = sumX / div;
+        final float focusY = sumY / div;
+
         boolean handled = false;
 
         switch (action & MotionEvent.ACTION_MASK) {
         case MotionEvent.ACTION_POINTER_DOWN:
-            if (mIgnoreMultitouch) {
-                // Multitouch event - abort.
-                cancel();
-            }
+            mDownFocusX = mLastFocusX = focusX;
+            mDownFocusY = mLastFocusY = focusY;
+            // Cancel long press and taps
+            cancelTaps();
             break;
 
         case MotionEvent.ACTION_POINTER_UP:
-            // Ending a multitouch gesture and going back to 1 finger
-            if (mIgnoreMultitouch && ev.getPointerCount() == 2) {
-                int index = (((action & MotionEvent.ACTION_POINTER_INDEX_MASK)
-                        >> MotionEvent.ACTION_POINTER_INDEX_SHIFT) == 0) ? 1 : 0;
-                mLastMotionX = ev.getX(index);
-                mLastMotionY = ev.getY(index);
-                mVelocityTracker.recycle();
-                mVelocityTracker = VelocityTracker.obtain();
-            }
+            mDownFocusX = mLastFocusX = focusX;
+            mDownFocusY = mLastFocusY = focusY;
             break;
 
         case MotionEvent.ACTION_DOWN:
@@ -504,8 +502,8 @@
                 }
             }
 
-            mLastMotionX = x;
-            mLastMotionY = y;
+            mDownFocusX = mLastFocusX = focusX;
+            mDownFocusY = mLastFocusY = focusY;
             if (mCurrentDownEvent != null) {
                 mCurrentDownEvent.recycle();
             }
@@ -525,22 +523,22 @@
             break;
 
         case MotionEvent.ACTION_MOVE:
-            if (mInLongPress || (mIgnoreMultitouch && ev.getPointerCount() > 1)) {
+            if (mInLongPress) {
                 break;
             }
-            final float scrollX = mLastMotionX - x;
-            final float scrollY = mLastMotionY - y;
+            final float scrollX = mLastFocusX - focusX;
+            final float scrollY = mLastFocusY - focusY;
             if (mIsDoubleTapping) {
                 // Give the move events of the double-tap
                 handled |= mDoubleTapListener.onDoubleTapEvent(ev);
             } else if (mAlwaysInTapRegion) {
-                final int deltaX = (int) (x - mCurrentDownEvent.getX());
-                final int deltaY = (int) (y - mCurrentDownEvent.getY());
+                final int deltaX = (int) (focusX - mDownFocusX);
+                final int deltaY = (int) (focusY - mDownFocusY);
                 int distance = (deltaX * deltaX) + (deltaY * deltaY);
                 if (distance > mTouchSlopSquare) {
                     handled = mListener.onScroll(mCurrentDownEvent, ev, scrollX, scrollY);
-                    mLastMotionX = x;
-                    mLastMotionY = y;
+                    mLastFocusX = focusX;
+                    mLastFocusY = focusY;
                     mAlwaysInTapRegion = false;
                     mHandler.removeMessages(TAP);
                     mHandler.removeMessages(SHOW_PRESS);
@@ -551,8 +549,8 @@
                 }
             } else if ((Math.abs(scrollX) >= 1) || (Math.abs(scrollY) >= 1)) {
                 handled = mListener.onScroll(mCurrentDownEvent, ev, scrollX, scrollY);
-                mLastMotionX = x;
-                mLastMotionY = y;
+                mLastFocusX = focusX;
+                mLastFocusY = focusY;
             }
             break;
 
@@ -571,9 +569,10 @@
 
                 // A fling must travel the minimum tap distance
                 final VelocityTracker velocityTracker = mVelocityTracker;
+                final int pointerId = ev.getPointerId(0);
                 velocityTracker.computeCurrentVelocity(1000, mMaximumFlingVelocity);
-                final float velocityY = velocityTracker.getYVelocity();
-                final float velocityX = velocityTracker.getXVelocity();
+                final float velocityY = velocityTracker.getYVelocity(pointerId);
+                final float velocityX = velocityTracker.getXVelocity(pointerId);
 
                 if ((Math.abs(velocityY) > mMinimumFlingVelocity)
                         || (Math.abs(velocityX) > mMinimumFlingVelocity)){
@@ -622,6 +621,18 @@
         }
     }
 
+    private void cancelTaps() {
+        mHandler.removeMessages(SHOW_PRESS);
+        mHandler.removeMessages(LONG_PRESS);
+        mHandler.removeMessages(TAP);
+        mIsDoubleTapping = false;
+        mAlwaysInTapRegion = false;
+        mAlwaysInBiggerTapRegion = false;
+        if (mInLongPress) {
+            mInLongPress = false;
+        }
+    }
+
     private boolean isConsideredDoubleTap(MotionEvent firstDown, MotionEvent firstUp,
             MotionEvent secondDown) {
         if (!mAlwaysInBiggerTapRegion) {
diff --git a/core/java/android/view/ScaleGestureDetector.java b/core/java/android/view/ScaleGestureDetector.java
index 73f94bc..bcb8800 100644
--- a/core/java/android/view/ScaleGestureDetector.java
+++ b/core/java/android/view/ScaleGestureDetector.java
@@ -17,14 +17,13 @@
 package android.view;
 
 import android.content.Context;
-import android.util.DisplayMetrics;
 import android.util.FloatMath;
-import android.util.Log;
 
 /**
- * Detects transformation gestures involving more than one pointer ("multitouch")
- * using the supplied {@link MotionEvent}s. The {@link OnScaleGestureListener}
- * callback will notify users when a particular gesture event has occurred.
+ * Detects scaling transformation gestures using the supplied {@link MotionEvent}s.
+ * The {@link OnScaleGestureListener} callback will notify users when a particular
+ * gesture event has occurred.
+ *
  * This class should only be used with {@link MotionEvent}s reported via touch.
  *
  * To use this class:
@@ -87,8 +86,8 @@
          * pointers going up.
          *
          * Once a scale has ended, {@link ScaleGestureDetector#getFocusX()}
-         * and {@link ScaleGestureDetector#getFocusY()} will return the location
-         * of the pointer remaining on the screen.
+         * and {@link ScaleGestureDetector#getFocusY()} will return focal point
+         * of the pointers remaining on the screen.
          *
          * @param detector The detector reporting the event - use this to
          *          retrieve extended info about event state.
@@ -121,43 +120,23 @@
         }
     }
 
-    /**
-     * This value is the threshold ratio between our previous combined pressure
-     * and the current combined pressure. We will only fire an onScale event if
-     * the computed ratio between the current and previous event pressures is
-     * greater than this value. When pressure decreases rapidly between events
-     * the position values can often be imprecise, as it usually indicates
-     * that the user is in the process of lifting a pointer off of the device.
-     * Its value was tuned experimentally.
-     */
-    private static final float PRESSURE_THRESHOLD = 0.67f;
-
     private final Context mContext;
     private final OnScaleGestureListener mListener;
-    private boolean mGestureInProgress;
-
-    private MotionEvent mPrevEvent;
-    private MotionEvent mCurrEvent;
 
     private float mFocusX;
     private float mFocusY;
-    private float mPrevFingerDiffX;
-    private float mPrevFingerDiffY;
-    private float mCurrFingerDiffX;
-    private float mCurrFingerDiffY;
-    private float mCurrLen;
-    private float mPrevLen;
-    private float mScaleFactor;
-    private float mCurrPressure;
-    private float mPrevPressure;
-    private long mTimeDelta;
 
-    private boolean mInvalidGesture;
-
-    // Pointer IDs currently responsible for the two fingers controlling the gesture
-    private int mActiveId0;
-    private int mActiveId1;
-    private boolean mActive0MostRecent;
+    private float mCurrSpan;
+    private float mPrevSpan;
+    private float mInitialSpan;
+    private float mCurrSpanX;
+    private float mCurrSpanY;
+    private float mPrevSpanX;
+    private float mPrevSpanY;
+    private long mCurrTime;
+    private long mPrevTime;
+    private boolean mInProgress;
+    private int mSpanSlop;
 
     /**
      * Consistency verifier for debugging purposes.
@@ -169,8 +148,21 @@
     public ScaleGestureDetector(Context context, OnScaleGestureListener listener) {
         mContext = context;
         mListener = listener;
+        mSpanSlop = ViewConfiguration.get(context).getScaledTouchSlop() * 2;
     }
 
+    /**
+     * Accepts MotionEvents and dispatches events to a {@link OnScaleGestureListener}
+     * when appropriate.
+     *
+     * <p>Applications should pass a complete and consistent event stream to this method.
+     * A complete and consistent event stream involves all MotionEvents from the initial
+     * ACTION_DOWN to the final ACTION_UP or ACTION_CANCEL.</p>
+     *
+     * @param event The event to process
+     * @return true if the event was processed and the detector wants to receive the
+     *         rest of the MotionEvents in this event stream.
+     */
     public boolean onTouchEvent(MotionEvent event) {
         if (mInputEventConsistencyVerifier != null) {
             mInputEventConsistencyVerifier.onTouchEvent(event, 0);
@@ -178,265 +170,115 @@
 
         final int action = event.getActionMasked();
 
-        if (action == MotionEvent.ACTION_DOWN) {
-            reset(); // Start fresh
-        }
-
-        boolean handled = true;
-        if (mInvalidGesture) {
-            handled = false;
-        } else if (!mGestureInProgress) {
-            switch (action) {
-                case MotionEvent.ACTION_DOWN: {
-                    mActiveId0 = event.getPointerId(0);
-                    mActive0MostRecent = true;
-                }
-                break;
-
-                case MotionEvent.ACTION_UP:
-                    reset();
-                    break;
-
-                case MotionEvent.ACTION_POINTER_DOWN: {
-                    // We have a new multi-finger gesture
-                    if (mPrevEvent != null) mPrevEvent.recycle();
-                    mPrevEvent = MotionEvent.obtain(event);
-                    mTimeDelta = 0;
-
-                    int index1 = event.getActionIndex();
-                    int index0 = event.findPointerIndex(mActiveId0);
-                    mActiveId1 = event.getPointerId(index1);
-                    if (index0 < 0 || index0 == index1) {
-                        // Probably someone sending us a broken event stream.
-                        index0 = findNewActiveIndex(event, mActiveId1, -1);
-                        mActiveId0 = event.getPointerId(index0);
-                    }
-                    mActive0MostRecent = false;
-
-                    setContext(event);
-
-                    mGestureInProgress = mListener.onScaleBegin(this);
-                    break;
-                }
-            }
-        } else {
-            // Transform gesture in progress - attempt to handle it
-            switch (action) {
-                case MotionEvent.ACTION_POINTER_DOWN: {
-                    // End the old gesture and begin a new one with the most recent two fingers.
-                    mListener.onScaleEnd(this);
-                    final int oldActive0 = mActiveId0;
-                    final int oldActive1 = mActiveId1;
-                    reset();
-
-                    mPrevEvent = MotionEvent.obtain(event);
-                    mActiveId0 = mActive0MostRecent ? oldActive0 : oldActive1;
-                    mActiveId1 = event.getPointerId(event.getActionIndex());
-                    mActive0MostRecent = false;
-
-                    int index0 = event.findPointerIndex(mActiveId0);
-                    if (index0 < 0 || mActiveId0 == mActiveId1) {
-                        // Probably someone sending us a broken event stream.
-                        Log.e(TAG, "Got " + MotionEvent.actionToString(action) +
-                                " with bad state while a gesture was in progress. " +
-                                "Did you forget to pass an event to " +
-                                "ScaleGestureDetector#onTouchEvent?");
-                        index0 = findNewActiveIndex(event, mActiveId1, -1);
-                        mActiveId0 = event.getPointerId(index0);
-                    }
-
-                    setContext(event);
-
-                    mGestureInProgress = mListener.onScaleBegin(this);
-                }
-                break;
-
-                case MotionEvent.ACTION_POINTER_UP: {
-                    final int pointerCount = event.getPointerCount();
-                    final int actionIndex = event.getActionIndex();
-                    final int actionId = event.getPointerId(actionIndex);
-
-                    boolean gestureEnded = false;
-                    if (pointerCount > 2) {
-                        if (actionId == mActiveId0) {
-                            final int newIndex = findNewActiveIndex(event, mActiveId1, actionIndex);
-                            if (newIndex >= 0) {
-                                mListener.onScaleEnd(this);
-                                mActiveId0 = event.getPointerId(newIndex);
-                                mActive0MostRecent = true;
-                                mPrevEvent = MotionEvent.obtain(event);
-                                setContext(event);
-                                mGestureInProgress = mListener.onScaleBegin(this);
-                            } else {
-                                gestureEnded = true;
-                            }
-                        } else if (actionId == mActiveId1) {
-                            final int newIndex = findNewActiveIndex(event, mActiveId0, actionIndex);
-                            if (newIndex >= 0) {
-                                mListener.onScaleEnd(this);
-                                mActiveId1 = event.getPointerId(newIndex);
-                                mActive0MostRecent = false;
-                                mPrevEvent = MotionEvent.obtain(event);
-                                setContext(event);
-                                mGestureInProgress = mListener.onScaleBegin(this);
-                            } else {
-                                gestureEnded = true;
-                            }
-                        }
-                        mPrevEvent.recycle();
-                        mPrevEvent = MotionEvent.obtain(event);
-                        setContext(event);
-                    } else {
-                        gestureEnded = true;
-                    }
-
-                    if (gestureEnded) {
-                        // Gesture ended
-                        setContext(event);
-
-                        // Set focus point to the remaining finger
-                        final int activeId = actionId == mActiveId0 ? mActiveId1 : mActiveId0;
-                        final int index = event.findPointerIndex(activeId);
-                        mFocusX = event.getX(index);
-                        mFocusY = event.getY(index);
-
-                        mListener.onScaleEnd(this);
-                        reset();
-                        mActiveId0 = activeId;
-                        mActive0MostRecent = true;
-                    }
-                }
-                break;
-
-                case MotionEvent.ACTION_CANCEL:
-                    mListener.onScaleEnd(this);
-                    reset();
-                    break;
-
-                case MotionEvent.ACTION_UP:
-                    reset();
-                    break;
-
-                case MotionEvent.ACTION_MOVE: {
-                    setContext(event);
-
-                    // Only accept the event if our relative pressure is within
-                    // a certain limit - this can help filter shaky data as a
-                    // finger is lifted.
-                    if (mCurrPressure / mPrevPressure > PRESSURE_THRESHOLD) {
-                        final boolean updatePrevious = mListener.onScale(this);
-
-                        if (updatePrevious) {
-                            mPrevEvent.recycle();
-                            mPrevEvent = MotionEvent.obtain(event);
-                        }
-                    }
-                }
-                break;
-            }
-        }
-
-        if (!handled && mInputEventConsistencyVerifier != null) {
-            mInputEventConsistencyVerifier.onUnhandledEvent(event, 0);
-        }
-        return handled;
-    }
-
-    private int findNewActiveIndex(MotionEvent ev, int otherActiveId, int removedPointerIndex) {
-        final int pointerCount = ev.getPointerCount();
-
-        // It's ok if this isn't found and returns -1, it simply won't match.
-        final int otherActiveIndex = ev.findPointerIndex(otherActiveId);
-
-        // Pick a new id and update tracking state.
-        for (int i = 0; i < pointerCount; i++) {
-            if (i != removedPointerIndex && i != otherActiveIndex) {
-                return i;
-            }
-        }
-        return -1;
-    }
-
-    private void setContext(MotionEvent curr) {
-        if (mCurrEvent != null) {
-            mCurrEvent.recycle();
-        }
-        mCurrEvent = MotionEvent.obtain(curr);
-
-        mCurrLen = -1;
-        mPrevLen = -1;
-        mScaleFactor = -1;
-
-        final MotionEvent prev = mPrevEvent;
-
-        final int prevIndex0 = prev.findPointerIndex(mActiveId0);
-        final int prevIndex1 = prev.findPointerIndex(mActiveId1);
-        final int currIndex0 = curr.findPointerIndex(mActiveId0);
-        final int currIndex1 = curr.findPointerIndex(mActiveId1);
-
-        if (prevIndex0 < 0 || prevIndex1 < 0 || currIndex0 < 0 || currIndex1 < 0) {
-            mInvalidGesture = true;
-            Log.e(TAG, "Invalid MotionEvent stream detected.", new Throwable());
-            if (mGestureInProgress) {
+        final boolean streamComplete = action == MotionEvent.ACTION_UP ||
+                action == MotionEvent.ACTION_CANCEL;
+        if (action == MotionEvent.ACTION_DOWN || streamComplete) {
+            // Reset any scale in progress with the listener.
+            // If it's an ACTION_DOWN we're beginning a new event stream.
+            // This means the app probably didn't give us all the events. Shame on it.
+            if (mInProgress) {
                 mListener.onScaleEnd(this);
+                mInProgress = false;
+                mInitialSpan = 0;
             }
-            return;
+
+            if (streamComplete) {
+                return true;
+            }
         }
 
-        final float px0 = prev.getX(prevIndex0);
-        final float py0 = prev.getY(prevIndex0);
-        final float px1 = prev.getX(prevIndex1);
-        final float py1 = prev.getY(prevIndex1);
-        final float cx0 = curr.getX(currIndex0);
-        final float cy0 = curr.getY(currIndex0);
-        final float cx1 = curr.getX(currIndex1);
-        final float cy1 = curr.getY(currIndex1);
+        final boolean configChanged =
+                action == MotionEvent.ACTION_POINTER_UP ||
+                action == MotionEvent.ACTION_POINTER_DOWN;
+        final boolean pointerUp = action == MotionEvent.ACTION_POINTER_UP;
+        final int skipIndex = pointerUp ? event.getActionIndex() : -1;
 
-        final float pvx = px1 - px0;
-        final float pvy = py1 - py0;
-        final float cvx = cx1 - cx0;
-        final float cvy = cy1 - cy0;
-        mPrevFingerDiffX = pvx;
-        mPrevFingerDiffY = pvy;
-        mCurrFingerDiffX = cvx;
-        mCurrFingerDiffY = cvy;
-
-        mFocusX = cx0 + cvx * 0.5f;
-        mFocusY = cy0 + cvy * 0.5f;
-        mTimeDelta = curr.getEventTime() - prev.getEventTime();
-        mCurrPressure = curr.getPressure(currIndex0) + curr.getPressure(currIndex1);
-        mPrevPressure = prev.getPressure(prevIndex0) + prev.getPressure(prevIndex1);
-    }
-
-    private void reset() {
-        if (mPrevEvent != null) {
-            mPrevEvent.recycle();
-            mPrevEvent = null;
+        // Determine focal point
+        float sumX = 0, sumY = 0;
+        final int count = event.getPointerCount();
+        for (int i = 0; i < count; i++) {
+            if (skipIndex == i) continue;
+            sumX += event.getX(i);
+            sumY += event.getY(i);
         }
-        if (mCurrEvent != null) {
-            mCurrEvent.recycle();
-            mCurrEvent = null;
+        final int div = pointerUp ? count - 1 : count;
+        final float focusX = sumX / div;
+        final float focusY = sumY / div;
+
+        // Determine average deviation from focal point
+        float devSumX = 0, devSumY = 0;
+        for (int i = 0; i < count; i++) {
+            if (skipIndex == i) continue;
+            devSumX += Math.abs(event.getX(i) - focusX);
+            devSumY += Math.abs(event.getY(i) - focusY);
         }
-        mGestureInProgress = false;
-        mActiveId0 = -1;
-        mActiveId1 = -1;
-        mInvalidGesture = false;
+        final float devX = devSumX / div;
+        final float devY = devSumY / div;
+
+        // Span is the average distance between touch points through the focal point;
+        // i.e. the diameter of the circle with a radius of the average deviation from
+        // the focal point.
+        final float spanX = devX * 2;
+        final float spanY = devY * 2;
+        final float span = FloatMath.sqrt(spanX * spanX + spanY * spanY);
+
+        // Dispatch begin/end events as needed.
+        // If the configuration changes, notify the app to reset its current state by beginning
+        // a fresh scale event stream.
+        final boolean wasInProgress = mInProgress;
+        mFocusX = focusX;
+        mFocusY = focusY;
+        if (mInProgress && (span == 0 || configChanged)) {
+            mListener.onScaleEnd(this);
+            mInProgress = false;
+            mInitialSpan = span;
+        }
+        if (configChanged) {
+            mPrevSpanX = mCurrSpanX = spanX;
+            mPrevSpanY = mCurrSpanY = spanY;
+            mInitialSpan = mPrevSpan = mCurrSpan = span;
+        }
+        if (!mInProgress && span != 0 &&
+                (wasInProgress || Math.abs(span - mInitialSpan) > mSpanSlop)) {
+            mPrevSpanX = mCurrSpanX = spanX;
+            mPrevSpanY = mCurrSpanY = spanY;
+            mPrevSpan = mCurrSpan = span;
+            mInProgress = mListener.onScaleBegin(this);
+        }
+
+        // Handle motion; focal point and span/scale factor are changing.
+        if (action == MotionEvent.ACTION_MOVE) {
+            mCurrSpanX = spanX;
+            mCurrSpanY = spanY;
+            mCurrSpan = span;
+
+            boolean updatePrev = true;
+            if (mInProgress) {
+                updatePrev = mListener.onScale(this);
+            }
+
+            if (updatePrev) {
+                mPrevSpanX = mCurrSpanX;
+                mPrevSpanY = mCurrSpanY;
+                mPrevSpan = mCurrSpan;
+            }
+        }
+
+        return true;
     }
 
     /**
-     * Returns {@code true} if a two-finger scale gesture is in progress.
-     * @return {@code true} if a scale gesture is in progress, {@code false} otherwise.
+     * Returns {@code true} if a scale gesture is in progress.
      */
     public boolean isInProgress() {
-        return mGestureInProgress;
+        return mInProgress;
     }
 
     /**
      * Get the X coordinate of the current gesture's focal point.
-     * If a gesture is in progress, the focal point is directly between
-     * the two pointers forming the gesture.
-     * If a gesture is ending, the focal point is the location of the
-     * remaining pointer on the screen.
+     * If a gesture is in progress, the focal point is between
+     * each of the pointers forming the gesture.
+     *
      * If {@link #isInProgress()} would return false, the result of this
      * function is undefined.
      *
@@ -448,10 +290,9 @@
 
     /**
      * Get the Y coordinate of the current gesture's focal point.
-     * If a gesture is in progress, the focal point is directly between
-     * the two pointers forming the gesture.
-     * If a gesture is ending, the focal point is the location of the
-     * remaining pointer on the screen.
+     * If a gesture is in progress, the focal point is between
+     * each of the pointers forming the gesture.
+     *
      * If {@link #isInProgress()} would return false, the result of this
      * function is undefined.
      *
@@ -462,73 +303,63 @@
     }
 
     /**
-     * Return the current distance between the two pointers forming the
-     * gesture in progress.
+     * Return the average distance between each of the pointers forming the
+     * gesture in progress through the focal point.
      *
      * @return Distance between pointers in pixels.
      */
     public float getCurrentSpan() {
-        if (mCurrLen == -1) {
-            final float cvx = mCurrFingerDiffX;
-            final float cvy = mCurrFingerDiffY;
-            mCurrLen = FloatMath.sqrt(cvx*cvx + cvy*cvy);
-        }
-        return mCurrLen;
+        return mCurrSpan;
     }
 
     /**
-     * Return the current x distance between the two pointers forming the
-     * gesture in progress.
+     * Return the average X distance between each of the pointers forming the
+     * gesture in progress through the focal point.
      *
      * @return Distance between pointers in pixels.
      */
     public float getCurrentSpanX() {
-        return mCurrFingerDiffX;
+        return mCurrSpanX;
     }
 
     /**
-     * Return the current y distance between the two pointers forming the
-     * gesture in progress.
+     * Return the average Y distance between each of the pointers forming the
+     * gesture in progress through the focal point.
      *
      * @return Distance between pointers in pixels.
      */
     public float getCurrentSpanY() {
-        return mCurrFingerDiffY;
+        return mCurrSpanY;
     }
 
     /**
-     * Return the previous distance between the two pointers forming the
-     * gesture in progress.
+     * Return the previous average distance between each of the pointers forming the
+     * gesture in progress through the focal point.
      *
      * @return Previous distance between pointers in pixels.
      */
     public float getPreviousSpan() {
-        if (mPrevLen == -1) {
-            final float pvx = mPrevFingerDiffX;
-            final float pvy = mPrevFingerDiffY;
-            mPrevLen = FloatMath.sqrt(pvx*pvx + pvy*pvy);
-        }
-        return mPrevLen;
+        return mPrevSpan;
     }
 
     /**
-     * Return the previous x distance between the two pointers forming the
-     * gesture in progress.
+     * Return the previous average X distance between each of the pointers forming the
+     * gesture in progress through the focal point.
      *
      * @return Previous distance between pointers in pixels.
      */
     public float getPreviousSpanX() {
-        return mPrevFingerDiffX;
+        return mPrevSpanX;
     }
 
     /**
-     * Return the previous y distance between the two pointers forming the
-     * gesture in progress.
+     * Return the previous average Y distance between each of the pointers forming the
+     * gesture in progress through the focal point.
      *
      * @return Previous distance between pointers in pixels.
      */
     public float getPreviousSpanY() {
-        return mPrevFingerDiffY;
+        return mPrevSpanY;
     }
 
     /**
@@ -539,10 +370,7 @@
      * @return The current scaling factor.
      */
     public float getScaleFactor() {
-        if (mScaleFactor == -1) {
-            mScaleFactor = getCurrentSpan() / getPreviousSpan();
-        }
-        return mScaleFactor;
+        return mPrevSpan > 0 ? mCurrSpan / mPrevSpan : 1;
     }
 
     /**
@@ -552,7 +380,7 @@
      * @return Time difference since the last scaling event in milliseconds.
      */
     public long getTimeDelta() {
-        return mTimeDelta;
+        return mCurrTime - mPrevTime;
     }
 
     /**
@@ -561,6 +389,6 @@
      * @return Current event time in milliseconds.
      */
     public long getEventTime() {
-        return mCurrEvent.getEventTime();
+        return mCurrTime;
     }
 }
diff --git a/core/java/android/webkit/WebViewClassic.java b/core/java/android/webkit/WebViewClassic.java
index 84a6129..233f29b 100644
--- a/core/java/android/webkit/WebViewClassic.java
+++ b/core/java/android/webkit/WebViewClassic.java
@@ -1336,20 +1336,40 @@
 
     private void onHandleUiTouchEvent(MotionEvent ev) {
         final ScaleGestureDetector detector =
-                mZoomManager.getMultiTouchGestureDetector();
+                mZoomManager.getScaleGestureDetector();
 
-        float x = ev.getX();
-        float y = ev.getY();
+        int action = ev.getActionMasked();
+        final boolean pointerUp = action == MotionEvent.ACTION_POINTER_UP;
+        final boolean configChanged =
+            action == MotionEvent.ACTION_POINTER_UP ||
+            action == MotionEvent.ACTION_POINTER_DOWN;
+        final int skipIndex = pointerUp ? ev.getActionIndex() : -1;
+
+        // Determine focal point
+        float sumX = 0, sumY = 0;
+        final int count = ev.getPointerCount();
+        for (int i = 0; i < count; i++) {
+            if (skipIndex == i) continue;
+            sumX += ev.getX(i);
+            sumY += ev.getY(i);
+        }
+        final int div = pointerUp ? count - 1 : count;
+        float x = sumX / div;
+        float y = sumY / div;
+
+        if (configChanged) {
+            mLastTouchX = Math.round(x);
+            mLastTouchY = Math.round(y);
+            mLastTouchTime = ev.getEventTime();
+            mWebView.cancelLongPress();
+            mPrivateHandler.removeMessages(SWITCH_TO_LONGPRESS);
+        }
 
         if (detector != null) {
             detector.onTouchEvent(ev);
             if (detector.isInProgress()) {
                 mLastTouchTime = ev.getEventTime();
-                x = detector.getFocusX();
-                y = detector.getFocusY();
 
-                mWebView.cancelLongPress();
-                mPrivateHandler.removeMessages(SWITCH_TO_LONGPRESS);
                 if (!mZoomManager.supportsPanDuringZoom()) {
                     return;
                 }
@@ -1360,14 +1380,9 @@
             }
         }
 
-        int action = ev.getActionMasked();
         if (action == MotionEvent.ACTION_POINTER_DOWN) {
             cancelTouch();
             action = MotionEvent.ACTION_DOWN;
-        } else if (action == MotionEvent.ACTION_POINTER_UP && ev.getPointerCount() >= 2) {
-            // set mLastTouchX/Y to the remaining points for multi-touch.
-            mLastTouchX = Math.round(x);
-            mLastTouchY = Math.round(y);
         } else if (action == MotionEvent.ACTION_MOVE) {
             // negative x or y indicate it is on the edge, skip it.
             if (x < 0 || y < 0) {
@@ -4345,7 +4360,7 @@
 
         // A multi-finger gesture can look like a long press; make sure we don't take
         // long press actions if we're scaling.
-        final ScaleGestureDetector detector = mZoomManager.getMultiTouchGestureDetector();
+        final ScaleGestureDetector detector = mZoomManager.getScaleGestureDetector();
         if (detector != null && detector.isInProgress()) {
             return false;
         }
@@ -5752,7 +5767,7 @@
     * and the middle point for multi-touch.
     */
     private void handleTouchEventCommon(MotionEvent event, int action, int x, int y) {
-        ScaleGestureDetector detector = mZoomManager.getMultiTouchGestureDetector();
+        ScaleGestureDetector detector = mZoomManager.getScaleGestureDetector();
 
         long eventTime = event.getEventTime();
 
diff --git a/core/java/android/webkit/ZoomManager.java b/core/java/android/webkit/ZoomManager.java
index 8830119..80a6782 100644
--- a/core/java/android/webkit/ZoomManager.java
+++ b/core/java/android/webkit/ZoomManager.java
@@ -204,7 +204,7 @@
      */
     private boolean mAllowPanAndScale;
 
-    // use the framework's ScaleGestureDetector to handle multi-touch
+    // use the framework's ScaleGestureDetector to handle scaling gestures
     private ScaleGestureDetector mScaleDetector;
     private boolean mPinchToZoomAnimating = false;
 
@@ -768,7 +768,7 @@
         return isZoomAnimating();
     }
 
-    public ScaleGestureDetector getMultiTouchGestureDetector() {
+    public ScaleGestureDetector getScaleGestureDetector() {
         return mScaleDetector;
     }
 
diff --git a/docs/downloads/design/Android_Design_Downloads_20120823.zip b/docs/downloads/design/Android_Design_Downloads_20120823.zip
new file mode 100644
index 0000000..6d31283
--- /dev/null
+++ b/docs/downloads/design/Android_Design_Downloads_20120823.zip
Binary files differ
diff --git a/docs/downloads/design/Roboto_Hinted_20120823.zip b/docs/downloads/design/Roboto_Hinted_20120823.zip
new file mode 100644
index 0000000..9ead4af
--- /dev/null
+++ b/docs/downloads/design/Roboto_Hinted_20120823.zip
Binary files differ
diff --git a/docs/downloads/training/TabCompat.zip b/docs/downloads/training/TabCompat.zip
index b70b442..b907b42 100644
--- a/docs/downloads/training/TabCompat.zip
+++ b/docs/downloads/training/TabCompat.zip
Binary files differ
diff --git a/docs/html/about/dashboards/index.jd b/docs/html/about/dashboards/index.jd
index 4a75b91..c3da3bf 100644
--- a/docs/html/about/dashboards/index.jd
+++ b/docs/html/about/dashboards/index.jd
@@ -20,44 +20,43 @@
 <p>The following pie chart and table is based on the number of Android devices that have accessed
 Google Play within a 14-day period ending on the data collection date noted below.</p>
 
-<div class="col-6" style="margin-left:0">
+<div class="col-5" style="margin-left:0">
 
 
 <table>
 <tr>
   <th>Version</th>
   <th>Codename</th>
-  <th>API Level</th>
+  <th>API</th>
   <th>Distribution</th>
 </tr>
 <tr><td><a href="/about/versions/android-1.5.html">1.5</a></td><td>Cupcake</td>  <td>3</td><td>0.2%</td></tr>
-<tr><td><a href="/about/versions/android-1.6.html">1.6</a></td><td>Donut</td>    <td>4</td><td>0.5%</td></tr>
-<tr><td><a href="/about/versions/android-2.1.html">2.1</a></td><td>Eclair</td>   <td>7</td><td>4.2%</td></tr>
-<tr><td><a href="/about/versions/android-2.2.html">2.2</a></td><td>Froyo</td>    <td>8</td><td>15.5%</td></tr>
+<tr><td><a href="/about/versions/android-1.6.html">1.6</a></td><td>Donut</td>    <td>4</td><td>0.4%</td></tr>
+<tr><td><a href="/about/versions/android-2.1.html">2.1</a></td><td>Eclair</td>   <td>7</td><td>3.7%</td></tr>
+<tr><td><a href="/about/versions/android-2.2.html">2.2</a></td><td>Froyo</td>    <td>8</td><td>14%</td></tr>
 <tr><td><a href="/about/versions/android-2.3.html">2.3 - 2.3.2</a>
                                    </td><td rowspan="2">Gingerbread</td>    <td>9</td><td>0.3%</td></tr>
 <tr><td><a href="/about/versions/android-2.3.3.html">2.3.3 - 2.3.7
-        </a></td><!-- Gingerbread -->                                       <td>10</td><td>60.3%</td></tr>
+        </a></td><!-- Gingerbread -->                                       <td>10</td><td>57.2%</td></tr>
 <tr><td><a href="/about/versions/android-3.1.html">3.1</a></td>
                                                    <td rowspan="2">Honeycomb</td>      <td>12</td><td>0.5%</td></tr>
-<tr><td><a href="/about/versions/android-3.2.html">3.2</a></td>      <!-- Honeycomb --><td>13</td><td>1.8%</td></tr> 
+<tr><td><a href="/about/versions/android-3.2.html">3.2</a></td>      <!-- Honeycomb --><td>13</td><td>1.6%</td></tr> 
 <tr><td><a href="/about/versions/android-4.0.html">4.0 - 4.0.2</a></td>
                                                 <td rowspan="2">Ice Cream Sandwich</td><td>14</td><td>0.1%</td></tr> 
 <tr><td><a href="/about/versions/android-4.0.3.html">4.0.3 - 4.0.4</a></td>
-                                                                     <!-- ICS     -->  <td>15</td><td>15.8%</td></tr> 
-<tr><td><a href="/about/versions/android-4.1.html">4.1</a></td>   <td>Jelly Bean</td><td>16</td><td>0.8%</td></tr> 
+                                                                     <!-- ICS     -->  <td>15</td><td>20.8%</td></tr> 
+<tr><td><a href="/about/versions/android-4.1.html">4.1</a></td>   <td>Jelly Bean</td><td>16</td><td>1.2%</td></tr> 
 </table>
 
-
 </div>
 
-<div class="col-7" style="margin-right:0">
+<div class="col-8" style="margin-right:0">
 <img alt=""
-src="http://chart.apis.google.com/chart?&cht=p&chs=460x310&chd=t:0.2,0.5,4.2,15.5,0.3,60.3,0.5,1.8,0.1,15.8,0.8&chl=Android%201.5|Android%201.6|Android%202.1|Android%202.2|Android%202.3|Android%202.3.3|Android%203.1|Android%203.2|Android%204.0|Android%204.0.3|Android%204.1&chco=c4df9b,6fad0c&chf=bg,s,00000000" />
+src="http://chart.apis.google.com/chart?&cht=p&chs=460x245&chd=t:4.3,14,57.5,2.1,20.9,1.2&chl=Eclair%20%26%20older|Froyo|Gingerbread|Honeycomb|Ice%20Cream%20Sandwich|Jelly%20Bean&chco=c4df9b,6fad0c&chf=bg,s,00000000" />
 
 </div><!-- end dashboard-panel -->
 
-<p style="clear:both"><em>Data collected during a 14-day period ending on August 1, 2012</em></p>
+<p style="clear:both"><em>Data collected during a 14-day period ending on September 4, 2012</em></p>
 <!--
 <p style="font-size:.9em">* <em>Other: 0.1% of devices running obsolete versions</em></p>
 -->
@@ -82,9 +81,9 @@
 Google Play within a 14-day period ending on the date indicated on the x-axis.</p>
 
 <img alt="" height="250" width="660"
-src="http://chart.apis.google.com/chart?&cht=lc&chs=660x250&chxt=x,x,y,r&chf=bg,s,00000000&chxr=0,0,12|1,0,12|2,0,100|3,0,100&chxl=0%3A%7C02/01%7C02/15%7C03/01%7C03/15%7C04/01%7C04/15%7C05/01%7C05/15%7C06/01%7C06/15%7C07/01%7C07/15%7C08/01%7C1%3A%7C2012%7C%7C%7C%7C%7C%7C%7C%7C%7C%7C%7C%7C2012%7C2%3A%7C0%25%7C25%25%7C50%25%7C75%25%7C100%25%7C3%3A%7C0%25%7C25%25%7C50%25%7C75%25%7C100%25&chxp=0,0,1,2,3,4,5,6,7,8,9,10,11,12&chxtc=0,5&chd=t:98.6,98.4,98.4,98.6,98.5,98.6,98.8,98.7,98.9,99.1,99.1,99.2,98.6|97.6,97.5,97.6,97.8,97.8,97.9,98.1,98.1,98.3,98.5,98.6,98.7,98.1|89.9,90.3,90.8,91.4,91.8,92.1,92.5,92.7,93.1,93.5,93.9,94.2,93.9|62.0,63.7,65.2,66.8,68.6,69.9,71.5,72.6,74.0,75.2,76.5,77.8,78.4|4.0,4.1,4.3,4.6,5.5,6.5,7.6,8.2,9.4,11.0,12.8,15.6,18.1|2.6,3.0,3.2,3.5,4.5,5.5,6.6,7.4,8.7,10.4,12.3,15.1,17.6|0.7,0.8,1.1,1.3,2.3,3.3,4.4,5.3,6.7,8.4,10.4,13.2,15.8&chm=b,c3df9b,0,1,0|b,b6dc7d,1,2,0|tAndroid%202.2,5b831d,2,0,15,,t::-5|b,aadb5e,2,3,0|tAndroid%202.3.3,496c13,3,0,15,,t::-5|b,9ddb3d,3,4,0|b,91da1e,4,5,0|b,80c414,5,6,0|tAndroid%204.0.3,131d02,6,10,15,,t::-5|B,6fad0c,6,7,0&chg=7,25&chdl=Android%201.6|Android%202.1|Android%202.2|Android%202.3.3|Android%203.1|Android%203.2|Android%204.0.3&chco=add274,a0d155,94d134,84c323,73ad18,62960f,507d08" />
+src="http://chart.apis.google.com/chart?&cht=lc&chs=660x250&chxt=x,x,y,r&chf=bg,s,00000000&chxr=0,0,12|1,0,12|2,0,100|3,0,100&chxl=0%3A%7C03/01%7C03/15%7C04/01%7C04/15%7C05/01%7C05/15%7C06/01%7C06/15%7C07/01%7C07/15%7C08/01%7C08/15%7C09/01%7C1%3A%7C2012%7C%7C%7C%7C%7C%7C%7C%7C%7C%7C%7C%7C2012%7C2%3A%7C0%25%7C25%25%7C50%25%7C75%25%7C100%25%7C3%3A%7C0%25%7C25%25%7C50%25%7C75%25%7C100%25&chxp=0,0,1,2,3,4,5,6,7,8,9,10,11,12&chxtc=0,5&chd=t:97.6,97.8,97.8,97.9,98.1,98.1,98.3,98.5,98.6,98.7,98.9,98.9,99.0|90.8,91.4,91.8,92.1,92.5,92.7,93.1,93.5,93.9,94.2,94.7,94.9,95.3|65.2,66.8,68.6,69.9,71.5,72.6,74.0,75.2,76.5,77.8,79.2,80.1,81.1|4.3,4.6,5.5,6.5,7.6,8.2,9.4,11.0,12.8,15.6,18.9,21.2,23.7|3.2,3.5,4.5,5.5,6.6,7.4,8.7,10.4,12.3,15.1,18.4,20.7,23.2|1.1,1.3,2.3,3.3,4.4,5.3,6.7,8.4,10.4,13.2,16.6,19.0,21.5|0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.8,0.9,1.1&chm=b,c3df9b,0,1,0|tAndroid%202.2,6c9729,1,0,15,,t::-5|b,b6dc7d,1,2,0|tAndroid%202.3.3,5b831d,2,0,15,,t::-5|b,aadb5e,2,3,0|b,9ddb3d,3,4,0|b,91da1e,4,5,0|tAndroid%204.0.3,253a06,5,8,15,,t::-5|b,80c414,5,6,0|B,6fad0c,6,7,0&chg=7,25&chdl=Android%202.1|Android%202.2|Android%202.3.3|Android%203.1|Android%203.2|Android%204.0.3|Android%204.1&chco=add274,a0d155,94d134,84c323,73ad18,62960f,507d08" />
 
-<p><em>Last historical dataset collected during a 14-day period ending on August 1, 2012</em></p>
+<p><em>Last historical dataset collected during a 14-day period ending on September 1, 2012</em></p>
 
 
 
@@ -111,6 +110,14 @@
 
 <h2 id="Screens">Screen Sizes and Densities</h2>
 
+
+<img alt="" style="float:right;"
+src="http://chart.googleapis.com/chart?cht=p&chs=400x250&chf=bg,s,00000000&chco=c4df9b,6fad0c&chl=Xlarge%7CLarge%7CNormal%7CSmall&chd=t%3A4.7,6.5,86,2.8" />
+
+
+<img alt="" style="float:right;clear:right"
+src="http://chart.googleapis.com/chart?cht=p&chs=400x250&chf=bg,s,00000000&chco=c4df9b,6fad0c&chl=ldpi%7Cmdpi%7Chdpi%7Cxhdpi&chd=t%3A1.6,18.6,53.6,26.2" />
+
 <p>This section provides data about the relative number of active devices that have a particular
 screen configuration, defined by a combination of screen size and density. To simplify the way that
 you design your user interfaces for different screen configurations, Android divides the range of
@@ -132,10 +139,7 @@
 ending on the data collection date noted below.</p>
 
 
-<div class="col-6" style="margin-left:0">
-
-
-<table>
+<table style="width:350px">
 <tr>
 <th></th>
 <th scope="col">ldpi</th>
@@ -144,22 +148,22 @@
 <th scope="col">xhdpi</th>
 </tr>
 <tr><th scope="row">small</th> 
-<td>1.5%</td>     <!-- small/ldpi -->
+<td>1.1%</td>     <!-- small/ldpi -->
 <td></td>     <!-- small/mdpi -->
-<td>1.2%</td> <!-- small/hdpi -->
+<td>1.7%</td> <!-- small/hdpi -->
 <td></td>     <!-- small/xhdpi -->
 </tr> 
 <tr><th scope="row">normal</th> 
-<td>0.5%</td>  <!-- normal/ldpi -->
-<td>12.1%</td> <!-- normal/mdpi -->
-<td>55.3%</td> <!-- normal/hdpi -->
-<td>17.4%</td>      <!-- normal/xhdpi -->
+<td>0.4%</td>  <!-- normal/ldpi -->
+<td>11.4%</td> <!-- normal/mdpi -->
+<td>51.9%</td> <!-- normal/hdpi -->
+<td>22.3%</td>      <!-- normal/xhdpi -->
 </tr> 
 <tr><th scope="row">large</th> 
 <td>0.1%</td>     <!-- large/ldpi -->
-<td>2.7%</td> <!-- large/mdpi -->
+<td>2.5%</td> <!-- large/mdpi -->
 <td></td>     <!-- large/hdpi -->
-<td>4.5%</td>     <!-- large/xhdpi -->
+<td>3.9%</td>     <!-- large/xhdpi -->
 </tr> 
 <tr><th scope="row">xlarge</th> 
 <td></td>     <!-- xlarge/ldpi -->
@@ -169,16 +173,7 @@
 </tr> 
 </table>
 
-
-</div>
-
-<div class="col-7" style="margin-right:0">
-<img alt=""
-src="http://chart.googleapis.com/chart?cht=p&chs=400x250&chf=bg,s,00000000&chco=c4df9b,6fad0c&chl=Xlarge%20/%20mdpi|Large%20/%20ldpi|Large%20/%20mdpi|Large%20/%20xhdpi|Normal%20/%20hdpi|Normal%20/%20ldpi|Normal%20/%20mdpi|Normal%20/%20xhdpi|Small%20/%20hdpi|Small%20/%20ldpi&chd=t%3A4.7,0.1,2.7,4.5,55.3,0.5,12.1,17.4,1.2,1.5" />
-
-</div>
-
-<p style="clear:both"><em>Data collected during a 7-day period ending on August 1, 2012</em></p>
+<p style="clear:both"><em>Data collected during a 7-day period ending on September 4, 2012</em></p>
 
 
 
@@ -196,6 +191,10 @@
 support for any lower version (for example, support for version 2.0 also implies support for
 1.1).</p>
 
+
+<img alt="" style="float:right"
+src="http://chart.googleapis.com/chart?cht=p&chs=400x250&chco=c4df9b,6fad0c&chl=GL%201.1%20only|GL%202.0%20%26%201.1&chd=t%3A9.2,90.8&chf=bg,s,00000000" />
+
 <p>To declare which version of OpenGL ES your application requires, you should use the {@code
 android:glEsVersion} attribute of the <a
 href="{@docRoot}guide/topics/manifest/uses-feature-element.html">{@code &lt;uses-feature&gt;}</a>
@@ -209,28 +208,21 @@
 ending on the data collection date noted below.</p>
 
 
-<div class="col-6" style="margin-left:0">
-<table>
+<table style="width:350px">
 <tr>
 <th scope="col">OpenGL ES Version</th>
 <th scope="col">Distribution</th>
 </tr>
 <tr>
 <td>1.1 only</th>
-<td>9.3%</td>
+<td>9.2%</td>
 </tr>
 <tr>
 <td>2.0 &amp; 1.1</th>
-<td>90.7%</td>
+<td>90.8%</td>
 </tr>
 </table>
-</div>
-
-<div class="col-7" style="margin-right:0">
-<img alt=""
-src="http://chart.googleapis.com/chart?cht=p&chs=400x250&chco=c4df9b,6fad0c&chl=GL%201.1%20only|GL%202.0%20%26%201.1&chd=t%3A9.3,90.7&chf=bg,s,00000000" />
-
-</div>
 
 
-<p style="clear:both"><em>Data collected during a 7-day period ending on August 1, 2012</em></p>
+
+<p style="clear:both"><em>Data collected during a 7-day period ending on September 4, 2012</em></p>
diff --git a/docs/html/about/versions/jelly-bean.jd b/docs/html/about/versions/jelly-bean.jd
index db56fa4..485a1bb 100644
--- a/docs/html/about/versions/jelly-bean.jd
+++ b/docs/html/about/versions/jelly-bean.jd
@@ -1,29 +1,6 @@
 page.title=Android 4.1 for Developers
 @jd:body
 
-
-<!--<style type="text/css">
-#jd-content {
-  max-width:1024px;
-}
-#jd-content div.screenshot {
-  float:left;
-  clear:left;
-  padding:15px 30px 15px 0;
-}
-
-</style>
-
-<p></p>
-
-
-<div style="float:right;width:230px;padding:0px 0px 60px 34px;margin-top:-40px">
-<div>
-<img src="{@docRoot}images/android-jellybean-sm.png" xheight="402" width="280">
-</div>
-<p class="image-caption">Find out more about the Jelly Bean features for users at <a href="http://www.android.com">android.com</a></p>
-</div>-->
-
 <div style="float:right;width:320px;padding:0px 0px 0px 34px;clear:both">
 <div>
 <img src="{@docRoot}images/jb-android-4.1.png" height="426" width="390">
@@ -35,23 +12,9 @@
 improvements throughout the platform and added great new features
 for users and developers. This document provides a glimpse of what's new for developers.
 
-<p>See the <a href="{@docRoot}about/versions/android-4.1.html">Android 4.1 APIs</a> document for a detailed look at the new developer APIs,</p>
+<p>See the <a href="{@docRoot}about/versions/android-4.1.html">Android 4.1 APIs</a> document for a detailed look at the new developer APIs.</p>
 
-<!--
-<ul>
-  <li><a href="#performance">Fast, Smooth, Responsive</a></li>
-  <li><a href="#accessibility">Enhanced Accessibility</a></li>
-  <li><a href="#intl">Support for International Users</a></li>
-  <li><a href="#ui">Capabilities for Creating Beautiful UI</a></li>
-  <li><a href="#input">New Input Types and Capabilities</a></li>
-  <li><a href="#graphics">Animation and Graphics</a></li>
-  <li><a href="#connectivity">New Types of Connectivity</a></li>
-  <li><a href="#media">Media Capabilities</a></li>
-  <li><a href="#google">Google APIs and services</a></li>
-  </ul>
--->
-
-<p>Find out more about the Jelly Bean features for users at <a href="http://www.android.com/whatsnew">www.android.com</a></p>
+<p>Find out more about the Jelly Bean features for users at <a href="http://www.android.com/whatsnew">www.android.com</a>.</p>
 
 
 <h2 id="performance">Faster, Smoother, More Responsive</h2>
diff --git a/docs/html/design/downloads/index.jd b/docs/html/design/downloads/index.jd
index be75800..5f78aea 100644
--- a/docs/html/design/downloads/index.jd
+++ b/docs/html/design/downloads/index.jd
@@ -12,7 +12,7 @@
   <div class="layout-content-col span-4">
 
 <p>
-  <a class="download-button" href="https://dl-ssl.google.com/android/design/Android_Design_Downloads_20120814.zip">Download All</a>
+  <a class="download-button" href="{@docRoot}downloads/design/Android_Design_Downloads_20120823.zip">Download All</a>
 </p>
 
   </div>
@@ -37,10 +37,10 @@
   <div class="layout-content-col span-4">
 
 <p>
-  <a class="download-button" href="https://dl-ssl.google.com/android/design/Android_Design_Fireworks_Stencil_20120814.png">Adobe&reg; Fireworks&reg; PNG Stencil</a>
-  <a class="download-button" href="https://dl-ssl.google.com/android/design/Android_Design_Illustrator_Vectors_20120814.ai">Adobe&reg; Illustrator&reg; Stencil</a>
-  <a class="download-button" href="https://dl-ssl.google.com/android/design/Android_Design_OmniGraffle_Stencil_20120814.graffle">Omni&reg; OmniGraffle&reg; Stencil</a>
-  <a class="download-button" href="https://dl-ssl.google.com/android/design/Android_Design_Holo_Widgets_20120814.zip">Adobe&reg; Photoshop&reg; Sources</a>
+  <a class="download-button" href="{@docRoot}downloads/design/Android_Design_Fireworks_Stencil_20120814.png">Adobe&reg; Fireworks&reg; PNG Stencil</a>
+  <a class="download-button" href="{@docRoot}downloads/design/Android_Design_Illustrator_Vectors_20120814.ai">Adobe&reg; Illustrator&reg; Stencil</a>
+  <a class="download-button" href="{@docRoot}downloads/design/Android_Design_OmniGraffle_Stencil_20120814.graffle">Omni&reg; OmniGraffle&reg; Stencil</a>
+  <a class="download-button" href="{@docRoot}downloads/design/Android_Design_Holo_Widgets_20120814.zip">Adobe&reg; Photoshop&reg; Sources</a>
 </p>
 
   </div>
@@ -66,7 +66,7 @@
   <div class="layout-content-col span-4">
 
 <p>
-  <a class="download-button" href="https://dl-ssl.google.com/android/design/Android_Design_Icons_20120814.zip">Action Bar Icon Pack</a>
+  <a class="download-button" href="{@docRoot}downloads/design/Android_Design_Icons_20120814.zip">Action Bar Icon Pack</a>
 </p>
 
   </div>
@@ -91,8 +91,8 @@
   <div class="layout-content-col span-4">
 
 <p>
-  <a class="download-button" href="https://dl-ssl.google.com/android/design/Roboto_Hinted_20111129.zip">Roboto</a>
-  <a class="download-button" href="https://dl-ssl.google.com/android/design/Roboto_Specimen_Book_20111129.pdf">Specimen Book</a>
+  <a class="download-button" href="{@docRoot}downloads/design/Roboto_Hinted_20120823.zip">Roboto</a>
+  <a class="download-button" href="{@docRoot}downloads/design/Roboto_Specimen_Book_20111129.pdf">Specimen Book</a>
 </p>
 
   </div>
@@ -115,7 +115,7 @@
   <div class="layout-content-col span-4">
 
 <p>
-  <a class="download-button" href="https://dl-ssl.google.com/android/design/Android_Design_Color_Swatches_20120229.zip">Color Swatches</a>
+  <a class="download-button" href="{@docRoot}downloads/design/Android_Design_Color_Swatches_20120229.zip">Color Swatches</a>
 </p>
 
   </div>
diff --git a/docs/html/design/patterns/actionbar.jd b/docs/html/design/patterns/actionbar.jd
index 9ceb499..ba5b400 100644
--- a/docs/html/design/patterns/actionbar.jd
+++ b/docs/html/design/patterns/actionbar.jd
@@ -293,7 +293,7 @@
 </p>
 <p>
 
-<a href="https://dl-ssl.google.com/android/design/Android_Design_Icons_20120229.zip">Download the Action Bar Icon Pack</a>
+<a href="{@docRoot}downloads/design/Android_Design_Icons_20120229.zip">Download the Action Bar Icon Pack</a>
 
 </p>
 
diff --git a/docs/html/design/style/color.jd b/docs/html/design/style/color.jd
index 9c7b6b6..5be34ac 100644
--- a/docs/html/design/style/color.jd
+++ b/docs/html/design/style/color.jd
@@ -115,7 +115,7 @@
 
 <p>Blue is the standard accent color in Android's color palette. Each color has a corresponding darker
 shade that can be used as a complement when needed.</p>
-<p><a href="https://dl-ssl.google.com/android/design/Android_Design_Color_Swatches_20120229.zip">Download the swatches</a></p>
+<p><a href="{@docRoot}downloads/design/Android_Design_Color_Swatches_20120229.zip">Download the swatches</a></p>
 
 <img src="{@docRoot}design/media/color_spectrum.png">
 
diff --git a/docs/html/design/style/iconography.jd b/docs/html/design/style/iconography.jd
index 775e45d..31274c5 100644
--- a/docs/html/design/style/iconography.jd
+++ b/docs/html/design/style/iconography.jd
@@ -110,7 +110,7 @@
 </p>
 <p>
 
-<a href="https://dl-ssl.google.com/android/design/Android_Design_Icons_20120229.zip">Download the Action Bar Icon Pack</a>
+<a href="{@docRoot}downloads/design/Android_Design_Icons_20120229.zip">Download the Action Bar Icon Pack</a>
 
 </p>
 
diff --git a/docs/html/design/style/typography.jd b/docs/html/design/style/typography.jd
index db2fb5f..a699bed 100644
--- a/docs/html/design/style/typography.jd
+++ b/docs/html/design/style/typography.jd
@@ -18,8 +18,8 @@
 
     <img src="{@docRoot}design/media/typography_alphas.png">
 
-<p><a href="https://dl-ssl.google.com/android/design/Roboto_Hinted_20111129.zip">Download Roboto</a></p>
-<p><a href="https://dl-ssl.google.com/android/design/Roboto_Specimen_Book_20111129.pdf">Specimen Book</a></p>
+<p><a href="{@docRoot}downloads/design/Roboto_Hinted_20111129.zip">Download Roboto</a></p>
+<p><a href="{@docRoot}downloads/design/Roboto_Specimen_Book_20111129.pdf">Specimen Book</a></p>
 
   </div>
 </div>
diff --git a/docs/html/develop/index.jd b/docs/html/develop/index.jd
index eaa70e2..14ab5d5 100644
--- a/docs/html/develop/index.jd
+++ b/docs/html/develop/index.jd
@@ -180,7 +180,6 @@
 </div>
 
 <br class="clearfix"/>
-    </div>
 
       
       
diff --git a/docs/html/guide/google/gcm/adv.jd b/docs/html/guide/google/gcm/adv.jd
index 5cb433f..2174128 100644
--- a/docs/html/guide/google/gcm/adv.jd
+++ b/docs/html/guide/google/gcm/adv.jd
@@ -175,7 +175,8 @@
   <li>The end user uninstalls the application.</li>
   <li>The 3rd-party server sends a message to GCM server.</li>
   <li>The GCM server sends the message to the device.</li>
-  <li>The GCM client receives the message and queries Package Manager, which returns a &quot;package not found&quot; error.</li>
+  <li>The GCM client receives the message and queries Package Manager about whether there are broadcast receivers configured to receive it, which returns <code>false</code>.
+</li>
   <li>The GCM client informs the GCM server that the application was uninstalled.</li>
   <li>The GCM server marks the registration ID for deletion.</li>
   <li>The 3rd-party server sends a message to  GCM.</li>
diff --git a/docs/html/guide/google/gcm/client-javadoc/allclasses-frame.html b/docs/html/guide/google/gcm/client-javadoc/allclasses-frame.html
index 26916d5..e1bed36 100644
--- a/docs/html/guide/google/gcm/client-javadoc/allclasses-frame.html
+++ b/docs/html/guide/google/gcm/client-javadoc/allclasses-frame.html
@@ -2,12 +2,12 @@
 <!--NewPage-->
 <HTML>
 <HEAD>
-<!-- Generated by javadoc (build 1.6.0_26) on Mon Jul 16 14:13:37 PDT 2012 -->
+<!-- Generated by javadoc (build 1.6.0_26) on Wed Aug 22 13:22:47 PDT 2012 -->
 <TITLE>
 All Classes
 </TITLE>
 
-<META NAME="date" CONTENT="2012-07-16">
+<META NAME="date" CONTENT="2012-08-22">
 
 <LINK REL ="stylesheet" TYPE="text/css" HREF="default.css" TITLE="Style">
 
diff --git a/docs/html/guide/google/gcm/client-javadoc/allclasses-noframe.html b/docs/html/guide/google/gcm/client-javadoc/allclasses-noframe.html
index 6ae9fe0..dc34021 100644
--- a/docs/html/guide/google/gcm/client-javadoc/allclasses-noframe.html
+++ b/docs/html/guide/google/gcm/client-javadoc/allclasses-noframe.html
@@ -2,12 +2,12 @@
 <!--NewPage-->
 <HTML>
 <HEAD>
-<!-- Generated by javadoc (build 1.6.0_26) on Mon Jul 16 14:13:37 PDT 2012 -->
+<!-- Generated by javadoc (build 1.6.0_26) on Wed Aug 22 13:22:47 PDT 2012 -->
 <TITLE>
 All Classes
 </TITLE>
 
-<META NAME="date" CONTENT="2012-07-16">
+<META NAME="date" CONTENT="2012-08-22">
 
 <LINK REL ="stylesheet" TYPE="text/css" HREF="default.css" TITLE="Style">
 
diff --git a/docs/html/guide/google/gcm/client-javadoc/com/google/android/gcm/GCMBaseIntentService.html b/docs/html/guide/google/gcm/client-javadoc/com/google/android/gcm/GCMBaseIntentService.html
index eed1aea..ff15218 100644
--- a/docs/html/guide/google/gcm/client-javadoc/com/google/android/gcm/GCMBaseIntentService.html
+++ b/docs/html/guide/google/gcm/client-javadoc/com/google/android/gcm/GCMBaseIntentService.html
@@ -2,12 +2,12 @@
 <!--NewPage-->
 <HTML>
 <HEAD>
-<!-- Generated by javadoc (build 1.6.0_26) on Mon Jul 16 14:13:36 PDT 2012 -->
+<!-- Generated by javadoc (build 1.6.0_26) on Wed Aug 22 13:22:47 PDT 2012 -->
 <TITLE>
 GCMBaseIntentService
 </TITLE>
 
-<META NAME="date" CONTENT="2012-07-16">
+<META NAME="date" CONTENT="2012-08-22">
 
 <LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../default.css" TITLE="Style">
 
diff --git a/docs/html/guide/google/gcm/client-javadoc/com/google/android/gcm/GCMBroadcastReceiver.html b/docs/html/guide/google/gcm/client-javadoc/com/google/android/gcm/GCMBroadcastReceiver.html
index 2a1c676..ae80bf7 100644
--- a/docs/html/guide/google/gcm/client-javadoc/com/google/android/gcm/GCMBroadcastReceiver.html
+++ b/docs/html/guide/google/gcm/client-javadoc/com/google/android/gcm/GCMBroadcastReceiver.html
@@ -2,12 +2,12 @@
 <!--NewPage-->
 <HTML>
 <HEAD>
-<!-- Generated by javadoc (build 1.6.0_26) on Mon Jul 16 14:13:36 PDT 2012 -->
+<!-- Generated by javadoc (build 1.6.0_26) on Wed Aug 22 13:22:47 PDT 2012 -->
 <TITLE>
 GCMBroadcastReceiver
 </TITLE>
 
-<META NAME="date" CONTENT="2012-07-16">
+<META NAME="date" CONTENT="2012-08-22">
 
 <LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../default.css" TITLE="Style">
 
diff --git a/docs/html/guide/google/gcm/client-javadoc/com/google/android/gcm/GCMConstants.html b/docs/html/guide/google/gcm/client-javadoc/com/google/android/gcm/GCMConstants.html
index f778f06..205bcf0 100644
--- a/docs/html/guide/google/gcm/client-javadoc/com/google/android/gcm/GCMConstants.html
+++ b/docs/html/guide/google/gcm/client-javadoc/com/google/android/gcm/GCMConstants.html
@@ -2,12 +2,12 @@
 <!--NewPage-->
 <HTML>
 <HEAD>
-<!-- Generated by javadoc (build 1.6.0_26) on Mon Jul 16 14:13:36 PDT 2012 -->
+<!-- Generated by javadoc (build 1.6.0_26) on Wed Aug 22 13:22:47 PDT 2012 -->
 <TITLE>
 GCMConstants
 </TITLE>
 
-<META NAME="date" CONTENT="2012-07-16">
+<META NAME="date" CONTENT="2012-08-22">
 
 <LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../default.css" TITLE="Style">
 
@@ -177,8 +177,8 @@
 <TD><CODE><B><A HREF="../../../../com/google/android/gcm/GCMConstants.html#EXTRA_APPLICATION_PENDING_INTENT">EXTRA_APPLICATION_PENDING_INTENT</A></B></CODE>
 
 <BR>
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Extra used on <A HREF="../../../../com/google/android/gcm/GCMConstants.html#INTENT_TO_GCM_REGISTRATION"><CODE>INTENT_TO_GCM_REGISTRATION</CODE></A> to get the application
- id.</TD>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Extra used on <A HREF="../../../../com/google/android/gcm/GCMConstants.html#INTENT_TO_GCM_REGISTRATION">"com.google.android.c2dm.intent.REGISTER"</A> to get the
+ application info.</TD>
 </TR>
 <TR BGCOLOR="white" CLASS="TableRowColor">
 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
@@ -186,16 +186,25 @@
 <TD><CODE><B><A HREF="../../../../com/google/android/gcm/GCMConstants.html#EXTRA_ERROR">EXTRA_ERROR</A></B></CODE>
 
 <BR>
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Extra used on <A HREF="../../../../com/google/android/gcm/GCMConstants.html#INTENT_FROM_GCM_REGISTRATION_CALLBACK"><CODE>INTENT_FROM_GCM_REGISTRATION_CALLBACK</CODE></A> to indicate
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Extra used on <A HREF="../../../../com/google/android/gcm/GCMConstants.html#INTENT_FROM_GCM_REGISTRATION_CALLBACK">"com.google.android.c2dm.intent.REGISTRATION"</A> to indicate
  an error when the registration fails.</TD>
 </TR>
 <TR BGCOLOR="white" CLASS="TableRowColor">
 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
 <CODE>static&nbsp;java.lang.String</CODE></FONT></TD>
+<TD><CODE><B><A HREF="../../../../com/google/android/gcm/GCMConstants.html#EXTRA_FROM">EXTRA_FROM</A></B></CODE>
+
+<BR>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Extra used on <A HREF="../../../../com/google/android/gcm/GCMConstants.html#INTENT_FROM_GCM_MESSAGE">"com.google.android.c2dm.intent.RECEIVE"</A> to indicate which
+ sender (Google API project id) sent the message.</TD>
+</TR>
+<TR BGCOLOR="white" CLASS="TableRowColor">
+<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
+<CODE>static&nbsp;java.lang.String</CODE></FONT></TD>
 <TD><CODE><B><A HREF="../../../../com/google/android/gcm/GCMConstants.html#EXTRA_REGISTRATION_ID">EXTRA_REGISTRATION_ID</A></B></CODE>
 
 <BR>
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Extra used on <A HREF="../../../../com/google/android/gcm/GCMConstants.html#INTENT_FROM_GCM_REGISTRATION_CALLBACK"><CODE>INTENT_FROM_GCM_REGISTRATION_CALLBACK</CODE></A> to indicate
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Extra used on <A HREF="../../../../com/google/android/gcm/GCMConstants.html#INTENT_FROM_GCM_REGISTRATION_CALLBACK">"com.google.android.c2dm.intent.REGISTRATION"</A> to indicate
  the registration id when the registration succeeds.</TD>
 </TR>
 <TR BGCOLOR="white" CLASS="TableRowColor">
@@ -204,8 +213,8 @@
 <TD><CODE><B><A HREF="../../../../com/google/android/gcm/GCMConstants.html#EXTRA_SENDER">EXTRA_SENDER</A></B></CODE>
 
 <BR>
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Extra used on <A HREF="../../../../com/google/android/gcm/GCMConstants.html#INTENT_TO_GCM_REGISTRATION"><CODE>INTENT_TO_GCM_REGISTRATION</CODE></A> to indicate the sender
- account (a Google email) that owns the application.</TD>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Extra used on <A HREF="../../../../com/google/android/gcm/GCMConstants.html#INTENT_TO_GCM_REGISTRATION">"com.google.android.c2dm.intent.REGISTER"</A> to indicate which
+ senders (Google API project ids) can send messages to the application.</TD>
 </TR>
 <TR BGCOLOR="white" CLASS="TableRowColor">
 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
@@ -213,7 +222,7 @@
 <TD><CODE><B><A HREF="../../../../com/google/android/gcm/GCMConstants.html#EXTRA_SPECIAL_MESSAGE">EXTRA_SPECIAL_MESSAGE</A></B></CODE>
 
 <BR>
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Type of message present in the <A HREF="../../../../com/google/android/gcm/GCMConstants.html#INTENT_FROM_GCM_MESSAGE"><CODE>INTENT_FROM_GCM_MESSAGE</CODE></A> intent.</TD>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Type of message present in the <A HREF="../../../../com/google/android/gcm/GCMConstants.html#INTENT_FROM_GCM_MESSAGE">"com.google.android.c2dm.intent.RECEIVE"</A> intent.</TD>
 </TR>
 <TR BGCOLOR="white" CLASS="TableRowColor">
 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
@@ -229,7 +238,7 @@
 <TD><CODE><B><A HREF="../../../../com/google/android/gcm/GCMConstants.html#EXTRA_UNREGISTERED">EXTRA_UNREGISTERED</A></B></CODE>
 
 <BR>
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Extra used on <A HREF="../../../../com/google/android/gcm/GCMConstants.html#INTENT_FROM_GCM_REGISTRATION_CALLBACK"><CODE>INTENT_FROM_GCM_REGISTRATION_CALLBACK</CODE></A> to indicate
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Extra used on <A HREF="../../../../com/google/android/gcm/GCMConstants.html#INTENT_FROM_GCM_REGISTRATION_CALLBACK">"com.google.android.c2dm.intent.REGISTRATION"</A> to indicate
  that the application has been unregistered.</TD>
 </TR>
 <TR BGCOLOR="white" CLASS="TableRowColor">
@@ -388,8 +397,8 @@
 <PRE>
 public static final java.lang.String <B>EXTRA_SENDER</B></PRE>
 <DL>
-<DD>Extra used on <A HREF="../../../../com/google/android/gcm/GCMConstants.html#INTENT_TO_GCM_REGISTRATION"><CODE>INTENT_TO_GCM_REGISTRATION</CODE></A> to indicate the sender
- account (a Google email) that owns the application.
+<DD>Extra used on <A HREF="../../../../com/google/android/gcm/GCMConstants.html#INTENT_TO_GCM_REGISTRATION">"com.google.android.c2dm.intent.REGISTER"</A> to indicate which
+ senders (Google API project ids) can send messages to the application.
 <P>
 <DL>
 <DT><B>See Also:</B><DD><A HREF="../../../../constant-values.html#com.google.android.gcm.GCMConstants.EXTRA_SENDER">Constant Field Values</A></DL>
@@ -401,8 +410,8 @@
 <PRE>
 public static final java.lang.String <B>EXTRA_APPLICATION_PENDING_INTENT</B></PRE>
 <DL>
-<DD>Extra used on <A HREF="../../../../com/google/android/gcm/GCMConstants.html#INTENT_TO_GCM_REGISTRATION"><CODE>INTENT_TO_GCM_REGISTRATION</CODE></A> to get the application
- id.
+<DD>Extra used on <A HREF="../../../../com/google/android/gcm/GCMConstants.html#INTENT_TO_GCM_REGISTRATION">"com.google.android.c2dm.intent.REGISTER"</A> to get the
+ application info.
 <P>
 <DL>
 <DT><B>See Also:</B><DD><A HREF="../../../../constant-values.html#com.google.android.gcm.GCMConstants.EXTRA_APPLICATION_PENDING_INTENT">Constant Field Values</A></DL>
@@ -414,7 +423,7 @@
 <PRE>
 public static final java.lang.String <B>EXTRA_UNREGISTERED</B></PRE>
 <DL>
-<DD>Extra used on <A HREF="../../../../com/google/android/gcm/GCMConstants.html#INTENT_FROM_GCM_REGISTRATION_CALLBACK"><CODE>INTENT_FROM_GCM_REGISTRATION_CALLBACK</CODE></A> to indicate
+<DD>Extra used on <A HREF="../../../../com/google/android/gcm/GCMConstants.html#INTENT_FROM_GCM_REGISTRATION_CALLBACK">"com.google.android.c2dm.intent.REGISTRATION"</A> to indicate
  that the application has been unregistered.
 <P>
 <DL>
@@ -427,7 +436,7 @@
 <PRE>
 public static final java.lang.String <B>EXTRA_ERROR</B></PRE>
 <DL>
-<DD>Extra used on <A HREF="../../../../com/google/android/gcm/GCMConstants.html#INTENT_FROM_GCM_REGISTRATION_CALLBACK"><CODE>INTENT_FROM_GCM_REGISTRATION_CALLBACK</CODE></A> to indicate
+<DD>Extra used on <A HREF="../../../../com/google/android/gcm/GCMConstants.html#INTENT_FROM_GCM_REGISTRATION_CALLBACK">"com.google.android.c2dm.intent.REGISTRATION"</A> to indicate
  an error when the registration fails. See constants starting with ERROR_
  for possible values.
 <P>
@@ -441,7 +450,7 @@
 <PRE>
 public static final java.lang.String <B>EXTRA_REGISTRATION_ID</B></PRE>
 <DL>
-<DD>Extra used on <A HREF="../../../../com/google/android/gcm/GCMConstants.html#INTENT_FROM_GCM_REGISTRATION_CALLBACK"><CODE>INTENT_FROM_GCM_REGISTRATION_CALLBACK</CODE></A> to indicate
+<DD>Extra used on <A HREF="../../../../com/google/android/gcm/GCMConstants.html#INTENT_FROM_GCM_REGISTRATION_CALLBACK">"com.google.android.c2dm.intent.REGISTRATION"</A> to indicate
  the registration id when the registration succeeds.
 <P>
 <DL>
@@ -454,7 +463,7 @@
 <PRE>
 public static final java.lang.String <B>EXTRA_SPECIAL_MESSAGE</B></PRE>
 <DL>
-<DD>Type of message present in the <A HREF="../../../../com/google/android/gcm/GCMConstants.html#INTENT_FROM_GCM_MESSAGE"><CODE>INTENT_FROM_GCM_MESSAGE</CODE></A> intent.
+<DD>Type of message present in the <A HREF="../../../../com/google/android/gcm/GCMConstants.html#INTENT_FROM_GCM_MESSAGE">"com.google.android.c2dm.intent.RECEIVE"</A> intent.
  This extra is only set for special messages sent from GCM, not for
  messages originated from the application.
 <P>
@@ -482,13 +491,26 @@
 <DL>
 <DD>Number of messages deleted by the server because the device was idle.
  Present only on messages of special type
- <A HREF="../../../../com/google/android/gcm/GCMConstants.html#VALUE_DELETED_MESSAGES"><CODE>VALUE_DELETED_MESSAGES</CODE></A>
+ <A HREF="../../../../com/google/android/gcm/GCMConstants.html#VALUE_DELETED_MESSAGES">"deleted_messages"</A>
 <P>
 <DL>
 <DT><B>See Also:</B><DD><A HREF="../../../../constant-values.html#com.google.android.gcm.GCMConstants.EXTRA_TOTAL_DELETED">Constant Field Values</A></DL>
 </DL>
 <HR>
 
+<A NAME="EXTRA_FROM"><!-- --></A><H3>
+EXTRA_FROM</H3>
+<PRE>
+public static final java.lang.String <B>EXTRA_FROM</B></PRE>
+<DL>
+<DD>Extra used on <A HREF="../../../../com/google/android/gcm/GCMConstants.html#INTENT_FROM_GCM_MESSAGE">"com.google.android.c2dm.intent.RECEIVE"</A> to indicate which
+ sender (Google API project id) sent the message.
+<P>
+<DL>
+<DT><B>See Also:</B><DD><A HREF="../../../../constant-values.html#com.google.android.gcm.GCMConstants.EXTRA_FROM">Constant Field Values</A></DL>
+</DL>
+<HR>
+
 <A NAME="PERMISSION_GCM_INTENTS"><!-- --></A><H3>
 PERMISSION_GCM_INTENTS</H3>
 <PRE>
diff --git a/docs/html/guide/google/gcm/client-javadoc/com/google/android/gcm/GCMRegistrar.html b/docs/html/guide/google/gcm/client-javadoc/com/google/android/gcm/GCMRegistrar.html
index bb486ff..c29bf90 100644
--- a/docs/html/guide/google/gcm/client-javadoc/com/google/android/gcm/GCMRegistrar.html
+++ b/docs/html/guide/google/gcm/client-javadoc/com/google/android/gcm/GCMRegistrar.html
@@ -2,12 +2,12 @@
 <!--NewPage-->
 <HTML>
 <HEAD>
-<!-- Generated by javadoc (build 1.6.0_26) on Mon Jul 16 14:13:36 PDT 2012 -->
+<!-- Generated by javadoc (build 1.6.0_26) on Wed Aug 22 13:22:47 PDT 2012 -->
 <TITLE>
 GCMRegistrar
 </TITLE>
 
-<META NAME="date" CONTENT="2012-07-16">
+<META NAME="date" CONTENT="2012-08-22">
 
 <LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../default.css" TITLE="Style">
 
@@ -308,11 +308,12 @@
     <li>It defines at least one <CODE>BroadcastReceiver</CODE> with category
       <code>PACKAGE_NAME</code>.
     <li>The <CODE>BroadcastReceiver</CODE>(s) uses the
-       permission.
-    <li>The <CODE>BroadcastReceiver</CODE>(s) handles the 3 GCM intents
-      (,
-      ,
-      and ).
+      <A HREF="../../../../com/google/android/gcm/GCMConstants.html#PERMISSION_GCM_INTENTS">"com.google.android.c2dm.permission.SEND"</A>
+      permission.
+    <li>The <CODE>BroadcastReceiver</CODE>(s) handles the 2 GCM intents
+      (<A HREF="../../../../com/google/android/gcm/GCMConstants.html#INTENT_FROM_GCM_MESSAGE">"com.google.android.c2dm.intent.RECEIVE"</A>
+      and
+      <A HREF="../../../../com/google/android/gcm/GCMConstants.html#INTENT_FROM_GCM_REGISTRATION_CALLBACK">"com.google.android.c2dm.intent.REGISTRATION"</A>).
  </ol>
  ...where <code>PACKAGE_NAME</code> is the application package.
  <p>
diff --git a/docs/html/guide/google/gcm/client-javadoc/com/google/android/gcm/package-frame.html b/docs/html/guide/google/gcm/client-javadoc/com/google/android/gcm/package-frame.html
index 4828eea..a2a599d 100644
--- a/docs/html/guide/google/gcm/client-javadoc/com/google/android/gcm/package-frame.html
+++ b/docs/html/guide/google/gcm/client-javadoc/com/google/android/gcm/package-frame.html
@@ -2,12 +2,12 @@
 <!--NewPage-->
 <HTML>
 <HEAD>
-<!-- Generated by javadoc (build 1.6.0_26) on Mon Jul 16 14:13:37 PDT 2012 -->
+<!-- Generated by javadoc (build 1.6.0_26) on Wed Aug 22 13:22:47 PDT 2012 -->
 <TITLE>
 com.google.android.gcm
 </TITLE>
 
-<META NAME="date" CONTENT="2012-07-16">
+<META NAME="date" CONTENT="2012-08-22">
 
 <LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../default.css" TITLE="Style">
 
diff --git a/docs/html/guide/google/gcm/client-javadoc/com/google/android/gcm/package-summary.html b/docs/html/guide/google/gcm/client-javadoc/com/google/android/gcm/package-summary.html
index 877248b..c8e0341 100644
--- a/docs/html/guide/google/gcm/client-javadoc/com/google/android/gcm/package-summary.html
+++ b/docs/html/guide/google/gcm/client-javadoc/com/google/android/gcm/package-summary.html
@@ -2,12 +2,12 @@
 <!--NewPage-->
 <HTML>
 <HEAD>
-<!-- Generated by javadoc (build 1.6.0_26) on Mon Jul 16 14:13:37 PDT 2012 -->
+<!-- Generated by javadoc (build 1.6.0_26) on Wed Aug 22 13:22:47 PDT 2012 -->
 <TITLE>
 com.google.android.gcm
 </TITLE>
 
-<META NAME="date" CONTENT="2012-07-16">
+<META NAME="date" CONTENT="2012-08-22">
 
 <LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../default.css" TITLE="Style">
 
diff --git a/docs/html/guide/google/gcm/client-javadoc/com/google/android/gcm/package-tree.html b/docs/html/guide/google/gcm/client-javadoc/com/google/android/gcm/package-tree.html
index bf6fce3..0e27efe 100644
--- a/docs/html/guide/google/gcm/client-javadoc/com/google/android/gcm/package-tree.html
+++ b/docs/html/guide/google/gcm/client-javadoc/com/google/android/gcm/package-tree.html
@@ -2,12 +2,12 @@
 <!--NewPage-->
 <HTML>
 <HEAD>
-<!-- Generated by javadoc (build 1.6.0_26) on Mon Jul 16 14:13:37 PDT 2012 -->
+<!-- Generated by javadoc (build 1.6.0_26) on Wed Aug 22 13:22:47 PDT 2012 -->
 <TITLE>
 com.google.android.gcm Class Hierarchy
 </TITLE>
 
-<META NAME="date" CONTENT="2012-07-16">
+<META NAME="date" CONTENT="2012-08-22">
 
 <LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../default.css" TITLE="Style">
 
diff --git a/docs/html/guide/google/gcm/client-javadoc/constant-values.html b/docs/html/guide/google/gcm/client-javadoc/constant-values.html
index 6ccd123..796d196 100644
--- a/docs/html/guide/google/gcm/client-javadoc/constant-values.html
+++ b/docs/html/guide/google/gcm/client-javadoc/constant-values.html
@@ -2,12 +2,12 @@
 <!--NewPage-->
 <HTML>
 <HEAD>
-<!-- Generated by javadoc (build 1.6.0_26) on Mon Jul 16 14:13:37 PDT 2012 -->
+<!-- Generated by javadoc (build 1.6.0_26) on Wed Aug 22 13:22:47 PDT 2012 -->
 <TITLE>
 Constant Field Values
 </TITLE>
 
-<META NAME="date" CONTENT="2012-07-16">
+<META NAME="date" CONTENT="2012-08-22">
 
 <LINK REL ="stylesheet" TYPE="text/css" HREF="default.css" TITLE="Style">
 
@@ -173,6 +173,12 @@
 <TD ALIGN="right"><CODE>"error"</CODE></TD>
 </TR>
 <TR BGCOLOR="white" CLASS="TableRowColor">
+<A NAME="com.google.android.gcm.GCMConstants.EXTRA_FROM"><!-- --></A><TD ALIGN="right"><FONT SIZE="-1">
+<CODE>public&nbsp;static&nbsp;final&nbsp;java.lang.String</CODE></FONT></TD>
+<TD ALIGN="left"><CODE><A HREF="com/google/android/gcm/GCMConstants.html#EXTRA_FROM">EXTRA_FROM</A></CODE></TD>
+<TD ALIGN="right"><CODE>"from"</CODE></TD>
+</TR>
+<TR BGCOLOR="white" CLASS="TableRowColor">
 <A NAME="com.google.android.gcm.GCMConstants.EXTRA_REGISTRATION_ID"><!-- --></A><TD ALIGN="right"><FONT SIZE="-1">
 <CODE>public&nbsp;static&nbsp;final&nbsp;java.lang.String</CODE></FONT></TD>
 <TD ALIGN="left"><CODE><A HREF="com/google/android/gcm/GCMConstants.html#EXTRA_REGISTRATION_ID">EXTRA_REGISTRATION_ID</A></CODE></TD>
diff --git a/docs/html/guide/google/gcm/client-javadoc/default.css b/docs/html/guide/google/gcm/client-javadoc/default.css
index 2513e69..f11daf7 100644
--- a/docs/html/guide/google/gcm/client-javadoc/default.css
+++ b/docs/html/guide/google/gcm/client-javadoc/default.css
@@ -530,12 +530,12 @@
 }
 .design ol {
   counter-reset: item; }
-  .design ol li {
+  .design ol>li {
     font-size: 14px;
     line-height: 20px;
     list-style-type: none;
     position: relative; }
-    .design ol li:before {
+    .design ol>li:before {
       content: counter(item) ". ";
       counter-increment: item;
       position: absolute;
@@ -561,16 +561,18 @@
       content: "9. "; }
     .design ol li.value-10:before {
       content: "10. "; }
-.design .with-callouts ol li {
+.design .with-callouts ol>li {
   list-style-position: inside;
   margin-left: 0; }
-  .design .with-callouts ol li:before {
+  .design .with-callouts ol>li:before {
     display: inline;
     left: -20px;
     float: left;
     width: 17px;
     color: #33b5e5;
     font-weight: 500; }
+.design .with-callouts ul>li {
+  list-style-position: outside; }
 
 /* special list items */
 li.no-bullet {
@@ -1079,22 +1081,71 @@
    Print Only
    ========================================================================== */
 @media print {
-a {
-    color: inherit;
-}
-.nav-x, .nav-y {
-    display: none;
-}
-.str { color: #060; }
-.kwd { color: #006; font-weight: bold; }
-.com { color: #600; font-style: italic; }
-.typ { color: #404; font-weight: bold; }
-.lit { color: #044; }
-.pun { color: #440; }
-.pln { color: #000; }
-.tag { color: #006; font-weight: bold; }
-.atn { color: #404; }
-.atv { color: #060; }
+  /* configure printed page */
+  @page {
+      margin: 0.75in 1in;
+      widows: 4;
+      orphans: 4;
+  }
+
+  /* reset spacing metrics */
+  html, body, .wrap {
+      margin: 0 !important;
+      padding: 0 !important;
+      width: auto !important;
+  }
+
+  /* leave enough space on the left for bullets */
+  body {
+      padding-left: 20px !important;
+  }
+  #doc-col {
+      margin-left: 0;
+  }
+
+  /* hide a bunch of non-content elements */
+  #header, #footer, #nav-x, #side-nav,
+  .training-nav-top, .training-nav-bottom,
+  #doc-col .content-footer,
+  .nav-x, .nav-y,
+  .paging-links,
+  a.totop {
+      display: none !important;
+  }
+
+  /* remove extra space above page titles */
+  #doc-col .content-header {
+      margin-top: 0;
+  }
+
+  /* bump up spacing above subheadings */
+  h2 {
+      margin-top: 40px !important;
+  }
+
+  /* print link URLs where possible and give links default text color */
+  p a:after {
+      content: " (" attr(href) ")";
+      font-size: 80%;
+  }
+  p a {
+      word-wrap: break-word;
+  }
+  a {
+      color: inherit;
+  }
+
+  /* syntax highlighting rules */
+  .str { color: #060; }
+  .kwd { color: #006; font-weight: bold; }
+  .com { color: #600; font-style: italic; }
+  .typ { color: #404; font-weight: bold; }
+  .lit { color: #044; }
+  .pun { color: #440; }
+  .pln { color: #000; }
+  .tag { color: #006; font-weight: bold; }
+  .atn { color: #404; }
+  .atv { color: #060; }
 }
 
 /* =============================================================================
@@ -2033,8 +2084,11 @@
 #jd-content img.toggle-content-img {
   margin:0 5px 5px 0;
 }
-div.toggle-content > p {
-  padding:0 0 5px;
+div.toggle-content p {
+  margin:10px 0 0;
+}
+div.toggle-content-toggleme {
+  padding:0 0 0 15px;
 }
 
 
@@ -2145,14 +2199,9 @@
 
 .nolist {
   list-style:none;
-  padding:0;
-  margin:0 0 1em 1em;
+  margin-left:0;
 }
 
-.nolist li {
-  padding:0 0 2px;
-  margin:0;
-}
 
 pre.classic {
   background-color:transparent;
@@ -2180,6 +2229,12 @@
   color:#666;
 }
 
+div.note, 
+div.caution, 
+div.warning {
+  margin: 0 0 15px;
+}
+
 p.note, div.note, 
 p.caution, div.caution, 
 p.warning, div.warning {
@@ -2898,10 +2953,6 @@
 
 /* SEARCH RESULTS */
 
-/* disable twiddle and size selectors for left column */
-#leftSearchControl div {
-  padding:0;
-}
 
 #leftSearchControl .gsc-twiddle {
   background-image : none;
@@ -3475,7 +3526,7 @@
 
 .morehover:hover {
   opacity:1;
-  height:345px;
+  height:385px;
   width:268px;
   -webkit-transition-property:height,  -webkit-opacity;
 }
@@ -3489,7 +3540,7 @@
 .morehover .mid {
   width:228px;
   background:url(../images/more_mid.png) repeat-y;
-  padding:10px 20px 10px 20px;
+  padding:10px 20px 0 20px;
 }
 
 .morehover .mid .header {
@@ -3598,15 +3649,19 @@
   padding-top: 14px;
 }
 
+#nav-x .wrap {
+  min-height:34px;
+}
+
 #nav-x .wrap,
 #searchResults.wrap {
     max-width:940px;
     border-bottom:1px solid #CCC;
-    min-height:34px;
-    
 }
 
-
+#searchResults.wrap #leftSearchControl {
+  min-height:700px
+}
 .nav-x {
     margin-left:0;
     margin-bottom:0;
@@ -3762,7 +3817,8 @@
   height: 300px;
 }
 .slideshow-develop img.play {
-  width:350px;
+  max-width:350px;
+  max-height:240px;
   margin:20px 0 0 90px;
   -webkit-transform: perspective(800px ) rotateY( 35deg );
   box-shadow: -16px 20px 40px rgba(0, 0, 0, 0.3);
@@ -3817,6 +3873,7 @@
 .feed .feed-nav li {
   list-style: none;
   float: left;
+  height: 21px; /* +4px bottom border = 25px; same as .feed-nav */
   margin-right: 25px;
   cursor: pointer;
 }
@@ -3969,21 +4026,24 @@
 .landing-docs {
   margin:20px 0 0;
 }
-.landing-banner {
-  height:280px;
-}
 .landing-banner .col-6:first-child,
-.landing-docs .col-6:first-child {
+.landing-docs .col-6:first-child,
+.landing-docs .col-12 {
   margin-left:0;
+  min-height:280px;
 }
 .landing-banner .col-6:last-child,
-.landing-docs .col-6:last-child {
+.landing-docs .col-6:last-child,
+.landing-docs .col-12 {
   margin-right:0;
 }
 
 .landing-banner h1 {
   margin-top:0;
 }
+.landing-docs {
+  clear:left;
+}
 .landing-docs h3 {
   font-size:14px;
   line-height:21px;
@@ -4002,4 +4062,99 @@
 
 .plusone {
   float:right;
-}
\ No newline at end of file
+}
+
+
+
+/************* HOME/LANDING PAGE *****************/
+
+.slideshow-home {
+  height: 500px;
+  width: 940px;
+  border-bottom: 1px solid #CCC;
+  position: relative;
+  margin: 0;
+}
+.slideshow-home .frame {
+  width: 940px;
+  height: 500px;
+}
+.slideshow-home .content-left {
+  float: left;
+  text-align: center;
+  vertical-align: center;
+  margin: 0 0 0 35px;
+}
+.slideshow-home .content-right {
+  margin: 80px 0 0 0;
+}
+.slideshow-home .content-right p {
+  margin-bottom: 10px;
+}
+.slideshow-home .content-right p:last-child {
+  margin-top: 15px;
+}
+.slideshow-home .content-right h1 {
+  padding:0;
+}
+.slideshow-home .item {
+  height: 500px;
+  width: 940px;
+}
+.home-sections {
+  padding: 30px 20px 20px;
+  margin: 20px 0;
+  background: -webkit-linear-gradient(top, #F6F6F6,#F9F9F9);
+}
+.home-sections ul {
+  margin: 0;
+}
+.home-sections ul li {
+  float: left;
+  display: block;
+  list-style: none;
+  width: 170px;
+  height: 35px;
+  border: 1px solid #ccc;
+  background: white;
+  margin-right: 10px;
+  border-radius: 1px;
+  -webkit-border-radius: 1px;
+  -moz-border-radius: 1px;
+  box-shadow: 1px 1px 5px #EEE;
+  -webkit-box-shadow: 1px 1px 5px #EEE;
+  -moz-box-shadow: 1px 1px 5px #EEE;
+  background: white;
+}
+.home-sections ul li:hover {
+  background: #F9F9F9;
+  border: 1px solid #CCC;
+}
+.home-sections ul li a,
+.home-sections ul li a:hover {
+  font-weight: bold;
+  margin-top: 8px;
+  line-height: 18px;
+  float: left;
+  width: 100%;
+  text-align: center;
+  color: #09c !important;
+}
+.home-sections ul li a {
+  font-weight: bold;
+  margin-top: 8px;
+  line-height: 18px;
+  float: left;
+  width:100%;
+  text-align:center;
+}
+.home-sections ul li img {
+  float: left;
+  margin: -8px 0 0 10px;
+}
+.home-sections ul li.last {
+  margin-right: 0px;
+}
+#footer {
+  margin-top: -40px;
+}
diff --git a/docs/html/guide/google/gcm/client-javadoc/deprecated-list.html b/docs/html/guide/google/gcm/client-javadoc/deprecated-list.html
index 6b86bfe..d9a63c5 100644
--- a/docs/html/guide/google/gcm/client-javadoc/deprecated-list.html
+++ b/docs/html/guide/google/gcm/client-javadoc/deprecated-list.html
@@ -2,12 +2,12 @@
 <!--NewPage-->
 <HTML>
 <HEAD>
-<!-- Generated by javadoc (build 1.6.0_26) on Mon Jul 16 14:13:37 PDT 2012 -->
+<!-- Generated by javadoc (build 1.6.0_26) on Wed Aug 22 13:22:47 PDT 2012 -->
 <TITLE>
 Deprecated List
 </TITLE>
 
-<META NAME="date" CONTENT="2012-07-16">
+<META NAME="date" CONTENT="2012-08-22">
 
 <LINK REL ="stylesheet" TYPE="text/css" HREF="default.css" TITLE="Style">
 
diff --git a/docs/html/guide/google/gcm/client-javadoc/help-doc.html b/docs/html/guide/google/gcm/client-javadoc/help-doc.html
index ffd1f77..af1bca8 100644
--- a/docs/html/guide/google/gcm/client-javadoc/help-doc.html
+++ b/docs/html/guide/google/gcm/client-javadoc/help-doc.html
@@ -2,12 +2,12 @@
 <!--NewPage-->
 <HTML>
 <HEAD>
-<!-- Generated by javadoc (build 1.6.0_26) on Mon Jul 16 14:13:37 PDT 2012 -->
+<!-- Generated by javadoc (build 1.6.0_26) on Wed Aug 22 13:22:47 PDT 2012 -->
 <TITLE>
 API Help
 </TITLE>
 
-<META NAME="date" CONTENT="2012-07-16">
+<META NAME="date" CONTENT="2012-08-22">
 
 <LINK REL ="stylesheet" TYPE="text/css" HREF="default.css" TITLE="Style">
 
diff --git a/docs/html/guide/google/gcm/client-javadoc/index-all.html b/docs/html/guide/google/gcm/client-javadoc/index-all.html
index 74e6095..408edee 100644
--- a/docs/html/guide/google/gcm/client-javadoc/index-all.html
+++ b/docs/html/guide/google/gcm/client-javadoc/index-all.html
@@ -2,12 +2,12 @@
 <!--NewPage-->
 <HTML>
 <HEAD>
-<!-- Generated by javadoc (build 1.6.0_26) on Mon Jul 16 14:13:37 PDT 2012 -->
+<!-- Generated by javadoc (build 1.6.0_26) on Wed Aug 22 13:22:47 PDT 2012 -->
 <TITLE>
 Index
 </TITLE>
 
-<META NAME="date" CONTENT="2012-07-16">
+<META NAME="date" CONTENT="2012-08-22">
 
 <LINK REL ="stylesheet" TYPE="text/css" HREF="./default.css" TITLE="Style">
 
@@ -124,29 +124,33 @@
  server that can be retried later.
 <DT><A HREF="./com/google/android/gcm/GCMConstants.html#EXTRA_APPLICATION_PENDING_INTENT"><B>EXTRA_APPLICATION_PENDING_INTENT</B></A> - 
 Static variable in class com.google.android.gcm.<A HREF="./com/google/android/gcm/GCMConstants.html" title="class in com.google.android.gcm">GCMConstants</A>
-<DD>Extra used on <A HREF="./com/google/android/gcm/GCMConstants.html#INTENT_TO_GCM_REGISTRATION"><CODE>GCMConstants.INTENT_TO_GCM_REGISTRATION</CODE></A> to get the application
- id.
+<DD>Extra used on <A HREF="./com/google/android/gcm/GCMConstants.html#INTENT_TO_GCM_REGISTRATION">"com.google.android.c2dm.intent.REGISTER"</A> to get the
+ application info.
 <DT><A HREF="./com/google/android/gcm/GCMConstants.html#EXTRA_ERROR"><B>EXTRA_ERROR</B></A> - 
 Static variable in class com.google.android.gcm.<A HREF="./com/google/android/gcm/GCMConstants.html" title="class in com.google.android.gcm">GCMConstants</A>
-<DD>Extra used on <A HREF="./com/google/android/gcm/GCMConstants.html#INTENT_FROM_GCM_REGISTRATION_CALLBACK"><CODE>GCMConstants.INTENT_FROM_GCM_REGISTRATION_CALLBACK</CODE></A> to indicate
+<DD>Extra used on <A HREF="./com/google/android/gcm/GCMConstants.html#INTENT_FROM_GCM_REGISTRATION_CALLBACK">"com.google.android.c2dm.intent.REGISTRATION"</A> to indicate
  an error when the registration fails.
+<DT><A HREF="./com/google/android/gcm/GCMConstants.html#EXTRA_FROM"><B>EXTRA_FROM</B></A> - 
+Static variable in class com.google.android.gcm.<A HREF="./com/google/android/gcm/GCMConstants.html" title="class in com.google.android.gcm">GCMConstants</A>
+<DD>Extra used on <A HREF="./com/google/android/gcm/GCMConstants.html#INTENT_FROM_GCM_MESSAGE">"com.google.android.c2dm.intent.RECEIVE"</A> to indicate which
+ sender (Google API project id) sent the message.
 <DT><A HREF="./com/google/android/gcm/GCMConstants.html#EXTRA_REGISTRATION_ID"><B>EXTRA_REGISTRATION_ID</B></A> - 
 Static variable in class com.google.android.gcm.<A HREF="./com/google/android/gcm/GCMConstants.html" title="class in com.google.android.gcm">GCMConstants</A>
-<DD>Extra used on <A HREF="./com/google/android/gcm/GCMConstants.html#INTENT_FROM_GCM_REGISTRATION_CALLBACK"><CODE>GCMConstants.INTENT_FROM_GCM_REGISTRATION_CALLBACK</CODE></A> to indicate
+<DD>Extra used on <A HREF="./com/google/android/gcm/GCMConstants.html#INTENT_FROM_GCM_REGISTRATION_CALLBACK">"com.google.android.c2dm.intent.REGISTRATION"</A> to indicate
  the registration id when the registration succeeds.
 <DT><A HREF="./com/google/android/gcm/GCMConstants.html#EXTRA_SENDER"><B>EXTRA_SENDER</B></A> - 
 Static variable in class com.google.android.gcm.<A HREF="./com/google/android/gcm/GCMConstants.html" title="class in com.google.android.gcm">GCMConstants</A>
-<DD>Extra used on <A HREF="./com/google/android/gcm/GCMConstants.html#INTENT_TO_GCM_REGISTRATION"><CODE>GCMConstants.INTENT_TO_GCM_REGISTRATION</CODE></A> to indicate the sender
- account (a Google email) that owns the application.
+<DD>Extra used on <A HREF="./com/google/android/gcm/GCMConstants.html#INTENT_TO_GCM_REGISTRATION">"com.google.android.c2dm.intent.REGISTER"</A> to indicate which
+ senders (Google API project ids) can send messages to the application.
 <DT><A HREF="./com/google/android/gcm/GCMConstants.html#EXTRA_SPECIAL_MESSAGE"><B>EXTRA_SPECIAL_MESSAGE</B></A> - 
 Static variable in class com.google.android.gcm.<A HREF="./com/google/android/gcm/GCMConstants.html" title="class in com.google.android.gcm">GCMConstants</A>
-<DD>Type of message present in the <A HREF="./com/google/android/gcm/GCMConstants.html#INTENT_FROM_GCM_MESSAGE"><CODE>GCMConstants.INTENT_FROM_GCM_MESSAGE</CODE></A> intent.
+<DD>Type of message present in the <A HREF="./com/google/android/gcm/GCMConstants.html#INTENT_FROM_GCM_MESSAGE">"com.google.android.c2dm.intent.RECEIVE"</A> intent.
 <DT><A HREF="./com/google/android/gcm/GCMConstants.html#EXTRA_TOTAL_DELETED"><B>EXTRA_TOTAL_DELETED</B></A> - 
 Static variable in class com.google.android.gcm.<A HREF="./com/google/android/gcm/GCMConstants.html" title="class in com.google.android.gcm">GCMConstants</A>
 <DD>Number of messages deleted by the server because the device was idle.
 <DT><A HREF="./com/google/android/gcm/GCMConstants.html#EXTRA_UNREGISTERED"><B>EXTRA_UNREGISTERED</B></A> - 
 Static variable in class com.google.android.gcm.<A HREF="./com/google/android/gcm/GCMConstants.html" title="class in com.google.android.gcm">GCMConstants</A>
-<DD>Extra used on <A HREF="./com/google/android/gcm/GCMConstants.html#INTENT_FROM_GCM_REGISTRATION_CALLBACK"><CODE>GCMConstants.INTENT_FROM_GCM_REGISTRATION_CALLBACK</CODE></A> to indicate
+<DD>Extra used on <A HREF="./com/google/android/gcm/GCMConstants.html#INTENT_FROM_GCM_REGISTRATION_CALLBACK">"com.google.android.c2dm.intent.REGISTRATION"</A> to indicate
  that the application has been unregistered.
 </DL>
 <HR>
diff --git a/docs/html/guide/google/gcm/client-javadoc/index.html b/docs/html/guide/google/gcm/client-javadoc/index.html
index 26e57f6..fa7af90 100644
--- a/docs/html/guide/google/gcm/client-javadoc/index.html
+++ b/docs/html/guide/google/gcm/client-javadoc/index.html
@@ -2,7 +2,7 @@
 <!--NewPage-->
 <HTML>
 <HEAD>
-<!-- Generated by javadoc on Mon Jul 16 14:13:37 PDT 2012-->
+<!-- Generated by javadoc on Wed Aug 22 13:22:47 PDT 2012-->
 <TITLE>
 Generated Documentation (Untitled)
 </TITLE>
diff --git a/docs/html/guide/google/gcm/client-javadoc/overview-tree.html b/docs/html/guide/google/gcm/client-javadoc/overview-tree.html
index c9076f1..392f3e0 100644
--- a/docs/html/guide/google/gcm/client-javadoc/overview-tree.html
+++ b/docs/html/guide/google/gcm/client-javadoc/overview-tree.html
@@ -2,12 +2,12 @@
 <!--NewPage-->
 <HTML>
 <HEAD>
-<!-- Generated by javadoc (build 1.6.0_26) on Mon Jul 16 14:13:37 PDT 2012 -->
+<!-- Generated by javadoc (build 1.6.0_26) on Wed Aug 22 13:22:47 PDT 2012 -->
 <TITLE>
 Class Hierarchy
 </TITLE>
 
-<META NAME="date" CONTENT="2012-07-16">
+<META NAME="date" CONTENT="2012-08-22">
 
 <LINK REL ="stylesheet" TYPE="text/css" HREF="default.css" TITLE="Style">
 
diff --git a/docs/html/guide/google/gcm/gcm.jd b/docs/html/guide/google/gcm/gcm.jd
index f471560..5515f31 100644
--- a/docs/html/guide/google/gcm/gcm.jd
+++ b/docs/html/guide/google/gcm/gcm.jd
@@ -203,7 +203,7 @@
 <p>The registration ID lasts until the Android application explicitly unregisters
 itself, or until Google refreshes the registration ID for your Android application.</p>
 
-<p class="note"><strong>Note:</strong> When users uninstall an application, it is not automatically unregistered on GCM. It is only  unregistered when the GCM server tries to send a message to the device and the device answers that the application is uninstalled. At that point, you server should mark the device as unregistered (the server will receive a <code><a href="#unreg_device">NotRegistered</a></code> error).
+<p class="note"><strong>Note:</strong> When users uninstall an application, it is not automatically unregistered on GCM. It is only  unregistered when the GCM server tries to send a message to the device and the device answers that the application is uninstalled or it does not have a broadcast receiver configured to receive <code>com.google.android.c2dm.intent.RECEIVE</code> intents. At that point, you server should mark the device as unregistered (the server will receive a <code><a href="#unreg_device">NotRegistered</a></code> error).
   <p>
 Note that it might take a few minutes for the registration ID to be completed removed from the GCM server. So if the 3rd party server sends a message during this time, it will get a valid message ID, even though the message will not be delivered to the device.</p>
 </p>
@@ -546,7 +546,7 @@
 deliver the messages sent by the 3rd-party server to the application running in the device.
 If the server included key-pair values in the <code>data</code> parameter, they are available as 
 extras in this intent, with the keys being the extra names. GCM also includes an  extra called 
-<code>from</code> which contains the sender ID as an string.
+<code>from</code> which contains the sender ID as an string, and another called <code>collapse_key</code> containing the collapse key (when in use).
 
 <p>Here is an example, again using the <code>MyIntentReceiver</code> class:</p>
 
@@ -653,7 +653,7 @@
     <td><code>data</code></td>
     <td>A JSON object whose fields represents the key-value pairs of the message's payload data. If present, the payload data it will be
 included in the Intent as application data, with the key being the extra's name. For instance, <code>"data":{"score":"3x1"}</code> would result in an intent extra named <code>score</code> whose value is the string <code>3x1</code>. 
-There is no limit on the number of key/value pairs, though there is a limit on the total size of the message (4kb). Note that the values <em>must be enclosed by strings</em>. If you want to include objects or other non-string data types (such as integers or booleans), you have to do the conversion to string yourself. Also note that the key cannot be a reserved word (<code>from</code> or any word starting with <code>google.</code>). Optional.</td>
+There is no limit on the number of key/value pairs, though there is a limit on the total size of the message (4kb). The values could be any JSON object, but we recommend using strings, since the values will be converted to strings in the GCM server anyway. If you want to include objects or other non-string data types (such as integers or booleans), you have to do the conversion to string yourself. Also note that the key cannot be a reserved word (<code>from</code> or any word starting with <code>google.</code>). To complicate things slightly, there are some reserved words (such as <code>collapse_key</code>) that are technically allowed in payload data. However, if the request also contains the word, the value in the request will overwrite the value in the payload data. Hence using words that are defined as field names in this table is not recommended, even in cases where they are technically allowed. Optional.</td>
 
   </tr>
   <tr>
@@ -685,7 +685,8 @@
   </tr>
   <tr>
     <td><code>data.&lt;key&gt;</code></td>
-    <td>Payload data, expressed as parameters prefixed with <code>data.</code> and suffixed as the key. For instance, a parameter of <code>data.score=3x1</code> would result in an intent extra named <code>score</code> whose value is the string <code>3x1</code>. There is no limit on the number of key/value parameters, though there is a limit on the total size of the  message. Note that the key cannot be a reserved word (<code>from</code> or any word starting with <code>google.</code>). Optional.</td>
+    <td>Payload data, expressed as parameters prefixed with <code>data.</code> and suffixed as the key. For instance, a parameter of <code>data.score=3x1</code> would result in an intent extra named <code>score</code> whose value is the string <code>3x1</code>. There is no limit on the number of key/value parameters, though there is a limit on the total size of the  message. Also note that the key cannot be a reserved word (<code>from</code> or any word starting with 
+<code>google.</code>). To complicate things slightly, there are some reserved words (such as <code>collapse_key</code>) that are technically allowed in payload data. However, if the request also contains the word, the value in the request will overwrite the value in the payload data. Hence using words that are defined as field names in this table is not recommended, even in cases where they are technically allowed. Optional.</td>
   </tr>
   <tr>
     <td><code>delay_while_idle</code></td>
@@ -816,7 +817,7 @@
   <li>Otherwise, get the value of <code>error</code>:
     <ul>
       <li>If it is <code>Unavailable</code>, you could retry to send it in another request.</li>
-      <li>If it is <code>NotRegistered</code>, you should remove the registration ID from your server database because the application was uninstalled from the device.</li>
+      <li>If it is <code>NotRegistered</code>, you should remove the registration ID from your server database because the application was uninstalled from the device or it does not have a broadcast receiver configured to receive <code>com.google.android.c2dm.intent.RECEIVE</code> intents.</li>
       <li>Otherwise, there is something wrong in the registration ID passed in the request; it is probably a non-recoverable error that will also require removing the registration from the server database. See <a href="#error_codes">Interpreting an error response</a> for all possible error values.</li>
     </ul>
   </li>
@@ -850,6 +851,7 @@
 <dt id="invalid_reg"><strong>Invalid Registration ID</strong></dt>
 <dd>Check the formatting of the registration ID that you pass to the server. Make sure it matches the registration ID the phone receives in the <code>com.google.android.c2dm.intent.REGISTRATION</code> intent and that you're not truncating it or adding additional characters. 
 <br/>Happens when error code is <code>InvalidRegistration</code>.</dd>
+
 <dt id="mismatched_sender"><strong>Mismatched Sender</strong></dt>
 <dd>A registration ID is tied to a certain group of senders. When an application registers for GCM usage, it must specify which senders are allowed to send messages. Make sure you're using one of those when trying to send messages to the device. If you switch to a different sender, the existing registration IDs won't work. 
 Happens when error code is <code>MismatchSenderId</code>.</dd>
@@ -860,15 +862,21 @@
   <li>If the application manually unregisters by issuing a <span class="prettyprint pretty-java"><code>com.google.android.c2dm.intent.UNREGISTER</code></span><code> </code>intent.</li>
   <li>If the application is automatically unregistered, which can happen (but is not guaranteed) if the user uninstalls the application.</li>
   <li>If the registration ID expires. Google might decide to refresh registration IDs. </li>
+  <li>If the application is updated but the new version does not have a broadcast receiver configured to receive <code>com.google.android.c2dm.intent.RECEIVE</code> intents.</li>
 </ul>
 For all these cases, you should remove this registration ID from the 3rd-party server and stop using it to send 
 messages. 
 <br/>Happens when error code is <code>NotRegistered</code>.</dd>
 
-  <dt id="big_msg"><strong>Message Too Big</strong></dt>
+<dt id="big_msg"><strong>Message Too Big</strong></dt>
   <dd>The total size of the payload data that is included in a message can't exceed 4096 bytes. Note that this includes both the size of the keys as well as the values. 
 <br/>Happens when error code is <code>MessageTooBig</code>.</dd>
 
+<dt id="invalid_datakey"><strong>Invalid Data Key</strong></dt>
+<dd>The payload data contains a key (such as <code>from</code> or any value prefixed by <code>google.</code>) that is used internally by GCM in the  <code>com.google.android.c2dm.intent.RECEIVE</code> Intent and cannot be used. Note that some words (such as <code>collapse_key</code>) are also used by GCM but are allowed in the payload, in which case the payload value will be overridden by the GCM value. 
+<br />
+Happens when the error code is <code>InvalidDataKey</code>.</dd>
+
 <dt id="ttl_error"><strong>Invalid Time To Live</strong></dt>
   <dd>The value for the Time to Live field must be an integer representing a duration in seconds between 0 and 2,419,200 (4 weeks). Happens when error code is <code>InvalidTtl</code>.
 </dd>
diff --git a/docs/html/guide/guide_toc.cs b/docs/html/guide/guide_toc.cs
index 9465f18..e812ccb 100644
--- a/docs/html/guide/guide_toc.cs
+++ b/docs/html/guide/guide_toc.cs
@@ -8,7 +8,7 @@
 <ul id="nav">
   <!--  Walkthrough for Developers -- quick overview of what it's like to develop on Android -->
   <!--<li style="color:red">Overview</li> -->
-  
+
   <li class="nav-section">
     <div class="nav-section-header"><a href="<?cs var:toroot ?>guide/components/index.html">
         <span class="en">App Components</span>
@@ -223,7 +223,7 @@
             <li><a href="<?cs var:toroot ?>guide/topics/search/adding-custom-suggestions.html">Adding Custom Suggestions</a></li>
             <li><a href="<?cs var:toroot ?>guide/topics/search/searchable-config.html">Searchable Configuration</a></li>
           </ul>
-      </li>  
+      </li>
       <li><a href="<?cs var:toroot ?>guide/topics/ui/drag-drop.html">
           <span class="en">Drag and Drop</span>
         </a></li>
@@ -235,6 +235,9 @@
           <li><a href="<?cs var:toroot ?>guide/topics/ui/accessibility/apps.html">
               <span class="en">Making Applications Accessible</span>
             </a></li>
+          <li><a href="<?cs var:toroot ?>guide/topics/ui/accessibility/checklist.html">
+              <span class="en">Accessibility Developer Checklist</span>
+            </a></li>
           <li><a href="<?cs var:toroot ?>guide/topics/ui/accessibility/services.html">
               <span class="en">Building Accessibility Services</span>
             </a></li>
@@ -382,9 +385,9 @@
             </a></li>
         </ul>
       </li><!-- end of location and sensors -->
-      
 
-      
+
+
       <li class="nav-section">
         <div class="nav-section-header"><a href="<?cs var:toroot ?>guide/topics/connectivity/index.html">
                <span class="en">Connectivity</span>
@@ -419,10 +422,10 @@
             <span class="en">SIP</span>
           </a>
      </li>
-     
+
     </ul>
   </li><!-- end of connectivity -->
-  
+
       <li class="nav-section">
         <div class="nav-section-header"><a href="<?cs var:toroot ?>guide/topics/text/index.html">
             <span class="en">Text and Input</span>
@@ -439,7 +442,7 @@
             </a></li>
         </ul>
       </li><!-- end of text and input -->
-      
+
      <li class="nav-section">
       <div class="nav-section-header"><a href="<?cs var:toroot ?>guide/topics/data/index.html">
           <span class="en">Data Storage</span>
@@ -457,7 +460,7 @@
       </ul>
     </li><!-- end of data storage -->
 
-  
+
   <li class="nav-section">
            <div class="nav-section-header"><a href="<?cs var:toroot?>guide/topics/admin/index.html">
                <span class="en">Administration</span>
@@ -475,7 +478,7 @@
             -->
            </ul>
   </li><!-- end of administration -->
-  
+
   <li class="nav-section">
     <div class="nav-section-header"><a href="<?cs var:toroot ?>guide/webapps/index.html">
     <span class="en">Web Apps</span>
@@ -498,7 +501,7 @@
           </a></li>
     </ul>
   </li><!-- end of web apps -->
-  
+
   <li class="nav-section">
     <div class="nav-section-header"><a href="<?cs var:toroot ?>guide/practices/index.html">
       <span class="en">Best Practices</span>
@@ -555,13 +558,13 @@
 
     </ul>
   </li>
-  
-  
+
+
   <li class="nav-section">
     <div class="nav-section-header"><a href="<?cs var:toroot ?>guide/google/index.html">
         <span class="en">Google Services</span>
       </a></div>
-    <ul>      
+    <ul>
 
       <li class="nav-section">
         <div class="nav-section-header"><a href="<?cs var:toroot?>guide/google/play/billing/index.html">
@@ -623,7 +626,7 @@
       <li><a href="<?cs var:toroot ?>guide/google/play/expansion-files.html">
           <span class="en">APK Expansion Files</span></a>
       </li>
-      
+
       <li class="nav-section">
         <div class="nav-section-header"><a href="<?cs var:toroot ?>guide/google/gcm/index.html">
           <span class="en">Google Cloud Messaging</span></a>
@@ -649,9 +652,9 @@
 
     </ul>
   </li><!-- end Google Play -->
-  
-  
-  
+
+
+
       <!-- this needs to move
       <li class="nav-section">
         <div class="nav-section-header"><a href="<?cs var:toroot ?>guide/practices/ui_guidelines/index.html">
@@ -691,9 +694,9 @@
               </a></div>
           </li>
         </ul>
-      </li> 
+      </li>
         </ul> -->
-        
+
 <!-- Remove
   <li class="nav-section">
     <div class="nav-section-header"><a href="<?cs var:toroot ?>guide/appendix/index.html">
@@ -710,7 +713,7 @@
       <li><a href="<?cs var:toroot ?>guide/appendix/g-app-intents.html">
             <span class="en">Intents List: Google Apps</span>
           </a></li>
-       
+
 
       <li><a href="<?cs var:toroot ?>guide/appendix/glossary.html">
             <span class="en">Glossary</span>
diff --git a/docs/html/guide/topics/appwidgets/index.jd b/docs/html/guide/topics/appwidgets/index.jd
index a46f9a7..5a4e03a 100644
--- a/docs/html/guide/topics/appwidgets/index.jd
+++ b/docs/html/guide/topics/appwidgets/index.jd
@@ -307,6 +307,7 @@
   <li>{@link android.widget.FrameLayout}</li>
   <li>{@link android.widget.LinearLayout}</li>
   <li>{@link android.widget.RelativeLayout}</li>
+  <li>{@link android.widget.GridLayout}</li>
 </ul>
 
 <p>And the following widget classes:</p>
@@ -327,6 +328,9 @@
 
 <p>Descendants of these classes are not supported.</p>
 
+<p>RemoteViews also supports {@link android.view.ViewStub}, which is an invisible, zero-sized View you can use 
+to lazily inflate layout resources at runtime.</p>
+
 
 <h3 id="AddingMargins">Adding margins to App Widgets</h3>
 
@@ -410,6 +414,25 @@
 done.
     (See <a href="#Configuring">Creating an App Widget Configuration
 Activity</a> below.)</dd> 
+
+<dt>
+  {@link android.appwidget.AppWidgetProvider#onAppWidgetOptionsChanged onAppWidgetOptionsChanged()} 
+</dt>
+<dd>
+This is called when the widget is first placed and any time the widget is resized. You can use this callback to show or hide content based on the widget's size ranges. You get the size ranges by calling {@link android.appwidget.AppWidgetManager#getAppWidgetOptions getAppWidgetOptions()}, which returns a  {@link android.os.Bundle} that includes the following:<br /><br />
+<ul>
+  <li>{@link android.appwidget.AppWidgetManager#OPTION_APPWIDGET_MIN_WIDTH}&mdash;Contains 
+the lower bound on the current width, in dp units, of a widget instance.</li>
+  <li>{@link android.appwidget.AppWidgetManager#OPTION_APPWIDGET_MIN_HEIGHT}&mdash;Contains 
+the lower bound on the current height, in dp units, of a widget instance.</li>
+  <li>{@link android.appwidget.AppWidgetManager#OPTION_APPWIDGET_MAX_WIDTH}&mdash;Contains
+ the upper bound on the current width, in dp units, of a widget instance.</li>
+  <li>{@link android.appwidget.AppWidgetManager#OPTION_APPWIDGET_MAX_HEIGHT}&mdash;Contains 
+the upper bound on the current width, in dp units, of a widget instance.</li>
+</ul>
+
+This callback was introduced in API Level 16 (Android 4.1). If you implement this callback, make sure that your app doesn't depend on it since it won't be called on older devices.
+</dd>
   <dt>{@link android.appwidget.AppWidgetProvider#onDeleted(Context,int[])}</dt>
     <dd>This is called every time an App Widget is deleted from the App Widget
 host.</dd>
@@ -533,12 +556,13 @@
 to receive the App Widget broadcasts directly, you can implement your own 
 {@link android.content.BroadcastReceiver} or override the 
 {@link android.appwidget.AppWidgetProvider#onReceive(Context,Intent)} callback. 
-The four Intents you need to care about are:</p>
+The Intents you need to care about are as follows:</p>
 <ul>
   <li>{@link android.appwidget.AppWidgetManager#ACTION_APPWIDGET_UPDATE}</li>
   <li>{@link android.appwidget.AppWidgetManager#ACTION_APPWIDGET_DELETED}</li>
   <li>{@link android.appwidget.AppWidgetManager#ACTION_APPWIDGET_ENABLED}</li>
   <li>{@link android.appwidget.AppWidgetManager#ACTION_APPWIDGET_DISABLED}</li>
+  <li>{@link android.appwidget.AppWidgetManager#ACTION_APPWIDGET_OPTIONS_CHANGED}</li>
 </ul>
 
 
diff --git a/docs/html/guide/topics/media/camera.jd b/docs/html/guide/topics/media/camera.jd
index a63270a..3fe23f8 100644
--- a/docs/html/guide/topics/media/camera.jd
+++ b/docs/html/guide/topics/media/camera.jd
@@ -617,7 +617,7 @@
 
         // Create our Preview view and set it as the content of our activity.
         mPreview = new CameraPreview(this, mCamera);
-        FrameLayout preview = (FrameLayout) findViewById(id.camera_preview);
+        FrameLayout preview = (FrameLayout) findViewById(R.id.camera_preview);
         preview.addView(mPreview);
     }
 }
diff --git a/docs/html/guide/topics/search/index.jd b/docs/html/guide/topics/search/index.jd
index 2ee624b..680c607 100644
--- a/docs/html/guide/topics/search/index.jd
+++ b/docs/html/guide/topics/search/index.jd
@@ -54,9 +54,9 @@
 if your data is stored in an SQLite database, you should use the {@link android.database.sqlite}
 APIs to perform searches.
 <br/><br/>
-Also, there is no guarantee that every device provides a dedicated SEARCH button to invoke the
+Also, there is no guarantee that a device provides a dedicated SEARCH button that invokes the
 search interface in your application. When using the search dialog or a custom interface, you
-must always provide a search button in your UI that activates the search interface. For more
+must provide a search button in your UI that activates the search interface. For more
 information, see <a href="search-dialog.html#InvokingTheSearchDialog">Invoking the search
 dialog</a>.</p>
 
diff --git a/docs/html/guide/topics/search/search-dialog.jd b/docs/html/guide/topics/search/search-dialog.jd
index 49451ac..b9a26d6 100644
--- a/docs/html/guide/topics/search/search-dialog.jd
+++ b/docs/html/guide/topics/search/search-dialog.jd
@@ -6,14 +6,6 @@
 <div id="qv-wrapper">
 <div id="qv">
 
-  <h2>Quickview</h2>
-  <ul>
-    <li>The Android system sends search queries from the search dialog or widget to an activity you
-specify to perform searches and present results</li>
-    <li>You can put the search widget in the Action Bar, as an "action view," for quick
-access</li>
-  </ul>
-
 
 <h2>In this document</h2>
 <ol>
@@ -61,14 +53,8 @@
 
 <h2>Downloads</h2>
 <ol>
-<li><a href="{@docRoot}shareables/search_icons.zip">search_icons.zip</a></li>
-</ol>
-
-<h2>See also</h2>
-<ol>
-<li><a href="adding-recent-query-suggestions.html">Adding Recent Query Suggestions</a></li>
-<li><a href="adding-custom-suggestions.html">Adding Custom Suggestions</a></li>
-<li><a href="searchable-config.html">Searchable Configuration</a></li>
+<li><a href="{@docRoot}design/downloads/index.html#action-bar-icon-pack">Action Bar
+Icon Pack</a></li>
 </ol>
 
 </div>
@@ -142,12 +128,14 @@
   <li>A search interface, provided by either:
     <ul>
       <li>The search dialog
-        <p>By default, the search dialog is hidden, but appears at the top of the screen when the 
-user presses the device SEARCH button (when available) or another button in your user interface.</p>
+        <p>By default, the search dialog is hidden, but appears at the top of the screen when
+          you call {@link android.app.Activity#onSearchRequested()} (when the user presses your
+          Search button).</p>
       </li>
       <li>Or, a {@link android.widget.SearchView} widget
         <p>Using the search widget allows you to put the search box anywhere in your activity.
-Instead of putting it in your activity layout, however, it's usually more convenient for users as an
+Instead of putting it in your activity layout, you should usually use
+{@link android.widget.SearchView} as an 
 <a href="{@docRoot}guide/topics/ui/actionbar.html#ActionView">action view in the Action Bar</a>.</p>
       </li>
     </ul>
@@ -415,10 +403,9 @@
 your application for devices running Android 3.0, you should consider using the search widget
 instead (see the side box).</p>
 
-<p>The search dialog is always hidden by default, until the user activates it. If the user's device
-includes a SEARCH button, pressing it will activate the search dialog by default. Your application
-can also activate the search dialog on demand by calling {@link
-android.app.Activity#onSearchRequested onSearchRequested()}. However, neither of these work
+<p>The search dialog is always hidden by default, until the user activates it. Your application
+can activate the search dialog by calling {@link
+android.app.Activity#onSearchRequested onSearchRequested()}. However, this method doesn't work
 until you enable the search dialog for the activity.</p>
 
 <p>To enable the search dialog, you must indicate to the system which searchable activity should
@@ -469,8 +456,8 @@
 href="{@docRoot}guide/topics/manifest/meta-data-element.html">{@code &lt;meta-data&gt;}</a>
 element to declare which searchable activity to use for searches, the activity has enabled the
 search dialog.
-While the user is in this activity, the device SEARCH button (if available) and the {@link
-android.app.Activity#onSearchRequested onSearchRequested()} method will activate the search dialog.
+While the user is in this activity, the {@link
+android.app.Activity#onSearchRequested onSearchRequested()} method activates the search dialog.
 When the user executes the search, the system starts {@code SearchableActivity} and delivers it
 the {@link android.content.Intent#ACTION_SEARCH} intent.</p>
 
@@ -495,21 +482,22 @@
 
 <h3 id="InvokingTheSearchDialog">Invoking the search dialog</h3>
 
-<p>As mentioned above, the device SEARCH button will open the search dialog as long as the current
-activity has declared in the manifest the searchable activity to use.</p>
+<p>Although some devices provide a dedicated Search button, the behavior of the button may vary
+between devices and many devices do not provide a Search button at all. So when using the search
+dialog, you <strong>must provide a search button in your UI</strong> that activates the search
+dialog by calling {@link android.app.Activity#onSearchRequested()}.</p>
 
-<p>However, some devices do not include a dedicated SEARCH button, so you should not assume that
-it's always available. When using the search dialog, you must <strong>always provide another search
-button in your UI</strong> that activates the search dialog by calling {@link
-android.app.Activity#onSearchRequested()}.</p>
+<p>For instance, you should add a Search button in your <a
+href="{@docRoot}guide/topics/ui/menus.html#options-menu">Options Menu</a> or UI
+layout that calls {@link android.app.Activity#onSearchRequested()}. For consistency with
+the Android system and other apps, you should label your button with the Android Search icon that's
+available from the <a href="{@docRoot}design/downloads/index.html#action-bar-icon-pack">Action Bar
+Icon Pack</a>.</p>
 
-<p>For instance, you should either provide a menu item in your <a
-href="{@docRoot}guide/topics/ui/menus.html#options-menu">Options Menu</a> or a button in your
-activity layout that
-activates search by calling {@link android.app.Activity#onSearchRequested()}. The <a
-href="{@docRoot}shareables/search_icons.zip">search_icons.zip</a> file includes icons for
-medium and high density screens, which you can use for your search menu item or button (low-density
-screens scale-down the hdpi image by one half). </p>
+<p class="note"><strong>Note:</strong> If your app uses the <a
+href="{@docRoot}guide/topics/ui/actionbar.html">action bar</a>, then you should not use
+the search dialog for your search interface. Instead, use the <a href="#UsingSearchWidget">search
+widget</a> as a collapsible view in the action bar.</p>
 
 <p>You can also enable "type-to-search" functionality, which activates the search dialog when the
 user starts typing on the keyboard&mdash;the keystrokes are inserted into the search dialog. You can
diff --git a/docs/html/guide/topics/ui/accessibility/apps.jd b/docs/html/guide/topics/ui/accessibility/apps.jd
index d23512b..13b4538 100644
--- a/docs/html/guide/topics/ui/accessibility/apps.jd
+++ b/docs/html/guide/topics/ui/accessibility/apps.jd
@@ -21,14 +21,11 @@
         <li><a href="#accessibility-methods">Implementing accessibility API methods</a></li>
         <li><a href="#send-events">Sending accessibility events</a></li>
         <li><a href="#populate-events">Populating accessibility events</a></li>
+        <li><a href="#virtual-hierarchy">Providing a customized accessibility context</a></li>
+        <li><a href="#custom-touch-events">Handling custom touch events</a></li>
       </ol>
     </li>
-    <li><a href="#test">Testing Accessibility</a>
-      <ol>
-        <li><a href="#test-audibles">Testing audible feedback</a></li>
-        <li><a href="#test-navigation">Testing focus navigation</a></li>
-      </ol>
-    </li>
+    <li><a href="#test">Testing Accessibility</a></li>
   </ol>
 
   <h2>Key classes</h2>
@@ -42,60 +39,79 @@
 
   <h2>See also</h2>
   <ol>
-    <li><a href="{@docRoot}training/accessibility/index.html">Implementing Accessibility</a></li>
-    <li><a href="{@docRoot}training/design-navigation/index.html">Designing Effective Navigation</a>
-      </li>
-    <li><a href="{@docRoot}design/index.html">Android Design</a></li>
+    <li><a href="checklist.html">Accessibility Developer Checklist</a><li>
+    <li><a href="{@docRoot}tools/testing/testing_accessibility.html">Accessibility Testing Checklist</a><li>
+    <li><a href="{@docRoot}design/patterns/accessibility.html">Android Design: Accessibility</a></li>
+    <li><a href="{@docRoot}training/design-navigation/index.html">Designing Effective Navigation</a></li>
+    <li><a href="{@docRoot}training/accessibility/index.html">Training: Implementing Accessibility</a></li>
   </ol>
 
 </div>
 </div>
 
-<p>Applications built for Android are accessible to users with visual, physical or age-related
-disabilities when they activate accessibility features and services on a device. By default,
-these services make your application more accessible. However, there are further steps you should
-take to optimize the accessibility of your application and ensure a pleasant experience for all your
-users.</p>
+<p>Applications built for Android are more accessible to users with visual, physical or age-related
+limitations when those users activate accessibility services and features on a device. These
+services make your application more accessible even if you do not make any accessibility changes
+to your code. However, there are steps you should take to optimize the accessibility of your
+application and ensure a pleasant experience for all your users.</p>
 
-<p>Making sure your application is accessible to all users is relatively easy, particularly when you
-use framework-provided user interface components. If you only use these standard components for your
-application, there are just a few steps required to ensure your application is accessible:</p>
+<p>Making sure your application is accessible to all users requires only a few steps, particularly
+when you create your user interface with the components provided by the Android framework. If you
+use only the standard components for your application, the steps are:</p>
 
 <ol>
-  <li>Label your {@link android.widget.ImageButton}, {@link android.widget.ImageView}, {@link
-android.widget.EditText}, {@link android.widget.CheckBox} and other user interface controls using
-the <a href="{@docRoot}reference/android/view/View.html#attr_android:contentDescription">
-    {@code android:contentDescription}</a> attribute.</li>
-  <li>Make all of your user interface elements accessible with a directional controller,
-    such as a trackball or D-pad.</li>
-  <li>Test your application by turning on accessibility services like TalkBack and Explore by
-    Touch, and try using your application using only directional controls.</li>
+  <li>Add descriptive text to user interface controls in your application using the
+    <a href="{@docRoot}reference/android/view/View.html#attr_android:contentDescription">
+    {@code android:contentDescription}</a> attribute. Pay particular attention to
+    {@link android.widget.ImageButton}, {@link android.widget.ImageView}
+    and {@link android.widget.CheckBox}.</li>
+  <li>Make sure that all user interface elements that can accept input (touches or typing) can be
+    reached with a directional controller, such as a trackball, D-pad (physical or virtual) or
+    navigation <a href="http://support.google.com/android/bin/topic.py?hl=en&topic=2492346">gestures
+    </a>.</li>
+  <li>Make sure that audio prompts are always accompanied by another visual prompt or notification,
+    to assist users who are deaf or hard of hearing.</li>
+  <li>Test your application using only accessibility navigation services and features. Turn on
+    <a href="{@docRoot}tools/testing/testing_accessibility.html#testing-talkback">TalkBack</a> and
+    <a href="{@docRoot}tools/testing/testing_accessibility.html#testing-ebt">Explore by Touch</a>,
+    and then try using your application using only directional controls. For more information on
+    testing for accessibility, see the <a href="{@docRoot}tools/testing/testing_accessibility.html">
+    Accessibility Testing Checklist</a>.</li>
 </ol>
 
-<p>Developers who create custom controls that extend from the {@link android.view.View} class have
-some additional responsibilities for making sure their components are accessible for users. This
-document also discusses how to make custom view controls compatible with accessibility services.</p>
+<p>If you build custom controls that extend the {@link android.view.View} class, you must complete
+some additional work to make sure your components are accessible. This document discusses how to
+make custom view controls compatible with accessibility services.</p>
+
+<p class="note">
+<strong>Note:</strong> The implementation steps in this document describe the requirements for
+making your application accessible for users with blindness or low-vision. Be sure to review the
+requirements for serving users who are deaf and hard of hearing in the
+<a href="{@docRoot}guide/topics/ui/accessibility/checklist.html">Accessibility Developer
+Checklist</a></p>.
+
 
 
 <h2 id="label-ui">Labeling User Interface Elements</h2>
 
-<p>Many user interface controls rely on visual cues to inform users of their meaning. For
+<p>Many user interface controls depend on visual cues to indicate their meaning and usage. For
 example, a note-taking application might use an {@link android.widget.ImageButton} with a
-picture of a plus sign to indicate that the user can add a new note. Or, an {@link
-android.widget.EditText} component may have a label near it that indicates its purpose. When a user
-with impaired vision accesses your application, these visual cues are often useless.</p>
+picture of a plus sign to indicate that the user can add a new note. An {@link
+android.widget.EditText} component may have a label near it that indicates its purpose. A user
+with impaired vision can't see these cues well enough to follow them, which makes them useless.</p>
 
-<p>To provide textual information about interface controls (as an alternative to the visual cues),
-use the <a href="{@docRoot}reference/android/view/View.html#attr_android:contentDescription">
-{@code android:contentDescription}</a> attribute. The text you provide in this attribute is not
-visible on the screen, but if a user has enabled accessibility services that provide audible
-prompts, then the description in this attribute is read aloud to the user.</p>
+<p>You can make these controls more accessible with the
+<a href="{@docRoot}reference/android/view/View.html#attr_android:contentDescription">
+{@code android:contentDescription}</a> XML layout attribute. The text in this attribute does not
+appear on screen, but if the user enables accessibility services that provide audible prompts, then
+when the user navigates to that control, the text is spoken.</p>
 
-<p>Set the <a href="{@docRoot}reference/android/view/View.html#attr_android:contentDescription">
+<p>For this reason, set the
+<a href="{@docRoot}reference/android/view/View.html#attr_android:contentDescription">
 {@code android:contentDescription}</a> attribute for every {@link android.widget.ImageButton},
-{@link android.widget.ImageView}, {@link android.widget.EditText}, {@link android.widget.CheckBox}
-in your application's user interface, and on any other input controls that might require additional
-information for users who are not able to see it.</p>
+{@link android.widget.ImageView}, {@link android.widget.CheckBox}
+in your application's user interface, and add descriptions to any other input controls that might
+require additional information for users who are not able to see it.</p>
 
 <p>For example, the following {@link android.widget.ImageButton} sets the content description for
 the plus button to the {@code add_note} string resource, which could be defined as “Add note" for an
@@ -108,32 +124,38 @@
     android:contentDescription=”@string/add_note”/&gt;
 </pre>
 
-<p>By including the description, speech-based accessibility services can announce "Add note" when a
-user moves focus to this button or hovers over it.</p>
+<p>By including the description, an accessibility service that provides spoken feedback can announce
+"Add note" when a user moves focus to this button or hovers over it.</p>
 
 <p class="note"><strong>Note:</strong> For {@link android.widget.EditText} fields, provide an
 <a href="{@docRoot}reference/android/widget/TextView.html#attr_android:hint">android:hint</a>
-attribute to help users understand what content is expected.</p>
+attribute <em>instead</em> of a content description, to help users understand what content is
+expected when the text field is empty. When the field is filled, TalkBack reads the entered
+content to the user, instead of the hint text.</p>
+
 
 <h2 id="focus-nav">Enabling Focus Navigation</h2>
 
 <p>Focus navigation allows users with disabilities to step through user interface controls using a
-directional controller. Directional controllers can be physical, such as a clickable trackball,
-directional pad (D-pad) or arrow keys, tab key navigation with an attached keyboard or a software
-application, such as the
+directional controller. Directional controllers can be physical, such as a trackball, directional
+pad (D-pad) or arrow keys, or virtual, such as the
 <a href="https://play.google.com/store/apps/details?id=com.googlecode.eyesfree.inputmethod.latin">
-Eyes-Free Keyboard</a>, that provides an on-screen directional control.</p>
+Eyes-Free Keyboard</a>, or the gestures navigation mode available in Android 4.1 and higher.
+Directional controllers are a primary means of navigation for many Android users.
+</p>
 
-<p>A directional controller is a primary means of navigation for many users.
-Verify that all user interface (UI) controls in your application are accessible
-without using the touchscreen and that clicking with the center button (or OK button) of a
-directional controller has the same effect as touching the controls on the touchscreen. For
-information on testing directional controls, see <a href="#test-navigation">Testing focus
-navigation</a>.</p>
+<p>To ensure that users can navigate your application using only a directional controller, verify
+that all user interface (UI) input controls in your application can be reached and activated
+without using the touchscreen. You should also verify that clicking with the center button (or OK
+button) of a directional controller has the same effect as touching a control that already has
+focus. For information on testing directional controls, see
+<a href="{@docRoot}tools/testing/testing_accessibility.html#test-navigation">Testing
+focus navigation</a>.</p>
+
 
 <h3 id="focus-enable">Enabling view focus</h3>
 
-<p>A user interface element is accessible using directional controls when its
+<p>A user interface element is reachable using directional controls when its
 <a href="{@docRoot}reference/android/view/View.html#attr_android:focusable">
 {@code android:focusable}</a> attribute is set to {@code true}. This setting allows users to focus
 on the element using the directional controls and then interact with it. The user interface controls
@@ -149,44 +171,44 @@
   <li>{@link android.view.View#requestFocus requestFocus()}</li>
 </ul>
 
-<p>When working with a view that is not focusable by default, you can make it focusable from the XML
-layout file by setting the
-<a href="{@docRoot}reference/android/view/View.html#attr_android:focusable">
-{@code android:focusable}</a> attribute to {@code true} or by using the {@link
+<p>If a view is not focusable by default, you can make it focusable in your layout file by setting
+the <a href="{@docRoot}reference/android/view/View.html#attr_android:focusable">
+{@code android:focusable}</a> attribute to {@code true} or by calling the its {@link
 android.view.View#setFocusable setFocusable()} method.</p>
 
+
 <h3 id="focus-order">Controlling focus order</h3>
 
 <p>When users navigate in any direction using directional controls, focus is passed from one
-user interface element (View) to another, as determined by the focus ordering. The ordering of the
-focus movement is based on an algorithm that finds the nearest neighbor in a given direction. In
-rare cases, the default algorithm may not match the order that you intended for your UI. In these
-situations, you can provide explicit overrides to the ordering using the following XML attributes in
-the layout file:</p>
+user interface element (view) to another, as determined by the focus order. This order is based on
+an algorithm that finds the nearest neighbor in a given direction. In rare cases, the algorithm may
+not match the order that you intended or may not be logical for users. In these situations, you can
+provide explicit overrides to the ordering using the following XML attributes in your layout file:
+</p>
 
 <dl>
- <dt><a href="{@docRoot}reference/android/view/View.html#attr_android:nextFocusDown"
->{@code android:nextFocusDown}</a></dt>
-  <dd>Defines the next view to receive focus when the user navigates down.</dd>
- <a><a href="{@docRoot}reference/android/view/View.html#attr_android:nextFocusLeft"
->{@code android:nextFocusLeft}</a></dt>
-  <dd>Defines the next view to receive focus when the user navigates left.</dd>
- <dt><a href="{@docRoot}reference/android/view/View.html#attr_android:nextFocusRight"
->{@code android:nextFocusRight}</a></dt>
-  <dd>Defines the next view to receive focus when the user navigates right.</dd>
- <dt><a href="{@docRoot}reference/android/view/View.html#attr_android:nextFocusUp"
->{@code android:nextFocusUp}</a></dt>
-  <dd>Defines the next view to receive focus when the user navigates up.</dd>
+  <dt><a href="{@docRoot}reference/android/view/View.html#attr_android:nextFocusDown">
+  {@code android:nextFocusDown}</a></dt>
+    <dd>Defines the next view to receive focus when the user navigates down.</dd>
+  <dt><a href="{@docRoot}reference/android/view/View.html#attr_android:nextFocusLeft">
+  {@code android:nextFocusLeft}</a></dt>
+    <dd>Defines the next view to receive focus when the user navigates left.</dd>
+  <dt><a href="{@docRoot}reference/android/view/View.html#attr_android:nextFocusRight">
+  {@code android:nextFocusRight}</a></dt>
+    <dd>Defines the next view to receive focus when the user navigates right.</dd>
+  <dt><a href="{@docRoot}reference/android/view/View.html#attr_android:nextFocusUp">
+  {@code android:nextFocusUp}</a></dt>
+    <dd>Defines the next view to receive focus when the user navigates up.</dd>
 </dl>
 
-<p>The following example XML layout shows two focusable user interface elements where the <a
-href="{@docRoot}reference/android/view/View.html#attr_android:nextFocusDown"
->{@code android:nextFocusDown}</a> and <a
-href="{@docRoot}reference/android/view/View.html#attr_android:nextFocusUp"
->{@code android:nextFocusUp}</a> attributes have been explicitly set. The {@link android.widget.TextView} is
+<p>The following example XML layout shows two focusable user interface elements where the
+<a href="{@docRoot}reference/android/view/View.html#attr_android:nextFocusDown">{@code
+android:nextFocusDown}</a> and
+<a href="{@docRoot}reference/android/view/View.html#attr_android:nextFocusUp">{@code
+android:nextFocusUp}</a> attributes have been explicitly set. The {@link android.widget.TextView} is
 located to the right of the {@link android.widget.EditText}. However, since these properties have
 been set, the {@link android.widget.TextView} element can now be reached by pressing the down arrow
-when focus is on the {@link android.widget.EditText} element: </p>
+when focus is on the {@link android.widget.EditText} element:</p>
 
 <pre>
 &lt;LinearLayout android:orientation="horizontal"
@@ -218,8 +240,9 @@
 
 <ul>
   <li>Handle directional controller clicks</li>
-  <li>Implement Accessibility API methods</li>
-  <li>Send {@link android.view.accessibility.AccessibilityEvent} objects specific to your custom view</li>
+  <li>Implement accessibility API methods</li>
+  <li>Send {@link android.view.accessibility.AccessibilityEvent} objects specific to your custom
+    view</li>
   <li>Populate {@link android.view.accessibility.AccessibilityEvent} and {@link
     android.view.accessibility.AccessibilityNodeInfo} for your view</li>
 </ul>
@@ -243,9 +266,9 @@
 
 <p>Accessibility events are messages about users interaction with visual interface components in
 your application. These messages are handled by <a href="services.html">Accessibility Services</a>,
-which use the information in these events to produce supplemental feedback and prompts when users
-have enabled accessibility services. As of Android 4.0 (API Level 14) and higher, the methods for
-generating accessibility events have been expanded to provide more detailed information beyond the
+which use the information in these events to produce supplemental feedback and prompts. In
+Android 4.0 (API Level 14) and higher, the methods for
+generating accessibility events have been expanded to provide more detailed information than the
 {@link android.view.accessibility.AccessibilityEventSource} interface introduced in Android 1.6 (API
 Level 4). The expanded accessibility methods are part of the {@link android.view.View} class as well
 as the {@link android.view.View.AccessibilityDelegate} class. The methods are as follows:</p>
@@ -262,12 +285,12 @@
   <dd>(API Level 4) This method is used when the calling code needs to directly control the check
 for accessibility being enabled on the device ({@link
 android.view.accessibility.AccessibilityManager#isEnabled AccessibilityManager.isEnabled()}). If
-you do implement this method, you must assume that the calling method has already checked that
-accessibility is enabled and the result is {@code true}. You typically do not need to implement this
-method for a custom view.</dd>
+you do implement this method, you must perform the call as if accessibility is enabled, regardless
+of the actual system setting. You typically do not need to implement this method for a custom view.
+</dd>
 
   <dt>{@link android.view.View#dispatchPopulateAccessibilityEvent
-dispatchPopulateAccessibilityEvent()} </dt>
+dispatchPopulateAccessibilityEvent()}</dt>
   <dd>(API Level 4) The system calls this method when your custom view generates an
 accessibility event. As of API Level 14, the default implementation of this method calls {@link
 android.view.View#onPopulateAccessibilityEvent onPopulateAccessibilityEvent()} for this view and
@@ -276,21 +299,21 @@
 accessibility services on revisions of Android <em>prior</em> to 4.0 (API Level 14) you
 <em>must</em> override this method and populate {@link
 android.view.accessibility.AccessibilityEvent#getText} with descriptive text for your custom
-view.</dd>
+view, which is spoken by accessibility services, such as TalkBack.</dd>
 
   <dt>{@link android.view.View#onPopulateAccessibilityEvent onPopulateAccessibilityEvent()}</dt>
-  <dd>(API Level 14) This method sets the text output of an {@link
+  <dd>(API Level 14) This method sets the spoken text prompt of the {@link
 android.view.accessibility.AccessibilityEvent} for your view. This method is also called if the
 view is a child of a view which generates an accessibility event.
 
   <p class="note"><strong>Note:</strong> Modifying additional attributes beyond the text within
-this method potentially overwrites properties set by other methods. So, while you are able modify
+this method potentially overwrites properties set by other methods. While you can modify
 attributes of the accessibility event with this method, you should limit these changes
-to text content only and use the {@link android.view.View#onInitializeAccessibilityEvent
+to text content, and use the {@link android.view.View#onInitializeAccessibilityEvent
 onInitializeAccessibilityEvent()} method to modify other properties of the event.</p>
 
-  <p class="note"><strong>Note:</strong> If your implementation of this event calls for completely
-overiding the output text without allowing other parts of your layout to modify its content, then
+  <p class="note"><strong>Note:</strong> If your implementation of this event completely
+overrides the output text without allowing other parts of your layout to modify its content, then
 do not call the super implementation of this method in your code.</p>
   </dd>
 
@@ -306,7 +329,7 @@
   <dt>{@link android.view.View#onInitializeAccessibilityNodeInfo
 onInitializeAccessibilityNodeInfo()}</dt>
   <dd>(API Level 14) This method provides accessibility services with information about the state of
-the view. The default {@link android.view.View} implementation sets a standard set of view
+the view. The default {@link android.view.View} implementation has a standard set of view
 properties, but if your custom view provides interactive control beyond a simple {@link
 android.widget.TextView} or {@link android.widget.Button}, you should override this method and set
 the additional information about your view into the {@link
@@ -315,7 +338,7 @@
   <dt>{@link android.view.ViewGroup#onRequestSendAccessibilityEvent
 onRequestSendAccessibilityEvent()}</dt>
   <dd>(API Level 14) The system calls this method when a child of your view has generated an
-{@link android.view.accessibility.AccessibilityEvent}. This step allows the the parent view to amend
+{@link android.view.accessibility.AccessibilityEvent}. This step allows the parent view to amend
 the accessibility event with additional information. You should implement this method only if your
 custom view can have child views and if the parent view can provide context information to the
 accessibility event that would be useful to accessibility services.</dd>
@@ -333,7 +356,7 @@
 {@link android.support.v4.view.ViewCompat#setAccessibilityDelegate
 ViewCompat.setAccessibilityDelegate()} method to implement the accessibility methods
 above. For an example of this approach, see the Android Support Library (revision 5 or higher)
-sample {@code AccessibilityDelegateSupportActivity} in 
+sample {@code AccessibilityDelegateSupportActivity} in
 ({@code &lt;sdk&gt;/extras/android/support/v4/samples/Support4Demos/})
   </li>
 </ul>
@@ -446,20 +469,20 @@
 }
 </pre>
 
-<p>On Android 4.0 (API Level 14) and higher, the {@link
+<p>For Android 4.0 (API Level 14) and higher, use the {@link
 android.view.View#onPopulateAccessibilityEvent onPopulateAccessibilityEvent()} and
 {@link android.view.View#onInitializeAccessibilityEvent onInitializeAccessibilityEvent()}
-methods are the recommended way to populate or modify the information in an {@link
-android.view.accessibility.AccessibilityEvent}. Use the 
+methods to populate or modify the information in an {@link
+android.view.accessibility.AccessibilityEvent}. Use the
 {@link android.view.View#onPopulateAccessibilityEvent onPopulateAccessibilityEvent()} method
 specifically for adding or modifying the text content of the event, which is turned into audible
 prompts by accessibility services such as TalkBack. Use the
 {@link android.view.View#onInitializeAccessibilityEvent onInitializeAccessibilityEvent()} method for
 populating additional information about the event, such as the selection state of the view.</p>
 
-<p>In addition, you should also implement the
+<p>In addition, implement the
 {@link android.view.View#onInitializeAccessibilityNodeInfo onInitializeAccessibilityNodeInfo()}
-method. {@link android.view.accessibility.AccessibilityNodeInfo} objects populated by this method
+method. The {@link android.view.accessibility.AccessibilityNodeInfo} objects populated by this method
 are used by accessibility services to investigate the view hierarchy that generated an accessibility
 event after receiving that event, to obtain a more detailed context information and provide
 appropriate feedback to users.</p>
@@ -467,8 +490,8 @@
 <p>The example code below shows how override these three methods by using
 {@link android.support.v4.view.ViewCompat#setAccessibilityDelegate
 ViewCompat.setAccessibilityDelegate()}. Note that this sample code requires that the Android
-<a href="{@docRoot}tools/extras/support-library.html">Support Library</a> for API Level 4 (revision 5
-or higher) is added to your project.</p>
+<a href="{@docRoot}tools/extras/support-library.html">Support Library</a> for API Level 4 (revision
+5 or higher) is added to your project.</p>
 
 <pre>
 ViewCompat.setAccessibilityDelegate(new AccessibilityDelegateCompat() {
@@ -509,10 +532,10 @@
 }
 </pre>
 
-<p>On applications targeting Android 4.0 (API Level 14) and higher, these methods can be implemented
+<p>In applications targeting Android 4.0 (API Level 14) and higher, you can implement these methods
 directly in your custom view class. For another example of this approach, see the Android
-<a href="{@docRoot}tools/extras/support-library.html">Support Library</a> (revision 5 or higher) sample
-{@code AccessibilityDelegateSupportActivity} in 
+<a href="{@docRoot}tools/extras/support-library.html">Support Library</a> (revision 5 or higher)
+sample {@code AccessibilityDelegateSupportActivity} in
 ({@code &lt;sdk&gt;/extras/android/support/v4/samples/Support4Demos/}).</p>
 
 <p class="note"><strong>Note:</strong> You may find information on implementing accessibility for
@@ -525,50 +548,141 @@
 methods.</p>
 
 
+<h3 id="virtual-hierarchy">Providing a customized accessibility context</h3>
+
+<p>In Android 4.0 (API Level 14), the framework was enhanced to allow accessibility services to
+  inspect the containing view hierarchy of a user interface component that generates an
+  accessibility event. This enhancement allows accessibility services to provide a much richer set
+  of contextual information with which to aid users.</p>
+
+<p>There are some cases where accessibility services cannot get adequate information
+  from the view hierarchy. An example of this is a custom interface control that has two or more
+  separately clickable areas, such as a calendar control. In this case, the services cannot get
+  adequate information because the clickable subsections are not part of the view hierarchy.</p>
+
+<img src="calendar.png" alt="" id="figure1" />
+<p class="img-caption">
+  <strong>Figure 1.</strong> A custom calendar view with selectable day elements.
+</p>
+
+<p>In the example shown in Figure 1, the entire calendar is implemented as a single view, so if you
+  do not do anything else, accessibility services do not receive enough information about the
+  content of the view and the user's selection within the view. For example, if a user clicks on the
+  day containing <strong>17</strong>, the accessibility framework only receives the description
+  information for the whole calendar control. In this case, the TalkBack accessibility service would
+  simply announce "Calendar" or, only slightly better, "April Calendar" and the user would be left
+  to wonder what day was selected.</p>
+
+<p>To provide adequate context information for accessibility services in situations like this,
+  the framework provides a way to specify a virtual view hierarchy. A <em>virtual view
+  hierarchy</em> is a way for application developers to provide a complementary view hierarchy
+  to accessibility services that more closely matches the actual information on screen. This
+  approach allows accessibility services to provide more useful context information to users.</p>
+
+<p>Another situation where a virtual view hierarchy may be needed is a user interface containing
+  a set of controls (views) that have closely related functions, where an action on one control
+  affects the contents of one or more elements, such as a number picker with separate up and down
+  buttons. In this case, accessibility services cannot get adequate information because action on
+  one control changes content in another and the relationship of those controls may not be apparent
+  to the service. To handle this situation, group the related controls with a containing view and
+  provide a virtual view hierarchy from this container to clearly represent the information and
+  behavior provided by the controls.</p>
+
+<p>In order to provide a virtual view hierarchy for a view, override the {@link
+  android.view.View#getAccessibilityNodeProvider} method in your custom view or view group and
+  return an implementation of {@link android.view.accessibility.AccessibilityNodeProvider}. For an
+  example implementation of this accessibility feature, see
+  {@code AccessibilityNodeProviderActivity} in the ApiDemos sample project. You can implement a
+  virtual view hierarchy that is compatible with Android 1.6 and later by using the
+  <a href="{@docRoot}tools/extras/support-library.html">Support Library</a> with the
+  {@link android.support.v4.view.ViewCompat#getAccessibilityNodeProvider
+  ViewCompat.getAccessibilityNodeProvider()} method and providing an implementation with
+  {@link android.support.v4.view.accessibility.AccessibilityNodeProviderCompat}.</p>
+
+
+<h3 id="custom-touch-events">Handling custom touch events</h3>
+
+<p>Custom view controls may require non-standard touch event behavior. For example, a custom
+control may use the {@link android.view.View#onTouchEvent} listener method to detect the
+{@link android.view.MotionEvent#ACTION_DOWN} and {@link android.view.MotionEvent#ACTION_UP} events
+and trigger a special click event. In order to maintain compatibility with accessibility services,
+the code that handles this custom click event must do the following:</p>
+
+<ol>
+  <li>Generate an appropriate {@link android.view.accessibility.AccessibilityEvent} for the
+  interpreted click action.</li>
+  <li>Enable accessibility services to perform the custom click action for users who are not able to
+   use a touch screen.</li>
+</ol>
+
+<p>To handle these requirements in an efficient way, your code should override the
+{@link android.view.View#performClick} method, which must call the super implementation of this
+method and then execute whatever actions are required by the click event. When the custom click
+action is detected, that code should then call your {@code performClick()} method. The following
+code example demonstrates this pattern.</p>
+
+<pre>
+class CustomTouchView extends View {
+
+    public CustomTouchView(Context context) {
+        super(context);
+    }
+
+    boolean mDownTouch = false;
+
+    &#64;Override
+    public boolean onTouchEvent(MotionEvent event) {
+        super.onTouchEvent(event);
+
+        // Listening for the down and up touch events
+        switch (event.getAction()) {
+            case MotionEvent.ACTION_DOWN:
+                mDownTouch = true;
+                return true;
+
+            case MotionEvent.ACTION_UP:
+                if (mDownTouch) {
+                    mDownTouch = false;
+                    performClick(); // Call this method to handle the response, and
+                                    // thereby enable accessibility services to
+                                    // perform this action for a user who cannot
+                                    // click the touchscreen.
+                    return true;
+                }
+        }
+        return false; // Return false for other touch events
+    }
+
+    &#64;Override
+    public boolean performClick() {
+        // Calls the super implementation, which generates an AccessibilityEvent
+        // and calls the onClick() listener on the view, if any
+        super.performClick();
+
+        // Handle the action for the custom click here
+
+        return true;
+    }
+}
+</pre>
+
+<p>The pattern shown above makes sure that the custom click event is compatible with
+accessibility services by using the {@link android.view.View#performClick} method to both generate
+an accessibility event and provide an entry point for accessibility services to act on behalf of a
+user to perform this custom click event.</p>
+
+<p class="note"><strong>Note:</strong> If your custom view has distinct clickable regions, such as
+a custom calendar view, you must implement a <a href="#virtual-hierarchy">virtual view
+hierarchy</a> by overriding {@link android.view.View#getAccessibilityNodeProvider} in your custom
+view in order to be compatible with accessibility services.</p>
+
+
 <h2 id="test">Testing Accessibility</h2>
 
 <p>Testing the accessibility of your application is an important part of ensuring your users have a
-great experience. You can test the most important parts of accessibility by testing your application
-with audible feedback enabled and testing navigation within your application using directional
-controls.</p>
+great experience. You can test the most important accessibility features by using your application
+with audible feedback enabled and navigating within your application using only directional
+controls. For more information on testing accessibility in your application, see the
+<a href="{@docRoot}tools/testing/testing_accessibility.html">Accessibility Testing Checklist</a>.
+</p>
 
-<h3 id="test-audibles">Testing audible feedback</h3>
-<p>You can simulate the experience for many users by enabling an accessibility service that speaks
-as you move around the screen. The Explore by Touch accessibility service, which is available on
-devices with Android 4.0 and later. The <a
-href="https://play.google.com/store/apps/details?id=com.google.android.marvin.talkback">TalkBack</a>
-accessibility service, by the <a href="http://code.google.com/p/eyes-free/">Eyes-Free
-Project</a> comes preinstalled on many Android devices.</p>
-
-<p>To enable TalkBack on revisions of Android prior to Android 4.0:</p>
-<ol>
-  <li>Launch the Settings application.</li>
-  <li>Navigate to the <strong>Accessibility</strong> category and select it.</li>
-  <li>Select <strong>Accessibility</strong> to enable it.</li>
-  <li>Select <strong>TalkBack</strong> to enable it.</li>
-</ol>
-
-<p class="note"><strong>Note:</strong> If the TalkBack accessibility service is not available, you
-can install it for free from <a href="http://play.google.com">Google Play</a>.</p>
-
-<p>To enable Explore by Touch on Android 4.0 and later:</p>
-<ol>
-  <li>Launch the Settings application.</li>
-  <li>Navigate to the <strong>Accessibility</strong> category and select it.</li>
-  <li>Select the <strong>TalkBack</strong> to enable it.</li>
-  <li>Return to the <strong>Accessibility</strong> category and select <strong>Explore by
-Touch</strong> to enable it.
-    <p class="note"><strong>Note:</strong> You must turn on TalkBack <em>first</em>, otherwise this
-option is not available.</p>
-  </li>
-</ol>
-
-<h3 id="test-navigation">Testing focus navigation</h3>
-
-<p>As part of your accessibility testing, you can test navigation of your application using focus,
-even if your test devices does not have a directional controller. The <a
-href="{@docRoot}tools/help/emulator.html">Android Emulator</a> provides a
-simulated directional controller that you can easily use to test navigation. You can also use a
-software-based directional controller, such as the one provided by the
-<a href="https://play.google.com/store/apps/details?id=com.googlecode.eyesfree.inputmethod.latin">
-Eyes-Free Keyboard</a> to simulate use of a D-pad.</p>
diff --git a/docs/html/guide/topics/ui/accessibility/calendar.png b/docs/html/guide/topics/ui/accessibility/calendar.png
new file mode 100644
index 0000000..ca5c44f
--- /dev/null
+++ b/docs/html/guide/topics/ui/accessibility/calendar.png
Binary files differ
diff --git a/docs/html/guide/topics/ui/accessibility/checklist.jd b/docs/html/guide/topics/ui/accessibility/checklist.jd
new file mode 100644
index 0000000..9473d1b
--- /dev/null
+++ b/docs/html/guide/topics/ui/accessibility/checklist.jd
@@ -0,0 +1,173 @@
+page.title=Accessibility Developer Checklist
+parent.title=Accessibility
+parent.link=index.html
+@jd:body
+
+<div id="qv-wrapper">
+<div id="qv">
+
+  <h2>In this document</h2>
+  <ol>
+    <li><a href="#requirements">Accessibility Requirements</a></li>
+    <li><a href="#recommendations">Accessibility Recommendations</a></li>
+    <li><a href="#special-cases">Special Cases and Considerations</a></li>
+  </ol>
+
+  <h2>See also</h2>
+  <ol>
+    <li><a href="{@docRoot}design/patterns/accessibility.html">Android Design: Accessibility</a></li>
+    <li><a href="{@docRoot}tools/testing/testing_accessibility.html">Accessibility Testing Checklist</a></li>
+    <li><a href="{@docRoot}training/accessibility/index.html">Training: Implementing Accessibility</a></li>
+    <li><a href="{@docRoot}training/design-navigation/index.html">Designing Effective Navigation</a></li>
+  </ol>
+
+</div>
+</div>
+
+<p>Making an application accessible is about a deep commitment to usability, getting the
+details right and delighting your users. This document provides a checklist of accessibility
+requirements, recommendations and considerations to help you make sure your application is
+accessible. Following this checklist does not guarantee your application is accessible, but it's a
+good place to start.</p>
+
+<p>Creating an accessible application is not just the responsibility of developers. Involve your
+design and testing folks as well, and make them are aware of the guidelines for these other stages
+of development:</p>
+
+<ul>
+  <li><a href="{@docRoot}design/patterns/accessibility.html">Android Design: Accessibility</a></li>
+  <li><a href="{@docRoot}tools/testing/testing_accessibility.html">Accessibility Testing
+    Checklist</a></li>
+</ul>
+
+<p>In most cases, creating an accessible Android application does not require extensive code
+restructuring. Rather, it means working through the subtle details of how users interact with your
+application, so you can provide them with feedback they can sense and understand. This checklist
+helps you focus on the key development issues to get the details of accessibility right.</p>
+
+
+<h2 id="requirements">Accessibility Requirements</h2>
+
+<p>The following steps must be completed in order to ensure a minimum level of application
+  accessibility.</p>
+
+<ol>
+  <li><strong>Describe user interface controls:</strong> Provide content
+    <a href="{@docRoot}guide/topics/ui/accessibility/apps.html#label-ui">descriptions</a> for user
+    interface components that do not have visible text, particularly
+    {@link android.widget.ImageButton}, {@link android.widget.ImageView}
+    and {@link android.widget.CheckBox} components. Use the
+    <a href="{@docRoot}reference/android/view/View.html#attr_android:contentDescription">
+    {@code android:contentDescription}</a> XML layout attribute or the {@link
+    android.view.View#setContentDescription} method to provide this information for accessibility
+    services. (Exception: <a href="#decorative">decorative graphics</a>)</li>
+  <li><strong>Enable focus-based navigation:</strong> Make sure
+    <a href="{@docRoot}guide/topics/ui/accessibility/apps.html#focus-nav">users can navigate</a>
+    your screen layouts using hardware-based or software directional controls (D-pads, trackballs,
+    keyboards and navigation gestures). In a few cases, you may need to make user interface components
+    <a href="{@docRoot}reference/android/view/View.html#attr_android:focusable">focusable</a>
+    or change the <a href="{@docRoot}guide/topics/ui/accessibility/apps.html#focus-order">focus
+    order</a> to be more logical for user actions.</li>
+  <li><strong>Custom view controls:</strong> If you build
+    <a href="{@docRoot}guide/topics/ui/custom-components.html">custom interface controls</a> for
+    your application, <a href="{@docRoot}guide/topics/ui/accessibility/apps.html#custom-views">
+    implement accessibility interfaces</a> for your custom views and provide content descriptions.
+    For custom controls that are intended to be compatible with versions of Android back to 1.6,
+    use the <a href="{@docRoot}tools/extras/support-library.html">Support Library</a> to implement
+    the latest accessibility features.</li>
+  <li><strong>No audio-only feedback:</strong> Audio feedback must always have a secondary
+    feedback mechanism to support users who are deaf or hard of hearing. For example, a sound alert
+    for the arrival of a message must be accompanied by a system
+    {@link android.app.Notification}, haptic feedback (if available) or other visual alert.</li>
+  <li><strong>Test:</strong> Test accessibility by navigating your application
+    using directional controls, and using eyes-free navigation with TalkBack enabled.
+    For more accessibility testing information, see the
+    <a href="{@docRoot}tools/testing/testing_accessibility.html">Accessibility Testing
+    Checklist</a>.</li>
+</ol>
+
+
+<h2 id="recommendations">Accessibility Recommendations</h2>
+
+<p>The following steps are recommended for ensuring the accessibility of your application. If you
+  do not take these actions, it may impact the overall accessibility and quality of your
+  application.</p>
+
+<ol>
+  <li><strong>Android Design Accessibility Guidelines:</strong> Before building your layouts,
+    review and follow the accessibility guidelines provided in the
+    <a href="{@docRoot}design/patterns/accessibility.html">Design guidelines</a>.</li>
+  <li><strong>Framework-provided controls:</strong> Use Android's built-in user interface
+    controls whenever possible, as these components provide accessibility support by default.</li>
+  <li><strong>Temporary or self-hiding controls and notifications:</strong> Avoid having user
+    interface controls that fade out or disappear after a certain amount of time. If this behavior
+    is important to your application, provide an alternative interface for these functions.</li>
+</ol>
+
+
+<h2 id="special-cases">Special Cases and Considerations</h2>
+
+<p>The following list describes specific situations where action should be taken to ensure an
+  accessible app. Review this list to see if any of these special cases and considerations apply to
+  your application, and take the appropriate action.</p>
+
+<ol>
+  <li><strong>Text field hints:</strong> For {@link android.widget.EditText} fields, provide an
+    <a href="{@docRoot}reference/android/widget/TextView.html#attr_android:hint">android:hint</a>
+    attribute <em>instead</em> of a content description, to help users understand what content is
+    expected when the text field is empty and allow the contents of the field to be spoken when
+    it is filled.</li>
+  <li><strong>Custom controls with high visual context:</strong> If your application contains a
+    <a href="{@docRoot}guide/topics/ui/custom-components.html">custom control</a> with a high degree
+    of visual context (such as a calendar control), default accessibility services processing may
+    not provide adequate descriptions for users, and you should consider providing a
+    <a href="{@docRoot}guide/topics/ui/accessibility/apps.html#virtual-hierarchy">virtual
+    view hierarchy</a> for your control using
+    {@link android.view.accessibility.AccessibilityNodeProvider}.</li>
+  <li><strong>Custom controls and click handling:</strong> If a custom control in your
+    application performs specific handling of user touch interaction, such as listening with
+    {@link android.view.View#onTouchEvent} for {@link android.view.MotionEvent#ACTION_DOWN
+    MotionEvent.ACTION_DOWN} and {@link android.view.MotionEvent#ACTION_UP MotionEvent.ACTION_UP}
+    and treating it as a click event, you must trigger an {@link
+    android.view.accessibility.AccessibilityEvent} equivalent to a click and provide a way for
+    accessibility services to perform this action for users. For more information, see
+    <a href="{@docRoot}guide/topics/ui/accessibility/apps.html#custom-touch-events">Handling custom
+    touch events</a>.</li>
+  <li><strong>Controls that change function:</strong> If you have buttons or other controls
+    that change function during the normal activity of a user in your application (for example, a
+    button that changes from <strong>Play</strong> to <strong>Pause</strong>), make sure you also
+    change the <a href="{@docRoot}reference/android/view/View.html#attr_android:contentDescription">
+    {@code android:contentDescription}</a> of the button appropriately.</li>
+  <li><strong>Prompts for related controls:</strong> Make sure sets of controls which provide a
+    single function, such as the {@link android.widget.DatePicker}, provide useful audio feedback
+    when an user interacts with the individual controls.</li>
+  <li><strong>Video playback and captioning:</strong> If your application provides video
+    playback, it must support captioning and subtitles to assist users who are deaf or hard of
+    hearing. Your video playback controls must also clearly indicate if captioning is available for
+    a video and provide a clear way of enabling captions.</li>
+  <li><strong>Supplemental accessibility audio feedback:</strong> Use only the Android accessibility
+    framework to provide accessibility audio feedback for your app. Accessibility services such as
+    <a href="https://play.google.com/store/apps/details?id=com.google.android.marvin.talkback"
+    >TalkBack</a> should be the only way your application provides accessibility audio prompts to
+    users. Provide the prompting information with a
+    <a href="{@docRoot}reference/android/view/View.html#attr_android:contentDescription">{@code
+    android:contentDescription}</a> XML layout attribute or dynamically add it using accessibility
+    framework APIs. For example, if your application takes action that you want to announce to a
+    user, such as automatically turning the page of a book, use the {@link
+    android.view.View#announceForAccessibility} method to have accessibility services speak this
+    information to the user.</li>
+  <li><strong>Custom controls with complex visual interactions:</strong> For custom controls that
+    provide complex or non-standard visual interactions, provide a
+    <a href="{@docRoot}guide/topics/ui/accessibility/apps.html#virtual-hierarchy">virtual view
+    hierarchy</a> for your control using {@link android.view.accessibility.AccessibilityNodeProvider}
+    that allows accessibility services to provide a simplified interaction model for the user. If
+    this approach is not feasible, consider providing an alternate view that is accessible.</li>
+  <li><strong>Sets of small controls:</strong> If you have controls that are smaller than
+    the minimum recommended touch size in your application screens, consider grouping these controls
+    together using a {@link android.view.ViewGroup} and providing a
+    <a href="{@docRoot}reference/android/view/View.html#attr_android:contentDescription">{@code
+    android:contentDescription}</a> for the group.</li>
+  <li id="decorative"><strong>Decorative images and graphics:</strong> Elements in application
+    screens that are purely decorative and do not provide any content or enable a user action should
+    not have accessibility content descriptions.</li>
+</ol>
diff --git a/docs/html/guide/topics/ui/accessibility/index.jd b/docs/html/guide/topics/ui/accessibility/index.jd
index 6fd71e2..6cdbde4 100644
--- a/docs/html/guide/topics/ui/accessibility/index.jd
+++ b/docs/html/guide/topics/ui/accessibility/index.jd
@@ -8,47 +8,67 @@
 
   <h2>Topics</h2>
   <ol>
-  <li><a href="{@docRoot}guide/topics/ui/accessibility/apps.html">Making Applications Accessible</a>
-    </li>
-  <li><a href="{@docRoot}guide/topics/ui/accessibility/services.html">Building Accessibility
-    Services</a></li>
+  <li><a href="apps.html">
+    Making Applications Accessible</a></li>
+  <li><a href="checklist.html">
+    Accessibility Developer Checklist</a></li>
+  <li><a href="services.html">
+    Building Accessibility Services</a></li>
   </ol>
 
-  <h2>Key classes</h2>
-  <ol>
-    <li>{@link android.view.accessibility.AccessibilityEvent}</li>
-    <li>{@link android.accessibilityservice.AccessibilityService}</li>
-  </ol>
-  
   <h2>See also</h2>
   <ol>
-    <li><a href="{@docRoot}training/accessibility/index.html">Implementing Accessibility</a></li>
+    <li><a href="{@docRoot}design/patterns/accessibility.html">Android Design: Accessibility</a></li>
+    <li><a href="{@docRoot}training/accessibility/index.html">Training: Implementing Accessibility</a></li>
+    <li><a href="{@docRoot}tools/testing/testing_accessibility.html">Accessibility Testing Checklist</a></li>
+  </ol>
+
+  <h2>Related Videos</h2>
+  <ol>
+    <li>
+      <iframe title="Google I/O 2012 - Making Android Apps Accessible"
+          width="210" height="160"
+          src="http://www.youtube.com/embed/q3HliaMjL38?rel=0&amp;hd=1"
+          frameborder="0" allowfullscreen>
+      </iframe>
+    <li>
   </ol>
 
 </div>
 </div>
 
-<p>Many Android users have disabilities that require them to interact with their Android devices in
-different ways. These include users who have visual, physical or age-related disabilities that
-prevent them from fully seeing or using a touchscreen.</p>
+<p>Many Android users have different abilities that require them to interact with their Android
+devices in different ways. These include users who have visual, physical or age-related limitations
+that prevent them from fully seeing or using a touchscreen, and users with hearing loss who may not
+be able to perceive audible information and alerts.</p>
 
 <p>Android provides accessibility features and services for helping these users navigate their
-devices more easily, including text-to-speech, haptic feedback, trackball and D-pad navigation that
-augment their experience. Android application developers can take advantage of these services to
-make their applications more accessible and also build their own accessibility services.</p>
+devices more easily, including text-to-speech, haptic feedback, gesture navigation, trackball and
+directional-pad navigation. Android application developers can take advantage of these services to
+make their applications more accessible.</p>
+
+<p>Android developers can also build their own accessibility services, which can provide
+enhanced usability features such as audio prompting, physical feedback, and alternative navigation
+modes. Accessibility services can provide these enhancements for all applications, a set of
+applications or just a single app.</p>
 
 <p>The following topics show you how to use the Android framework to make applications more
 accessible.</p>
 
 <dl>
-  <dt><strong><a href="{@docRoot}guide/topics/ui/accessibility/apps.html">Making Applications
-Accessible</a></strong>
+  <dt><strong><a href="{@docRoot}guide/topics/ui/accessibility/apps.html">
+  Making Applications Accessible</a></strong>
   </dt>
   <dd>Development practices and API features to ensure your application is accessible to users with
 disabilities.</dd>
 
-  <dt><strong><a href="{@docRoot}guide/topics/ui/accessibility/services.html">Building Accessibility
-Services</a></strong>
+  <dt><strong><a href="{@docRoot}guide/topics/ui/accessibility/checklist.html">
+  Accessibility Developer Checklist</a></strong>
+  </dt>
+  <dd>A checklist to help developers ensure that their applications are accessible.</dd>
+
+  <dt><strong><a href="{@docRoot}guide/topics/ui/accessibility/services.html">
+  Building Accessibility Services</a></strong>
   </dt>
   <dd>How to use API features to build services that make other applications more accessible for
 users.</dd>
diff --git a/docs/html/guide/topics/ui/accessibility/services.jd b/docs/html/guide/topics/ui/accessibility/services.jd
index 7d36181..2a6fe7a 100644
--- a/docs/html/guide/topics/ui/accessibility/services.jd
+++ b/docs/html/guide/topics/ui/accessibility/services.jd
@@ -14,8 +14,16 @@
         <li><a href="#service-config">Accessibility service configuration</a></li>
       </ol>
     </li>
+    <li><a href="#register">Registering for Accessibility Events</a></li>
     <li><a href="#methods">AccessibilityService Methods</a></li>
     <li><a href="#event-details">Getting Event Details</a></li>
+    <li><a href="#act-for-users">Taking Action for Users</a>
+      <ol>
+        <li><a href="#detect-gestures">Listening for gestures</a></li>
+        <li><a href="#using-actions">Using accessibility actions</a></li>
+        <li><a href="#focus-types">Using focus types</a></li>
+      </ol>
+    </li>
     <li><a href="#examples">Example Code</a></li>
   </ol>
 
@@ -30,7 +38,7 @@
 
   <h2>See also</h2>
   <ol>
-    <li><a href="{@docRoot}training/accessibility/index.html">Implementing Accessibility</a></li>
+    <li><a href="{@docRoot}training/accessibility/index.html">Training: Implementing Accessibility</a></li>
   </ol>
 
 </div>
@@ -45,20 +53,20 @@
 create and distribute their own services. This document explains the basics of building an
 accessibility service.</p>
 
-<p>The ability for you to build and deploy accessibility services was introduced with Android
-1.6 (API Level 4) and received significant improvements with Android 4.0 (API Level 14). The Android
-Support Library was also updated with the release of Android 4.0 to provide support for these
-enhanced accessibility features back to Android 1.6. Developers aiming for widely compatible
-accessibility services are encouraged to use the
-<a href="{@docRoot}tools/extras/support-library.html">Support Library</a> and develop for the more
-advanced accessibility features introduced in Android 4.0.</p>
+<p>The ability for you to build and deploy accessibility services was introduced with Android 1.6
+  (API Level 4) and received significant improvements with Android 4.0 (API Level 14). The Android
+  <a href="{@docRoot}tools/extras/support-library.html">Support Library</a> was also updated with
+  the release of Android 4.0 to provide support for these enhanced accessibility features back to
+  Android 1.6. Developers aiming for widely compatible accessibility services are encouraged to use
+  the Support Library and develop for the more advanced accessibility features introduced in
+  Android 4.0.</p>
 
 
 <h2 id="manifest">Manifest Declarations and Permissions</h2>
 
 <p>Applications that provide accessibility services must include specific declarations in their
- application manifests in order to be treated as an accessibility service by an Android system.
- This section explains the required and optional settings for accessibility services.</p>
+ application manifests to be treated as an accessibility service by the Android system. This
+ section explains the required and optional settings for accessibility services.</p>
 
 
 <h3 id="service-declaration">Accessibility service declaration</h3>
@@ -66,7 +74,9 @@
 <p>In order to be treated as an accessibility service, your application must include the
 {@code service} element (rather than the {@code activity} element) within the {@code application}
 element in its manifest. In addition, within the {@code service} element, you must also include an
-accessibility service intent filter, as shown in the following sample:</p>
+accessibility service intent filter. For compatiblity with Android 4.1 and higher, the manifest
+must also request the {@link android.Manifest.permission#BIND_ACCESSIBILITY_SERVICE} permission
+as shown in the following sample:</p>
 
 <pre>
 &lt;application&gt;
@@ -76,6 +86,7 @@
       &lt;action android:name=&quot;android.accessibilityservice.AccessibilityService&quot; /&gt;
     &lt;/intent-filter&gt;
   &lt;/service&gt;
+  &lt;uses-permission android:name="android.permission.BIND_ACCESSIBILITY_SERVICE" /&gt;
 &lt;/application&gt;
 </pre>
 
@@ -123,27 +134,6 @@
 /&gt;
 </pre>
 
-<p>One of the most important functions of the accessibility service configuration parameters is to
-allow you to specify what types of accessibility events your service can handle. Being able to
-specify this information enables accessibility services to cooperate with each other, and allows you
-as a developer the flexibility to handle only specific events types from specific applications. The
-event filtering can include the following criteria:</p>
-
-<ul>
-  <li><strong>Package Names</strong> - Specify the package names of applications whose accessibility
-events you want your service to handle. If this parameter is omitted, your accessibility service is
-considered available to service accessibility events for any application. This parameter can be set
-in the accessibility service configuration files with the {@code android:packageNames} attribute as
-a comma-separated list, or set using the {@link
-android.accessibilityservice.AccessibilityServiceInfo#packageNames
-AccessibilityServiceInfo.packageNames} member.</li>
-  <li><strong>Event Types</strong> - Specify the types of accessibility events you want your service
-to handle. This parameter can be set in the accessibility service configuration files with the
-{@code android:accessibilityEventTypes} attribute as a comma-separated list, or set using the
-{@link android.accessibilityservice.AccessibilityServiceInfo#eventTypes
-AccessibilityServiceInfo.eventTypes} member. </li>
-</ul>
-
 <p>For more information about the XML attributes which can be used in the accessibility service
  configuration file, follow these links to the reference documentation:</p>
 
@@ -162,9 +152,45 @@
 the {@link android.accessibilityservice.AccessibilityServiceInfo} reference documentation.</p>
 
 
+<h2 id="register">Registering for Accessibility Events</h2>
+
+<p>One of the most important functions of the accessibility service configuration parameters is to
+allow you to specify what types of accessibility events your service can handle. Being able to
+specify this information enables accessibility services to cooperate with each other, and allows you
+as a developer the flexibility to handle only specific events types from specific applications. The
+event filtering can include the following criteria:</p>
+
+<ul>
+  <li><strong>Package Names</strong> - Specify the package names of applications whose accessibility
+events you want your service to handle. If this parameter is omitted, your accessibility service is
+considered available to service accessibility events for any application. This parameter can be set
+in the accessibility service configuration files with the {@code android:packageNames} attribute as
+a comma-separated list, or set using the {@link
+android.accessibilityservice.AccessibilityServiceInfo#packageNames
+AccessibilityServiceInfo.packageNames} member.</li>
+  <li><strong>Event Types</strong> - Specify the types of accessibility events you want your service
+to handle. This parameter can be set in the accessibility service configuration files with the
+{@code android:accessibilityEventTypes} attribute as a list separated by the {@code |} character
+(for example {@code accessibilityEventTypes="typeViewClicked|typeViewFocused"}), or set using the
+{@link android.accessibilityservice.AccessibilityServiceInfo#eventTypes
+AccessibilityServiceInfo.eventTypes} member. </li>
+</ul>
+
+<p>When setting up your accessibility service, carefully consider what events your service is able
+to handle and only register for those events. Since users can activate more than one accessibility
+services at a time, your service must not consume events that it is not able to handle. Remember
+that other services may handle those events in order to improve a user's experience.</p>
+
+<p class="note"><strong>Note:</strong> The Android framework dispatches accessibility events to
+more than one accessibility service if the services provide different
+<a href="{@docRoot}reference/android/R.styleable.html#AccessibilityService_accessibilityFeedbackType">
+feedback types</a>. However, if two or more services provide the same feedback type, then only the
+first registered service receives the event.</p>
+
+
 <h2 id="methods">AccessibilityService Methods</h2>
 
-<p>An application that provides accessibility service must extend the {@link
+<p>An accessibility service must extend the {@link
 android.accessibilityservice.AccessibilityService} class and override the following methods from
 that class. These methods are presented in the order in which they are called by the Android system,
 from when the service is started
@@ -188,15 +214,15 @@
 {@link android.view.accessibility.AccessibilityEvent} that matches the event filtering parameters
 specified by your accessibility service. For example, when the user clicks a button or focuses on a
 user interface control in an application for which your accessibility service is providing feedback.
-When this happens, the system calls this method of your service with the associated {@link
-android.view.accessibility.AccessibilityEvent}, which you can then interpret and provide feedback to
-the user. This method may be called many times over the lifecycle of your service.</li>
+When this happens, the system calls this method, passing the associated {@link
+android.view.accessibility.AccessibilityEvent}, which the service can then interpret and use to
+provide feedback to the user. This method may be called many times over the lifecycle of your
+service.</li>
 
   <li>{@link android.accessibilityservice.AccessibilityService#onInterrupt onInterrupt()} -
 (required) This method is called when the system wants to interrupt the feedback your service is
-providing, usually in response to a user taking action, such as moving focus to a different user
-interface control than the one for which you are currently providing feedback. This method may be
-called many times over the lifecycle of your service.</li>
+providing, usually in response to a user action such as moving focus to a different control. This
+method may be called many times over the lifecycle of your service.</li>
 
   <li>{@link android.accessibilityservice.AccessibilityService#onUnbind onUnbind()} - (optional)
 This method is called when the system is about to shutdown the accessibility service. Use this
@@ -206,7 +232,9 @@
 
 <p>These callback methods provide the basic structure for your accessibility service. It is up to
 you to decide on how to process data provided by the Android system in the form of {@link
-android.view.accessibility.AccessibilityEvent} objects and provide feedback to the user.</p>
+android.view.accessibility.AccessibilityEvent} objects and provide feedback to the user. For more
+information about getting information from an accessibility event, see the
+<a href="{@docRoot}training/accessibility/service.html">Implementing Accessibility</a> training.</p>
 
 
 <h2 id="event-details">Getting Event Details</h2>
@@ -214,15 +242,15 @@
 <p>The Android system provides information to accessibility services about the user interface
 interaction through {@link android.view.accessibility.AccessibilityEvent} objects. Prior to Android
 4.0, the information available in an accessibility event, while providing a significant amount of
-detail about a user interface control selected by the user, typically provided limited contextual
+detail about a user interface control selected by the user, offered limited contextual
 information. In many cases, this missing context information might be critical to understanding the
 meaning of the selected control.</p>
 
-<p>A typical example of an interface where context is of critical importance is a calendar or day
-planner. If a user selects a 4:00 PM time slot in a Monday to Friday day list and the accessibility
-service announces “4 PM”, but fails to indicate this is a Friday a Monday, the month or day, this is
-hardly ideal feedback for the user. In this case, the context of a user interface control is of
-critical importance to a user who wants to schedule a meeting.</p>
+<p>An example of an interface where context is critical is a calendar or day planner. If the
+user selects a 4:00 PM time slot in a Monday to Friday day list and the accessibility service
+announces “4 PM”, but does not announce the weekday name, the day of the month, or the month name,
+the resulting feedback is confusing. In this case, the context of a user interface control is
+critical to a user who wants to schedule a meeting.</p>
 
 <p>Android 4.0 significantly extends the amount of information that an accessibility service can
 obtain about an user interface interaction by composing accessibility events based on the view
@@ -245,26 +273,167 @@
 AccessibilityEvent.getRecordCount()} and {@link
 android.view.accessibility.AccessibilityEvent#getRecord getRecord(int)} - These methods allow you to
 retrieve the set of {@link android.view.accessibility.AccessibilityRecord} objects which contributed
-to the {@link android.view.accessibility.AccessibilityEvent} passed to you by the system, which can
-provide more context for your accessibility service.</li>
+to the {@link android.view.accessibility.AccessibilityEvent} passed to you by the system. This level
+of detail provides more context for the event that triggered your accessibility service.</li>
 
   <li>{@link android.view.accessibility.AccessibilityEvent#getSource
 AccessibilityEvent.getSource()} - This method returns an {@link
-android.view.accessibility.AccessibilityNodeInfo} object. This object allows you to request the
-parents and children of the component that originated the accessibility event and investigate their
-contents and state in order to provide
+android.view.accessibility.AccessibilityNodeInfo} object. This object allows you to request view
+layout hierarchy (parents and children) of the component that originated the accessibility event.
+This feature allows an accessibility service to investigate the full context of an event, including
+the content and state of any enclosing views or child views.
 
-    <p class="caution"><strong>Important:</strong> The ability to investigate the full view
+<p class="caution"><strong>Important:</strong> The ability to investigate the view
 hierarchy from an {@link android.view.accessibility.AccessibilityEvent} potentially exposes private
 user information to your accessibility service. For this reason, your service must request this
 level of access through the accessibility <a href="#service-config">service configuration XML</a>
 file, by including the {@code canRetrieveWindowContent} attribute and setting it to {@code true}. If
 you do not include this setting in your service configuration xml file, calls to {@link
 android.view.accessibility.AccessibilityEvent#getSource getSource()} fail.</p>
+
+<p class="note"><strong>Note:</strong> In Android 4.1 (API Level 16) and higher, the
+{@link android.view.accessibility.AccessibilityEvent#getSource getSource()} method,
+as well as {@link android.view.accessibility.AccessibilityNodeInfo#getChild
+AccessibilityNodeInfo.getChild()} and
+{@link android.view.accessibility.AccessibilityNodeInfo#getParent getParent()}, return only
+view objects that are considered important for accessibility (views that draw content or respond to
+user actions). If your service requires all views, it can request them by setting the
+{@link android.accessibilityservice.AccessibilityServiceInfo#flags flags} member of the service's
+{@link android.accessibilityservice.AccessibilityServiceInfo} instance to
+{@link android.accessibilityservice.AccessibilityServiceInfo#FLAG_INCLUDE_NOT_IMPORTANT_VIEWS}.</p>
   </li>
 </ul>
 
 
+<h2 id="act-for-users">Taking Action for Users</h2>
+
+<p>Starting with Android 4.0 (API Level 14), accessibility services can act on behalf
+  of users, including changing the input focus and selecting (activating) user interface elements.
+  In Android 4.1 (API Level 16) the range of actions has been expanded to include scrolling lists
+  and interacting with text fields. Accessibility services can
+  also take global actions, such as navigating to the Home screen, pressing the Back button, opening
+  the notifications screen and recent applications list. Android 4.1 also includes a new type of
+  focus, <em>Accessibilty Focus</em>, which makes all visible elements selectable by an
+  accessibility service.</p>
+
+<p>These new capabilities make it possible for developers of accessibility services to create
+  alternative navigation modes such as
+  <a href="{@docRoot}tools/testing/testing_accessibility.html#test-gestures">gesture navigation</a>,
+  and give users with disabilities improved control of their Android devices.</p>
+
+
+<h3 id="detect-gestures">Listening for gestures</h3>
+
+<p>Accessibility services can listen for specific gestures and respond by taking action on behalf
+  of a user. This feature, added in Android 4.1 (API Level 16), and requires that your
+  accessibility service request activation of the Explore by Touch feature. Your service can
+  request this activation by setting the
+  {@link android.accessibilityservice.AccessibilityServiceInfo#flags flags} member of the service’s
+  {@link android.accessibilityservice.AccessibilityServiceInfo} instance to
+  {@link android.accessibilityservice.AccessibilityServiceInfo#FLAG_REQUEST_TOUCH_EXPLORATION_MODE},
+  as shown in the following example.
+  </p>
+
+<pre>
+public class MyAccessibilityService extends AccessibilityService {
+    &#64;Override
+    public void onCreate() {
+        getServiceInfo().flags = AccessibilityServiceInfo.FLAG_REQUEST_TOUCH_EXPLORATION_MODE;
+    }
+    ...
+}
+</pre>
+
+<p>Once your service has requested activation of Explore by Touch, the user must allow the
+  feature to be turned on, if it is not already active. When this feature is active, your service
+  receives notification of accessibility gestures through your service's
+  {@link android.accessibilityservice.AccessibilityService#onGesture onGesture()} callback method
+  and can respond by taking actions for the user.</p>
+
+
+<h3 id="using-actions">Using accessibility actions</h3>
+
+<p>Accessibility services can take action on behalf of users to make interacting with applications
+  simpler and more productive. The ability of accessibility services to perform actions was added
+  in Android 4.0 (API Level 14) and significantly expanded with Android 4.1 (API Level 16).</p>
+
+<p>In order to take actions on behalf of users, your accessibility service must
+  <a href="#register">register</a> to receive events from a few or many applications and request
+  permission to view the content of applications by setting the
+  <a href="{@docRoot}reference/android/R.styleable.html#AccessibilityService_canRetrieveWindowContent">
+  {@code android:canRetrieveWindowContent}</a> to {@code true} in the
+  <a href="#service-config">service configuration file</a>. When events are received by your
+  service, it can then retrieve the
+  {@link android.view.accessibility.AccessibilityNodeInfo} object from the event using
+  {@link android.view.accessibility.AccessibilityEvent#getSource getSource()}.
+  With the {@link android.view.accessibility.AccessibilityNodeInfo} object, your service can then
+  explore the view hierarchy to determine what action to take and then act for the user using
+  {@link android.view.accessibility.AccessibilityNodeInfo#performAction performAction()}.</p>
+
+<pre>
+public class MyAccessibilityService extends AccessibilityService {
+
+    &#64;Override
+    public void onAccessibilityEvent(AccessibilityEvent event) {
+        // get the source node of the event
+        AccessibilityNodeInfo nodeInfo = event.getSource();
+
+        // Use the event and node information to determine
+        // what action to take
+
+        // take action on behalf of the user
+        nodeInfo.performAction(AccessibilityNodeInfo.ACTION_SCROLL_FORWARD);
+
+        // recycle the nodeInfo object
+        nodeInfo.recycle();
+    }
+    ...
+}
+</pre>
+
+<p>The {@link android.view.accessibility.AccessibilityNodeInfo#performAction performAction()} method
+  allows your service to take action within an application. If your service needs to perform a
+  global action such as navigating to the Home screen, pressing the Back button, opening the
+  notifications screen or recent applications list, then use the
+  {@link android.accessibilityservice.AccessibilityService#performGlobalAction performGlobalAction()}
+  method.</p>
+
+
+<h3 id="focus-types">Using focus types</h3>
+
+<p>Android 4.1 (API Level 16) introduces a new type of user interface focus called <em>Accessibility
+  Focus</em>. This type of focus can be used by accessibility services to select any visible user
+  interface element and act on it. This focus type is different from the more well known <em>Input
+  Focus</em>, which determines what on-screen user interface element receives input when a user
+  types characters, presses <strong>Enter</strong> on a keyboard or pushes the center button of a
+  D-pad control.</p>
+
+<p>Accessibility Focus is completely separate and independent from Input Focus. In fact, it is
+  possible for one element in a user interface to have Input Focus while another element has
+  Accessibility Focus. The purpose of Accessibility Focus is to provide accessibility services with
+  a method of interacting with any visible element on a screen, regardless of whether or not the
+  element is input-focusable from a system perspective. You can see accessibility focus in action by
+  testing accessibility gestures. For more information about testing this feature, see
+  <a href="{@docRoot}tools/testing/testing_accessibility.html#test-gestures">Testing gesture
+  navigation</a>.</p>
+
+<p class="note">
+  <strong>Note:</strong> Accessibility services that use Accessibility Focus are responsible for
+  synchronizing the current Input Focus when an element is capable of this type of focus. Services
+  that do not synchronize Input Focus with Accessibility Focus run the risk of causing problems in
+  applications that expect input focus to be in a specific location when certain actions are taken.
+  </p>
+
+<p>An accessibility service can determine what user interface element has Input Focus or
+  Accessibility Focus using the {@link android.view.accessibility.AccessibilityNodeInfo#findFocus
+  AccessibilityNodeInfo.findFocus()} method. You can also search for elements that can be selected
+  with Input Focus using the
+  {@link android.view.accessibility.AccessibilityNodeInfo#focusSearch focusSearch()} method.
+  Finally, your accessibility service can set Accessibility Focus using the
+  {@link android.view.accessibility.AccessibilityNodeInfo#performAction
+  performAction(AccessibilityNodeInfo.ACTION_SET_ACCESSIBILITY_FOCUS)} method.</p>
+
+
 <h2 id="examples">Example Code</h2>
 
 <p>The API Demo project contains two samples which can be used as a starting point for generating
diff --git a/docs/html/guide/topics/ui/controls/radiobutton.jd b/docs/html/guide/topics/ui/controls/radiobutton.jd
index f6f6d49..c96e576 100644
--- a/docs/html/guide/topics/ui/controls/radiobutton.jd
+++ b/docs/html/guide/topics/ui/controls/radiobutton.jd
@@ -72,7 +72,7 @@
 <pre>
 public void onRadioButtonClicked(View view) {
     // Is the button now checked?
-    boolean checked = (RadioButton) view).isChecked();
+    boolean checked = ((RadioButton) view).isChecked();
     
     // Check which radio button was clicked
     switch(view.getId()) {
diff --git a/docs/html/guide/topics/ui/declaring-layout.jd b/docs/html/guide/topics/ui/declaring-layout.jd
index e971a75..e229f23 100644
--- a/docs/html/guide/topics/ui/declaring-layout.jd
+++ b/docs/html/guide/topics/ui/declaring-layout.jd
@@ -32,12 +32,17 @@
     <li>{@link android.view.ViewGroup}</li>
     <li>{@link android.view.ViewGroup.LayoutParams}</li>
   </ol>
-</div>
+  
+  <h2>See also</h2>
+  <ol>
+    <li><a href="{@docRoot}training/basics/firstapp/building-ui.html">Building a Simple User
+Interface</a></li> </div>
 </div>
 
-<p>Your layout is the architecture for the user interface in an Activity.
-It defines the layout structure and holds all the elements that appear to the user. 
-You can declare your layout in two ways:</p>
+<p>A layout defines the visual structure for a user interface, such as the UI for an <a
+href="{@docRoot}guide/components/activities.html">activity</a> or <a
+href="{@docRoot}guide/topics/appwidgets/index.html">app widget</a>.
+You can declare a layout in two ways:</p>
 <ul>
 <li><strong>Declare UI elements in XML</strong>. Android provides a straightforward XML 
 vocabulary that corresponds to the View classes and subclasses, such as those for widgets and layouts.</li>
@@ -77,16 +82,6 @@
 
 <h2 id="write">Write the XML</h2>
 
-<div class="sidebox-wrapper">
-<div class="sidebox">
-<p>For your convenience, the API reference documentation for UI related classes
-lists the available XML attributes that correspond to the class methods, including inherited
-attributes.</p>
-<p>To learn more about the available XML elements and attributes, as well as the format of the XML file, see <a
-href="{@docRoot}guide/topics/resources/available-resources.html#layoutresources">Layout Resources</a>.</p>
-</div>
-</div>
-
 <p>Using Android's XML vocabulary, you can quickly design UI layouts and the screen elements they contain, in the same way you create web pages in HTML &mdash; with a series of nested elements. </p>
 
 <p>Each layout file must contain exactly one root element, which must be a View or ViewGroup object. Once you've defined the root element, you can add additional layout objects or widgets as child elements to gradually build a View hierarchy that defines your layout. For example, here's an XML layout that uses a vertical {@link android.widget.LinearLayout}
@@ -111,7 +106,8 @@
 <p>After you've declared your layout in XML, save the file with the <code>.xml</code> extension, 
 in your Android project's <code>res/layout/</code> directory, so it will properly compile. </p>
 
-<p>We'll discuss each of the attributes shown here a little later.</p>
+<p>More information about the syntax for a layout XML file is available in the <a
+href="{@docRoot}guide/topics/resources/layout-resource.html">Layout Resources</a> document.</p>
 
 <h2 id="load">Load the XML Resource</h2>
 
diff --git a/docs/html/guide/topics/ui/layout/gridview.jd b/docs/html/guide/topics/ui/layout/gridview.jd
index 11c5474..67bdd0f0 100644
--- a/docs/html/guide/topics/ui/layout/gridview.jd
+++ b/docs/html/guide/topics/ui/layout/gridview.jd
@@ -22,10 +22,15 @@
 scrollable grid. The grid items are automatically inserted to the layout using a {@link
 android.widget.ListAdapter}.</p>
 
+<p>For an introduction to how you can dynamically insert views using an adapter, read
+<a href="{@docRoot}guide/topics/ui/declaring-layout.html#AdapterViews">Building Layouts with
+  an Adapter</a>.</p>
+
 <img src="{@docRoot}images/ui/gridview.png" alt="" />
 
 
 <h2 id="example">Example</h2>
+
 <p>In this tutorial, you'll create a grid of image thumbnails. When an item is selected, a
 toast message will display the position of the image.</p>
 
diff --git a/docs/html/guide/topics/ui/layout/listview.jd b/docs/html/guide/topics/ui/layout/listview.jd
index 26a7597..fee5292 100644
--- a/docs/html/guide/topics/ui/layout/listview.jd
+++ b/docs/html/guide/topics/ui/layout/listview.jd
@@ -28,6 +28,10 @@
 android.widget.Adapter} that pulls content from a source such as an array or database query and
 converts each item result into a view that's placed into the list.</p>
 
+<p>For an introduction to how you can dynamically insert views using an adapter, read
+<a href="{@docRoot}guide/topics/ui/declaring-layout.html#AdapterViews">Building Layouts with
+  an Adapter</a>.</p>
+
 <img src="{@docRoot}images/ui/listview.png" alt="" />
 
 <h2 id="Loader">Using a Loader</h2>
@@ -147,5 +151,5 @@
 Provider</a>, if you want to
 try this code, your app must request the {@link android.Manifest.permission#READ_CONTACTS}
 permission in the manifest file:<br/>
-<code>&lt;uses-permission android:name="android.permission.READ_CONTACTS" /></p>
+<code>&lt;uses-permission android:name="android.permission.READ_CONTACTS" /></code></p>
 
diff --git a/docs/html/guide/topics/ui/settings.jd b/docs/html/guide/topics/ui/settings.jd
index fd3b684..33e164b 100644
--- a/docs/html/guide/topics/ui/settings.jd
+++ b/docs/html/guide/topics/ui/settings.jd
@@ -217,7 +217,7 @@
         android:dialogTitle="@string/pref_syncConnectionType"
         android:entries="@array/pref_syncConnectionTypes_entries"
         android:entryValues="@array/pref_syncConnectionTypes_values"
-        android:defaultValue="@string/pref_syncConnectionTypes_default" >
+        android:defaultValue="@string/pref_syncConnectionTypes_default" />
 &lt;/PreferenceScreen>
 </pre>
 
diff --git a/docs/html/intl/ja/index.jd b/docs/html/intl/ja/index.jd
deleted file mode 100644
index ac36f90..0000000
--- a/docs/html/intl/ja/index.jd
+++ /dev/null
@@ -1,159 +0,0 @@
-home=true
-@jd:body
-
-
-	<div id="mainBodyFixed">
-              <div id="mainBodyLeft">			
-                    <div id="homeMiddle">
-                        <div id="topAnnouncement">
-                            <div id="homeTitle">
-                                <h2>デベロッパーへのお知らせ</h2>
-                            </div><!-- end homeTitle -->
-                            <div id="announcement-block">
-                            <!-- total max width is 520px -->
-                                <img src="/assets/images/home/android_adc.png" alt="Android Developer Challenge 2" width="232px" />
-                                <div id="announcement" style="width:275px">
-                                  <p>第2Android Developer Challengeが、遂に登場しました!このアプリケーション開発コンテストでは、Androidのユーザなら誰でも簡単に参加でき、一等の賞金は$250,000 です。登録の締切日は8月31日になります。</p>
-                                  <p><a href="http://code.google.com/android/adc/">Android  Developer Challengeについて詳しくはこちら &raquo;</a></p>
-                                </div> <!-- end annoucement -->
-                            </div> <!-- end annoucement-block -->  
-                        </div><!-- end topAnnouncement -->
-                        <div id="carouselMain" style="height:210px"> <!-- this height can be adjusted based on the content height -->
-                        </div>
-                            <div class="clearer"></div>
-                        <div id="carouselWheel">
-                            <div class="app-list-container" align="center"> 
-                                <a href="javascript:{}" id="arrow-left" onclick="" class="arrow-left-off"></a>
-                                <div id="list-clip">
-                                    <div style="left: 0px;" id="app-list">
-                                      <!-- populated by buildCarousel() -->
-                                    </div>
-                                </div><!-- end list-clip -->
-                                <a href="javascript:{ page_right(); }" id="arrow-right" onclick="" class="arrow-right-on"></a>
-                                <div class="clearer"></div>
-                            </div><!-- end app-list container -->
-                        </div><!-- end carouselWheel -->
-                    </div><!-- end homeMiddle -->
-
-                    <div style="clear:both">&nbsp;</div>
-              </div><!-- end mainBodyLeft -->
-
-              <div id="mainBodyRight">
-                      <table id="rightColumn">
-                              <tr>
-                                      <td class="imageCell"><a href="{@docRoot}sdk/index.html"><img src="{@docRoot}assets/images/icon_download.jpg" style="padding:0" /></a></td>
-                                      <td>
-                                              <h2 class="green">ダウンロード</h2>
-                                              <p>Android SDK には、優れたアプリケーションの作成に必要となるツール、サンプル コード、ドキュメントが含まれています。  </p>
-                                              <p><a href="{@docRoot}sdk/index.html">詳細 &raquo;</a></p>
-                                      </td>
-                              </tr>
-                              <tr>
-                                      <td colspan="2"><div class="seperator">&nbsp;</div></td>
-                              </tr>
-                              <tr>
-                                      <td class="imageCell"><a href="http://play.google.com/apps/publish"><img src="{@docRoot}assets/images/icon_play.png" style="padding:0" /></a></td>
-                                      <td>
-                                              <h2 class="green">公開</h2>
-                                              <p>Android マーケットは、アプリケーションを携帯端末に配信するためのオープン サービスです。</p>
-                                              <p><a href="http://play.google.com/apps/publish">詳細 &raquo;</a></p>
-                                      </td>
-                              </tr>
-                              <tr>
-                                      <td colspan="2"><div class="seperator">&nbsp;</div></td>
-                              </tr>
-                              <tr>
-                                      <td class="imageCell"><a href="http://source.android.com"><img src="{@docRoot}assets/images/icon_contribute.jpg" style="padding:0" /></a></td>
-                                      <td>
-                                              <h2 class="green">貢献</h2>
-                                              <p>Android オープンソース プロジェクトでは、プラットフォーム全体のソースコードを公開しています。</p>
-                                              <p><a href="http://source.android.com">詳細 &raquo;</a></p>
-                                      </td>
-                              </tr>
-                              <tr>
-                                      <td colspan="2"><div class="seperator">&nbsp;</div></td>
-                              </tr>
-                              <tr>
-                                      <td class="imageCell"><a href="http://www.youtube.com/user/androiddevelopers"><img src="{@docRoot}assets/images/video-droid.png" style="padding:0" /></a></td>
-                                      <td>
-                                              <h2 class="green">再生</h2>
-                                              <object width="150" height="140"><param name="movie" value="http://www.youtube.com/v/GARMe7Km_gk&hl=en&fs=1"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/GARMe7Km_gk&hl=en&fs=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="150" height="140"></embed></object>
-                                              <p style="margin-top:1em"><a href="{@docRoot}videos/index.html">その他の Android 動画 &raquo;</a></p>
-                                      </td>
-                              </tr>
-
-                      </table>
-              </div>
-	</div>
-
-<!--[if lte IE 6]>
-  <style>
-    #arrow-left {
-      margin:0 0 0 5px;
-    }
-    #arrow-right {
-      margin-left:0;
-    }
-    .app-list-container {
-      margin: 37px 0 0 23px;
-    }
-    div#list-clip { 
-      width:468px;
-    }
-  </style>
-<![endif]-->
-
-<script type="text/javascript">
-
-// * -- carousel dictionary -- * //
-  /* layout:  imgLeft, imgRight, imgTop
-     icon:    image for carousel entry. cropped (height:70px, width:90px)
-     name:    string for carousel entry
-     img:     image for bulletin post. cropped (height: 170, width:230px)
-     title:   header for bulletin (optional, insert "" value to skip
-     desc:    the bulletin post. must include html tags. 
-  */
-
-  var droidList = {
-    'sdk': {
-      'layout':"imgLeft",
-      'icon':"sdk-small.png",
-      'name':"Android 2.0",
-      'img':"eclair-android.png",
-      'title':"Android 2.0",
-      'desc': "<p>Android 2.0 の最新バージョンが公開されました。このリリースには Android 2.0 用の API、最新版デベロッパーツール、複数プラットフォーム(バージョン)サポート、そして Google API のアドオンが含まれています。</p><p><a href='{@docRoot}sdk/index.html'>Android SDK をダウンロード &raquo;</a></p>"
-    },
-    
-    'io': {
-      'layout':"imgLeft",
-      'icon':"io-small.png",
-      'name':"Google I/O",
-      'img':"io-large.png",
-      'title':"Google I/O Developer Conference",
-      'desc': "<p>Google I/O は、サンフランシスコの Moscone Center で 5 月 27~28 日に開催された開発者会議です。このイベントに参加できなかった方は、各アンドロイド向けセッションを、YouTube ビデオ資料で体験する事が可能<nobr>です</nobr>。</p><p><a href='{@docRoot}videos/index.html'>セッションを参照してください &raquo;</a></p>"
-    },
-
-    'mapskey': {
-      'layout':"imgLeft",
-      'icon':"maps-small.png",
-      'name':"Maps API キー",
-      'img':"maps-large.png",
-      'title':"Maps API キー",
-      'desc':"<p>MapView から Google マップを利用する Android アプリケーションを開発する場合は、アプリケーションを登録して Maps API キーを取得する必要があります。この API キーが無いアプリケーションは、Android 上で動作しません。キーの取得は、簡単な手順で行うことができます。</p><p><a href='http://code.google.com/android/add-ons/google-apis/maps-overview.html'>詳細 &raquo;</a></p>"
-    },
-
-    'devphone': {
-      'layout':"imgLeft",
-      'icon':"devphone-small.png",
-      'name':"Dev Phone 1",
-      'img':"devphone-large.png",
-      'title':"Android Dev Phone 1",
-      'desc': "<p>この携帯電話を使用することで、開発した Android アプリケーションの実行とデバッグを行うことができます。Android オペレーティングシステムを変更してからリビルドし、携帯電話に書き込むことができます。Android Dev Phone 1 は携帯通信会社に依存しておらず、<a href='http://play.google.com/apps/publish'>Android マーケット</a>に登録済みのデベロッパーなら誰でも購入可能です。</p><p><a href='/tools/device.html#dev-phone-1'>Android Dev Phone 1 の詳細&raquo;</a></p>"
-    }
-
-  }
-</script>
-<script type="text/javascript" src="{@docRoot}assets/carousel.js"></script>
-<script type="text/javascript">
-  initCarousel("sdk");
-</script>
diff --git a/docs/html/tools/testing/testing_accessibility.jd b/docs/html/tools/testing/testing_accessibility.jd
new file mode 100644
index 0000000..daf9b36
--- /dev/null
+++ b/docs/html/tools/testing/testing_accessibility.jd
@@ -0,0 +1,257 @@
+page.title=Accessibility Testing Checklist
+parent.title=Testing
+parent.link=index.html
+@jd:body
+
+<div id="qv-wrapper">
+  <div id="qv">
+  <h2>In this document</h2>
+  <ol>
+    <li><a href="#goals">Testing Goals</a></li>
+    <li><a href="#requirements">Testing Requirements</a></li>
+    <li><a href="#recommendations">Testing Recommendations</a></li>
+    <li><a href="#special-cases">Special Cases and Considerations</a></li>
+    <li><a href="#how-to">Testing Accessibility Features</a>
+      <ol>
+        <li><a href="#test-audibles">Testing audible feedback</a></li>
+        <li><a href="#test-navigation">Testing focus navigation</a></li>
+        <li><a href="#test-gestures">Testing gesture navigation</a></li>
+      </ol>
+    </li>
+  </ol>
+
+  <h2>See Also</h2>
+    <ol>
+      <li>
+        <a href="{@docRoot}guide/topics/ui/accessibility/checklist.html">
+        Accessibility Developer Checklist</a>
+      </li>
+      <li>
+        <a href="{@docRoot}design/patterns/accessibility.html">
+        Android Design: Accessibility</a>
+      </li>
+      <li>
+        <a href="{@docRoot}guide/topics/ui/accessibility/apps.html">
+        Making Applications Accessible</a>
+      </li>
+    </ol>
+  </div>
+</div>
+<p>
+  Testing is an important part of making your application accessible to users with varying
+  abilities. Following <a href="{@docRoot}design/patterns/accessibility.html">design</a> and
+  <a href="{@docRoot}guide/topics/ui/accessibility/checklist.html">development</a> guidelines for
+  accessibility are important steps toward that goal, but testing for accessibility can uncover
+  problems with user interaction that are not obvious during design and development.</p>
+
+<p>This accessibility testing checklist guides you through the important aspects of
+  accessibility testing, including overall goals, required testing steps, recommended testing and
+  special considerations. This document also discusses how to enable accessibility features on
+  Android devices for testing purposes.</p>
+
+
+<h2 id="goals">Testing Goals</h2>
+
+<p>Your accessibility testing should have the following, high level goals:</p>
+
+<ul>
+  <li>Set up and use the application without sighted assistance</li>
+  <li>All task workflows in the application can be easily navigated using directional controls and
+    provide clear and appropriate feedback</li>
+</ul>
+
+
+<h2 id="requirements">Testing Requirements</h2>
+
+<p>The following tests must be completed in order to ensure a minimum level of application
+  accessibility.</p>
+
+<ol>
+  <li><strong>Directional controls:</strong> Verify that the application can be operated
+    without the use of a touch screen. Attempt to use only directional controls to accomplish the
+    primary tasks in the application. Use the keyboard and directional-pad (D-Pad) controls in the
+    Android <a href="{@docRoot}tools/devices/emulator.html">Emulator</a> or use
+    <a href="http://support.google.com/nexus/bin/answer.py?hl=en&answer=2700718">gesture
+    navigation</a> on devices with Android 4.1 (API Level 16) or higher.
+    <p class="note"><strong>Note:</strong> Keyboards and D-pads provide different navigation paths
+    than accessibility gestures. While gestures allow users to focus on nearly any on-screen
+    content, keyboard and D-pad navigation only allow focus on input fields and buttons.</p>
+    </li>
+  <li><strong>TalkBack audio prompts:</strong> Verify that user interface controls that provide
+    information (graphics or text) or allow user action have clear and accurate audio descriptions
+    when <a href="#testing-talkback">TalkBack is enabled</a> and controls are focused. Use
+    directional controls to move focus between application layout elements.</li>
+  <li><strong>Explore by Touch prompts:</strong> Verify that user interface controls that
+    provide information (graphics or text) or allow user action have appropriate audio descriptions
+    when <a href="#testing-ebt">Explore by Touch is enabled</a>. There should be no
+    regions where contents or controls do not provide an audio description.</li>
+  <li><strong>Touchable control sizes:</strong> All controls where a user can select or take an
+    action must be a minimum of 48 dp (approximately 9mm) in length and width, as recommended by
+    <a href="{@docRoot}design/patterns/accessibility.html">Android Design</a>.</li>
+  <li><strong>Gestures work with TalkBack enabled:</strong> Verify that app-specific gestures,
+    such as zooming images, scrolling lists, swiping between pages or navigating carousel controls
+    continue to work when <a href="#testing-talkback">TalkBack is enabled</a>. If these gestures do
+    not function, then an alternative interface for these actions must be provided.</li>
+  <li><strong>No audio-only feedback:</strong> Audio feedback must always have a secondary
+    feedback mechanism to support users who are deaf or hard of hearing, for example: A sound alert
+    for the arrival of a message should also be accompanied by a system
+    {@link android.app.Notification}, haptic feedback (if available) or another visual alert.</li>
+</ol>
+
+
+<h2 id="recommendations">Testing Recommendations</h2>
+
+<p>The following tests are recommended for ensuring the accessibility of your application. If you
+  do not test these items, it may impact the overall accessibility and quality of your
+  application.</p>
+
+<ol>
+  <li><strong>Repetitive audio prompting:</strong> Check that closely related controls (such as
+    items with multiple components in a list) do not simply repeat the same audio prompt. For
+    example, in a contacts list that contains a contact picture, written name and title, the prompts
+    should not simply repeat “Bob Smith” for each item.</li>
+  <li><strong>Audio prompt overloading or underloading:</strong> Check that closely related
+    controls provide an appropriate level of audio information that enables users to understand and
+    act on a screen element. Too little or too much prompting can make it difficult to understand
+    and use a control.</li>
+</ol>
+
+
+<h2 id="special-cases">Special Cases and Considerations</h2>
+
+<p>The following list describes specific situations that should be tested to ensure an
+  accessible app. Some, none or all of the cases described here may apply to your application. Be
+  sure to review this list to find out if these special cases apply and take appropriate action.</p>
+
+<ol>
+  <li><strong>Review developer special cases and considerations:</strong> Review the list of
+    <a href="{@docRoot}guide/topics/ui/accessibility/checklist.html#special-cases">special cases</a>
+     for accessibility development and test your application for the cases that apply.</li>
+  <li><strong>Prompts for controls that change function:</strong> Buttons or other controls
+    that change function due to application context or workflow must provide audio prompts
+    appropriate to their current function. For example, a button that changes function from play
+    video to pause video should provide an audio prompt which is appropriate to its current state.</li>
+  <li><strong>Video playback and captioning:</strong> If the application provides video
+    playback, verify that it supports captioning and subtitles to assist users who are deaf or hard
+    of hearing. The video playback controls must clearly indicate if captioning is available for a
+    video and provide a clear way of enabling captions.</li>
+</ol>
+
+
+<h2 id="how-to">Testing Accessibility Features</h2>
+
+<p>Testing of accessibility features such as TalkBack, Explore by Touch and accessibility Gestures
+requires setup of your testing device. This section describes how to enable these features for
+accessibility testing.</p>
+
+
+<h3 id="test-audibles">Testing audible feedback</h3>
+
+<p>Audible accessibility feedback features on Android devices provide audio prompts that speaks
+  the screen content as you move around an application. By enabling these features on an Android
+  device, you can test the experience of users with blindness or low-vision using your application.
+</p>
+
+<p>Audible feedback for users on Android is typically provided by TalkBack accessibility service and
+the Explore by Touch system feature. The TalkBack accessibility service comes preinstalled on most
+Android devices and can also be downloaded for free from
+<a href="https://play.google.com/store/apps/details?id=com.google.android.marvin.talkback">Google
+Play</a>. The Explore by Touch system feature is available on devices running Android 4.0 and later.
+</p>
+
+<h4 id="testing-talkback">Testing with TalkBack</h4>
+
+<p>The <em>TalkBack</em> accessibility service works by speaking the contents of user interface
+controls as the user moves focus onto controls. This service should be enabled as part of testing
+focus navigation and audible prompts.</p>
+
+<p>To enable the TalkBack accessibility service:</p>
+<ol>
+  <li>Launch the <strong>Settings</strong> application.</li>
+  <li>Navigate to the <strong>Accessibility</strong> category and select it.</li>
+  <li>Select <strong>Accessibility</strong> to enable it.</li>
+  <li>Select <strong>TalkBack</strong> to enable it.</li>
+</ol>
+
+<p class="note">
+  <strong>Note:</strong> While TalkBack is the most available Android accessibility service for
+  users with disabilities, other accessibility services are available and may be installed by users.
+</p>
+
+<p>For more information about using TalkBack, see
+<a href="http://support.google.com/nexus/bin/answer.py?hl=en&answer=2700928">Use TalkBack</a>.</p>
+
+<h4 id="testing-ebt">Testing with Explore by Touch</h4>
+
+<p>The <em>Explore by Touch</em> system feature is available on devices running Android 4.0 and
+  later, and works by enabling a special accessibility mode that allows users to drag a finger
+  around the interface of an application and hear the contents of the screen spoken. This feature
+  does not require screen elements to be focused using an directional controller, but listens for
+  hover events over user interface controls.
+</p>
+
+<p>To enable Explore by Touch on Android 4.0 and later:</p>
+<ol>
+  <li>Launch the <strong>Settings</strong> application.</li>
+  <li>Navigate to the <strong>Accessibility</strong> category and select it.</li>
+  <li>Select the <strong>TalkBack</strong> to enable it.
+      <p class="note"><strong>Note:</strong> On Android 4.1 (API Level 16) and higher, the system
+      provides a popup message to enable Explore by Touch. On older versions, you must follow the
+      step below.</p>
+  </li>
+  <li>Return to the <strong>Accessibility</strong> category and select <strong>Explore by
+Touch</strong> to enable it.
+    <p class="note"><strong>Note:</strong> You must turn on TalkBack <em>first</em>, otherwise this
+option is not available.</p>
+  </li>
+</ol>
+
+<p>For more information about using the Explore by Touch features, see
+<a href="http://support.google.com/nexus/bin/answer.py?hl=en&answer=2700722">Use Explore by
+Touch</a>.</p>
+
+<h3 id="test-navigation">Testing focus navigation</h3>
+
+<p>Focus navigation is the use of directional controls to navigate between the individual user
+  interface elements of an application in order to operate it. Users with limited vision or limited
+  manual dexterity often use this mode of navigation instead of touch navigation. As part of
+  accessibility testing, you should verify that your application can be operated using only
+  directional controls.</p>
+
+<p>You can test navigation of your application using only focus controls, even if your test devices
+  does not have a directional controller. The <a href="{@docRoot}tools/help/emulator.html">Android
+  Emulator</a> provides a simulated directional controller that you can use to test navigation. You
+  can also use a software-based directional controller, such as the one provided by the
+  <a href="https://play.google.com/store/apps/details?id=com.googlecode.eyesfree.inputmethod.latin"
+  >Eyes-Free Keyboard</a> to simulate use of a D-pad on a test device that does not have a physical
+  D-pad.</p>
+
+
+<h3 id="test-gestures">Testing gesture navigation</h3>
+
+<p>Gesture navigation is an accessibility navigation mode that allows users to navigate Android
+  devices and applications using specific
+  <a href="http://support.google.com/nexus/bin/answer.py?hl=en&answer=2700718">gestures</a>. This
+  navigation mode is available on Android 4.1 (API Level 16) and higher.</p>
+
+<p class="note"><strong>Note:</strong> Accessibility gestures provide a different navigation path
+than keyboards and D-pads. While gestures allow users to focus on nearly any on-screen
+content, keyboard and D-pad navigation only allow focus on input fields and buttons.</p>
+
+<p>To enable gesture navigation on Android 4.1 and later:</p>
+<ul>
+  <li>Enable both TalkBack and the Explore by Touch feature as described in the
+    <a href="#testing-ebt">Testing with Explore by Touch</a>. When <em>both</em> of these
+    features are enabled, accessibility gestures are automatically enabled.</li>
+  <li>You can change gesture settings using <strong>Settings &gt; Accessibility &gt; TalkBack &gt;
+    Settings &gt; Manage shortcut gestures</strong>.
+</ul>
+
+<p>For more information about using Explore by Touch accessibility gestures, see
+<a href="http://support.google.com/android/bin/topic.py?hl=en&topic=2492346">Accessibility
+gestures</a>.</p>
+
+<p class="note">
+  <strong>Note:</strong> Accessibility services other than TalkBack may map accessibility gestures
+  to different user actions. If gestures are not producing the expected actions during testing, try
+  disabling other accessibility services before proceeding.</p>
\ No newline at end of file
diff --git a/docs/html/tools/tools_toc.cs b/docs/html/tools/tools_toc.cs
index 850e0ec..f3936b8 100644
--- a/docs/html/tools/tools_toc.cs
+++ b/docs/html/tools/tools_toc.cs
@@ -5,7 +5,7 @@
         <a href="<?cs var:toroot ?>tools/index.html"><span class="en">Developer Tools</span></a>
     </div>
   </li>
-  
+
   <li class="nav-section">
     <div class="nav-section-header"><a href="<?cs var:toroot
 ?>sdk/index.html"><span class="en">Download</span></a></div>
@@ -29,7 +29,7 @@
       </li>
     </ul>
   </li>
-  
+
   <li class="nav-section">
     <div class="nav-section-header">
         <a href="/tools/workflow/index.html"><span class="en">Workflow</span></a>
@@ -39,8 +39,8 @@
         <div class="nav-section-header"><a href="/tools/devices/index.html"><span class="en">Setting Up Virtual Devices</span></a></div>
         <ul>
           <li><a href="/tools/devices/managing-avds.html"><span class="en">With AVD Manager</span></a></li>
-          <li><a href="/tools/devices/managing-avds-cmdline.html"><span class="en">From the Command Line</span></a></li>      
-          <li><a href="/tools/devices/emulator.html"><span class="en">Using the Android Emulator</span></a></li>                  
+          <li><a href="/tools/devices/managing-avds-cmdline.html"><span class="en">From the Command Line</span></a></li>
+          <li><a href="/tools/devices/emulator.html"><span class="en">Using the Android Emulator</span></a></li>
         </ul>
       </li>
       <li><a href="/tools/device.html"><span class="en">Using Hardware Devices</span></a></li>
@@ -48,16 +48,16 @@
         <div class="nav-section-header"><a href="/tools/projects/index.html"><span class="en">Setting Up Projects</span></a></div>
         <ul>
           <li><a href="/tools/projects/projects-eclipse.html"><span class="en">From Eclipse with ADT</span></a></li>
-          <li><a href="/tools/projects/projects-cmdline.html"><span class="en">From the Command Line</span></a></li>                      
+          <li><a href="/tools/projects/projects-cmdline.html"><span class="en">From the Command Line</span></a></li>
         </ul>
       </li>
 
-  
+
       <li class="nav-section">
         <div class="nav-section-header"><a href="/tools/building/index.html"><span class="en">Building and Running</span></a></div>
         <ul>
           <li><a href="/tools/building/building-eclipse.html"><span class="en">From Eclipse with ADT</span></a></li>
-          <li><a href="/tools/building/building-cmdline.html"><span class="en">From the Command Line</span></a></li>                    
+          <li><a href="/tools/building/building-cmdline.html"><span class="en">From the Command Line</span></a></li>
         </ul>
       </li>
 
@@ -76,7 +76,7 @@
           </li>
           <li><a href="<?cs var:toroot ?>tools/testing/testing_otheride.html">
             <span class="en">From Other IDEs</span></a>
-          </li>  
+          </li>
           <li>
             <a href="<?cs var:toroot?>tools/testing/activity_testing.html">
             <span class="en">Activity Testing</span></a>
@@ -90,6 +90,10 @@
             <span class="en">Content Provider Testing</span></a>
           </li>
           <li>
+            <a href="<?cs var:toroot?>tools/testing/testing_accessibility.html">
+            <span class="en">Accessibility Testing</span></a>
+          </li>
+          <li>
             <a href="<?cs var:toroot ?>tools/testing/what_to_test.html">
             <span class="en">What To Test</span></a>
           </li>
@@ -160,7 +164,7 @@
        <li><a href="<?cs var:toroot ?>tools/help/zipalign.html">zipalign</a></li>
     </ul>
   </li>
-  
+
   <li class="nav-section">
     <div class="nav-section-header"><a href="<?cs var:toroot
 ?>tools/revisions/index.html"><span class="en">Revisions</span></a></div>
@@ -178,8 +182,8 @@
 class="en">Platforms</span></a></li>
     </ul>
   </li>
-  
-  
+
+
   <li class="nav-section">
     <div class="nav-section-header"><a href="<?cs var:toroot
 ?>tools/extras/index.html"><span class="en">Extras</span></a></div>
@@ -192,13 +196,13 @@
     </ul>
   </li>
 
-  
+
   <li class="nav-section">
     <div class="nav-section-header empty"><a href="<?cs var:toroot
 ?>tools/samples/index.html"><span class="en">Samples</span></a></div>
   </li>
 
-  
+
   <li class="nav-section">
     <div class="nav-section-header">
     <a href="<?cs var:toroot ?>tools/adk/index.html">
@@ -217,7 +221,7 @@
       </li>
     </ul>
   </li>
-  
+
 </ul><!-- nav -->
 
 <script type="text/javascript">
diff --git a/docs/html/training/basics/activity-lifecycle/recreating.jd b/docs/html/training/basics/activity-lifecycle/recreating.jd
index 3bbf0bb..8c7126a 100644
--- a/docs/html/training/basics/activity-lifecycle/recreating.jd
+++ b/docs/html/training/basics/activity-lifecycle/recreating.jd
@@ -51,7 +51,7 @@
 the foreground activity because the screen configuration has changed and your activity might need to
 load alternative resources (such as the layout).</p>
 
-<p>By default, the system uses the {@link android.os.Bundle} instance state to saves information
+<p>By default, the system uses the {@link android.os.Bundle} instance state to save information
 about each {@link android.view.View} object in your activity layout (such as the text value entered
 into an {@link android.widget.EditText} object). So, if your activity instance is destroyed and
 recreated, the state of the layout is automatically restored to its previous state. However, your
diff --git a/docs/html/training/basics/activity-lifecycle/starting.jd b/docs/html/training/basics/activity-lifecycle/starting.jd
index 1a4bc2d..dd17304 100644
--- a/docs/html/training/basics/activity-lifecycle/starting.jd
+++ b/docs/html/training/basics/activity-lifecycle/starting.jd
@@ -112,7 +112,7 @@
 </table>
 -->
 
-<p>As you'll learn in the following lessons, there are several situtations in which an activity
+<p>As you'll learn in the following lessons, there are several situations in which an activity
 transitions between different states that are illustrated in figure 1. However, only three of
 these states can be static. That is, the activity can exist in one of only three states for an
 extended period of time:</p>
diff --git a/docs/html/training/basics/firstapp/starting-activity.jd b/docs/html/training/basics/firstapp/starting-activity.jd
index 4d0a84a..3dafcfa 100644
--- a/docs/html/training/basics/firstapp/starting-activity.jd
+++ b/docs/html/training/basics/firstapp/starting-activity.jd
@@ -285,8 +285,8 @@
 
 <p>The app is now runnable because the {@link android.content.Intent} in the
 first activity now resolves to the {@code DisplayMessageActivity} class. If you run the app now,
-clicking the Send button starts the
-second activity, but it doesn't show anything yet.</p>
+clicking the Send button starts the second activity, but it's still using the default
+"Hello world" layout.</p>
 
 
 <h2 id="ReceiveIntent">Receive the Intent</h2>
diff --git a/packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java b/packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java
index 2594167..384e8af 100644
--- a/packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java
+++ b/packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java
@@ -63,7 +63,7 @@
     // database gets upgraded properly. At a minimum, please confirm that 'upgradeVersion'
     // is properly propagated through your change.  Not doing so will result in a loss of user
     // settings.
-    private static final int DATABASE_VERSION = 79;
+    private static final int DATABASE_VERSION = 80;
 
     private Context mContext;
 
@@ -1071,6 +1071,52 @@
             upgradeVersion = 79;
         }
 
+        if (upgradeVersion == 79) {
+            // Before touch exploration was a global setting controlled by the user
+            // via the UI. However, if the enabled accessibility services do not
+            // handle touch exploration mode, enabling it makes no sense. Therefore,
+            // now the services request touch exploration mode and the user is
+            // presented with a dialog to allow that and if she does we store that
+            // in the database. As a result of this change a user that has enabled
+            // accessibility, touch exploration, and some accessibility services
+            // may lose touch exploration state, thus rendering the device useless
+            // unless sighted help is provided, since the enabled service(s) are
+            // not in the list of services to which the user granted a permission
+            // to put the device in touch explore mode. Here we are allowing all
+            // enabled accessibility services to toggle touch exploration provided
+            // accessibility and touch exploration are enabled and no services can
+            // toggle touch exploration. Note that the user has already manually
+            // enabled the services and touch exploration which means the she has
+            // given consent to have these services work in touch exploration mode.
+            final boolean accessibilityEnabled = getIntValueFromTable(db, "secure",
+                    Settings.Secure.ACCESSIBILITY_ENABLED, 0) == 1;
+            final boolean touchExplorationEnabled = getIntValueFromTable(db, "secure",
+                    Settings.Secure.TOUCH_EXPLORATION_ENABLED, 0) == 1;
+            if (accessibilityEnabled && touchExplorationEnabled) {
+                String enabledServices = getStringValueFromTable(db, "secure",
+                        Settings.Secure.ENABLED_ACCESSIBILITY_SERVICES, "");
+                String touchExplorationGrantedServices = getStringValueFromTable(db, "secure",
+                        Settings.Secure.TOUCH_EXPLORATION_GRANTED_ACCESSIBILITY_SERVICES, "");
+                if (TextUtils.isEmpty(touchExplorationGrantedServices)
+                        && !TextUtils.isEmpty(enabledServices)) {
+                    SQLiteStatement stmt = null;
+                    try {
+                        db.beginTransaction();
+                        stmt = db.compileStatement("INSERT OR REPLACE INTO secure(name,value)"
+                                + " VALUES(?,?);");
+                        loadSetting(stmt,
+                                Settings.Secure.TOUCH_EXPLORATION_GRANTED_ACCESSIBILITY_SERVICES,
+                                enabledServices);
+                        db.setTransactionSuccessful();
+                    } finally {
+                        db.endTransaction();
+                        if (stmt != null) stmt.close();
+                    }
+                }
+            }
+            upgradeVersion = 80;
+        }
+
         // *** Remember to update DATABASE_VERSION above!
 
         if (upgradeVersion != currentVersion) {
@@ -1700,18 +1746,28 @@
     }
 
     private int getIntValueFromSystem(SQLiteDatabase db, String name, int defaultValue) {
-        int value = defaultValue;
+        return getIntValueFromTable(db, "system", name, defaultValue);
+    }
+
+    private int getIntValueFromTable(SQLiteDatabase db, String table, String name,
+            int defaultValue) {
+        String value = getStringValueFromTable(db, table, name, null);
+        return (value != null) ? Integer.parseInt(value) : defaultValue;
+    }
+
+    private String getStringValueFromTable(SQLiteDatabase db, String table, String name,
+            String defaultValue) {
         Cursor c = null;
         try {
-            c = db.query("system", new String[] { Settings.System.VALUE }, "name='" + name + "'",
+            c = db.query(table, new String[] { Settings.System.VALUE }, "name='" + name + "'",
                     null, null, null, null);
             if (c != null && c.moveToFirst()) {
                 String val = c.getString(0);
-                value = val == null ? defaultValue : Integer.parseInt(val);
+                return val == null ? defaultValue : val;
             }
         } finally {
             if (c != null) c.close();
         }
-        return value;
+        return defaultValue;
     }
 }
diff --git a/telephony/java/com/android/internal/telephony/cdma/sms/BearerData.java b/telephony/java/com/android/internal/telephony/cdma/sms/BearerData.java
index 5cacd23..3d88f50 100755
--- a/telephony/java/com/android/internal/telephony/cdma/sms/BearerData.java
+++ b/telephony/java/com/android/internal/telephony/cdma/sms/BearerData.java
@@ -595,7 +595,6 @@
         byte[] payload = encodeUtf16(uData.payloadStr);
         int udhBytes = udhData.length + 1;  // Add length octet.
         int udhCodeUnits = (udhBytes + 1) / 2;
-        int udhPadding = udhBytes % 2;
         int payloadCodeUnits = payload.length / 2;
         uData.msgEncoding = UserData.ENCODING_UNICODE_16;
         uData.msgEncodingSet = true;
@@ -603,7 +602,7 @@
         uData.payload = new byte[uData.numFields * 2];
         uData.payload[0] = (byte)udhData.length;
         System.arraycopy(udhData, 0, uData.payload, 1, udhData.length);
-        System.arraycopy(payload, 0, uData.payload, udhBytes + udhPadding, payload.length);
+        System.arraycopy(payload, 0, uData.payload, udhBytes, payload.length);
     }
 
     private static void encodeEmsUserDataPayload(UserData uData)
@@ -997,27 +996,37 @@
     private static String decodeUtf8(byte[] data, int offset, int numFields)
         throws CodingException
     {
-        if (numFields < 0 || (numFields + offset) > data.length) {
-            throw new CodingException("UTF-8 decode failed: offset or length out of range");
-        }
-        try {
-            return new String(data, offset, numFields, "UTF-8");
-        } catch (java.io.UnsupportedEncodingException ex) {
-            throw new CodingException("UTF-8 decode failed: " + ex);
-        }
+        return decodeCharset(data, offset, numFields, 1, "UTF-8");
     }
 
     private static String decodeUtf16(byte[] data, int offset, int numFields)
         throws CodingException
     {
-        int byteCount = numFields * 2;
-        if (byteCount < 0 || (byteCount + offset) > data.length) {
-            throw new CodingException("UTF-16 decode failed: offset or length out of range");
+        // Subtract header and possible padding byte (at end) from num fields.
+        int padding = offset % 2;
+        numFields -= (offset + padding) / 2;
+        return decodeCharset(data, offset, numFields, 2, "utf-16be");
+    }
+
+    private static String decodeCharset(byte[] data, int offset, int numFields, int width,
+            String charset) throws CodingException
+    {
+        if (numFields < 0 || (numFields * width + offset) > data.length) {
+            // Try to decode the max number of characters in payload
+            int padding = offset % width;
+            int maxNumFields = (data.length - offset - padding) / width;
+            if (maxNumFields < 0) {
+                throw new CodingException(charset + " decode failed: offset out of range");
+            }
+            Log.e(LOG_TAG, charset + " decode error: offset = " + offset + " numFields = "
+                    + numFields + " data.length = " + data.length + " maxNumFields = "
+                    + maxNumFields);
+            numFields = maxNumFields;
         }
         try {
-            return new String(data, offset, byteCount, "utf-16be");
+            return new String(data, offset, numFields * width, charset);
         } catch (java.io.UnsupportedEncodingException ex) {
-            throw new CodingException("UTF-16 decode failed: " + ex);
+            throw new CodingException(charset + " decode failed: " + ex);
         }
     }
 
@@ -1073,14 +1082,7 @@
     private static String decodeLatin(byte[] data, int offset, int numFields)
         throws CodingException
     {
-        if (numFields < 0 || (numFields + offset) > data.length) {
-            throw new CodingException("ISO-8859-1 decode failed: offset or length out of range");
-        }
-        try {
-            return new String(data, offset, numFields, "ISO-8859-1");
-        } catch (java.io.UnsupportedEncodingException ex) {
-            throw new CodingException("ISO-8859-1 decode failed: " + ex);
-        }
+        return decodeCharset(data, offset, numFields, 1, "ISO-8859-1");
     }
 
     private static void decodeUserDataPayload(UserData userData, boolean hasUserDataHeader)
diff --git a/telephony/java/com/android/internal/telephony/gsm/GsmDataConnectionTracker.java b/telephony/java/com/android/internal/telephony/gsm/GsmDataConnectionTracker.java
index a971066..23364b4 100644
--- a/telephony/java/com/android/internal/telephony/gsm/GsmDataConnectionTracker.java
+++ b/telephony/java/com/android/internal/telephony/gsm/GsmDataConnectionTracker.java
@@ -996,9 +996,23 @@
     }
 
     private boolean dataConnectionNotInUse(DataConnectionAc dcac) {
+        if (DBG) log("dataConnectionNotInUse: check if dcac is inuse dc=" + dcac.dataConnection);
         for (ApnContext apnContext : mApnContexts.values()) {
-            if (apnContext.getDataConnectionAc() == dcac) return false;
+            if (apnContext.getDataConnectionAc() == dcac) {
+                if (DBG) log("dataConnectionNotInUse: in use by apnContext=" + apnContext);
+                return false;
+            }
         }
+        // TODO: Fix retry handling so free DataConnections have empty apnlists.
+        // Probably move retry handling into DataConnections and reduce complexity
+        // of DCT.
+        for (ApnContext apnContext : dcac.getApnListSync()) {
+            if (DBG) {
+                log("dataConnectionNotInUse: removing apnContext=" + apnContext);
+            }
+            dcac.removeApnContextSync(apnContext);
+        }
+        if (DBG) log("dataConnectionNotInUse: not in use return true");
         return true;
     }
 
@@ -2131,14 +2145,14 @@
     protected void onDisconnectDone(int connId, AsyncResult ar) {
         ApnContext apnContext = null;
 
-        if(DBG) log("onDisconnectDone: EVENT_DISCONNECT_DONE connId=" + connId);
         if (ar.userObj instanceof ApnContext) {
             apnContext = (ApnContext) ar.userObj;
         } else {
-            loge("Invalid ar in onDisconnectDone");
+            loge("onDisconnectDone: Invalid ar in onDisconnectDone, ignore");
             return;
         }
 
+        if(DBG) log("onDisconnectDone: EVENT_DISCONNECT_DONE apnContext=" + apnContext);
         apnContext.setState(State.IDLE);
 
         mPhone.notifyDataConnection(apnContext.getReason(), apnContext.getApnType());
diff --git a/telephony/tests/telephonytests/src/com/android/internal/telephony/cdma/sms/CdmaSmsTest.java b/telephony/tests/telephonytests/src/com/android/internal/telephony/cdma/sms/CdmaSmsTest.java
index 58e73e0..f1bc268 100644
--- a/telephony/tests/telephonytests/src/com/android/internal/telephony/cdma/sms/CdmaSmsTest.java
+++ b/telephony/tests/telephonytests/src/com/android/internal/telephony/cdma/sms/CdmaSmsTest.java
@@ -35,10 +35,21 @@
 import android.util.Log;
 
 import java.util.ArrayList;
+import java.util.Arrays;
 
 public class CdmaSmsTest extends AndroidTestCase {
     private final static String LOG_TAG = "XXX CdmaSmsTest XXX";
 
+    // CJK ideographs, Hiragana, Katakana, full width letters, Cyrillic, etc.
+    private static final String sUnicodeChars = "\u4e00\u4e01\u4e02\u4e03" +
+            "\u4e04\u4e05\u4e06\u4e07\u4e08\u4e09\u4e0a\u4e0b\u4e0c\u4e0d" +
+            "\u4e0e\u4e0f\u3041\u3042\u3043\u3044\u3045\u3046\u3047\u3048" +
+            "\u30a1\u30a2\u30a3\u30a4\u30a5\u30a6\u30a7\u30a8" +
+            "\uff10\uff11\uff12\uff13\uff14\uff15\uff16\uff17\uff18" +
+            "\uff70\uff71\uff72\uff73\uff74\uff75\uff76\uff77\uff78" +
+            "\u0400\u0401\u0402\u0403\u0404\u0405\u0406\u0407\u0408" +
+            "\u00a2\u00a9\u00ae\u2122";
+
     @SmallTest
     public void testCdmaSmsAddrParsing() throws Exception {
         CdmaSmsAddress addr = CdmaSmsAddress.parse("6502531000");
@@ -811,23 +822,51 @@
 
     @SmallTest
     public void testUserDataHeaderWithEightCharMsg() throws Exception {
+        encodeDecodeAssertEquals("01234567", 2, 2, false);
+    }
+
+    private void encodeDecodeAssertEquals(String payload, int index, int total,
+            boolean oddLengthHeader) throws Exception {
         BearerData bearerData = new BearerData();
         bearerData.messageType = BearerData.MESSAGE_TYPE_DELIVER;
         bearerData.messageId = 55;
-        SmsHeader.ConcatRef concatRef = new SmsHeader.ConcatRef();
-        concatRef.refNumber = 0xEE;
-        concatRef.msgCount = 2;
-        concatRef.seqNumber = 2;
-        concatRef.isEightBits = true;
         SmsHeader smsHeader = new SmsHeader();
-        smsHeader.concatRef = concatRef;
+        if (oddLengthHeader) {
+            // Odd length header to verify correct UTF-16 header padding
+            SmsHeader.MiscElt miscElt = new SmsHeader.MiscElt();
+            miscElt.id = 0x27;  // reserved for future use; ignored on decode
+            miscElt.data = new byte[]{0x12, 0x34};
+            smsHeader.miscEltList.add(miscElt);
+        } else {
+            // Even length header normally generated for concatenated SMS.
+            SmsHeader.ConcatRef concatRef = new SmsHeader.ConcatRef();
+            concatRef.refNumber = 0xEE;
+            concatRef.msgCount = total;
+            concatRef.seqNumber = index;
+            concatRef.isEightBits = true;
+            smsHeader.concatRef = concatRef;
+        }
+        byte[] encodeHeader = SmsHeader.toByteArray(smsHeader);
+        if (oddLengthHeader) {
+            assertEquals(4, encodeHeader.length);     // 5 bytes with UDH length
+        } else {
+            assertEquals(5, encodeHeader.length);     // 6 bytes with UDH length
+        }
         UserData userData = new UserData();
-        userData.payloadStr = "01234567";
+        userData.payloadStr = payload;
         userData.userDataHeader = smsHeader;
         bearerData.userData = userData;
         byte[] encodedSms = BearerData.encode(bearerData);
         BearerData revBearerData = BearerData.decode(encodedSms);
         assertEquals(userData.payloadStr, revBearerData.userData.payloadStr);
+        assertTrue(revBearerData.hasUserDataHeader);
+        byte[] header = SmsHeader.toByteArray(revBearerData.userData.userDataHeader);
+        if (oddLengthHeader) {
+            assertEquals(4, header.length);     // 5 bytes with UDH length
+        } else {
+            assertEquals(5, header.length);     // 6 bytes with UDH length
+        }
+        assertTrue(Arrays.equals(encodeHeader, header));
     }
 
     @SmallTest
@@ -881,7 +920,27 @@
         if (isCdmaPhone) {
             ArrayList<String> fragments = android.telephony.SmsMessage.fragmentText(text2);
             assertEquals(3, fragments.size());
+
+            for (int i = 0; i < 3; i++) {
+                encodeDecodeAssertEquals(fragments.get(i), i + 1, 3, false);
+                encodeDecodeAssertEquals(fragments.get(i), i + 1, 3, true);
+            }
         }
 
+        // Test case for multi-part UTF-16 message.
+        String text3 = sUnicodeChars + sUnicodeChars + sUnicodeChars;
+        ted = SmsMessage.calculateLength(text3, false);
+        assertEquals(3, ted.msgCount);
+        assertEquals(189, ted.codeUnitCount);
+        assertEquals(3, ted.codeUnitSize);
+        if (isCdmaPhone) {
+            ArrayList<String> fragments = android.telephony.SmsMessage.fragmentText(text3);
+            assertEquals(3, fragments.size());
+
+            for (int i = 0; i < 3; i++) {
+                encodeDecodeAssertEquals(fragments.get(i), i + 1, 3, false);
+                encodeDecodeAssertEquals(fragments.get(i), i + 1, 3, true);
+            }
+        }
     }
 }
diff --git a/wifi/java/android/net/wifi/WifiWatchdogStateMachine.java b/wifi/java/android/net/wifi/WifiWatchdogStateMachine.java
index 1a42f93..45efe3e 100644
--- a/wifi/java/android/net/wifi/WifiWatchdogStateMachine.java
+++ b/wifi/java/android/net/wifi/WifiWatchdogStateMachine.java
@@ -881,6 +881,9 @@
             //test to avoid any wifi connectivity issues
             loge("ARP test initiation failure: " + se);
             success = true;
+        } catch (IllegalArgumentException e) {
+            // ArpPeer throws exception for IPv6 address
+            success = true;
         }
 
         return success;