Merge "ExifInterface: Add PEF, RW2 files parse support"
diff --git a/api/current.txt b/api/current.txt
index 8872c58..fbc2faa 100644
--- a/api/current.txt
+++ b/api/current.txt
@@ -10081,7 +10081,7 @@
     method public android.os.PersistableBundle getExtras();
     method public java.lang.String getId();
     method public android.content.Intent getIntent();
-    method public android.content.Intent getIntents();
+    method public android.content.Intent[] getIntents();
     method public long getLastChangedTimestamp();
     method public java.lang.CharSequence getLongLabel();
     method public java.lang.String getPackage();
@@ -42533,6 +42533,7 @@
     method public float getPivotY();
     method public android.view.PointerIcon getPointerIcon();
     method public android.content.res.Resources getResources();
+    method public final boolean getRevealOnFocusHint();
     method public final int getRight();
     method protected float getRightFadingEdgeStrength();
     method protected int getRightPaddingOffset();
@@ -42820,6 +42821,7 @@
     method public void setPivotY(float);
     method public void setPointerIcon(android.view.PointerIcon);
     method public void setPressed(boolean);
+    method public final void setRevealOnFocusHint(boolean);
     method public final void setRight(int);
     method public void setRotation(float);
     method public void setRotationX(float);
diff --git a/api/system-current.txt b/api/system-current.txt
index 69bfc6c..b2e0ee6 100644
--- a/api/system-current.txt
+++ b/api/system-current.txt
@@ -8449,6 +8449,7 @@
     method public abstract void sendBroadcast(android.content.Intent, java.lang.String, android.os.Bundle);
     method public abstract void sendBroadcastAsUser(android.content.Intent, android.os.UserHandle);
     method public abstract void sendBroadcastAsUser(android.content.Intent, android.os.UserHandle, java.lang.String);
+    method public abstract void sendBroadcastAsUser(android.content.Intent, android.os.UserHandle, java.lang.String, android.os.Bundle);
     method public abstract void sendOrderedBroadcast(android.content.Intent, java.lang.String);
     method public abstract void sendOrderedBroadcast(android.content.Intent, java.lang.String, android.content.BroadcastReceiver, android.os.Handler, int, java.lang.String, android.os.Bundle);
     method public abstract void sendOrderedBroadcast(android.content.Intent, java.lang.String, android.os.Bundle, android.content.BroadcastReceiver, android.os.Handler, int, java.lang.String, android.os.Bundle);
@@ -8642,6 +8643,7 @@
     method public void sendBroadcast(android.content.Intent, java.lang.String, android.os.Bundle);
     method public void sendBroadcastAsUser(android.content.Intent, android.os.UserHandle);
     method public void sendBroadcastAsUser(android.content.Intent, android.os.UserHandle, java.lang.String);
+    method public void sendBroadcastAsUser(android.content.Intent, android.os.UserHandle, java.lang.String, android.os.Bundle);
     method public void sendOrderedBroadcast(android.content.Intent, java.lang.String);
     method public void sendOrderedBroadcast(android.content.Intent, java.lang.String, android.content.BroadcastReceiver, android.os.Handler, int, java.lang.String, android.os.Bundle);
     method public void sendOrderedBroadcast(android.content.Intent, java.lang.String, android.os.Bundle, android.content.BroadcastReceiver, android.os.Handler, int, java.lang.String, android.os.Bundle);
@@ -10496,7 +10498,7 @@
     method public android.os.PersistableBundle getExtras();
     method public java.lang.String getId();
     method public android.content.Intent getIntent();
-    method public android.content.Intent getIntents();
+    method public android.content.Intent[] getIntents();
     method public long getLastChangedTimestamp();
     method public java.lang.CharSequence getLongLabel();
     method public java.lang.String getPackage();
@@ -41189,6 +41191,7 @@
     method public void sendBroadcast(android.content.Intent, java.lang.String, android.os.Bundle);
     method public void sendBroadcastAsUser(android.content.Intent, android.os.UserHandle);
     method public void sendBroadcastAsUser(android.content.Intent, android.os.UserHandle, java.lang.String);
+    method public void sendBroadcastAsUser(android.content.Intent, android.os.UserHandle, java.lang.String, android.os.Bundle);
     method public void sendOrderedBroadcast(android.content.Intent, java.lang.String);
     method public void sendOrderedBroadcast(android.content.Intent, java.lang.String, android.content.BroadcastReceiver, android.os.Handler, int, java.lang.String, android.os.Bundle);
     method public void sendOrderedBroadcast(android.content.Intent, java.lang.String, android.os.Bundle, android.content.BroadcastReceiver, android.os.Handler, int, java.lang.String, android.os.Bundle);
@@ -45689,6 +45692,7 @@
     method public float getPivotY();
     method public android.view.PointerIcon getPointerIcon();
     method public android.content.res.Resources getResources();
+    method public final boolean getRevealOnFocusHint();
     method public final int getRight();
     method protected float getRightFadingEdgeStrength();
     method protected int getRightPaddingOffset();
@@ -45976,6 +45980,7 @@
     method public void setPivotY(float);
     method public void setPointerIcon(android.view.PointerIcon);
     method public void setPressed(boolean);
+    method public final void setRevealOnFocusHint(boolean);
     method public final void setRight(int);
     method public void setRotation(float);
     method public void setRotationX(float);
diff --git a/api/test-current.txt b/api/test-current.txt
index 3441f72..5f5fd76 100644
--- a/api/test-current.txt
+++ b/api/test-current.txt
@@ -10094,7 +10094,7 @@
     method public android.os.PersistableBundle getExtras();
     method public java.lang.String getId();
     method public android.content.Intent getIntent();
-    method public android.content.Intent getIntents();
+    method public android.content.Intent[] getIntents();
     method public long getLastChangedTimestamp();
     method public java.lang.CharSequence getLongLabel();
     method public java.lang.String getPackage();
@@ -42613,6 +42613,7 @@
     method public float getPivotY();
     method public android.view.PointerIcon getPointerIcon();
     method public android.content.res.Resources getResources();
+    method public final boolean getRevealOnFocusHint();
     method public final int getRight();
     method protected float getRightFadingEdgeStrength();
     method protected int getRightPaddingOffset();
@@ -42900,6 +42901,7 @@
     method public void setPivotY(float);
     method public void setPointerIcon(android.view.PointerIcon);
     method public void setPressed(boolean);
+    method public final void setRevealOnFocusHint(boolean);
     method public final void setRight(int);
     method public void setRotation(float);
     method public void setRotationX(float);
diff --git a/cmds/bootanimation/BootAnimation.cpp b/cmds/bootanimation/BootAnimation.cpp
index e634717..3087098 100644
--- a/cmds/bootanimation/BootAnimation.cpp
+++ b/cmds/bootanimation/BootAnimation.cpp
@@ -320,6 +320,7 @@
     mFlingerSurface.clear();
     mFlingerSurfaceControl.clear();
     eglTerminate(mDisplay);
+    eglReleaseThread();
     IPCThreadState::self()->stopProcess();
     return r;
 }
diff --git a/cmds/bootanimation/audioplay.cpp b/cmds/bootanimation/audioplay.cpp
index dbb76dc..4983b9a 100644
--- a/cmds/bootanimation/audioplay.cpp
+++ b/cmds/bootanimation/audioplay.cpp
@@ -20,6 +20,7 @@
 #include "audioplay.h"
 
 #define CHATTY ALOGD
+#define LOG_TAG "audioplay"
 
 #include <string.h>
 
@@ -114,10 +115,8 @@
     }
     (void)result;
 
-    // create output mix, with environmental reverb specified as a non-required interface
-    const SLInterfaceID ids[1] = {SL_IID_ENVIRONMENTALREVERB};
-    const SLboolean req[1] = {SL_BOOLEAN_FALSE};
-    result = (*engineEngine)->CreateOutputMix(engineEngine, &outputMixObject, 1, ids, req);
+    // create output mix
+    result = (*engineEngine)->CreateOutputMix(engineEngine, &outputMixObject, 0, NULL, NULL);
     if (result != SL_RESULT_SUCCESS) {
         ALOGE("sl engine CreateOutputMix failed with result %d", result);
         return false;
@@ -183,6 +182,14 @@
         ALOGE("SetConfiguration failed with result %d", result);
         return false;
     }
+    // use normal performance mode as low latency is not needed. This is not mandatory so
+    // do not bail if we fail
+    SLuint32 performanceMode = SL_ANDROID_PERFORMANCE_NONE;
+    result = (*playerConfig)->SetConfiguration(
+           playerConfig, SL_ANDROID_KEY_PERFORMANCE_MODE, &performanceMode, sizeof(SLuint32));
+    ALOGW_IF(result != SL_RESULT_SUCCESS,
+            "could not set performance mode on player, error %d", result);
+    (void)result;
 
     // realize the player
     result = (*bqPlayerObject)->Realize(bqPlayerObject, SL_BOOLEAN_FALSE);
@@ -264,6 +271,7 @@
                 break;
             case ID_DATA:
                 /* Stop looking for chunks */
+                *oSoundBufSize = chunkHeader->sz;
                 endLoop = true;
                 break;
             default:
@@ -317,7 +325,8 @@
         return false;
     }
 
-    CHATTY("playClip on player %p: buf=%p size=%d", bqPlayerBufferQueue, buf, size);
+    CHATTY("playClip on player %p: buf=%p size=%d nextSize %d",
+           bqPlayerBufferQueue, buf, size, nextSize);
 
     if (nextSize > 0) {
         // here we only enqueue one buffer because it is a long clip,
diff --git a/core/java/android/animation/ObjectAnimator.java b/core/java/android/animation/ObjectAnimator.java
index 5c4b979..9a2aa30 100644
--- a/core/java/android/animation/ObjectAnimator.java
+++ b/core/java/android/animation/ObjectAnimator.java
@@ -977,7 +977,7 @@
     @Override
     void animateValue(float fraction) {
         final Object target = getTarget();
-        if (mTarget != null && target == null) {
+        if (target == null) {
             // We lost the target reference, cancel and clean up.
             cancel();
             return;
diff --git a/core/java/android/animation/ValueAnimator.java b/core/java/android/animation/ValueAnimator.java
index 2f2d9d6..f93a1d8 100644
--- a/core/java/android/animation/ValueAnimator.java
+++ b/core/java/android/animation/ValueAnimator.java
@@ -982,6 +982,7 @@
         mStarted = true;
         mPaused = false;
         mRunning = false;
+        mAnimationEndRequested = false;
         // Resets mLastFrameTime when start() is called, so that if the animation was running,
         // calling start() would put the animation in the
         // started-but-not-yet-reached-the-first-frame phase.
diff --git a/core/java/android/app/ActivityManagerNative.java b/core/java/android/app/ActivityManagerNative.java
index 277348a..aacd5da 100644
--- a/core/java/android/app/ActivityManagerNative.java
+++ b/core/java/android/app/ActivityManagerNative.java
@@ -3010,6 +3010,13 @@
             reply.writeNoException();
             return true;
         }
+        case SET_HAS_TOP_UI: {
+            data.enforceInterface(IActivityManager.descriptor);
+            final boolean hasTopUi = data.readInt() != 0;
+            setHasTopUi(hasTopUi);
+            reply.writeNoException();
+            return true;
+        }
         }
 
         return super.onTransact(code, data, reply, flags);
@@ -7072,5 +7079,18 @@
         return;
     }
 
+    public void setHasTopUi(boolean hasTopUi)
+            throws RemoteException {
+        Parcel data = Parcel.obtain();
+        Parcel reply = Parcel.obtain();
+        data.writeInterfaceToken(IActivityManager.descriptor);
+        data.writeInt(hasTopUi ? 1 : 0);
+        mRemote.transact(SET_HAS_TOP_UI, data, reply, 0);
+        reply.readException();
+        data.recycle();
+        reply.recycle();
+        return;
+    }
+
     private IBinder mRemote;
 }
diff --git a/core/java/android/app/ActivityThread.java b/core/java/android/app/ActivityThread.java
index 18a5d64..4ca1af8 100644
--- a/core/java/android/app/ActivityThread.java
+++ b/core/java/android/app/ActivityThread.java
@@ -4632,11 +4632,12 @@
         if ((activity == null) || (activity.mCurrentConfig == null)) {
             shouldChangeConfig = true;
         } else {
-            // If the new config is the same as the config this Activity
-            // is already running with then don't bother calling
-            // onConfigurationChanged
+            // If the new config is the same as the config this Activity is already
+            // running with and the override config also didn't change, then don't
+            // bother calling onConfigurationChanged.
             int diff = activity.mCurrentConfig.diff(newConfig);
-            if (diff != 0) {
+            if (diff != 0 || !mResourcesManager.isSameResourcesOverrideConfig(activityToken,
+                    amOverrideConfig)) {
                 // Always send the task-level config changes. For system-level configuration, if
                 // this activity doesn't handle any of the config changes, then don't bother
                 // calling onConfigurationChanged as we're going to destroy it.
diff --git a/core/java/android/app/BackStackRecord.java b/core/java/android/app/BackStackRecord.java
index fb3ba7c..199e9aa 100644
--- a/core/java/android/app/BackStackRecord.java
+++ b/core/java/android/app/BackStackRecord.java
@@ -868,7 +868,9 @@
              * Ensure that fragments that are entering are at least at the CREATED state
              * so that they may load Transitions using TransitionInflater.
              */
-            if (fragment.mState < Fragment.CREATED && mManager.mCurState >= Fragment.CREATED) {
+            if (fragment.mState < Fragment.CREATED && mManager.mCurState >= Fragment.CREATED &&
+                    mManager.mHost.getContext().getApplicationInfo().targetSdkVersion >=
+                    Build.VERSION_CODES.N) {
                 mManager.makeActive(fragment);
                 mManager.moveToState(fragment, Fragment.CREATED, 0, 0, false);
             }
diff --git a/core/java/android/app/ContextImpl.java b/core/java/android/app/ContextImpl.java
index 8f42467..f1d0e10 100644
--- a/core/java/android/app/ContextImpl.java
+++ b/core/java/android/app/ContextImpl.java
@@ -1053,6 +1053,23 @@
     }
 
     @Override
+    public void sendBroadcastAsUser(Intent intent, UserHandle user, String receiverPermission,
+            Bundle options) {
+        String resolvedType = intent.resolveTypeIfNeeded(getContentResolver());
+        String[] receiverPermissions = receiverPermission == null ? null
+                : new String[] {receiverPermission};
+        try {
+            intent.prepareToLeaveProcess(this);
+            ActivityManagerNative.getDefault().broadcastIntent(
+                    mMainThread.getApplicationThread(), intent, resolvedType, null,
+                    Activity.RESULT_OK, null, null, receiverPermissions, AppOpsManager.OP_NONE,
+                    options, false, false, user.getIdentifier());
+        } catch (RemoteException e) {
+            throw e.rethrowFromSystemServer();
+        }
+    }
+
+    @Override
     public void sendBroadcastAsUser(Intent intent, UserHandle user,
             String receiverPermission, int appOp) {
         String resolvedType = intent.resolveTypeIfNeeded(getContentResolver());
diff --git a/core/java/android/app/IActivityManager.java b/core/java/android/app/IActivityManager.java
index 4a4202a..d54ce4b 100644
--- a/core/java/android/app/IActivityManager.java
+++ b/core/java/android/app/IActivityManager.java
@@ -661,6 +661,14 @@
     public void setVrThread(int tid) throws RemoteException;
     public void setRenderThread(int tid) throws RemoteException;
 
+    /**
+     * Let's activity manager know whether the calling process is currently showing "top-level" UI
+     * that is not an activity, i.e. windows on the screen the user is currently interacting with.
+     *
+     * @param hasTopUi Whether the calling process has "top-level" UI.
+     */
+    public void setHasTopUi(boolean hasTopUi) throws RemoteException;
+
     /*
      * Private non-Binder interfaces
      */
@@ -1051,4 +1059,5 @@
     // Start of N MR1 transactions
     int SET_VR_THREAD_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION + 377;
     int SET_RENDER_THREAD_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION + 378;
+    int SET_HAS_TOP_UI = IBinder.FIRST_CALL_TRANSACTION + 379;
 }
diff --git a/core/java/android/app/Instrumentation.java b/core/java/android/app/Instrumentation.java
index 67d762b..f934a9f 100644
--- a/core/java/android/app/Instrumentation.java
+++ b/core/java/android/app/Instrumentation.java
@@ -1151,16 +1151,6 @@
 //      }
       
       activity.performDestroy();
-      
-      if (mActivityMonitors != null) {
-          synchronized (mSync) {
-              final int N = mActivityMonitors.size();
-              for (int i=0; i<N; i++) {
-                  final ActivityMonitor am = mActivityMonitors.get(i);
-                  am.match(activity, activity, activity.getIntent());
-              }
-          }
-      }
   }
 
     /**
diff --git a/core/java/android/app/LoadedApk.java b/core/java/android/app/LoadedApk.java
index b889c8f..7754244 100644
--- a/core/java/android/app/LoadedApk.java
+++ b/core/java/android/app/LoadedApk.java
@@ -1396,18 +1396,6 @@
         }
 
         public void death(ComponentName name, IBinder service) {
-            ServiceDispatcher.ConnectionInfo old;
-
-            synchronized (this) {
-                old = mActiveConnections.remove(name);
-                if (old == null || old.binder != service) {
-                    // Death for someone different than who we last
-                    // reported...  just ignore it.
-                    return;
-                }
-                old.binder.unlinkToDeath(old.deathMonitor, 0);
-            }
-
             if (mActivityThread != null) {
                 mActivityThread.post(new RunConnection(name, service, 1));
             } else {
@@ -1456,7 +1444,7 @@
                 }
             }
 
-            // If there was an old service, it is not disconnected.
+            // If there was an old service, it is now disconnected.
             if (old != null) {
                 mConnection.onServiceDisconnected(name);
             }
@@ -1467,6 +1455,17 @@
         }
 
         public void doDeath(ComponentName name, IBinder service) {
+            synchronized (this) {
+                ConnectionInfo old = mActiveConnections.get(name);
+                if (old == null || old.binder != service) {
+                    // Death for someone different than who we last
+                    // reported...  just ignore it.
+                    return;
+                }
+                mActiveConnections.remove(name);
+                old.binder.unlinkToDeath(old.deathMonitor, 0);
+            }
+
             mConnection.onServiceDisconnected(name);
         }
 
diff --git a/core/java/android/app/Notification.java b/core/java/android/app/Notification.java
index e78b2e7..40b0906 100644
--- a/core/java/android/app/Notification.java
+++ b/core/java/android/app/Notification.java
@@ -39,7 +39,6 @@
 import android.media.session.MediaSession;
 import android.net.Uri;
 import android.os.BadParcelableException;
-import android.os.BaseBundle;
 import android.os.Build;
 import android.os.Bundle;
 import android.os.Parcel;
@@ -51,7 +50,9 @@
 import android.text.Spanned;
 import android.text.TextUtils;
 import android.text.style.AbsoluteSizeSpan;
+import android.text.style.BackgroundColorSpan;
 import android.text.style.CharacterStyle;
+import android.text.style.ForegroundColorSpan;
 import android.text.style.RelativeSizeSpan;
 import android.text.style.TextAppearanceSpan;
 import android.util.ArraySet;
@@ -73,7 +74,6 @@
 import java.lang.reflect.Constructor;
 import java.util.ArrayList;
 import java.util.Arrays;
-import java.util.Collection;
 import java.util.Collections;
 import java.util.List;
 import java.util.Set;
@@ -3710,8 +3710,6 @@
                     emphazisedMode ? getEmphasizedActionLayoutResource()
                             : tombstone ? getActionTombstoneLayoutResource()
                                     : getActionLayoutResource());
-            final Icon ai = action.getIcon();
-            button.setTextViewText(R.id.action0, processLegacyText(action.title));
             if (!tombstone) {
                 button.setOnClickPendingIntent(R.id.action0, action.actionIntent);
             }
@@ -3720,14 +3718,29 @@
                 button.setRemoteInputs(R.id.action0, action.mRemoteInputs);
             }
             if (emphazisedMode) {
-                // change the background color
-                int color = resolveContrastColor();
-                if (oddAction) {
-                    color = NotificationColorUtil.lightenColor(color, 10);
-                }
-                button.setDrawableParameters(R.id.button_holder, true, -1, color,
+                // change the background bgColor
+                int bgColor = mContext.getColor(oddAction ? R.color.notification_action_list
+                        : R.color.notification_action_list_dark);
+                button.setDrawableParameters(R.id.button_holder, true, -1, bgColor,
                         PorterDuff.Mode.SRC_ATOP, -1);
+                CharSequence title = action.title;
+                ColorStateList[] outResultColor = null;
+                if (isLegacy()) {
+                    title = clearColorSpans(title);
+                } else {
+                    outResultColor = new ColorStateList[1];
+                    title = ensureColorSpanContrast(title, bgColor, outResultColor);
+                }
+                button.setTextViewText(R.id.action0, title);
+                if (outResultColor != null && outResultColor[0] != null) {
+                    // We need to set the text color as well since changing a text to uppercase
+                    // clears its spans.
+                    button.setTextColor(R.id.action0, outResultColor[0]);
+                } else if (mN.color != COLOR_DEFAULT) {
+                    button.setTextColor(R.id.action0,resolveContrastColor());
+                }
             } else {
+                button.setTextViewText(R.id.action0, processLegacyText(action.title));
                 if (mN.color != COLOR_DEFAULT) {
                     button.setTextColor(R.id.action0, resolveContrastColor());
                 }
@@ -3736,6 +3749,112 @@
         }
 
         /**
+         * Clears all color spans of a text
+         * @param charSequence the input text
+         * @return the same text but without color spans
+         */
+        private CharSequence clearColorSpans(CharSequence charSequence) {
+            if (charSequence instanceof Spanned) {
+                Spanned ss = (Spanned) charSequence;
+                Object[] spans = ss.getSpans(0, ss.length(), Object.class);
+                SpannableStringBuilder builder = new SpannableStringBuilder(ss.toString());
+                for (Object span : spans) {
+                    Object resultSpan = span;
+                    if (resultSpan instanceof CharacterStyle) {
+                        resultSpan = ((CharacterStyle) span).getUnderlying();
+                    }
+                    if (resultSpan instanceof TextAppearanceSpan) {
+                        TextAppearanceSpan originalSpan = (TextAppearanceSpan) resultSpan;
+                        if (originalSpan.getTextColor() != null) {
+                            resultSpan = new TextAppearanceSpan(
+                                    originalSpan.getFamily(),
+                                    originalSpan.getTextStyle(),
+                                    originalSpan.getTextSize(),
+                                    null,
+                                    originalSpan.getLinkTextColor());
+                        }
+                    } else if (resultSpan instanceof ForegroundColorSpan
+                            || (resultSpan instanceof BackgroundColorSpan)) {
+                        continue;
+                    } else {
+                        resultSpan = span;
+                    }
+                    builder.setSpan(resultSpan, ss.getSpanStart(span), ss.getSpanEnd(span),
+                            ss.getSpanFlags(span));
+                }
+                return builder;
+            }
+            return charSequence;
+        }
+
+        /**
+         * Ensures contrast on color spans against a background color. also returns the color of the
+         * text if a span was found that spans over the whole text.
+         *
+         * @param charSequence the charSequence on which the spans are
+         * @param background the background color to ensure the contrast against
+         * @param outResultColor an array in which a color will be returned as the first element if
+         *                    there exists a full length color span.
+         * @return the contrasted charSequence
+         */
+        private CharSequence ensureColorSpanContrast(CharSequence charSequence, int background,
+                ColorStateList[] outResultColor) {
+            if (charSequence instanceof Spanned) {
+                Spanned ss = (Spanned) charSequence;
+                Object[] spans = ss.getSpans(0, ss.length(), Object.class);
+                SpannableStringBuilder builder = new SpannableStringBuilder(ss.toString());
+                for (Object span : spans) {
+                    Object resultSpan = span;
+                    int spanStart = ss.getSpanStart(span);
+                    int spanEnd = ss.getSpanEnd(span);
+                    boolean fullLength = (spanEnd - spanStart) == charSequence.length();
+                    if (resultSpan instanceof CharacterStyle) {
+                        resultSpan = ((CharacterStyle) span).getUnderlying();
+                    }
+                    if (resultSpan instanceof TextAppearanceSpan) {
+                        TextAppearanceSpan originalSpan = (TextAppearanceSpan) resultSpan;
+                        ColorStateList textColor = originalSpan.getTextColor();
+                        if (textColor != null) {
+                            int[] colors = textColor.getColors();
+                            int[] newColors = new int[colors.length];
+                            for (int i = 0; i < newColors.length; i++) {
+                                newColors[i] = NotificationColorUtil.ensureLargeTextContrast(
+                                        colors[i], background);
+                            }
+                            textColor = new ColorStateList(textColor.getStates().clone(),
+                                    newColors);
+                            resultSpan = new TextAppearanceSpan(
+                                    originalSpan.getFamily(),
+                                    originalSpan.getTextStyle(),
+                                    originalSpan.getTextSize(),
+                                    textColor,
+                                    originalSpan.getLinkTextColor());
+                            if (fullLength) {
+                                outResultColor[0] = new ColorStateList(
+                                        textColor.getStates().clone(), newColors);
+                            }
+                        }
+                    } else if (resultSpan instanceof ForegroundColorSpan) {
+                        ForegroundColorSpan originalSpan = (ForegroundColorSpan) resultSpan;
+                        int foregroundColor = originalSpan.getForegroundColor();
+                        foregroundColor = NotificationColorUtil.ensureLargeTextContrast(
+                                foregroundColor, background);
+                        resultSpan = new ForegroundColorSpan(foregroundColor);
+                        if (fullLength) {
+                            outResultColor[0] = ColorStateList.valueOf(foregroundColor);
+                        }
+                    } else {
+                        resultSpan = span;
+                    }
+
+                    builder.setSpan(resultSpan, spanStart, spanEnd, ss.getSpanFlags(span));
+                }
+                return builder;
+            }
+            return charSequence;
+        }
+
+        /**
          * @return Whether we are currently building a notification from a legacy (an app that
          *         doesn't create material notifications by itself) app.
          */
diff --git a/core/java/android/app/ResourcesManager.java b/core/java/android/app/ResourcesManager.java
index c4673a3..835ef626 100644
--- a/core/java/android/app/ResourcesManager.java
+++ b/core/java/android/app/ResourcesManager.java
@@ -364,6 +364,26 @@
         return null;
     }
 
+    /**
+     * Check if activity resources have same override config as the provided on.
+     * @param activityToken The Activity that resources should be associated with.
+     * @param overrideConfig The override configuration to be checked for equality with.
+     * @return true if activity resources override config matches the provided one or they are both
+     *         null, false otherwise.
+     */
+    boolean isSameResourcesOverrideConfig(@Nullable IBinder activityToken,
+            @Nullable Configuration overrideConfig) {
+        synchronized (this) {
+            final ActivityResources activityResources
+                    = activityToken != null ? mActivityResourceReferences.get(activityToken) : null;
+            if (activityResources == null) {
+                return overrideConfig == null;
+            } else {
+                return Objects.equals(activityResources.overrideConfig, overrideConfig);
+            }
+        }
+    }
+
     private ActivityResources getOrCreateActivityResourcesStructLocked(
             @NonNull IBinder activityToken) {
         ActivityResources activityResources = mActivityResourceReferences.get(activityToken);
@@ -679,7 +699,7 @@
                 if (overrideConfig != null) {
                     activityResources.overrideConfig.setTo(overrideConfig);
                 } else {
-                    activityResources.overrideConfig.setToDefaults();
+                    activityResources.overrideConfig.unset();
                 }
 
                 if (DEBUG) {
diff --git a/core/java/android/bluetooth/BluetoothAdapter.java b/core/java/android/bluetooth/BluetoothAdapter.java
index cd1a3dd..073196c 100644
--- a/core/java/android/bluetooth/BluetoothAdapter.java
+++ b/core/java/android/bluetooth/BluetoothAdapter.java
@@ -23,6 +23,7 @@
 import android.annotation.SdkConstant;
 import android.annotation.SdkConstant.SdkConstantType;
 import android.annotation.SystemApi;
+import android.app.ActivityThread;
 import android.bluetooth.le.BluetoothLeAdvertiser;
 import android.bluetooth.le.BluetoothLeScanner;
 import android.bluetooth.le.ScanCallback;
@@ -252,6 +253,29 @@
             "android.bluetooth.adapter.action.REQUEST_ENABLE";
 
     /**
+     * Activity Action: Show a system activity that allows the user to turn off
+     * Bluetooth. This is used only if permission review is enabled which is for
+     * apps targeting API less than 23 require a permission review before any of
+     * the app's components can run.
+     * <p>This system activity will return once Bluetooth has completed turning
+     * off, or the user has decided not to turn Bluetooth off.
+     * <p>Notification of the result of this activity is posted using the
+     * {@link android.app.Activity#onActivityResult} callback. The
+     * <code>resultCode</code>
+     * will be {@link android.app.Activity#RESULT_OK} if Bluetooth has been
+     * turned off or {@link android.app.Activity#RESULT_CANCELED} if the user
+     * has rejected the request or an error has occurred.
+     * <p>Applications can also listen for {@link #ACTION_STATE_CHANGED}
+     * for global notification whenever Bluetooth is turned on or off.
+     * <p>Requires {@link android.Manifest.permission#BLUETOOTH}
+     *
+     * @hide
+     */
+    @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
+    public static final String ACTION_REQUEST_DISABLE =
+            "android.bluetooth.adapter.action.REQUEST_DISABLE";
+
+    /**
      * Activity Action: Show a system activity that allows user to enable BLE scans even when
      * Bluetooth is turned off.<p>
      *
@@ -775,7 +799,7 @@
         try {
             if (DBG) Log.d(TAG, "Calling enableBLE");
             mManagerService.updateBleAppCount(mToken, true);
-            return mManagerService.enable();
+            return mManagerService.enable(ActivityThread.currentPackageName());
         } catch (RemoteException e) {
             Log.e(TAG, "", e);
         }
@@ -902,7 +926,7 @@
             return true;
         }
         try {
-            return mManagerService.enable();
+            return mManagerService.enable(ActivityThread.currentPackageName());
         } catch (RemoteException e) {Log.e(TAG, "", e);}
         return false;
     }
@@ -934,7 +958,7 @@
     @RequiresPermission(Manifest.permission.BLUETOOTH_ADMIN)
     public boolean disable() {
         try {
-            return mManagerService.disable(true);
+            return mManagerService.disable(ActivityThread.currentPackageName(), true);
         } catch (RemoteException e) {Log.e(TAG, "", e);}
         return false;
     }
@@ -952,7 +976,7 @@
     public boolean disable(boolean persist) {
 
         try {
-            return mManagerService.disable(persist);
+            return mManagerService.disable(ActivityThread.currentPackageName(), persist);
         } catch (RemoteException e) {Log.e(TAG, "", e);}
         return false;
     }
diff --git a/core/java/android/bluetooth/IBluetoothManager.aidl b/core/java/android/bluetooth/IBluetoothManager.aidl
index 2b853a3..3af4a4d 100644
--- a/core/java/android/bluetooth/IBluetoothManager.aidl
+++ b/core/java/android/bluetooth/IBluetoothManager.aidl
@@ -34,9 +34,9 @@
     void registerStateChangeCallback(in IBluetoothStateChangeCallback callback);
     void unregisterStateChangeCallback(in IBluetoothStateChangeCallback callback);
     boolean isEnabled();
-    boolean enable();
+    boolean enable(String packageName);
     boolean enableNoAutoConnect();
-    boolean disable(boolean persist);
+    boolean disable( String packageName, boolean persist);
     int getState();
     IBluetoothGatt getBluetoothGatt();
 
@@ -50,3 +50,4 @@
     int updateBleAppCount(IBinder b, boolean enable);
     boolean isBleAppPresent();
 }
+
diff --git a/core/java/android/content/Context.java b/core/java/android/content/Context.java
index f51fe58..467eb89 100644
--- a/core/java/android/content/Context.java
+++ b/core/java/android/content/Context.java
@@ -2028,6 +2028,27 @@
     public abstract void sendBroadcastAsUser(@RequiresPermission Intent intent,
             UserHandle user, @Nullable String receiverPermission);
 
+    /**
+     * Version of {@link #sendBroadcast(Intent, String, Bundle)} that allows you to specify the
+     * user the broadcast will be sent to.  This is not available to applications
+     * that are not pre-installed on the system image.  Using it requires holding
+     * the INTERACT_ACROSS_USERS permission.
+     *
+     * @param intent The Intent to broadcast; all receivers matching this
+     *               Intent will receive the broadcast.
+     * @param user UserHandle to send the intent to.
+     * @param receiverPermission (optional) String naming a permission that
+     *               a receiver must hold in order to receive your broadcast.
+     *               If null, no permission is required.
+     * @param options (optional) Additional sending options, generated from a
+     * {@link android.app.BroadcastOptions}.
+     *
+     * @see #sendBroadcast(Intent, String, Bundle)
+     * @hide
+     */
+    @SystemApi
+    public abstract void sendBroadcastAsUser(@RequiresPermission Intent intent,
+            UserHandle user, @Nullable String receiverPermission, @Nullable Bundle options);
 
     /**
      * Version of {@link #sendBroadcast(Intent, String)} that allows you to specify the
diff --git a/core/java/android/content/ContextWrapper.java b/core/java/android/content/ContextWrapper.java
index 60da63e..edc8d82 100644
--- a/core/java/android/content/ContextWrapper.java
+++ b/core/java/android/content/ContextWrapper.java
@@ -498,6 +498,13 @@
     /** @hide */
     @Override
     public void sendBroadcastAsUser(Intent intent, UserHandle user,
+            String receiverPermission, Bundle options) {
+        mBase.sendBroadcastAsUser(intent, user, receiverPermission, options);
+    }
+
+    /** @hide */
+    @Override
+    public void sendBroadcastAsUser(Intent intent, UserHandle user,
             String receiverPermission, int appOp) {
         mBase.sendBroadcastAsUser(intent, user, receiverPermission, appOp);
     }
diff --git a/core/java/android/content/Intent.java b/core/java/android/content/Intent.java
index 43a8a82..d537739 100644
--- a/core/java/android/content/Intent.java
+++ b/core/java/android/content/Intent.java
@@ -4314,6 +4314,14 @@
     public static final int FLAG_DEBUG_TRIAGED_MISSING = 0x00000100;
 
     /**
+     * Internal flag used to indicate ephemeral applications should not be
+     * considered when resolving the intent.
+     *
+     * @hide
+     */
+    public static final int FLAG_IGNORE_EPHEMERAL = 0x00000200;
+
+    /**
      * If set, the new activity is not kept in the history stack.  As soon as
      * the user navigates away from it, the activity is finished.  This may also
      * be set with the {@link android.R.styleable#AndroidManifestActivity_noHistory
diff --git a/core/java/android/content/pm/LauncherApps.java b/core/java/android/content/pm/LauncherApps.java
index 29b2230..2eb767e 100644
--- a/core/java/android/content/pm/LauncherApps.java
+++ b/core/java/android/content/pm/LauncherApps.java
@@ -165,15 +165,15 @@
         }
 
         /**
-         * Indicates that one or more shortcuts of any kinds (dynamic, pinned, or manifest)
+         * Indicates that one or more shortcuts of any kind (dynamic, pinned, or manifest)
          * have been added, updated or removed.
          *
          * <p>Only the applications that are allowed to access the shortcut information,
          * as defined in {@link #hasShortcutHostPermission()}, will receive it.
          *
          * @param packageName The name of the package that has the shortcuts.
-         * @param shortcuts all shortcuts from the package (dynamic, manifest and/or pinned) will
-         *    be passed. Only "key" information will be provided, as defined in
+         * @param shortcuts All shortcuts from the package (dynamic, manifest and/or pinned).
+         *    Only "key" information will be provided, as defined in
          *    {@link ShortcutInfo#hasKeyFieldsOnly()}.
          * @param user The UserHandle of the profile that generated the change.
          *
@@ -224,16 +224,19 @@
         public static final int FLAG_GET_ALL_KINDS = FLAG_MATCH_ALL_KINDS;
 
         /**
-         * Requests "key" fields only.  See {@link ShortcutInfo#hasKeyFieldsOnly()} for which
-         * fields are available.  This allows quicker access to shortcut information in order to
-         * determine in-memory cache in the caller needs to be updated.
+         * Requests "key" fields only.  See {@link ShortcutInfo#hasKeyFieldsOnly()}'s javadoc to
+         * see which fields fields "key".
+         * This allows quicker access to shortcut information in order to
+         * determine whether the caller's in-memory cache needs to be updated.
          *
-         * <p>Typically, launcher applications cache all or most shortcuts' information
-         * in memory in order to show shortcuts without a delay.  When they want to update their
-         * cache (e.g. when their process restart), they can fetch all shortcuts' information with
-         * with this flag, then check {@link ShortcutInfo#getLastChangedTimestamp()} for each
-         * shortcut and issue a second call to fetch the non-key information of only updated
-         * shortcuts.
+         * <p>Typically, launcher applications cache all or most shortcut information
+         * in memory in order to show shortcuts without a delay.
+         *
+         * When a given launcher application wants to update its cache, such as when its process
+         * restarts, it can fetch shortcut information with this flag.
+         * The application can then check {@link ShortcutInfo#getLastChangedTimestamp()} for each
+         * shortcut, fetching a shortcut's non-key information only if that shortcut has been
+         * updated.
          *
          * @see ShortcutManager
          */
@@ -268,8 +271,9 @@
         }
 
         /**
-         * If non-zero, returns only shortcuts that have been added or updated since the timestamp.
-         * Units are as per {@link System#currentTimeMillis()}.
+         * If non-zero, returns only shortcuts that have been added or updated
+         * since the given timestamp, expressed in milliseconds since the Epoch&mdash;see
+         * {@link System#currentTimeMillis()}.
          */
         public ShortcutQuery setChangedSince(long changedSince) {
             mChangedSince = changedSince;
@@ -304,13 +308,15 @@
         }
 
         /**
-         * Set query options.  At least one of the {@code MATCH} flags should be set.  (Otherwise
-         * no shortcuts will be returned.)
+         * Set query options.  At least one of the {@code MATCH} flags should be set.  Otherwise,
+         * no shortcuts will be returned.
          *
-         * @see {@link #FLAG_MATCH_DYNAMIC}
-         * @see {@link #FLAG_MATCH_PINNED}
-         * @see {@link #FLAG_MATCH_MANIFEST}
-         * @see {@link #FLAG_GET_KEY_FIELDS_ONLY}
+         * <ul>
+         *     <li>{@link #FLAG_MATCH_DYNAMIC}
+         *     <li>{@link #FLAG_MATCH_PINNED}
+         *     <li>{@link #FLAG_MATCH_MANIFEST}
+         *     <li>{@link #FLAG_GET_KEY_FIELDS_ONLY}
+         * </ul>
          */
         public ShortcutQuery setQueryFlags(@QueryFlags int queryFlags) {
             mQueryFlags = queryFlags;
@@ -483,8 +489,8 @@
      * the user is trying a new launcher application.  The user may decide to change the default
      * launcher back to the calling application again, so even if a launcher application loses
      * this permission, it does <b>not</b> have to purge pinned shortcut information.
-     * Also in this situation, pinned shortcuts can still be started, even though the caller
-     * no longer has the shortcut host permission.
+     * If the calling launcher application contains pinned shortcuts, they will still work,
+     * even though the caller no longer has the shortcut host permission.
      *
      * @see ShortcutManager
      */
@@ -542,8 +548,8 @@
      * <p>This API is <b>NOT</b> cumulative; this will replace all pinned shortcuts for the package.
      * However, different launchers may have different set of pinned shortcuts.
      *
-     * <p>Callers must be allowed to access the shortcut information, as defined in {@link
-     * #hasShortcutHostPermission()}.
+     * <p>The calling launcher application must be allowed to access the shortcut information,
+     * as defined in {@link #hasShortcutHostPermission()}.
      *
      * @param packageName The target package name.
      * @param shortcutIds The IDs of the shortcut to be pinned.
@@ -613,8 +619,8 @@
     /**
      * Returns the icon for this shortcut, without any badging for the profile.
      *
-     * <p>Callers must be allowed to access the shortcut information, as defined in {@link
-     * #hasShortcutHostPermission()}.
+     * <p>The calling launcher application must be allowed to access the shortcut information,
+     * as defined in {@link #hasShortcutHostPermission()}.
      *
      * @param density The preferred density of the icon, zero for default density. Use
      * density DPI values from {@link DisplayMetrics}.
@@ -661,14 +667,14 @@
     /**
      * Returns the shortcut icon with badging appropriate for the profile.
      *
-     * <p>Callers must be allowed to access the shortcut information, as defined in {@link
-     * #hasShortcutHostPermission()}.
+     * <p>The calling launcher application must be allowed to access the shortcut information,
+     * as defined in {@link #hasShortcutHostPermission()}.
      *
      * @param density Optional density for the icon, or 0 to use the default density. Use
      * @return A badged icon for the shortcut.
      *
      * @see ShortcutManager
-     * @see #getShortcutBadgedIconDrawable(ShortcutInfo, int)
+     * @see #getShortcutIconDrawable(ShortcutInfo, int)
      * @see DisplayMetrics
      */
     public Drawable getShortcutBadgedIconDrawable(ShortcutInfo shortcut, int density) {
@@ -681,8 +687,8 @@
     /**
      * Starts a shortcut.
      *
-     * <p>Callers must be allowed to access the shortcut information, as defined in {@link
-     * #hasShortcutHostPermission()}.
+     * <p>The calling launcher application must be allowed to access the shortcut information,
+     * as defined in {@link #hasShortcutHostPermission()}.
      *
      * @param packageName The target shortcut package name.
      * @param shortcutId The target shortcut ID.
@@ -703,8 +709,8 @@
     /**
      * Launches a shortcut.
      *
-     * <p>Callers must be allowed to access the shortcut information, as defined in {@link
-     * #hasShortcutHostPermission()}.
+     * <p>The calling launcher application must be allowed to access the shortcut information,
+     * as defined in {@link #hasShortcutHostPermission()}.
      *
      * @param shortcut The target shortcut.
      * @param sourceBounds The Rect containing the source bounds of the clicked icon.
diff --git a/core/java/android/content/pm/PackageParser.java b/core/java/android/content/pm/PackageParser.java
index 5305c9f..503ca09 100644
--- a/core/java/android/content/pm/PackageParser.java
+++ b/core/java/android/content/pm/PackageParser.java
@@ -702,8 +702,10 @@
 
     private static PackageLite parseMonolithicPackageLite(File packageFile, int flags)
             throws PackageParserException {
+        Trace.traceBegin(TRACE_TAG_PACKAGE_MANAGER, "parseApkLite");
         final ApkLite baseApk = parseApkLite(packageFile, flags);
         final String packagePath = packageFile.getAbsolutePath();
+        Trace.traceEnd(TRACE_TAG_PACKAGE_MANAGER);
         return new PackageLite(packagePath, baseApk, null, null, null);
     }
 
@@ -718,6 +720,7 @@
         String packageName = null;
         int versionCode = 0;
 
+        Trace.traceBegin(TRACE_TAG_PACKAGE_MANAGER, "parseApkLite");
         final ArrayMap<String, ApkLite> apks = new ArrayMap<>();
         for (File file : files) {
             if (isApkFile(file)) {
@@ -749,6 +752,7 @@
                 }
             }
         }
+        Trace.traceEnd(TRACE_TAG_PACKAGE_MANAGER);
 
         final ApkLite baseApk = apks.remove(null);
         if (baseApk == null) {
diff --git a/core/java/android/content/pm/ResolveInfo.java b/core/java/android/content/pm/ResolveInfo.java
index c9be6ed..b5df4d7 100644
--- a/core/java/android/content/pm/ResolveInfo.java
+++ b/core/java/android/content/pm/ResolveInfo.java
@@ -68,12 +68,6 @@
     public EphemeralResolveInfo ephemeralResolveInfo;
 
     /**
-     * A ResolveInfo that points at the ephemeral installer.
-     * @hide
-     */
-    public ResolveInfo ephemeralInstaller;
-
-    /**
      * The IntentFilter that was matched for this ResolveInfo.
      */
     public IntentFilter filter;
diff --git a/core/java/android/content/pm/ShortcutInfo.java b/core/java/android/content/pm/ShortcutInfo.java
index 0ec1623..ed0ac53 100644
--- a/core/java/android/content/pm/ShortcutInfo.java
+++ b/core/java/android/content/pm/ShortcutInfo.java
@@ -770,17 +770,21 @@
          * Sets the target activity.  A shortcut will be shown along with this activity's icon
          * on the launcher.
          *
-         * <p>This is a mandatory field when publishing a new shortcut with
-         * {@link ShortcutManager#addDynamicShortcuts(List)} or
-         * {@link ShortcutManager#setDynamicShortcuts(List)}.
-         *
+         * When selecting a target activity, keep the following in mind:
          * <ul>
-         * <li>Only "main" activities (ones with an intent filter for
-         * {@link Intent#ACTION_MAIN} and {@link Intent#CATEGORY_LAUNCHER}) can be target
+         * <li>All dynamic shortcuts must have a target activity.  When a shortcut with no target
+         * activity is published using
+         * {@link ShortcutManager#addDynamicShortcuts(List)} or
+         * {@link ShortcutManager#setDynamicShortcuts(List)},
+         * the first main activity defined in the application's <code>AndroidManifest.xml</code>
+         * file is used.
+         *
+         * <li>Only "main" activities&mdash;ones that define the {@link Intent#ACTION_MAIN}
+         * and {@link Intent#CATEGORY_LAUNCHER} intent filters&mdash;can be target
          * activities.
          *
-         * <li>By default, the first main activity defined in the application manifest will be
-         * the target.
+         * <li>By default, the first main activity defined in the application manifest is
+         * the target activity.
          *
          * <li>A target activity must belong to the publisher application.
          * </ul>
@@ -806,8 +810,8 @@
          * and will be ignored.
          *
          * <p>Only icons created with {@link Icon#createWithBitmap(Bitmap)} and
-         * {@link Icon#createWithResource} are supported.  Other types such as URI based icons
-         * are not supported.
+         * {@link Icon#createWithResource} are supported.
+         * Other types, such as URI-based icons, are not supported.
          *
          * @see LauncherApps#getShortcutIconDrawable(ShortcutInfo, int)
          * @see LauncherApps#getShortcutBadgedIconDrawable(ShortcutInfo, int)
@@ -836,9 +840,9 @@
          * {@link ShortcutManager#addDynamicShortcuts(List)} or
          * {@link ShortcutManager#setDynamicShortcuts(List)}.
          *
-         * <p>This field is intended for a concise description of a shortcut.
+         * <p>This field is intended to be a concise description of a shortcut.
          *
-         * <p>The recommended max length is 10 characters.
+         * <p>The recommended maximum length is 10 characters.
          *
          * @see ShortcutInfo#getShortLabel()
          */
@@ -866,7 +870,7 @@
          * <p>This field is intended to be more descriptive than the shortcut title.  The launcher
          * shows this instead of the short title when it has enough space.
          *
-         * <p>The recommend max length is 25 characters.
+         * <p>The recommend maximum length is 25 characters.
          *
          * @see ShortcutInfo#getLongLabel()
          */
@@ -913,7 +917,8 @@
         }
 
         /**
-         * Sets the message that should be shown when a shortcut is launched when disabled.
+         * Sets the message that should be shown when the user attempts to start a shortcut that
+         * is disabled.
          *
          * @see ShortcutInfo#getDisabledMessage()
          */
@@ -941,20 +946,19 @@
         }
 
         /**
-         * Sets the intent of a shortcut.
+         * Sets the intent of a shortcut.  Alternatively, {@link #setIntents(Intent[])} can be used
+         * to launch an activity with other activities in the back stack.
          *
          * <p>This is a mandatory field when publishing a new shortcut with
          * {@link ShortcutManager#addDynamicShortcuts(List)} or
          * {@link ShortcutManager#setDynamicShortcuts(List)}.
          *
-         * <p>A shortcut can launch any intent that the publisher application has a permission to
-         * launch -- for example, a shortcut can launch an unexported activity within the publisher
-         * application.
+         * <p>A shortcut can launch any intent that the publisher application has permission to
+         * launch.  For example, a shortcut can launch an unexported activity within the publisher
+         * application.  A shortcut intent doesn't have to point at the target activity.
          *
-         * <p>A shortcut intent doesn't have to point at the target activity.
-         *
-         * <p>{@code intent} can contain extras, but only values of the primitive types are
-         * supported so the system can persist them.
+         * <p>The given {@code intent} can contain extras, but these extras must contain values
+         * of primitive types in order for the system to persist these values.
          *
          * @see ShortcutInfo#getIntent()
          * @see #setIntents(Intent[])
@@ -965,7 +969,9 @@
         }
 
         /**
-         * Sets multiple intents instead of a single intent.
+         * Sets multiple intents instead of a single intent, in order to launch an activity with
+         * other activities in back stack.  Use {@link TaskStackBuilder} to build intents.
+         * See the {@link ShortcutManager} javadoc for details.
          *
          * @see Builder#setIntent(Intent)
          * @see ShortcutInfo#getIntents()
@@ -1000,10 +1006,10 @@
         }
 
         /**
-         * Extras that application can set to any purposes.
+         * Extras that application can set for any purpose.
          *
-         * <p>Applications can store any meta-data of
-         * shortcuts in extras, and retrieve later from {@link ShortcutInfo#getExtras()}.
+         * <p>Applications can store arbitrary shortcut metadata in extras and retrieve the
+         * metadata later using {@link ShortcutInfo#getExtras()}.
          */
         @NonNull
         public Builder setExtras(@NonNull PersistableBundle extras) {
@@ -1023,9 +1029,9 @@
     /**
      * Returns the ID of a shortcut.
      *
-     * <p>Shortcut IDs are unique within each publisher application, and must be stable across
-     * devices to that shortcuts will still be valid when restored.  See {@link ShortcutManager}
-     * for details.
+     * <p>Shortcut IDs are unique within each publisher application and must be stable across
+     * devices so that shortcuts will still be valid when restored on a different device.
+     * See {@link ShortcutManager} for details.
      */
     @NonNull
     public String getId() {
@@ -1043,8 +1049,9 @@
     /**
      * Return the target activity.
      *
-     * <p>This has nothing to do with the activity that this shortcut will launch.  Launcher
-     * applications should show a shortcut along with the launcher icon for this activity.
+     * <p>This has nothing to do with the activity that this shortcut will launch.
+     * Launcher applications should show the launcher icon for the returned activity alongside
+     * this shortcut.
      *
      * @see Builder#setActivity
      */
@@ -1125,7 +1132,8 @@
     }
 
     /**
-     * Return the message that should be shown when a shortcut in disabled state is launched.
+     * Return the message that should be shown when the user attempts to start a shortcut
+     * that is disabled.
      *
      * @see Builder#setDisabledMessage(CharSequence)
      */
@@ -1140,7 +1148,7 @@
     }
 
     /**
-     * Return the categories.
+     * Return the shortcut's categories.
      *
      * @see Builder#setCategories(Set)
      */
@@ -1150,7 +1158,8 @@
     }
 
     /**
-     * Return the intent. If setIntents() was used, then return the last intent in the array.
+     * Returns the intent that is executed when the user selects this shortcut.
+     * If setIntents() was used, then return the last intent in the array.
      *
      * <p>Launcher applications <b>cannot</b> see the intent.  If a {@link ShortcutInfo} is
      * obtained via {@link LauncherApps}, then this method will always return null.
@@ -1280,7 +1289,7 @@
     }
 
     /**
-     * {@link UserHandle} on which the publisher created a shortcut.
+     * {@link UserHandle} on which the publisher created this shortcut.
      */
     public UserHandle getUserHandle() {
         return UserHandle.of(mUserId);
@@ -1330,7 +1339,7 @@
     }
 
     /**
-     * Return whether a shortcut is published AndroidManifest.xml or not.  If {@code true},
+     * Return whether a shortcut is published from AndroidManifest.xml or not.  If {@code true},
      * it's also {@link #isImmutable()}.
      *
      * <p>When an app is upgraded and a shortcut is no longer published from AndroidManifest.xml,
@@ -1438,11 +1447,11 @@
      *     <li>{@link #getUserHandle()}
      * </ul>
      *
-     * <p>{@link ShortcutInfo}s passed to
-     * {@link LauncherApps.Callback#onShortcutsChanged(String, List, UserHandle)}
-     * as well as returned by {@link LauncherApps#getShortcuts(ShortcutQuery, UserHandle)} with
-     * the {@link ShortcutQuery#FLAG_GET_KEY_FIELDS_ONLY} option will only have key information
-     * for performance reasons.
+     * <p>For performance reasons, shortcuts passed to
+     * {@link LauncherApps.Callback#onShortcutsChanged(String, List, UserHandle)} as well as those
+     * returned from {@link LauncherApps#getShortcuts(ShortcutQuery, UserHandle)}
+     * while using the {@link ShortcutQuery#FLAG_GET_KEY_FIELDS_ONLY} option contain only key
+     * information.
      */
     public boolean hasKeyFieldsOnly() {
         return hasFlags(FLAG_KEY_FIELDS_ONLY);
diff --git a/core/java/android/content/pm/ShortcutManager.java b/core/java/android/content/pm/ShortcutManager.java
index cfd3442..99d578b 100644
--- a/core/java/android/content/pm/ShortcutManager.java
+++ b/core/java/android/content/pm/ShortcutManager.java
@@ -18,6 +18,7 @@
 import android.annotation.NonNull;
 import android.annotation.TestApi;
 import android.annotation.UserIdInt;
+import android.app.Activity;
 import android.app.usage.UsageStatsManager;
 import android.content.Context;
 import android.content.Intent;
@@ -30,35 +31,40 @@
 import java.util.List;
 
 /**
- * ShortcutManager manages "launcher shortcuts" (or simply "shortcuts").  Shortcuts provide user
- * with quick
- * ways to access activities other than the main activity from the launcher to users.  For example,
- * an email application may publish the "compose new email" action which will directly open the
- * compose activity.  The {@link ShortcutInfo} class represents shortcuts.
+ * The ShortcutManager manages "launcher shortcuts" (or simply "shortcuts").  Shortcuts provide
+ * users
+ * with quick access to activities other than an application's main activity in the currently-active
+ * launcher.  For example,
+ * an email application may publish the "compose new email" action, which will directly open the
+ * compose activity.  The {@link ShortcutInfo} class contains information about each of the
+ * shortcuts themselves.
  *
  * <h3>Dynamic Shortcuts and Manifest Shortcuts</h3>
  *
  * There are two ways to publish shortcuts: manifest shortcuts and dynamic shortcuts.
  *
  * <ul>
- * <li>Manifest shortcuts are declared in a resource XML which is referred to from
- * AndroidManifest.xml.  Manifest shortcuts are published when an application is installed,
- * and are updated when an application is upgraded with an updated XML file.
- * Manifest shortcuts are immutable and their
- * definitions (e.g. icons and labels) can not be changed dynamically (without upgrading the
- * publisher application).
+ * <li>Manifest shortcuts are declared in a resource
+ * XML, which is referenced in the publisher application's <code>AndroidManifest.xml</code> file.
+ * Manifest shortcuts are published when an application is installed,
+ * and the details of these shortcuts change when an application is upgraded with an updated XML
+ * file.
+ * Manifest shortcuts are immutable, and their
+ * definitions, such as icons and labels, cannot be changed dynamically without upgrading the
+ * publisher application.
  *
- * <li>Dynamic shortcuts are published at runtime with {@link ShortcutManager} APIs.
- * Applications can publish, update and remove dynamic shortcuts at runtime with certain limitations
- * described below.
+ * <li>Dynamic shortcuts are published at runtime using the {@link ShortcutManager} APIs.
+ * Applications can publish, update, and remove dynamic shortcuts at runtime.
  * </ul>
  *
- * <p>Only "main" activities (i.e. activities that handle the {@code MAIN} action and the
- * {@code LAUNCHER} category) can have shortcuts.  If an application has multiple main activities,
- * they will have different set of shortcuts.
+ * <p>Only "main" activities&mdash;activities that handle the {@code MAIN} action and the
+ * {@code LAUNCHER} category&mdash;can have shortcuts.
+ * If an application has multiple main activities, these activities will have different sets
+ * of shortcuts.
  *
- * <p>Dynamic shortcuts and manifest shortcuts are shown by launcher applications when the user
- * takes a certain action (e.g. long-press) on an application launcher icon.
+ * <p>Dynamic shortcuts and manifest shortcuts are shown in the currently active launcher when
+ * the user long-presses on an application launcher icon.  The actual gesture may be different
+ * depending on the launcher application.
  *
  * <p>Each launcher icon can have at most {@link #getMaxShortcutCountPerActivity()} number of
  * dynamic and manifest shortcuts combined.
@@ -67,69 +73,162 @@
  * <h3>Pinning Shortcuts</h3>
  *
  * Launcher applications allow users to "pin" shortcuts so they're easier to access.  Both manifest
- * and dynamic shortcuts can be pinned, to avoid user's confusion.
+ * and dynamic shortcuts can be pinned.
  * Pinned shortcuts <b>cannot</b> be removed by publisher
- * applications -- they are only removed when the publisher is uninstalled. (Or the user performs
- * "clear data" on the publisher application on the Settings application.)
+ * applications; they're removed only when the user removes them,
+ * when the publisher application is uninstalled, or when the
+ * user performs the "clear data" action on the publisher application from the device's Settings
+ * application.
  *
- * <p>Publisher can however "disable" pinned shortcuts so they cannot be launched.  See below
- * for details.
+ * <p>However, the publisher application can <em>disable</em> pinned shortcuts so they cannot be
+ * started.  See the following sections for details.
  *
  *
  * <h3>Updating and Disabling Shortcuts</h3>
  *
  * <p>When a dynamic shortcut is pinned, even when the publisher removes it as a dynamic shortcut,
- * the pinned shortcut will still be available and launchable.  This allows an application to have
- * more than {@link #getMaxShortcutCountPerActivity()} number of shortcuts -- for example, suppose
- * {@link #getMaxShortcutCountPerActivity()} is 5:
+ * the pinned shortcut will still be visible and launchable.  This allows an application to have
+ * more than {@link #getMaxShortcutCountPerActivity()} number of shortcuts.
+ *
+ * <p>For example, suppose {@link #getMaxShortcutCountPerActivity()} is 5:
  * <ul>
  *     <li>A chat application publishes 5 dynamic shortcuts for the 5 most recent
  *     conversations, "c1" - "c5".
  *
- *     <li>The user pins all of the 5 shortcuts.
+ *     <li>The user pins all 5 of the shortcuts.
  *
- *     <li>Later, the user has 3 newer conversations ("c6", "c7" and "c8"), so the application
- *     re-publishes dynamic shortcuts and now it has the dynamic shortcuts "c4", "c5", "c6", "c7"
- *     and "c8".  The publisher has to remove "c1", "c2" and "c3" because it can't have more than
+ *     <li>Later, the user has started 3 additional conversations ("c6", "c7", and "c8"),
+ *     so the publisher application
+ *     re-publishes its dynamic shortcuts.  The new dynamic shortcut list is:
+ *     "c4", "c5", "c6", "c7", and "c8".
+ *     The publisher application has to remove "c1", "c2", and "c3" because it can't have more than
  *     5 dynamic shortcuts.
  *
  *     <li>However, even though "c1", "c2" and "c3" are no longer dynamic shortcuts, the pinned
- *     shortcuts for those conversations are still available and launchable.
+ *     shortcuts for these conversations are still available and launchable.
  *
- *     <li>At this point, the application has 8 shortcuts in total, including the 3 pinned
+ *     <li>At this point, the user can access a total of 8 shortcuts that link to activities in
+ *     the publisher application, including the 3 pinned
  *     shortcuts, even though it's allowed to have at most 5 dynamic shortcuts.
  *
  *     <li>The application can use {@link #updateShortcuts(List)} to update any of the existing
  *     8 shortcuts, when, for example, the chat peers' icons have changed.
  * </ul>
- * {@link #addDynamicShortcuts(List)} and {@link #setDynamicShortcuts(List)} can also be used
- * to update existing shortcuts with the same IDs, but they <b>cannot</b> be used for
- * non-dynamic pinned shortcuts because these two APIs will always try to make the passed
- * shortcuts dynamic.
+ * The {@link #addDynamicShortcuts(List)} and {@link #setDynamicShortcuts(List)} methods
+ * can also be used
+ * to update existing shortcuts with the same IDs, but they <b>cannot</b> be used
+ * for updating non-dynamic, pinned shortcuts because these two methods try to convert the given
+ * lists of shortcuts to dynamic shortcuts.
  *
  *
  * <h4>Disabling Manifest Shortcuts</h4>
+ * When an application is upgraded and the new version
+ * no longer uses a manifest shortcut that appeared in the previous version, this deprecated
+ * shortcut will no longer be published as a manifest shortcut.
+ *
+ * <p>If the deprecated shortcut is pinned, then the pinned shortcut will remain on the launcher,
+ * but it will be disabled automatically.
+ * Note that, in this case, the pinned shortcut is no longer a manifest shortcut, but it's
+ * still <b>immutable</b> and cannot be updated using the {@link ShortcutManager} APIs.
+ *
+ *
+ * <h4>Disabling Dynamic Shortcuts</h4>
  * Sometimes pinned shortcuts become obsolete and may not be usable.  For example, a pinned shortcut
- * to a group chat will be unusable when the group chat room is deleted.  In cases like this,
+ * to a group chat will be unusable when the associated group chat is deleted.  In cases like this,
  * applications should use {@link #disableShortcuts(List)}, which will remove the specified dynamic
- * shortcuts and also make the pinned shortcuts un-launchable, if any.
- * {@link #disableShortcuts(List, CharSequence)} can also be used to disable shortcuts with
- * a custom error message that will be shown when the user starts the shortcut.
+ * shortcuts and also make any specified pinned shortcuts un-launchable.
+ * The {@link #disableShortcuts(List, CharSequence)} method can also be used to disabled shortcuts
+ * and show users a custom error message when they attempt to launch the disabled shortcuts.
  *
- * <h4>Disabling Manifest Shortcuts</h4>
- * When an application is upgraded and the new version no longer has a manifest shortcut that
- * the previous version had, this shortcut will no longer be published as a manifest shortcut.
  *
- * <p>If the shortcut is pinned, then the pinned shortcut will remain on the launcher, but will be
- * disabled.  Note in this case, the pinned shortcut is no longer a manifest shortcut, but is
- * still <b>immutable</b> and cannot be updated with the {@link ShortcutManager} APIs.
+ * <h3>Publishing Manifest Shortcuts</h3>
  *
+ * In order to add manifest shortcuts to your application, first add
+ * {@code <meta-data android:name="android.app.shortcuts" />} to your main activity in
+ * AndroidManifest.xml:
+ * <pre>
+ * &lt;manifest xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;
+ *   package=&quot;com.example.myapplication&quot;&gt;
+ *   &lt;application . . .&gt;
+ *     &lt;activity android:name=&quot;Main&quot;&gt;
+ *       &lt;intent-filter&gt;
+ *         &lt;action android:name=&quot;android.intent.action.MAIN&quot; /&gt;
+ *         &lt;category android:name=&quot;android.intent.category.LAUNCHER&quot; /&gt;
+ *       &lt;/intent-filter&gt;
+ *       <b>&lt;meta-data android:name=&quot;android.app.shortcuts&quot; android:resource=&quot;@xml/shortcuts&quot;/&gt;</b>
+ *     &lt;/activity&gt;
+ *   &lt;/application&gt;
+ * &lt;/manifest&gt;
+ * </pre>
+ *
+ * Then, define your application's manifest shortcuts in the <code>res/xml/shortcuts.xml</code>
+ * file:
+ * <pre>
+ * &lt;shortcuts xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot; &gt;
+ *   &lt;shortcut
+ *     android:shortcutId=&quot;compose&quot;
+ *     android:enabled=&quot;true&quot;
+ *     android:icon=&quot;@drawable/compose_icon&quot;
+ *     android:shortcutShortLabel=&quot;@string/compose_shortcut_short_label1&quot;
+ *     android:shortcutLongLabel=&quot;@string/compose_shortcut_long_label1&quot;
+ *     android:shortcutDisabledMessage=&quot;@string/compose_disabled_message1&quot;
+ *     &gt;
+ *     &lt;intent
+ *       android:action=&quot;android.intent.action.VIEW&quot;
+ *       android:targetPackage=&quot;com.example.myapplication&quot;
+ *       android:targetClass=&quot;com.example.myapplication.ComposeActivity&quot; /&gt;
+ *     &lt;!-- more intents can go here; see below --&gt;
+ *     &lt;categories android:name=&quot;android.shortcut.conversation&quot; /&gt;
+ *   &lt;/shortcut&gt;
+ *   &lt;!-- more shortcuts can go here --&gt;
+ * &lt;/shortcuts&gt;
+ * </pre>
+ *
+ * The following list includes descriptions for the different attributes within a manifest shortcut:
+ * <dl>
+ *   <dt>android:shortcutId</dt>
+ *   <dd>Mandatory shortcut ID</dd>
+ *
+ *   <dt>android:enabled</dt>
+ *   <dd>Default is {@code true}.  Can be set to {@code false} in order
+ *   to disable a manifest shortcut that was published in a previous version and and set a custom
+ *   disabled message.  If a custom disabled message is not needed, then a manifest shortcut can
+ *   be simply removed from the XML file rather than keeping it with {@code enabled="false"}.</dd>
+ *
+ *   <dt>android:icon</dt>
+ *   <dd>Shortcut icon.</dd>
+ *
+ *   <dt>android:shortcutShortLabel</dt>
+ *   <dd>Mandatory shortcut short label.
+ *   See {@link ShortcutInfo.Builder#setShortLabel(CharSequence)}.</dd>
+ *
+ *   <dt>android:shortcutLongLabel</dt>
+ *   <dd>Shortcut long label.
+ *   See {@link ShortcutInfo.Builder#setLongLabel(CharSequence)}.</dd>
+ *
+ *   <dt>android:shortcutDisabledMessage</dt>
+ *   <dd>When {@code android:enabled} is set to
+ *   {@code false}, this attribute is used to display a custom disabled message.</dd>
+ *
+ *   <dt>intent</dt>
+ *   <dd>Intent to launch when the user selects the shortcut.
+ *   {@code android:action} is mandatory.
+ *   See <a href="{@docRoot}guide/topics/ui/settings.html#Intents">Using intents</a> for the
+ *   other supported tags.
+ *   You can provide multiple intents for a single shortcut so that an activity is launched
+ *   with other activities in the back stack. See {@link android.app.TaskStackBuilder} for details.
+ *   </dd>
+ *   <dt>categories</dt>
+ *   <dd>Specify shortcut categories.  Currently only
+ *   {@link ShortcutInfo#SHORTCUT_CATEGORY_CONVERSATION} is defined in the framework.
+ *   </dd>
+ * </dl>
  *
  * <h3>Publishing Dynamic Shortcuts</h3>
  *
  * Applications can publish dynamic shortcuts with {@link #setDynamicShortcuts(List)}
- * or {@link #addDynamicShortcuts(List)}.  {@link #updateShortcuts(List)} can also be used to
- * update existing (mutable) shortcuts.
+ * or {@link #addDynamicShortcuts(List)}.  The {@link #updateShortcuts(List)} method can also be
+ * used to update existing, mutable shortcuts.
  * Use {@link #removeDynamicShortcuts(List)} or {@link #removeAllDynamicShortcuts()} to remove
  * dynamic shortcuts.
  *
@@ -148,165 +247,141 @@
  * </pre>
  *
  *
- * <h3>Publishing Manifest Shortcuts</h3>
+ * <h3>Shortcut Intents</h3>
+ * Dynamic shortcuts can be published with any set of {@link Intent#addFlags Intent} flags.
+ * Typically, {@link Intent#FLAG_ACTIVITY_CLEAR_TASK} is specified, possibly along with other
+ * flags; otherwise, if the application is already running, the application is simply brought to
+ * the foreground, and the target activity may not appear.
  *
- * In order to add manifest shortcuts to your application, first add
- * {@code <meta-data android:name="android.app.shortcuts" />} to your main activity in
- * AndroidManifest.xml.
- * <pre>
- * &lt;manifest xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;
- *   package=&quot;com.example.myapplication&quot;&gt;
- *   &lt;application . . .&gt;
- *     &lt;activity android:name=&quot;Main&quot;&gt;
- *       &lt;intent-filter&gt;
- *         &lt;action android:name=&quot;android.intent.action.MAIN&quot; /&gt;
- *         &lt;category android:name=&quot;android.intent.category.LAUNCHER&quot; /&gt;
- *       &lt;/intent-filter&gt;
- *       <b>&lt;meta-data android:name=&quot;android.app.shortcuts&quot; android:resource=&quot;@xml/shortcuts&quot;/&gt;</b>
- *     &lt;/activity&gt;
- *   &lt;/application&gt;
- * &lt;/manifest&gt;
- * </pre>
+ * <p>The {@link ShortcutInfo.Builder#setIntents(Intent[])} method can be used instead of
+ * {@link ShortcutInfo.Builder#setIntent(Intent)} with {@link android.app.TaskStackBuilder}
+ * in order to launch an activity with other activities in the back stack.
+ * When the user selects a shortcut to load an activity with a back stack,
+ * then presses the back key, a "parent" activity will be shown instead of the user being
+ * navigated back to the launcher.
  *
- * Then define shortcuts in res/xml/shortcuts.xml.
- * <pre>
- * &lt;shortcuts xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot; &gt;
- *   &lt;shortcut
- *     android:shortcutId=&quot;compose&quot;
- *     android:enabled=&quot;true&quot;
- *     android:icon=&quot;@drawable/compose_icon&quot;
- *     android:shortcutShortLabel=&quot;@string/compose_shortcut_short_label1&quot;
- *     android:shortcutLongLabel=&quot;@string/compose_shortcut_short_label1&quot;
- *     android:shortcutDisabledMessage=&quot;@string/compose_disabled_message1&quot;
- *     &gt;
- *     &lt;intent
- *       android:action=&quot;android.intent.action.VIEW&quot;
- *       android:targetPackage=&quot;com.example.myapplication&quot;
- *       android:targetClass=&quot;com.example.myapplication.ComposeActivity&quot; /&gt;
- *     &lt;categories android:name=&quot;android.shortcut.conversation&quot; /&gt;
- *   &lt;/shortcut&gt;
- *   &lt;!-- more shortcut can go here --&gt;
- * &lt;/shortcuts&gt;
- * </pre>
- * <ul>
- *   <li>{@code android:shortcutId} Mandatory shortcut ID
+ * <p>Manifest shortcuts can also have multiple intents to achieve the same effect.
+ * In order to associate multiple {@link Intent} objects with a shortcut, simply list multiple
+ * <code>&lt;intent&gt;</code> elements within a single <code>&lt;shortcut&gt;</code> element.
+ * The last intent specifies what the user will see when they launch a shortcut.
  *
- *   <li>{@code android:enabled} Default is {@code true}.  Can be set to {@code false} in order
- *   to disable a manifest shortcut that was published on a previous version with a custom
- *   disabled message.  If a custom disabled message is not needed, then a manifest shortcut can
- *   be simply removed from the xml file rather than keeping it with {@code enabled="false"}.
+ * <p>Manifest shortcuts <b>cannot</b> have custom intent flags.
+ * The first intent of a manifest shortcut will always have {@link Intent#FLAG_ACTIVITY_NEW_TASK}
+ * and {@link Intent#FLAG_ACTIVITY_CLEAR_TASK} set.
+ * This means, when the application is already running, all the existing activities will be
+ * destroyed when a manifest shortcut is launched.
+ * If this behavior is not desirable, you can use a <em>trampoline activity</em>,
+ * or an invisible activity that starts another activity in {@link Activity#onCreate},
+ * then calls {@link Activity#finish()}.
+ * The first activity should include an attribute setting
+ * of {@code android:taskAffinity=""} in the application's <code>AndroidManifest.xml</code>
+ * file, and the intent within the manifest shortcut should point at this first activity.
  *
- *   <li>{@code android:icon} Shortcut icon.
  *
- *   <li>{@code android:shortcutShortLabel} Mandatory shortcut short label.
- *   See {@link ShortcutInfo.Builder#setShortLabel(CharSequence)}
- *
- *   <li>{@code android:shortcutLongLabel} Shortcut long label.
- *   See {@link ShortcutInfo.Builder#setLongLabel(CharSequence)}
- *
- *   <li>{@code android:shortcutDisabledMessage} When {@code android:enabled} is set to
- *   {@code false}, this can be used to set a custom disabled message.
- *
- *   <li>{@code intent} Intent to launch.  {@code android:action} is mandatory.
- *   See <a href="{@docRoot}guide/topics/ui/settings.html#Intents">Using intents</a> for the
- *   other supported tags.
- * </ul>
- *
- * <h3>Updating Shortcuts v.s. Re-publishing New One with Different ID</h3>
- * In order to avoid users' confusion, {@link #updateShortcuts(List)} should not be used to update
- * a shortcut to something that is conceptually different.
+ * <h3>Showing New Information in a Shortcut</h3>
+ * In order to avoid confusion, you should not use {@link #updateShortcuts(List)} to update
+ * a shortcut so that it contains conceptually different information.
  *
  * <p>For example, a phone application may publish the most frequently called contact as a dynamic
- * shortcut.  Over the time, this contact may change, but when it changes the application should
- * publish a new contact with a different ID with either
+ * shortcut.  Over time, this contact may change; when it does, the application should
+ * represent the changed contact with a new shortcut that contains a different ID, using either
  * {@link #setDynamicShortcuts(List)} or {@link #addDynamicShortcuts(List)}, rather than updating
  * the existing shortcut with {@link #updateShortcuts(List)}.
+ * This is because when the shortcut is pinned, changing
+ * it to reference a different contact will likely confuse the user.
  *
- * This is because when the shortcut is pinned, changing it to a different contact
- * will likely confuse the user.
- *
- * <p>On the other hand, when the contact's information (e.g. the name or picture) has changed,
- * then the application should use {@link #updateShortcuts(List)} so that the pinned shortcut
- * will be updated too.
+ * <p>On the other hand, when the
+ * contact's information has changed, such as the name or picture, the application should
+ * use {@link #updateShortcuts(List)} so that the pinned shortcut is updated too.
  *
  *
  * <h3>Shortcut Display Order</h3>
- * When the launcher show the shortcuts for a launcher icon, the showing order should be the
- * following:
+ * When the launcher displays the shortcuts that are associated with a particular launcher icon,
+ * the shortcuts should appear in the following order:
  * <ul>
  *   <li>First show manifest shortcuts
- *   ({@link ShortcutInfo#isDeclaredInManifest()} is {@code true}),
- *   and then dynamic shortcuts ({@link ShortcutInfo#isDynamic()} is {@code true}).
- *   <li>Within each category, sort by {@link ShortcutInfo#getRank()}.
+ *   (if {@link ShortcutInfo#isDeclaredInManifest()} is {@code true}),
+ *   and then show dynamic shortcuts (if {@link ShortcutInfo#isDynamic()} is {@code true}).
+ *   <li>Within each category of shortcuts (manifest and dynamic), sort the shortcuts in order
+ *   of increasing rank according to {@link ShortcutInfo#getRank()}.
  * </ul>
- * <p>Shortcut ranks are non-negative sequential integers for each target activity.  Ranks of
- * existing shortcuts can be updated with
- * {@link #updateShortcuts(List)} ({@link #addDynamicShortcuts(List)} and
- * {@link #setDynamicShortcuts(List)} may be used too).
+ * <p>Shortcut ranks are non-negative sequential integers
+ * that determine the order in which shortcuts appear, assuming that the shortcuts are all in
+ * the same category.
+ * Ranks of existing shortcuts can be updated with
+ * {@link #updateShortcuts(List)}; you can use {@link #addDynamicShortcuts(List)} and
+ * {@link #setDynamicShortcuts(List)}, too.
  *
- * <p>Ranks will be auto-adjusted so that they're unique for each target activity for each category
+ * <p>Ranks are auto-adjusted so that they're unique for each target activity in each category
  * (dynamic or manifest).  For example, if there are 3 dynamic shortcuts with ranks 0, 1 and 2,
- * adding another dynamic shortcut with rank = 1 means to place this shortcut at the second
- * position.  The third and forth shortcuts (that were originally second and third) will be adjusted
- * to 2 and 3 respectively.
+ * adding another dynamic shortcut with a rank of 1 represents a request to place this shortcut at
+ * the second position.
+ * In response, the third and fourth shortcuts move closer to the bottom of the shortcut list,
+ * with their ranks changing to 2 and 3, respectively.
  *
  * <h3>Rate Limiting</h3>
  *
- * Calls to {@link #setDynamicShortcuts(List)}, {@link #addDynamicShortcuts(List)} and
- * {@link #updateShortcuts(List)} may be rate-limited when called by background applications (i.e.
- * applications with no foreground activity or service).  When rate-limited, these APIs will return
- * {@code false}.
+ * Calls to {@link #setDynamicShortcuts(List)}, {@link #addDynamicShortcuts(List)}, and
+ * {@link #updateShortcuts(List)} may be rate-limited when called by background applications, or
+ * applications with no foreground activity or service.  When you attempt to call these methods
+ * from a background application after exceeding the rate limit, these APIs return {@code false}.
  *
- * <p>Applications with a foreground activity or service will not be rate-limited.
+ * <p>Applications with a foreground activity or service are not rate-limited.
  *
  * <p>Rate-limiting will be reset upon certain events, so that even background applications
- * will be able to call these APIs again (until they are rate-limited again).
+ * can call these APIs again until they are rate limit is reached again.
+ * These events include the following:
  * <ul>
- *   <li>When an application comes to foreground.
+ *   <li>When an application comes to the foreground.
  *   <li>When the system locale changes.
- *   <li>When the user performs "inline reply" on a notification.
+ *   <li>When the user performs an "inline reply" action on a notification.
  * </ul>
  *
+ * <p>When rate-limiting is active, {@link #isRateLimitingActive()} returns {@code true}.
+ *
  * <h4>Resetting rate-limiting for testing</h4>
  *
  * If your application is rate-limited during development or testing, you can use the
- * "Reset ShortcutManager rate-limiting" development option, or the following adb command to reset
- * it.
+ * "Reset ShortcutManager rate-limiting" development option or the following adb command to reset
+ * it:
  * <pre>
  * adb shell cmd shortcut reset-throttling [ --user USER-ID ]
  * </pre>
  *
- * <h3>Handling System Locale Change</h3>
+ * <h3>Handling System Locale Changes</h3>
  *
  * Applications should update dynamic and pinned shortcuts when the system locale changes
  * using the {@link Intent#ACTION_LOCALE_CHANGED} broadcast.
  *
- * <p>When the system locale changes, rate-limiting will be reset, so even background applications
- * what were previously rate-limited will be able to call {@link #updateShortcuts(List)}.
+ * <p>When the system locale changes, rate-limiting is reset, so even background applications
+ * can set dynamic shortcuts, add dynamic shortcuts, and update shortcuts until the rate limit
+ * is reached again.
  *
  *
  * <h3>Backup and Restore</h3>
  *
- * When an application has {@code android:allowBackup="true"} in its AndroidManifest.xml, pinned
- * shortcuts will be backed up automatically and restored when the user sets up a new device.
+ * When an application has the {@code android:allowBackup="true"} attribute assignment included
+ * in its <code>AndroidManifest.xml</code> file, pinned shortcuts are
+ * backed up automatically and are restored when the user sets up a new device.
  *
- * <h4>What will be backed up and what will not be backed up</h4>
+ * <h4>Categories of Shortcuts that are Backed Up</h4>
  *
  * <ul>
- *  <li>Pinned shortcuts will be backed up.  Bitmap icons will not be backed up by the system,
- *  but launcher applications should back them up and restore them, so the user will still get
- *  icons for pinned shortcuts on the launcher.  Applications can always use
+ *  <li>Pinned shortcuts are backed up.  Bitmap icons are not backed up by the system,
+ *  but launcher applications should back them up and restore them so that the user still sees icons
+ *  for pinned shortcuts on the launcher.  Applications can always use
  *  {@link #updateShortcuts(List)} to re-publish icons.
  *
- *  <li>Manifest shortcuts will not be backed up, but when an application is re-installed on a new
- *  device, they will be re-published from AndroidManifest.xml anyway.
+ *  <li>Manifest shortcuts are not backed up, but when an application is re-installed on a new
+ *  device, they are re-published from the <code>AndroidManifest.xml</code> file, anyway.
  *
- *  <li>Dynamic shortcuts will <b>not</b> be backed up.
+ *  <li>Dynamic shortcuts are <b>not</b> backed up.
  * </ul>
  *
- * <p>Because dynamic shortcuts will not restored, it is recommended that applications check
- * currently published dynamic shortcuts with {@link #getDynamicShortcuts()} when they start,
- * and re-publish dynamic shortcuts when necessary.
+ * <p>Because dynamic shortcuts are not restored, it is recommended that applications check
+ * currently-published dynamic shortcuts using {@link #getDynamicShortcuts()}
+ * each time they are launched, and they should re-publish
+ * dynamic shortcuts when necessary.
  *
  * <pre>
  * public class MainActivity extends Activity {
@@ -319,7 +394,7 @@
  *             // Application restored; re-publish dynamic shortcuts.
  *
  *             if (shortcutManager.getPinnedShortcuts().size() > 0) {
- *                 // Pinned shortcuts have been restored.  use updateShortcuts() to make sure
+ *                 // Pinned shortcuts have been restored.  Use updateShortcuts() to make sure
  *                 // they have up-to-date information.
  *             }
  *         }
@@ -332,30 +407,33 @@
  *
  * <h4>Backup/restore and shortcut IDs</h4>
  *
- * Because pinned shortcuts will be backed up and restored on new devices, shortcut IDs should be
- * meaningful across devices; that is, IDs should be either stable constant strings, or server-side
- * identifiers, rather than identifiers generated locally that may not make sense on other devices.
+ * Because pinned shortcuts are backed up and restored on new devices, shortcut IDs should be
+ * meaningful across devices; that is, IDs should contain either stable, constant strings
+ * or server-side identifiers,
+ * rather than identifiers generated locally that might not make sense on other devices.
  *
  *
  * <h3>Report Shortcut Usage and Prediction</h3>
  *
- * Launcher applications may be capable of predicting which shortcuts will most likely be used at
- * the moment with the shortcut usage history data.
+ * Launcher applications may be capable of predicting which shortcuts will most likely be
+ * used at a given time by examining the shortcut usage history data.
  *
- * <p>In order to provide launchers with such data, publisher applications should report which
- * shortcut is used with {@link #reportShortcutUsed(String)} when a shortcut is started,
+ * <p>In order to provide launchers with such data, publisher applications should
+ * report the shortcuts that are used with {@link #reportShortcutUsed(String)}
+ * when a shortcut is selected,
  * <b>or when an action equivalent to a shortcut is taken by the user even if it wasn't started
  * with the shortcut</b>.
  *
- * <p>For example, suppose a GPS navigation application exposes "navigate to work" as a shortcut.
- * Then it should report it when the user starts this shortcut, and also when the user navigates
- * to work within the application without using the shortcut.  This helps the launcher application
- * learn that the user wants to navigate to work at a certain time every weekday, so that the
- * launcher can show this shortcut in a suggestion list.
+ * <p>For example, suppose a GPS navigation application supports "navigate to work" as a shortcut.
+ * It should then report when the user selects this shortcut <b>and</b> when the user chooses
+ * to navigate to work within the application itself.
+ * This helps the launcher application
+ * learn that the user wants to navigate to work at a certain time every
+ * weekday, and it can then show this shortcut in a suggestion list at the right time.
  *
  * <h3>Launcher API</h3>
  *
- * {@link LauncherApps} provides APIs for launcher applications to access shortcuts.
+ * The {@link LauncherApps} class provides APIs for launcher applications to access shortcuts.
  */
 public class ShortcutManager {
     private static final String TAG = "ShortcutManager";
@@ -381,16 +459,16 @@
     }
 
     /**
-     * Publish a list of shortcuts.  All existing dynamic shortcuts from the caller application
-     * will be replaced.  If there's already pinned shortcuts with the same IDs, they will all be
-     * updated, unless they're immutable.
+     * Publish the list of shortcuts.  All existing dynamic shortcuts from the caller application
+     * will be replaced.  If there are already pinned shortcuts with the same IDs,
+     * the mutable pinned shortcuts are updated.
      *
      * <p>This API will be rate-limited.
      *
      * @return {@code true} if the call has succeeded. {@code false} if the call is rate-limited.
      *
      * @throws IllegalArgumentException if {@link #getMaxShortcutCountPerActivity()} is exceeded,
-     * or trying to update immutable shortcuts.
+     * or when trying to update immutable shortcuts.
      */
     public boolean setDynamicShortcuts(@NonNull List<ShortcutInfo> shortcutInfoList) {
         try {
@@ -428,15 +506,15 @@
     }
 
     /**
-     * Publish list of dynamic shortcuts.  If there's already dynamic or pinned shortcuts with
-     * the same IDs, they will all be updated, unless they're immutable.
+     * Publish the list of dynamic shortcuts.  If there are already dynamic or pinned shortcuts with
+     * the same IDs, each mutable shortcut is updated.
      *
      * <p>This API will be rate-limited.
      *
      * @return {@code true} if the call has succeeded. {@code false} if the call is rate-limited.
      *
      * @throws IllegalArgumentException if {@link #getMaxShortcutCountPerActivity()} is exceeded,
-     * or trying to update immutable shortcuts.
+     * or when trying to update immutable shortcuts.
      */
     public boolean addDynamicShortcuts(@NonNull List<ShortcutInfo> shortcutInfoList) {
         try {
@@ -485,13 +563,13 @@
 
     /**
      * Update all existing shortcuts with the same IDs.  Target shortcuts may be pinned and/or
-     * dynamic, but may not be immutable.
+     * dynamic, but they must not be immutable.
      *
      * <p>This API will be rate-limited.
      *
      * @return {@code true} if the call has succeeded. {@code false} if the call is rate-limited.
      *
-     * @throws IllegalArgumentException if trying to update immutable shortcuts.
+     * @throws IllegalArgumentException If trying to update immutable shortcuts.
      */
     public boolean updateShortcuts(List<ShortcutInfo> shortcutInfoList) {
         try {
@@ -503,7 +581,10 @@
     }
 
     /**
-     * Disable pinned shortcuts.  See {@link ShortcutManager}'s class javadoc for details.
+     * Disable pinned shortcuts.  For more details, see the Javadoc for the {@link ShortcutManager}
+     * class.
+     *
+     * @throws IllegalArgumentException If trying to disable immutable shortcuts.
      */
     public void disableShortcuts(@NonNull List<String> shortcutIds) {
         try {
@@ -536,8 +617,11 @@
     }
 
     /**
-     * Disable pinned shortcuts with a custom error message.
-     * See {@link ShortcutManager}'s class javadoc for details.
+     * Disable pinned shortcuts, showing the user a custom error message when they try to select
+     * the disabled shortcuts.
+     * For more details, see the Javadoc for the {@link ShortcutManager} class.
+     *
+     * @throws IllegalArgumentException If trying to disable immutable shortcuts.
      */
     public void disableShortcuts(@NonNull List<String> shortcutIds, CharSequence disabledMessage) {
         try {
@@ -550,7 +634,10 @@
     }
 
     /**
-     * Re-enable disabled pinned shortcuts.
+     * Re-enable pinned shortcuts that were previously disabled.  If the target shortcuts
+     * already enabled, this method does nothing.
+     *
+     * @throws IllegalArgumentException If trying to enable immutable shortcuts.
      */
     public void enableShortcuts(@NonNull List<String> shortcutIds) {
         try {
@@ -569,7 +656,7 @@
     }
 
     /**
-     * Return the max number of dynamic and manifest shortcuts that each launcher icon
+     * Return the maximum number of dynamic and manifest shortcuts that each launcher icon
      * can have at a time.
      */
     public int getMaxShortcutCountPerActivity() {
@@ -652,9 +739,10 @@
     }
 
     /**
-     * Applications that publish shortcuts should call this method whenever a shortcut is started
-     * or an action equivalent to a shortcut is taken.  See the {@link ShortcutManager} class
-     * javadoc for details.
+     * Applications that publish shortcuts should call this method
+     * whenever the user selects the shortcut containing the given ID or when the user completes
+     * an action in the application that is equivalent to selecting the shortcut.
+     * For more details, see the Javadoc for the {@link ShortcutManager} class
      *
      * <p>The information is accessible via {@link UsageStatsManager#queryEvents}
      * Typically, launcher applications use this information to build a prediction model
diff --git a/core/java/android/content/res/Configuration.java b/core/java/android/content/res/Configuration.java
index b2d518c..35d3dc3 100644
--- a/core/java/android/content/res/Configuration.java
+++ b/core/java/android/content/res/Configuration.java
@@ -725,11 +725,23 @@
     public static final int NATIVE_CONFIG_LAYOUTDIR = 0x4000;
 
     /**
-     * Construct an invalid Configuration.  You must call {@link #setToDefaults}
-     * for this object to be valid.  {@more}
+     * <p>Construct an invalid Configuration. This state is only suitable for constructing a
+     * Configuration delta that will be applied to some valid Configuration object. In order to
+     * create a valid standalone Configuration, you must call {@link #setToDefaults}. </p>
+     *
+     * <p>Example:</p>
+     * <pre class="prettyprint">
+     *     Configuration validConfig = new Configuration();
+     *     validConfig.setToDefaults();
+     *
+     *     Configuration deltaOnlyConfig = new Configuration();
+     *     deltaOnlyConfig.orientation = Configuration.ORIENTATION_LANDSCAPE;
+     *
+     *     validConfig.updateFrom(deltaOnlyConfig);
+     * </pre>
      */
     public Configuration() {
-        setToDefaults();
+        unset();
     }
 
     /**
@@ -939,6 +951,15 @@
         seq = 0;
     }
 
+    /**
+     * Set this object to completely undefined.
+     * @hide
+     */
+    public void unset() {
+        setToDefaults();
+        fontScale = 0;
+    }
+
     /** {@hide} */
     @Deprecated public void makeDefault() {
         setToDefaults();
diff --git a/core/java/android/content/res/ResourcesImpl.java b/core/java/android/content/res/ResourcesImpl.java
index aa80390..8233ad2 100644
--- a/core/java/android/content/res/ResourcesImpl.java
+++ b/core/java/android/content/res/ResourcesImpl.java
@@ -142,6 +142,7 @@
         mAssets = assets;
         mMetrics.setToDefaults();
         mDisplayAdjustments = displayAdjustments;
+        mConfiguration.setToDefaults();
         updateConfiguration(config, metrics, displayAdjustments.getCompatibilityInfo());
         mAssets.ensureStringBlocks();
     }
@@ -383,7 +384,10 @@
                     mMetrics.density =
                             mConfiguration.densityDpi * DisplayMetrics.DENSITY_DEFAULT_SCALE;
                 }
-                mMetrics.scaledDensity = mMetrics.density * mConfiguration.fontScale;
+
+                // Protect against an unset fontScale.
+                mMetrics.scaledDensity = mMetrics.density *
+                        (mConfiguration.fontScale != 0 ? mConfiguration.fontScale : 1.0f);
 
                 final int width, height;
                 if (mMetrics.widthPixels >= mMetrics.heightPixels) {
diff --git a/core/java/android/os/INetworkManagementService.aidl b/core/java/android/os/INetworkManagementService.aidl
index 013e77f..0c211d68 100644
--- a/core/java/android/os/INetworkManagementService.aidl
+++ b/core/java/android/os/INetworkManagementService.aidl
@@ -437,6 +437,7 @@
 
     void addInterfaceToLocalNetwork(String iface, in List<RouteInfo> routes);
     void removeInterfaceFromLocalNetwork(String iface);
+    int removeRoutesFromLocalNetwork(in List<RouteInfo> routes);
 
     void setAllowOnlyVpnForUids(boolean enable, in UidRange[] uidRanges);
 }
diff --git a/core/java/android/os/UserManager.java b/core/java/android/os/UserManager.java
index f893896..3fcc253 100644
--- a/core/java/android/os/UserManager.java
+++ b/core/java/android/os/UserManager.java
@@ -581,6 +581,16 @@
     public static final String DISALLOW_CAMERA = "no_camera";
 
     /**
+     * Specifies if a user is not allowed to unmute the device's master volume.
+     *
+     * @see DevicePolicyManager#setMasterVolumeMuted(ComponentName, boolean)
+     * @see DevicePolicyManager#clearUserRestriction(ComponentName, String)
+     * @see #getUserRestrictions()
+     * @hide
+     */
+    public static final String DISALLLOW_UNMUTE_DEVICE = "disallow_unmute_device";
+
+    /**
      * Specifies if a user is not allowed to use cellular data when roaming. This can only be set by
      * device owners. The default value is <code>false</code>.
      *
diff --git a/core/java/android/preference/PreferenceFragment.java b/core/java/android/preference/PreferenceFragment.java
index d4a3582..73fa01e 100644
--- a/core/java/android/preference/PreferenceFragment.java
+++ b/core/java/android/preference/PreferenceFragment.java
@@ -27,12 +27,14 @@
 import android.os.Bundle;
 import android.os.Handler;
 import android.os.Message;
+import android.text.TextUtils;
 import android.view.KeyEvent;
 import android.view.LayoutInflater;
 import android.view.View;
 import android.view.View.OnKeyListener;
 import android.view.ViewGroup;
 import android.widget.ListView;
+import android.widget.TextView;
 
 /**
  * Shows a hierarchy of {@link Preference} objects as
@@ -366,6 +368,20 @@
     private void bindPreferences() {
         final PreferenceScreen preferenceScreen = getPreferenceScreen();
         if (preferenceScreen != null) {
+            View root = getView();
+            if (root != null) {
+                View titleView = root.findViewById(android.R.id.title);
+                if (titleView instanceof TextView) {
+                    CharSequence title = preferenceScreen.getTitle();
+                    if (TextUtils.isEmpty(title)) {
+                        titleView.setVisibility(View.GONE);
+                    } else {
+                        ((TextView) titleView).setText(title);
+                        titleView.setVisibility(View.VISIBLE);
+                    }
+                }
+            }
+
             preferenceScreen.bind(getListView());
         }
         onBindPreferences();
diff --git a/core/java/android/preference/PreferenceScreen.java b/core/java/android/preference/PreferenceScreen.java
index b1317e6..2305b05 100644
--- a/core/java/android/preference/PreferenceScreen.java
+++ b/core/java/android/preference/PreferenceScreen.java
@@ -19,6 +19,8 @@
 import android.app.Dialog;
 import android.content.Context;
 import android.content.DialogInterface;
+import android.content.res.TypedArray;
+import android.graphics.drawable.Drawable;
 import android.os.Bundle;
 import android.os.Parcel;
 import android.os.Parcelable;
@@ -31,6 +33,7 @@
 import android.widget.AdapterView;
 import android.widget.ListAdapter;
 import android.widget.ListView;
+import android.widget.TextView;
 
 /**
  * Represents a top-level {@link Preference} that
@@ -91,13 +94,33 @@
     private Dialog mDialog;
 
     private ListView mListView;
-    
+
+    private int mLayoutResId = com.android.internal.R.layout.preference_list_fragment;
+    private Drawable mDividerDrawable;
+    private boolean mDividerSpecified;
+
     /**
      * Do NOT use this constructor, use {@link PreferenceManager#createPreferenceScreen(Context)}.
      * @hide-
      */
     public PreferenceScreen(Context context, AttributeSet attrs) {
         super(context, attrs, com.android.internal.R.attr.preferenceScreenStyle);
+
+        TypedArray a = context.obtainStyledAttributes(null,
+                com.android.internal.R.styleable.PreferenceScreen,
+                com.android.internal.R.attr.preferenceScreenStyle,
+                0);
+
+        mLayoutResId = a.getResourceId(
+                com.android.internal.R.styleable.PreferenceScreen_screenLayout,
+                mLayoutResId);
+        if (a.hasValueOrEmpty(com.android.internal.R.styleable.PreferenceScreen_divider)) {
+            mDividerDrawable =
+                    a.getDrawable(com.android.internal.R.styleable.PreferenceScreen_divider);
+            mDividerSpecified = true;
+        }
+
+        a.recycle();
     }
 
     /**
@@ -163,18 +186,30 @@
 
         LayoutInflater inflater = (LayoutInflater)
                 context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
-        View childPrefScreen = inflater.inflate(
-                com.android.internal.R.layout.preference_list_fragment, null);
+        View childPrefScreen = inflater.inflate(mLayoutResId, null);
+        View titleView = childPrefScreen.findViewById(android.R.id.title);
         mListView = (ListView) childPrefScreen.findViewById(android.R.id.list);
+        if (mDividerSpecified) {
+            mListView.setDivider(mDividerDrawable);
+        }
+
         bind(mListView);
 
         // Set the title bar if title is available, else no title bar
         final CharSequence title = getTitle();
         Dialog dialog = mDialog = new Dialog(context, context.getThemeResId());
         if (TextUtils.isEmpty(title)) {
+            if (titleView != null) {
+                titleView.setVisibility(View.GONE);
+            }
             dialog.getWindow().requestFeature(Window.FEATURE_NO_TITLE);
         } else {
-            dialog.setTitle(title);
+            if (titleView instanceof TextView) {
+                ((TextView) titleView).setText(title);
+                titleView.setVisibility(View.VISIBLE);
+            } else {
+                dialog.setTitle(title);
+            }
         }
         dialog.setContentView(childPrefScreen);
         dialog.setOnDismissListener(this);
diff --git a/core/java/android/provider/Settings.java b/core/java/android/provider/Settings.java
index 4f1b839..d4a3f76 100755
--- a/core/java/android/provider/Settings.java
+++ b/core/java/android/provider/Settings.java
@@ -440,6 +440,22 @@
             "android.settings.DISPLAY_SETTINGS";
 
     /**
+     * Activity Action: Show settings to allow configuration of Night display.
+     * <p>
+     * In some cases, a matching Activity may not exist, so ensure you
+     * safeguard against this.
+     * <p>
+     * Input: Nothing.
+     * <p>
+     * Output: Nothing.
+     *
+     * @hide
+     */
+    @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
+    public static final String ACTION_NIGHT_DISPLAY_SETTINGS =
+            "android.settings.NIGHT_DISPLAY_SETTINGS";
+
+    /**
      * Activity Action: Show settings to allow configuration of locale.
      * <p>
      * In some cases, a matching Activity may not exist, so ensure you
@@ -6265,19 +6281,35 @@
                 "automatic_storage_manager_last_run";
 
         /**
-         * Whether Downloads folder backup is enabled and should run on the device.
-         *
-         * @hide
-         */
-        public static final String DOWNLOADS_BACKUP_ENABLED = "downloads_backup_enabled";
-
-        /**
          * Whether SystemUI navigation keys is enabled.
          * @hide
          */
         public static final String SYSTEM_NAVIGATION_KEYS_ENABLED =
                 "system_navigation_keys_enabled";
 
+        /**
+         * Whether Downloads folder backup is enabled and should run on the device.
+         *
+         * @hide
+         */
+        public static final String DOWNLOADS_BACKUP_ENABLED = "downloads_backup_enabled";
+        
+        /**
+         * Whether Downloads folder backup should only occur if the device is using a metered
+         * network.
+         *
+         * @hide
+         */
+        public static final String DOWNLOADS_BACKUP_ALLOW_METERED =
+                "downloads_backup_allow_metered";
+
+        /**
+         * Whether Downloads folder backup should only occur if the device is charging.
+         *
+         * @hide
+         */
+        public static final String DOWNLOADS_BACKUP_CHARGING_ONLY =
+                "downloads_backup_charging_only";
 
         /**
          * This are the settings to be backed up.
diff --git a/core/java/android/text/SpannableStringInternal.java b/core/java/android/text/SpannableStringInternal.java
index 47e71be..4b02df86 100644
--- a/core/java/android/text/SpannableStringInternal.java
+++ b/core/java/android/text/SpannableStringInternal.java
@@ -33,6 +33,7 @@
             mText = source.toString().substring(start, end);
 
         mSpans = EmptyArray.OBJECT;
+        // Invariant: mSpanData.length = mSpans.length * COLUMNS
         mSpanData = EmptyArray.INT;
 
         if (source instanceof Spanned) {
@@ -99,7 +100,7 @@
             Object[] srcSpans = src.mSpans;
             mSpanCount = count;
             mSpans = ArrayUtils.newUnpaddedObjectArray(mSpanCount);
-            mSpanData = new int[mSpanCount * COLUMNS];
+            mSpanData = new int[mSpans.length * COLUMNS];
             for (int i = 0, j = 0; i < limit; i++) {
                 int spanStart = srcData[i * COLUMNS + START];
                 int spanEnd = srcData[i * COLUMNS + END];
diff --git a/core/java/android/view/DragAndDropPermissions.java b/core/java/android/view/DragAndDropPermissions.java
index 71afaaa..c198e1f 100644
--- a/core/java/android/view/DragAndDropPermissions.java
+++ b/core/java/android/view/DragAndDropPermissions.java
@@ -17,7 +17,7 @@
 package android.view;
 
 import android.app.Activity;
-import android.app.ActivityManagerNative;
+import android.os.Binder;
 import android.os.IBinder;
 import android.os.Parcel;
 import android.os.Parcelable;
@@ -54,7 +54,7 @@
 
     private final IDragAndDropPermissions mDragAndDropPermissions;
 
-    private IBinder mPermissionOwnerToken;
+    private IBinder mTransientToken;
 
     /**
      * Create a new {@link DragAndDropPermissions} object to control the access permissions for
@@ -98,9 +98,8 @@
      */
     public boolean takeTransient() {
         try {
-            mPermissionOwnerToken = ActivityManagerNative.getDefault().
-                    newUriPermissionOwner("drop");
-            mDragAndDropPermissions.takeTransient(mPermissionOwnerToken);
+            mTransientToken = new Binder();
+            mDragAndDropPermissions.takeTransient(mTransientToken);
         } catch (RemoteException e) {
             return false;
         }
@@ -113,7 +112,7 @@
     public void release() {
         try {
             mDragAndDropPermissions.release();
-            mPermissionOwnerToken = null;
+            mTransientToken = null;
         } catch (RemoteException e) {
         }
     }
@@ -139,11 +138,11 @@
     @Override
     public void writeToParcel(Parcel destination, int flags) {
         destination.writeStrongInterface(mDragAndDropPermissions);
-        destination.writeStrongBinder(mPermissionOwnerToken);
+        destination.writeStrongBinder(mTransientToken);
     }
 
     private DragAndDropPermissions(Parcel in) {
         mDragAndDropPermissions = IDragAndDropPermissions.Stub.asInterface(in.readStrongBinder());
-        mPermissionOwnerToken = in.readStrongBinder();
+        mTransientToken = in.readStrongBinder();
     }
 }
diff --git a/core/java/android/view/IWindowManager.aidl b/core/java/android/view/IWindowManager.aidl
index 9bc0bb4..0601219 100644
--- a/core/java/android/view/IWindowManager.aidl
+++ b/core/java/android/view/IWindowManager.aidl
@@ -173,7 +173,8 @@
             in CompatibilityInfo compatInfo, CharSequence nonLocalizedLabel, int labelRes,
             int icon, int logo, int windowFlags, IBinder transferFrom, boolean createIfNeeded);
     void setAppVisibility(IBinder token, boolean visible);
-    void notifyAppStopped(IBinder token, boolean stopped);
+    void notifyAppResumed(IBinder token, boolean wasStopped);
+    void notifyAppStopped(IBinder token);
     void startAppFreezingScreen(IBinder token, int configChanges);
     void stopAppFreezingScreen(IBinder token, boolean force);
     void removeAppToken(IBinder token);
diff --git a/core/java/android/view/RoundScrollbarRenderer.java b/core/java/android/view/RoundScrollbarRenderer.java
new file mode 100644
index 0000000..b77be8c
--- /dev/null
+++ b/core/java/android/view/RoundScrollbarRenderer.java
@@ -0,0 +1,123 @@
+/*
+ * Copyright (C) 2016 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.view;
+
+import android.graphics.Canvas;
+import android.graphics.Color;
+import android.graphics.Paint;
+import android.graphics.RectF;
+import android.graphics.Rect;
+
+/**
+ * Helper class for drawing round scroll bars on round Wear devices.
+ */
+class RoundScrollbarRenderer {
+    // The range of the scrollbar position represented as an angle in degrees.
+    private static final int SCROLLBAR_ANGLE_RANGE = 90;
+    private static final int MAX_SCROLLBAR_ANGLE_SWIPE = 16;
+    private static final int MIN_SCROLLBAR_ANGLE_SWIPE = 6;
+    private static final float WIDTH_PERCENTAGE = 0.02f;
+    private static final int DEFAULT_THUMB_COLOR = 0xFF757575;
+    private static final int DEFAULT_TRACK_COLOR = 0x21FFFFFF;
+
+    private final Paint mThumbPaint = new Paint();
+    private final Paint mTrackPaint = new Paint();
+    private final RectF mRect = new RectF();
+    private final View mParent;
+
+    public RoundScrollbarRenderer(View parent) {
+        // Paints for the round scrollbar.
+        // Set up the thumb paint
+        mThumbPaint.setAntiAlias(true);
+        mThumbPaint.setStrokeCap(Paint.Cap.ROUND);
+        mThumbPaint.setStyle(Paint.Style.STROKE);
+
+        // Set up the track paint
+        mTrackPaint.setAntiAlias(true);
+        mTrackPaint.setStrokeCap(Paint.Cap.ROUND);
+        mTrackPaint.setStyle(Paint.Style.STROKE);
+
+        mParent = parent;
+    }
+
+    public void drawRoundScrollbars(Canvas canvas, float alpha, Rect bounds) {
+        if (alpha == 0) {
+            return;
+        }
+        // Get information about the current scroll state of the parent view.
+        float maxScroll = mParent.computeVerticalScrollRange();
+        float scrollExtent = mParent.computeVerticalScrollExtent();
+        if (scrollExtent <= 0 || maxScroll <= scrollExtent) {
+            return;
+        }
+        float currentScroll = Math.max(0, mParent.computeVerticalScrollOffset());
+        float linearThumbLength = mParent.computeVerticalScrollExtent();
+        float thumbWidth = mParent.getWidth() * WIDTH_PERCENTAGE;
+        mThumbPaint.setStrokeWidth(thumbWidth);
+        mTrackPaint.setStrokeWidth(thumbWidth);
+
+        setThumbColor(applyAlpha(DEFAULT_THUMB_COLOR, alpha));
+        setTrackColor(applyAlpha(DEFAULT_TRACK_COLOR, alpha));
+
+        // Normalize the sweep angle for the scroll bar.
+        float sweepAngle = (linearThumbLength / maxScroll) * SCROLLBAR_ANGLE_RANGE;
+        sweepAngle = clamp(sweepAngle, MIN_SCROLLBAR_ANGLE_SWIPE, MAX_SCROLLBAR_ANGLE_SWIPE);
+        // Normalize the start angle so that it falls on the track.
+        float startAngle = (currentScroll * (SCROLLBAR_ANGLE_RANGE - sweepAngle))
+                / (maxScroll - linearThumbLength) - SCROLLBAR_ANGLE_RANGE / 2;
+        startAngle = clamp(startAngle, -SCROLLBAR_ANGLE_RANGE / 2,
+                SCROLLBAR_ANGLE_RANGE / 2 - sweepAngle);
+
+        // Draw the track and the scroll bar.
+        mRect.set(
+                bounds.left - thumbWidth / 2,
+                bounds.top,
+                bounds.right - thumbWidth / 2,
+                bounds.bottom);
+
+        canvas.drawArc(mRect, -SCROLLBAR_ANGLE_RANGE / 2, SCROLLBAR_ANGLE_RANGE, false,
+                mTrackPaint);
+        canvas.drawArc(mRect, startAngle, sweepAngle, false, mThumbPaint);
+    }
+
+    private static float clamp(float val, float min, float max) {
+        if (val < min) {
+            return min;
+        } else if (val > max) {
+            return max;
+        } else {
+            return val;
+        }
+    }
+
+    private static int applyAlpha(int color, float alpha) {
+        int alphaByte = (int) (Color.alpha(color) * alpha);
+        return Color.argb(alphaByte, Color.red(color), Color.green(color), Color.blue(color));
+    }
+
+    private void setThumbColor(int thumbColor) {
+        if (mThumbPaint.getColor() != thumbColor) {
+            mThumbPaint.setColor(thumbColor);
+        }
+    }
+
+    private void setTrackColor(int trackColor) {
+        if (mTrackPaint.getColor() != trackColor) {
+            mTrackPaint.setColor(trackColor);
+        }
+    }
+}
diff --git a/core/java/android/view/TextureView.java b/core/java/android/view/TextureView.java
index f4bf859..b34dfe0 100644
--- a/core/java/android/view/TextureView.java
+++ b/core/java/android/view/TextureView.java
@@ -355,17 +355,6 @@
         }
     }
 
-    /**
-     * @hide
-     */
-    @Override
-    protected void destroyHardwareResources() {
-        super.destroyHardwareResources();
-        destroySurface();
-        invalidateParentCaches();
-        invalidate(true);
-    }
-
     HardwareLayer getHardwareLayer() {
         if (mLayer == null) {
             if (mAttachInfo == null || mAttachInfo.mThreadedRenderer == null) {
diff --git a/core/java/android/view/View.java b/core/java/android/view/View.java
index 397bd07..8f480d6 100644
--- a/core/java/android/view/View.java
+++ b/core/java/android/view/View.java
@@ -40,6 +40,7 @@
 import android.content.res.TypedArray;
 import android.graphics.Bitmap;
 import android.graphics.Canvas;
+import android.graphics.Color;
 import android.graphics.Insets;
 import android.graphics.Interpolator;
 import android.graphics.LinearGradient;
@@ -2435,6 +2436,7 @@
      *          1                        PFLAG3_OVERLAPPING_RENDERING_FORCED_VALUE
      *         1                         PFLAG3_HAS_OVERLAPPING_RENDERING_FORCED
      *        1                          PFLAG3_TEMPORARY_DETACH
+     *       1                           PFLAG3_NO_REVEAL_ON_FOCUS
      * |-------|-------|-------|-------|
      */
 
@@ -2676,6 +2678,16 @@
      */
     static final int PFLAG3_TEMPORARY_DETACH = 0x2000000;
 
+    /**
+     * Flag indicating that the view does not wish to be revealed within its parent
+     * hierarchy when it gains focus. Expressed in the negative since the historical
+     * default behavior is to reveal on focus; this flag suppresses that behavior.
+     *
+     * @see #setRevealOnFocusHint(boolean)
+     * @see #getRevealOnFocusHint()
+     */
+    private static final int PFLAG3_NO_REVEAL_ON_FOCUS = 0x4000000;
+
     /* End of masks for mPrivateFlags3 */
 
     /**
@@ -3982,6 +3994,9 @@
      */
     String mStartActivityRequestWho;
 
+    @Nullable
+    private RoundScrollbarRenderer mRoundScrollbarRenderer;
+
     /**
      * Simple constructor to use when creating a view from code.
      *
@@ -5943,6 +5958,47 @@
     }
 
     /**
+     * Sets this view's preference for reveal behavior when it gains focus.
+     *
+     * <p>When set to true, this is a signal to ancestor views in the hierarchy that
+     * this view would prefer to be brought fully into view when it gains focus.
+     * For example, a text field that a user is meant to type into. Other views such
+     * as scrolling containers may prefer to opt-out of this behavior.</p>
+     *
+     * <p>The default value for views is true, though subclasses may change this
+     * based on their preferred behavior.</p>
+     *
+     * @param revealOnFocus true to request reveal on focus in ancestors, false otherwise
+     *
+     * @see #getRevealOnFocusHint()
+     */
+    public final void setRevealOnFocusHint(boolean revealOnFocus) {
+        if (revealOnFocus) {
+            mPrivateFlags3 &= ~PFLAG3_NO_REVEAL_ON_FOCUS;
+        } else {
+            mPrivateFlags3 |= PFLAG3_NO_REVEAL_ON_FOCUS;
+        }
+    }
+
+    /**
+     * Returns this view's preference for reveal behavior when it gains focus.
+     *
+     * <p>When this method returns true for a child view requesting focus, ancestor
+     * views responding to a focus change in {@link ViewParent#requestChildFocus(View, View)}
+     * should make a best effort to make the newly focused child fully visible to the user.
+     * When it returns false, ancestor views should preferably not disrupt scroll positioning or
+     * other properties affecting visibility to the user as part of the focus change.</p>
+     *
+     * @return true if this view would prefer to become fully visible when it gains focus,
+     *         false if it would prefer not to disrupt scroll positioning
+     *
+     * @see #setRevealOnFocusHint(boolean)
+     */
+    public final boolean getRevealOnFocusHint() {
+        return (mPrivateFlags3 & PFLAG3_NO_REVEAL_ON_FOCUS) == 0;
+    }
+
+    /**
      * Populates <code>outRect</code> with the hotspot bounds. By default,
      * the hotspot bounds are identical to the screen bounds.
      *
@@ -14718,6 +14774,37 @@
     }
 
     private void getVerticalScrollBarBounds(Rect bounds) {
+        if (mRoundScrollbarRenderer == null) {
+            getStraightVerticalScrollBarBounds(bounds);
+        } else {
+            getRoundVerticalScrollBarBounds(bounds);
+        }
+    }
+
+    private void getRoundVerticalScrollBarBounds(Rect bounds) {
+        final int inside = (mViewFlags & SCROLLBARS_OUTSIDE_MASK) == 0 ? ~0 : 0;
+        int verticalScrollbarPosition = mVerticalScrollbarPosition;
+        if (verticalScrollbarPosition == SCROLLBAR_POSITION_DEFAULT) {
+            verticalScrollbarPosition = isLayoutRtl() ?
+                    SCROLLBAR_POSITION_LEFT : SCROLLBAR_POSITION_RIGHT;
+        }
+        final int width = mRight - mLeft;
+        final int height = mBottom - mTop;
+        switch (verticalScrollbarPosition) {
+            default:
+            case SCROLLBAR_POSITION_RIGHT:
+                bounds.left = mScrollX - (mUserPaddingRight & inside);
+                break;
+            case SCROLLBAR_POSITION_LEFT:
+                bounds.left = mScrollX + (mUserPaddingLeft & inside);
+                break;
+        }
+        bounds.top = mScrollY + (mPaddingTop & inside);
+        bounds.right = bounds.left + width;
+        bounds.bottom = mScrollY + height - (mUserPaddingBottom & inside);
+    }
+
+    private void getStraightVerticalScrollBarBounds(Rect bounds) {
         final int inside = (mViewFlags & SCROLLBARS_OUTSIDE_MASK) == 0 ? ~0 : 0;
         final int size = getVerticalScrollbarWidth();
         int verticalScrollbarPosition = mVerticalScrollbarPosition;
@@ -14752,6 +14839,7 @@
     protected final void onDrawScrollBars(Canvas canvas) {
         // scrollbars are drawn only when the animation is running
         final ScrollabilityCache cache = mScrollCache;
+
         if (cache != null) {
 
             int state = cache.state;
@@ -14792,13 +14880,25 @@
             final boolean drawVerticalScrollBar = isVerticalScrollBarEnabled()
                     && !isVerticalScrollBarHidden();
 
-            if (drawVerticalScrollBar || drawHorizontalScrollBar) {
+            // Fork out the scroll bar drawing for round wearable devices.
+            if (mRoundScrollbarRenderer != null) {
+                if (drawVerticalScrollBar) {
+                    final Rect bounds = cache.mScrollBarBounds;
+                    getVerticalScrollBarBounds(bounds);
+                    mRoundScrollbarRenderer.drawRoundScrollbars(
+                            canvas, (float) cache.scrollBar.getAlpha() / 255f, bounds);
+                    if (invalidate) {
+                        invalidate();
+                    }
+                }
+                // Do not draw horizontal scroll bars for round wearable devices.
+            } else if (drawVerticalScrollBar || drawHorizontalScrollBar) {
                 final ScrollBarDrawable scrollBar = cache.scrollBar;
 
                 if (drawHorizontalScrollBar) {
                     scrollBar.setParameters(computeHorizontalScrollRange(),
-                                            computeHorizontalScrollOffset(),
-                                            computeHorizontalScrollExtent(), false);
+                            computeHorizontalScrollOffset(),
+                            computeHorizontalScrollExtent(), false);
                     final Rect bounds = cache.mScrollBarBounds;
                     getHorizontalScrollBarBounds(bounds);
                     onDrawHorizontalScrollBar(canvas, scrollBar, bounds.left, bounds.top,
@@ -14810,8 +14910,8 @@
 
                 if (drawVerticalScrollBar) {
                     scrollBar.setParameters(computeVerticalScrollRange(),
-                                            computeVerticalScrollOffset(),
-                                            computeVerticalScrollExtent(), true);
+                            computeVerticalScrollOffset(),
+                            computeVerticalScrollExtent(), true);
                     final Rect bounds = cache.mScrollBarBounds;
                     getVerticalScrollBarBounds(bounds);
                     onDrawVerticalScrollBar(canvas, scrollBar, bounds.left, bounds.top,
@@ -17522,6 +17622,15 @@
 
         if (changed || (mPrivateFlags & PFLAG_LAYOUT_REQUIRED) == PFLAG_LAYOUT_REQUIRED) {
             onLayout(changed, l, t, r, b);
+
+            if (shouldDrawRoundScrollbar()) {
+                if(mRoundScrollbarRenderer == null) {
+                    mRoundScrollbarRenderer = new RoundScrollbarRenderer(this);
+                }
+            } else {
+                mRoundScrollbarRenderer = null;
+            }
+
             mPrivateFlags &= ~PFLAG_LAYOUT_REQUIRED;
 
             ListenerInfo li = mListenerInfo;
@@ -22903,7 +23012,7 @@
         final int[] mInvalidateChildLocation = new int[2];
 
         /**
-         * Global to the view hierarchy used as a temporary for dealng with
+         * Global to the view hierarchy used as a temporary for dealing with
          * computing absolute on-screen location.
          */
         final int[] mTmpLocation = new int[2];
@@ -23741,4 +23850,30 @@
         stream.addProperty("accessibility:labelFor", getLabelFor());
         stream.addProperty("accessibility:importantForAccessibility", getImportantForAccessibility());
     }
+
+    /**
+     * Determine if this view is rendered on a round wearable device and is the main view
+     * on the screen.
+     */
+    private boolean shouldDrawRoundScrollbar() {
+        if (!mResources.getConfiguration().isScreenRound()) {
+            return false;
+        }
+
+        final View rootView = getRootView();
+        final WindowInsets insets = getRootWindowInsets();
+
+        int height = getHeight();
+        int width = getWidth();
+        int displayHeight = rootView.getHeight();
+        int displayWidth = rootView.getWidth();
+
+        if (height != displayHeight || width != displayWidth) {
+            return false;
+        }
+
+        getLocationOnScreen(mAttachInfo.mTmpLocation);
+        return mAttachInfo.mTmpLocation[0] == insets.getStableInsetLeft()
+                && mAttachInfo.mTmpLocation[1] == insets.getStableInsetTop();
+    }
 }
diff --git a/core/java/android/view/accessibility/AccessibilityNodeInfo.java b/core/java/android/view/accessibility/AccessibilityNodeInfo.java
index c1076e7..7880b1a 100644
--- a/core/java/android/view/accessibility/AccessibilityNodeInfo.java
+++ b/core/java/android/view/accessibility/AccessibilityNodeInfo.java
@@ -3801,7 +3801,8 @@
 
     /**
      * Class with information if a node is a range. Use
-     * {@link RangeInfo#obtain(int, float, float, float)} to get an instance.
+     * {@link RangeInfo#obtain(int, float, float, float)} to get an instance. Recycling is
+     * handled by the {@link AccessibilityNodeInfo} to which this object is attached.
      */
     public static final class RangeInfo {
         private static final int MAX_POOL_SIZE = 10;
@@ -3926,7 +3927,8 @@
 
     /**
      * Class with information if a node is a collection. Use
-     * {@link CollectionInfo#obtain(int, int, boolean)} to get an instance.
+     * {@link CollectionInfo#obtain(int, int, boolean)} to get an instance. Recycling is
+     * handled by the {@link AccessibilityNodeInfo} to which this object is attached.
      * <p>
      * A collection of items has rows and columns and may be hierarchical.
      * For example, a horizontal list is a collection with one column, as
@@ -4082,7 +4084,8 @@
     /**
      * Class with information if a node is a collection item. Use
      * {@link CollectionItemInfo#obtain(int, int, int, int, boolean)}
-     * to get an instance.
+     * to get an instance. Recycling is handled by the {@link AccessibilityNodeInfo} to which this
+     * object is attached.
      * <p>
      * A collection item is contained in a collection, it starts at
      * a given row and column in the collection, and spans one or
diff --git a/core/java/android/widget/AbsListView.java b/core/java/android/widget/AbsListView.java
index b65f933..66b22ce 100644
--- a/core/java/android/widget/AbsListView.java
+++ b/core/java/android/widget/AbsListView.java
@@ -2997,8 +2997,9 @@
             setChildrenDrawingCacheEnabled(false);
             if (mFlingRunnable != null) {
                 removeCallbacks(mFlingRunnable);
-                // let the fling runnable report it's new state which
+                // let the fling runnable report its new state which
                 // should be idle
+                mFlingRunnable.mSuppressIdleStateChangeCall = false;
                 mFlingRunnable.endFling();
                 if (mPositionScroller != null) {
                     mPositionScroller.stop();
@@ -4549,6 +4550,12 @@
          */
         private int mLastFlingY;
 
+        /**
+         * If true, {@link #endFling()} will not report scroll state change to
+         * {@link OnScrollListener#SCROLL_STATE_IDLE}.
+         */
+        private boolean mSuppressIdleStateChangeCall;
+
         private final Runnable mCheckFlywheel = new Runnable() {
             @Override
             public void run() {
@@ -4587,6 +4594,7 @@
             mScroller.fling(0, initialY, 0, initialVelocity,
                     0, Integer.MAX_VALUE, 0, Integer.MAX_VALUE);
             mTouchMode = TOUCH_MODE_FLING;
+            mSuppressIdleStateChangeCall = false;
             postOnAnimation(this);
 
             if (PROFILE_FLINGING) {
@@ -4602,6 +4610,7 @@
         }
 
         void startSpringback() {
+            mSuppressIdleStateChangeCall = false;
             if (mScroller.springBack(0, mScrollY, 0, 0, 0, 0)) {
                 mTouchMode = TOUCH_MODE_OVERFLING;
                 invalidate();
@@ -4617,6 +4626,7 @@
             mScroller.fling(0, mScrollY, 0, initialVelocity, 0, 0,
                     Integer.MIN_VALUE, Integer.MAX_VALUE, 0, getHeight());
             mTouchMode = TOUCH_MODE_OVERFLING;
+            mSuppressIdleStateChangeCall = false;
             invalidate();
             postOnAnimation(this);
         }
@@ -4643,12 +4653,14 @@
             postOnAnimation(this);
         }
 
-        void startScroll(int distance, int duration, boolean linear) {
+        void startScroll(int distance, int duration, boolean linear,
+                boolean suppressEndFlingStateChangeCall) {
             int initialY = distance < 0 ? Integer.MAX_VALUE : 0;
             mLastFlingY = initialY;
             mScroller.setInterpolator(linear ? sLinearInterpolator : null);
             mScroller.startScroll(0, initialY, 0, distance, duration);
             mTouchMode = TOUCH_MODE_FLING;
+            mSuppressIdleStateChangeCall = suppressEndFlingStateChangeCall;
             postOnAnimation(this);
         }
 
@@ -4658,7 +4670,9 @@
             removeCallbacks(this);
             removeCallbacks(mCheckFlywheel);
 
-            reportScrollStateChange(OnScrollListener.SCROLL_STATE_IDLE);
+            if (!mSuppressIdleStateChangeCall) {
+                reportScrollStateChange(OnScrollListener.SCROLL_STATE_IDLE);
+            }
             clearScrollingCache();
             mScroller.abortAnimation();
 
@@ -4901,10 +4915,11 @@
      * @param duration Duration of the scroll animation in milliseconds.
      */
     public void smoothScrollBy(int distance, int duration) {
-        smoothScrollBy(distance, duration, false);
+        smoothScrollBy(distance, duration, false, false);
     }
 
-    void smoothScrollBy(int distance, int duration, boolean linear) {
+    void smoothScrollBy(int distance, int duration, boolean linear,
+            boolean suppressEndFlingStateChangeCall) {
         if (mFlingRunnable == null) {
             mFlingRunnable = new FlingRunnable();
         }
@@ -4926,7 +4941,7 @@
             }
         } else {
             reportScrollStateChange(OnScrollListener.SCROLL_STATE_FLING);
-            mFlingRunnable.startScroll(distance, duration, linear);
+            mFlingRunnable.startScroll(distance, duration, linear, suppressEndFlingStateChangeCall);
         }
     }
 
@@ -5000,6 +5015,9 @@
     /**
      * Scrolls the list items within the view by a specified number of pixels.
      *
+     * <p>The actual amount of scroll is capped by the list content viewport height
+     * which is the list height minus top and bottom paddings minus one pixel.</p>
+     *
      * @param y the amount of pixels to scroll by vertically
      * @see #canScrollList(int)
      */
@@ -7361,7 +7379,7 @@
             } else {
                 // On-screen, just scroll.
                 final int targetTop = getChildAt(mTargetPos - firstPos).getTop();
-                smoothScrollBy(targetTop - offset, duration, true);
+                smoothScrollBy(targetTop - offset, duration, true, false);
                 return;
             }
 
@@ -7461,7 +7479,7 @@
                         Math.max(mListPadding.bottom, mExtraScroll) : mListPadding.bottom;
 
                 final int scrollBy = lastViewHeight - lastViewPixelsShowing + extraScroll;
-                smoothScrollBy(scrollBy, mScrollDuration, true);
+                smoothScrollBy(scrollBy, mScrollDuration, true, lastPos < mTargetPos);
 
                 mLastSeenPos = lastPos;
                 if (lastPos < mTargetPos) {
@@ -7476,6 +7494,7 @@
 
                 if (firstPos == mBoundPos || childCount <= nextViewIndex
                         || firstPos + childCount >= mItemCount) {
+                    reportScrollStateChange(OnScrollListener.SCROLL_STATE_IDLE);
                     return;
                 }
                 final int nextPos = firstPos + nextViewIndex;
@@ -7492,14 +7511,16 @@
                 final int extraScroll = Math.max(mListPadding.bottom, mExtraScroll);
                 if (nextPos < mBoundPos) {
                     smoothScrollBy(Math.max(0, nextViewHeight + nextViewTop - extraScroll),
-                            mScrollDuration, true);
+                            mScrollDuration, true, true);
 
                     mLastSeenPos = nextPos;
 
                     postOnAnimation(this);
                 } else  {
                     if (nextViewTop > extraScroll) {
-                        smoothScrollBy(nextViewTop - extraScroll, mScrollDuration, true);
+                        smoothScrollBy(nextViewTop - extraScroll, mScrollDuration, true, false);
+                    } else {
+                        reportScrollStateChange(OnScrollListener.SCROLL_STATE_IDLE);
                     }
                 }
                 break;
@@ -7520,7 +7541,8 @@
                 final int extraScroll = firstPos > 0 ?
                         Math.max(mExtraScroll, mListPadding.top) : mListPadding.top;
 
-                smoothScrollBy(firstViewTop - extraScroll, mScrollDuration, true);
+                smoothScrollBy(firstViewTop - extraScroll, mScrollDuration, true,
+                        firstPos > mTargetPos);
 
                 mLastSeenPos = firstPos;
 
@@ -7550,13 +7572,16 @@
                 final int extraScroll = Math.max(mListPadding.top, mExtraScroll);
                 mLastSeenPos = lastPos;
                 if (lastPos > mBoundPos) {
-                    smoothScrollBy(-(lastViewPixelsShowing - extraScroll), mScrollDuration, true);
+                    smoothScrollBy(-(lastViewPixelsShowing - extraScroll), mScrollDuration, true,
+                            true);
                     postOnAnimation(this);
                 } else {
                     final int bottom = listHeight - extraScroll;
                     final int lastViewBottom = lastViewTop + lastViewHeight;
                     if (bottom > lastViewBottom) {
-                        smoothScrollBy(-(bottom - lastViewBottom), mScrollDuration, true);
+                        smoothScrollBy(-(bottom - lastViewBottom), mScrollDuration, true, false);
+                    } else {
+                        reportScrollStateChange(OnScrollListener.SCROLL_STATE_IDLE);
                     }
                 }
                 break;
@@ -7589,12 +7614,12 @@
                 if (position < firstPos) {
                     final int distance = (int) (-getHeight() * modifier);
                     final int duration = (int) (mScrollDuration * modifier);
-                    smoothScrollBy(distance, duration, true);
+                    smoothScrollBy(distance, duration, true, true);
                     postOnAnimation(this);
                 } else if (position > lastPos) {
                     final int distance = (int) (getHeight() * modifier);
                     final int duration = (int) (mScrollDuration * modifier);
-                    smoothScrollBy(distance, duration, true);
+                    smoothScrollBy(distance, duration, true, true);
                     postOnAnimation(this);
                 } else {
                     // On-screen, just scroll.
@@ -7602,7 +7627,7 @@
                     final int distance = targetTop - mOffsetFromTop;
                     final int duration = (int) (mScrollDuration *
                             ((float) Math.abs(distance) / getHeight()));
-                    smoothScrollBy(distance, duration, true);
+                    smoothScrollBy(distance, duration, true, false);
                 }
                 break;
             }
diff --git a/core/java/android/widget/Editor.java b/core/java/android/widget/Editor.java
index e0a81dd..a0447a6 100644
--- a/core/java/android/widget/Editor.java
+++ b/core/java/android/widget/Editor.java
@@ -136,7 +136,7 @@
 
     static final int BLINK = 500;
     private static final float[] TEMP_POSITION = new float[2];
-    private static int DRAG_SHADOW_MAX_TEXT_LENGTH = 20;
+    private static final int DRAG_SHADOW_MAX_TEXT_LENGTH = 20;
     private static final float LINE_SLOP_MULTIPLIER_FOR_HANDLEVIEWS = 0.5f;
     private static final int UNSET_X_VALUE = -1;
     private static final int UNSET_LINE = -1;
@@ -182,7 +182,9 @@
             isDirty = true;
             renderNode = RenderNode.create(name, null);
         }
-        boolean needsRecord() { return isDirty || !renderNode.isValid(); }
+        boolean needsRecord() {
+            return isDirty || !renderNode.isValid();
+        }
     }
     private TextRenderNode[] mTextRenderNodes;
 
@@ -278,7 +280,8 @@
 
     final ProcessTextIntentActionsHandler mProcessTextIntentActionsHandler;
 
-    private final CursorAnchorInfoNotifier mCursorAnchorInfoNotifier = new CursorAnchorInfoNotifier();
+    private final CursorAnchorInfoNotifier mCursorAnchorInfoNotifier =
+            new CursorAnchorInfoNotifier();
 
     private final Runnable mShowFloatingToolbar = new Runnable() {
         @Override
@@ -454,7 +457,8 @@
                     com.android.internal.R.layout.textview_hint, null);
 
             final float scale = mTextView.getResources().getDisplayMetrics().density;
-            mErrorPopup = new ErrorPopup(err, (int)(200 * scale + 0.5f), (int)(50 * scale + 0.5f));
+            mErrorPopup =
+                    new ErrorPopup(err, (int) (200 * scale + 0.5f), (int) (50 * scale + 0.5f));
             mErrorPopup.setFocusable(false);
             // The user is entering text, so the input method is needed.  We
             // don't want the popup to be displayed on top of it.
@@ -532,9 +536,9 @@
         switch (layoutDirection) {
             default:
             case View.LAYOUT_DIRECTION_LTR:
-                offset = - (dr != null ? dr.mDrawableSizeRight : 0) / 2 + (int) (25 * scale + 0.5f);
-                errorX = mTextView.getWidth() - mErrorPopup.getWidth() -
-                        mTextView.getPaddingRight() + offset;
+                offset = -(dr != null ? dr.mDrawableSizeRight : 0) / 2 + (int) (25 * scale + 0.5f);
+                errorX = mTextView.getWidth() - mErrorPopup.getWidth()
+                        - mTextView.getPaddingRight() + offset;
                 break;
             case View.LAYOUT_DIRECTION_RTL:
                 offset = (dr != null ? dr.mDrawableSizeLeft : 0) / 2 - (int) (25 * scale + 0.5f);
@@ -554,8 +558,8 @@
          * if the text height is smaller.
          */
         final int compoundPaddingTop = mTextView.getCompoundPaddingTop();
-        int vspace = mTextView.getBottom() - mTextView.getTop() -
-                mTextView.getCompoundPaddingBottom() - compoundPaddingTop;
+        int vspace = mTextView.getBottom() - mTextView.getTop()
+                - mTextView.getCompoundPaddingBottom() - compoundPaddingTop;
 
         final Drawables dr = mTextView.mDrawables;
 
@@ -654,8 +658,8 @@
         // One is the true focus lost where suggestions pop-up (if any) should be dismissed, and the
         // other is an side effect of showing the suggestions pop-up itself. We use isShowingUp()
         // to distinguish one from the other.
-        if (mSuggestionsPopupWindow != null && ((mTextView.isInExtractedMode()) ||
-                !mSuggestionsPopupWindow.isShowingUp())) {
+        if (mSuggestionsPopupWindow != null && ((mTextView.isInExtractedMode())
+                || !mSuggestionsPopupWindow.isShowingUp())) {
             // Should be done before hide insertion point controller since it triggers a show of it
             mSuggestionsPopupWindow.hide();
         }
@@ -670,8 +674,8 @@
         mTextView.removeAdjacentSuggestionSpans(start);
         mTextView.removeAdjacentSuggestionSpans(end);
 
-        if (mTextView.isTextEditable() && mTextView.isSuggestionsEnabled() &&
-                !(mTextView.isInExtractedMode())) {
+        if (mTextView.isTextEditable() && mTextView.isSuggestionsEnabled()
+                && !(mTextView.isInExtractedMode())) {
             if (mSpellChecker == null && createSpellChecker) {
                 mSpellChecker = new SpellChecker(mTextView);
             }
@@ -802,13 +806,13 @@
         int variation = inputType & InputType.TYPE_MASK_VARIATION;
 
         // Specific text field types: select the entire text for these
-        if (klass == InputType.TYPE_CLASS_NUMBER ||
-                klass == InputType.TYPE_CLASS_PHONE ||
-                klass == InputType.TYPE_CLASS_DATETIME ||
-                variation == InputType.TYPE_TEXT_VARIATION_URI ||
-                variation == InputType.TYPE_TEXT_VARIATION_EMAIL_ADDRESS ||
-                variation == InputType.TYPE_TEXT_VARIATION_WEB_EMAIL_ADDRESS ||
-                variation == InputType.TYPE_TEXT_VARIATION_FILTER) {
+        if (klass == InputType.TYPE_CLASS_NUMBER
+                || klass == InputType.TYPE_CLASS_PHONE
+                || klass == InputType.TYPE_CLASS_DATETIME
+                || variation == InputType.TYPE_TEXT_VARIATION_URI
+                || variation == InputType.TYPE_TEXT_VARIATION_EMAIL_ADDRESS
+                || variation == InputType.TYPE_TEXT_VARIATION_WEB_EMAIL_ADDRESS
+                || variation == InputType.TYPE_TEXT_VARIATION_FILTER) {
             return true;
         }
         return false;
@@ -838,8 +842,8 @@
         int selectionStart, selectionEnd;
 
         // If a URLSpan (web address, email, phone...) is found at that position, select it.
-        URLSpan[] urlSpans = ((Spanned) mTextView.getText()).
-                getSpans(minOffset, maxOffset, URLSpan.class);
+        URLSpan[] urlSpans =
+                ((Spanned) mTextView.getText()).getSpans(minOffset, maxOffset, URLSpan.class);
         if (urlSpans.length >= 1) {
             URLSpan urlSpan = urlSpans[0];
             selectionStart = ((Spanned) mTextView.getText()).getSpanStart(urlSpan);
@@ -853,8 +857,8 @@
             selectionStart = wordIterator.getBeginning(minOffset);
             selectionEnd = wordIterator.getEnd(maxOffset);
 
-            if (selectionStart == BreakIterator.DONE || selectionEnd == BreakIterator.DONE ||
-                    selectionStart == selectionEnd) {
+            if (selectionStart == BreakIterator.DONE || selectionEnd == BreakIterator.DONE
+                    || selectionStart == selectionEnd) {
                 // Possible when the word iterator does not properly handle the text's language
                 long range = getCharClusterRange(minOffset);
                 selectionStart = TextUtils.unpackRangeStartFromLong(range);
@@ -957,8 +961,8 @@
     private int getNextCursorOffset(int offset, boolean findAfterGivenOffset) {
         final Layout layout = mTextView.getLayout();
         if (layout == null) return offset;
-        return findAfterGivenOffset == layout.isRtlCharAt(offset) ?
-                layout.getOffsetToLeftOf(offset) : layout.getOffsetToRightOf(offset);
+        return findAfterGivenOffset == layout.isRtlCharAt(offset)
+                ? layout.getOffsetToLeftOf(offset) : layout.getOffsetToRightOf(offset);
     }
 
     private long getCharClusterRange(int offset) {
@@ -1024,8 +1028,8 @@
                     position[1] -= view.getScrollY();
                 }
 
-                if (position[0] < 0 || position[1] < 0 ||
-                        position[0] > view.getWidth() || position[1] > view.getHeight()) {
+                if (position[0] < 0 || position[1] < 0 || position[0] > view.getWidth()
+                        || position[1] > view.getHeight()) {
                     return false;
                 }
 
@@ -1096,8 +1100,8 @@
 
     public boolean performLongClick(boolean handled) {
         // Long press in empty space moves cursor and starts the insertion action mode.
-        if (!handled && !isPositionOnText(mLastDownPositionX, mLastDownPositionY) &&
-                mInsertionControllerEnabled) {
+        if (!handled && !isPositionOnText(mLastDownPositionX, mLastDownPositionY)
+                && mInsertionControllerEnabled) {
             final int offset = mTextView.getOffsetForPosition(mLastDownPositionX,
                     mLastDownPositionY);
             Selection.setSelection((Spannable) mTextView.getText(), offset);
@@ -1141,11 +1145,11 @@
 
             // SelectAllOnFocus fields are highlighted and not selected. Do not start text selection
             // mode for these, unless there was a specific selection already started.
-            final boolean isFocusHighlighted = mSelectAllOnFocus && selStart == 0 &&
-                    selEnd == mTextView.getText().length();
+            final boolean isFocusHighlighted = mSelectAllOnFocus && selStart == 0
+                    && selEnd == mTextView.getText().length();
 
-            mCreatedWithASelection = mFrozenWithFocus && mTextView.hasSelection() &&
-                    !isFocusHighlighted;
+            mCreatedWithASelection = mFrozenWithFocus && mTextView.hasSelection()
+                    && !isFocusHighlighted;
 
             if (!mFrozenWithFocus || (selStart < 0 || selEnd < 0)) {
                 // If a tap was used to give focus to that view, move cursor at tap position.
@@ -1166,8 +1170,8 @@
                 // ExtractEditText clears focus, which gives focus to the ExtractEditText.
                 // This special case ensure that we keep current selection in that case.
                 // It would be better to know why the DecorView does not have focus at that time.
-                if (((mTextView.isInExtractedMode()) || mSelectionMoved) &&
-                        selStart >= 0 && selEnd >= 0) {
+                if (((mTextView.isInExtractedMode()) || mSelectionMoved)
+                        && selStart >= 0 && selEnd >= 0) {
                     /*
                      * Someone intentionally set the selection, so let them
                      * do whatever it is that they wanted to do instead of
@@ -1310,8 +1314,8 @@
             // Detect double tap and triple click.
             if (((mTapState == TAP_STATE_FIRST_TAP)
                     || ((mTapState == TAP_STATE_DOUBLE_TAP) && isMouse))
-                        && (SystemClock.uptimeMillis() - mLastTouchUpTime) <=
-                                ViewConfiguration.getDoubleTapTimeout()) {
+                            && (SystemClock.uptimeMillis() - mLastTouchUpTime)
+                                    <= ViewConfiguration.getDoubleTapTimeout()) {
                 if (mTapState == TAP_STATE_FIRST_TAP) {
                     mTapState = TAP_STATE_DOUBLE_TAP;
                 } else {
@@ -1465,8 +1469,8 @@
 
         // Show drag handles if they were blocked by batch edit mode.
         if (mTextActionMode != null) {
-            final CursorController cursorController = mTextView.hasSelection() ?
-                    getSelectionController() : getInsertionController();
+            final CursorController cursorController = mTextView.hasSelection()
+                    ? getSelectionController() : getInsertionController();
             if (cursorController != null && !cursorController.isActive()
                     && !cursorController.isCursorBeingModified()) {
                 cursorController.show();
@@ -1506,7 +1510,7 @@
                 partialEndOffset += delta;
                 // Adjust offsets to ensure we contain full spans.
                 if (content instanceof Spanned) {
-                    Spanned spanned = (Spanned)content;
+                    Spanned spanned = (Spanned) content;
                     Object[] spans = spanned.getSpans(partialStartOffset,
                             partialEndOffset, ParcelableSpan.class);
                     int i = spans.length;
@@ -1532,7 +1536,7 @@
                     partialEndOffset = 0;
                 }
             }
-            if ((request.flags&InputConnection.GET_TEXT_WITH_STYLES) != 0) {
+            if ((request.flags & InputConnection.GET_TEXT_WITH_STYLES) != 0) {
                 outText.text = content.subSequence(partialStartOffset,
                         partialEndOffset);
             } else {
@@ -1568,20 +1572,24 @@
                 if (req != null) {
                     InputMethodManager imm = InputMethodManager.peekInstance();
                     if (imm != null) {
-                        if (TextView.DEBUG_EXTRACT) Log.v(TextView.LOG_TAG,
-                                "Retrieving extracted start=" + ims.mChangedStart +
-                                " end=" + ims.mChangedEnd +
-                                " delta=" + ims.mChangedDelta);
+                        if (TextView.DEBUG_EXTRACT) {
+                            Log.v(TextView.LOG_TAG, "Retrieving extracted start="
+                                    + ims.mChangedStart
+                                    + " end=" + ims.mChangedEnd
+                                    + " delta=" + ims.mChangedDelta);
+                        }
                         if (ims.mChangedStart < 0 && !contentChanged) {
                             ims.mChangedStart = EXTRACT_NOTHING;
                         }
                         if (extractTextInternal(req, ims.mChangedStart, ims.mChangedEnd,
                                 ims.mChangedDelta, ims.mExtractedText)) {
-                            if (TextView.DEBUG_EXTRACT) Log.v(TextView.LOG_TAG,
-                                    "Reporting extracted start=" +
-                                    ims.mExtractedText.partialStartOffset +
-                                    " end=" + ims.mExtractedText.partialEndOffset +
-                                    ": " + ims.mExtractedText.text);
+                            if (TextView.DEBUG_EXTRACT) {
+                                Log.v(TextView.LOG_TAG,
+                                        "Reporting extracted start="
+                                                + ims.mExtractedText.partialStartOffset
+                                                + " end=" + ims.mExtractedText.partialEndOffset
+                                                + ": " + ims.mExtractedText.text);
+                            }
 
                             imm.updateExtractedText(mTextView, req.token, ims.mExtractedText);
                             ims.mChangedStart = EXTRACT_UNKNOWN;
@@ -1701,7 +1709,8 @@
                             new TextRenderNode("Text " + blockIndex);
                 }
 
-                final boolean blockDisplayListIsInvalid = mTextRenderNodes[blockIndex].needsRecord();
+                final boolean blockDisplayListIsInvalid =
+                        mTextRenderNodes[blockIndex].needsRecord();
                 RenderNode blockDisplayList = mTextRenderNodes[blockIndex].renderNode;
                 if (i >= indexFirstChangedBlock || blockDisplayListIsInvalid) {
                     final int blockBeginLine = endOfPreviousBlock + 1;
@@ -2201,9 +2210,10 @@
     }
 
     private void updateCursorPosition(int cursorIndex, int top, int bottom, float horizontal) {
-        if (mCursorDrawable[cursorIndex] == null)
+        if (mCursorDrawable[cursorIndex] == null) {
             mCursorDrawable[cursorIndex] = mTextView.getContext().getDrawable(
                     mTextView.mCursorDrawableRes);
+        }
         final Drawable drawable = mCursorDrawable[cursorIndex];
         final int left = clampHorizontalPosition(drawable, horizontal);
         final int width = drawable.getIntrinsicWidth();
@@ -2243,8 +2253,8 @@
         if (horizontalDiff >= (viewClippedWidth - 1f)) {
             // at the rightmost position
             left = viewClippedWidth + scrollX - (drawableWidth - mTempRect.right);
-        } else if (Math.abs(horizontalDiff) <= 1f ||
-                (TextUtils.isEmpty(mTextView.getText())
+        } else if (Math.abs(horizontalDiff) <= 1f
+                || (TextUtils.isEmpty(mTextView.getText())
                         && (TextView.VERY_WIDE - scrollX) <= (viewClippedWidth + 1f)
                         && horizontal <= 1f)) {
             // at the leftmost position
@@ -2392,12 +2402,11 @@
         try {
             ClipData clipData = event.getClipData();
             final int itemCount = clipData.getItemCount();
-            for (int i=0; i < itemCount; i++) {
+            for (int i = 0; i < itemCount; i++) {
                 Item item = clipData.getItemAt(i);
                 content.append(item.coerceToStyledText(mTextView.getContext()));
             }
-        }
-        finally {
+        } finally {
             if (permissions != null) {
                 permissions.release();
             }
@@ -2411,8 +2420,8 @@
             if (localState instanceof DragLocalState) {
                 dragLocalState = (DragLocalState) localState;
             }
-            boolean dragDropIntoItself = dragLocalState != null &&
-                    dragLocalState.sourceTextView == mTextView;
+            boolean dragDropIntoItself = dragLocalState != null
+                    && dragLocalState.sourceTextView == mTextView;
 
             if (dragDropIntoItself) {
                 if (offset >= dragLocalState.start && offset < dragLocalState.end) {
@@ -2823,8 +2832,8 @@
             mContentView.setBackgroundResource(
                     com.android.internal.R.drawable.text_edit_side_paste_window);
 
-            LayoutInflater inflater = (LayoutInflater)mTextView.getContext().
-                    getSystemService(Context.LAYOUT_INFLATER_SERVICE);
+            LayoutInflater inflater = (LayoutInflater) mTextView.getContext()
+                    .getSystemService(Context.LAYOUT_INFLATER_SERVICE);
 
             LayoutParams wrapContent = new LayoutParams(
                     ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT);
@@ -2885,10 +2894,10 @@
         // 3 handles
         // 3 ActionPopup [replace, suggestion, easyedit] (suggestionsPopup first hides the others)
         // 1 CursorAnchorInfoNotifier
-        private final int MAXIMUM_NUMBER_OF_LISTENERS = 7;
+        private static final int MAXIMUM_NUMBER_OF_LISTENERS = 7;
         private TextViewPositionListener[] mPositionListeners =
                 new TextViewPositionListener[MAXIMUM_NUMBER_OF_LISTENERS];
-        private boolean mCanMove[] = new boolean[MAXIMUM_NUMBER_OF_LISTENERS];
+        private boolean[] mCanMove = new boolean[MAXIMUM_NUMBER_OF_LISTENERS];
         private boolean mPositionHasChanged = true;
         // Absolute position of the TextView with respect to its parent window
         private int mPositionX, mPositionY;
@@ -3402,10 +3411,11 @@
                     if (spanUnionStart >= 0 && spanUnionEnd > spanUnionStart) {
                         // Do not leave two adjacent spaces after deletion, or one at beginning of
                         // text
-                        if (spanUnionEnd < editable.length() &&
-                                Character.isSpaceChar(editable.charAt(spanUnionEnd)) &&
-                                (spanUnionStart == 0 ||
-                                Character.isSpaceChar(editable.charAt(spanUnionStart - 1)))) {
+                        if (spanUnionEnd < editable.length()
+                                && Character.isSpaceChar(editable.charAt(spanUnionEnd))
+                                && (spanUnionStart == 0
+                                        || Character.isSpaceChar(
+                                                editable.charAt(spanUnionStart - 1)))) {
                             spanUnionEnd = spanUnionEnd + 1;
                         }
                         mTextView.deleteText_internal(spanUnionStart, spanUnionEnd);
@@ -3709,29 +3719,29 @@
         private void populateMenuWithItems(Menu menu) {
             if (mTextView.canCut()) {
                 menu.add(Menu.NONE, TextView.ID_CUT, MENU_ITEM_ORDER_CUT,
-                        com.android.internal.R.string.cut).
-                    setAlphabeticShortcut('x').
-                    setShowAsAction(MenuItem.SHOW_AS_ACTION_ALWAYS);
+                        com.android.internal.R.string.cut)
+                                .setAlphabeticShortcut('x')
+                                .setShowAsAction(MenuItem.SHOW_AS_ACTION_ALWAYS);
             }
 
             if (mTextView.canCopy()) {
                 menu.add(Menu.NONE, TextView.ID_COPY, MENU_ITEM_ORDER_COPY,
-                        com.android.internal.R.string.copy).
-                    setAlphabeticShortcut('c').
-                    setShowAsAction(MenuItem.SHOW_AS_ACTION_ALWAYS);
+                        com.android.internal.R.string.copy)
+                                .setAlphabeticShortcut('c')
+                                .setShowAsAction(MenuItem.SHOW_AS_ACTION_ALWAYS);
             }
 
             if (mTextView.canPaste()) {
                 menu.add(Menu.NONE, TextView.ID_PASTE, MENU_ITEM_ORDER_PASTE,
-                        com.android.internal.R.string.paste).
-                    setAlphabeticShortcut('v').
-                    setShowAsAction(MenuItem.SHOW_AS_ACTION_ALWAYS);
+                        com.android.internal.R.string.paste)
+                                .setAlphabeticShortcut('v')
+                                .setShowAsAction(MenuItem.SHOW_AS_ACTION_ALWAYS);
             }
 
             if (mTextView.canShare()) {
                 menu.add(Menu.NONE, TextView.ID_SHARE, MENU_ITEM_ORDER_SHARE,
-                        com.android.internal.R.string.share).
-                    setShowAsAction(MenuItem.SHOW_AS_ACTION_IF_ROOM);
+                        com.android.internal.R.string.share)
+                                .setShowAsAction(MenuItem.SHOW_AS_ACTION_IF_ROOM);
             }
 
             updateSelectAllItem(menu);
@@ -4102,8 +4112,8 @@
             mHorizontalGravity = getHorizontalGravity(isRtlCharAtOffset);
             if (oldDrawable != mDrawable && isShowing()) {
                 // Update popup window position.
-                mPositionX = getCursorHorizontalPosition(layout, offset) - mHotspotX -
-                        getHorizontalOffset() + getCursorOffset();
+                mPositionX = getCursorHorizontalPosition(layout, offset) - mHotspotX
+                        - getHorizontalOffset() + getCursorOffset();
                 mPositionX += mTextView.viewportToContentHorizontalOffset();
                 mPositionHasChanged = true;
                 updatePosition(mLastParentX, mLastParentY, false, false);
@@ -4145,8 +4155,8 @@
                 index = (mPreviousOffsetIndex - i + HISTORY_SIZE) % HISTORY_SIZE;
             }
 
-            if (i > 0 && i < iMax &&
-                    (now - mPreviousOffsetsTimes[index]) > TOUCH_UP_FILTER_DELAY_BEFORE) {
+            if (i > 0 && i < iMax
+                    && (now - mPreviousOffsetsTimes[index]) > TOUCH_UP_FILTER_DELAY_BEFORE) {
                 positionAtCursorOffset(mPreviousOffsets[index], false);
             }
         }
@@ -4258,8 +4268,8 @@
                 final int line = layout.getLineForOffset(offset);
                 mPrevLine = line;
 
-                mPositionX = getCursorHorizontalPosition(layout, offset) - mHotspotX -
-                        getHorizontalOffset() + getCursorOffset();
+                mPositionX = getCursorHorizontalPosition(layout, offset) - mHotspotX
+                        - getHorizontalOffset() + getCursorOffset();
                 mPositionY = layout.getLineBottom(line);
 
                 // Take TextView's padding and scroll into account.
@@ -4790,8 +4800,8 @@
                     // We still snap to the word boundary but we only use the letters on the
                     // current line to determine if the user is far enough into the word to snap.
                     if (layout.getLineForOffset(wordBoundary) != currLine) {
-                        wordBoundary = isStartHandle() ?
-                                layout.getLineStart(currLine) : layout.getLineEnd(currLine);
+                        wordBoundary = isStartHandle()
+                                ? layout.getLineStart(currLine) : layout.getLineEnd(currLine);
                     }
                     final int offsetThresholdToSnap = isStartHandle()
                             ? wordEnd - ((wordEnd - wordBoundary) / 2)
@@ -4846,8 +4856,8 @@
                         || (!isStartHandle() && adjustedOffset > mPreviousOffset)) {
                     // Handle has jumped to the word boundary, and the user is moving
                     // their finger towards the handle, the delta should be updated.
-                    mTouchWordDelta = mTextView.convertToLocalHorizontalCoordinate(x) -
-                            getHorizontal(layout, mPreviousOffset);
+                    mTouchWordDelta = mTextView.convertToLocalHorizontalCoordinate(x)
+                            - getHorizontal(layout, mPreviousOffset);
                 }
             }
 
@@ -4893,8 +4903,8 @@
                         // This handle passes another one as it crossed a direction boundary.
                         // Don't minimize the selection, but keep the handle at the run boundary.
                         final int currentOffset = getCurrentCursorOffset();
-                        final int offsetToGetRunRange = isStartHandle() ?
-                                currentOffset : Math.max(currentOffset - 1, 0);
+                        final int offsetToGetRunRange = isStartHandle()
+                                ? currentOffset : Math.max(currentOffset - 1, 0);
                         final long range = layout.getRunRange(offsetToGetRunRange);
                         if (isStartHandle()) {
                             offset = TextUtils.unpackRangeStartFromLong(range);
@@ -4941,8 +4951,8 @@
             final int offsetToCheck = startHandle ? offset : Math.max(offset - 1, 0);
             final boolean isRtlChar = layout.isRtlCharAt(offsetToCheck);
             final boolean isRtlParagraph = layout.getParagraphDirection(line) == -1;
-            return (isRtlChar == isRtlParagraph) ?
-                    layout.getPrimaryHorizontal(offset) : layout.getSecondaryHorizontal(offset);
+            return (isRtlChar == isRtlParagraph)
+                    ? layout.getPrimaryHorizontal(offset) : layout.getSecondaryHorizontal(offset);
         }
 
         @Override
@@ -4961,8 +4971,8 @@
             } else if (primaryDiff > secondaryDiff) {
                 return secondaryOffset;
             } else {
-                final int offsetToCheck = isStartHandle() ?
-                        currentOffset : Math.max(currentOffset - 1, 0);
+                final int offsetToCheck = isStartHandle()
+                        ? currentOffset : Math.max(currentOffset - 1, 0);
                 final boolean isRtlChar = layout.isRtlCharAt(offsetToCheck);
                 final boolean isRtlParagraph = layout.getParagraphDirection(line) == -1;
                 return isRtlChar == isRtlParagraph ? primaryOffset : secondaryOffset;
@@ -5513,11 +5523,11 @@
         private int mStart, mEnd;
         private long mFadingStartTime;
         private RectF mTempRectF;
-        private final static int FADE_OUT_DURATION = 400;
+        private static final int FADE_OUT_DURATION = 400;
 
         public CorrectionHighlighter() {
-            mPaint.setCompatibilityScaling(mTextView.getResources().getCompatibilityInfo().
-                    applicationScale);
+            mPaint.setCompatibilityScaling(
+                    mTextView.getResources().getCompatibilityInfo().applicationScale);
             mPaint.setStyle(Paint.Style.FILL);
         }
 
@@ -5555,8 +5565,8 @@
 
             final float coef = 1.0f - (float) duration / FADE_OUT_DURATION;
             final int highlightColorAlpha = Color.alpha(mTextView.mHighlightColor);
-            final int color = (mTextView.mHighlightColor & 0x00FFFFFF) +
-                    ((int) (highlightColorAlpha * coef) << 24);
+            final int color = (mTextView.mHighlightColor & 0x00FFFFFF)
+                    + ((int) (highlightColorAlpha * coef) << 24);
             mPaint.setColor(color);
             return true;
         }
@@ -5628,8 +5638,8 @@
                         com.android.internal.R.styleable.Theme_errorMessageBackground);
             }
 
-            mView.setBackgroundResource(above ? mPopupInlineErrorAboveBackgroundId :
-                mPopupInlineErrorBackgroundId);
+            mView.setBackgroundResource(
+                    above ? mPopupInlineErrorAboveBackgroundId : mPopupInlineErrorBackgroundId);
         }
 
         private int getResourceId(int currentId, int index) {
@@ -5744,8 +5754,8 @@
         public CharSequence filter(CharSequence source, int start, int end,
                 Spanned dest, int dstart, int dend) {
             if (DEBUG_UNDO) {
-                Log.d(TAG, "filter: source=" + source + " (" + start + "-" + end + ") " +
-                        "dest=" + dest + " (" + dstart + "-" + dend + ")");
+                Log.d(TAG, "filter: source=" + source + " (" + start + "-" + end + ") "
+                        + "dest=" + dest + " (" + dstart + "-" + dend + ")");
             }
 
             // Check to see if this edit should be tracked for undo.
@@ -5781,10 +5791,10 @@
         @Retention(RetentionPolicy.SOURCE)
         @IntDef({MERGE_EDIT_MODE_FORCE_MERGE, MERGE_EDIT_MODE_NEVER_MERGE, MERGE_EDIT_MODE_NORMAL})
         private @interface MergeMode {}
-        private final static int MERGE_EDIT_MODE_FORCE_MERGE = 0;
-        private final static int MERGE_EDIT_MODE_NEVER_MERGE = 1;
+        private static final int MERGE_EDIT_MODE_FORCE_MERGE = 0;
+        private static final int MERGE_EDIT_MODE_NEVER_MERGE = 1;
         /** Use {@link EditOperation#mergeWith} to merge */
-        private final static int MERGE_EDIT_MODE_NORMAL = 2;
+        private static final int MERGE_EDIT_MODE_NORMAL = 2;
 
         private void handleEdit(CharSequence source, int start, int end,
                 Spanned dest, int dstart, int dend, boolean shouldCreateSeparateState) {
@@ -6042,8 +6052,8 @@
                 mIsComposition = edit.mIsComposition;
                 return true;
             }
-            if (mIsComposition && edit.mType == TYPE_REPLACE &&
-                    mStart <= edit.mStart && getNewTextEnd() >= edit.getOldTextEnd()) {
+            if (mIsComposition && edit.mType == TYPE_REPLACE
+                    && mStart <= edit.mStart && getNewTextEnd() >= edit.getOldTextEnd()) {
                 // Merge insertion with replace as they can be single insertion.
                 mNewText = mNewText.substring(0, edit.mStart - mStart) + edit.mNewText
                         + mNewText.substring(edit.getOldTextEnd() - mStart, mNewText.length());
@@ -6143,8 +6153,8 @@
         private static void modifyText(Editable text, int deleteFrom, int deleteTo,
                 CharSequence newText, int newTextInsertAt, int newCursorPos) {
             // Apply the edit if it is still valid.
-            if (isValidRange(text, deleteFrom, deleteTo) &&
-                    newTextInsertAt <= text.length() - (deleteTo - deleteFrom)) {
+            if (isValidRange(text, deleteFrom, deleteTo)
+                    && newTextInsertAt <= text.length() - (deleteTo - deleteFrom)) {
                 if (deleteFrom != deleteTo) {
                     text.delete(deleteFrom, deleteTo);
                 }
@@ -6175,18 +6185,18 @@
 
         @Override
         public String toString() {
-            return "[mType=" + getTypeString() + ", " +
-                    "mOldText=" + mOldText + ", " +
-                    "mNewText=" + mNewText + ", " +
-                    "mStart=" + mStart + ", " +
-                    "mOldCursorPos=" + mOldCursorPos + ", " +
-                    "mNewCursorPos=" + mNewCursorPos + ", " +
-                    "mFrozen=" + mFrozen + ", " +
-                    "mIsComposition=" + mIsComposition + "]";
+            return "[mType=" + getTypeString() + ", "
+                    + "mOldText=" + mOldText + ", "
+                    + "mNewText=" + mNewText + ", "
+                    + "mStart=" + mStart + ", "
+                    + "mOldCursorPos=" + mOldCursorPos + ", "
+                    + "mNewCursorPos=" + mNewCursorPos + ", "
+                    + "mFrozen=" + mFrozen + ", "
+                    + "mIsComposition=" + mIsComposition + "]";
         }
 
-        public static final Parcelable.ClassLoaderCreator<EditOperation> CREATOR
-                = new Parcelable.ClassLoaderCreator<EditOperation>() {
+        public static final Parcelable.ClassLoaderCreator<EditOperation> CREATOR =
+                new Parcelable.ClassLoaderCreator<EditOperation>() {
             @Override
             public EditOperation createFromParcel(Parcel in) {
                 return new EditOperation(in, null);
@@ -6216,9 +6226,9 @@
         private final PackageManager mPackageManager;
         private final String mPackageName;
         private final SparseArray<Intent> mAccessibilityIntents = new SparseArray<>();
-        private final SparseArray<AccessibilityNodeInfo.AccessibilityAction> mAccessibilityActions
-                = new SparseArray<>();
-        private final List<ResolveInfo> supportedActivities = new ArrayList<>();
+        private final SparseArray<AccessibilityNodeInfo.AccessibilityAction> mAccessibilityActions =
+                new SparseArray<>();
+        private final List<ResolveInfo> mSupportedActivities = new ArrayList<>();
 
         private ProcessTextIntentActionsHandler(Editor editor) {
             mEditor = Preconditions.checkNotNull(editor);
@@ -6234,7 +6244,7 @@
         public void onInitializeMenu(Menu menu) {
             int i = 0;
             loadSupportedActivities();
-            for (ResolveInfo resolveInfo : supportedActivities) {
+            for (ResolveInfo resolveInfo : mSupportedActivities) {
                 menu.add(Menu.NONE, Menu.NONE,
                         Editor.MENU_ITEM_ORDER_PROCESS_TEXT_INTENT_ACTIONS_START + i++,
                         getLabel(resolveInfo))
@@ -6261,7 +6271,7 @@
             mAccessibilityActions.clear();
             int i = 0;
             loadSupportedActivities();
-            for (ResolveInfo resolveInfo : supportedActivities) {
+            for (ResolveInfo resolveInfo : mSupportedActivities) {
                 int actionId = TextView.ACCESSIBILITY_ACTION_PROCESS_TEXT_START_ID + i++;
                 mAccessibilityActions.put(
                         actionId,
@@ -6304,12 +6314,13 @@
         }
 
         private void loadSupportedActivities() {
-            supportedActivities.clear();
+            mSupportedActivities.clear();
             PackageManager packageManager = mTextView.getContext().getPackageManager();
-            List<ResolveInfo> unfiltered = packageManager.queryIntentActivities(createProcessTextIntent(), 0);
+            List<ResolveInfo> unfiltered =
+                    packageManager.queryIntentActivities(createProcessTextIntent(), 0);
             for (ResolveInfo info : unfiltered) {
                 if (isSupportedActivity(info)) {
-                    supportedActivities.add(info);
+                    mSupportedActivities.add(info);
                 }
             }
         }
diff --git a/core/java/android/widget/ForwardingListener.java b/core/java/android/widget/ForwardingListener.java
index b383e1c..a5fcbc7 100644
--- a/core/java/android/widget/ForwardingListener.java
+++ b/core/java/android/widget/ForwardingListener.java
@@ -58,13 +58,14 @@
 
     public ForwardingListener(View src) {
         mSrc = src;
+        src.setLongClickable(true);
+        src.addOnAttachStateChangeListener(this);
+
         mScaledTouchSlop = ViewConfiguration.get(src.getContext()).getScaledTouchSlop();
         mTapTimeout = ViewConfiguration.getTapTimeout();
 
         // Use a medium-press timeout. Halfway between tap and long-press.
         mLongPressTimeout = (mTapTimeout + ViewConfiguration.getLongPressTimeout()) / 2;
-
-        src.addOnAttachStateChangeListener(this);
     }
 
     /**
diff --git a/core/java/android/widget/ImageView.java b/core/java/android/widget/ImageView.java
index 222a040..184544d 100644
--- a/core/java/android/widget/ImageView.java
+++ b/core/java/android/widget/ImageView.java
@@ -545,6 +545,13 @@
      * Subsequent calls to {@link #setImageDrawable(Drawable)} will automatically
      * mutate the drawable and apply the specified tint and tint mode using
      * {@link Drawable#setTintList(ColorStateList)}.
+     * <p>
+     * <em>Note:</em> The default tint mode used by this setter is NOT
+     * consistent with the default tint mode used by the
+     * {@link android.R.styleable#ImageView_tint android:tint}
+     * attribute. If the {@code android:tint} attribute is specified, the
+     * default tint mode will be set to {@link PorterDuff.Mode#SRC_ATOP} to
+     * ensure consistency with earlier versions of the platform.
      *
      * @param tint the tint to apply, may be {@code null} to clear tint
      *
diff --git a/core/java/android/widget/ListView.java b/core/java/android/widget/ListView.java
index b8b7c55..b0f19d7 100644
--- a/core/java/android/widget/ListView.java
+++ b/core/java/android/widget/ListView.java
@@ -112,8 +112,8 @@
         public boolean isSelectable;
     }
 
-    private ArrayList<FixedViewInfo> mHeaderViewInfos = Lists.newArrayList();
-    private ArrayList<FixedViewInfo> mFooterViewInfos = Lists.newArrayList();
+    ArrayList<FixedViewInfo> mHeaderViewInfos = Lists.newArrayList();
+    ArrayList<FixedViewInfo> mFooterViewInfos = Lists.newArrayList();
 
     Drawable mDivider;
     int mDividerHeight;
@@ -279,7 +279,7 @@
         // Wrap the adapter if it wasn't already wrapped.
         if (mAdapter != null) {
             if (!(mAdapter instanceof HeaderViewListAdapter)) {
-                mAdapter = new HeaderViewListAdapter(mHeaderViewInfos, mFooterViewInfos, mAdapter);
+                wrapHeaderListAdapterInternal();
             }
 
             // In the case of re-adding a header view, or adding one later on,
@@ -373,7 +373,7 @@
         // Wrap the adapter if it wasn't already wrapped.
         if (mAdapter != null) {
             if (!(mAdapter instanceof HeaderViewListAdapter)) {
-                mAdapter = new HeaderViewListAdapter(mHeaderViewInfos, mFooterViewInfos, mAdapter);
+                wrapHeaderListAdapterInternal();
             }
 
             // In the case of re-adding a footer view, or adding one later on,
@@ -476,7 +476,7 @@
         mRecycler.clear();
 
         if (mHeaderViewInfos.size() > 0|| mFooterViewInfos.size() > 0) {
-            mAdapter = new HeaderViewListAdapter(mHeaderViewInfos, mFooterViewInfos, adapter);
+            mAdapter = wrapHeaderListAdapterInternal(mHeaderViewInfos, mFooterViewInfos, adapter);
         } else {
             mAdapter = adapter;
         }
@@ -2050,6 +2050,8 @@
                 p.recycledHeaderFooter = true;
             }
             addViewInLayout(child, flowDown ? -1 : 0, p, true);
+            // add view in layout will reset the RTL properties. We have to re-resolve them
+            child.resolveRtlPropertiesIfNeeded();
         }
 
         if (needToMeasure) {
@@ -2226,7 +2228,7 @@
      * after the header views.
      */
     public void setSelectionAfterHeaderView() {
-        final int count = mHeaderViewInfos.size();
+        final int count = getHeaderViewsCount();
         if (count > 0) {
             mNextSelectedPosition = 0;
             return;
@@ -3354,7 +3356,7 @@
             bounds.right = mRight - mLeft - mPaddingRight;
 
             final int count = getChildCount();
-            final int headerCount = mHeaderViewInfos.size();
+            final int headerCount = getHeaderViewsCount();
             final int itemCount = mItemCount;
             final int footerLimit = (itemCount - mFooterViewInfos.size());
             final boolean headerDividers = mHeaderDividersEnabled;
@@ -3938,7 +3940,7 @@
         if (drawDividers) {
             final boolean fillForMissingDividers = isOpaque() && !super.isOpaque();
             final int itemCount = mItemCount;
-            final int headerCount = mHeaderViewInfos.size();
+            final int headerCount = getHeaderViewsCount();
             final int footerLimit = (itemCount - mFooterViewInfos.size());
             final boolean isHeader = (itemIndex < headerCount);
             final boolean isFooter = (itemIndex >= footerLimit);
@@ -4050,4 +4052,24 @@
 
         encoder.addProperty("recycleOnMeasure", recycleOnMeasure());
     }
+
+    /** @hide */
+    protected HeaderViewListAdapter wrapHeaderListAdapterInternal(
+            ArrayList<ListView.FixedViewInfo> headerViewInfos,
+            ArrayList<ListView.FixedViewInfo> footerViewInfos,
+            ListAdapter adapter) {
+        return new HeaderViewListAdapter(headerViewInfos, footerViewInfos, adapter);
+    }
+
+    /** @hide */
+    protected void wrapHeaderListAdapterInternal() {
+        mAdapter = wrapHeaderListAdapterInternal(mHeaderViewInfos, mFooterViewInfos, mAdapter);
+    }
+
+    /** @hide */
+    protected void dispatchDataSetObserverOnChangedInternal() {
+        if (mDataSetObserver != null) {
+            mDataSetObserver.onChanged();
+        }
+    }
 }
diff --git a/core/java/android/widget/RemoteViews.java b/core/java/android/widget/RemoteViews.java
index 47ae726..2a6e01f 100644
--- a/core/java/android/widget/RemoteViews.java
+++ b/core/java/android/widget/RemoteViews.java
@@ -2786,6 +2786,18 @@
     }
 
     /**
+     * @hide
+     * Equivalent to calling {@link android.widget.TextView#setTextColor(ColorStateList)}.
+     *
+     * @param viewId The id of the view whose text color should change
+     * @param colors the text colors to set
+     */
+    public void setTextColor(int viewId, @ColorInt ColorStateList colors) {
+        addAction(new ReflectionAction(viewId, "setTextColor", ReflectionAction.COLOR_STATE_LIST,
+                colors));
+    }
+
+    /**
      * Equivalent to calling {@link android.widget.AbsListView#setRemoteViewsAdapter(Intent)}.
      *
      * @param appWidgetId The id of the app widget which contains the specified view. (This
diff --git a/core/java/android/widget/TabHost.java b/core/java/android/widget/TabHost.java
index 27fa3b9..28d187c 100644
--- a/core/java/android/widget/TabHost.java
+++ b/core/java/android/widget/TabHost.java
@@ -18,6 +18,8 @@
 
 import com.android.internal.R;
 
+import android.annotation.NonNull;
+import android.annotation.Nullable;
 import android.app.LocalActivityManager;
 import android.content.Context;
 import android.content.Intent;
@@ -108,10 +110,15 @@
     }
 
     /**
-     * Get a new {@link TabSpec} associated with this tab host.
-     * @param tag required tag of tab.
+     * Creates a new {@link TabSpec} associated with this tab host.
+     *
+     * @param tag tag for the tab specification, must be non-null
      */
-    public TabSpec newTabSpec(String tag) {
+    @NonNull
+    public TabSpec newTabSpec(@NonNull String tag) {
+        if (tag == null) {
+            throw new IllegalArgumentException("tag must be non-null");
+        }
         return new TabSpec(tag);
     }
 
@@ -240,10 +247,23 @@
         return mTabWidget;
     }
 
+    /**
+     * Returns the current tab.
+     *
+     * @return the current tab, may be {@code null} if no tab is set as current
+     */
+    @Nullable
     public int getCurrentTab() {
         return mCurrentTab;
     }
 
+    /**
+     * Returns the tag for the current tab.
+     *
+     * @return the tag for the current tab, may be {@code null} if no tab is
+     *         set as current
+     */
+    @Nullable
     public String getCurrentTabTag() {
         if (mCurrentTab >= 0 && mCurrentTab < mTabSpecs.size()) {
             return mTabSpecs.get(mCurrentTab).getTag();
@@ -251,6 +271,13 @@
         return null;
     }
 
+    /**
+     * Returns the view for the current tab.
+     *
+     * @return the view for the current tab, may be {@code null} if no tab is
+     *         set as current
+     */
+    @Nullable
     public View getCurrentTabView() {
         if (mCurrentTab >= 0 && mCurrentTab < mTabSpecs.size()) {
             return mTabWidget.getChildTabViewAt(mCurrentTab);
@@ -262,9 +289,13 @@
         return mCurrentView;
     }
 
+    /**
+     * Sets the current tab based on its tag.
+     *
+     * @param tag the tag for the tab to set as current
+     */
     public void setCurrentTabByTag(String tag) {
-        int i;
-        for (i = 0; i < mTabSpecs.size(); i++) {
+        for (int i = 0, count = mTabSpecs.size(); i < count; i++) {
             if (mTabSpecs.get(i).getTag().equals(tag)) {
                 setCurrentTab(i);
                 break;
@@ -462,12 +493,17 @@
      */
     public class TabSpec {
 
-        private String mTag;
+        private final @NonNull String mTag;
 
         private IndicatorStrategy mIndicatorStrategy;
         private ContentStrategy mContentStrategy;
 
-        private TabSpec(String tag) {
+        /**
+         * Constructs a new tab specification with the specified tag.
+         *
+         * @param tag the tag for the tag specification, must be non-null
+         */
+        private TabSpec(@NonNull String tag) {
             mTag = tag;
         }
 
@@ -521,7 +557,12 @@
             return this;
         }
 
-
+        /**
+         * Returns the tag for this tab specification.
+         *
+         * @return the tag for this tab specification
+         */
+        @NonNull
         public String getTag() {
             return mTag;
         }
diff --git a/core/java/android/widget/TextView.java b/core/java/android/widget/TextView.java
index 44f59dc..b8616cf 100644
--- a/core/java/android/widget/TextView.java
+++ b/core/java/android/widget/TextView.java
@@ -342,9 +342,10 @@
 
     // A flag to prevent repeated movements from escaping the enclosing text view. The idea here is
     // that if a user is holding down a movement key to traverse text, we shouldn't also traverse
-    // the view hierarchy. On the other hand, if the user is using the movement key to traverse views
-    // (i.e. the first movement was to traverse out of this view, or this view was traversed into by
-    // the user holding the movement key down) then we shouldn't prevent the focus from changing.
+    // the view hierarchy. On the other hand, if the user is using the movement key to traverse
+    // views (i.e. the first movement was to traverse out of this view, or this view was traversed
+    // into by the user holding the movement key down) then we shouldn't prevent the focus from
+    // changing.
     private boolean mPreventDefaultMovement;
 
     private TextUtils.TruncateAt mEllipsize;
@@ -386,8 +387,8 @@
 
         public Drawables(Context context) {
             final int targetSdkVersion = context.getApplicationInfo().targetSdkVersion;
-            mIsRtlCompatibilityMode = (targetSdkVersion < JELLY_BEAN_MR1 ||
-                !context.getApplicationInfo().hasRtlSupport());
+            mIsRtlCompatibilityMode = targetSdkVersion < JELLY_BEAN_MR1
+                    || !context.getApplicationInfo().hasRtlSupport();
             mOverride = false;
         }
 
@@ -767,69 +768,69 @@
                 int attr = appearance.getIndex(i);
 
                 switch (attr) {
-                case com.android.internal.R.styleable.TextAppearance_textColorHighlight:
-                    textColorHighlight = appearance.getColor(attr, textColorHighlight);
-                    break;
+                    case com.android.internal.R.styleable.TextAppearance_textColorHighlight:
+                        textColorHighlight = appearance.getColor(attr, textColorHighlight);
+                        break;
 
-                case com.android.internal.R.styleable.TextAppearance_textColor:
-                    textColor = appearance.getColorStateList(attr);
-                    break;
+                    case com.android.internal.R.styleable.TextAppearance_textColor:
+                        textColor = appearance.getColorStateList(attr);
+                        break;
 
-                case com.android.internal.R.styleable.TextAppearance_textColorHint:
-                    textColorHint = appearance.getColorStateList(attr);
-                    break;
+                    case com.android.internal.R.styleable.TextAppearance_textColorHint:
+                        textColorHint = appearance.getColorStateList(attr);
+                        break;
 
-                case com.android.internal.R.styleable.TextAppearance_textColorLink:
-                    textColorLink = appearance.getColorStateList(attr);
-                    break;
+                    case com.android.internal.R.styleable.TextAppearance_textColorLink:
+                        textColorLink = appearance.getColorStateList(attr);
+                        break;
 
-                case com.android.internal.R.styleable.TextAppearance_textSize:
-                    textSize = appearance.getDimensionPixelSize(attr, textSize);
-                    break;
+                    case com.android.internal.R.styleable.TextAppearance_textSize:
+                        textSize = appearance.getDimensionPixelSize(attr, textSize);
+                        break;
 
-                case com.android.internal.R.styleable.TextAppearance_typeface:
-                    typefaceIndex = appearance.getInt(attr, -1);
-                    break;
+                    case com.android.internal.R.styleable.TextAppearance_typeface:
+                        typefaceIndex = appearance.getInt(attr, -1);
+                        break;
 
-                case com.android.internal.R.styleable.TextAppearance_fontFamily:
-                    fontFamily = appearance.getString(attr);
-                    break;
+                    case com.android.internal.R.styleable.TextAppearance_fontFamily:
+                        fontFamily = appearance.getString(attr);
+                        break;
 
-                case com.android.internal.R.styleable.TextAppearance_textStyle:
-                    styleIndex = appearance.getInt(attr, -1);
-                    break;
+                    case com.android.internal.R.styleable.TextAppearance_textStyle:
+                        styleIndex = appearance.getInt(attr, -1);
+                        break;
 
-                case com.android.internal.R.styleable.TextAppearance_textAllCaps:
-                    allCaps = appearance.getBoolean(attr, false);
-                    break;
+                    case com.android.internal.R.styleable.TextAppearance_textAllCaps:
+                        allCaps = appearance.getBoolean(attr, false);
+                        break;
 
-                case com.android.internal.R.styleable.TextAppearance_shadowColor:
-                    shadowcolor = appearance.getInt(attr, 0);
-                    break;
+                    case com.android.internal.R.styleable.TextAppearance_shadowColor:
+                        shadowcolor = appearance.getInt(attr, 0);
+                        break;
 
-                case com.android.internal.R.styleable.TextAppearance_shadowDx:
-                    dx = appearance.getFloat(attr, 0);
-                    break;
+                    case com.android.internal.R.styleable.TextAppearance_shadowDx:
+                        dx = appearance.getFloat(attr, 0);
+                        break;
 
-                case com.android.internal.R.styleable.TextAppearance_shadowDy:
-                    dy = appearance.getFloat(attr, 0);
-                    break;
+                    case com.android.internal.R.styleable.TextAppearance_shadowDy:
+                        dy = appearance.getFloat(attr, 0);
+                        break;
 
-                case com.android.internal.R.styleable.TextAppearance_shadowRadius:
-                    r = appearance.getFloat(attr, 0);
-                    break;
+                    case com.android.internal.R.styleable.TextAppearance_shadowRadius:
+                        r = appearance.getFloat(attr, 0);
+                        break;
 
-                case com.android.internal.R.styleable.TextAppearance_elegantTextHeight:
-                    elegant = appearance.getBoolean(attr, false);
-                    break;
+                    case com.android.internal.R.styleable.TextAppearance_elegantTextHeight:
+                        elegant = appearance.getBoolean(attr, false);
+                        break;
 
-                case com.android.internal.R.styleable.TextAppearance_letterSpacing:
-                    letterSpacing = appearance.getFloat(attr, 0);
-                    break;
+                    case com.android.internal.R.styleable.TextAppearance_letterSpacing:
+                        letterSpacing = appearance.getFloat(attr, 0);
+                        break;
 
-                case com.android.internal.R.styleable.TextAppearance_fontFeatureSettings:
-                    fontFeatureSettings = appearance.getString(attr);
-                    break;
+                    case com.android.internal.R.styleable.TextAppearance_fontFeatureSettings:
+                        fontFeatureSettings = appearance.getString(attr);
+                        break;
                 }
             }
 
@@ -846,7 +847,7 @@
         int buffertype = 0;
         boolean selectallonfocus = false;
         Drawable drawableLeft = null, drawableTop = null, drawableRight = null,
-            drawableBottom = null, drawableStart = null, drawableEnd = null;
+                drawableBottom = null, drawableStart = null, drawableEnd = null;
         ColorStateList drawableTint = null;
         PorterDuff.Mode drawableTintMode = null;
         int drawablePadding = 0;
@@ -866,351 +867,351 @@
             int attr = a.getIndex(i);
 
             switch (attr) {
-            case com.android.internal.R.styleable.TextView_editable:
-                editable = a.getBoolean(attr, editable);
-                break;
+                case com.android.internal.R.styleable.TextView_editable:
+                    editable = a.getBoolean(attr, editable);
+                    break;
 
-            case com.android.internal.R.styleable.TextView_inputMethod:
-                inputMethod = a.getText(attr);
-                break;
+                case com.android.internal.R.styleable.TextView_inputMethod:
+                    inputMethod = a.getText(attr);
+                    break;
 
-            case com.android.internal.R.styleable.TextView_numeric:
-                numeric = a.getInt(attr, numeric);
-                break;
+                case com.android.internal.R.styleable.TextView_numeric:
+                    numeric = a.getInt(attr, numeric);
+                    break;
 
-            case com.android.internal.R.styleable.TextView_digits:
-                digits = a.getText(attr);
-                break;
+                case com.android.internal.R.styleable.TextView_digits:
+                    digits = a.getText(attr);
+                    break;
 
-            case com.android.internal.R.styleable.TextView_phoneNumber:
-                phone = a.getBoolean(attr, phone);
-                break;
+                case com.android.internal.R.styleable.TextView_phoneNumber:
+                    phone = a.getBoolean(attr, phone);
+                    break;
 
-            case com.android.internal.R.styleable.TextView_autoText:
-                autotext = a.getBoolean(attr, autotext);
-                break;
+                case com.android.internal.R.styleable.TextView_autoText:
+                    autotext = a.getBoolean(attr, autotext);
+                    break;
 
-            case com.android.internal.R.styleable.TextView_capitalize:
-                autocap = a.getInt(attr, autocap);
-                break;
+                case com.android.internal.R.styleable.TextView_capitalize:
+                    autocap = a.getInt(attr, autocap);
+                    break;
 
-            case com.android.internal.R.styleable.TextView_bufferType:
-                buffertype = a.getInt(attr, buffertype);
-                break;
+                case com.android.internal.R.styleable.TextView_bufferType:
+                    buffertype = a.getInt(attr, buffertype);
+                    break;
 
-            case com.android.internal.R.styleable.TextView_selectAllOnFocus:
-                selectallonfocus = a.getBoolean(attr, selectallonfocus);
-                break;
+                case com.android.internal.R.styleable.TextView_selectAllOnFocus:
+                    selectallonfocus = a.getBoolean(attr, selectallonfocus);
+                    break;
 
-            case com.android.internal.R.styleable.TextView_autoLink:
-                mAutoLinkMask = a.getInt(attr, 0);
-                break;
+                case com.android.internal.R.styleable.TextView_autoLink:
+                    mAutoLinkMask = a.getInt(attr, 0);
+                    break;
 
-            case com.android.internal.R.styleable.TextView_linksClickable:
-                mLinksClickable = a.getBoolean(attr, true);
-                break;
+                case com.android.internal.R.styleable.TextView_linksClickable:
+                    mLinksClickable = a.getBoolean(attr, true);
+                    break;
 
-            case com.android.internal.R.styleable.TextView_drawableLeft:
-                drawableLeft = a.getDrawable(attr);
-                break;
+                case com.android.internal.R.styleable.TextView_drawableLeft:
+                    drawableLeft = a.getDrawable(attr);
+                    break;
 
-            case com.android.internal.R.styleable.TextView_drawableTop:
-                drawableTop = a.getDrawable(attr);
-                break;
+                case com.android.internal.R.styleable.TextView_drawableTop:
+                    drawableTop = a.getDrawable(attr);
+                    break;
 
-            case com.android.internal.R.styleable.TextView_drawableRight:
-                drawableRight = a.getDrawable(attr);
-                break;
+                case com.android.internal.R.styleable.TextView_drawableRight:
+                    drawableRight = a.getDrawable(attr);
+                    break;
 
-            case com.android.internal.R.styleable.TextView_drawableBottom:
-                drawableBottom = a.getDrawable(attr);
-                break;
+                case com.android.internal.R.styleable.TextView_drawableBottom:
+                    drawableBottom = a.getDrawable(attr);
+                    break;
 
-            case com.android.internal.R.styleable.TextView_drawableStart:
-                drawableStart = a.getDrawable(attr);
-                break;
+                case com.android.internal.R.styleable.TextView_drawableStart:
+                    drawableStart = a.getDrawable(attr);
+                    break;
 
-            case com.android.internal.R.styleable.TextView_drawableEnd:
-                drawableEnd = a.getDrawable(attr);
-                break;
+                case com.android.internal.R.styleable.TextView_drawableEnd:
+                    drawableEnd = a.getDrawable(attr);
+                    break;
 
-            case com.android.internal.R.styleable.TextView_drawableTint:
-                drawableTint = a.getColorStateList(attr);
-                break;
+                case com.android.internal.R.styleable.TextView_drawableTint:
+                    drawableTint = a.getColorStateList(attr);
+                    break;
 
-            case com.android.internal.R.styleable.TextView_drawableTintMode:
-                drawableTintMode = Drawable.parseTintMode(a.getInt(attr, -1), drawableTintMode);
-                break;
+                case com.android.internal.R.styleable.TextView_drawableTintMode:
+                    drawableTintMode = Drawable.parseTintMode(a.getInt(attr, -1), drawableTintMode);
+                    break;
 
-            case com.android.internal.R.styleable.TextView_drawablePadding:
-                drawablePadding = a.getDimensionPixelSize(attr, drawablePadding);
-                break;
+                case com.android.internal.R.styleable.TextView_drawablePadding:
+                    drawablePadding = a.getDimensionPixelSize(attr, drawablePadding);
+                    break;
 
-            case com.android.internal.R.styleable.TextView_maxLines:
-                setMaxLines(a.getInt(attr, -1));
-                break;
+                case com.android.internal.R.styleable.TextView_maxLines:
+                    setMaxLines(a.getInt(attr, -1));
+                    break;
 
-            case com.android.internal.R.styleable.TextView_maxHeight:
-                setMaxHeight(a.getDimensionPixelSize(attr, -1));
-                break;
+                case com.android.internal.R.styleable.TextView_maxHeight:
+                    setMaxHeight(a.getDimensionPixelSize(attr, -1));
+                    break;
 
-            case com.android.internal.R.styleable.TextView_lines:
-                setLines(a.getInt(attr, -1));
-                break;
+                case com.android.internal.R.styleable.TextView_lines:
+                    setLines(a.getInt(attr, -1));
+                    break;
 
-            case com.android.internal.R.styleable.TextView_height:
-                setHeight(a.getDimensionPixelSize(attr, -1));
-                break;
+                case com.android.internal.R.styleable.TextView_height:
+                    setHeight(a.getDimensionPixelSize(attr, -1));
+                    break;
 
-            case com.android.internal.R.styleable.TextView_minLines:
-                setMinLines(a.getInt(attr, -1));
-                break;
+                case com.android.internal.R.styleable.TextView_minLines:
+                    setMinLines(a.getInt(attr, -1));
+                    break;
 
-            case com.android.internal.R.styleable.TextView_minHeight:
-                setMinHeight(a.getDimensionPixelSize(attr, -1));
-                break;
+                case com.android.internal.R.styleable.TextView_minHeight:
+                    setMinHeight(a.getDimensionPixelSize(attr, -1));
+                    break;
 
-            case com.android.internal.R.styleable.TextView_maxEms:
-                setMaxEms(a.getInt(attr, -1));
-                break;
+                case com.android.internal.R.styleable.TextView_maxEms:
+                    setMaxEms(a.getInt(attr, -1));
+                    break;
 
-            case com.android.internal.R.styleable.TextView_maxWidth:
-                setMaxWidth(a.getDimensionPixelSize(attr, -1));
-                break;
+                case com.android.internal.R.styleable.TextView_maxWidth:
+                    setMaxWidth(a.getDimensionPixelSize(attr, -1));
+                    break;
 
-            case com.android.internal.R.styleable.TextView_ems:
-                setEms(a.getInt(attr, -1));
-                break;
+                case com.android.internal.R.styleable.TextView_ems:
+                    setEms(a.getInt(attr, -1));
+                    break;
 
-            case com.android.internal.R.styleable.TextView_width:
-                setWidth(a.getDimensionPixelSize(attr, -1));
-                break;
+                case com.android.internal.R.styleable.TextView_width:
+                    setWidth(a.getDimensionPixelSize(attr, -1));
+                    break;
 
-            case com.android.internal.R.styleable.TextView_minEms:
-                setMinEms(a.getInt(attr, -1));
-                break;
+                case com.android.internal.R.styleable.TextView_minEms:
+                    setMinEms(a.getInt(attr, -1));
+                    break;
 
-            case com.android.internal.R.styleable.TextView_minWidth:
-                setMinWidth(a.getDimensionPixelSize(attr, -1));
-                break;
+                case com.android.internal.R.styleable.TextView_minWidth:
+                    setMinWidth(a.getDimensionPixelSize(attr, -1));
+                    break;
 
-            case com.android.internal.R.styleable.TextView_gravity:
-                setGravity(a.getInt(attr, -1));
-                break;
+                case com.android.internal.R.styleable.TextView_gravity:
+                    setGravity(a.getInt(attr, -1));
+                    break;
 
-            case com.android.internal.R.styleable.TextView_hint:
-                hint = a.getText(attr);
-                break;
+                case com.android.internal.R.styleable.TextView_hint:
+                    hint = a.getText(attr);
+                    break;
 
-            case com.android.internal.R.styleable.TextView_text:
-                text = a.getText(attr);
-                break;
+                case com.android.internal.R.styleable.TextView_text:
+                    text = a.getText(attr);
+                    break;
 
-            case com.android.internal.R.styleable.TextView_scrollHorizontally:
-                if (a.getBoolean(attr, false)) {
-                    setHorizontallyScrolling(true);
-                }
-                break;
+                case com.android.internal.R.styleable.TextView_scrollHorizontally:
+                    if (a.getBoolean(attr, false)) {
+                        setHorizontallyScrolling(true);
+                    }
+                    break;
 
-            case com.android.internal.R.styleable.TextView_singleLine:
-                singleLine = a.getBoolean(attr, singleLine);
-                break;
+                case com.android.internal.R.styleable.TextView_singleLine:
+                    singleLine = a.getBoolean(attr, singleLine);
+                    break;
 
-            case com.android.internal.R.styleable.TextView_ellipsize:
-                ellipsize = a.getInt(attr, ellipsize);
-                break;
+                case com.android.internal.R.styleable.TextView_ellipsize:
+                    ellipsize = a.getInt(attr, ellipsize);
+                    break;
 
-            case com.android.internal.R.styleable.TextView_marqueeRepeatLimit:
-                setMarqueeRepeatLimit(a.getInt(attr, mMarqueeRepeatLimit));
-                break;
+                case com.android.internal.R.styleable.TextView_marqueeRepeatLimit:
+                    setMarqueeRepeatLimit(a.getInt(attr, mMarqueeRepeatLimit));
+                    break;
 
-            case com.android.internal.R.styleable.TextView_includeFontPadding:
-                if (!a.getBoolean(attr, true)) {
-                    setIncludeFontPadding(false);
-                }
-                break;
+                case com.android.internal.R.styleable.TextView_includeFontPadding:
+                    if (!a.getBoolean(attr, true)) {
+                        setIncludeFontPadding(false);
+                    }
+                    break;
 
-            case com.android.internal.R.styleable.TextView_cursorVisible:
-                if (!a.getBoolean(attr, true)) {
-                    setCursorVisible(false);
-                }
-                break;
+                case com.android.internal.R.styleable.TextView_cursorVisible:
+                    if (!a.getBoolean(attr, true)) {
+                        setCursorVisible(false);
+                    }
+                    break;
 
-            case com.android.internal.R.styleable.TextView_maxLength:
-                maxlength = a.getInt(attr, -1);
-                break;
+                case com.android.internal.R.styleable.TextView_maxLength:
+                    maxlength = a.getInt(attr, -1);
+                    break;
 
-            case com.android.internal.R.styleable.TextView_textScaleX:
-                setTextScaleX(a.getFloat(attr, 1.0f));
-                break;
+                case com.android.internal.R.styleable.TextView_textScaleX:
+                    setTextScaleX(a.getFloat(attr, 1.0f));
+                    break;
 
-            case com.android.internal.R.styleable.TextView_freezesText:
-                mFreezesText = a.getBoolean(attr, false);
-                break;
+                case com.android.internal.R.styleable.TextView_freezesText:
+                    mFreezesText = a.getBoolean(attr, false);
+                    break;
 
-            case com.android.internal.R.styleable.TextView_shadowColor:
-                shadowcolor = a.getInt(attr, 0);
-                break;
+                case com.android.internal.R.styleable.TextView_shadowColor:
+                    shadowcolor = a.getInt(attr, 0);
+                    break;
 
-            case com.android.internal.R.styleable.TextView_shadowDx:
-                dx = a.getFloat(attr, 0);
-                break;
+                case com.android.internal.R.styleable.TextView_shadowDx:
+                    dx = a.getFloat(attr, 0);
+                    break;
 
-            case com.android.internal.R.styleable.TextView_shadowDy:
-                dy = a.getFloat(attr, 0);
-                break;
+                case com.android.internal.R.styleable.TextView_shadowDy:
+                    dy = a.getFloat(attr, 0);
+                    break;
 
-            case com.android.internal.R.styleable.TextView_shadowRadius:
-                r = a.getFloat(attr, 0);
-                break;
+                case com.android.internal.R.styleable.TextView_shadowRadius:
+                    r = a.getFloat(attr, 0);
+                    break;
 
-            case com.android.internal.R.styleable.TextView_enabled:
-                setEnabled(a.getBoolean(attr, isEnabled()));
-                break;
+                case com.android.internal.R.styleable.TextView_enabled:
+                    setEnabled(a.getBoolean(attr, isEnabled()));
+                    break;
 
-            case com.android.internal.R.styleable.TextView_textColorHighlight:
-                textColorHighlight = a.getColor(attr, textColorHighlight);
-                break;
+                case com.android.internal.R.styleable.TextView_textColorHighlight:
+                    textColorHighlight = a.getColor(attr, textColorHighlight);
+                    break;
 
-            case com.android.internal.R.styleable.TextView_textColor:
-                textColor = a.getColorStateList(attr);
-                break;
+                case com.android.internal.R.styleable.TextView_textColor:
+                    textColor = a.getColorStateList(attr);
+                    break;
 
-            case com.android.internal.R.styleable.TextView_textColorHint:
-                textColorHint = a.getColorStateList(attr);
-                break;
+                case com.android.internal.R.styleable.TextView_textColorHint:
+                    textColorHint = a.getColorStateList(attr);
+                    break;
 
-            case com.android.internal.R.styleable.TextView_textColorLink:
-                textColorLink = a.getColorStateList(attr);
-                break;
+                case com.android.internal.R.styleable.TextView_textColorLink:
+                    textColorLink = a.getColorStateList(attr);
+                    break;
 
-            case com.android.internal.R.styleable.TextView_textSize:
-                textSize = a.getDimensionPixelSize(attr, textSize);
-                break;
+                case com.android.internal.R.styleable.TextView_textSize:
+                    textSize = a.getDimensionPixelSize(attr, textSize);
+                    break;
 
-            case com.android.internal.R.styleable.TextView_typeface:
-                typefaceIndex = a.getInt(attr, typefaceIndex);
-                break;
+                case com.android.internal.R.styleable.TextView_typeface:
+                    typefaceIndex = a.getInt(attr, typefaceIndex);
+                    break;
 
-            case com.android.internal.R.styleable.TextView_textStyle:
-                styleIndex = a.getInt(attr, styleIndex);
-                break;
+                case com.android.internal.R.styleable.TextView_textStyle:
+                    styleIndex = a.getInt(attr, styleIndex);
+                    break;
 
-            case com.android.internal.R.styleable.TextView_fontFamily:
-                fontFamily = a.getString(attr);
-                fontFamilyExplicit = true;
-                break;
+                case com.android.internal.R.styleable.TextView_fontFamily:
+                    fontFamily = a.getString(attr);
+                    fontFamilyExplicit = true;
+                    break;
 
-            case com.android.internal.R.styleable.TextView_password:
-                password = a.getBoolean(attr, password);
-                break;
+                case com.android.internal.R.styleable.TextView_password:
+                    password = a.getBoolean(attr, password);
+                    break;
 
-            case com.android.internal.R.styleable.TextView_lineSpacingExtra:
-                mSpacingAdd = a.getDimensionPixelSize(attr, (int) mSpacingAdd);
-                break;
+                case com.android.internal.R.styleable.TextView_lineSpacingExtra:
+                    mSpacingAdd = a.getDimensionPixelSize(attr, (int) mSpacingAdd);
+                    break;
 
-            case com.android.internal.R.styleable.TextView_lineSpacingMultiplier:
-                mSpacingMult = a.getFloat(attr, mSpacingMult);
-                break;
+                case com.android.internal.R.styleable.TextView_lineSpacingMultiplier:
+                    mSpacingMult = a.getFloat(attr, mSpacingMult);
+                    break;
 
-            case com.android.internal.R.styleable.TextView_inputType:
-                inputType = a.getInt(attr, EditorInfo.TYPE_NULL);
-                break;
+                case com.android.internal.R.styleable.TextView_inputType:
+                    inputType = a.getInt(attr, EditorInfo.TYPE_NULL);
+                    break;
 
-            case com.android.internal.R.styleable.TextView_allowUndo:
-                createEditorIfNeeded();
-                mEditor.mAllowUndo = a.getBoolean(attr, true);
-                break;
+                case com.android.internal.R.styleable.TextView_allowUndo:
+                    createEditorIfNeeded();
+                    mEditor.mAllowUndo = a.getBoolean(attr, true);
+                    break;
 
-            case com.android.internal.R.styleable.TextView_imeOptions:
-                createEditorIfNeeded();
-                mEditor.createInputContentTypeIfNeeded();
-                mEditor.mInputContentType.imeOptions = a.getInt(attr,
-                        mEditor.mInputContentType.imeOptions);
-                break;
+                case com.android.internal.R.styleable.TextView_imeOptions:
+                    createEditorIfNeeded();
+                    mEditor.createInputContentTypeIfNeeded();
+                    mEditor.mInputContentType.imeOptions = a.getInt(attr,
+                            mEditor.mInputContentType.imeOptions);
+                    break;
 
-            case com.android.internal.R.styleable.TextView_imeActionLabel:
-                createEditorIfNeeded();
-                mEditor.createInputContentTypeIfNeeded();
-                mEditor.mInputContentType.imeActionLabel = a.getText(attr);
-                break;
+                case com.android.internal.R.styleable.TextView_imeActionLabel:
+                    createEditorIfNeeded();
+                    mEditor.createInputContentTypeIfNeeded();
+                    mEditor.mInputContentType.imeActionLabel = a.getText(attr);
+                    break;
 
-            case com.android.internal.R.styleable.TextView_imeActionId:
-                createEditorIfNeeded();
-                mEditor.createInputContentTypeIfNeeded();
-                mEditor.mInputContentType.imeActionId = a.getInt(attr,
-                        mEditor.mInputContentType.imeActionId);
-                break;
+                case com.android.internal.R.styleable.TextView_imeActionId:
+                    createEditorIfNeeded();
+                    mEditor.createInputContentTypeIfNeeded();
+                    mEditor.mInputContentType.imeActionId = a.getInt(attr,
+                            mEditor.mInputContentType.imeActionId);
+                    break;
 
-            case com.android.internal.R.styleable.TextView_privateImeOptions:
-                setPrivateImeOptions(a.getString(attr));
-                break;
+                case com.android.internal.R.styleable.TextView_privateImeOptions:
+                    setPrivateImeOptions(a.getString(attr));
+                    break;
 
-            case com.android.internal.R.styleable.TextView_editorExtras:
-                try {
-                    setInputExtras(a.getResourceId(attr, 0));
-                } catch (XmlPullParserException e) {
-                    Log.w(LOG_TAG, "Failure reading input extras", e);
-                } catch (IOException e) {
-                    Log.w(LOG_TAG, "Failure reading input extras", e);
-                }
-                break;
+                case com.android.internal.R.styleable.TextView_editorExtras:
+                    try {
+                        setInputExtras(a.getResourceId(attr, 0));
+                    } catch (XmlPullParserException e) {
+                        Log.w(LOG_TAG, "Failure reading input extras", e);
+                    } catch (IOException e) {
+                        Log.w(LOG_TAG, "Failure reading input extras", e);
+                    }
+                    break;
 
-            case com.android.internal.R.styleable.TextView_textCursorDrawable:
-                mCursorDrawableRes = a.getResourceId(attr, 0);
-                break;
+                case com.android.internal.R.styleable.TextView_textCursorDrawable:
+                    mCursorDrawableRes = a.getResourceId(attr, 0);
+                    break;
 
-            case com.android.internal.R.styleable.TextView_textSelectHandleLeft:
-                mTextSelectHandleLeftRes = a.getResourceId(attr, 0);
-                break;
+                case com.android.internal.R.styleable.TextView_textSelectHandleLeft:
+                    mTextSelectHandleLeftRes = a.getResourceId(attr, 0);
+                    break;
 
-            case com.android.internal.R.styleable.TextView_textSelectHandleRight:
-                mTextSelectHandleRightRes = a.getResourceId(attr, 0);
-                break;
+                case com.android.internal.R.styleable.TextView_textSelectHandleRight:
+                    mTextSelectHandleRightRes = a.getResourceId(attr, 0);
+                    break;
 
-            case com.android.internal.R.styleable.TextView_textSelectHandle:
-                mTextSelectHandleRes = a.getResourceId(attr, 0);
-                break;
+                case com.android.internal.R.styleable.TextView_textSelectHandle:
+                    mTextSelectHandleRes = a.getResourceId(attr, 0);
+                    break;
 
-            case com.android.internal.R.styleable.TextView_textEditSuggestionItemLayout:
-                mTextEditSuggestionItemLayout = a.getResourceId(attr, 0);
-                break;
+                case com.android.internal.R.styleable.TextView_textEditSuggestionItemLayout:
+                    mTextEditSuggestionItemLayout = a.getResourceId(attr, 0);
+                    break;
 
-            case com.android.internal.R.styleable.TextView_textEditSuggestionContainerLayout:
-                mTextEditSuggestionContainerLayout = a.getResourceId(attr, 0);
-                break;
+                case com.android.internal.R.styleable.TextView_textEditSuggestionContainerLayout:
+                    mTextEditSuggestionContainerLayout = a.getResourceId(attr, 0);
+                    break;
 
-            case com.android.internal.R.styleable.TextView_textEditSuggestionHighlightStyle:
-                mTextEditSuggestionHighlightStyle = a.getResourceId(attr, 0);
-                break;
+                case com.android.internal.R.styleable.TextView_textEditSuggestionHighlightStyle:
+                    mTextEditSuggestionHighlightStyle = a.getResourceId(attr, 0);
+                    break;
 
-            case com.android.internal.R.styleable.TextView_textIsSelectable:
-                setTextIsSelectable(a.getBoolean(attr, false));
-                break;
+                case com.android.internal.R.styleable.TextView_textIsSelectable:
+                    setTextIsSelectable(a.getBoolean(attr, false));
+                    break;
 
-            case com.android.internal.R.styleable.TextView_textAllCaps:
-                allCaps = a.getBoolean(attr, false);
-                break;
+                case com.android.internal.R.styleable.TextView_textAllCaps:
+                    allCaps = a.getBoolean(attr, false);
+                    break;
 
-            case com.android.internal.R.styleable.TextView_elegantTextHeight:
-                elegant = a.getBoolean(attr, false);
-                break;
+                case com.android.internal.R.styleable.TextView_elegantTextHeight:
+                    elegant = a.getBoolean(attr, false);
+                    break;
 
-            case com.android.internal.R.styleable.TextView_letterSpacing:
-                letterSpacing = a.getFloat(attr, 0);
-                break;
+                case com.android.internal.R.styleable.TextView_letterSpacing:
+                    letterSpacing = a.getFloat(attr, 0);
+                    break;
 
-            case com.android.internal.R.styleable.TextView_fontFeatureSettings:
-                fontFeatureSettings = a.getString(attr);
-                break;
+                case com.android.internal.R.styleable.TextView_fontFeatureSettings:
+                    fontFeatureSettings = a.getString(attr);
+                    break;
 
-            case com.android.internal.R.styleable.TextView_breakStrategy:
-                mBreakStrategy = a.getInt(attr, Layout.BREAK_STRATEGY_SIMPLE);
-                break;
+                case com.android.internal.R.styleable.TextView_breakStrategy:
+                    mBreakStrategy = a.getInt(attr, Layout.BREAK_STRATEGY_SIMPLE);
+                    break;
 
-            case com.android.internal.R.styleable.TextView_hyphenationFrequency:
-                mHyphenationFrequency = a.getInt(attr, Layout.HYPHENATION_FREQUENCY_NONE);
-                break;
+                case com.android.internal.R.styleable.TextView_hyphenationFrequency:
+                    mHyphenationFrequency = a.getInt(attr, Layout.HYPHENATION_FREQUENCY_NONE);
+                    break;
             }
         }
         a.recycle();
@@ -1284,24 +1285,24 @@
             inputType = EditorInfo.TYPE_CLASS_TEXT;
 
             switch (autocap) {
-            case 1:
-                cap = TextKeyListener.Capitalize.SENTENCES;
-                inputType |= EditorInfo.TYPE_TEXT_FLAG_CAP_SENTENCES;
-                break;
+                case 1:
+                    cap = TextKeyListener.Capitalize.SENTENCES;
+                    inputType |= EditorInfo.TYPE_TEXT_FLAG_CAP_SENTENCES;
+                    break;
 
-            case 2:
-                cap = TextKeyListener.Capitalize.WORDS;
-                inputType |= EditorInfo.TYPE_TEXT_FLAG_CAP_WORDS;
-                break;
+                case 2:
+                    cap = TextKeyListener.Capitalize.WORDS;
+                    inputType |= EditorInfo.TYPE_TEXT_FLAG_CAP_WORDS;
+                    break;
 
-            case 3:
-                cap = TextKeyListener.Capitalize.CHARACTERS;
-                inputType |= EditorInfo.TYPE_TEXT_FLAG_CAP_CHARACTERS;
-                break;
+                case 3:
+                    cap = TextKeyListener.Capitalize.CHARACTERS;
+                    inputType |= EditorInfo.TYPE_TEXT_FLAG_CAP_CHARACTERS;
+                    break;
 
-            default:
-                cap = TextKeyListener.Capitalize.NONE;
-                break;
+                default:
+                    cap = TextKeyListener.Capitalize.NONE;
+                    break;
             }
 
             createEditorIfNeeded();
@@ -1336,15 +1337,18 @@
             }
         }
 
-        if (mEditor != null) mEditor.adjustInputType(password, passwordInputType,
-                webPasswordInputType, numberPasswordInputType);
+        if (mEditor != null) {
+            mEditor.adjustInputType(password, passwordInputType, webPasswordInputType,
+                    numberPasswordInputType);
+        }
 
         if (selectallonfocus) {
             createEditorIfNeeded();
             mEditor.mSelectAllOnFocus = true;
 
-            if (bufferType == BufferType.NORMAL)
+            if (bufferType == BufferType.NORMAL) {
                 bufferType = BufferType.SPANNABLE;
+            }
         }
 
         // Set up the tint (if needed) before setting the drawables so that it
@@ -1365,7 +1369,7 @@
 
         // This call will save the initial left/right drawables
         setCompoundDrawablesWithIntrinsicBounds(
-            drawableLeft, drawableTop, drawableRight, drawableBottom);
+                drawableLeft, drawableTop, drawableRight, drawableBottom);
         setRelativeDrawablesIfNeeded(drawableStart, drawableEnd);
         setCompoundDrawablePadding(drawablePadding);
 
@@ -1375,7 +1379,7 @@
         applySingleLine(singleLine, singleLine, singleLine);
 
         if (singleLine && getKeyListener() == null && ellipsize < 0) {
-                ellipsize = 3; // END
+            ellipsize = 3; // END
         }
 
         switch (ellipsize) {
@@ -1418,8 +1422,9 @@
         if (password || passwordInputType || webPasswordInputType || numberPasswordInputType) {
             setTransformationMethod(PasswordTransformationMethod.getInstance());
             typefaceIndex = MONOSPACE;
-        } else if (mEditor != null &&
-                (mEditor.mInputType & (EditorInfo.TYPE_MASK_CLASS | EditorInfo.TYPE_MASK_VARIATION))
+        } else if (mEditor != null
+                && (mEditor.mInputType
+                        & (EditorInfo.TYPE_MASK_CLASS | EditorInfo.TYPE_MASK_VARIATION))
                 == (EditorInfo.TYPE_CLASS_TEXT | EditorInfo.TYPE_TEXT_VARIATION_PASSWORD)) {
             typefaceIndex = MONOSPACE;
         }
@@ -1459,17 +1464,17 @@
             int attr = a.getIndex(i);
 
             switch (attr) {
-            case com.android.internal.R.styleable.View_focusable:
-                focusable = a.getBoolean(attr, focusable);
-                break;
+                case com.android.internal.R.styleable.View_focusable:
+                    focusable = a.getBoolean(attr, focusable);
+                    break;
 
-            case com.android.internal.R.styleable.View_clickable:
-                clickable = a.getBoolean(attr, clickable);
-                break;
+                case com.android.internal.R.styleable.View_clickable:
+                    clickable = a.getBoolean(attr, clickable);
+                    break;
 
-            case com.android.internal.R.styleable.View_longClickable:
-                longClickable = a.getBoolean(attr, longClickable);
-                break;
+                case com.android.internal.R.styleable.View_longClickable:
+                    longClickable = a.getBoolean(attr, longClickable);
+                    break;
             }
         }
         a.recycle();
@@ -1698,7 +1703,7 @@
      * @see #getText
      */
     public Editable getEditableText() {
-        return (mText instanceof Editable) ? (Editable)mText : null;
+        return (mText instanceof Editable) ? (Editable) mText : null;
     }
 
     /**
@@ -2738,10 +2743,10 @@
 
     @Override
     public void setPadding(int left, int top, int right, int bottom) {
-        if (left != mPaddingLeft ||
-            right != mPaddingRight ||
-            top != mPaddingTop ||
-            bottom != mPaddingBottom) {
+        if (left != mPaddingLeft
+                || right != mPaddingRight
+                || top != mPaddingTop
+                ||  bottom != mPaddingBottom) {
             nullLayouts();
         }
 
@@ -2752,10 +2757,10 @@
 
     @Override
     public void setPaddingRelative(int start, int top, int end, int bottom) {
-        if (start != getPaddingStart() ||
-            end != getPaddingEnd() ||
-            top != mPaddingTop ||
-            bottom != mPaddingBottom) {
+        if (start != getPaddingStart()
+                || end != getPaddingEnd()
+                || top != mPaddingTop
+                || bottom != mPaddingBottom) {
             nullLayouts();
         }
 
@@ -2848,17 +2853,17 @@
 
         if (ta.hasValue(R.styleable.TextAppearance_elegantTextHeight)) {
             setElegantTextHeight(ta.getBoolean(
-                R.styleable.TextAppearance_elegantTextHeight, false));
+                    R.styleable.TextAppearance_elegantTextHeight, false));
         }
 
         if (ta.hasValue(R.styleable.TextAppearance_letterSpacing)) {
             setLetterSpacing(ta.getFloat(
-                R.styleable.TextAppearance_letterSpacing, 0));
+                    R.styleable.TextAppearance_letterSpacing, 0));
         }
 
         if (ta.hasValue(R.styleable.TextAppearance_fontFeatureSettings)) {
             setFontFeatureSettings(ta.getString(
-                R.styleable.TextAppearance_fontFeatureSettings));
+                    R.styleable.TextAppearance_fontFeatureSettings));
         }
 
         ta.recycle();
@@ -2878,7 +2883,7 @@
      * Get the default {@link LocaleList} of the text in this TextView.
      * @return the default {@link LocaleList} of the text in this TextView.
      */
-    @NonNull @Size(min=1)
+    @NonNull @Size(min = 1)
     public LocaleList getTextLocales() {
         return mTextPaint.getTextLocales();
     }
@@ -2912,7 +2917,7 @@
      *
      * @see Paint#setTextLocales
      */
-    public void setTextLocales(@NonNull @Size(min=1) LocaleList locales) {
+    public void setTextLocales(@NonNull @Size(min = 1) LocaleList locales) {
         mLocalesChanged = true;
         mTextPaint.setTextLocales(locales);
         if (mLayout != null) {
@@ -2991,10 +2996,11 @@
         Context c = getContext();
         Resources r;
 
-        if (c == null)
+        if (c == null) {
             r = Resources.getSystem();
-        else
+        } else {
             r = c.getResources();
+        }
 
         setRawTextSize(TypedValue.applyDimension(
                 unit, size, r.getDisplayMetrics()));
@@ -3134,8 +3140,8 @@
     /**
      * Returns the font feature settings. The format is the same as the CSS
      * font-feature-settings attribute:
-     * <a href="http://dev.w3.org/csswg/css-fonts/#propdef-font-feature-settings">
-     *     http://dev.w3.org/csswg/css-fonts/#propdef-font-feature-settings</a>
+     * <a href="https://www.w3.org/TR/css-fonts-3/#font-feature-settings-prop">
+     *     https://www.w3.org/TR/css-fonts-3/#font-feature-settings-prop</a>
      *
      * @return the currently set font feature settings.  Default is null.
      *
@@ -3177,8 +3183,8 @@
     }
 
     /**
-     * Sets the hyphenation frequency. The default value for both TextView and EditText, which is set
-     * from the theme, is {@link Layout#HYPHENATION_FREQUENCY_NORMAL}.
+     * Sets the hyphenation frequency. The default value for both TextView and EditText, which is
+     * set from the theme, is {@link Layout#HYPHENATION_FREQUENCY_NORMAL}.
      *
      * @attr ref android.R.styleable#TextView_hyphenationFrequency
      * @see #getHyphenationFrequency()
@@ -3206,8 +3212,8 @@
     /**
      * Sets font feature settings. The format is the same as the CSS
      * font-feature-settings attribute:
-     * <a href="http://dev.w3.org/csswg/css-fonts/#propdef-font-feature-settings">
-     *     http://dev.w3.org/csswg/css-fonts/#propdef-font-feature-settings</a>
+     * <a href="https://www.w3.org/TR/css-fonts-3/#font-feature-settings-prop">
+     *     https://www.w3.org/TR/css-fonts-3/#font-feature-settings-prop</a>
      *
      * @param fontFeatureSettings font feature settings represented as CSS compatible string
      *
@@ -3255,6 +3261,7 @@
      *
      * @attr ref android.R.styleable#TextView_textColor
      */
+    @android.view.RemotableViewMethod
     public void setTextColor(ColorStateList colors) {
         if (colors == null) {
             throw new NullPointerException();
@@ -3584,8 +3591,8 @@
 
         boolean newLayout = false;
 
-        if ((gravity & Gravity.RELATIVE_HORIZONTAL_GRAVITY_MASK) !=
-            (mGravity & Gravity.RELATIVE_HORIZONTAL_GRAVITY_MASK)) {
+        if ((gravity & Gravity.RELATIVE_HORIZONTAL_GRAVITY_MASK)
+                != (mGravity & Gravity.RELATIVE_HORIZONTAL_GRAVITY_MASK)) {
             newLayout = true;
         }
 
@@ -3601,8 +3608,7 @@
             int hintWant = mHintLayout == null ? 0 : mHintLayout.getWidth();
 
             makeNewLayout(want, hintWant, UNKNOWN_BORING, UNKNOWN_BORING,
-                          mRight - mLeft - getCompoundPaddingLeft() -
-                          getCompoundPaddingRight(), true);
+                    mRight - mLeft - getCompoundPaddingLeft() - getCompoundPaddingRight(), true);
         }
     }
 
@@ -4190,7 +4196,7 @@
             return;
         }
 
-        SavedState ss = (SavedState)state;
+        SavedState ss = (SavedState) state;
         super.onRestoreInstanceState(ss.getSuperState());
 
         // XXX restore buffer type too, as well as lots of other stuff
@@ -4209,9 +4215,8 @@
                         restored = "(restored) ";
                     }
 
-                    Log.e(LOG_TAG, "Saved cursor position " + ss.selStart +
-                          "/" + ss.selEnd + " out of range for " + restored +
-                          "text " + mText);
+                    Log.e(LOG_TAG, "Saved cursor position " + ss.selStart + "/" + ss.selEnd
+                            + " out of range for " + restored + "text " + mText);
                 } else {
                     Selection.setSelection((Spannable) mText, ss.selStart, ss.selEnd);
 
@@ -4349,8 +4354,8 @@
 
         if (!mUserSetTextScaleX) mTextPaint.setTextScaleX(1.0f);
 
-        if (text instanceof Spanned &&
-            ((Spanned) text).getSpanStart(TextUtils.TruncateAt.MARQUEE) >= 0) {
+        if (text instanceof Spanned
+                && ((Spanned) text).getSpanStart(TextUtils.TruncateAt.MARQUEE) >= 0) {
             if (ViewConfiguration.get(mContext).isFadingMarqueeEnabled()) {
                 setHorizontalFadingEdgeEnabled(true);
                 mMarqueeFadeMode = MARQUEE_FADE_NORMAL;
@@ -4384,8 +4389,8 @@
             needEditableForNotification = true;
         }
 
-        if (type == BufferType.EDITABLE || getKeyListener() != null ||
-                needEditableForNotification) {
+        if (type == BufferType.EDITABLE || getKeyListener() != null
+                || needEditableForNotification) {
             createEditorIfNeeded();
             mEditor.forgetUndoRedo();
             Editable t = mEditableFactory.newEditable(text);
@@ -4450,8 +4455,8 @@
 
             if (mChangeWatcher == null) mChangeWatcher = new ChangeWatcher();
 
-            sp.setSpan(mChangeWatcher, 0, textLength, Spanned.SPAN_INCLUSIVE_INCLUSIVE |
-                       (CHANGE_WATCHER_PRIORITY << Spanned.SPAN_PRIORITY_SHIFT));
+            sp.setSpan(mChangeWatcher, 0, textLength, Spanned.SPAN_INCLUSIVE_INCLUSIVE
+                    | (CHANGE_WATCHER_PRIORITY << Spanned.SPAN_PRIORITY_SHIFT));
 
             if (mEditor != null) mEditor.addSpanWatchers(sp);
 
@@ -4606,29 +4611,29 @@
     }
 
     private static boolean isMultilineInputType(int type) {
-        return (type & (EditorInfo.TYPE_MASK_CLASS | EditorInfo.TYPE_TEXT_FLAG_MULTI_LINE)) ==
-            (EditorInfo.TYPE_CLASS_TEXT | EditorInfo.TYPE_TEXT_FLAG_MULTI_LINE);
+        return (type & (EditorInfo.TYPE_MASK_CLASS | EditorInfo.TYPE_TEXT_FLAG_MULTI_LINE))
+                == (EditorInfo.TYPE_CLASS_TEXT | EditorInfo.TYPE_TEXT_FLAG_MULTI_LINE);
     }
 
     /**
      * Removes the suggestion spans.
      */
     CharSequence removeSuggestionSpans(CharSequence text) {
-       if (text instanceof Spanned) {
-           Spannable spannable;
-           if (text instanceof Spannable) {
-               spannable = (Spannable) text;
-           } else {
-               spannable = new SpannableString(text);
-               text = spannable;
-           }
+        if (text instanceof Spanned) {
+            Spannable spannable;
+            if (text instanceof Spannable) {
+                spannable = (Spannable) text;
+            } else {
+                spannable = new SpannableString(text);
+                text = spannable;
+            }
 
-           SuggestionSpan[] spans = spannable.getSpans(0, text.length(), SuggestionSpan.class);
-           for (int i = 0; i < spans.length; i++) {
-               spannable.removeSpan(spans[i]);
-           }
-       }
-       return text;
+            SuggestionSpan[] spans = spannable.getSpans(0, text.length(), SuggestionSpan.class);
+            for (int i = 0; i < spans.length; i++) {
+                spannable.removeSpan(spans[i]);
+            }
+        }
+        return text;
     }
 
     /**
@@ -4910,8 +4915,8 @@
                 View v = focusSearch(FOCUS_FORWARD);
                 if (v != null) {
                     if (!v.requestFocus(FOCUS_FORWARD)) {
-                        throw new IllegalStateException("focus search returned a view " +
-                                "that wasn't able to take focus!");
+                        throw new IllegalStateException("focus search returned a view "
+                                + "that wasn't able to take focus!");
                     }
                 }
                 return;
@@ -4920,8 +4925,8 @@
                 View v = focusSearch(FOCUS_BACKWARD);
                 if (v != null) {
                     if (!v.requestFocus(FOCUS_BACKWARD)) {
-                        throw new IllegalStateException("focus search returned a view " +
-                                "that wasn't able to take focus!");
+                        throw new IllegalStateException("focus search returned a view "
+                                + "that wasn't able to take focus!");
                     }
                 }
                 return;
@@ -5046,8 +5051,12 @@
      */
     @Nullable
     public LocaleList getImeHintLocales() {
-        if (mEditor == null) { return null; }
-        if (mEditor.mInputContentType == null) { return null; }
+        if (mEditor == null) {
+            return null;
+        }
+        if (mEditor.mInputContentType == null) {
+            return null;
+        }
         return mEditor.mInputContentType.imeHintLocales;
     }
 
@@ -5177,9 +5186,9 @@
 
     private int getBoxHeight(Layout l) {
         Insets opticalInsets = isLayoutModeOptical(mParent) ? getOpticalInsets() : Insets.NONE;
-        int padding = (l == mHintLayout) ?
-                getCompoundPaddingTop() + getCompoundPaddingBottom() :
-                getExtendedPaddingTop() + getExtendedPaddingBottom();
+        int padding = (l == mHintLayout)
+                ? getCompoundPaddingTop() + getCompoundPaddingBottom()
+                : getExtendedPaddingTop() + getExtendedPaddingBottom();
         return getMeasuredHeight() - padding + opticalInsets.top + opticalInsets.bottom;
     }
 
@@ -5197,10 +5206,11 @@
             int textht = l.getHeight();
 
             if (textht < boxht) {
-                if (gravity == Gravity.BOTTOM)
+                if (gravity == Gravity.BOTTOM) {
                     voffset = boxht - textht;
-                else // (gravity == Gravity.CENTER_VERTICAL)
+                } else { // (gravity == Gravity.CENTER_VERTICAL)
                     voffset = (boxht - textht) >> 1;
+                }
             }
         }
         return voffset;
@@ -5220,10 +5230,11 @@
             int textht = l.getHeight();
 
             if (textht < boxht) {
-                if (gravity == Gravity.TOP)
+                if (gravity == Gravity.TOP) {
                     voffset = boxht - textht;
-                else // (gravity == Gravity.CENTER_VERTICAL)
+                } else { // (gravity == Gravity.CENTER_VERTICAL)
                     voffset = (boxht - textht) >> 1;
+                }
             }
         }
         return voffset;
@@ -5293,54 +5304,55 @@
         if (mLayout == null) {
             invalidate();
         } else {
-                int lineStart = mLayout.getLineForOffset(start);
-                int top = mLayout.getLineTop(lineStart);
+            int lineStart = mLayout.getLineForOffset(start);
+            int top = mLayout.getLineTop(lineStart);
 
-                // This is ridiculous, but the descent from the line above
-                // can hang down into the line we really want to redraw,
-                // so we have to invalidate part of the line above to make
-                // sure everything that needs to be redrawn really is.
-                // (But not the whole line above, because that would cause
-                // the same problem with the descenders on the line above it!)
-                if (lineStart > 0) {
-                    top -= mLayout.getLineDescent(lineStart - 1);
+            // This is ridiculous, but the descent from the line above
+            // can hang down into the line we really want to redraw,
+            // so we have to invalidate part of the line above to make
+            // sure everything that needs to be redrawn really is.
+            // (But not the whole line above, because that would cause
+            // the same problem with the descenders on the line above it!)
+            if (lineStart > 0) {
+                top -= mLayout.getLineDescent(lineStart - 1);
+            }
+
+            int lineEnd;
+
+            if (start == end) {
+                lineEnd = lineStart;
+            } else {
+                lineEnd = mLayout.getLineForOffset(end);
+            }
+
+            int bottom = mLayout.getLineBottom(lineEnd);
+
+            // mEditor can be null in case selection is set programmatically.
+            if (invalidateCursor && mEditor != null) {
+                for (int i = 0; i < mEditor.mCursorCount; i++) {
+                    Rect bounds = mEditor.mCursorDrawable[i].getBounds();
+                    top = Math.min(top, bounds.top);
+                    bottom = Math.max(bottom, bounds.bottom);
                 }
+            }
 
-                int lineEnd;
+            final int compoundPaddingLeft = getCompoundPaddingLeft();
+            final int verticalPadding = getExtendedPaddingTop() + getVerticalOffset(true);
 
-                if (start == end)
-                    lineEnd = lineStart;
-                else
-                    lineEnd = mLayout.getLineForOffset(end);
+            int left, right;
+            if (lineStart == lineEnd && !invalidateCursor) {
+                left = (int) mLayout.getPrimaryHorizontal(start);
+                right = (int) (mLayout.getPrimaryHorizontal(end) + 1.0);
+                left += compoundPaddingLeft;
+                right += compoundPaddingLeft;
+            } else {
+                // Rectangle bounding box when the region spans several lines
+                left = compoundPaddingLeft;
+                right = getWidth() - getCompoundPaddingRight();
+            }
 
-                int bottom = mLayout.getLineBottom(lineEnd);
-
-                // mEditor can be null in case selection is set programmatically.
-                if (invalidateCursor && mEditor != null) {
-                    for (int i = 0; i < mEditor.mCursorCount; i++) {
-                        Rect bounds = mEditor.mCursorDrawable[i].getBounds();
-                        top = Math.min(top, bounds.top);
-                        bottom = Math.max(bottom, bounds.bottom);
-                    }
-                }
-
-                final int compoundPaddingLeft = getCompoundPaddingLeft();
-                final int verticalPadding = getExtendedPaddingTop() + getVerticalOffset(true);
-
-                int left, right;
-                if (lineStart == lineEnd && !invalidateCursor) {
-                    left = (int) mLayout.getPrimaryHorizontal(start);
-                    right = (int) (mLayout.getPrimaryHorizontal(end) + 1.0);
-                    left += compoundPaddingLeft;
-                    right += compoundPaddingLeft;
-                } else {
-                    // Rectangle bounding box when the region spans several lines
-                    left = compoundPaddingLeft;
-                    right = getWidth() - getCompoundPaddingRight();
-                }
-
-                invalidate(mScrollX + left, verticalPadding + top,
-                        mScrollX + right, verticalPadding + bottom);
+            invalidate(mScrollX + left, verticalPadding + top,
+                    mScrollX + right, verticalPadding + bottom);
         }
     }
 
@@ -5360,6 +5372,7 @@
     /**
      * {@inheritDoc}
      */
+    @Override
     public boolean onPreDraw() {
         if (mLayout == null) {
             assumeLayout();
@@ -5372,8 +5385,8 @@
              */
             int curs = getSelectionEnd();
             // Do not create the controller if it is not already created.
-            if (mEditor != null && mEditor.mSelectionModifierCursorController != null &&
-                    mEditor.mSelectionModifierCursorController.isSelectionStartDragged()) {
+            if (mEditor != null && mEditor.mSelectionModifierCursorController != null
+                    && mEditor.mSelectionModifierCursorController.isSelectionStartDragged()) {
                 curs = getSelectionStart();
             }
 
@@ -5446,8 +5459,8 @@
 
     @Override
     protected int getLeftPaddingOffset() {
-        return getCompoundPaddingLeft() - mPaddingLeft +
-                (int) Math.min(0, mShadowDx - mShadowRadius);
+        return getCompoundPaddingLeft() - mPaddingLeft
+                + (int) Math.min(0, mShadowDx - mShadowRadius);
     }
 
     @Override
@@ -5462,8 +5475,8 @@
 
     @Override
     protected int getRightPaddingOffset() {
-        return -(getCompoundPaddingRight() - mPaddingRight) +
-                (int) Math.max(0, mShadowDx + mShadowRadius);
+        return -(getCompoundPaddingRight() - mPaddingRight)
+                + (int) Math.max(0, mShadowDx + mShadowRadius);
     }
 
     @Override
@@ -5658,9 +5671,9 @@
         final int selEnd = getSelectionEnd();
         if (mMovement != null && (isFocused() || isPressed()) && selStart >= 0) {
             if (selStart == selEnd) {
-                if (mEditor != null && mEditor.isCursorVisible() &&
-                        (SystemClock.uptimeMillis() - mEditor.mShowCursor) %
-                        (2 * Editor.BLINK) < Editor.BLINK) {
+                if (mEditor != null && mEditor.isCursorVisible()
+                        && (SystemClock.uptimeMillis() - mEditor.mShowCursor)
+                        % (2 * Editor.BLINK) < Editor.BLINK) {
                     if (mHighlightPathBogus) {
                         if (mHighlightPath == null) mHighlightPath = new Path();
                         mHighlightPath.reset();
@@ -5719,7 +5732,7 @@
         final boolean isLayoutRtl = isLayoutRtl();
         final int offset = getHorizontalOffsetForDrawables();
         final int leftOffset = isLayoutRtl ? 0 : offset;
-        final int rightOffset = isLayoutRtl ? offset : 0 ;
+        final int rightOffset = isLayoutRtl ? offset : 0;
 
         final Drawables dr = mDrawables;
         if (dr != null) {
@@ -5736,8 +5749,7 @@
             if (dr.mShowing[Drawables.LEFT] != null) {
                 canvas.save();
                 canvas.translate(scrollX + mPaddingLeft + leftOffset,
-                                 scrollY + compoundPaddingTop +
-                                 (vspace - dr.mDrawableHeightLeft) / 2);
+                        scrollY + compoundPaddingTop + (vspace - dr.mDrawableHeightLeft) / 2);
                 dr.mShowing[Drawables.LEFT].draw(canvas);
                 canvas.restore();
             }
@@ -5757,8 +5769,8 @@
             // Make sure to update invalidateDrawable() when changing this code.
             if (dr.mShowing[Drawables.TOP] != null) {
                 canvas.save();
-                canvas.translate(scrollX + compoundPaddingLeft +
-                        (hspace - dr.mDrawableWidthTop) / 2, scrollY + mPaddingTop);
+                canvas.translate(scrollX + compoundPaddingLeft
+                        + (hspace - dr.mDrawableWidthTop) / 2, scrollY + mPaddingTop);
                 dr.mShowing[Drawables.TOP].draw(canvas);
                 canvas.restore();
             }
@@ -5767,8 +5779,8 @@
             // Make sure to update invalidateDrawable() when changing this code.
             if (dr.mShowing[Drawables.BOTTOM] != null) {
                 canvas.save();
-                canvas.translate(scrollX + compoundPaddingLeft +
-                        (hspace - dr.mDrawableWidthBottom) / 2,
+                canvas.translate(scrollX + compoundPaddingLeft
+                        + (hspace - dr.mDrawableWidthBottom) / 2,
                          scrollY + bottom - top - mPaddingBottom - dr.mDrawableSizeBottom);
                 dr.mShowing[Drawables.BOTTOM].draw(canvas);
                 canvas.restore();
@@ -5808,8 +5820,8 @@
         float clipLeft = compoundPaddingLeft + scrollX;
         float clipTop = (scrollY == 0) ? 0 : extendedPaddingTop + scrollY;
         float clipRight = right - left - getCompoundPaddingRight() + scrollX;
-        float clipBottom = bottom - top + scrollY -
-                ((scrollY == maxScrollY) ? 0 : extendedPaddingBottom);
+        float clipBottom = bottom - top + scrollY
+                - ((scrollY == maxScrollY) ? 0 : extendedPaddingBottom);
 
         if (mShadowRadius != 0) {
             clipLeft += Math.min(0, mShadowDx - mShadowRadius);
@@ -5835,8 +5847,8 @@
         final int layoutDirection = getLayoutDirection();
         final int absoluteGravity = Gravity.getAbsoluteGravity(mGravity, layoutDirection);
         if (isMarqueeFadeEnabled()) {
-            if (!mSingleLine && getLineCount() == 1 && canMarquee() &&
-                    (absoluteGravity & Gravity.HORIZONTAL_GRAVITY_MASK) != Gravity.LEFT) {
+            if (!mSingleLine && getLineCount() == 1 && canMarquee()
+                    && (absoluteGravity & Gravity.HORIZONTAL_GRAVITY_MASK) != Gravity.LEFT) {
                 final int width = mRight - mLeft;
                 final int padding = getCompoundPaddingLeft() + getCompoundPaddingRight();
                 final float dx = mLayout.getLineRight(0) - (width - padding);
@@ -5906,8 +5918,8 @@
                 }
                 synchronized (TEMP_RECTF) {
                     mHighlightPath.computeBounds(TEMP_RECTF, true);
-                    r.left = (int)TEMP_RECTF.left-1;
-                    r.right = (int)TEMP_RECTF.right+1;
+                    r.left = (int) TEMP_RECTF.left - 1;
+                    r.right = (int) TEMP_RECTF.right + 1;
                 }
             }
         }
@@ -5946,8 +5958,7 @@
                 bounds.set(0, 0, 0, 0);
             }
             return 0;
-        }
-        else {
+        } else {
             int baseline = mLayout.getLineBounds(line, bounds);
 
             int voffset = getExtendedPaddingTop();
@@ -6098,19 +6109,19 @@
         KeyEvent up = KeyEvent.changeAction(event, KeyEvent.ACTION_UP);
         if (which == KEY_DOWN_HANDLED_BY_KEY_LISTENER) {
             // mEditor and mEditor.mInput are not null from doKeyDown
-            mEditor.mKeyListener.onKeyUp(this, (Editable)mText, keyCode, up);
+            mEditor.mKeyListener.onKeyUp(this, (Editable) mText, keyCode, up);
             while (--repeatCount > 0) {
-                mEditor.mKeyListener.onKeyDown(this, (Editable)mText, keyCode, down);
-                mEditor.mKeyListener.onKeyUp(this, (Editable)mText, keyCode, up);
+                mEditor.mKeyListener.onKeyDown(this, (Editable) mText, keyCode, down);
+                mEditor.mKeyListener.onKeyUp(this, (Editable) mText, keyCode, up);
             }
             hideErrorIfUnchanged();
 
         } else if (which == KEY_DOWN_HANDLED_BY_MOVEMENT_METHOD) {
             // mMovement is not null from doKeyDown
-            mMovement.onKeyUp(this, (Spannable)mText, keyCode, up);
+            mMovement.onKeyUp(this, (Spannable) mText, keyCode, up);
             while (--repeatCount > 0) {
-                mMovement.onKeyDown(this, (Spannable)mText, keyCode, down);
-                mMovement.onKeyUp(this, (Spannable)mText, keyCode, up);
+                mMovement.onKeyDown(this, (Spannable) mText, keyCode, down);
+                mMovement.onKeyUp(this, (Spannable) mText, keyCode, up);
             }
         }
 
@@ -6132,8 +6143,9 @@
             return true;
         }
 
-        if (mEditor != null &&
-                (mEditor.mInputType & EditorInfo.TYPE_MASK_CLASS) == EditorInfo.TYPE_CLASS_TEXT) {
+        if (mEditor != null
+                && (mEditor.mInputType & EditorInfo.TYPE_MASK_CLASS)
+                        == EditorInfo.TYPE_CLASS_TEXT) {
             int variation = mEditor.mInputType & EditorInfo.TYPE_MASK_VARIATION;
             if (variation == EditorInfo.TYPE_TEXT_VARIATION_EMAIL_ADDRESS
                     || variation == EditorInfo.TYPE_TEXT_VARIATION_EMAIL_SUBJECT) {
@@ -6149,8 +6161,9 @@
      * of inserting the character.  Insert tabs only in multi-line editors.
      */
     private boolean shouldAdvanceFocusOnTab() {
-        if (getKeyListener() != null && !mSingleLine && mEditor != null &&
-                (mEditor.mInputType & EditorInfo.TYPE_MASK_CLASS) == EditorInfo.TYPE_CLASS_TEXT) {
+        if (getKeyListener() != null && !mSingleLine && mEditor != null
+                && (mEditor.mInputType & EditorInfo.TYPE_MASK_CLASS)
+                        == EditorInfo.TYPE_CLASS_TEXT) {
             int variation = mEditor.mInputType & EditorInfo.TYPE_MASK_VARIATION;
             if (variation == EditorInfo.TYPE_TEXT_FLAG_IME_MULTI_LINE
                     || variation == EditorInfo.TYPE_TEXT_FLAG_MULTI_LINE) {
@@ -6184,9 +6197,9 @@
                     if (mEditor != null && mEditor.mInputContentType != null) {
                         // If there is an action listener, given them a
                         // chance to consume the event.
-                        if (mEditor.mInputContentType.onEditorActionListener != null &&
-                                mEditor.mInputContentType.onEditorActionListener.onEditorAction(
-                                this, EditorInfo.IME_NULL, event)) {
+                        if (mEditor.mInputContentType.onEditorActionListener != null
+                                && mEditor.mInputContentType.onEditorActionListener.onEditorAction(
+                                        this, EditorInfo.IME_NULL, event)) {
                             mEditor.mInputContentType.enterDown = true;
                             // We are consuming the enter key for them.
                             return KEY_EVENT_HANDLED;
@@ -6304,7 +6317,7 @@
                 }
             }
             if (doDown) {
-                if (mMovement.onKeyDown(this, (Spannable)mText, keyCode, event)) {
+                if (mMovement.onKeyDown(this, (Spannable) mText, keyCode, event)) {
                     if (event.getRepeatCount() == 0 && !KeyEvent.isModifierKey(keyCode)) {
                         mPreventDefaultMovement = true;
                     }
@@ -6313,8 +6326,8 @@
             }
         }
 
-        return mPreventDefaultMovement && !KeyEvent.isModifierKey(keyCode) ?
-                KEY_EVENT_HANDLED : KEY_EVENT_NOT_HANDLED;
+        return mPreventDefaultMovement && !KeyEvent.isModifierKey(keyCode)
+                ? KEY_EVENT_HANDLED : KEY_EVENT_NOT_HANDLED;
     }
 
     /**
@@ -6405,9 +6418,8 @@
 
                             if (v != null) {
                                 if (!v.requestFocus(FOCUS_DOWN)) {
-                                    throw new IllegalStateException(
-                                            "focus search returned a view " +
-                                            "that wasn't able to take focus!");
+                                    throw new IllegalStateException("focus search returned a view "
+                                            + "that wasn't able to take focus!");
                                 }
 
                                 /*
@@ -6433,13 +6445,17 @@
                 break;
         }
 
-        if (mEditor != null && mEditor.mKeyListener != null)
-            if (mEditor.mKeyListener.onKeyUp(this, (Editable) mText, keyCode, event))
+        if (mEditor != null && mEditor.mKeyListener != null) {
+            if (mEditor.mKeyListener.onKeyUp(this, (Editable) mText, keyCode, event)) {
                 return true;
+            }
+        }
 
-        if (mMovement != null && mLayout != null)
-            if (mMovement.onKeyUp(this, (Spannable) mText, keyCode, event))
+        if (mMovement != null && mLayout != null) {
+            if (mMovement.onKeyUp(this, (Spannable) mText, keyCode, event)) {
                 return true;
+            }
+        }
 
         return super.onKeyUp(keyCode, event);
     }
@@ -6471,9 +6487,9 @@
             if (focusSearch(FOCUS_UP) != null) {
                 outAttrs.imeOptions |= EditorInfo.IME_FLAG_NAVIGATE_PREVIOUS;
             }
-            if ((outAttrs.imeOptions&EditorInfo.IME_MASK_ACTION)
+            if ((outAttrs.imeOptions & EditorInfo.IME_MASK_ACTION)
                     == EditorInfo.IME_ACTION_UNSPECIFIED) {
-                if ((outAttrs.imeOptions&EditorInfo.IME_FLAG_NAVIGATE_NEXT) != 0) {
+                if ((outAttrs.imeOptions & EditorInfo.IME_FLAG_NAVIGATE_NEXT) != 0) {
                     // An action has not been set, but the enter key will move to
                     // the next focus, so set the action to that.
                     outAttrs.imeOptions |= EditorInfo.IME_ACTION_NEXT;
@@ -6564,18 +6580,24 @@
         // avoid crashes.  If this is a partial update, it is possible that
         // the underlying text may have changed, causing us problems here.
         // Also we just don't want to trust clients to do the right thing.
-        Spannable sp = (Spannable)getText();
+        Spannable sp = (Spannable) getText();
         final int N = sp.length();
         int start = text.selectionStart;
-        if (start < 0) start = 0;
-        else if (start > N) start = N;
+        if (start < 0) {
+            start = 0;
+        } else if (start > N) {
+            start = N;
+        }
         int end = text.selectionEnd;
-        if (end < 0) end = 0;
-        else if (end > N) end = N;
+        if (end < 0) {
+            end = 0;
+        } else if (end > N) {
+            end = N;
+        }
         Selection.setSelection(sp, start, end);
 
         // Finally, update the selection mode.
-        if ((text.flags&ExtractedText.FLAG_SELECTING) != 0) {
+        if ((text.flags & ExtractedText.FLAG_SELECTING) != 0) {
             MetaKeyKeyListener.startSelecting(this, sp);
         } else {
             MetaKeyKeyListener.stopSelecting(this, sp);
@@ -6736,12 +6758,12 @@
                 alignment = Layout.Alignment.ALIGN_CENTER;
                 break;
             case TEXT_ALIGNMENT_VIEW_START:
-                alignment = (getLayoutDirection() == LAYOUT_DIRECTION_RTL) ?
-                        Layout.Alignment.ALIGN_RIGHT : Layout.Alignment.ALIGN_LEFT;
+                alignment = (getLayoutDirection() == LAYOUT_DIRECTION_RTL)
+                        ? Layout.Alignment.ALIGN_RIGHT : Layout.Alignment.ALIGN_LEFT;
                 break;
             case TEXT_ALIGNMENT_VIEW_END:
-                alignment = (getLayoutDirection() == LAYOUT_DIRECTION_RTL) ?
-                        Layout.Alignment.ALIGN_LEFT : Layout.Alignment.ALIGN_RIGHT;
+                alignment = (getLayoutDirection() == LAYOUT_DIRECTION_RTL)
+                        ? Layout.Alignment.ALIGN_LEFT : Layout.Alignment.ALIGN_RIGHT;
                 break;
             case TEXT_ALIGNMENT_INHERIT:
                 // This should never happen as we have already resolved the text alignment
@@ -6778,17 +6800,17 @@
         }
 
         Layout.Alignment alignment = getLayoutAlignment();
-        final boolean testDirChange = mSingleLine && mLayout != null &&
-            (alignment == Layout.Alignment.ALIGN_NORMAL ||
-             alignment == Layout.Alignment.ALIGN_OPPOSITE);
+        final boolean testDirChange = mSingleLine && mLayout != null
+                && (alignment == Layout.Alignment.ALIGN_NORMAL
+                        || alignment == Layout.Alignment.ALIGN_OPPOSITE);
         int oldDir = 0;
         if (testDirChange) oldDir = mLayout.getParagraphDirection(0);
         boolean shouldEllipsize = mEllipsize != null && getKeyListener() == null;
-        final boolean switchEllipsize = mEllipsize == TruncateAt.MARQUEE &&
-                mMarqueeFadeMode != MARQUEE_FADE_NORMAL;
+        final boolean switchEllipsize = mEllipsize == TruncateAt.MARQUEE
+                && mMarqueeFadeMode != MARQUEE_FADE_NORMAL;
         TruncateAt effectiveEllipsize = mEllipsize;
-        if (mEllipsize == TruncateAt.MARQUEE &&
-                mMarqueeFadeMode == MARQUEE_FADE_SWITCH_SHOW_ELLIPSIS) {
+        if (mEllipsize == TruncateAt.MARQUEE
+                && mMarqueeFadeMode == MARQUEE_FADE_SWITCH_SHOW_ELLIPSIS) {
             effectiveEllipsize = TruncateAt.END_SMALL;
         }
 
@@ -6799,8 +6821,8 @@
         mLayout = makeSingleLayout(wantWidth, boring, ellipsisWidth, alignment, shouldEllipsize,
                 effectiveEllipsize, effectiveEllipsize == mEllipsize);
         if (switchEllipsize) {
-            TruncateAt oppositeEllipsize = effectiveEllipsize == TruncateAt.MARQUEE ?
-                    TruncateAt.END : TruncateAt.MARQUEE;
+            TruncateAt oppositeEllipsize = effectiveEllipsize == TruncateAt.MARQUEE
+                    ? TruncateAt.END : TruncateAt.MARQUEE;
             mSavedMarqueeModeLayout = makeSingleLayout(wantWidth, boring, ellipsisWidth, alignment,
                     shouldEllipsize, oppositeEllipsize, effectiveEllipsize != mEllipsize);
         }
@@ -6820,11 +6842,10 @@
             }
 
             if (hintBoring != null) {
-                if (hintBoring.width <= hintWidth &&
-                    (!shouldEllipsize || hintBoring.width <= ellipsisWidth)) {
+                if (hintBoring.width <= hintWidth
+                        && (!shouldEllipsize || hintBoring.width <= ellipsisWidth)) {
                     if (mSavedHintLayout != null) {
-                        mHintLayout = mSavedHintLayout.
-                                replaceOrMake(mHint, mTextPaint,
+                        mHintLayout = mSavedHintLayout.replaceOrMake(mHint, mTextPaint,
                                 hintWidth, alignment, mSpacingMult, mSpacingAdd,
                                 hintBoring, mIncludePad);
                     } else {
@@ -6836,8 +6857,7 @@
                     mSavedHintLayout = (BoringLayout) mHintLayout;
                 } else if (shouldEllipsize && hintBoring.width <= hintWidth) {
                     if (mSavedHintLayout != null) {
-                        mHintLayout = mSavedHintLayout.
-                                replaceOrMake(mHint, mTextPaint,
+                        mHintLayout = mSavedHintLayout.replaceOrMake(mHint, mTextPaint,
                                 hintWidth, alignment, mSpacingMult, mSpacingAdd,
                                 hintBoring, mIncludePad, mEllipsize,
                                 ellipsisWidth);
@@ -6911,8 +6931,8 @@
             }
 
             if (boring != null) {
-                if (boring.width <= wantWidth &&
-                        (effectiveEllipsize == null || boring.width <= ellipsisWidth)) {
+                if (boring.width <= wantWidth
+                        && (effectiveEllipsize == null || boring.width <= ellipsisWidth)) {
                     if (useSaved && mSavedLayout != null) {
                         result = mSavedLayout.replaceOrMake(mTransformed, mTextPaint,
                                 wantWidth, alignment, mSpacingMult, mSpacingAdd,
@@ -6965,8 +6985,8 @@
         if (isHardwareAccelerated()) return false;
 
         // Only compress the text if it hasn't been compressed by the previous pass
-        if (width > 0.0f && mLayout != null && getLineCount() == 1 && !mUserSetTextScaleX &&
-                mTextPaint.getTextScaleX() == 1.0f) {
+        if (width > 0.0f && mLayout != null && getLineCount() == 1 && !mUserSetTextScaleX
+                && mTextPaint.getTextScaleX() == 1.0f) {
             final float textWidth = mLayout.getLineWidth(0);
             final float overflow = (textWidth + 1.0f - width) / width;
             if (overflow > 0.0f && overflow <= Marquee.MARQUEE_DELTA_MAX) {
@@ -6992,8 +7012,9 @@
         // but it's ok for the last line not to have a newline
 
         for (int i = 0; i < n - 1; i++) {
-            if (text.charAt(layout.getLineEnd(i) - 1) != '\n')
+            if (text.charAt(layout.getLineEnd(i) - 1) != '\n') {
                 return -1;
+            }
         }
 
         for (int i = 0; i < n; i++) {
@@ -7155,15 +7176,14 @@
             makeNewLayout(want, hintWant, boring, hintBoring,
                           width - getCompoundPaddingLeft() - getCompoundPaddingRight(), false);
         } else {
-            final boolean layoutChanged = (mLayout.getWidth() != want) ||
-                    (hintWidth != hintWant) ||
-                    (mLayout.getEllipsizedWidth() !=
-                            width - getCompoundPaddingLeft() - getCompoundPaddingRight());
+            final boolean layoutChanged = (mLayout.getWidth() != want) || (hintWidth != hintWant)
+                    || (mLayout.getEllipsizedWidth()
+                            != width - getCompoundPaddingLeft() - getCompoundPaddingRight());
 
-            final boolean widthChanged = (mHint == null) &&
-                    (mEllipsize == null) &&
-                    (want > mLayout.getWidth()) &&
-                    (mLayout instanceof BoringLayout || (fromexisting && des >= 0 && des <= want));
+            final boolean widthChanged = (mHint == null) && (mEllipsize == null)
+                    && (want > mLayout.getWidth())
+                    && (mLayout instanceof BoringLayout
+                            || (fromexisting && des >= 0 && des <= want));
 
             final boolean maximumChanged = (mMaxMode != mOldMaxMode) || (mMaximum != mOldMaximum);
 
@@ -7203,9 +7223,9 @@
          * We didn't let makeNewLayout() register to bring the cursor into view,
          * so do it here if there is any possibility that it is needed.
          */
-        if (mMovement != null ||
-            mLayout.getWidth() > unpaddedWidth ||
-            mLayout.getHeight() > unpaddedHeight) {
+        if (mMovement != null
+                || mLayout.getWidth() > unpaddedWidth
+                || mLayout.getHeight() > unpaddedHeight) {
             registerForPreDraw();
         } else {
             scrollTo(0, 0);
@@ -7319,10 +7339,10 @@
         // If we have a fixed width, we can just swap in a new text layout
         // if the text height stays the same or if the view height is fixed.
 
-        if (((mLayoutParams.width != LayoutParams.WRAP_CONTENT && mLayoutParams.width != 0) ||
-                (mMaxWidthMode == mMinWidthMode && mMaxWidth == mMinWidth)) &&
-                (mHint == null || mHintLayout != null) &&
-                (mRight - mLeft - getCompoundPaddingLeft() - getCompoundPaddingRight() > 0)) {
+        if (((mLayoutParams.width != LayoutParams.WRAP_CONTENT && mLayoutParams.width != 0)
+                || (mMaxWidthMode == mMinWidthMode && mMaxWidth == mMinWidth))
+                && (mHint == null || mHintLayout != null)
+                && (mRight - mLeft - getCompoundPaddingLeft() - getCompoundPaddingRight() > 0)) {
             // Static width, so try making a new text layout.
 
             int oldht = mLayout.getHeight();
@@ -7340,16 +7360,16 @@
 
             if (mEllipsize != TextUtils.TruncateAt.MARQUEE) {
                 // In a fixed-height view, so use our new text layout.
-                if (mLayoutParams.height != LayoutParams.WRAP_CONTENT &&
-                    mLayoutParams.height != LayoutParams.MATCH_PARENT) {
+                if (mLayoutParams.height != LayoutParams.WRAP_CONTENT
+                        && mLayoutParams.height != LayoutParams.MATCH_PARENT) {
                     invalidate();
                     return;
                 }
 
                 // Dynamic height, but height has stayed the same,
                 // so use our new text layout.
-                if (mLayout.getHeight() == oldht &&
-                    (mHintLayout == null || mHintLayout.getHeight() == oldht)) {
+                if (mLayout.getHeight() == oldht
+                        && (mHintLayout == null || mHintLayout.getHeight() == oldht)) {
                     invalidate();
                     return;
                 }
@@ -7402,11 +7422,11 @@
 
         // Convert to left, center, or right alignment.
         if (a == Layout.Alignment.ALIGN_NORMAL) {
-            a = dir == Layout.DIR_LEFT_TO_RIGHT ? Layout.Alignment.ALIGN_LEFT :
-                Layout.Alignment.ALIGN_RIGHT;
-        } else if (a == Layout.Alignment.ALIGN_OPPOSITE){
-            a = dir == Layout.DIR_LEFT_TO_RIGHT ? Layout.Alignment.ALIGN_RIGHT :
-                Layout.Alignment.ALIGN_LEFT;
+            a = dir == Layout.DIR_LEFT_TO_RIGHT
+                    ? Layout.Alignment.ALIGN_LEFT : Layout.Alignment.ALIGN_RIGHT;
+        } else if (a == Layout.Alignment.ALIGN_OPPOSITE) {
+            a = dir == Layout.DIR_LEFT_TO_RIGHT
+                    ? Layout.Alignment.ALIGN_RIGHT : Layout.Alignment.ALIGN_LEFT;
         }
 
         if (a == Layout.Alignment.ALIGN_CENTER) {
@@ -7463,7 +7483,7 @@
         }
         boolean changed = false;
 
-        Layout layout = isShowingHint() ? mHintLayout: mLayout;
+        Layout layout = isShowingHint() ? mHintLayout : mLayout;
 
         if (layout == null) return changed;
 
@@ -7502,7 +7522,7 @@
         // right where it is most likely to be annoying.
         final boolean clamped = grav > 0;
         // FIXME: Is it okay to truncate this, or should we round?
-        final int x = (int)layout.getPrimaryHorizontal(offset, clamped);
+        final int x = (int) layout.getPrimaryHorizontal(offset, clamped);
         final int top = layout.getLineTop(line);
         final int bottom = layout.getLineTop(line + 1);
 
@@ -7520,22 +7540,28 @@
         int hslack = (bottom - top) / 2;
         int vslack = hslack;
 
-        if (vslack > vspace / 4)
+        if (vslack > vspace / 4) {
             vslack = vspace / 4;
-        if (hslack > hspace / 4)
+        }
+        if (hslack > hspace / 4) {
             hslack = hspace / 4;
+        }
 
         int hs = mScrollX;
         int vs = mScrollY;
 
-        if (top - vs < vslack)
+        if (top - vs < vslack) {
             vs = top - vslack;
-        if (bottom - vs > vspace - vslack)
+        }
+        if (bottom - vs > vspace - vslack) {
             vs = bottom - (vspace - vslack);
-        if (ht - vs < vspace)
+        }
+        if (ht - vs < vspace) {
             vs = ht - vspace;
-        if (0 - vs > 0)
+        }
+        if (0 - vs > 0) {
             vs = 0;
+        }
 
         if (grav != 0) {
             if (x - hs < hslack) {
@@ -7547,15 +7573,19 @@
         }
 
         if (grav < 0) {
-            if (left - hs > 0)
+            if (left - hs > 0) {
                 hs = left;
-            if (right - hs < hspace)
+            }
+            if (right - hs < hspace) {
                 hs = right - hspace;
+            }
         } else if (grav > 0) {
-            if (right - hs < hspace)
+            if (right - hs < hspace) {
                 hs = right - hspace;
-            if (left - hs > 0)
+            }
+            if (left - hs > 0) {
                 hs = left;
+            }
         } else /* grav == 0 */ {
             if (right - left <= hspace) {
                 /*
@@ -7670,14 +7700,15 @@
         final int bottom = mLayout.getLineTop(line + 1);
         final int vspace = mBottom - mTop - getExtendedPaddingTop() - getExtendedPaddingBottom();
         int vslack = (bottom - top) / 2;
-        if (vslack > vspace / 4)
+        if (vslack > vspace / 4) {
             vslack = vspace / 4;
+        }
         final int vs = mScrollY;
 
-        if (top < (vs+vslack)) {
-            line = mLayout.getLineForVertical(vs+vslack+(bottom-top));
-        } else if (bottom > (vspace+vs-vslack)) {
-            line = mLayout.getLineForVertical(vspace+vs-vslack-(bottom-top));
+        if (top < (vs + vslack)) {
+            line = mLayout.getLineForVertical(vs + vslack + (bottom - top));
+        } else if (bottom > (vspace + vs - vslack)) {
+            line = mLayout.getLineForVertical(vspace + vs - vslack - (bottom - top));
         }
 
         // Next: make sure the character is visible on screen:
@@ -7685,7 +7716,7 @@
         final int hspace = mRight - mLeft - getCompoundPaddingLeft() - getCompoundPaddingRight();
         final int hs = mScrollX;
         final int leftChar = mLayout.getOffsetForHorizontal(line, hs);
-        final int rightChar = mLayout.getOffsetForHorizontal(line, hspace+hs);
+        final int rightChar = mLayout.getOffsetForHorizontal(line, hspace + hs);
 
         // line might contain bidirectional text
         final int lowChar = leftChar < rightChar ? leftChar : rightChar;
@@ -7699,7 +7730,7 @@
         }
 
         if (newStart != start) {
-            Selection.setSelection((Spannable)mText, newStart);
+            Selection.setSelection((Spannable) mText, newStart);
             return true;
         }
 
@@ -7862,8 +7893,9 @@
      * @param singleLine
      */
     private void setInputTypeSingleLine(boolean singleLine) {
-        if (mEditor != null &&
-                (mEditor.mInputType & EditorInfo.TYPE_MASK_CLASS) == EditorInfo.TYPE_CLASS_TEXT) {
+        if (mEditor != null
+                && (mEditor.mInputType & EditorInfo.TYPE_MASK_CLASS)
+                        == EditorInfo.TYPE_CLASS_TEXT) {
             if (singleLine) {
                 mEditor.mInputType &= ~EditorInfo.TYPE_TEXT_FLAG_MULTI_LINE;
             } else {
@@ -8007,10 +8039,10 @@
     }
 
     private boolean canMarquee() {
-        int width = (mRight - mLeft - getCompoundPaddingLeft() - getCompoundPaddingRight());
-        return width > 0 && (mLayout.getLineWidth(0) > width ||
-                (mMarqueeFadeMode != MARQUEE_FADE_NORMAL && mSavedMarqueeModeLayout != null &&
-                        mSavedMarqueeModeLayout.getLineWidth(0) > width));
+        int width = mRight - mLeft - getCompoundPaddingLeft() - getCompoundPaddingRight();
+        return width > 0 && (mLayout.getLineWidth(0) > width
+                || (mMarqueeFadeMode != MARQUEE_FADE_NORMAL && mSavedMarqueeModeLayout != null
+                        && mSavedMarqueeModeLayout.getLineWidth(0) > width));
     }
 
     private void startMarquee() {
@@ -8021,8 +8053,8 @@
             return;
         }
 
-        if ((mMarquee == null || mMarquee.isStopped()) && (isFocused() || isSelected()) &&
-                getLineCount() == 1 && canMarquee()) {
+        if ((mMarquee == null || mMarquee.isStopped()) && (isFocused() || isSelected())
+                && getLineCount() == 1 && canMarquee()) {
 
             if (mMarqueeFadeMode == MARQUEE_FADE_SWITCH_SHOW_ELLIPSIS) {
                 mMarqueeFadeMode = MARQUEE_FADE_SWITCH_SHOW_FADE;
@@ -8236,12 +8268,12 @@
             ims.mContentChanged = true;
             if (ims.mChangedStart < 0) {
                 ims.mChangedStart = start;
-                ims.mChangedEnd = start+before;
+                ims.mChangedEnd = start + before;
             } else {
                 ims.mChangedStart = Math.min(ims.mChangedStart, start);
                 ims.mChangedEnd = Math.max(ims.mChangedEnd, start + before - ims.mChangedDelta);
             }
-            ims.mChangedDelta += after-before;
+            ims.mChangedDelta += after - before;
         }
         resetErrorChangedFlag();
         sendOnTextChanged(buffer, start, before, after);
@@ -8257,7 +8289,7 @@
         // spending too much time invalidating.
 
         boolean selChanged = false;
-        int newSelStart=-1, newSelEnd=-1;
+        int newSelStart = -1, newSelEnd = -1;
 
         final Editor.InputMethodState ims = mEditor == null ? null : mEditor.mInputMethodState;
 
@@ -8287,7 +8319,7 @@
             mHighlightPathBogus = true;
             if (mEditor != null && !isFocused()) mEditor.mSelectionMoved = true;
 
-            if ((buf.getSpanFlags(what)&Spanned.SPAN_INTERMEDIATE) == 0) {
+            if ((buf.getSpanFlags(what) & Spanned.SPAN_INTERMEDIATE) == 0) {
                 if (newSelStart < 0) {
                     newSelStart = Selection.getSelectionStart(buf);
                 }
@@ -8306,8 +8338,8 @@
             }
         }
 
-        if (what instanceof UpdateAppearance || what instanceof ParagraphStyle ||
-                what instanceof CharacterStyle) {
+        if (what instanceof UpdateAppearance || what instanceof ParagraphStyle
+                || what instanceof CharacterStyle) {
             if (ims == null || ims.mBatchEditNesting == 0) {
                 invalidate();
                 mHighlightPathBogus = true;
@@ -8359,16 +8391,18 @@
                         }
                     }
                 } else {
-                    if (DEBUG_EXTRACT) Log.v(LOG_TAG, "Span change outside of batch: "
-                            + oldStart + "-" + oldEnd + ","
-                            + newStart + "-" + newEnd + " " + what);
+                    if (DEBUG_EXTRACT) {
+                        Log.v(LOG_TAG, "Span change outside of batch: "
+                                + oldStart + "-" + oldEnd + ","
+                                + newStart + "-" + newEnd + " " + what);
+                    }
                     ims.mContentChanged = true;
                 }
             }
         }
 
-        if (mEditor != null && mEditor.mSpellChecker != null && newStart < 0 &&
-                what instanceof SpellCheckSpan) {
+        if (mEditor != null && mEditor.mSpellChecker != null && newStart < 0
+                && what instanceof SpellCheckSpan) {
             mEditor.mSpellChecker.onSpellCheckSpanRemoved((SpellCheckSpan) what);
         }
     }
@@ -8424,7 +8458,7 @@
      */
     public void clearComposingText() {
         if (mText instanceof Spannable) {
-            BaseInputConnection.removeComposingSpans((Spannable)mText);
+            BaseInputConnection.removeComposingSpans((Spannable) mText);
         }
     }
 
@@ -8449,8 +8483,8 @@
         if (mEditor != null) {
             mEditor.onTouchEvent(event);
 
-            if (mEditor.mSelectionModifierCursorController != null &&
-                    mEditor.mSelectionModifierCursorController.isDragAcceleratorActive()) {
+            if (mEditor.mSelectionModifierCursorController != null
+                    && mEditor.mSelectionModifierCursorController.isDragAcceleratorActive()) {
                 return true;
             }
         }
@@ -8472,10 +8506,10 @@
             return superResult;
         }
 
-        final boolean touchIsFinished = (action == MotionEvent.ACTION_UP) &&
-                (mEditor == null || !mEditor.mIgnoreActionUpEvent) && isFocused();
+        final boolean touchIsFinished = (action == MotionEvent.ACTION_UP)
+                && (mEditor == null || !mEditor.mIgnoreActionUpEvent) && isFocused();
 
-         if ((mMovement != null || onCheckIsTextEditor()) && isEnabled()
+        if ((mMovement != null || onCheckIsTextEditor()) && isEnabled()
                 && mText instanceof Spannable && mLayout != null) {
             boolean handled = false;
 
@@ -8608,7 +8642,7 @@
             }
         } else if (getLineCount() == 1) {
             final float lineLeft = getLayout().getLineLeft(0);
-            if(lineLeft > mScrollX) return 0.0f;
+            if (lineLeft > mScrollX) return 0.0f;
             return getHorizontalFadingEdgeStrength(mScrollX, lineLeft);
         }
         return super.getLeftFadingEdgeStrength();
@@ -8620,10 +8654,10 @@
             final Marquee marquee = mMarquee;
             return getHorizontalFadingEdgeStrength(marquee.getMaxFadeScroll(), marquee.getScroll());
         } else if (getLineCount() == 1) {
-            final float rightEdge = mScrollX + (getWidth() - getCompoundPaddingLeft() -
-                    getCompoundPaddingRight());
+            final float rightEdge = mScrollX +
+                    (getWidth() - getCompoundPaddingLeft() - getCompoundPaddingRight());
             final float lineRight = getLayout().getLineRight(0);
-            if(lineRight < rightEdge) return 0.0f;
+            if (lineRight < rightEdge) return 0.0f;
             return getHorizontalFadingEdgeStrength(rightEdge, lineRight);
         }
         return super.getRightFadingEdgeStrength();
@@ -8638,25 +8672,25 @@
      * @param position2 A horizontal position.
      * @return Fading edge strength between [0.0f, 1.0f].
      */
-    @FloatRange(from=0.0, to=1.0)
-    private final float getHorizontalFadingEdgeStrength(float position1, float position2) {
+    @FloatRange(from = 0.0, to = 1.0)
+    private float getHorizontalFadingEdgeStrength(float position1, float position2) {
         final int horizontalFadingEdgeLength = getHorizontalFadingEdgeLength();
-        if(horizontalFadingEdgeLength == 0) return 0.0f;
+        if (horizontalFadingEdgeLength == 0) return 0.0f;
         final float diff = Math.abs(position1 - position2);
-        if(diff > horizontalFadingEdgeLength) return 1.0f;
+        if (diff > horizontalFadingEdgeLength) return 1.0f;
         return diff / horizontalFadingEdgeLength;
     }
 
-    private final boolean isMarqueeFadeEnabled() {
-        return mEllipsize == TextUtils.TruncateAt.MARQUEE &&
-                mMarqueeFadeMode != MARQUEE_FADE_SWITCH_SHOW_ELLIPSIS;
+    private boolean isMarqueeFadeEnabled() {
+        return mEllipsize == TextUtils.TruncateAt.MARQUEE
+                && mMarqueeFadeMode != MARQUEE_FADE_SWITCH_SHOW_ELLIPSIS;
     }
 
     @Override
     protected int computeHorizontalScrollRange() {
         if (mLayout != null) {
-            return mSingleLine && (mGravity & Gravity.HORIZONTAL_GRAVITY_MASK) == Gravity.LEFT ?
-                    (int) mLayout.getLineWidth(0) : mLayout.getWidth();
+            return mSingleLine && (mGravity & Gravity.HORIZONTAL_GRAVITY_MASK) == Gravity.LEFT
+                    ? (int) mLayout.getLineWidth(0) : mLayout.getWidth();
         }
 
         return super.computeHorizontalScrollRange();
@@ -8664,9 +8698,9 @@
 
     @Override
     protected int computeVerticalScrollRange() {
-        if (mLayout != null)
+        if (mLayout != null) {
             return mLayout.getHeight();
-
+        }
         return super.computeVerticalScrollRange();
     }
 
@@ -8747,31 +8781,31 @@
         if (event.hasModifiers(KeyEvent.META_CTRL_ON)) {
             // Handle Ctrl-only shortcuts.
             switch (keyCode) {
-            case KeyEvent.KEYCODE_A:
-                if (canSelectText()) {
-                    return onTextContextMenuItem(ID_SELECT_ALL);
-                }
-                break;
-            case KeyEvent.KEYCODE_Z:
-                if (canUndo()) {
-                    return onTextContextMenuItem(ID_UNDO);
-                }
-                break;
-            case KeyEvent.KEYCODE_X:
-                if (canCut()) {
-                    return onTextContextMenuItem(ID_CUT);
-                }
-                break;
-            case KeyEvent.KEYCODE_C:
-                if (canCopy()) {
-                    return onTextContextMenuItem(ID_COPY);
-                }
-                break;
-            case KeyEvent.KEYCODE_V:
-                if (canPaste()) {
-                    return onTextContextMenuItem(ID_PASTE);
-                }
-                break;
+                case KeyEvent.KEYCODE_A:
+                    if (canSelectText()) {
+                        return onTextContextMenuItem(ID_SELECT_ALL);
+                    }
+                    break;
+                case KeyEvent.KEYCODE_Z:
+                    if (canUndo()) {
+                        return onTextContextMenuItem(ID_UNDO);
+                    }
+                    break;
+                case KeyEvent.KEYCODE_X:
+                    if (canCut()) {
+                        return onTextContextMenuItem(ID_CUT);
+                    }
+                    break;
+                case KeyEvent.KEYCODE_C:
+                    if (canCopy()) {
+                        return onTextContextMenuItem(ID_COPY);
+                    }
+                    break;
+                case KeyEvent.KEYCODE_V:
+                    if (canPaste()) {
+                        return onTextContextMenuItem(ID_PASTE);
+                    }
+                    break;
             }
         } else if (event.hasModifiers(KeyEvent.META_CTRL_ON | KeyEvent.META_SHIFT_ON)) {
             // Handle Ctrl-Shift shortcuts.
@@ -8811,8 +8845,8 @@
         // If you change this condition, make sure prepareCursorController is called anywhere
         // the value of this condition might be changed.
         if (mMovement == null || !mMovement.canSelectArbitrarily()) return false;
-        return isTextEditable() ||
-                (isTextSelectable() && mText instanceof Spannable && isEnabled());
+        return isTextEditable()
+                || (isTextSelectable() && mText instanceof Spannable && isEnabled());
     }
 
     private Locale getTextServicesLocale(boolean allowNullLocale) {
@@ -8966,22 +9000,22 @@
                 if (topWindowLocation >= 0) {
                     // The top of the view is fully within its window; start text at line 0.
                     topLine = getLineAtCoordinateUnclamped(0);
-                    bottomLine = getLineAtCoordinateUnclamped(windowHeight-1);
+                    bottomLine = getLineAtCoordinateUnclamped(windowHeight - 1);
                 } else {
                     // The top of hte window has scrolled off the top of the window; figure out
                     // the starting line for this.
                     topLine = getLineAtCoordinateUnclamped(-topWindowLocation);
-                    bottomLine = getLineAtCoordinateUnclamped(windowHeight-1-topWindowLocation);
+                    bottomLine = getLineAtCoordinateUnclamped(windowHeight - 1 - topWindowLocation);
                 }
                 // We want to return some contextual lines above/below the lines that are
                 // actually visible.
-                int expandedTopLine = topLine - (bottomLine-topLine)/2;
+                int expandedTopLine = topLine - (bottomLine - topLine) / 2;
                 if (expandedTopLine < 0) {
                     expandedTopLine = 0;
                 }
-                int expandedBottomLine = bottomLine + (bottomLine-topLine)/2;
+                int expandedBottomLine = bottomLine + (bottomLine - topLine) / 2;
                 if (expandedBottomLine >= lineCount) {
-                    expandedBottomLine = lineCount-1;
+                    expandedBottomLine = lineCount - 1;
                 }
                 // Convert lines into character offsets.
                 int expandedTopChar = layout.getLineStart(expandedTopLine);
@@ -9003,13 +9037,13 @@
                 if (expandedTopChar > 0 || expandedBottomChar < text.length()) {
                     text = text.subSequence(expandedTopChar, expandedBottomChar);
                 }
-                structure.setText(text, selStart-expandedTopChar, selEnd-expandedTopChar);
-                final int[] lineOffsets = new int[bottomLine-topLine+1];
-                final int[] lineBaselines = new int[bottomLine-topLine+1];
+                structure.setText(text, selStart - expandedTopChar, selEnd - expandedTopChar);
+                final int[] lineOffsets = new int[bottomLine - topLine + 1];
+                final int[] lineBaselines = new int[bottomLine - topLine + 1];
                 final int baselineOffset = getBaselineOffset();
-                for (int i=topLine; i<=bottomLine; i++) {
-                    lineOffsets[i-topLine] = layout.getLineStart(i);
-                    lineBaselines[i-topLine] = layout.getLineBaseline(i) + baselineOffset;
+                for (int i = topLine; i <= bottomLine; i++) {
+                    lineOffsets[i - topLine] = layout.getLineStart(i);
+                    lineBaselines[i - topLine] = layout.getLineBaseline(i) + baselineOffset;
                 }
                 structure.setTextLines(lineOffsets, lineBaselines);
             }
@@ -9465,11 +9499,11 @@
         if ((mEditor.mInputType & InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS) > 0) return false;
 
         final int variation = mEditor.mInputType & EditorInfo.TYPE_MASK_VARIATION;
-        return (variation == EditorInfo.TYPE_TEXT_VARIATION_NORMAL ||
-                variation == EditorInfo.TYPE_TEXT_VARIATION_EMAIL_SUBJECT ||
-                variation == EditorInfo.TYPE_TEXT_VARIATION_LONG_MESSAGE ||
-                variation == EditorInfo.TYPE_TEXT_VARIATION_SHORT_MESSAGE ||
-                variation == EditorInfo.TYPE_TEXT_VARIATION_WEB_EDIT_TEXT);
+        return (variation == EditorInfo.TYPE_TEXT_VARIATION_NORMAL
+                || variation == EditorInfo.TYPE_TEXT_VARIATION_EMAIL_SUBJECT
+                || variation == EditorInfo.TYPE_TEXT_VARIATION_LONG_MESSAGE
+                || variation == EditorInfo.TYPE_TEXT_VARIATION_SHORT_MESSAGE
+                || variation == EditorInfo.TYPE_TEXT_VARIATION_WEB_EDIT_TEXT);
     }
 
     /**
@@ -9571,8 +9605,8 @@
             return false;
         }
 
-        if (mText.length() > 0 && hasSelection() && mText instanceof Editable && mEditor != null &&
-                mEditor.mKeyListener != null) {
+        if (mText.length() > 0 && hasSelection() && mText instanceof Editable && mEditor != null
+                && mEditor.mKeyListener != null) {
             return true;
         }
 
@@ -9609,12 +9643,12 @@
     }
 
     boolean canPaste() {
-        return (mText instanceof Editable &&
-                mEditor != null && mEditor.mKeyListener != null &&
-                getSelectionStart() >= 0 &&
-                getSelectionEnd() >= 0 &&
-                ((ClipboardManager)getContext().getSystemService(Context.CLIPBOARD_SERVICE)).
-                hasPrimaryClip());
+        return (mText instanceof Editable
+                && mEditor != null && mEditor.mKeyListener != null
+                && getSelectionStart() >= 0
+                && getSelectionEnd() >= 0
+                && ((ClipboardManager) getContext().getSystemService(Context.CLIPBOARD_SERVICE))
+                        .hasPrimaryClip());
     }
 
     boolean canProcessText() {
@@ -9644,11 +9678,11 @@
      */
     private void paste(int min, int max, boolean withFormatting) {
         ClipboardManager clipboard =
-            (ClipboardManager) getContext().getSystemService(Context.CLIPBOARD_SERVICE);
+                (ClipboardManager) getContext().getSystemService(Context.CLIPBOARD_SERVICE);
         ClipData clip = clipboard.getPrimaryClip();
         if (clip != null) {
             boolean didFirst = false;
-            for (int i=0; i<clip.getItemCount(); i++) {
+            for (int i = 0; i < clip.getItemCount(); i++) {
                 final CharSequence paste;
                 if (withFormatting) {
                     paste = clip.getItemAt(i).coerceToStyledText(getContext());
@@ -9685,8 +9719,8 @@
     }
 
     private void setPrimaryClip(ClipData clip) {
-        ClipboardManager clipboard = (ClipboardManager) getContext().
-                getSystemService(Context.CLIPBOARD_SERVICE);
+        ClipboardManager clipboard =
+                (ClipboardManager) getContext().getSystemService(Context.CLIPBOARD_SERVICE);
         clipboard.setPrimaryClip(clip);
         sLastCutCopyOrTextChangedTime = SystemClock.uptimeMillis();
     }
@@ -9748,7 +9782,7 @@
 
             case DragEvent.ACTION_DRAG_LOCATION:
                 final int offset = getOffsetForPosition(event.getX(), event.getY());
-                Selection.setSelection((Spannable)mText, offset);
+                Selection.setSelection((Spannable) mText, offset);
                 return true;
 
             case DragEvent.ACTION_DROP:
@@ -9948,7 +9982,7 @@
                 Spannable text = (Spannable) getIterableTextForAccessibility();
                 if (!TextUtils.isEmpty(text) && getLayout() != null) {
                     AccessibilityIterators.LineTextSegmentIterator iterator =
-                        AccessibilityIterators.LineTextSegmentIterator.getInstance();
+                            AccessibilityIterators.LineTextSegmentIterator.getInstance();
                     iterator.initialize(text, getLayout());
                     return iterator;
                 }
@@ -9957,7 +9991,7 @@
                 Spannable text = (Spannable) getIterableTextForAccessibility();
                 if (!TextUtils.isEmpty(text) && getLayout() != null) {
                     AccessibilityIterators.PageTextSegmentIterator iterator =
-                        AccessibilityIterators.PageTextSegmentIterator.getInstance();
+                            AccessibilityIterators.PageTextSegmentIterator.getInstance();
                     iterator.initialize(this);
                     return iterator;
                 }
@@ -10081,16 +10115,16 @@
         }
 
         @SuppressWarnings("hiding")
-        public static final Parcelable.Creator<SavedState> CREATOR
-                = new Parcelable.Creator<SavedState>() {
-            public SavedState createFromParcel(Parcel in) {
-                return new SavedState(in);
-            }
+        public static final Parcelable.Creator<SavedState> CREATOR =
+                new Parcelable.Creator<SavedState>() {
+                    public SavedState createFromParcel(Parcel in) {
+                        return new SavedState(in);
+                    }
 
-            public SavedState[] newArray(int size) {
-                return new SavedState[size];
-            }
-        };
+                    public SavedState[] newArray(int size) {
+                        return new SavedState[size];
+                    }
+                };
 
         private SavedState(Parcel in) {
             super(in);
@@ -10301,8 +10335,8 @@
             if (textView != null && textView.mLayout != null) {
                 mStatus = MARQUEE_STARTING;
                 mScroll = 0.0f;
-                final int textWidth = textView.getWidth() - textView.getCompoundPaddingLeft() -
-                        textView.getCompoundPaddingRight();
+                final int textWidth = textView.getWidth() - textView.getCompoundPaddingLeft()
+                        - textView.getCompoundPaddingRight();
                 final float lineWidth = textView.mLayout.getLineWidth(0);
                 final float gap = textWidth / 3.0f;
                 mGhostStart = lineWidth - textWidth + gap;
@@ -10351,8 +10385,10 @@
 
         public void beforeTextChanged(CharSequence buffer, int start,
                                       int before, int after) {
-            if (DEBUG_EXTRACT) Log.v(LOG_TAG, "beforeTextChanged start=" + start
-                    + " before=" + before + " after=" + after + ": " + buffer);
+            if (DEBUG_EXTRACT) {
+                Log.v(LOG_TAG, "beforeTextChanged start=" + start
+                        + " before=" + before + " after=" + after + ": " + buffer);
+            }
 
             if (AccessibilityManager.getInstance(mContext).isEnabled()
                     && ((!isPasswordInputType(getInputType()) && !hasPasswordTransformationMethod())
@@ -10364,19 +10400,23 @@
         }
 
         public void onTextChanged(CharSequence buffer, int start, int before, int after) {
-            if (DEBUG_EXTRACT) Log.v(LOG_TAG, "onTextChanged start=" + start
-                    + " before=" + before + " after=" + after + ": " + buffer);
+            if (DEBUG_EXTRACT) {
+                Log.v(LOG_TAG, "onTextChanged start=" + start
+                        + " before=" + before + " after=" + after + ": " + buffer);
+            }
             TextView.this.handleTextChanged(buffer, start, before, after);
 
-            if (AccessibilityManager.getInstance(mContext).isEnabled() &&
-                    (isFocused() || isSelected() && isShown())) {
+            if (AccessibilityManager.getInstance(mContext).isEnabled()
+                    && (isFocused() || isSelected() && isShown())) {
                 sendAccessibilityEventTypeViewTextChanged(mBeforeText, start, before, after);
                 mBeforeText = null;
             }
         }
 
         public void afterTextChanged(Editable buffer) {
-            if (DEBUG_EXTRACT) Log.v(LOG_TAG, "afterTextChanged: " + buffer);
+            if (DEBUG_EXTRACT) {
+                Log.v(LOG_TAG, "afterTextChanged: " + buffer);
+            }
             TextView.this.sendAfterTextChanged(buffer);
 
             if (MetaKeyKeyListener.getMetaState(buffer, MetaKeyKeyListener.META_SELECTING) != 0) {
@@ -10385,20 +10425,24 @@
         }
 
         public void onSpanChanged(Spannable buf, Object what, int s, int e, int st, int en) {
-            if (DEBUG_EXTRACT) Log.v(LOG_TAG, "onSpanChanged s=" + s + " e=" + e
-                    + " st=" + st + " en=" + en + " what=" + what + ": " + buf);
+            if (DEBUG_EXTRACT) {
+                Log.v(LOG_TAG, "onSpanChanged s=" + s + " e=" + e
+                        + " st=" + st + " en=" + en + " what=" + what + ": " + buf);
+            }
             TextView.this.spanChange(buf, what, s, st, e, en);
         }
 
         public void onSpanAdded(Spannable buf, Object what, int s, int e) {
-            if (DEBUG_EXTRACT) Log.v(LOG_TAG, "onSpanAdded s=" + s + " e=" + e
-                    + " what=" + what + ": " + buf);
+            if (DEBUG_EXTRACT) {
+                Log.v(LOG_TAG, "onSpanAdded s=" + s + " e=" + e + " what=" + what + ": " + buf);
+            }
             TextView.this.spanChange(buf, what, -1, s, -1, e);
         }
 
         public void onSpanRemoved(Spannable buf, Object what, int s, int e) {
-            if (DEBUG_EXTRACT) Log.v(LOG_TAG, "onSpanRemoved s=" + s + " e=" + e
-                    + " what=" + what + ": " + buf);
+            if (DEBUG_EXTRACT) {
+                Log.v(LOG_TAG, "onSpanRemoved s=" + s + " e=" + e + " what=" + what + ": " + buf);
+            }
             TextView.this.spanChange(buf, what, s, -1, e, -1);
         }
     }
diff --git a/core/java/android/widget/Toast.java b/core/java/android/widget/Toast.java
index 7762675..e147ed6 100644
--- a/core/java/android/widget/Toast.java
+++ b/core/java/android/widget/Toast.java
@@ -357,8 +357,8 @@
 
         WindowManager mWM;
 
-        static final long SHORT_DURATION_TIMEOUT = 5000;
-        static final long LONG_DURATION_TIMEOUT = 1000;
+        static final long SHORT_DURATION_TIMEOUT = 4000;
+        static final long LONG_DURATION_TIMEOUT = 7000;
 
         TN() {
             // XXX This should be changed to use a Dialog, with a Theme.Toast
diff --git a/core/java/com/android/internal/app/AlertController.java b/core/java/com/android/internal/app/AlertController.java
index 2b25b3f..5aeb7f9 100644
--- a/core/java/com/android/internal/app/AlertController.java
+++ b/core/java/com/android/internal/app/AlertController.java
@@ -178,11 +178,6 @@
         return outValue.data != 0;
     }
 
-    private static boolean isWatch(Context context) {
-        return (context.getResources().getConfiguration().uiMode & Configuration.UI_MODE_TYPE_WATCH)
-                == Configuration.UI_MODE_TYPE_WATCH;
-    }
-
     public static final AlertController create(Context context, DialogInterface di, Window window) {
         final TypedArray a = context.obtainStyledAttributes(
                 null, R.styleable.AlertDialog, R.attr.alertDialogStyle, 0);
@@ -892,14 +887,8 @@
             listView.setAdapter(mAdapter);
             final int checkedItem = mCheckedItem;
             if (checkedItem > -1) {
-                // TODO: Remove temp watch specific code
-                if (isWatch(mContext)) {
-                    listView.setItemChecked(checkedItem + listView.getHeaderViewsCount(), true);
-                    listView.setSelection(checkedItem + listView.getHeaderViewsCount());
-                } else {
-                    listView.setItemChecked(checkedItem, true);
-                    listView.setSelection(checkedItem);
-                }
+                listView.setItemChecked(checkedItem, true);
+                listView.setSelection(checkedItem);
             }
         }
     }
@@ -1078,13 +1067,7 @@
                             if (mCheckedItems != null) {
                                 boolean isItemChecked = mCheckedItems[position];
                                 if (isItemChecked) {
-                                    // TODO: Remove temp watch specific code
-                                    if (isWatch(mContext)) {
-                                        listView.setItemChecked(
-                                                position + listView.getHeaderViewsCount(), true);
-                                    } else {
-                                        listView.setItemChecked(position, true);
-                                    }
+                                    listView.setItemChecked(position, true);
                                 }
                             }
                             return view;
@@ -1105,16 +1088,9 @@
                         public void bindView(View view, Context context, Cursor cursor) {
                             CheckedTextView text = (CheckedTextView) view.findViewById(R.id.text1);
                             text.setText(cursor.getString(mLabelIndex));
-                            // TODO: Remove temp watch specific code
-                            if (isWatch(mContext)) {
-                                listView.setItemChecked(
-                                        cursor.getPosition() + listView.getHeaderViewsCount(),
-                                        cursor.getInt(mIsCheckedIndex) == 1);
-                            } else {
-                                listView.setItemChecked(
-                                        cursor.getPosition(),
-                                        cursor.getInt(mIsCheckedIndex) == 1);
-                            }
+                            listView.setItemChecked(
+                                    cursor.getPosition(),
+                                    cursor.getInt(mIsCheckedIndex) == 1);
                         }
 
                         @Override
@@ -1157,10 +1133,6 @@
                 listView.setOnItemClickListener(new OnItemClickListener() {
                     @Override
                     public void onItemClick(AdapterView<?> parent, View v, int position, long id) {
-                        // TODO: Remove temp watch specific code
-                        if (isWatch(mContext)) {
-                            position -= listView.getHeaderViewsCount();
-                        }
                         mOnClickListener.onClick(dialog.mDialogInterface, position);
                         if (!mIsSingleChoice) {
                             dialog.mDialogInterface.dismiss();
@@ -1171,10 +1143,6 @@
                 listView.setOnItemClickListener(new OnItemClickListener() {
                     @Override
                     public void onItemClick(AdapterView<?> parent, View v, int position, long id) {
-                        // TODO: Remove temp watch specific code
-                        if (isWatch(mContext)) {
-                            position -= listView.getHeaderViewsCount();
-                        }
                         if (mCheckedItems != null) {
                             mCheckedItems[position] = listView.isItemChecked(position);
                         }
diff --git a/core/java/com/android/internal/app/MicroAlertController.java b/core/java/com/android/internal/app/MicroAlertController.java
index 00fcd6f..4431f3c 100644
--- a/core/java/com/android/internal/app/MicroAlertController.java
+++ b/core/java/com/android/internal/app/MicroAlertController.java
@@ -18,12 +18,15 @@
 
 import android.content.Context;
 import android.content.DialogInterface;
+import android.text.TextUtils;
+import android.view.Gravity;
 import android.view.View;
 import android.view.ViewGroup;
 import android.view.Window;
+import android.widget.FrameLayout;
+import android.widget.ImageView;
 import android.widget.ScrollView;
 import android.widget.TextView;
-import android.widget.AbsListView;
 
 import com.android.internal.app.AlertController;
 import com.android.internal.R;
@@ -52,30 +55,38 @@
             contentPanel.removeView(mMessageView);
 
             if (mListView != null) {
-                // has ListView, swap ScrollView with ListView
+                // has ListView, swap scrollView with ListView
 
-                // move topPanel into header of ListView
+                // move topPanel into top of scrollParent
                 View topPanel = mScrollView.findViewById(R.id.topPanel);
                 ((ViewGroup) topPanel.getParent()).removeView(topPanel);
-                topPanel.setLayoutParams(
-                        new AbsListView.LayoutParams(topPanel.getLayoutParams()));
-                mListView.addHeaderView(topPanel, null, false);
+                FrameLayout.LayoutParams topParams =
+                        new FrameLayout.LayoutParams(topPanel.getLayoutParams());
+                topParams.gravity = Gravity.TOP;
+                topPanel.setLayoutParams(topParams);
 
-                // move buttonPanel into footer of ListView
+                // move buttonPanel into bottom of scrollParent
                 View buttonPanel = mScrollView.findViewById(R.id.buttonPanel);
                 ((ViewGroup) buttonPanel.getParent()).removeView(buttonPanel);
-                buttonPanel.setLayoutParams(
-                        new AbsListView.LayoutParams(buttonPanel.getLayoutParams()));
-                mListView.addFooterView(buttonPanel, null, false);
+                FrameLayout.LayoutParams buttonParams =
+                        new FrameLayout.LayoutParams(buttonPanel.getLayoutParams());
+                buttonParams.gravity = Gravity.BOTTOM;
+                buttonPanel.setLayoutParams(buttonParams);
 
-                // swap ScrollView w/ ListView
+                // remove scrollview
                 final ViewGroup scrollParent = (ViewGroup) mScrollView.getParent();
                 final int childIndex = scrollParent.indexOfChild(mScrollView);
                 scrollParent.removeViewAt(childIndex);
-                scrollParent.addView(mListView, childIndex,
+
+                // add list view
+                scrollParent.addView(mListView,
                         new ViewGroup.LayoutParams(
                                 ViewGroup.LayoutParams.MATCH_PARENT,
                                 ViewGroup.LayoutParams.MATCH_PARENT));
+
+                // add top and button panel
+                scrollParent.addView(topPanel);
+                scrollParent.addView(buttonPanel);
             } else {
                 // no content, just hide everything
                 contentPanel.setVisibility(View.GONE);
diff --git a/core/java/com/android/internal/util/NotificationColorUtil.java b/core/java/com/android/internal/util/NotificationColorUtil.java
index 77452ca..4748e6f 100644
--- a/core/java/com/android/internal/util/NotificationColorUtil.java
+++ b/core/java/com/android/internal/util/NotificationColorUtil.java
@@ -271,7 +271,7 @@
      * Finds a text color with sufficient contrast over bg that has the same hue as the original
      * color, assuming it is for large text.
      */
-    private static int ensureLargeTextContrast(int color, int bg) {
+    public static int ensureLargeTextContrast(int color, int bg) {
         return findContrastColor(color, bg, true, 3);
     }
 
diff --git a/core/java/com/android/internal/view/IDragAndDropPermissions.aidl b/core/java/com/android/internal/view/IDragAndDropPermissions.aidl
index 64c2d04..edb759a 100644
--- a/core/java/com/android/internal/view/IDragAndDropPermissions.aidl
+++ b/core/java/com/android/internal/view/IDragAndDropPermissions.aidl
@@ -24,6 +24,6 @@
  */
 interface IDragAndDropPermissions {
     void take(IBinder activityToken);
-    void takeTransient(IBinder permissionOwnerToken);
+    void takeTransient(IBinder transientToken);
     void release();
 }
diff --git a/core/java/com/android/internal/widget/WatchHeaderListView.java b/core/java/com/android/internal/widget/WatchHeaderListView.java
new file mode 100644
index 0000000..3d32d86
--- /dev/null
+++ b/core/java/com/android/internal/widget/WatchHeaderListView.java
@@ -0,0 +1,215 @@
+/*
+ * Copyright (C) 2016 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.android.internal.widget;
+
+import android.annotation.IdRes;
+import android.content.Context;
+import android.util.AttributeSet;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.AdapterView;
+import android.widget.ListAdapter;
+import android.widget.ListView;
+import android.widget.HeaderViewListAdapter;
+
+import java.util.ArrayList;
+
+import com.android.internal.util.Predicate;
+
+public class WatchHeaderListView extends ListView {
+    private View mTopPanel;
+
+    public WatchHeaderListView(Context context, AttributeSet attrs) {
+        super(context, attrs);
+    }
+
+    public WatchHeaderListView(Context context, AttributeSet attrs, int defStyleAttr) {
+        super(context, attrs, defStyleAttr);
+    }
+
+    public WatchHeaderListView(
+            Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
+        super(context, attrs, defStyleAttr, defStyleRes);
+    }
+
+    @Override
+    protected HeaderViewListAdapter wrapHeaderListAdapterInternal(
+            ArrayList<ListView.FixedViewInfo> headerViewInfos,
+            ArrayList<ListView.FixedViewInfo> footerViewInfos,
+            ListAdapter adapter) {
+        return new WatchHeaderListAdapter(headerViewInfos, footerViewInfos, adapter);
+    }
+
+    @Override
+    public void addView(View child, ViewGroup.LayoutParams params) {
+        if (mTopPanel == null) {
+            setTopPanel(child);
+        } else {
+            throw new IllegalStateException("WatchHeaderListView can host only one header");
+        }
+    }
+
+    public void setTopPanel(View v) {
+        mTopPanel = v;
+        wrapAdapterIfNecessary();
+    }
+
+    @Override
+    public void setAdapter(ListAdapter adapter) {
+        super.setAdapter(adapter);
+        wrapAdapterIfNecessary();
+    }
+
+    @Override
+    protected View findViewTraversal(@IdRes int id) {
+        View v = super.findViewTraversal(id);
+        if (v == null && mTopPanel != null && !mTopPanel.isRootNamespace()) {
+            return mTopPanel.findViewById(id);
+        }
+        return v;
+    }
+
+    @Override
+    protected View findViewWithTagTraversal(Object tag) {
+        View v = super.findViewWithTagTraversal(tag);
+        if (v == null && mTopPanel != null && !mTopPanel.isRootNamespace()) {
+            return mTopPanel.findViewWithTag(tag);
+        }
+        return v;
+    }
+
+    @Override
+    protected View findViewByPredicateTraversal(Predicate<View> predicate, View childToSkip) {
+        View v = super.findViewByPredicateTraversal(predicate, childToSkip);
+        if (v == null && mTopPanel != null && mTopPanel != childToSkip
+                && !mTopPanel.isRootNamespace()) {
+            return mTopPanel.findViewByPredicate(predicate);
+        }
+        return v;
+    }
+
+    @Override
+    public int getHeaderViewsCount() {
+        return mTopPanel == null ? super.getHeaderViewsCount() : super.getHeaderViewsCount() + 1;
+    }
+
+    private void wrapAdapterIfNecessary() {
+        ListAdapter adapter = getAdapter();
+        if (adapter != null && mTopPanel != null) {
+            if (!(adapter instanceof WatchHeaderListAdapter)) {
+                wrapHeaderListAdapterInternal();
+            }
+
+            ((WatchHeaderListAdapter) getAdapter()).setTopPanel(mTopPanel);
+            dispatchDataSetObserverOnChangedInternal();
+        }
+    }
+
+    private static class WatchHeaderListAdapter extends HeaderViewListAdapter {
+        private View mTopPanel;
+
+        public WatchHeaderListAdapter(
+                ArrayList<ListView.FixedViewInfo> headerViewInfos,
+                ArrayList<ListView.FixedViewInfo> footerViewInfos,
+                ListAdapter adapter) {
+            super(headerViewInfos, footerViewInfos, adapter);
+        }
+
+        public void setTopPanel(View v) {
+            mTopPanel = v;
+        }
+
+        private int getTopPanelCount() {
+            return mTopPanel == null ? 0 : 1;
+        }
+
+        @Override
+        public int getCount() {
+            return super.getCount() + getTopPanelCount();
+        }
+
+        @Override
+        public boolean areAllItemsEnabled() {
+            return mTopPanel == null && super.areAllItemsEnabled();
+        }
+
+        @Override
+        public boolean isEnabled(int position) {
+            if (mTopPanel != null) {
+                if (position == 0) {
+                    return false;
+                } else {
+                    return super.isEnabled(position - 1);
+                }
+            }
+
+            return super.isEnabled(position);
+        }
+
+        @Override
+        public Object getItem(int position) {
+            if (mTopPanel != null) {
+                if (position == 0) {
+                    return null;
+                } else {
+                    return super.getItem(position - 1);
+                }
+            }
+
+            return super.getItem(position);
+        }
+
+        @Override
+        public long getItemId(int position) {
+            int numHeaders = getHeadersCount() + getTopPanelCount();
+            if (getWrappedAdapter() != null && position >= numHeaders) {
+                int adjPosition = position - numHeaders;
+                int adapterCount = getWrappedAdapter().getCount();
+                if (adjPosition < adapterCount) {
+                    return getWrappedAdapter().getItemId(adjPosition);
+                }
+            }
+            return -1;
+        }
+
+        @Override
+        public View getView(int position, View convertView, ViewGroup parent) {
+            if (mTopPanel != null) {
+                if (position == 0) {
+                    return mTopPanel;
+                } else {
+                    return super.getView(position - 1, convertView, parent);
+                }
+            }
+
+            return super.getView(position, convertView, parent);
+        }
+
+        @Override
+        public int getItemViewType(int position) {
+            int numHeaders = getHeadersCount() + getTopPanelCount();
+            if (getWrappedAdapter() != null && position >= numHeaders) {
+                int adjPosition = position - numHeaders;
+                int adapterCount = getWrappedAdapter().getCount();
+                if (adjPosition < adapterCount) {
+                    return getWrappedAdapter().getItemViewType(adjPosition);
+                }
+            }
+
+            return AdapterView.ITEM_VIEW_TYPE_HEADER_OR_FOOTER;
+        }
+    }
+}
diff --git a/core/java/com/android/internal/widget/WatchListDecorLayout.java b/core/java/com/android/internal/widget/WatchListDecorLayout.java
new file mode 100644
index 0000000..538ceca
--- /dev/null
+++ b/core/java/com/android/internal/widget/WatchListDecorLayout.java
@@ -0,0 +1,327 @@
+/*
+ * Copyright (C) 2016 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.android.internal.widget;
+
+import android.content.Context;
+import android.graphics.drawable.Drawable;
+import android.graphics.Rect;
+import android.util.AttributeSet;
+import android.view.Gravity;
+import android.view.View;
+import android.view.ViewTreeObserver;
+import android.widget.ListView;
+import android.widget.FrameLayout;
+
+import java.util.ArrayList;
+
+
+/**
+ * Layout for the decor for ListViews on watch-type devices with small screens.
+ * <p>
+ * Supports one panel with the gravity set to top, and one panel with gravity set to bottom.
+ * <p>
+ * Use with one ListView child. The top and bottom panels will track the ListView's scrolling.
+ * If there is no ListView child, it will act like a normal FrameLayout.
+ */
+public class WatchListDecorLayout extends FrameLayout
+        implements ViewTreeObserver.OnScrollChangedListener {
+
+    private int mForegroundPaddingLeft = 0;
+    private int mForegroundPaddingTop = 0;
+    private int mForegroundPaddingRight = 0;
+    private int mForegroundPaddingBottom = 0;
+
+    private final ArrayList<View> mMatchParentChildren = new ArrayList<>(1);
+
+    /** Track the amount the ListView has to scroll up to account for padding change difference. */
+    private int mPendingScroll;
+    private View mBottomPanel;
+    private View mTopPanel;
+    private ListView mListView;
+    private ViewTreeObserver mObserver;
+
+
+    public WatchListDecorLayout(Context context, AttributeSet attrs) {
+        super(context, attrs);
+    }
+
+    public WatchListDecorLayout(Context context, AttributeSet attrs, int defStyleAttr) {
+        super(context, attrs, defStyleAttr);
+    }
+
+    public WatchListDecorLayout(
+            Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
+        super(context, attrs, defStyleAttr, defStyleRes);
+    }
+
+    @Override
+    protected void onAttachedToWindow() {
+        super.onAttachedToWindow();
+
+        mPendingScroll = 0;
+
+        for (int i = 0; i < getChildCount(); ++i) {
+            View child = getChildAt(i);
+            if (child instanceof ListView) {
+                if (mListView != null) {
+                    throw new IllegalArgumentException("only one ListView child allowed");
+                }
+                mListView = (ListView) child;
+
+                mListView.setNestedScrollingEnabled(true);
+                mObserver = mListView.getViewTreeObserver();
+                mObserver.addOnScrollChangedListener(this);
+            } else {
+                int gravity = (((LayoutParams) child.getLayoutParams()).gravity
+                        & Gravity.VERTICAL_GRAVITY_MASK);
+                if (gravity == Gravity.TOP && mTopPanel == null) {
+                    mTopPanel = child;
+                } else if (gravity == Gravity.BOTTOM && mBottomPanel == null) {
+                    mBottomPanel = child;
+                }
+            }
+        }
+    }
+
+    @Override
+    public void onDetachedFromWindow() {
+        mListView = null;
+        mBottomPanel = null;
+        mTopPanel = null;
+        if (mObserver != null) {
+            if (mObserver.isAlive()) {
+                mObserver.removeOnScrollChangedListener(this);
+            }
+            mObserver = null;
+        }
+    }
+
+    private void applyMeasureToChild(View child, int widthMeasureSpec, int heightMeasureSpec) {
+        final MarginLayoutParams lp = (MarginLayoutParams) child.getLayoutParams();
+
+        final int childWidthMeasureSpec;
+        if (lp.width == LayoutParams.MATCH_PARENT) {
+            final int width = Math.max(0, getMeasuredWidth()
+                    - getPaddingLeftWithForeground() - getPaddingRightWithForeground()
+                    - lp.leftMargin - lp.rightMargin);
+            childWidthMeasureSpec = MeasureSpec.makeMeasureSpec(
+                    width, MeasureSpec.EXACTLY);
+        } else {
+            childWidthMeasureSpec = getChildMeasureSpec(widthMeasureSpec,
+                    getPaddingLeftWithForeground() + getPaddingRightWithForeground() +
+                    lp.leftMargin + lp.rightMargin,
+                    lp.width);
+        }
+
+        final int childHeightMeasureSpec;
+        if (lp.height == LayoutParams.MATCH_PARENT) {
+            final int height = Math.max(0, getMeasuredHeight()
+                    - getPaddingTopWithForeground() - getPaddingBottomWithForeground()
+                    - lp.topMargin - lp.bottomMargin);
+            childHeightMeasureSpec = MeasureSpec.makeMeasureSpec(
+                    height, MeasureSpec.EXACTLY);
+        } else {
+            childHeightMeasureSpec = getChildMeasureSpec(heightMeasureSpec,
+                    getPaddingTopWithForeground() + getPaddingBottomWithForeground() +
+                    lp.topMargin + lp.bottomMargin,
+                    lp.height);
+        }
+
+        child.measure(childWidthMeasureSpec, childHeightMeasureSpec);
+    }
+
+    private int measureAndGetHeight(View child, int widthMeasureSpec, int heightMeasureSpec) {
+        if (child != null) {
+            if (child.getVisibility() != GONE) {
+                applyMeasureToChild(mBottomPanel, widthMeasureSpec, heightMeasureSpec);
+                return child.getMeasuredHeight();
+            } else if (getMeasureAllChildren()) {
+                applyMeasureToChild(mBottomPanel, widthMeasureSpec, heightMeasureSpec);
+            }
+        }
+        return 0;
+    }
+
+    @Override
+    protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
+        int count = getChildCount();
+
+        final boolean measureMatchParentChildren =
+                MeasureSpec.getMode(widthMeasureSpec) != MeasureSpec.EXACTLY ||
+                MeasureSpec.getMode(heightMeasureSpec) != MeasureSpec.EXACTLY;
+        mMatchParentChildren.clear();
+
+        int maxHeight = 0;
+        int maxWidth = 0;
+        int childState = 0;
+
+        for (int i = 0; i < count; i++) {
+            final View child = getChildAt(i);
+            if (getMeasureAllChildren() || child.getVisibility() != GONE) {
+                measureChildWithMargins(child, widthMeasureSpec, 0, heightMeasureSpec, 0);
+                final LayoutParams lp = (LayoutParams) child.getLayoutParams();
+                maxWidth = Math.max(maxWidth,
+                        child.getMeasuredWidth() + lp.leftMargin + lp.rightMargin);
+                maxHeight = Math.max(maxHeight,
+                        child.getMeasuredHeight() + lp.topMargin + lp.bottomMargin);
+                childState = combineMeasuredStates(childState, child.getMeasuredState());
+                if (measureMatchParentChildren) {
+                    if (lp.width == LayoutParams.MATCH_PARENT ||
+                            lp.height == LayoutParams.MATCH_PARENT) {
+                        mMatchParentChildren.add(child);
+                    }
+                }
+            }
+        }
+
+        // Account for padding too
+        maxWidth += getPaddingLeftWithForeground() + getPaddingRightWithForeground();
+        maxHeight += getPaddingTopWithForeground() + getPaddingBottomWithForeground();
+
+        // Check against our minimum height and width
+        maxHeight = Math.max(maxHeight, getSuggestedMinimumHeight());
+        maxWidth = Math.max(maxWidth, getSuggestedMinimumWidth());
+
+        // Check against our foreground's minimum height and width
+        final Drawable drawable = getForeground();
+        if (drawable != null) {
+            maxHeight = Math.max(maxHeight, drawable.getMinimumHeight());
+            maxWidth = Math.max(maxWidth, drawable.getMinimumWidth());
+        }
+
+        setMeasuredDimension(resolveSizeAndState(maxWidth, widthMeasureSpec, childState),
+                resolveSizeAndState(maxHeight, heightMeasureSpec,
+                        childState << MEASURED_HEIGHT_STATE_SHIFT));
+
+        if (mListView != null) {
+            if (mPendingScroll != 0) {
+                mListView.scrollListBy(mPendingScroll);
+                mPendingScroll = 0;
+            }
+
+            int paddingTop = Math.max(mListView.getPaddingTop(),
+                    measureAndGetHeight(mTopPanel, widthMeasureSpec, heightMeasureSpec));
+            int paddingBottom = Math.max(mListView.getPaddingBottom(),
+                    measureAndGetHeight(mBottomPanel, widthMeasureSpec, heightMeasureSpec));
+
+            if (paddingTop != mListView.getPaddingTop()
+                    || paddingBottom != mListView.getPaddingBottom()) {
+                mPendingScroll += mListView.getPaddingTop() - paddingTop;
+                mListView.setPadding(
+                        mListView.getPaddingLeft(), paddingTop,
+                        mListView.getPaddingRight(), paddingBottom);
+            }
+        }
+
+        count = mMatchParentChildren.size();
+        if (count > 1) {
+            for (int i = 0; i < count; i++) {
+                final View child = mMatchParentChildren.get(i);
+                if (mListView == null || (child != mTopPanel && child != mBottomPanel)) {
+                    applyMeasureToChild(child, widthMeasureSpec, heightMeasureSpec);
+                }
+            }
+        }
+    }
+
+    @Override
+    public void setForegroundGravity(int foregroundGravity) {
+        if (getForegroundGravity() != foregroundGravity) {
+            super.setForegroundGravity(foregroundGravity);
+
+            // calling get* again here because the set above may apply default constraints
+            final Drawable foreground = getForeground();
+            if (getForegroundGravity() == Gravity.FILL && foreground != null) {
+                Rect padding = new Rect();
+                if (foreground.getPadding(padding)) {
+                    mForegroundPaddingLeft = padding.left;
+                    mForegroundPaddingTop = padding.top;
+                    mForegroundPaddingRight = padding.right;
+                    mForegroundPaddingBottom = padding.bottom;
+                }
+            } else {
+                mForegroundPaddingLeft = 0;
+                mForegroundPaddingTop = 0;
+                mForegroundPaddingRight = 0;
+                mForegroundPaddingBottom = 0;
+            }
+        }
+    }
+
+    private int getPaddingLeftWithForeground() {
+        return isForegroundInsidePadding() ? Math.max(mPaddingLeft, mForegroundPaddingLeft) :
+            mPaddingLeft + mForegroundPaddingLeft;
+    }
+
+    private int getPaddingRightWithForeground() {
+        return isForegroundInsidePadding() ? Math.max(mPaddingRight, mForegroundPaddingRight) :
+            mPaddingRight + mForegroundPaddingRight;
+    }
+
+    private int getPaddingTopWithForeground() {
+        return isForegroundInsidePadding() ? Math.max(mPaddingTop, mForegroundPaddingTop) :
+            mPaddingTop + mForegroundPaddingTop;
+    }
+
+    private int getPaddingBottomWithForeground() {
+        return isForegroundInsidePadding() ? Math.max(mPaddingBottom, mForegroundPaddingBottom) :
+            mPaddingBottom + mForegroundPaddingBottom;
+    }
+
+    @Override
+    public void onScrollChanged() {
+        if (mListView == null) {
+            return;
+        }
+
+        if (mTopPanel != null) {
+            if (mListView.getChildCount() > 0) {
+                if (mListView.getFirstVisiblePosition() == 0) {
+                    View firstChild = mListView.getChildAt(0);
+                    setScrolling(mTopPanel,
+                            firstChild.getY() - mTopPanel.getHeight() - mTopPanel.getTop());
+                } else {
+                    // shift to hide the frame, last child is not the last position
+                    setScrolling(mTopPanel, -mTopPanel.getHeight());
+                }
+            } else {
+                setScrolling(mTopPanel, 0); // no visible child, fallback to default behaviour
+            }
+        }
+
+        if (mBottomPanel != null) {
+            if (mListView.getChildCount() > 0) {
+                if (mListView.getLastVisiblePosition() >= mListView.getCount() - 1) {
+                    View lastChild = mListView.getChildAt(mListView.getChildCount() - 1);
+                    setScrolling(mBottomPanel,
+                            lastChild.getY() + lastChild.getHeight() - mBottomPanel.getTop());
+                } else {
+                    // shift to hide the frame, last child is not the last position
+                    setScrolling(mBottomPanel, mBottomPanel.getHeight());
+                }
+            } else {
+                setScrolling(mBottomPanel, 0); // no visible child, fallback to default behaviour
+            }
+        }
+    }
+
+    /** Only set scrolling for the panel if there is a change in its translationY. */
+    private void setScrolling(View panel, float translationY) {
+        if (panel.getTranslationY() != translationY) {
+            panel.setTranslationY(translationY);
+        }
+    }
+}
diff --git a/core/jni/android_graphics_Canvas.cpp b/core/jni/android_graphics_Canvas.cpp
index 03a50dd..d5a7a90 100644
--- a/core/jni/android_graphics_Canvas.cpp
+++ b/core/jni/android_graphics_Canvas.cpp
@@ -614,10 +614,10 @@
     {"native_drawPath","!(JJJ)V", (void*) CanvasJNI::drawPath},
     {"nativeDrawVertices", "!(JII[FI[FI[II[SIIJ)V", (void*)CanvasJNI::drawVertices},
     {"native_drawNinePatch", "!(JJJFFFFJII)V", (void*)CanvasJNI::drawNinePatch},
-    {"native_drawBitmap","!(JLandroid/graphics/Bitmap;FFJIII)V", (void*) CanvasJNI::drawBitmap},
+    {"native_drawBitmap","(JLandroid/graphics/Bitmap;FFJIII)V", (void*) CanvasJNI::drawBitmap},
     {"nativeDrawBitmapMatrix", "!(JLandroid/graphics/Bitmap;JJ)V", (void*)CanvasJNI::drawBitmapMatrix},
-    {"native_drawBitmap","!(JLandroid/graphics/Bitmap;FFFFFFFFJII)V", (void*) CanvasJNI::drawBitmapRect},
-    {"native_drawBitmap", "!(J[IIIFFIIZJ)V", (void*)CanvasJNI::drawBitmapArray},
+    {"native_drawBitmap","(JLandroid/graphics/Bitmap;FFFFFFFFJII)V", (void*) CanvasJNI::drawBitmapRect},
+    {"native_drawBitmap", "(J[IIIFFIIZJ)V", (void*)CanvasJNI::drawBitmapArray},
     {"nativeDrawBitmapMesh", "!(JLandroid/graphics/Bitmap;II[FI[IIJ)V", (void*)CanvasJNI::drawBitmapMesh},
     {"native_drawText","!(J[CIIFFIJJ)V", (void*) CanvasJNI::drawTextChars},
     {"native_drawText","!(JLjava/lang/String;IIFFIJJ)V", (void*) CanvasJNI::drawTextString},
diff --git a/core/res/AndroidManifest.xml b/core/res/AndroidManifest.xml
index ad36434..3ceba08 100644
--- a/core/res/AndroidManifest.xml
+++ b/core/res/AndroidManifest.xml
@@ -408,7 +408,7 @@
     <protected-broadcast android:name="android.security.STORAGE_CHANGED" />
     <protected-broadcast android:name="android.security.action.TRUST_STORE_CHANGED" />
     <protected-broadcast android:name="android.security.action.KEYCHAIN_CHANGED" />
-    <protected-broadcast android:name="android.security.action.KEY_PERMISSION_CHANGED" />
+    <protected-broadcast android:name="android.security.action.KEY_ACCESS_CHANGED" />
     <protected-broadcast android:name="android.telecom.action.PHONE_ACCOUNT_REGISTERED" />
     <protected-broadcast android:name="android.telecom.action.PHONE_ACCOUNT_UNREGISTERED" />
     <protected-broadcast android:name="android.telecom.action.SHOW_MISSED_CALLS_NOTIFICATION" />
@@ -1266,6 +1266,11 @@
     <permission android:name="android.permission.CONNECTIVITY_INTERNAL"
         android:protectionLevel="signature|privileged" />
 
+    <!-- Allows an internal user to use restricted Networks.
+         @hide -->
+    <permission android:name="android.permission.CONNECTIVITY_USE_RESTRICTED_NETWORKS"
+        android:protectionLevel="signature|privileged" />
+
     <!-- Allows a system application to access hardware packet offload capabilities.
          @hide -->
     <permission android:name="android.permission.PACKET_KEEPALIVE_OFFLOAD"
diff --git a/core/res/res/anim/watch_switch_thumb_to_off_animation.xml b/core/res/res/anim/watch_switch_thumb_to_off_animation.xml
new file mode 100644
index 0000000..cd02e0d
--- /dev/null
+++ b/core/res/res/anim/watch_switch_thumb_to_off_animation.xml
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="utf-8"?><!-- Copyright (C) 2016 The Android Open Source Project
+     Licensed under the Apache License, Version 2.0 (the "License");
+     you may not use this file except in compliance with the License.
+     You may obtain a copy of the License at
+          http://www.apache.org/licenses/LICENSE-2.0
+     Unless required by applicable law or agreed to in writing, software
+     distributed under the License is distributed on an "AS IS" BASIS,
+     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     See the License for the specific language governing permissions and
+     limitations under the License.
+-->
+
+<set xmlns:android="http://schemas.android.com/apk/res/android"
+    android:ordering="sequentially">
+    <objectAnimator
+        android:duration="33"
+        android:interpolator="@android:interpolator/linear"
+        android:propertyName="pathData"
+        android:valueFrom="M 0.0,-7.0 l 0.0,0.0 c 3.8659932486,0.0 7.0,3.1340067514 7.0,7.0 l 0.0,0.0 c 0.0,3.8659932486 -3.1340067514,7.0 -7.0,7.0 l 0.0,0.0 c -3.8659932486,0.0 -7.0,-3.1340067514 -7.0,-7.0 l 0.0,0.0 c 0.0,-3.8659932486 3.1340067514,-7.0 7.0,-7.0 Z"
+        android:valueTo="M -3.0,-7.0 l 6.0,0.0 c 3.8659932486,0.0 7.0,3.1340067514 7.0,7.0 l 0.0,0.0 c 0.0,3.8659932486 -3.1340067514,7.0 -7.0,7.0 l -6.0,0.0 c -3.8659932486,0.0 -7.0,-3.1340067514 -7.0,-7.0 l 0.0,0.0 c 0.0,-3.8659932486 3.1340067514,-7.0 7.0,-7.0 Z"
+        android:valueType="pathType" />
+    <objectAnimator
+        android:duration="66"
+        android:interpolator="@android:interpolator/linear"
+        android:propertyName="pathData"
+        android:valueFrom="M -3.0,-7.0 l 6.0,0.0 c 3.8659932486,0.0 7.0,3.1340067514 7.0,7.0 l 0.0,0.0 c 0.0,3.8659932486 -3.1340067514,7.0 -7.0,7.0 l -6.0,0.0 c -3.8659932486,0.0 -7.0,-3.1340067514 -7.0,-7.0 l 0.0,0.0 c 0.0,-3.8659932486 3.1340067514,-7.0 7.0,-7.0 Z"
+        android:valueTo="M -3.0,-7.0 l 6.0,0.0 c 3.8659932486,0.0 7.0,3.1340067514 7.0,7.0 l 0.0,0.0 c 0.0,3.8659932486 -3.1340067514,7.0 -7.0,7.0 l -6.0,0.0 c -3.8659932486,0.0 -7.0,-3.1340067514 -7.0,-7.0 l 0.0,0.0 c 0.0,-3.8659932486 3.1340067514,-7.0 7.0,-7.0 Z"
+        android:valueType="pathType" />
+    <objectAnimator
+        android:duration="66"
+        android:interpolator="@android:interpolator/linear"
+        android:propertyName="pathData"
+        android:valueFrom="M -3.0,-7.0 l 6.0,0.0 c 3.8659932486,0.0 7.0,3.1340067514 7.0,7.0 l 0.0,0.0 c 0.0,3.8659932486 -3.1340067514,7.0 -7.0,7.0 l -6.0,0.0 c -3.8659932486,0.0 -7.0,-3.1340067514 -7.0,-7.0 l 0.0,0.0 c 0.0,-3.8659932486 3.1340067514,-7.0 7.0,-7.0 Z"
+        android:valueTo="M 0.0,-7.0 l 0.0,0.0 c 3.8659932486,0.0 7.0,3.1340067514 7.0,7.0 l 0.0,0.0 c 0.0,3.8659932486 -3.1340067514,7.0 -7.0,7.0 l 0.0,0.0 c -3.8659932486,0.0 -7.0,-3.1340067514 -7.0,-7.0 l 0.0,0.0 c 0.0,-3.8659932486 3.1340067514,-7.0 7.0,-7.0 Z"
+        android:valueType="pathType" />
+</set>
diff --git a/core/res/res/anim/watch_switch_thumb_to_on_animation.xml b/core/res/res/anim/watch_switch_thumb_to_on_animation.xml
new file mode 100644
index 0000000..e644217
--- /dev/null
+++ b/core/res/res/anim/watch_switch_thumb_to_on_animation.xml
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2016 The Android Open Source Project
+     Licensed under the Apache License, Version 2.0 (the "License");
+     you may not use this file except in compliance with the License.
+     You may obtain a copy of the License at
+          http://www.apache.org/licenses/LICENSE-2.0
+     Unless required by applicable law or agreed to in writing, software
+     distributed under the License is distributed on an "AS IS" BASIS,
+     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     See the License for the specific language governing permissions and
+     limitations under the License.
+-->
+
+<set xmlns:android="http://schemas.android.com/apk/res/android"
+    android:ordering="sequentially">
+    <objectAnimator
+        android:duration="33"
+        android:interpolator="@android:interpolator/linear"
+        android:propertyName="pathData"
+        android:valueFrom="M 0.0,-7.0 l 0.0,0.0 c 3.8659932486,0.0 7.0,3.1340067514 7.0,7.0 l 0.0,0.0 c 0.0,3.8659932486 -3.1340067514,7.0 -7.0,7.0 l 0.0,0.0 c -3.8659932486,0.0 -7.0,-3.1340067514 -7.0,-7.0 l 0.0,0.0 c 0.0,-3.8659932486 3.1340067514,-7.0 7.0,-7.0 Z"
+        android:valueTo="M -3.0,-7.0 l 6.0,0.0 c 3.8659932486,0.0 7.0,3.1340067514 7.0,7.0 l 0.0,0.0 c 0.0,3.8659932486 -3.1340067514,7.0 -7.0,7.0 l -6.0,0.0 c -3.8659932486,0.0 -7.0,-3.1340067514 -7.0,-7.0 l 0.0,0.0 c 0.0,-3.8659932486 3.1340067514,-7.0 7.0,-7.0 Z"
+        android:valueType="pathType" />
+    <objectAnimator
+        android:duration="66"
+        android:interpolator="@android:interpolator/linear"
+        android:propertyName="pathData"
+        android:valueFrom="M -3.0,-7.0 l 6.0,0.0 c 3.8659932486,0.0 7.0,3.1340067514 7.0,7.0 l 0.0,0.0 c 0.0,3.8659932486 -3.1340067514,7.0 -7.0,7.0 l -6.0,0.0 c -3.8659932486,0.0 -7.0,-3.1340067514 -7.0,-7.0 l 0.0,0.0 c 0.0,-3.8659932486 3.1340067514,-7.0 7.0,-7.0 Z"
+        android:valueTo="M -3.0,-7.0 l 6.0,0.0 c 3.8659932486,0.0 7.0,3.1340067514 7.0,7.0 l 0.0,0.0 c 0.0,3.8659932486 -3.1340067514,7.0 -7.0,7.0 l -6.0,0.0 c -3.8659932486,0.0 -7.0,-3.1340067514 -7.0,-7.0 l 0.0,0.0 c 0.0,-3.8659932486 3.1340067514,-7.0 7.0,-7.0 Z"
+        android:valueType="pathType" />
+    <objectAnimator
+        android:duration="66"
+        android:interpolator="@android:interpolator/linear"
+        android:propertyName="pathData"
+        android:valueFrom="M -3.0,-7.0 l 6.0,0.0 c 3.8659932486,0.0 7.0,3.1340067514 7.0,7.0 l 0.0,0.0 c 0.0,3.8659932486 -3.1340067514,7.0 -7.0,7.0 l -6.0,0.0 c -3.8659932486,0.0 -7.0,-3.1340067514 -7.0,-7.0 l 0.0,0.0 c 0.0,-3.8659932486 3.1340067514,-7.0 7.0,-7.0 Z"
+        android:valueTo="M 0.0,-7.0 l 0.0,0.0 c 3.8659932486,0.0 7.0,3.1340067514 7.0,7.0 l 0.0,0.0 c 0.0,3.8659932486 -3.1340067514,7.0 -7.0,7.0 l 0.0,0.0 c -3.8659932486,0.0 -7.0,-3.1340067514 -7.0,-7.0 l 0.0,0.0 c 0.0,-3.8659932486 3.1340067514,-7.0 7.0,-7.0 Z"
+        android:valueType="pathType" />
+</set>
diff --git a/core/res/res/color/watch_switch_thumb_color_material.xml b/core/res/res/color/watch_switch_thumb_color_material.xml
new file mode 100644
index 0000000..a931724
--- /dev/null
+++ b/core/res/res/color/watch_switch_thumb_color_material.xml
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2016 The Android Open Source Project
+     Licensed under the Apache License, Version 2.0 (the "License");
+     you may not use this file except in compliance with the License.
+     You may obtain a copy of the License at
+          http://www.apache.org/licenses/LICENSE-2.0
+     Unless required by applicable law or agreed to in writing, software
+     distributed under the License is distributed on an "AS IS" BASIS,
+     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     See the License for the specific language governing permissions and
+     limitations under the License.
+-->
+
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+    <item android:color="?android:colorAccent" android:state_checked="true" />
+    <item android:color="?android:colorButtonNormal" android:state_checked="false" />
+</selector>
\ No newline at end of file
diff --git a/core/res/res/drawable/notification_material_action_background_emphasized.xml b/core/res/res/drawable/notification_material_action_background_emphasized.xml
deleted file mode 100644
index b7153ba..0000000
--- a/core/res/res/drawable/notification_material_action_background_emphasized.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-  ~ Copyright (C) 2016 The Android Open Source Project
-  ~
-  ~ Licensed under the Apache License, Version 2.0 (the "License");
-  ~ you may not use this file except in compliance with the License.
-  ~ You may obtain a copy of the License at
-  ~
-  ~      http://www.apache.org/licenses/LICENSE-2.0
-  ~
-  ~ Unless required by applicable law or agreed to in writing, software
-  ~ distributed under the License is distributed on an "AS IS" BASIS,
-  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  ~ See the License for the specific language governing permissions and
-  ~ limitations under the License
-  -->
-
-<ripple xmlns:android="http://schemas.android.com/apk/res/android"
-        android:color="@color/ripple_material_dark">
-    <item android:id="@id/mask">
-        <color android:color="@color/white" />
-    </item>
-</ripple>
-
diff --git a/core/res/res/drawable/watch_switch_thumb_material.xml b/core/res/res/drawable/watch_switch_thumb_material.xml
new file mode 100644
index 0000000..3463a4f
--- /dev/null
+++ b/core/res/res/drawable/watch_switch_thumb_material.xml
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2016 The Android Open Source Project
+     Licensed under the Apache License, Version 2.0 (the "License");
+     you may not use this file except in compliance with the License.
+     You may obtain a copy of the License at
+          http://www.apache.org/licenses/LICENSE-2.0
+     Unless required by applicable law or agreed to in writing, software
+     distributed under the License is distributed on an "AS IS" BASIS,
+     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     See the License for the specific language governing permissions and
+     limitations under the License.
+-->
+
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+    android:width="20dp"
+    android:height="40dp"
+    android:viewportHeight="40"
+    android:viewportWidth="20">
+    <group
+        android:translateX="10"
+        android:translateY="20">
+        <path
+            android:name="thumb_path"
+            android:fillColor="@color/white"
+            android:pathData="M 0.0,-7.0 l 0.0,0.0 c 3.8659932486,0.0 7.0,3.1340067514 7.0,7.0 l 0.0,0.0 c 0.0,3.8659932486 -3.1340067514,7.0 -7.0,7.0 l 0.0,0.0 c -3.8659932486,0.0 -7.0,-3.1340067514 -7.0,-7.0 l 0.0,0.0 c 0.0,-3.8659932486 3.1340067514,-7.0 7.0,-7.0 Z" />
+    </group>
+</vector>
diff --git a/core/res/res/drawable/watch_switch_thumb_material_anim.xml b/core/res/res/drawable/watch_switch_thumb_material_anim.xml
new file mode 100644
index 0000000..686fb97
--- /dev/null
+++ b/core/res/res/drawable/watch_switch_thumb_material_anim.xml
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2016 The Android Open Source Project
+     Licensed under the Apache License, Version 2.0 (the "License");
+     you may not use this file except in compliance with the License.
+     You may obtain a copy of the License at
+          http://www.apache.org/licenses/LICENSE-2.0
+     Unless required by applicable law or agreed to in writing, software
+     distributed under the License is distributed on an "AS IS" BASIS,
+     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     See the License for the specific language governing permissions and
+     limitations under the License.
+-->
+
+<animated-selector xmlns:android="http://schemas.android.com/apk/res/android"
+    android:constantSize="true">
+    <item
+        android:id="@+id/off"
+        android:drawable="@drawable/watch_switch_thumb_material"
+        android:state_enabled="false" />
+    <item
+        android:id="@+id/on"
+        android:drawable="@drawable/watch_switch_thumb_material"
+        android:state_checked="true" />
+    <item
+        android:id="@+id/off"
+        android:drawable="@drawable/watch_switch_thumb_material" />
+    <transition
+        android:drawable="@drawable/watch_switch_thumb_to_on_anim_mtrl"
+        android:fromId="@id/off"
+        android:toId="@id/on" />
+    <transition
+        android:drawable="@drawable/watch_switch_thumb_to_off_anim_mtrl"
+        android:fromId="@id/on"
+        android:toId="@id/off" />
+</animated-selector>
diff --git a/core/res/res/drawable/watch_switch_thumb_to_off_anim_mtrl.xml b/core/res/res/drawable/watch_switch_thumb_to_off_anim_mtrl.xml
new file mode 100644
index 0000000..2c6ba2f
--- /dev/null
+++ b/core/res/res/drawable/watch_switch_thumb_to_off_anim_mtrl.xml
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2016 The Android Open Source Project
+     Licensed under the Apache License, Version 2.0 (the "License");
+     you may not use this file except in compliance with the License.
+     You may obtain a copy of the License at
+          http://www.apache.org/licenses/LICENSE-2.0
+     Unless required by applicable law or agreed to in writing, software
+     distributed under the License is distributed on an "AS IS" BASIS,
+     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     See the License for the specific language governing permissions and
+     limitations under the License.
+-->
+
+<animated-vector xmlns:android="http://schemas.android.com/apk/res/android"
+    android:drawable="@drawable/watch_switch_thumb_material">
+    <target
+        android:name="thumb_path"
+        android:animation="@anim/watch_switch_thumb_to_off_animation" />
+</animated-vector>
diff --git a/core/res/res/drawable/watch_switch_thumb_to_on_anim_mtrl.xml b/core/res/res/drawable/watch_switch_thumb_to_on_anim_mtrl.xml
new file mode 100644
index 0000000..9f92361
--- /dev/null
+++ b/core/res/res/drawable/watch_switch_thumb_to_on_anim_mtrl.xml
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2016 The Android Open Source Project
+     Licensed under the Apache License, Version 2.0 (the "License");
+     you may not use this file except in compliance with the License.
+     You may obtain a copy of the License at
+          http://www.apache.org/licenses/LICENSE-2.0
+     Unless required by applicable law or agreed to in writing, software
+     distributed under the License is distributed on an "AS IS" BASIS,
+     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     See the License for the specific language governing permissions and
+     limitations under the License.
+-->
+
+<animated-vector xmlns:android="http://schemas.android.com/apk/res/android"
+    android:drawable="@drawable/watch_switch_thumb_material">
+    <target
+        android:name="thumb_path"
+        android:animation="@anim/watch_switch_thumb_to_on_animation" />
+</animated-vector>
diff --git a/core/res/res/drawable/watch_switch_track_material.xml b/core/res/res/drawable/watch_switch_track_material.xml
new file mode 100644
index 0000000..00cdadb
--- /dev/null
+++ b/core/res/res/drawable/watch_switch_track_material.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2016 The Android Open Source Project
+     Licensed under the Apache License, Version 2.0 (the "License");
+     you may not use this file except in compliance with the License.
+     You may obtain a copy of the License at
+          http://www.apache.org/licenses/LICENSE-2.0
+     Unless required by applicable law or agreed to in writing, software
+     distributed under the License is distributed on an "AS IS" BASIS,
+     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     See the License for the specific language governing permissions and
+     limitations under the License.
+-->
+
+<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
+    <item android:gravity="center_vertical|center_horizontal">
+        <shape android:shape="oval">
+            <solid android:color="@android:color/white" />
+            <size
+                android:width="40dp"
+                android:height="40dp" />
+        </shape>
+    </item>
+</layer-list>
\ No newline at end of file
diff --git a/core/res/res/layout-watch/alert_dialog_material.xml b/core/res/res/layout-watch/alert_dialog_material.xml
index a8bb204..ce8e20a 100644
--- a/core/res/res/layout-watch/alert_dialog_material.xml
+++ b/core/res/res/layout-watch/alert_dialog_material.xml
@@ -14,7 +14,7 @@
   ~ See the License for the specific language governing permissions and
   ~ limitations under the License
   -->
-<FrameLayout
+<com.android.internal.widget.WatchListDecorLayout
         xmlns:android="http://schemas.android.com/apk/res/android"
         android:id="@+id/parentPanel"
         android:layout_width="match_parent"
@@ -104,4 +104,4 @@
             </FrameLayout>
         </LinearLayout>
     </ScrollView>
-</FrameLayout>
+</com.android.internal.widget.WatchListDecorLayout>
diff --git a/core/res/res/layout-watch/preference_list_fragment_material.xml b/core/res/res/layout-watch/preference_list_fragment_material.xml
new file mode 100644
index 0000000..ae8f203
--- /dev/null
+++ b/core/res/res/layout-watch/preference_list_fragment_material.xml
@@ -0,0 +1,93 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+     Copyright (C) 2016 The Android Open Source Project
+
+     Licensed under the Apache License, Version 2.0 (the "License");
+     you may not use this file except in compliance with the License.
+     You may obtain a copy of the License at
+
+          http://www.apache.org/licenses/LICENSE-2.0
+
+     Unless required by applicable law or agreed to in writing, software
+     distributed under the License is distributed on an "AS IS" BASIS,
+     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     See the License for the specific language governing permissions and
+     limitations under the License.
+-->
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:orientation="vertical"
+    android:layout_height="match_parent"
+    android:layout_width="match_parent"
+    android:background="@android:color/transparent"
+    android:layout_removeBorders="true">
+
+    <FrameLayout
+        android:id="@android:id/list_container"
+        android:layout_width="match_parent"
+        android:layout_height="0px"
+        android:layout_weight="1">
+        <com.android.internal.widget.WatchHeaderListView
+            android:id="@android:id/list"
+            android:layout_width="match_parent"
+            android:layout_height="match_parent"
+            style="?attr/preferenceFragmentListStyle"
+            android:scrollbarStyle="@integer/preference_fragment_scrollbarStyle"
+            android:clipToPadding="false"
+            android:drawSelectorOnTop="false"
+            android:cacheColorHint="@android:color/transparent"
+            android:scrollbarAlwaysDrawVerticalTrack="true">
+             <TextView
+                android:id="@android:id/title"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:paddingStart="@dimen/dialog_padding_material"
+                android:paddingEnd="@dimen/dialog_padding_material"
+                android:paddingBottom="8dp"
+                android:textAppearance="@style/TextAppearance.Material.Title"
+                android:gravity="center" />
+        </com.android.internal.widget.WatchHeaderListView>
+    </FrameLayout>
+
+    <TextView android:id="@android:id/empty"
+        android:layout_width="match_parent"
+        android:layout_height="match_parent"
+        android:padding="@dimen/preference_fragment_padding_side"
+        android:gravity="center"
+        android:visibility="gone" />
+
+    <RelativeLayout android:id="@+id/button_bar"
+        android:layout_height="wrap_content"
+        android:layout_width="match_parent"
+        android:layout_weight="0"
+        android:visibility="gone">
+
+        <Button android:id="@+id/back_button"
+            android:layout_width="150dip"
+            android:layout_height="wrap_content"
+            android:layout_margin="5dip"
+            android:layout_alignParentStart="true"
+            android:text="@string/back_button_label"
+        />
+        <LinearLayout
+            android:orientation="horizontal"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_alignParentEnd="true">
+
+            <Button android:id="@+id/skip_button"
+                android:layout_width="150dip"
+                android:layout_height="wrap_content"
+                android:layout_margin="5dip"
+                android:text="@string/skip_button_label"
+                android:visibility="gone"
+            />
+
+            <Button android:id="@+id/next_button"
+                android:layout_width="150dip"
+                android:layout_height="wrap_content"
+                android:layout_margin="5dip"
+                android:text="@string/next_button_label"
+            />
+        </LinearLayout>
+    </RelativeLayout>
+</LinearLayout>
diff --git a/core/res/res/layout-watch/preference_widget_switch.xml b/core/res/res/layout-watch/preference_widget_switch.xml
new file mode 100644
index 0000000..37d0c6b
--- /dev/null
+++ b/core/res/res/layout-watch/preference_widget_switch.xml
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2016 The Android Open Source Project
+
+     Licensed under the Apache License, Version 2.0 (the "License");
+     you may not use this file except in compliance with the License.
+     You may obtain a copy of the License at
+
+          http://www.apache.org/licenses/LICENSE-2.0
+
+     Unless required by applicable law or agreed to in writing, software
+     distributed under the License is distributed on an "AS IS" BASIS,
+     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     See the License for the specific language governing permissions and
+     limitations under the License.
+-->
+
+<!-- Layout for a SwitchPreference -->
+<Switch xmlns:android="http://schemas.android.com/apk/res/android"
+    android:id="@+android:id/switch_widget"
+    android:layout_width="40dp"
+    android:layout_height="40dp"
+    android:switchMinWidth="40dp"
+    android:layout_gravity="center"
+    android:thumb="@drawable/watch_switch_thumb_material_anim"
+    android:thumbTint="@color/watch_switch_thumb_color_material"
+    android:track="@drawable/watch_switch_track_material"
+    android:trackTint="?android:colorPrimary"
+    android:focusable="false"
+    android:clickable="false"
+    android:background="@null" />
diff --git a/core/res/res/layout/notification_material_action_emphasized.xml b/core/res/res/layout/notification_material_action_emphasized.xml
index 992e43e..1e364cc 100644
--- a/core/res/res/layout/notification_material_action_emphasized.xml
+++ b/core/res/res/layout/notification_material_action_emphasized.xml
@@ -26,9 +26,9 @@
         android:layout_width="match_parent"
         android:layout_height="match_parent"
         android:gravity="center"
-        android:textColor="#ffffffff"
+        android:textColor="@color/notification_default_color"
         android:singleLine="true"
         android:ellipsize="end"
-        android:background="@drawable/notification_material_action_background_emphasized"
+        android:background="@drawable/notification_material_action_background"
         />
 </FrameLayout>
diff --git a/core/res/res/values-en-rAU/strings.xml b/core/res/res/values-en-rAU/strings.xml
index 78800c7..43945e5 100644
--- a/core/res/res/values-en-rAU/strings.xml
+++ b/core/res/res/values-en-rAU/strings.xml
@@ -974,7 +974,7 @@
     <string name="whichEditApplicationLabel" msgid="7183524181625290300">"Edit"</string>
     <string name="whichSendApplication" msgid="6902512414057341668">"Share with"</string>
     <string name="whichSendApplicationNamed" msgid="2799370240005424391">"Share with %1$s"</string>
-    <string name="whichSendApplicationLabel" msgid="4579076294675975354">"Shared"</string>
+    <string name="whichSendApplicationLabel" msgid="4579076294675975354">"Share"</string>
     <string name="whichSendToApplication" msgid="8272422260066642057">"Send using"</string>
     <string name="whichSendToApplicationNamed" msgid="7768387871529295325">"Send using %1$s"</string>
     <string name="whichSendToApplicationLabel" msgid="8878962419005813500">"Send"</string>
diff --git a/core/res/res/values-en-rGB/strings.xml b/core/res/res/values-en-rGB/strings.xml
index 78800c7..43945e5 100644
--- a/core/res/res/values-en-rGB/strings.xml
+++ b/core/res/res/values-en-rGB/strings.xml
@@ -974,7 +974,7 @@
     <string name="whichEditApplicationLabel" msgid="7183524181625290300">"Edit"</string>
     <string name="whichSendApplication" msgid="6902512414057341668">"Share with"</string>
     <string name="whichSendApplicationNamed" msgid="2799370240005424391">"Share with %1$s"</string>
-    <string name="whichSendApplicationLabel" msgid="4579076294675975354">"Shared"</string>
+    <string name="whichSendApplicationLabel" msgid="4579076294675975354">"Share"</string>
     <string name="whichSendToApplication" msgid="8272422260066642057">"Send using"</string>
     <string name="whichSendToApplicationNamed" msgid="7768387871529295325">"Send using %1$s"</string>
     <string name="whichSendToApplicationLabel" msgid="8878962419005813500">"Send"</string>
diff --git a/core/res/res/values-en-rIN/strings.xml b/core/res/res/values-en-rIN/strings.xml
index 78800c7..43945e5 100644
--- a/core/res/res/values-en-rIN/strings.xml
+++ b/core/res/res/values-en-rIN/strings.xml
@@ -974,7 +974,7 @@
     <string name="whichEditApplicationLabel" msgid="7183524181625290300">"Edit"</string>
     <string name="whichSendApplication" msgid="6902512414057341668">"Share with"</string>
     <string name="whichSendApplicationNamed" msgid="2799370240005424391">"Share with %1$s"</string>
-    <string name="whichSendApplicationLabel" msgid="4579076294675975354">"Shared"</string>
+    <string name="whichSendApplicationLabel" msgid="4579076294675975354">"Share"</string>
     <string name="whichSendToApplication" msgid="8272422260066642057">"Send using"</string>
     <string name="whichSendToApplicationNamed" msgid="7768387871529295325">"Send using %1$s"</string>
     <string name="whichSendToApplicationLabel" msgid="8878962419005813500">"Send"</string>
diff --git a/core/res/res/values-gl-rES/strings.xml b/core/res/res/values-gl-rES/strings.xml
index 40daed1..feb0802 100644
--- a/core/res/res/values-gl-rES/strings.xml
+++ b/core/res/res/values-gl-rES/strings.xml
@@ -1537,8 +1537,8 @@
     <string name="immersive_cling_description" msgid="3482371193207536040">"Para saír, pasa o dedo cara abaixo desde arriba."</string>
     <string name="immersive_cling_positive" msgid="5016839404568297683">"De acordo"</string>
     <string name="done_label" msgid="2093726099505892398">"Feito"</string>
-    <string name="hour_picker_description" msgid="6698199186859736512">"Control de desprazamento circular das horas"</string>
-    <string name="minute_picker_description" msgid="8606010966873791190">"Control de desprazamento circular dos minutos"</string>
+    <string name="hour_picker_description" msgid="6698199186859736512">"Control desprazable circular das horas"</string>
+    <string name="minute_picker_description" msgid="8606010966873791190">"Control desprazable circular dos minutos"</string>
     <string name="select_hours" msgid="6043079511766008245">"Seleccionar horas"</string>
     <string name="select_minutes" msgid="3974345615920336087">"Seleccionar minutos"</string>
     <string name="select_day" msgid="7774759604701773332">"Seleccionar mes e día"</string>
diff --git a/core/res/res/values-hy-rAM/strings.xml b/core/res/res/values-hy-rAM/strings.xml
index c90562a..85392ff 100644
--- a/core/res/res/values-hy-rAM/strings.xml
+++ b/core/res/res/values-hy-rAM/strings.xml
@@ -670,7 +670,7 @@
     <string name="emergency_call_dialog_number_for_display" msgid="696192103195090970">"Արտակարգ իրավիճակների հեռախոսահամար"</string>
     <string name="lockscreen_carrier_default" msgid="6169005837238288522">"Ծառայություն չկա"</string>
     <string name="lockscreen_screen_locked" msgid="7288443074806832904">"Էկրանը կողպված է:"</string>
-    <string name="lockscreen_instructions_when_pattern_enabled" msgid="46154051614126049">"Սեղմեք Ցանկ` ապակողպելու համար, կամ կատարեք արտակարգ իրավիճակների զանգ:"</string>
+    <string name="lockscreen_instructions_when_pattern_enabled" msgid="46154051614126049">"Ապակողպելու կամ շտապ կանչ անելու համար սեղմեք «Ընտրացանկ»"</string>
     <string name="lockscreen_instructions_when_pattern_disabled" msgid="686260028797158364">"Ապակողպելու համար սեղմեք Ցանկը:"</string>
     <string name="lockscreen_pattern_instructions" msgid="7478703254964810302">"Հավաքեք սխեման` ապակողպելու համար"</string>
     <string name="lockscreen_emergency_call" msgid="5298642613417801888">"Արտակարգ իրավիճակ"</string>
diff --git a/core/res/res/values-in/strings.xml b/core/res/res/values-in/strings.xml
index 382b0c9..4790524 100644
--- a/core/res/res/values-in/strings.xml
+++ b/core/res/res/values-in/strings.xml
@@ -1024,7 +1024,7 @@
     <string name="android_upgrading_fstrim" msgid="8036718871534640010">"Mengoptimalkan penyimpanan."</string>
     <string name="android_upgrading_notification_title" msgid="1619393112444671028">"Android sedang meningkatkan versi"</string>
     <string name="android_upgrading_notification_body" msgid="5761201379457064286">"Beberapa aplikasi mungkin tidak berfungsi dengan baik jika peningkatan versi belum selesai"</string>
-    <string name="app_upgrading_toast" msgid="3008139776215597053">"Versi <xliff:g id="APPLICATION">%1$s</xliff:g> sedang ditingkatkan…"</string>
+    <string name="app_upgrading_toast" msgid="3008139776215597053">"<xliff:g id="APPLICATION">%1$s</xliff:g> sedang ditingkatkan versinya…"</string>
     <string name="android_upgrading_apk" msgid="7904042682111526169">"Mengoptimalkan aplikasi <xliff:g id="NUMBER_0">%1$d</xliff:g> dari <xliff:g id="NUMBER_1">%2$d</xliff:g>."</string>
     <string name="android_preparing_apk" msgid="8162599310274079154">"Menyiapkan <xliff:g id="APPNAME">%1$s</xliff:g>."</string>
     <string name="android_upgrading_starting_apps" msgid="451464516346926713">"Memulai aplikasi."</string>
diff --git a/core/res/res/values-ne-rNP/strings.xml b/core/res/res/values-ne-rNP/strings.xml
index 9b297f7..5ada486 100644
--- a/core/res/res/values-ne-rNP/strings.xml
+++ b/core/res/res/values-ne-rNP/strings.xml
@@ -1606,7 +1606,7 @@
     <string name="zen_mode_feature_name" msgid="5254089399895895004">"अवरोध नपुर्याउँनुहोस्"</string>
     <string name="zen_mode_downtime_feature_name" msgid="2626974636779860146">"डाउनटाइम"</string>
     <string name="zen_mode_default_weeknights_name" msgid="3081318299464998143">"हरेक हप्तादिनको राति"</string>
-    <string name="zen_mode_default_weekends_name" msgid="2786495801019345244">"शनिवार"</string>
+    <string name="zen_mode_default_weekends_name" msgid="2786495801019345244">"शनिबार"</string>
     <string name="zen_mode_default_events_name" msgid="8158334939013085363">"घटना"</string>
     <string name="muted_by" msgid="6147073845094180001">"<xliff:g id="THIRD_PARTY">%1$s</xliff:g> द्वारा मौन गरिएको"</string>
     <string name="system_error_wipe_data" msgid="6608165524785354962">"तपाईंको यन्त्रसँग आन्तरिक समस्या छ, र तपाईंले फ्याक्ट्री डाटा रिसेट नगर्दासम्म यो अस्थिर रहन्छ।"</string>
diff --git a/core/res/res/values-pa-rIN/strings.xml b/core/res/res/values-pa-rIN/strings.xml
index 625856f..c059202c 100644
--- a/core/res/res/values-pa-rIN/strings.xml
+++ b/core/res/res/values-pa-rIN/strings.xml
@@ -1024,7 +1024,7 @@
     <string name="android_upgrading_fstrim" msgid="8036718871534640010">"ਸਟੋਰੇਜ ਅਨੁਕੂਲ ਕਰ ਰਿਹਾ ਹੈ।"</string>
     <string name="android_upgrading_notification_title" msgid="1619393112444671028">"Android ਅੱਪਗ੍ਰੇਡ ਕੀਤਾ ਜਾ ਰਿਹਾ ਹੈ"</string>
     <string name="android_upgrading_notification_body" msgid="5761201379457064286">"ਹੋ ਸਕਦਾ ਹੈ ਕਿ ਕੁਝ ਐਪਾਂ ਅੱਪਗ੍ਰੇਡ ਦੇ ਪੂਰੀ ਹੋਣ ਤੱਕ ਸਹੀ ਢੰਗ ਨਾਲ ਕੰਮ ਨਾ ਕਰਨ"</string>
-    <string name="app_upgrading_toast" msgid="3008139776215597053">"<xliff:g id="APPLICATION">%1$s</xliff:g> ਨੂੰ ਅੱਪਗ੍ਰੇਡ ਕੀਤਾ ਜਾ ਰਿਹਾ ਹੈ…"</string>
+    <string name="app_upgrading_toast" msgid="3008139776215597053">"<xliff:g id="APPLICATION">%1$s</xliff:g> ਅੱਪਗ੍ਰੇਡ ਹੋ ਰਹੀ ਹੈ…"</string>
     <string name="android_upgrading_apk" msgid="7904042682111526169">"<xliff:g id="NUMBER_0">%1$d</xliff:g> <xliff:g id="NUMBER_1">%2$d</xliff:g> ਦਾ ਐਪ ਅਨੁਕੂਲ ਕਰ ਰਿਹਾ ਹੈ।"</string>
     <string name="android_preparing_apk" msgid="8162599310274079154">"<xliff:g id="APPNAME">%1$s</xliff:g> ਤਿਆਰ ਕਰ ਰਿਹਾ ਹੈ।"</string>
     <string name="android_upgrading_starting_apps" msgid="451464516346926713">"ਐਪਸ ਚਾਲੂ ਕਰ ਰਿਹਾ ਹੈ।"</string>
diff --git a/core/res/res/values-ta-rIN/strings.xml b/core/res/res/values-ta-rIN/strings.xml
index 668c2bb..41e316f 100644
--- a/core/res/res/values-ta-rIN/strings.xml
+++ b/core/res/res/values-ta-rIN/strings.xml
@@ -243,23 +243,23 @@
     <string name="user_owner_label" msgid="1119010402169916617">"தனிப்பட்ட சுயவிவரத்திற்கு மாறு"</string>
     <string name="managed_profile_label" msgid="5289992269827577857">"பணிச் சுயவிவரத்திற்கு மாறு"</string>
     <string name="permgrouplab_contacts" msgid="3657758145679177612">"தொடர்புகள்"</string>
-    <string name="permgroupdesc_contacts" msgid="6951499528303668046">"தொடர்புகளை அணுகும்"</string>
+    <string name="permgroupdesc_contacts" msgid="6951499528303668046">"தொடர்புகளை அணுக வேண்டும்"</string>
     <string name="permgrouplab_location" msgid="7275582855722310164">"இருப்பிடம்"</string>
-    <string name="permgroupdesc_location" msgid="1346617465127855033">"சாதனத்தின் இருப்பிடத்தை அணுகும்"</string>
+    <string name="permgroupdesc_location" msgid="1346617465127855033">"இந்தச் சாதனத்தின் இருப்பிடத்தை அறிந்து கொள்ளலாம்"</string>
     <string name="permgrouplab_calendar" msgid="5863508437783683902">"கேலெண்டர்"</string>
-    <string name="permgroupdesc_calendar" msgid="3889615280211184106">"கேலெண்டரை அணுகும்"</string>
+    <string name="permgroupdesc_calendar" msgid="3889615280211184106">"கேலெண்டரை அணுகலாம்"</string>
     <string name="permgrouplab_sms" msgid="228308803364967808">"SMS"</string>
-    <string name="permgroupdesc_sms" msgid="4656988620100940350">"SMS செய்திகளை அனுப்பும் மற்றும் பார்க்கும்"</string>
+    <string name="permgroupdesc_sms" msgid="4656988620100940350">"SMS அனுப்பலாம், வந்த SMSகளைப் பார்க்கலாம்"</string>
     <string name="permgrouplab_storage" msgid="1971118770546336966">"சேமிப்பிடம்"</string>
-    <string name="permgroupdesc_storage" msgid="637758554581589203">"உங்கள் சாதனத்தில் உள்ள படங்கள், மீடியா மற்றும் கோப்புகளை அணுகும்"</string>
+    <string name="permgroupdesc_storage" msgid="637758554581589203">"உங்கள் சாதனத்தில் உள்ள படங்கள், மீடியா மற்றும் கோப்புகளை அணுக வேண்டும்"</string>
     <string name="permgrouplab_microphone" msgid="171539900250043464">"மைக்ரோஃபோன்"</string>
-    <string name="permgroupdesc_microphone" msgid="4988812113943554584">"ஆடியோவைப் பதிவுசெய்யும்"</string>
+    <string name="permgroupdesc_microphone" msgid="4988812113943554584">"ஒலிப் பதிவு செய்யலாம்"</string>
     <string name="permgrouplab_camera" msgid="4820372495894586615">"கேமரா"</string>
-    <string name="permgroupdesc_camera" msgid="3250611594678347720">"படங்களை எடுக்கும், வீடியோவைப் பதிவுசெய்யும்"</string>
+    <string name="permgroupdesc_camera" msgid="3250611594678347720">"படங்கள் மற்றும் வீடியோக்கள் எடுக்கலாம்"</string>
     <string name="permgrouplab_phone" msgid="5229115638567440675">"ஃபோன்"</string>
-    <string name="permgroupdesc_phone" msgid="6234224354060641055">"மொபைல் அழைப்புகளைச் செய்யும், பெறும்"</string>
+    <string name="permgroupdesc_phone" msgid="6234224354060641055">"யாரையும் தொலைபேசியில் அழைக்கலாம்"</string>
     <string name="permgrouplab_sensors" msgid="416037179223226722">"உடல் உணர்விகள்"</string>
-    <string name="permgroupdesc_sensors" msgid="7147968539346634043">"உங்கள் உடலியக்கக் குறிகள் பற்றிய உணர்வித் தரவை அணுகும்"</string>
+    <string name="permgroupdesc_sensors" msgid="7147968539346634043">"உங்கள் உடல் இயக்கம் பற்றி உணர்விகள் கூறும் தகவலைப் பார்க்கலாம்"</string>
     <string name="capability_title_canRetrieveWindowContent" msgid="3901717936930170320">"சாளர உள்ளடக்கத்தைப் பெறும்"</string>
     <string name="capability_desc_canRetrieveWindowContent" msgid="3772225008605310672">"நீங்கள் பணியாற்றி கொண்டிருக்கும் சாளரத்தின் உள்ளடக்கத்தைப் பார்க்கலாம்."</string>
     <string name="capability_title_canRequestTouchExploration" msgid="3108723364676667320">"தொடுவதன் மூலம் அறிவதை இயக்கும்"</string>
diff --git a/core/res/res/values-watch/styles_material.xml b/core/res/res/values-watch/styles_material.xml
index 5c4c632..f5735e6 100644
--- a/core/res/res/values-watch/styles_material.xml
+++ b/core/res/res/values-watch/styles_material.xml
@@ -57,6 +57,10 @@
         <item name="divider">@empty</item>
     </style>
 
+    <style name="Preference.Material.PreferenceScreen" parent="Preference.Material.BasePreferenceScreen">
+        <item name="divider">@empty</item>
+    </style>
+
     <style name="Widget.Material.TextView" parent="Widget.TextView">
         <item name="breakStrategy">balanced</item>
     </style>
diff --git a/core/res/res/values/attrs.xml b/core/res/res/values/attrs.xml
index d82158f..9a7fccc 100644
--- a/core/res/res/values/attrs.xml
+++ b/core/res/res/values/attrs.xml
@@ -3792,7 +3792,10 @@
         <!-- An optional argument to supply a maximum height for this view.
              See {see android.widget.ImageView#setMaxHeight} for details. -->
         <attr name="maxHeight" format="dimension" />
-        <!-- Set a tinting color for the image. By default, the tint will blend using SRC_ATOP mode. -->
+        <!-- The tinting color for the image. By default, the tint will blend using SRC_ATOP mode.
+             Please note that for compatibility reasons, this is NOT consistent with the default
+             SRC_IN tint mode used by {@link android.widget.ImageView#setImageTintList} and by
+             similar tint attributes on other views. -->
         <attr name="tint" format="color" />
         <!-- If true, the image view will be baseline aligned with based on its
              bottom edge. -->
@@ -7900,6 +7903,13 @@
         <attr name="divider" />
     </declare-styleable>
 
+    <!-- Base attributes available to PreferenceScreen. -->
+    <declare-styleable name="PreferenceScreen">
+        <!-- The layout for the PreferenceScreen. This should rarely need to be changed. -->
+        <attr name="screenLayout" format="reference" />
+        <attr name="divider" />
+    </declare-styleable>
+
     <!-- Base attributes available to PreferenceActivity. -->
     <declare-styleable name="PreferenceActivity">
         <!-- The layout for the Preference Activity. This should rarely need to be changed. -->
diff --git a/core/res/res/values/colors.xml b/core/res/res/values/colors.xml
index 1843475..de86cef 100644
--- a/core/res/res/values/colors.xml
+++ b/core/res/res/values/colors.xml
@@ -140,6 +140,7 @@
     <color name="notification_progress_background_color">@color/secondary_text_material_light</color>
 
     <color name="notification_action_list">#ffeeeeee</color>
+    <color name="notification_action_list_dark">#ffe0e0e0</color>
 
     <!-- Keyguard colors -->
     <color name="keyguard_avatar_frame_color">#ffffffff</color>
diff --git a/core/res/res/values/config.xml b/core/res/res/values/config.xml
index c1315cb..61b4c8d 100644
--- a/core/res/res/values/config.xml
+++ b/core/res/res/values/config.xml
@@ -2524,4 +2524,12 @@
          Note: Also update appropriate overlay files. -->
     <string-array translatable="false" name="config_defaultFirstUserRestrictions">
     </string-array>
+
+    <!-- Specifies whether the permissions needed by a legacy app should be
+         reviewed before any of its components can run. A legacy app is one
+         with targetSdkVersion < 23, i.e apps using the old permission model.
+         If review is not required, permissions are reviewed before the app
+         is installed. -->
+    <bool name="config_permissionReviewRequired">false</bool>
+
 </resources>
diff --git a/core/res/res/values/styles_material.xml b/core/res/res/values/styles_material.xml
index 1aae02b..4435537 100644
--- a/core/res/res/values/styles_material.xml
+++ b/core/res/res/values/styles_material.xml
@@ -81,7 +81,12 @@
         <item name="layout">@layout/preference_widget_seekbar_material</item>
     </style>
 
-    <style name="Preference.Material.PreferenceScreen"/>
+    <style name="Preference.Material.BasePreferenceScreen">
+        <item name="screenLayout">@layout/preference_list_fragment_material</item>
+        <item name="divider">?attr/listDivider</item>
+    </style>
+
+    <style name="Preference.Material.PreferenceScreen" parent="Preference.Material.BasePreferenceScreen"/>
 
     <style name="Preference.Material.DialogPreference">
         <item name="positiveButtonText">@string/ok</item>
@@ -1208,7 +1213,11 @@
     <style name="AlertDialog.Material.Light" />
 
     <style name="DatePickerDialog.Material" parent="AlertDialog.Material">
-        <item name="showTitle">true</item>
+        <item name="showTitle">false</item>
+    </style>
+
+    <style name="TimePickerDialog.Material" parent="AlertDialog.Material">
+        <item name="showTitle">false</item>
     </style>
 
     <!-- Window title -->
diff --git a/core/res/res/values/symbols.xml b/core/res/res/values/symbols.xml
index a7d8188..5c8d7f7 100644
--- a/core/res/res/values/symbols.xml
+++ b/core/res/res/values/symbols.xml
@@ -2560,6 +2560,7 @@
 
   <java-symbol type="color" name="notification_action_list" />
   <java-symbol type="color" name="notification_material_background_color" />
+  <java-symbol type="color" name="notification_action_list_dark" />
 
   <!-- Resolver target actions -->
   <java-symbol type="array" name="resolver_target_actions_pin" />
@@ -2679,4 +2680,7 @@
 
   <!-- Default first user restrictions -->
   <java-symbol type="array" name="config_defaultFirstUserRestrictions" />
+
+  <java-symbol type="bool" name="config_permissionReviewRequired" />
+
 </resources>
diff --git a/core/res/res/values/themes_material.xml b/core/res/res/values/themes_material.xml
index 35ce9b0..7e2867d 100644
--- a/core/res/res/values/themes_material.xml
+++ b/core/res/res/values/themes_material.xml
@@ -370,7 +370,7 @@
         <item name="timePickerStyle">@style/Widget.Material.TimePicker</item>
 
         <!-- TimePicker dialog theme -->
-        <item name="timePickerDialogTheme">?attr/dialogTheme</item>
+        <item name="timePickerDialogTheme">@style/ThemeOverlay.Material.Dialog.TimePicker</item>
 
         <!-- DatePicker style -->
         <item name="datePickerStyle">@style/Widget.Material.DatePicker</item>
@@ -733,7 +733,7 @@
         <item name="timePickerStyle">@style/Widget.Material.Light.TimePicker</item>
 
         <!-- TimePicker dialog theme -->
-        <item name="timePickerDialogTheme">?attr/dialogTheme</item>
+        <item name="timePickerDialogTheme">@style/ThemeOverlay.Material.Dialog.TimePicker</item>
 
         <!-- DatePicker style -->
         <item name="datePickerStyle">@style/Widget.Material.Light.DatePicker</item>
@@ -900,6 +900,11 @@
         <item name="colorBackground">?attr/colorBackgroundFloating</item>
     </style>
 
+    <!-- Theme overlay that overrides window properties to display as a time picker dialog. -->
+    <style name="ThemeOverlay.Material.Dialog.TimePicker">
+        <item name="alertDialogStyle">@style/TimePickerDialog.Material</item>
+    </style>
+
     <!-- Theme overlay that overrides window properties to display as a date picker dialog. -->
     <style name="ThemeOverlay.Material.Dialog.DatePicker">
         <item name="alertDialogStyle">@style/DatePickerDialog.Material</item>
diff --git a/core/tests/coretests/src/android/content/res/ResourcesManagerTest.java b/core/tests/coretests/src/android/content/res/ResourcesManagerTest.java
index f088197..4e70bb1 100644
--- a/core/tests/coretests/src/android/content/res/ResourcesManagerTest.java
+++ b/core/tests/coretests/src/android/content/res/ResourcesManagerTest.java
@@ -147,6 +147,7 @@
         mResourcesManager.applyConfigurationToResourcesLocked(newConfig, null);
 
         final Configuration expectedConfig = new Configuration();
+        expectedConfig.setToDefaults();
         expectedConfig.setLocales(LocaleList.getAdjustedDefault());
         expectedConfig.densityDpi = mDisplayMetrics.densityDpi;
         expectedConfig.orientation = Configuration.ORIENTATION_LANDSCAPE;
@@ -229,6 +230,7 @@
         assertNotSame(resources1.getImpl(), resources2.getImpl());
 
         final Configuration expectedConfig1 = new Configuration();
+        expectedConfig1.setToDefaults();
         expectedConfig1.setLocales(LocaleList.getAdjustedDefault());
         expectedConfig1.densityDpi = 280;
         assertEquals(expectedConfig1, resources1.getConfiguration());
@@ -236,6 +238,7 @@
         // resources2 should be based on the Activity's override config, so the density should
         // be the same as resources1.
         final Configuration expectedConfig2 = new Configuration();
+        expectedConfig2.setToDefaults();
         expectedConfig2.setLocales(LocaleList.getAdjustedDefault());
         expectedConfig2.densityDpi = 280;
         expectedConfig2.screenLayout |= Configuration.SCREENLAYOUT_ROUND_YES;
diff --git a/docs/html/_project.yaml b/docs/html/_project.yaml
new file mode 100644
index 0000000..a67469b
--- /dev/null
+++ b/docs/html/_project.yaml
@@ -0,0 +1,5 @@
+name: "Home"
+home_url: /
+description: "Android Developers website."
+content_license: cc3-apache2
+buganizer_id: 30209417
diff --git a/docs/html/_redirects.yaml b/docs/html/_redirects.yaml
index 4cfe808..2b94718 100644
--- a/docs/html/_redirects.yaml
+++ b/docs/html/_redirects.yaml
@@ -1201,3 +1201,10 @@
   to: /studio/intro/index.html?utm_medium=android-studio
 - from: /r/studio-ui/menu-start.html
   to: /training/index.html?utm_medium=android-studio
+
+# N Preview redirects
+
+- from: /preview/features/key-attestation.html
+  to: /training/articles/security-key-attestation.html
+- from: /preview/features/security-config.html
+  to: /training/articles/security-config.html
\ No newline at end of file
diff --git a/docs/html/about/_project.yaml b/docs/html/about/_project.yaml
new file mode 100644
index 0000000..160cf55
--- /dev/null
+++ b/docs/html/about/_project.yaml
@@ -0,0 +1,5 @@
+name: "Android"
+home_url: /about/
+description: "Android, the world's most popular mobile platform"
+content_license: cc3-apache2
+buganizer_id: 30209417
diff --git a/docs/html/about/dashboards/index.jd b/docs/html/about/dashboards/index.jd
index a9f1985..3cbfde9 100644
--- a/docs/html/about/dashboards/index.jd
+++ b/docs/html/about/dashboards/index.jd
@@ -381,7 +381,7 @@
     $divtable.append($table);
     $divchart.append($chart);
     $div.append($divtable).append($divchart);
-    $("#version-chart").append($div);
+    $("#version-chart").replaceWith($div);
   });
 
 
@@ -449,7 +449,7 @@
 
     // stack up and insert the elements
     $div.append($table).append($sizechart).append($densitychart);
-    $("#screens-chart").append($div);
+    $("#screens-chart").replaceWith($div);
   });
 
   // TODO (akassay): Remove this.
diff --git a/docs/html/about/versions/android-1.6.jd b/docs/html/about/versions/android-1.6.jd
index ffca6b6..970c343 100755
--- a/docs/html/about/versions/android-1.6.jd
+++ b/docs/html/about/versions/android-1.6.jd
@@ -289,7 +289,7 @@
 
     <ul>
       <li>New <a href="{@docRoot}guide/topics/manifest/supports-screens-element.html">{@code
-      &lt;supports-screens>}</a> element lets you specify the device screen sizes that your
+      <supports-screens>}</a> element lets you specify the device screen sizes that your
       application is designed and tested to support, where "size" is a combination
       of resolution and density. If your application is run on a device whose screen
       size is not specified in the <code>&lt;supports-screen&gt;</code> element, the system
@@ -324,7 +324,7 @@
     </p>
     </li>
 
-      <li>New <a href="{@docRoot}guide/topics/manifest/uses-feature-element.html">{@code &lt;uses-feature>}</a>
+      <li>New <a href="{@docRoot}guide/topics/manifest/uses-feature-element.html">{@code <uses-feature>}</a>
         element lets an application specify hardware (or other)
         features that it requires to function normally. When an application
         specifies such features, the system allows the application to be installed only
@@ -338,7 +338,7 @@
         </ul>
       </li>
       <li>New attributes for the
-      <a href="{@docRoot}guide/topics/manifest/uses-sdk-element.html">{@code &lt;uses-sdk>}</a> element:
+      <a href="{@docRoot}guide/topics/manifest/uses-sdk-element.html">{@code <uses-sdk>}</a> element:
         <ul>
           <li><code>targetSdkVersion</code>: Indicates the API Level that the application is targeting.
           It is able to run on older versions (down to minSdkVersion), but was explicitly tested to
diff --git a/docs/html/about/versions/android-4.0.3.jd b/docs/html/about/versions/android-4.0.3.jd
index bcfa35c..c4b503c 100644
--- a/docs/html/about/versions/android-4.0.3.jd
+++ b/docs/html/about/versions/android-4.0.3.jd
@@ -217,7 +217,7 @@
 
 <ul>
 <li>Adds the new method {@link
-android.speech.tts.TextToSpeech.Engine#getFeatures(java.util.Locale)
+android.speech.tts.TextToSpeech#getFeatures(java.util.Locale)
 getFeatures()}for querying and enabling network TTS support.
 <li>Adds a new listener class, {@link
 android.speech.tts.UtteranceProgressListener}, that engines can register to
diff --git a/docs/html/about/versions/android-4.0.jd b/docs/html/about/versions/android-4.0.jd
index 48afcd4..bf68584 100644
--- a/docs/html/about/versions/android-4.0.jd
+++ b/docs/html/about/versions/android-4.0.jd
@@ -631,8 +631,8 @@
 <p>A new package, {@link android.net.wifi.p2p}, contains all the APIs for performing peer-to-peer
 connections with Wi-Fi. The primary class you need to work with is {@link
 android.net.wifi.p2p.WifiP2pManager}, which you can acquire by calling {@link
-android.app.Activity#getSystemService getSystemService(WIFI_P2P_SERVICE)}. The {@link
-android.net.wifi.p2p.WifiP2pManager} includes APIs that allow you to:</p>
+android.app.Activity#getSystemService(java.lang.String) getSystemService(WIFI_P2P_SERVICE)}.
+The {@link android.net.wifi.p2p.WifiP2pManager} includes APIs that allow you to:</p>
 <ul>
 <li>Initialize your application for P2P connections by calling {@link
 android.net.wifi.p2p.WifiP2pManager#initialize initialize()}</li>
@@ -798,7 +798,7 @@
 android.R.attr#contentDescription android:contentDescription} text is missing or
 insufficient. To add more text description to the
 {@link android.view.accessibility.AccessibilityEvent}, call {@link
-android.view.accessibility.AccessibilityEvent#getText()}.{@link java.util.List#add add()}.</p>
+android.view.accessibility.AccessibilityRecord#getText()}.{@link java.util.List#add add()}.</p>
 </li>
   <li>At this point, the {@link android.view.View} passes the event up the view hierarchy by calling
 {@link android.view.ViewGroup#requestSendAccessibilityEvent requestSendAccessibilityEvent()} on the
diff --git a/docs/html/about/versions/android-4.2.jd b/docs/html/about/versions/android-4.2.jd
index 34fa1d4..ac84d0f 100755
--- a/docs/html/about/versions/android-4.2.jd
+++ b/docs/html/about/versions/android-4.2.jd
@@ -213,9 +213,9 @@
 <p>Android now allows your app to display unique content on additional screens that are connected
 to the user’s device over either a wired connection or Wi-Fi.
  To create unique content for a secondary display, extend the {@link android.app.Presentation}
-class and implement the {@link android.app.Presentation#onCreate onCreate()} callback. Within
-{@link android.app.Presentation#onCreate onCreate()}, specify your UI for the secondary display
-by calling {@link android.app.Presentation#setContentView setContentView()}.
+class and implement the {@link android.app.Dialog#onCreate onCreate()} callback. Within
+{@link android.app.Dialog#onCreate onCreate()}, specify your UI for the secondary display
+by calling {@link android.app.Dialog#setContentView setContentView()}.
 As an extension of the {@link android.app.Dialog} class, the {@link
 android.app.Presentation} class provides the region in which your app can display a unique UI on the
 secondary display.</p>
@@ -241,13 +241,13 @@
 
 <p>To detect at runtime when a new display has been connected, create an instance of {@link
 android.media.MediaRouter.SimpleCallback} in which you implement the {@link
-android.media.MediaRouter.SimpleCallback#onRoutePresentationDisplayChanged
+android.media.MediaRouter.Callback#onRoutePresentationDisplayChanged
 onRoutePresentationDisplayChanged()} callback method, which the system will call when a new
 presentation display is connected. Then register the {@link
 android.media.MediaRouter.SimpleCallback} by passing it to {@link
 android.media.MediaRouter#addCallback MediaRouter.addCallback()} along with the {@link
 android.media.MediaRouter#ROUTE_TYPE_LIVE_VIDEO} route type. When you receive a call to
-{@link android.media.MediaRouter.SimpleCallback#onRoutePresentationDisplayChanged
+{@link android.media.MediaRouter.Callback#onRoutePresentationDisplayChanged
 onRoutePresentationDisplayChanged()}, simply call {@link
 android.media.MediaRouter#getSelectedRoute MediaRouter.getSelectedRoute()} as mentioned above.</p>
 
@@ -262,7 +262,7 @@
 likely a different screen density. Because the screen characteristics may different, you should
 provide resources that are optimized specifically for such larger displays. If you need
 to request additional resources from your {@link
-android.app.Presentation}, call {@link android.app.Presentation#getContext()}{@link
+android.app.Presentation}, call {@link android.app.Dialog#getContext()}{@link
 android.content.Context#getResources .getResources()} to get the {@link
 android.content.res.Resources} object corresponding to the display. This provides
 the appropriate resources from your app that are best suited for the
@@ -510,7 +510,7 @@
   <p>To use a script intrinsic, call the static <code>create()</code> method of each instrinsic
   to create an instance of the script. You then call the available <code>set()</code>
   methods of each script intrinsic to set any necessary inputs and options.
-  Finally, call the {@link android.renderscript.ScriptC#forEach forEach()}</code>
+  Finally, call the {@link android.renderscript.Script#forEach forEach()}</code>
   method to execute the script.</p>
   </dd>
 
diff --git a/docs/html/about/versions/android-4.3.jd b/docs/html/about/versions/android-4.3.jd
index 547b2f8..34a701b 100644
--- a/docs/html/about/versions/android-4.3.jd
+++ b/docs/html/about/versions/android-4.3.jd
@@ -907,7 +907,7 @@
 
 <p>To track changes to inserts and updates, you can now include the {@link android.provider.ContactsContract.ContactsColumns#CONTACT_LAST_UPDATED_TIMESTAMP} parameter with your selection to query only the contacts that have changed since the last time you queried the provider.</p>
 
-<p>To track which contacts have been deleted, the new table {@link android.provider.ContactsContract.DeletedContacts} provides a log of contacts that have been deleted (but each contact deleted is held in this table for a limited time). Similar to {@link android.provider.ContactsContract.ContactsColumns#CONTACT_LAST_UPDATED_TIMESTAMP}, you can use the new selection parameter, {@link android.provider.ContactsContract.DeletedContacts#CONTACT_DELETED_TIMESTAMP} to check which contacts have been deleted since the last time you queried the provider. The table also contains the constant {@link android.provider.ContactsContract.DeletedContacts#DAYS_KEPT_MILLISECONDS} containing the number of days (in milliseconds) that the log will be kept.</p>
+<p>To track which contacts have been deleted, the new table {@link android.provider.ContactsContract.DeletedContacts} provides a log of contacts that have been deleted (but each contact deleted is held in this table for a limited time). Similar to {@link android.provider.ContactsContract.ContactsColumns#CONTACT_LAST_UPDATED_TIMESTAMP}, you can use the new selection parameter, {@link android.provider.ContactsContract.DeletedContactsColumns#CONTACT_DELETED_TIMESTAMP} to check which contacts have been deleted since the last time you queried the provider. The table also contains the constant {@link android.provider.ContactsContract.DeletedContacts#DAYS_KEPT_MILLISECONDS} containing the number of days (in milliseconds) that the log will be kept.</p>
 
 <p>Additionally, the Contacts Provider now broadcasts the {@link
 android.provider.ContactsContract.Intents#CONTACTS_DATABASE_CREATED} action when the user
diff --git a/docs/html/about/versions/marshmallow/android-6.0-changes.jd b/docs/html/about/versions/marshmallow/android-6.0-changes.jd
index b44142e..65c976b 100644
--- a/docs/html/about/versions/marshmallow/android-6.0-changes.jd
+++ b/docs/html/about/versions/marshmallow/android-6.0-changes.jd
@@ -280,7 +280,7 @@
 If your app uses the
 {@link java.lang.reflect.Constructor#newInstance(java.lang.Object...) newInstance()} method and you
 want to override access checks, call the
-{@link java.lang.reflect.Constructor#setAccessible(boolean) setAccessible()} method with the input
+{@link java.lang.reflect.AccessibleObject#setAccessible(boolean) setAccessible()} method with the input
 parameter set to {@code true}. If your app uses the
 <a href="{@docRoot}tools/support-library/features.html#v7-appcompat">v7 appcompat library</a> or the
 <a href="{@docRoot}tools/support-library/features.html#v7-recyclerview">v7 recyclerview library</a>,
diff --git a/docs/html/about/versions/marshmallow/android-6.0.jd b/docs/html/about/versions/marshmallow/android-6.0.jd
index 240b080..247c6d1c 100644
--- a/docs/html/about/versions/marshmallow/android-6.0.jd
+++ b/docs/html/about/versions/marshmallow/android-6.0.jd
@@ -129,8 +129,8 @@
 <pre class="no-prettyprint">
 adb -e emu finger touch &lt;finger_id&gt;
 </pre>
-<p>On Windows, you may have to run {@code telnet 127.0.0.1 &lt;emulator-id&gt;} followed by
-  {@code finger touch &lt;finger_id&gt;}.
+<p>On Windows, you may have to run {@code telnet 127.0.0.1 <emulator-id>} followed by
+  {@code finger touch <finger_id>}.
 </p>
 </li>
 </ol>
@@ -204,7 +204,7 @@
 
 <p>For each activity that you want to expose to
 {@link android.service.chooser.ChooserTargetService}, add a
-{@code &lt;meta-data&gt;} element with the name
+{@code <meta-data>} element with the name
 {@code "android.service.chooser.chooser_target_service"} in your app manifest.
 </p>
 
diff --git a/docs/html/design/_project.yaml b/docs/html/design/_project.yaml
new file mode 100644
index 0000000..72df4a8
--- /dev/null
+++ b/docs/html/design/_project.yaml
@@ -0,0 +1,5 @@
+name: "Design"
+home_url: /design/
+description: "Create beautiful experiences in your apps."
+content_license: cc3-apache2
+buganizer_id: 30209417
diff --git a/docs/html/develop/_project.yaml b/docs/html/develop/_project.yaml
new file mode 100644
index 0000000..40a66b3
--- /dev/null
+++ b/docs/html/develop/_project.yaml
@@ -0,0 +1,5 @@
+name: "Develop"
+home_url: /develop/
+description: "Android Studio provides the fastest tools for building apps on every type of Android device."
+content_license: cc3-apache2
+buganizer_id: 30209417
diff --git a/docs/html/distribute/_project.yaml b/docs/html/distribute/_project.yaml
new file mode 100644
index 0000000..5777333
--- /dev/null
+++ b/docs/html/distribute/_project.yaml
@@ -0,0 +1,5 @@
+name: "Distribute"
+home_url: /distribute/
+description: "The most visited store in the world for Android apps. Cloud-connected and always synced, it's never been easier for users to find and download your apps."
+content_license: cc3-apache2
+buganizer_id: 30209417
diff --git a/docs/html/distribute/analyze/_project.yaml b/docs/html/distribute/analyze/_project.yaml
new file mode 100644
index 0000000..5c77074
--- /dev/null
+++ b/docs/html/distribute/analyze/_project.yaml
@@ -0,0 +1,6 @@
+name: "Analyze"
+home_url: /distribute/analyze/
+description: "Understanding what your users do inside your app is the key to engaging and monetizing them."
+content_license: cc3-apache2
+buganizer_id: 30209417
+parent_project_metadata_path: /distribute/_project.yaml
diff --git a/docs/html/distribute/engage/_project.yaml b/docs/html/distribute/engage/_project.yaml
new file mode 100644
index 0000000..fd8fa44
--- /dev/null
+++ b/docs/html/distribute/engage/_project.yaml
@@ -0,0 +1,6 @@
+name: "Engage & Retain"
+home_url: /distribute/engage/
+description: "Engaging and retaining active users are the keys to success. Here are some resources to help you build an active user base."
+content_license: cc3-apache2
+buganizer_id: 30209417
+parent_project_metadata_path: /distribute/_project.yaml
diff --git a/docs/html/distribute/essentials/_project.yaml b/docs/html/distribute/essentials/_project.yaml
new file mode 100644
index 0000000..cafde8d
--- /dev/null
+++ b/docs/html/distribute/essentials/_project.yaml
@@ -0,0 +1,6 @@
+name: "Essentials"
+home_url: /distribute/essentials/
+description: "A focus on quality should be part of your entire app delivery process: from initial concept through app and UI design, coding and testing and onto a process of monitoring feedback and making improvement after launch."
+content_license: cc3-apache2
+buganizer_id: 30209417
+parent_project_metadata_path: /distribute/_project.yaml
diff --git a/docs/html/distribute/googleplay/_project.yaml b/docs/html/distribute/googleplay/_project.yaml
new file mode 100644
index 0000000..2dfded3
--- /dev/null
+++ b/docs/html/distribute/googleplay/_project.yaml
@@ -0,0 +1,6 @@
+name: "Google Play"
+home_url: /distribute/googleplay/
+description: "The premier store for distributing Android apps and games, with global reach and tools to help you gain traction in the marketplace."
+content_license: cc3-apache2
+buganizer_id: 30209417
+parent_project_metadata_path: /distribute/_project.yaml
diff --git a/docs/html/distribute/monetize/_project.yaml b/docs/html/distribute/monetize/_project.yaml
new file mode 100644
index 0000000..1936be2
--- /dev/null
+++ b/docs/html/distribute/monetize/_project.yaml
@@ -0,0 +1,6 @@
+name: "Earn"
+home_url: /distribute/monetize/
+description: "There are many ways to make money with your apps on Google Play, and we offer a variety of tools to make it easy."
+content_license: cc3-apache2
+buganizer_id: 30209417
+parent_project_metadata_path: /distribute/_project.yaml
diff --git a/docs/html/distribute/stories/_project.yaml b/docs/html/distribute/stories/_project.yaml
new file mode 100644
index 0000000..1c242bb
--- /dev/null
+++ b/docs/html/distribute/stories/_project.yaml
@@ -0,0 +1,6 @@
+name: "Stories"
+home_url: /distribute/stories/
+description: "Android developers, their apps, and their successes with Android and Google Play."
+content_license: cc3-apache2
+buganizer_id: 30209417
+parent_project_metadata_path: /distribute/_project.yaml
diff --git a/docs/html/distribute/tools/_project.yaml b/docs/html/distribute/tools/_project.yaml
new file mode 100644
index 0000000..a034ede
--- /dev/null
+++ b/docs/html/distribute/tools/_project.yaml
@@ -0,0 +1,6 @@
+name: "Tools & Reference"
+home_url: /distribute/tools/
+description: "Here you'll find resources to help you publish your apps and games, acquire users, and monetize your investment."
+content_license: cc3-apache2
+buganizer_id: 30209417
+parent_project_metadata_path: /distribute/_project.yaml
diff --git a/docs/html/distribute/users/_project.yaml b/docs/html/distribute/users/_project.yaml
new file mode 100644
index 0000000..cd7083e
--- /dev/null
+++ b/docs/html/distribute/users/_project.yaml
@@ -0,0 +1,6 @@
+name: "Get Users"
+home_url: /distribute/users/
+description: "There are some common themes from successful Google Play developers. These best practices are critical to your app or game's success."
+content_license: cc3-apache2
+buganizer_id: 30209417
+parent_project_metadata_path: /distribute/_project.yaml
diff --git a/docs/html/google/_project.yaml b/docs/html/google/_project.yaml
new file mode 100644
index 0000000..051e6bc
--- /dev/null
+++ b/docs/html/google/_project.yaml
@@ -0,0 +1,5 @@
+name: "Google Services"
+home_url: /google/
+description: "Take advantage of the latest Google technologies through a single set of APIs, delivered across Android devices worldwide as part of Google Play services."
+content_license: cc3-apache2
+buganizer_id: 30209417
diff --git a/docs/html/google/play/billing/billing_integrate.jd b/docs/html/google/play/billing/billing_integrate.jd
index e666bc6..5d6b3a8 100755
--- a/docs/html/google/play/billing/billing_integrate.jd
+++ b/docs/html/google/play/billing/billing_integrate.jd
@@ -90,7 +90,7 @@
 <li>Select <strong>Google Play Billing Library</strong>.</li>
 <li>Click <strong>Install packages</strong> to complete the download.</li>
 </ol>
-<p>The {@code IInAppBillingService.aidl} file will be installed to {@code &lt;sdk&gt;/extras/google/play_billing/}.</p>
+<p>The {@code IInAppBillingService.aidl} file will be installed to {@code <sdk>/extras/google/play_billing/}.</p>
 
 <p>To add the AIDL to your project:</p>
 
@@ -116,7 +116,7 @@
           <strong>OK</strong>.</li>
 
           <li>Using your operating system file explorer, navigate to
-          {@code &lt;sdk&gt;/extras/google/play_billing/}, copy the
+          {@code <sdk>/extras/google/play_billing/}, copy the
           {@code IInAppBillingService.aidl} file, and paste it into the
           {@code com.android.vending.billing} package in your project.
           </li>
diff --git a/docs/html/google/play/expansion-files.jd b/docs/html/google/play/expansion-files.jd
index 3c01684..cb8f277 100755
--- a/docs/html/google/play/expansion-files.jd
+++ b/docs/html/google/play/expansion-files.jd
@@ -131,7 +131,7 @@
   <dt>{@code main} or {@code patch}</dt>
     <dd>Specifies whether the file is the main or patch expansion file. There can be
 only one main file and one patch file for each APK.</dd>
-  <dt>{@code &lt;expansion-version&gt;}</dt>
+  <dt>{@code <expansion-version>}</dt>
     <dd>This is an integer that matches the version code of the APK with which the expansion is
 <em>first</em> associated (it matches the application's <a
 href="{@docRoot}guide/topics/manifest/manifest-element.html#vcode">{@code android:versionCode}</a>
@@ -139,7 +139,7 @@
     <p>"First" is emphasized because although the Developer Console allows you to
 re-use an uploaded expansion file with a new APK, the expansion file's name does not change&mdash;it
 retains the version applied to it when you first uploaded the file.</p></dd>
-  <dt>{@code &lt;package-name&gt;}</dt>
+  <dt>{@code <package-name>}</dt>
     <dd>Your application's Java-style package name.</dd>
 </dl>
 
@@ -162,9 +162,9 @@
 </pre>
 
 <ul>
-  <li>{@code &lt;shared-storage&gt;} is the path to the shared storage space, available from
+  <li>{@code <shared-storage>} is the path to the shared storage space, available from
 {@link android.os.Environment#getExternalStorageDirectory()}.</li>
-  <li>{@code &lt;package-name&gt;} is your application's Java-style package name, available
+  <li>{@code <package-name>} is your application's Java-style package name, available
 from {@link android.content.Context#getPackageName()}.</li>
 </ul>
 
@@ -470,7 +470,7 @@
 <strong>Finish</strong>.</li>
   <li>Select <strong>File > Project Structure</strong>.</li>
   <li>Select the <em>Properties</em> tab and in <em>Library
-Repository</em>, enter the library from the {@code &lt;sdk&gt;/extras/google/} directory
+Repository</em>, enter the library from the {@code <sdk>/extras/google/} directory
 ({@code play_licensing/} for the License Verification Library or {@code
 play_apk_expansion/downloader_library/} for the Downloader Library).</li>
   <li>Select <strong>OK</strong> to create the new module.</li>
@@ -716,7 +716,7 @@
   </li>
   <li>Start the download by calling the static method {@code
 DownloaderClientMarshaller.startDownloadServiceIfRequired(Context c, PendingIntent
-notificationClient, Class&lt;?> serviceClass)}.
+notificationClient, Class<?> serviceClass)}.
     <p>The method takes the following parameters:</p>
     <ul>
       <li><code>context</code>: Your application's {@link android.content.Context}.</li>
@@ -780,7 +780,7 @@
   </li>
   <li>When the {@code startDownloadServiceIfRequired()} method returns anything <em>other
 than</em> {@code NO_DOWNLOAD_REQUIRED}, create an instance of {@code IStub} by
-calling {@code DownloaderClientMarshaller.CreateStub(IDownloaderClient client, Class&lt;?>
+calling {@code DownloaderClientMarshaller.CreateStub(IDownloaderClient client, Class<?>
 downloaderService)}. The {@code IStub} provides a binding between your activity to the downloader
 service such that your activity receives callbacks about the download progress.
     <p>In order to instantiate your {@code IStub} by calling {@code CreateStub()}, you must pass it
@@ -956,7 +956,7 @@
 depends on the type of file you've used. As discussed in the <a href="#Overview">overview</a>, your
 expansion files can be any kind of file you
 want, but are renamed using a particular <a href="#Filename">file name format</a> and are saved to
-{@code &lt;shared-storage&gt;/Android/obb/&lt;package-name&gt;/}.</p>
+{@code <shared-storage>/Android/obb/<package-name>/}.</p>
 
 <p>Regardless of how you read your files, you should always first check that the external
 storage is available for reading. There's a chance that the user has the storage mounted to a
@@ -1059,7 +1059,7 @@
 
 <p>The Google Market Apk Expansion package includes a library called the APK
 Expansion Zip Library (located in {@code
-&lt;sdk>/extras/google/google_market_apk_expansion/zip_file/}). This is an optional library that
+<sdk>/extras/google/google_market_apk_expansion/zip_file/}). This is an optional library that
 helps you read your expansion
 files when they're saved as ZIP files. Using this library allows you to easily read resources from
 your ZIP expansion files as a virtual file system.</p>
diff --git a/docs/html/google/play/licensing/setting-up.jd b/docs/html/google/play/licensing/setting-up.jd
index 352b79b..11ca4d7 100755
--- a/docs/html/google/play/licensing/setting-up.jd
+++ b/docs/html/google/play/licensing/setting-up.jd
@@ -181,12 +181,12 @@
 <ol>
   <li>Launch the Android SDK Manager, available under the Android Studio Tools menu
 (<strong>Tools > Android > SDK Manager</strong>) or by executing
-{@code &lt;sdk>/tools/android sdk}.</li>
+{@code <sdk>/tools/android sdk}.</li>
   <li>Select and download <strong>Google APIs</strong> for the Android version you'd like to target
 (must be Android 2.2 or higher).</li>
   <li>When the download is complete, open the AVD Manager, available under the Android Studio
 Tools menu (<strong>Tools > Android > AVD Manager</strong>) or by executing
-{@code &lt;sdk>/tools/android avd}.</li>
+{@code <sdk>/tools/android avd}.</li>
   <li>In the <em>Android Virtual Device Manager</em> window, select
 <strong>+ Create Virtual Device</strong> to set the configuration details for the new AVD. </li>
   <li>In the <em>Virtual Device Configuration</em> window, select device hardware, then
@@ -317,7 +317,7 @@
 <strong>File > New > Import Module</strong>.</li>
 <li>In the <em>New Module</em> window, in <em>Source directory</em>, enter the LVL's
 <code>library</code> directory (the directory containing the library's AndroidManifest.xml file)
-as the project root ({@code &lt;sdk>/extras/google/play_licensing/library/AndroidManifest.xml}),
+as the project root ({@code <sdk>/extras/google/play_licensing/library/AndroidManifest.xml}),
 then select <strong>Next</strong>.</li>
 <li>Select <strong>Finish</strong> to import the library module.</li>
 </ol>
diff --git a/docs/html/guide/_project.yaml b/docs/html/guide/_project.yaml
new file mode 100644
index 0000000..d1f8e5e
--- /dev/null
+++ b/docs/html/guide/_project.yaml
@@ -0,0 +1,6 @@
+name: "API Guides"
+home_url: /guide/
+description: "Android provides a rich application framework that allows you to build innovative apps and games for mobile devices in a Java language environment."
+content_license: cc3-apache2
+buganizer_id: 30209417
+parent_project_metadata_path: /develop/_project.yaml
diff --git a/docs/html/guide/components/activities.jd b/docs/html/guide/components/activities.jd
index e757288..9443924 100644
--- a/docs/html/guide/components/activities.jd
+++ b/docs/html/guide/components/activities.jd
@@ -624,8 +624,8 @@
 before making the activity vulnerable to destruction. The system passes this method
 a {@link android.os.Bundle} in which you can save
 state information about the activity as name-value pairs, using methods such as {@link
-android.os.Bundle#putString putString()} and {@link
-android.os.Bundle#putInt putInt()}. Then, if the system kills your application
+android.os.BaseBundle#putString putString()} and {@link
+android.os.BaseBundle#putInt putInt()}. Then, if the system kills your application
 process and the user navigates back to your activity, the system recreates the activity and passes
 the {@link android.os.Bundle} to both {@link android.app.Activity#onCreate onCreate()} and {@link
 android.app.Activity#onRestoreInstanceState onRestoreInstanceState()}. Using either of these
diff --git a/docs/html/guide/practices/compatibility.jd b/docs/html/guide/practices/compatibility.jd
index 83e841c..fb3db84 100644
--- a/docs/html/guide/practices/compatibility.jd
+++ b/docs/html/guide/practices/compatibility.jd
@@ -114,7 +114,7 @@
 
 <p>If necessary, you can prevent users from installing your app when their devices don't provide a
 given feature by declaring it with a <a href=
-"{@docRoot}guide/topics/manifest/uses-feature-element.html">{@code &lt;uses-feature&gt;}</a>
+"{@docRoot}guide/topics/manifest/uses-feature-element.html">{@code <uses-feature>}</a>
 element in your app's <a href="{@docRoot}guide/topics/manifest/manifest-intro.html">manifest
 file</a>.</p>
 
@@ -164,7 +164,7 @@
 on this feature and make your app available to devices without Bluetooth by setting the <a href=
 "{@docRoot}guide/topics/manifest/uses-feature-element.html#required">{@code required}</a> attribute
 to {@code "false"} in the <a href=
-"{@docRoot}guide/topics/manifest/uses-feature-element.html">{@code &lt;uses-feature&gt;}</a> tag.
+"{@docRoot}guide/topics/manifest/uses-feature-element.html">{@code <uses-feature>}</a> tag.
 For more information about implicitly required device features, read <a href=
 "{@docRoot}guide/topics/manifest/uses-feature-element.html#permissions">Permissions that Imply
 Feature Requirements</a>.</p>
@@ -180,7 +180,7 @@
 
 <p>The API level allows you to declare the minimum version with which your app is
 compatible, using the <a href="{@docRoot}guide/topics/manifest/uses-sdk-element.html">{@code
-&lt;uses-sdk>}</a> manifest tag and its
+<uses-sdk>}</a> manifest tag and its
 <a href="{@docRoot}guide/topics/manifest/uses-sdk-element.html#min">{@code minSdkVersion}</a>
 attribute.</p>
 
diff --git a/docs/html/guide/topics/connectivity/bluetooth.jd b/docs/html/guide/topics/connectivity/bluetooth.jd
index 07fcd09..42229fd 100644
--- a/docs/html/guide/topics/connectivity/bluetooth.jd
+++ b/docs/html/guide/topics/connectivity/bluetooth.jd
@@ -1056,7 +1056,7 @@
 object. <p>Similar to regular headset and A2DP profile devices, you must call
 {@link android.bluetooth.BluetoothAdapter#getProfileProxy getProfileProxy()}
 with a {@link android.bluetooth.BluetoothProfile.ServiceListener} and the {@link
-android.bluetooth.BluetoothProfile.ServiceListener#HEALTH} profile type to
+android.bluetooth.BluetoothProfile#HEALTH} profile type to
 establish a connection with the profile proxy object.</p> </li>
 
   <li>Create a {@link android.bluetooth.BluetoothHealthCallback} and register an
diff --git a/docs/html/guide/topics/connectivity/wifip2p.jd b/docs/html/guide/topics/connectivity/wifip2p.jd
index b8eb40e..2bcdf54 100644
--- a/docs/html/guide/topics/connectivity/wifip2p.jd
+++ b/docs/html/guide/topics/connectivity/wifip2p.jd
@@ -117,7 +117,7 @@
 	</tr>
 
 	<tr>
-	  <td>{@link android.net.wifi.p2p.WifiP2pManager.PeerListListener#discoverPeers discoverPeers()}</td>
+	  <td>{@link android.net.wifi.p2p.WifiP2pManager#discoverPeers discoverPeers()}</td>
 	  <td>Initiates peer discovery </td>
 	</tr>
 
@@ -147,7 +147,7 @@
     android.net.wifi.p2p.WifiP2pManager#cancelConnect cancelConnect()}, {@link
     android.net.wifi.p2p.WifiP2pManager#createGroup createGroup()}, {@link
     android.net.wifi.p2p.WifiP2pManager#removeGroup removeGroup()}, and {@link
-    android.net.wifi.p2p.WifiP2pManager.PeerListListener#discoverPeers discoverPeers()}</td>
+    android.net.wifi.p2p.WifiP2pManager#discoverPeers discoverPeers()}</td>
     </tr>
 
     <tr>
@@ -190,8 +190,8 @@
       <tr>
         <td>{@link android.net.wifi.p2p.WifiP2pManager#WIFI_P2P_PEERS_CHANGED_ACTION}</td>
         <td>Broadcast when you call {@link
-    android.net.wifi.p2p.WifiP2pManager.PeerListListener#discoverPeers discoverPeers()}. You
-    usually want to call {@link android.net.wifi.p2p.WifiP2pManager.PeerListListener#requestPeers
+    android.net.wifi.p2p.WifiP2pManager#discoverPeers discoverPeers()}. You
+    usually want to call {@link android.net.wifi.p2p.WifiP2pManager#requestPeers
     requestPeers()} to get an updated list of peers if you handle this intent in your
     application.</td>
       </tr>
diff --git a/docs/html/guide/topics/manifest/activity-element.jd b/docs/html/guide/topics/manifest/activity-element.jd
index f30263e..5ced295 100644
--- a/docs/html/guide/topics/manifest/activity-element.jd
+++ b/docs/html/guide/topics/manifest/activity-element.jd
@@ -25,7 +25,7 @@
           android:<a href="#hwaccel">hardwareAccelerated</a>=["true" | "false"]
           android:<a href="#icon">icon</a>="<i>drawable resource</i>"
           android:<a href="#label">label</a>="<i>string resource</i>"
-          android:<a href="#lmode">launchMode</a>=["multiple" | "singleTop" |
+          android:<a href="#lmode">launchMode</a>=["standard" | "singleTop" |
                               "singleTask" | "singleInstance"]
           android:<a href="#maxRecents">maxRecents</a>="<i>integer</i>"
           android:<a href="#multi">multiprocess</a>=["true" | "false"]
diff --git a/docs/html/guide/topics/manifest/meta-data-element.jd b/docs/html/guide/topics/manifest/meta-data-element.jd
index 2d1bdfe..945b116 100644
--- a/docs/html/guide/topics/manifest/meta-data-element.jd
+++ b/docs/html/guide/topics/manifest/meta-data-element.jd
@@ -60,7 +60,7 @@
 <dt><a name="rsrc"></a>{@code android:resource}</dt>
 <dd>A reference to a resource.  The ID of the resource is the value assigned
 to the item.  The ID can be retrieved from the meta-data Bundle by the
-{@link android.os.Bundle#getInt Bundle.getInt()} method.</dd>
+{@link android.os.BaseBundle#getInt Bundle.getInt()} method.</dd>
 
 <dt><a name="val"></a>{@code android:value}</dt>
 <dd>The value assigned to the item.  The data types that can be assigned as values and the Bundle methods that  components use to retrieve those values are listed in the following table:
@@ -72,17 +72,17 @@
 </tr><tr>
   <td>String value, using double backslashes ({@code \\}) to escape characters
       &mdash; such as "{@code \\n}" and "{@code \\uxxxxx}" for a Unicode character.</td>
-  <td>{@link android.os.Bundle#getString(String) getString()}</td>
+  <td>{@link android.os.BaseBundle#getString(String) getString()}</td>
 </tr><tr>
   <td>Integer value, such as "{@code 100}"</td>
-  <td>{@link android.os.Bundle#getInt(String) getInt()}</td>
+  <td>{@link android.os.BaseBundle#getInt(String) getInt()}</td>
 </tr><tr>
   <td>Boolean value, either "{@code true}" or "{@code false}"</td>
-  <td>{@link android.os.Bundle#getBoolean(String) getBoolean()}</td>
+  <td>{@link android.os.BaseBundle#getBoolean(String) getBoolean()}</td>
 </tr><tr>
   <td>Color value, in the form "{@code #rgb}", "{@code #argb}",
       "{@code #rrggbb}", or "{@code #aarrggbb}"</td>
-  <td>{@link android.os.Bundle#getInt(String) getInt()}</td>
+  <td>{@link android.os.BaseBundle#getInt(String) getInt()}</td>
 </tr><tr>
   <td>Float value, such as "{@code 1.23}"</td>
   <td>{@link android.os.Bundle#getFloat(String) getFloat()}</td>
diff --git a/docs/html/guide/topics/manifest/uses-feature-element.jd b/docs/html/guide/topics/manifest/uses-feature-element.jd
index 0670348..10841d6 100755
--- a/docs/html/guide/topics/manifest/uses-feature-element.jd
+++ b/docs/html/guide/topics/manifest/uses-feature-element.jd
@@ -1149,12 +1149,12 @@
 
     <p>
       As a best practice, you should still declare your requirement for this
-      orientation using a {@code &lt;uses-feature&gt;} element. If you declare
+      orientation using a {@code <uses-feature>} element. If you declare
       an orientation for your activity using <a href=
       "{@docRoot}guide/topics/manifest/activity-element.html#screen">{@code
       android:screenOrientation}</a>, but don't actually require it, you can
       disable the requirement by declaring the orientation with a {@code
-      &lt;uses-feature&gt;} element and include {@code
+      <uses-feature>} element and include {@code
       android:required="false"}.
     </p>
 
diff --git a/docs/html/guide/topics/media/camera.jd b/docs/html/guide/topics/media/camera.jd
index 8b79b23..c806c88 100644
--- a/docs/html/guide/topics/media/camera.jd
+++ b/docs/html/guide/topics/media/camera.jd
@@ -1243,7 +1243,7 @@
 camera application that checks to see if device hardware supports those features and fails
 gracefully if a feature is not available.</p>
 
-<p>You can check the availabilty of camera features by getting an instance of a camera’s parameters
+<p>You can check the availabilty of camera features by getting an instance of a camera's parameters
 object, and checking the relevant methods. The following code sample shows you how to obtain a
 {@link android.hardware.Camera.Parameters} object and check if the camera supports the autofocus
 feature:</p>
@@ -1290,7 +1290,7 @@
 
 <p>This technique works for nearly all camera features, and most parameters can be changed at any
 time after you have obtained an instance of the {@link android.hardware.Camera} object. Changes to
-parameters are typically visible to the user immediately in the application’s camera preview.
+parameters are typically visible to the user immediately in the application's camera preview.
 On the software side, parameter changes may take several frames to actually take effect as the
 camera hardware processes the new instructions and then sends updated image data.</p>
 
@@ -1341,7 +1341,7 @@
 </pre>
 
 <p>The {@link android.hardware.Camera.Area} object contains two data parameters: A {@link
-android.graphics.Rect} object for specifying an area within the camera’s field of view and a weight
+android.graphics.Rect} object for specifying an area within the camera's field of view and a weight
 value, which tells the camera what level of importance this area should be given in light metering
 or focus calculations.</p>
 
@@ -1405,7 +1405,7 @@
 }
 </pre>
 
-<p>After creating this class, you then set it into your application’s
+<p>After creating this class, you then set it into your application's
 {@link android.hardware.Camera} object, as shown in the example code below:</p>
 
 <pre>
@@ -1480,7 +1480,7 @@
 
 <p class="note"><strong>Note:</strong> Remember to call this method <em>after</em> calling
 {@link android.hardware.Camera#startPreview startPreview()}. Do not attempt to start face detection
-in the {@link android.app.Activity#onCreate onCreate()} method of your camera app’s main activity,
+in the {@link android.app.Activity#onCreate onCreate()} method of your camera app's main activity,
 as the preview is not available by this point in your application's the execution.</p>
 
 
diff --git a/docs/html/guide/topics/providers/calendar-provider.jd b/docs/html/guide/topics/providers/calendar-provider.jd
index 485f3c1..01a1bfc 100644
--- a/docs/html/guide/topics/providers/calendar-provider.jd
+++ b/docs/html/guide/topics/providers/calendar-provider.jd
@@ -278,9 +278,9 @@
 
 <div class="sidebox-wrapper"> <div class="sidebox"> <h3>Why must you include
 ACCOUNT_TYPE?</h3> <p>If you query on a {@link
-android.provider.CalendarContract.Calendars#ACCOUNT_NAME
+android.provider.CalendarContract.SyncColumns#ACCOUNT_NAME
 Calendars.ACCOUNT_NAME}, you must also include
-{@link android.provider.CalendarContract.Calendars#ACCOUNT_TYPE Calendars.ACCOUNT_TYPE}
+{@link android.provider.CalendarContract.SyncColumns#ACCOUNT_TYPE Calendars.ACCOUNT_TYPE}
 in the selection. That is because a given account is
 only considered unique given both its <code>ACCOUNT_NAME</code> and its
 <code>ACCOUNT_TYPE</code>. The <code>ACCOUNT_TYPE</code> is the string corresponding to the
diff --git a/docs/html/guide/topics/providers/contacts-provider.jd b/docs/html/guide/topics/providers/contacts-provider.jd
index 2b14558..ac855aa 100644
--- a/docs/html/guide/topics/providers/contacts-provider.jd
+++ b/docs/html/guide/topics/providers/contacts-provider.jd
@@ -329,13 +329,13 @@
 </p>
 <dl>
     <dt>
-        {@link android.provider.ContactsContract.Data#RAW_CONTACT_ID}
+        {@link android.provider.ContactsContract.DataColumns#RAW_CONTACT_ID}
     </dt>
     <dd>
         The value of the <code>_ID</code> column of the raw contact for this data.
     </dd>
     <dt>
-        {@link android.provider.ContactsContract.Data#MIMETYPE}
+        {@link android.provider.ContactsContract.DataColumns#MIMETYPE}
     </dt>
     <dd>
         The type of data stored in this row, expressed as a custom MIME type. The Contacts Provider
@@ -2351,7 +2351,7 @@
     {@link android.provider.ContactsContract.Data} table, selecting on the raw contact's
     {@link android.provider.BaseColumns#_ID}, the
     {@link android.provider.ContactsContract.CommonDataKinds.Photo#CONTENT_ITEM_TYPE
-    Photo.CONTENT_ITEM_TYPE}, and the {@link android.provider.ContactsContract.Data#IS_PRIMARY}
+    Photo.CONTENT_ITEM_TYPE}, and the {@link android.provider.ContactsContract.DataColumns#IS_PRIMARY}
     column to find the raw contact's primary photo row.
 </p>
 <p>
diff --git a/docs/html/guide/topics/renderscript/advanced.jd b/docs/html/guide/topics/renderscript/advanced.jd
index 6a72b97..5cc0556 100644
--- a/docs/html/guide/topics/renderscript/advanced.jd
+++ b/docs/html/guide/topics/renderscript/advanced.jd
@@ -63,7 +63,7 @@
   <code>llvm</code> compiler that runs as part of an Android build. When your application
   runs on a device, the bytecode is then compiled (just-in-time) to machine code by another
   <code>llvm</code> compiler that resides on the device. The machine code is optimized for the
-  device and also cached, so subsequent uses of the RenderScript enabled application does not
+  device and also cached, so subsequent uses of the RenderScript enabled application do not
   recompile the bytecode.</p>
 
   <p>Some key features of the RenderScript runtime libraries include:</p>
@@ -128,7 +128,7 @@
 <h3 id="func">Functions</h3>
 <p>Functions are reflected into the script class itself, located in
 <code>project_root/gen/package/name/ScriptC_renderscript_filename</code>. For
-example, if you declare the following function in your RenderScript code:</p>
+example, if you define the following function in your RenderScript code:</p>
 
 <pre>
 void touch(float x, float y, float pressure, int id) {
@@ -142,7 +142,7 @@
 }
 </pre>
 
-<p>then the following code is generated:</p>
+<p>then the following Java code is generated:</p>
 
 <pre>
 public void invoke_touch(float x, float y, float pressure, int id) {
@@ -155,7 +155,7 @@
 }
 </pre>
 <p>
-Functions cannot have a return value, because the RenderScript system is designed to be
+Functions cannot have return values, because the RenderScript system is designed to be
 asynchronous. When your Android framework code calls into RenderScript, the call is queued and is
 executed when possible. This restriction allows the RenderScript system to function without constant
 interruption and increases efficiency. If functions were allowed to have return values, the call
@@ -171,11 +171,11 @@
 
   <p>Variables of supported types are reflected into the script class itself, located in
 <code>project_root/gen/package/name/ScriptC_renderscript_filename</code>. A set of accessor
-methods are generated for each variable. For example, if you declare the following variable in
+methods is generated for each variable. For example, if you define the following variable in
 your RenderScript code:</p>
   <pre>uint32_t unsignedInteger = 1;</pre>
 
-  <p>then the following code is generated:</p>
+  <p>then the following Java code is generated:</p>
 
 <pre>
 private long mExportVar_unsignedInteger;
@@ -194,7 +194,7 @@
   <p>Structs are reflected into their own classes, located in
     <code>&lt;project_root&gt;/gen/com/example/renderscript/ScriptField_struct_name</code>. This
     class represents an array of the <code>struct</code> and allows you to allocate memory for a
-    specified number of <code>struct</code>s. For example, if you declare the following struct:</p>
+    specified number of <code>struct</code>s. For example, if you define the following struct:</p>
 <pre>
 typedef struct Point {
     float2 position;
@@ -373,7 +373,7 @@
 the array. The RenderScript runtime automatically has access to the newly written memory.
 
       <li>Accessor methods to get and set the values of each field in a struct. Each of these
-        accessor methods have an <code>index</code> parameter to specify the <code>struct</code> in
+        accessor methods has an <code>index</code> parameter to specify the <code>struct</code> in
         the array that you want to read or write to. Each setter method also has a
 <code>copyNow</code> parameter that specifies whether or not to immediately sync this memory
 to the RenderScript runtime. To sync any memory that has not been synced, call
@@ -395,10 +395,10 @@
     </ul>
 
   <h3 id="pointer">Pointers</h3>
-  <p>Pointers are reflected into the script class itself, located in
+  <p>Global pointers are reflected into the script class itself, located in
 <code>project_root/gen/package/name/ScriptC_renderscript_filename</code>. You
 can declare pointers to a <code>struct</code> or any of the supported RenderScript types, but a
-<code>struct</code> cannot contain pointers or nested arrays. For example, if you declare the
+<code>struct</code> cannot contain pointers or nested arrays. For example, if you define the
 following pointers to a <code>struct</code> and <code>int32_t</code></p>
 
 <pre>
@@ -410,7 +410,7 @@
 Point_t *touchPoints;
 int32_t *intPointer;
 </pre>
-  <p>then the following code is generated in:</p>
+  <p>then the following Java code is generated:</p>
 
 <pre>
 private ScriptField_Point mExportVar_touchPoints;
@@ -437,7 +437,7 @@
   </pre>
 
 <p>A <code>get</code> method and a special method named <code>bind_<em>pointer_name</em></code>
-(instead of a <code>set()</code> method) is generated. This method allows you to bind the memory
+(instead of a <code>set()</code> method) are generated. The <code>bind_<em>pointer_name</em></code> method allows you to bind the memory
 that is allocated in the Android VM to the RenderScript runtime (you cannot allocate
 memory in your <code>.rs</code> file). For more information, see <a href="#memory">Working
 with Allocated Memory</a>.
@@ -521,7 +521,7 @@
         describes.</p>
 
         <p>A type consists of five dimensions: X, Y, Z, LOD (level of detail), and Faces (of a cube
-        map). You can assign the X,Y,Z dimensions to any positive integer value within the
+        map). You can set the X,Y,Z dimensions to any positive integer value within the
         constraints of available memory. A single dimension allocation has an X dimension of
         greater than zero while the Y and Z dimensions are zero to indicate not present. For
         example, an allocation of x=10, y=1 is considered two dimensional and x=10, y=0 is
diff --git a/docs/html/guide/topics/renderscript/compute.jd b/docs/html/guide/topics/renderscript/compute.jd
index 861c925..fe68654 100755
--- a/docs/html/guide/topics/renderscript/compute.jd
+++ b/docs/html/guide/topics/renderscript/compute.jd
@@ -294,7 +294,7 @@
 </ul></li>
 
 <li><strong>Populate Allocations with data.</strong> Except for Allocations created with {@link
-android.renderscript#createFromBitmap}, an Allocation will be populated with empty data when it is
+android.renderscript.Allocation#createFromBitmap}, an Allocation will be populated with empty data when it is
 first created. To populate an Allocation, use one of the <code>copy</code> methods in {@link
 android.renderscript.Allocation}.</li>
 
diff --git a/docs/html/guide/topics/search/search-dialog.jd b/docs/html/guide/topics/search/search-dialog.jd
index 4d6b400..8278ab1 100644
--- a/docs/html/guide/topics/search/search-dialog.jd
+++ b/docs/html/guide/topics/search/search-dialog.jd
@@ -699,7 +699,7 @@
     inflater.inflate(R.menu.options_menu, menu);
 
     // Get the SearchView and set the searchable configuration
-    SearchManager searchManager = (SearchManager) {@link android.app.Activity#getSystemService getSystemService}(Context.SEARCH_SERVICE);
+    SearchManager searchManager = (SearchManager) {@link android.app.Activity#getSystemService(java.lang.String) getSystemService()}(Context.SEARCH_SERVICE);
     SearchView searchView = (SearchView) menu.findItem(R.id.menu_search).getActionView();
     // Assumes current activity is the searchable activity
     searchView.setSearchableInfo(searchManager.getSearchableInfo({@link android.app.Activity#getComponentName()}));
diff --git a/docs/html/guide/topics/ui/accessibility/apps.jd b/docs/html/guide/topics/ui/accessibility/apps.jd
index 26fb3cc..c415762 100644
--- a/docs/html/guide/topics/ui/accessibility/apps.jd
+++ b/docs/html/guide/topics/ui/accessibility/apps.jd
@@ -160,7 +160,7 @@
 {@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
 provided by the Android framework are focusable by default and visually indicate focus by changing
-the control’s appearance.</p>
+the control's appearance.</p>
 
 <p>Android provides several APIs that let you control whether a user interface control is focusable
 and even request that a control be given focus:</p>
@@ -298,7 +298,7 @@
 dispatchPopulateAccessibilityEvent()} method for each child of this view. In order to support
 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
+android.view.accessibility.AccessibilityRecord#getText} with descriptive text for your custom
 view, which is spoken by accessibility services, such as TalkBack.</dd>
 
   <dt>{@link android.view.View#onPopulateAccessibilityEvent onPopulateAccessibilityEvent()}</dt>
@@ -436,7 +436,7 @@
 <h3 id="populate-events">Populating accessibility events</h3>
 
 <p>Each {@link android.view.accessibility.AccessibilityEvent} has a set of required properties that
-describe the current state of the view. These properties include things such as the view’s class
+describe the current state of the view. These properties include things such as the view's class
 name, content description and checked state. The specific properties required for each event type
 are described in the {@link android.view.accessibility.AccessibilityEvent} reference documentation.
 The {@link android.view.View} implementation provides default values for these properties. Many of
diff --git a/docs/html/guide/topics/ui/accessibility/services.jd b/docs/html/guide/topics/ui/accessibility/services.jd
index f91a979..d08022e 100644
--- a/docs/html/guide/topics/ui/accessibility/services.jd
+++ b/docs/html/guide/topics/ui/accessibility/services.jd
@@ -124,7 +124,7 @@
 &lt;/service&gt;
 </pre>
 
-<p>This meta-data element refers to an XML file that you create in your application’s resource
+<p>This meta-data element refers to an XML file that you create in your application's resource
 directory ({@code <project_dir>/res/xml/accessibility_service_config.xml}). The following code
 shows example contents for the service configuration file:</p>
 
@@ -205,7 +205,7 @@
 while it is running ({@link android.accessibilityservice.AccessibilityService#onAccessibilityEvent
 onAccessibilityEvent()},
 {@link android.accessibilityservice.AccessibilityService#onInterrupt onInterrupt()}) to when it is
-shut down ({@link android.accessibilityservice.AccessibilityService#onUnbind onUnbind()}).</p>
+shut down ({@link android.app.Service#onUnbind onUnbind()}).</p>
 
 <ul>
   <li>{@link android.accessibilityservice.AccessibilityService#onServiceConnected
@@ -231,7 +231,7 @@
 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)
+  <li>{@link android.app.Service#onUnbind onUnbind()} - (optional)
 This method is called when the system is about to shutdown the accessibility service. Use this
 method to do any one-time shutdown procedures, including de-allocating user feedback system
 services, such as the audio manager or device vibrator.</li>
@@ -267,7 +267,7 @@
 accessibility services to provide more useful feedback to users.</p>
 
 <p>An accessibility service gets information about an user interface event through an {@link
-android.view.accessibility.AccessibilityEvent} passed by the system to the service’s
+android.view.accessibility.AccessibilityEvent} passed by the system to the service's
 {@link android.accessibilityservice.AccessibilityService#onAccessibilityEvent
 onAccessibilityEvent()} callback method. This object provides details about the event, including the
 type of object being acted upon, its descriptive text and other details. Starting in Android 4.0
@@ -283,7 +283,7 @@
 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
+  <li>{@link android.view.accessibility.AccessibilityRecord#getSource
 AccessibilityEvent.getSource()} - This method returns an {@link
 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.
@@ -296,10 +296,10 @@
 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>
+android.view.accessibility.AccessibilityRecord#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,
+{@link android.view.accessibility.AccessibilityRecord#getSource getSource()} method,
 as well as {@link android.view.accessibility.AccessibilityNodeInfo#getChild
 AccessibilityNodeInfo.getChild()} and
 {@link android.view.accessibility.AccessibilityNodeInfo#getParent getParent()}, return only
@@ -335,7 +335,7 @@
   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#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.
@@ -372,7 +372,7 @@
   <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()}.
+  {@link android.view.accessibility.AccessibilityRecord#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>
diff --git a/docs/html/guide/topics/ui/declaring-layout.jd b/docs/html/guide/topics/ui/declaring-layout.jd
index bf0db57..ecdcfdc 100755
--- a/docs/html/guide/topics/ui/declaring-layout.jd
+++ b/docs/html/guide/topics/ui/declaring-layout.jd
@@ -423,7 +423,7 @@
   <li>The string array</li>
 </ul>
 <p>Then simply call
-{@link android.widget.ListView#setAdapter setAdapter()} on your {@link android.widget.ListView}:</p>
+{@link android.widget.AdapterView#setAdapter setAdapter()} on your {@link android.widget.ListView}:</p>
 <pre>
 ListView listView = (ListView) findViewById(R.id.listview);
 listView.setAdapter(adapter);
diff --git a/docs/html/guide/topics/ui/dialogs.jd b/docs/html/guide/topics/ui/dialogs.jd
index 7ab4ca5..52cd1a0 100644
--- a/docs/html/guide/topics/ui/dialogs.jd
+++ b/docs/html/guide/topics/ui/dialogs.jd
@@ -643,7 +643,7 @@
 or other {@link android.app.Dialog} objects to build the dialog in this case. If
 you want the {@link android.support.v4.app.DialogFragment} to be
 embeddable, you must define the dialog's UI in a layout, then load the layout in the
-{@link android.support.v4.app.DialogFragment#onCreateView
+{@link android.support.v4.app.Fragment#onCreateView
 onCreateView()} callback.</p>
 
 <p>Here's an example {@link android.support.v4.app.DialogFragment} that can appear as either a
diff --git a/docs/html/guide/topics/ui/index.jd b/docs/html/guide/topics/ui/index.jd
index ccdf200..7dbc015 100644
--- a/docs/html/guide/topics/ui/index.jd
+++ b/docs/html/guide/topics/ui/index.jd
@@ -13,7 +13,7 @@
 
     <a href="http://android-developers.blogspot.com/2012/01/say-goodbye-to-menu-button.html">
       <h4>Say Goodbye to the Menu Button</h4>
-      <p>As Ice Cream Sandwich rolls out to more devices, it’s important that you begin to migrate
+      <p>As Ice Cream Sandwich rolls out to more devices, it's important that you begin to migrate
 your designs to the action bar in order to promote a consistent Android user experience.</p> </a>
 
     <a href="http://android-developers.blogspot.com/2011/11/new-layout-widgets-space-and-gridlayout.html">
@@ -29,7 +29,7 @@
     <a href="http://android-developers.blogspot.com/2011/08/horizontal-view-swiping-with-viewpager.html">
       <h4>Horizontal View Swiping with ViewPager</h4>
       <p>Whether you have just started out in Android app development or are a veteran of the craft,
-it probably won’t be too long before you’ll need to implement horizontally scrolling sets of views.
+it probably won't be too long before you'll need to implement horizontally scrolling sets of views.
 </p> </a>
   </div>
 
diff --git a/docs/html/guide/topics/ui/layout/gridview.jd b/docs/html/guide/topics/ui/layout/gridview.jd
index 13467ae..4ed6ff5 100644
--- a/docs/html/guide/topics/ui/layout/gridview.jd
+++ b/docs/html/guide/topics/ui/layout/gridview.jd
@@ -81,7 +81,7 @@
   <p>After the {@code main.xml} layout is set for the content view, the
 {@link android.widget.GridView} is captured from the layout with {@link
 android.app.Activity#findViewById(int)}. The {@link
-android.widget.GridView#setAdapter(T) setAdapter()} method then sets a custom adapter ({@code
+android.widget.AdapterView#setAdapter(T) setAdapter()} method then sets a custom adapter ({@code
 ImageAdapter}) as the source for all items to be displayed in the grid. The {@code ImageAdapter} is
 created in the next step.</p>
 <p>To do something when an item in the grid is clicked, the {@link
@@ -170,7 +170,7 @@
 image is resized and cropped to fit in these dimensions, as appropriate.</li>
   <li>{@link android.widget.ImageView#setScaleType(ImageView.ScaleType)} declares that images should
 be cropped toward the center (if necessary).</li>
-  <li>{@link android.widget.ImageView#setPadding(int,int,int,int)} defines the padding for all
+  <li>{@link android.view.View#setPadding(int,int,int,int)} defines the padding for all
 sides. (Note that, if the images have different aspect-ratios, then less
 padding will cause more cropping of the image if it does not match
 the dimensions given to the ImageView.)</li>
diff --git a/docs/html/guide/topics/ui/menus.jd b/docs/html/guide/topics/ui/menus.jd
index 73dec20..38f6e21 100644
--- a/docs/html/guide/topics/ui/menus.jd
+++ b/docs/html/guide/topics/ui/menus.jd
@@ -132,7 +132,7 @@
 element may contain a nested <code>&lt;menu></code> element in order to create a submenu.</dd>
 
   <dt><code>&lt;group></code></dt>
-    <dd>An optional, invisible container for {@code &lt;item&gt;} elements. It allows you to
+    <dd>An optional, invisible container for {@code <item>} elements. It allows you to
 categorize menu items so they share properties such as active state and visibility. For more
 information, see the section about <a href="#groups">Creating Menu Groups</a>.</dd>
 </dl>
@@ -172,8 +172,8 @@
 For information about all the supported attributes, see the <a
 href="{@docRoot}guide/topics/resources/menu-resource.html">Menu Resource</a> document.</p>
 
-<p>You can add a submenu to an item in any menu (except a submenu) by adding a {@code &lt;menu&gt;}
-element as the child of an {@code &lt;item&gt;}. Submenus are useful when your application has a lot
+<p>You can add a submenu to an item in any menu (except a submenu) by adding a {@code <menu>}
+element as the child of an {@code <item>}. Submenus are useful when your application has a lot
 of functions that can be organized into topics, like items in a PC application's menu bar (File,
 Edit, View, etc.). For example:</p>
 
@@ -230,7 +230,7 @@
 the right side of the app bar (or by pressing the device <em>Menu</em> button, if available). To
 enable
 quick access to important actions, you can promote a few items to appear in the app bar by adding
-{@code android:showAsAction="ifRoom"} to the corresponding {@code &lt;item&gt;} elements (see figure
+{@code android:showAsAction="ifRoom"} to the corresponding {@code <item>} elements (see figure
 2). <p>For more information about action items and other app bar behaviors, see the <a
 href="{@docRoot}training/appbar/index.html">Adding the App Bar</a> training class. </p>
 </li>
@@ -246,7 +246,7 @@
 declare items for the options menu, they are combined in the UI. The activity's items appear
 first, followed by those of each fragment in the order in which each fragment is added to the
 activity. If necessary, you can re-order the menu items with the {@code android:orderInCategory}
-attribute in each {@code &lt;item&gt;} you need to move.</p>
+attribute in each {@code <item>} you need to move.</p>
 
 <p>To specify the options menu for an activity, override {@link
 android.app.Activity#onCreateOptionsMenu(Menu) onCreateOptionsMenu()} (fragments provide their
@@ -682,7 +682,7 @@
 </pre>
 
 <p>That's it. Now when the user selects an item with a long-click, the system calls the {@link
-android.widget.AbsListView.MultiChoiceModeListener#onCreateActionMode onCreateActionMode()}
+android.view.ActionMode.Callback#onCreateActionMode onCreateActionMode()}
 method and displays the contextual action bar with the specified actions. While the contextual
 action bar is visible, users can select additional items.</p>
 
@@ -814,7 +814,7 @@
 android.view.Menu#setGroupCheckable(int,boolean,boolean) setGroupCheckable()}</li>
 </ul>
 
-<p>You can create a group by nesting {@code &lt;item&gt;} elements inside a {@code &lt;group&gt;}
+<p>You can create a group by nesting {@code <item>} elements inside a {@code <group>}
 element in your menu resource or by specifying a group ID with the {@link
 android.view.Menu#add(int,int,int,int) add()} method.</p>
 
@@ -863,8 +863,8 @@
 each time the state changes.</p>
 
 <p>You can define the checkable behavior for individual menu items using the {@code
-android:checkable} attribute in the {@code &lt;item&gt;} element, or for an entire group with
-the {@code android:checkableBehavior} attribute in the {@code &lt;group&gt;} element. For
+android:checkable} attribute in the {@code <item>} element, or for an entire group with
+the {@code android:checkableBehavior} attribute in the {@code <group>} element. For
 example, all items in this menu group are checkable with a radio button:</p>
 
 <pre>
@@ -890,7 +890,7 @@
 </dl>
 
 <p>You can apply a default checked state to an item using the {@code android:checked} attribute in
-the {@code &lt;item&gt;} element and change it in code with the {@link
+the {@code <item>} element and change it in code with the {@link
 android.view.MenuItem#setChecked(boolean) setChecked()} method.</p>
 
 <p>When a checkable item is selected, the system calls your respective item-selected callback method
diff --git a/docs/html/guide/topics/ui/settings.jd b/docs/html/guide/topics/ui/settings.jd
index 9e304a3..619fd26 100644
--- a/docs/html/guide/topics/ui/settings.jd
+++ b/docs/html/guide/topics/ui/settings.jd
@@ -943,8 +943,8 @@
 
 <p>The Android framework includes a variety of {@link android.preference.Preference} subclasses that
 allow you to build a UI for several different types of settings.
-However, you might discover a setting you need for which there’s no built-in solution, such as a
-number picker or date picker. In such a case, you’ll need to create a custom preference by extending
+However, you might discover a setting you need for which there's no built-in solution, such as a
+number picker or date picker. In such a case, you'll need to create a custom preference by extending
 the {@link android.preference.Preference} class or one of the other subclasses.</p>
 
 <p>When you extend the {@link android.preference.Preference} class, there are a few important
diff --git a/docs/html/preview/_project.yaml b/docs/html/preview/_project.yaml
new file mode 100644
index 0000000..3ec851a
--- /dev/null
+++ b/docs/html/preview/_project.yaml
@@ -0,0 +1,5 @@
+name: "Preview"
+home_url: /preview/
+description: "Android N final SDK is now available."
+content_license: cc3-apache2
+buganizer_id: 30209417
diff --git a/docs/html/preview/features/background-optimization.jd b/docs/html/preview/features/background-optimization.jd
index 3e4c041..326513b 100644
--- a/docs/html/preview/features/background-optimization.jd
+++ b/docs/html/preview/features/background-optimization.jd
@@ -379,7 +379,7 @@
 
   <li style="list-style: none; display: inline">
 <pre class="no-pretty-print">
-{@code $ adb shell cmd appops set &lt;package_name&gt; RUN_IN_BACKGROUND ignore}
+{@code $ adb shell cmd appops set <package_name> RUN_IN_BACKGROUND ignore}
 </pre>
   </li>
 
@@ -389,7 +389,7 @@
 
   <li style="list-style: none; display: inline">
 <pre class="no-pretty-print">
-{@code $ adb shell cmd appops set &lt;package_name&gt; RUN_IN_BACKGROUND allow}
+{@code $ adb shell cmd appops set <package_name> RUN_IN_BACKGROUND allow}
 </pre>
   </li>
 </ul>
diff --git a/docs/html/reference/_project.yaml b/docs/html/reference/_project.yaml
new file mode 100644
index 0000000..e5c26e7
--- /dev/null
+++ b/docs/html/reference/_project.yaml
@@ -0,0 +1,6 @@
+name: "Reference"
+home_url: /reference/
+description: "API Reference packages and classes."
+content_license: cc3-apache2
+buganizer_id: 30209417
+parent_project_metadata_path: /develop/_project.yaml
diff --git a/docs/html/samples/_project.yaml b/docs/html/samples/_project.yaml
new file mode 100644
index 0000000..ede5958
--- /dev/null
+++ b/docs/html/samples/_project.yaml
@@ -0,0 +1,6 @@
+name: "Samples"
+home_url: /samples/
+description: "Welcome to code samples where you can browse sample code and learn how to build different components for your applications."
+content_license: cc3-apache2
+buganizer_id: 30209417
+parent_project_metadata_path: /develop/_project.yaml
diff --git a/docs/html/topic/instant-apps/_project.yaml b/docs/html/topic/instant-apps/_project.yaml
new file mode 100644
index 0000000..e6b8cd9
--- /dev/null
+++ b/docs/html/topic/instant-apps/_project.yaml
@@ -0,0 +1,6 @@
+name: "Android Instant Apps"
+home_url: /topic/instant-apps/
+description: "An evolution in app sharing and discovery, Android Instant Apps enables Android apps to run instantly, without requiring installation."
+content_license: cc3-apache2
+buganizer_id: 30209417
+parent_project_metadata_path: /develop/_project.yaml
diff --git a/docs/html/topic/libraries/_project.yaml b/docs/html/topic/libraries/_project.yaml
new file mode 100644
index 0000000..cdf59e5
--- /dev/null
+++ b/docs/html/topic/libraries/_project.yaml
@@ -0,0 +1,6 @@
+name: "Android Libraries"
+home_url: /topic/libraries/
+description: "This section describes several useful Android libraries that are not included with the Android Framework."
+content_license: cc3-apache2
+buganizer_id: 30209417
+parent_project_metadata_path: /develop/_project.yaml
diff --git a/docs/html/topic/libraries/support-library/revisions.jd b/docs/html/topic/libraries/support-library/revisions.jd
index 7e78925..3b25fb0 100644
--- a/docs/html/topic/libraries/support-library/revisions.jd
+++ b/docs/html/topic/libraries/support-library/revisions.jd
@@ -6,9 +6,34 @@
 <p>This page provides details about the Support Library package releases.</p>
 
 <div class="toggle-content opened">
-  <p id="rev24-1-0">
+  <p id="rev24-1-1">
     <a href="#" onclick="return toggleContent(this)"><img src=
     "{@docRoot}assets/images/styles/disclosure_up.png" class=
+    "toggle-content-img" alt="">Android Support Library, revision 24.1.1</a>
+    <em>(July 2016)</em>
+  </p>
+
+  <div class="toggle-content-toggleme">
+
+    <p>Fixed issues:</p>
+
+    <ul>
+      <li>Fixes an issue in the 24.1.0 release which affected resource IDs
+      shared between support libraries. This issue caused apps that depended on
+      support libraries with resources (such as design and appcompat) to
+      encounter issues caused by resource ID mismatches.
+      </li>
+    </ul>
+
+  </div>
+</div>
+
+<!-- end of collapsible section: 24.1.1 -->
+
+<div class="toggle-content closed">
+  <p id="rev24-1-0">
+    <a href="#" onclick="return toggleContent(this)"><img src=
+    "{@docRoot}assets/images/styles/disclosure_down.png" class=
     "toggle-content-img" alt="">Android Support Library, revision 24.1.0</a>
     <em>(July 2016)</em>
   </p>
@@ -935,7 +960,7 @@
           <li style="list-style: none; display: inline">
             <ul>
               <li>Day and night themes can be found here: {@code
-              &lt;sdk&gt;/extras/android/support/v7/appcompat/res/values/themes_daynight.xml}
+              <sdk>/extras/android/support/v7/appcompat/res/values/themes_daynight.xml}
               </li>
 
               <li>{@code AppCompatDelegate.setDefaultNightMode()}: sets the
@@ -2781,7 +2806,7 @@
 <a href="{@docRoot}design/index.html">Android Design</a> guidelines for navigation. These
 additions include a way to implement the action bar's <em>Up</em> button across versions.
 For an example implementation of this pattern, see the AppNavigation sample in
-({@code <em>&lt;sdk&gt;</em>/samples/<em>&lt;platform&gt;</em>/AppNavigation}).</li>
+({@code <em><sdk></em>/samples/<em><platform></em>/AppNavigation}).</li>
           <li>Added {@link android.support.v4.app.NotificationCompat.Builder} to provide a
 compatibility implementation of Android 3.0's {@link android.app.Notification.Builder} helper class
 for creating standardized system notifications.</li>
diff --git a/docs/html/topic/libraries/support-library/setup.jd b/docs/html/topic/libraries/support-library/setup.jd
index 62f7148..5e33851 100755
--- a/docs/html/topic/libraries/support-library/setup.jd
+++ b/docs/html/topic/libraries/support-library/setup.jd
@@ -72,7 +72,7 @@
 
 <p>After downloading, the tool installs the Support Library files to your existing Android SDK
   directory. The library files are located in the following subdirectory of your SDK:
-  {@code &lt;sdk&gt;/extras/android/support/} directory.</p>
+  {@code <sdk>/extras/android/support/} directory.</p>
 
 
 <h2 id="choosing">Choosing Support Libraries</h2>
@@ -233,9 +233,9 @@
 SDK installation directory, as listed below:</p>
 
 <ul>
-  <li>4v Samples: {@code &lt;sdk&gt;/extras/android/support/samples/Support4Demos/}</li>
-  <li>7v Samples: {@code &lt;sdk&gt;/extras/android/support/samples/Support7Demos/}</li>
-  <li>13v Samples: {@code &lt;sdk&gt;/extras/android/support/samples/Support13Demos/}</li>
-  <li>App Navigation: {@code &lt;sdk&gt;/extras/android/support/samples/SupportAppNavigation/}</li>
+  <li>4v Samples: {@code <sdk>/extras/android/support/samples/Support4Demos/}</li>
+  <li>7v Samples: {@code <sdk>/extras/android/support/samples/Support7Demos/}</li>
+  <li>13v Samples: {@code <sdk>/extras/android/support/samples/Support13Demos/}</li>
+  <li>App Navigation: {@code <sdk>/extras/android/support/samples/SupportAppNavigation/}</li>
 </ul>
 
diff --git a/docs/html/topic/performance/_project.yaml b/docs/html/topic/performance/_project.yaml
new file mode 100644
index 0000000..d4202a9
--- /dev/null
+++ b/docs/html/topic/performance/_project.yaml
@@ -0,0 +1,6 @@
+name: "Performance"
+home_url: /topic/performance/
+description: "Improve your app's performance by learning how to optimize power consumption, launch times, and other important areas of performance."
+content_license: cc3-apache2
+buganizer_id: 30209417
+parent_project_metadata_path: /develop/_project.yaml
diff --git a/docs/html/training/_book.yaml b/docs/html/training/_book.yaml
index 00f9295..0e2083a 100644
--- a/docs/html/training/_book.yaml
+++ b/docs/html/training/_book.yaml
@@ -1363,6 +1363,11 @@
     path_attributes:
     - name: description
       value: How to ensure that your app is secure when performing network transactions.
+  - title: Network Security Configuration
+    path: /training/articles/security-config.html
+    path_attributes:
+    - name: description
+      value: Customize the behavior of your app's secure network connections safely.
   - title: Updating Your Security Provider to Protect Against SSL Exploits
     path: /training/articles/security-gms-provider.html
     path_attributes:
@@ -1373,6 +1378,11 @@
     path_attributes:
     - name: description
       value: How to use the SafetyNet service to analyze a device where your app is running and get information about its compatibility with your app.
+  - title: Verifying Hardware-backed Key Pairs with Key Attestation
+    path: /training/articles/security-key-attestation.html
+    path_attributes:
+    - name: description
+      value: How to retrieve and verify the properties of a device's hardware-backed key pair.
   - title: Enhancing Security with Device Management Policies
     path: /work/device-management-policy.html
     path_attributes:
diff --git a/docs/html/training/_project.yaml b/docs/html/training/_project.yaml
new file mode 100644
index 0000000..6aa8760
--- /dev/null
+++ b/docs/html/training/_project.yaml
@@ -0,0 +1,6 @@
+name: "Training"
+home_url: /training/
+description: "Android Training provides a collection of classes that aim to help you build great apps for Android."
+content_license: cc3-apache2
+buganizer_id: 30209417
+parent_project_metadata_path: /develop/_project.yaml
diff --git a/docs/html/training/accessibility/service.jd b/docs/html/training/accessibility/service.jd
index 9935c97..de00db7 100755
--- a/docs/html/training/accessibility/service.jd
+++ b/docs/html/training/accessibility/service.jd
@@ -174,7 +174,7 @@
 In that method, use {@link
 android.view.accessibility.AccessibilityEvent#getEventType} to determine the
 type of event, and {@link
-android.view.accessibility.AccessibilityEvent#getContentDescription} to extract
+android.view.accessibility.AccessibilityRecord#getContentDescription} to extract
 any label text associated with the view that fired the event.</pre>
 
 <pre>
@@ -211,7 +211,7 @@
 </pre>
 <p>Once that's done, get an {@link
 android.view.accessibility.AccessibilityNodeInfo} object using {@link
-android.view.accessibility.AccessibilityEvent#getSource}.  This call only
+android.view.accessibility.AccessibilityRecord#getSource}.  This call only
 returns an object if the window where the event originated is still the active
 window.  If not, it will return null, so <em>behave accordingly</em>.  The
 following example is a snippet of code that, when it receives an event, does
diff --git a/docs/html/training/articles/perf-anr.jd b/docs/html/training/articles/perf-anr.jd
index 2eda4fa..8848354 100644
--- a/docs/html/training/articles/perf-anr.jd
+++ b/docs/html/training/articles/perf-anr.jd
@@ -146,7 +146,7 @@
 
 <p>If you implement {@link java.lang.Thread} or {@link android.os.HandlerThread},
 be sure that your UI thread does not block while waiting for the worker thread to
-complete&mdash;do not call {@link java.lang.Thread#wait Thread.wait()} or
+complete&mdash;do not call {@link java.lang.Object#wait Thread.wait()} or
 {@link java.lang.Thread#sleep Thread.sleep()}. Instead of blocking while waiting for a worker
 thread to complete, your main thread should provide a {@link
 android.os.Handler} for the other threads to post back to upon completion.
diff --git a/docs/html/preview/features/security-config.jd b/docs/html/training/articles/security-config.jd
similarity index 77%
rename from docs/html/preview/features/security-config.jd
rename to docs/html/training/articles/security-config.jd
index 2706ced..90a93fa 100644
--- a/docs/html/preview/features/security-config.jd
+++ b/docs/html/training/articles/security-config.jd
@@ -1,11 +1,12 @@
 page.title=Network Security Configuration
-page.keywords=androidn,security,network
+page.keywords=security,network,config
+page.metaDescription=Feature that allows app developers to customize network security settings in a safe configuration file.
 page.image=images/cards/card-nyc_2x.jpg
 
 @jd:body
 
-<div id="qv-wrapper">
-<div id="qv">
+<div id="tb-wrapper">
+<div id="tb">
 
 <h2>In this document</h2>
 <ol>
@@ -28,11 +29,10 @@
 
 
 <p>
-  Android N includes a Network Security Configuration
-  feature that lets apps customize their network security settings in a safe,
-  declarative configuration file without modifying app code. These settings can
-  be configured for specific domains and for a specific app. The key
-  capabilities of this feature are as follows:
+  The Network Security Configuration feature lets apps customize their network
+  security settings in a safe, declarative configuration file without modifying
+  app code. These settings can be configured for specific domains and for a
+  specific app. The key capabilities of this feature are as follows:
 </p>
 
 <ul>
@@ -49,7 +49,7 @@
   </li>
 
   <li>
-    <b>Cleartext traffic opt-out:</b> Protect apps from from
+    <b>Cleartext traffic opt-out:</b> Protect apps from
     accidental usage of cleartext traffic.
   </li>
 
@@ -72,10 +72,10 @@
 <pre>
 &lt;?xml version="1.0" encoding="utf-8"?&gt;
 &lt;manifest ... &gt;
-  &lt;application android:networkSecurityConfig="@xml/network_security_config"
-               ... &gt;
-    ...
-  &lt;/application&gt;
+    &lt;application android:networkSecurityConfig="@xml/network_security_config"
+                    ... &gt;
+        ...
+    &lt;/application&gt;
 &lt;/manifest&gt;
 </pre>
 
@@ -87,12 +87,12 @@
 </p>
 
 <ul>
-  <li>Connecting to a host with a custom certificate authority(self-signed,
-  issued by an internal corporate CA, etc).
+  <li>Connecting to a host with a custom certificate authority, such as a
+  CA that is self-signed or is issued internally within a company.
   </li>
 
   <li>Limiting the set of CAs to only the CAs you trust instead of every
-  preinstalled CA.
+  pre-installed CA.
   </li>
 
   <li>Trusting additional CAs not included in the system.
@@ -100,12 +100,11 @@
 </ul>
 
 <p>
-  By default secure (e.g. TLS, HTTPS) connections from all apps trust
-  the pre-installed system CAs, and apps targeting API level 23
-  (Android M) and below also trust the user-added CA store by default. An
-  app can customize its own connections using {@code base-config} (for
-  app-wide customization) or {@code domain-config} (for per-domain
-  customization).
+  By default, secure connections (using protocols like TLS and HTTPS) from all
+  apps trust the pre-installed system CAs, and apps targeting Android 6.0 (API
+  level 23) and lower also trust the user-added CA store by default. An app can
+  customize its own connections using {@code base-config} (for app-wide
+  customization) or {@code domain-config} (for per-domain customization).
 </p>
 
 
@@ -147,8 +146,8 @@
 </p>
 
 <p>
-  The config to limit the set of trusted CAs is similar to <a href=
-  "#TrustingACustomCa">trusting a custom CA</a> for a specific domain except
+  The configuration to limit the set of trusted CAs is similar to <a href=
+  "#ConfigCustom">trusting a custom CA</a> for a specific domain except
   that multiple CAs are provided in the resource.
 </p>
 
@@ -207,14 +206,14 @@
 <h2 id="TrustingDebugCa">Configuring CAs for Debugging</h2>
 
 <p>
-  When debugging an app that connects over HTTPS you may want to
+  When debugging an app that connects over HTTPS, you may want to
   connect to a local development server, which does not have the SSL
   certificate for your production server. In order to support this without any
-  modification to your app's code you can specify debug-only CAs that
-  are <i>only</i> trusted when <a href=
+  modification to your app's code, you can specify debug-only CAs, which
+  are trusted <i>only</i> when <a href=
   "{@docRoot}guide/topics/manifest/application-element.html#debug">
 android:debuggable</a>
-  is {@code true} by using {@code debug-overrides}. Normally IDEs and build
+  is {@code true}, by using {@code debug-overrides}. Normally, IDEs and build
   tools set this flag automatically for non-release builds.
 </p>
 
@@ -243,7 +242,7 @@
 
 <p>
   Applications intending to connect to destinations using only secure
-  connections can opt-out of supporting cleartext (using unencrypted HTTP
+  connections can opt-out of supporting cleartext (using the unencrypted HTTP
   protocol instead of HTTPS) to those destinations. This option helps prevent
   accidental regressions in apps due to changes in URLs provided by external
   sources such as backend servers.
@@ -273,29 +272,30 @@
 <h2 id="CertificatePinning">Pinning Certificates</h2>
 
 <p>
-  Normally an app trusts all preinstalled CAs. If any of these CAs were
-  to issue a fradulent certificate the app would be at risk from a MiTM
-  attack. Some apps choose to limit the set of certificates they accept
-  by either limiting the set of CAs they trust or by certificate pinning.
+  Normally, an app trusts all pre-installed CAs. If any of these CAs were to
+  issue a fradulent certificate, the app would be at risk from a
+  man-in-the-middle attack. Some apps choose to limit the set of certificates
+  they accept by either limiting the set of CAs they trust or by certificate
+  pinning.
 </p>
 
 <p>
   Certificate pinning is done by providing a set of certificates by hash of the
-  public key (SubjectPublicKeyInfo of the X.509 certificate). A certificate
-  chain is then only valid if the certificate chain contains at least one of
-  the pinned public keys.
+  public key (<code>SubjectPublicKeyInfo</code> of the X.509 certificate). A
+  certificate chain is then valid only if the certificate chain contains at
+  least one of the pinned public keys.
 </p>
 
 <p>
-  Note that when using certificate pinning you should always include a backup
-  key so that if you are forced to switch to new keys, or change CAs (when
+  Note that, when using certificate pinning, you should always include a backup
+  key so that if you are forced to switch to new keys or change CAs (when
   pinning to a CA certificate or an intermediate of that CA), your
-  app's connectivity is unaffected. Otherwise you must to push out
+  app's connectivity is unaffected. Otherwise, you must push out
   an update to the app to restore connectivity.
 </p>
 
 <p>
-  Additionally it is possible to set an expiration time for pins after which
+  Additionally, it is possible to set an expiration time for pins after which
   pinning is not performed. This helps prevent connectivity issues in
   apps which have not been updated. However, setting an expiration time
   on pins may enable pinning bypass.
@@ -322,24 +322,24 @@
 <h2 id="ConfigInheritance">Configuration Inheritance Behavior</h2>
 
 <p>
-  Values not set in a specific config are inherited. This behavior allows more
-  complex configurations while keeping the configuration file readable.
+  Values not set in a specific configuration are inherited. This behavior allows
+  more complex configurations while keeping the configuration file readable.
 </p>
 
 <p>
-  If a value is not set in a specific entry then value from the next more
-  general entry is used. Values not set in a {@code domain-config} is
-  taken from the parent {@code domain-config}, if nested, or from the {@code
-  base-config} if not. Values not set in the {@code base-config} uses the
+  If a value is not set in a specific entry, then the value from the more
+  general entry is used. For example, values not set in a {@code domain-config}
+  are taken from the parent {@code domain-config}, if nested, or from the {@code
+  base-config} if not. Values not set in the {@code base-config} use the
   platform default values.
 </p>
 
 <p>
-  For example consider, where all connections to subdomains of {@code
-  example.com} must use a custom set of CAs. Additonally cleartext traffic to
+  For example, consider where all connections to subdomains of {@code
+  example.com} must use a custom set of CAs. Additonally, cleartext traffic to
   these domains is permitted <em>except</em> when connecting to {@code
   secure.example.com}. By nesting the configuration for {@code
-  secure.example.com} inside the configuration for {@code example.com} the
+  secure.example.com} inside the configuration for {@code example.com}, the
   {@code trust-anchors} does not need to be duplicated.
 </p>
 
@@ -458,7 +458,8 @@
 
 <p>
   Any values that are not set use the platform default values. The default
-  configuration for apps targeting above API level 24 and above:
+  configuration for apps targeting Android 7.0 (API level 24) and higher is as
+  follows:
 </p>
 
 <pre>
@@ -468,7 +469,8 @@
     &lt;/trust-anchors&gt;
 &lt;/base-config&gt;
 </pre>
-The default configuration for apps targeting API level 23 and below is:
+The default configuration for apps targeting Android 6.0 (API level 23) and
+lower is as follows:
 <pre>
 &lt;base-config cleartextTrafficPermitted="true"&gt;
     &lt;trust-anchors&gt;
@@ -499,13 +501,14 @@
 <br/>Any number of nested <code>&lt;domain-config&gt;</code></dd>
 
 <dt>Description</dt>
-<dd>Configuration used for connections to specific destinations as the defined by {@code domain} elements.
+<dd>Configuration used for connections to specific destinations, as defined by
+the {@code domain} elements.
 
-<p>Note that if multiple {@code domain-config} elements cover a destination the config with the most specific (longest)
-matching domain rule is used.</p></dd>
+<p>Note that if multiple {@code domain-config} elements cover a destination, the
+configuration with the most specific (longest) matching domain rule is
+used.</p></dd>
 </dl>
 
-
 <h3 id="domain">&lt;domain&gt;</h3>
 
 <dl class="xml">
@@ -530,8 +533,8 @@
       </dt>
 
       <dd>
-        If {@code "true"} then this domain rule matches the domain and all
-        subdomains, including subdomains of subdomains, otherwise the rule only
+        If {@code "true"}, then this domain rule matches the domain and all
+        subdomains, including subdomains of subdomains. Otherwise, the rule only
         applies to exact matches.
       </dd>
     </dl>
@@ -572,13 +575,13 @@
   <dd>
     Overrides to be applied when <a href=
     "{@docRoot}guide/topics/manifest/application-element.html#debug">android:debuggable</a>
-    is {@code "true"} which is normally the case for non-release builds
+    is {@code "true"}, which is normally the case for non-release builds
     generated by IDEs and build tools. Trust anchors specified in {@code
-    debug-overrides} are added to all other configurations and certificate
+    debug-overrides} are added to all other configurations, and certificate
     pinning is not performed when the server's certificate chain uses one of
     these debug-only trust anchors. If <a href=
     "{@docRoot}guide/topics/manifest/application-element.html#debug">android:debuggable</a>
-    is {@code "false"} then this section is completely ignored.
+    is {@code "false"}, then this section is completely ignored.
   </dd>
 </dl>
 
@@ -627,11 +630,11 @@
 <dd><dl class="attr">
 <dt>{@code src}</dt>
 <dd>
-The source of CA certificates, can be one of
+The source of CA certificates. Each certificate can be one of the following:
 <ul>
-  <li>a raw resource id pointing to a file containing X.509 certificates.
+  <li>a raw resource ID pointing to a file containing X.509 certificates.
   Certificates must be encoded in DER or PEM format. In the case of PEM
-  certificates the file <em>must not</em> contain extra non-PEM data such as
+  certificates, the file <em>must not</em> contain extra non-PEM data such as
   comments.
   </li>
 
@@ -647,9 +650,9 @@
 <dd>
   <p>
     Specifies if the CAs from this source bypass certificate pinning. If {@code
-    "true"} then certificate chains which chain through one of the CAs from this
-    source then pinning is not be performed. This can be useful for debug CAs
-    or to support letting the user MiTM your app's secure traffic.
+    "true"}, then pinning is not performed on certificate chains which are
+    signed by one of the CAs from this source. This can be useful for debugging
+    CAs or for testing man-in-the-middle attacks on your app's secure traffic.
   </p>
 
   <p>
@@ -705,13 +708,12 @@
       </dt>
 
       <dd>
-        The date, in {@code yyyy-MM-dd} format, at and after which the pins
-        expire, thus disabling pinning. If the attribute is not set then the
-        pins do not expire.
+        The date, in {@code yyyy-MM-dd} format, on which the pins expire, thus
+        disabling pinning. If the attribute is not set, then the pins do not
+        expire.
         <p>
-          Expiration helps prevent connectivity issues in apps which do
-          not get updates to their pin set, for example because the user
-          disabled app updates.
+          Expiration helps prevent connectivity issues in apps which do not get
+          updates to their pin set, such as when the user disables app updates.
         </p>
       </dd>
     </dl>
@@ -742,7 +744,7 @@
       </dt>
 
       <dd>
-        The digest algorithm used to generate the pin. Currently only
+        The digest algorithm used to generate the pin. Currently, only
         {@code "SHA-256"} is supported.
       </dd>
     </dl>
diff --git a/docs/html/preview/features/key-attestation.jd b/docs/html/training/articles/security-key-attestation.jd
similarity index 92%
rename from docs/html/preview/features/key-attestation.jd
rename to docs/html/training/articles/security-key-attestation.jd
index 5be6dfa..9145d30 100644
--- a/docs/html/preview/features/key-attestation.jd
+++ b/docs/html/training/articles/security-key-attestation.jd
@@ -1,11 +1,11 @@
 page.title=Key Attestation
-page.metaDescription=New support in Android N for verifying security properties of hardware-backed keys.
-page.keywords="android N", "security", "TEE", "hardware-backed", "keystore", "certificate", "key attestation"
+page.metaDescription=A tool for verifying security properties of hardware-backed key pairs.
+page.keywords="security", "TEE", "hardware-backed", "keystore", "certificate", "key attestation"
 
 @jd:body
 
-<div id="qv-wrapper">
-  <div id="qv">
+<div id="tb-wrapper">
+  <div id="tb">
     <h2>In this document</h2>
       <ol>
         <li><a href="#verifying">Retrieving and Verifying a Hardware-backed Key Pair</a></li>
@@ -22,14 +22,14 @@
 </p>
 
 <p class="note">
-  <strong>Note: </strong>Only a small number of devices running Android N
-  support hardware-level key attestation; all other devices running Android N
-  use software-level key attestation instead. Before you verify the properties
-  of a device's hardware-backed keys in a production-level environment, you
-  should make sure that the device supports hardware-level key attestation. To
-  do so, you should check that the attestation certificate chain contains a root
-  certificate that is signed by the Google attestation root key and that the
-  <code>attestationSecurityLevel</code> element within the <a
+  <strong>Note: </strong>Only a small number of devices running Android 7.0 (API
+  level 24) support hardware-level key attestation; all other devices running
+  Android 7.0 use software-level key attestation instead. Before you verify the
+  properties of a device's hardware-backed keys in a production-level
+  environment, you should make sure that the device supports hardware-level key
+  attestation. To do so, you should check that the attestation certificate chain
+  contains a root certificate that is signed by the Google attestation root key
+  and that the <code>attestationSecurityLevel</code> element within the <a
   href="#certificate_schema_keydescription">key description</a> data structure
   is set to the TrustedEnvironment security level.
 </p>
@@ -45,15 +45,17 @@
 </p>
 
 <p>
-  The root certificate within this chain is signed using an attestation key,
-  which the device manufacturer injects into the device’s hardware-backed
-  keystore at the factory.
+  If the device supports hardware-level key attestation, the root certificate
+  within this chain is signed using an attestation root key, which the device
+  manufacturer injects into the device’s hardware-backed keystore at the
+  factory.
 </p>
 
 <p class="note">
-  <strong>Note:</strong> On devices that ship with Android N and Google Play
-  services, the root certificate is issued by Google. You should verify that
-  this root certificate appears within Google’s list of root certificates.
+  <strong>Note:</strong> On devices that ship with hardware-level key
+  attestation, Android 7.0 (API level 24), and Google Play services, the root
+  certificate is signed by the Google attestation root key. You should verify
+  that this root certificate appears within Google’s list of root certificates.
 </p>
 
 <p>
@@ -231,7 +233,7 @@
   </dd>
 
   <dt>
-    <code>attestationSecurity</code>
+    <code>attestationSecurityLevel</code>
   </dt>
 
   <dd>
@@ -242,8 +244,8 @@
 
     <p class="caution">
       <strong>Warning:</strong> Although it is possible to attest keys that are
-      stored in the Android system&mdash;that is, if the
-      <code>attestationSecurity</code> value is set to Software&mdash;you
+      stored in the Android system&mdash;that is, if the value of
+      <code>attestationSecurityLevel</code> is set to Software&mdash;you
       cannot trust these attestations if the Android system becomes compromised.
     </p>
   </dd>
@@ -259,7 +261,7 @@
   </dd>
 
   <dt>
-    <code>keymasterSecurity</code>
+    <code>keymasterSecurityLevel</code>
   </dt>
 
   <dd>
@@ -357,7 +359,8 @@
 <p>
   Each field name corresponds to a similarly-named Keymaster tag. For example,
   the <code>keySize</code> field in an authorization list corresponds to the
-  <code>KM_TAG_KEY_SIZE</code> Keymaster tag.
+  <a href="https://source.android.com/security/keystore/implementer-ref.html#km_tag_key_size">
+  <code>KM_TAG_KEY_SIZE</code></a> Keymaster tag.
 </p>
 
 <p>
@@ -780,7 +783,7 @@
   <dd>
     The month and year associated with the security patch that is currently
     installed on the device, specified as a six-digit integer. For example, the
-    June 2016 patch is represented as 201606.
+    August 2016 patch is represented as 201608.
   </dd>
 </dl>
 
diff --git a/docs/html/training/auto/testing/index.jd b/docs/html/training/auto/testing/index.jd
index c93012f..e3e2d86 100644
--- a/docs/html/training/auto/testing/index.jd
+++ b/docs/html/training/auto/testing/index.jd
@@ -523,7 +523,7 @@
 
 <ol>
 <li>Install the Android Media Browser simulator
-({@code &lt;sdk&gt;/extras/google/simulators/media-browser-simulator.apk}) on
+({@code <sdk>/extras/google/simulators/media-browser-simulator.apk}) on
 the test device. You can do this using
 the <a href="{@docRoot}tools/help/adb.html#move">adb</a> command line tool.</li>
 <li>Enable <a href="{@docRoot}tools/device.html#developer-device-options">
@@ -540,7 +540,7 @@
 
 <ol>
 <li>Install the Android Messaging simulator
-  ({@code &lt;sdk&gt;/extras/google/simulators/messaging-simulator.apk})
+  ({@code <sdk>/extras/google/simulators/messaging-simulator.apk})
 on the test device. You can do this using the
 <a href="{@docRoot}tools/help/adb.html#move">adb</a> command line tool.</li>
 <li>Enable the simulator to read notifications posted on the system:
diff --git a/docs/html/training/backup/autosyncapi.jd b/docs/html/training/backup/autosyncapi.jd
index 0e2a9a9..e0df7bb 100644
--- a/docs/html/training/backup/autosyncapi.jd
+++ b/docs/html/training/backup/autosyncapi.jd
@@ -257,7 +257,7 @@
 <a href="{@docRoot}guide/topics/manifest/application-element.html">app manifest</a>. If your app
 used this legacy approach, you can transition to full-data backups by adding the
 {@code android:fullBackupOnly="true"} attribute to the
-<a href="{@docRoot}guide/topics/manifest/application-element.html">{@code &lt;application/&gt;}</a>
+<a href="{@docRoot}guide/topics/manifest/application-element.html">{@code <application/>}</a>
 element in the manifest. When running on a device with Android 5.1
 (API level 22) or lower, your app ignores this value in the manifest, and continues performing
 backups in the previous manner.</p>
@@ -349,7 +349,7 @@
 <pre>$ adb shell bmgr wipe &lt;TRANSPORT&gt; &lt;PACKAGE&gt;</pre>
 
 <p>
-  You must prepend <code>com.google.android.gms</code> to the {@code &lt;TRANSPORT&gt;} value.
+  You must prepend <code>com.google.android.gms</code> to the {@code <TRANSPORT>} value.
   To get the list of <a href="{@docRoot}google/backup/index.html">transports</a>, execute the
   following command:
 </p>
diff --git a/docs/html/training/basics/firstapp/building-ui.jd b/docs/html/training/basics/firstapp/building-ui.jd
index 275500c..a680c73 100644
--- a/docs/html/training/basics/firstapp/building-ui.jd
+++ b/docs/html/training/basics/firstapp/building-ui.jd
@@ -71,38 +71,31 @@
 <h2 id="LinearLayout">Create a Linear Layout</h2>
 
 <ol>
-<li>In Android Studio, from the <code>res/layout</code> directory, open the {@code content_my.xml}
-file.
-<p>The BlankActivity template you chose when you created this project includes the
-<code>content_my.xml</code> file with a {@link android.widget.RelativeLayout} root view and a
-{@link android.widget.TextView} child view.</p>
-</li>
-<li>In the <strong>Preview</strong> pane, click the Hide icon <img src="{@docRoot}images/tools/as-hide-side.png"
-  style="vertical-align:baseline;margin:0; max-height:1.5em" /> to close the Preview pane.
-  <p> In Android Studio, when you open a layout file, you’re first shown
-    the Preview pane. Clicking elements in this pane opens the WYSIWYG tools in the Design pane. For
-    this lesson, you’re going to work directly with the XML.</p></li>
-<li>Delete the {@link android.widget.TextView &lt;TextView>} element.</li>
-<li>Change the {@link android.widget.RelativeLayout &lt;RelativeLayout>} element to
-{@link android.widget.LinearLayout &lt;LinearLayout>}.</li>
-<li>Add the <a href="{@docRoot}reference/android/widget/LinearLayout.html#attr_android:orientation">
-{@code android:orientation}</a> attribute and set it to <code>"horizontal"</code>.</li>
-<li>Remove the {@code android:padding} attributes and the {@code tools:context} attribute.
-</ol>
-
-<p>The result looks like this:</p>
-
-<pre>
-&lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
-    xmlns:app="http://schemas.android.com/apk/res-auto"
+  <li>From the <code>res/layout/</code> directory, open the
+    <code>activity_main.xml</code> file.
+    <p>This XML file defines the layout of your activity. It contains the
+      default "Hello World" text view.</p>
+  </li>
+  <li>When you open a layout file, you’re first shown the design editor in the
+    <a href="/studio/write/layout-editor.html">Layout Editor</a>. For this lesson,
+    you work directly with the XML, so click the <b>Text</b> tab to switch to
+    the text editor.
+  </li>
+  <li>Replace the contents of the file with the following XML:
+    <pre>&lt;?xml version="1.0" encoding="utf-8"?&gt;
+&lt;LinearLayout
+    xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:tools="http://schemas.android.com/tools"
-    android:orientation="horizontal"
     android:layout_width="match_parent"
     android:layout_height="match_parent"
-    app:layout_behavior="@string/appbar_scrolling_view_behavior"
-    tools:showIn="@layout/activity_my"&gt;
+    android:orientation="horizontal"&gt;
+&lt;/LinearLayout&gt;
 </pre>
 
+  </li>
+
+</ol>
+
 <p>{@link android.widget.LinearLayout} is a view group (a subclass of {@link
 android.view.ViewGroup}) that lays out child views in either a vertical or horizontal orientation,
 as specified by the <a
@@ -128,29 +121,25 @@
 
 <h2 id="TextInput">Add a Text Field</h2>
 
-<p>As with every {@link android.view.View} object, you must define certain XML attributes to specify
-the {@link android.widget.EditText} object's properties.</p>
+<p>In the <code>activity_main.xml</code> file, within the
+{@link android.widget.LinearLayout &lt;LinearLayout>} element, add the following
+{@link android.widget.EditText &lt;EditText>} element:</p>
 
-<ol>
-<li>In the <code>content_my.xml</code> file, within the
-{@link android.widget.LinearLayout &lt;LinearLayout>} element, define an
-{@link android.widget.EditText &lt;EditText>} element with the <code>id</code> attribute
-set to <code>@+id/edit_message</code>.</li>
-<li>Define the <code>layout_width</code> and <code>layout_height</code> attributes as
-<code>wrap_content</code>.</li>
-<li>Define a <code>hint</code> attribute as a string object named <code>edit_message</code>.</li>
-</ol>
-
-<p>The {@link android.widget.EditText &lt;EditText>} element should read as follows:</p>
-
-<pre>
-&lt;EditText android:id="@+id/edit_message"
-    android:layout_width="wrap_content"
-    android:layout_height="wrap_content"
-    android:hint="@string/edit_message" />
+<pre>&lt;LinearLayout
+    xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:tools="http://schemas.android.com/tools"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    android:orientation="horizontal"&gt;
+    <b>&lt;EditText android:id="@+id/edit_message"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:hint="@string/edit_message" /></b>
+&lt;/LinearLayout&gt;
 </pre>
 
-<p>Here are the {@link android.widget.EditText &lt;EditText>} attributes you added:</p>
+<p>Here is a description of the attributes in the
+  {@link android.widget.EditText &lt;EditText>} you added:</p>
 
 <dl>
 <dt><a href="{@docRoot}reference/android/view/View.html#attr_android:id">{@code android:id}</a></dt>
@@ -222,29 +211,20 @@
 <h2 id="Strings">Add String Resources</h2>
 
 <p>By default, your Android project includes a string resource file at
-<code>res/values/strings.xml</code>. Here, you'll add a new string named
-<code>"edit_message"</code> and set the value to "Enter a message."</p>
+<code>res/values/strings.xml</code>. Here, you'll add two new strings.</p>
 
 <ol>
-<li>In Android Studio, from the <code>res/values</code> directory, open <code>strings.xml</code>.</li>
-<li>Add a line for a string named <code>"edit_message"</code> with the value, "Enter a message".
-</li>
-<li>Add a line for a string named <code>"button_send"</code> with the value, "Send".
-<p>You'll create the button that uses this string in the next section.</p>
-</li>
-</ol>
-
-<p>The result for <code>strings.xml</code> looks like this:</p>
-
-<pre>
-&lt;?xml version="1.0" encoding="utf-8"?>
+<li>From the <code>res/values/</code> directory, open <code>strings.xml</code>.</li>
+<li>Add two strings so that your file looks like this:
+<pre>&lt;?xml version="1.0" encoding="utf-8"?>
 &lt;resources>
     &lt;string name="app_name">My First App&lt;/string>
-    &lt;string name="edit_message">Enter a message&lt;/string>
-    &lt;string name="button_send">Send&lt;/string>
-    &lt;string name="action_settings">Settings&lt;/string>
+    <b>&lt;string name="edit_message">Enter a message&lt;/string>
+    &lt;string name="button_send">Send&lt;/string></b>
 &lt;/resources>
 </pre>
+</li>
+</ol>
 
 <p>For text in the user interface, always specify each string as
 a resource. String resources allow you to manage all UI text in a single location,
@@ -260,40 +240,22 @@
 
 <h2 id="Button">Add a Button</h2>
 
-<ol>
-<li>In Android Studio, from the <code>res/layout</code> directory, edit the <code>content_my.xml</code>
-file.</li>
-<li>Within the
-{@link android.widget.LinearLayout &lt;LinearLayout>} element, define a
-{@link android.widget.Button &lt;Button>} element immediately following the
-{@link android.widget.EditText &lt;EditText>} element.</li>
-<li>Set the button's width and height attributes to <code>"wrap_content"</code> so
-the button is only as big as necessary to fit the button's text label.</li>
-<li>Define the button's text label with the <a
-href="{@docRoot}reference/android/widget/TextView.html#attr_android:text">{@code
-android:text}</a> attribute; set its value to the <code>button_send</code> string
-resource you defined in the previous section.</li>
-</ol>
-
-<p>Your {@link android.widget.LinearLayout &lt;LinearLayout>} should look like this:</p>
-
-<pre>
-&lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
-    xmlns:app="http://schemas.android.com/apk/res-auto"
+<p>Go back to the <code>activity_main.xml</code> file and add a button after the
+  {@link android.widget.EditText &lt;EditText>}. Your file should look like this:</p>
+<pre>&lt;LinearLayout
+    xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:tools="http://schemas.android.com/tools"
     android:orientation="horizontal"
     android:layout_width="match_parent"
-    android:layout_height="match_parent"
-    app:layout_behavior="@string/appbar_scrolling_view_behavior"
-    tools:showIn="@layout/activity_my"&gt;
+    android:layout_height="match_parent"&gt;
         &lt;EditText android:id="@+id/edit_message"
           android:layout_width="wrap_content"
           android:layout_height="wrap_content"
           android:hint="@string/edit_message" /&gt;
-        &lt;Button
+        <b>&lt;Button
           android:layout_width="wrap_content"
           android:layout_height="wrap_content"
-          android:text="@string/button_send" /&gt;
+          android:text="@string/button_send" /&gt;</b>
 &lt;/LinearLayout&gt;
 </pre>
 
@@ -302,7 +264,7 @@
 attribute, because it won't be referenced from the activity code.</p>
 
 <p>The layout is currently designed so that both the {@link android.widget.EditText} and {@link
-android.widget.Button} widgets are only as big as necessary to fit their content, as Figure 2 shows.
+android.widget.Button} widgets are only as big as necessary to fit their content, as figure 2 shows.
 </p>
 
 <img src="{@docRoot}images/training/firstapp/edittext_wrap.png" />
@@ -334,53 +296,36 @@
 
 <h2 id="Weight">Make the Input Box Fill in the Screen Width</h2>
 
-<p>To fill the remaining space in your layout with the {@link android.widget.EditText} element, do
-the following:</p>
-
-<ol>
-<li>In the <code>content_my.xml</code> file, assign the
-{@link android.widget.EditText &lt;EditText>} element's <code>layout_weight</code> attribute a value
-of <code>1</code>.</li>
-<li>Also, assign {@link android.widget.EditText &lt;EditText>} element's <code>layout_width</code>
-attribute a value of <code>0dp</code>.
+<p>In <code>activity_main.xml</code>, modify the
+  {@link android.widget.EditText &lt;EditText>} so that the attributes look like
+  this:</p>
 
 <pre>
-&lt;EditText
-    android:layout_weight="1"
-    android:layout_width="0dp"
-    ... /&gt;
+&lt;EditText android:id="@+id/edit_message"
+    <b>android:layout_weight="1"
+    android:layout_width="0dp"</b>
+    android:layout_height="wrap_content"
+    android:hint="@string/edit_message" /&gt;
 </pre>
 
-<p>To improve the layout efficiency when you specify the weight, you should change the
-width of the {@link android.widget.EditText} to be
-zero (0dp). Setting the width to zero improves layout performance because using
+<p>Setting the width to zero (0dp) improves layout performance because using
 <code>"wrap_content"</code> as the width requires the system to calculate a width that is
 ultimately irrelevant because the weight value requires another width calculation to fill the
 remaining space.</p>
 
-<p>Figure 3
-shows the result when you assign all weight to the {@link android.widget.EditText} element.</p>
-
 <img src="{@docRoot}images/training/firstapp/edittext_gravity.png" />
 <p class="img-caption"><strong>Figure 3.</strong> The {@link android.widget.EditText} widget is
 given all the layout weight, so it fills the remaining space in the {@link
 android.widget.LinearLayout}.</p>
 
-</li>
-</ol>
+<p>Here’s how your complete <code>activity_main.xml</code>layout file should now look:</p>
 
-<p>Here’s how your complete <code>content_my.xml</code>layout file should now look:</p>
-
-<pre>
-&lt;?xml version="1.0" encoding="utf-8"?>
+<pre>&lt;?xml version="1.0" encoding="utf-8"?&gt;
 &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
-   xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:orientation="horizontal"
    android:layout_width="match_parent"
-   android:layout_height="match_parent"
-   app:layout_behavior="@string/appbar_scrolling_view_behavior"
-   tools:showIn="@layout/activity_my"&gt;
+   android:layout_height="match_parent"&gt;
     &lt;EditText android:id="@+id/edit_message"
         android:layout_weight="1"
         android:layout_width="0dp"
@@ -406,7 +351,4 @@
 
 <p>Continue to the <a href="starting-activity.html">next
 lesson</a> to learn how to respond to button presses, read content
-from the text field, start another activity, and more.</p>
-
-
-
+from the text field, start another activity, and more.</p>
\ No newline at end of file
diff --git a/docs/html/training/basics/firstapp/creating-project.jd b/docs/html/training/basics/firstapp/creating-project.jd
index 4c2155b..cad32bf 100644
--- a/docs/html/training/basics/firstapp/creating-project.jd
+++ b/docs/html/training/basics/firstapp/creating-project.jd
@@ -14,36 +14,19 @@
 <div id="tb-wrapper">
 <div id="tb">
 
-<h2>This lesson teaches you to</h2>
-
-<ol>
-  <li><a href="#Studio">Create a Project with Android Studio</a></li>
-</ol>
-
 <h2>You should also read</h2>
 
 <ul>
-  <li><a href="{@docRoot}tools/projects/index.html">Managing Projects</a></li>
+  <li><a href="{@docRoot}studio/projects/index.html">Projects Overview</a></li>
 </ul>
 
 
 </div>
 </div>
 
-<p>An Android project contains all the files that comprise the source code for your Android
-app.</p>
-
-<p>This lesson
-shows how to create a new project either using Android Studio or using the
-SDK tools from a command line.</p>
-
-<p class="note"><strong>Note:</strong> You should already have Android Studio or the Android SDK
-command-line tools installed. If not, <a
-href="{@docRoot}studio/index.html">download them</a> before you start this
-lesson.</p>
-
-
-<h2 id="Studio">Create a Project with Android Studio</h2>
+<p>This lesson shows you how to create a new Android project with
+  <a href="{@docRoot}studio/index.html">Android Studio</a> and describes some
+  of the files in the project.</p>
 
 <ol>
   <li>In Android Studio, create a new project:
@@ -54,11 +37,12 @@
         Project</strong>. The <em>Create New Project</em> screen appears.</li>
     </ul>
   </li>
-  <li>Fill out the fields on the screen, and click <strong>Next</strong>.
-    <p>It is easier to follow these lessons if you use the same values as shown.</p>
+  <li>Fill out the fields on the screen. For <strong>Application Name</strong>
+    use "My First App". For <strong>Company Domain</strong>, use "example.com".
+    For the other fields, use the default values and click <strong>Next</strong>
+    <p>Here's a brief explanation of each field:</p>
     <ul>
-      <li><strong>Application Name</strong> is the app name that appears to users.
-          For this project, use "My First App."</li>
+      <li><strong>Application Name</strong> is the app name that appears to users.</li>
       <li><strong>Company domain</strong> provides a qualifier that will be appended to the package
         name; Android Studio will remember this qualifier for each new project you create.</li>
       <li><strong>Package name</strong> is the fully qualified name for the project (following the
@@ -70,9 +54,8 @@
         files.</li>
     </ul>
   </li>
-  <li>Under <strong>Select the form factors your app will run on</strong>, check the box for <strong>
-    Phone and Tablet</strong>.</li>
-  <li>For <strong>Minimum SDK</strong>, select <strong>API 8: Android 2.2 (Froyo)</strong>.
+  <li>Under <strong>Target Android Devices</strong>, accept the default values
+    and click <strong>Next</strong>.
     <p>The Minimum Required SDK is the earliest version of Android that your app supports,
       indicated using the <a href="{@docRoot}guide/topics/manifest/uses-sdk-element.html#ApiLevels">
       API level</a>. To support as many devices as possible, you should set this to the lowest
@@ -80,8 +63,13 @@
       app is possible only on newer versions of Android and it's not critical to the app's core
       feature set, you can enable the feature only when running on the versions that support it (as
       discussed in <a href="{@docRoot}training/basics/supporting-devices/platforms.html">
-      Supporting Different Platform Versions</a>).</p></li>
-  <li>Leave all of the other options (TV, Wear, and Glass) unchecked and click <strong>Next.</strong></li>
+      Supporting Different Platform Versions</a>).</p>
+    </li>
+
+  <li>Under <strong>Add an Activity to Mobile</strong>, select <strong>Empty
+    Activity</strong> and click <strong>Next</strong>.
+  </li>
+
   <div class="sidebox-wrapper">
     <div class="sidebox">
       <h3>Activities</h3>
@@ -93,43 +81,25 @@
         Activities</a> for more information.</p>
     </div>
   </div>
-  <li>Under <strong>Add an activity to &lt;<em>template</em>&gt;</strong>,
-  select <strong>Basic Activity</strong> and click <strong>Next</strong>.
-  </li>
 
-  <li>Under <strong>Customize the Activity</strong>, change the
-  <strong>Activity Name</strong> to <em>MyActivity</em>. The <strong>Layout
-  Name</strong> changes to <em>activity_my</em>, and the <strong>Title</strong>
-  to <em>MyActivity</em>. The <strong>Menu Resource Name</strong> is
-  <em>menu_my</em>.
-  </li>
-
-  <li>Click the <strong>Finish</strong> button to create the project.
-  </li>
+  <li>Under <strong>Customize the Activity</strong>, accept the default values
+    and click <strong>Finish</strong>.
 </ol>
 
 <p>Your Android project is now a basic "Hello World" app that contains some default files. Take a
 moment to review the most important of these:</p>
 
 <dl>
-  <dt><code>app/src/main/res/layout/activity_my.xml</code></dt>
-  <dd>This XML layout file is for the activity you added when you created the project
-  with Android Studio. Following the New Project workflow, Android Studio presents this file
-  with both a text
-    view and a preview of the screen UI. The file contains some default interface elements
-    from the material design library, including the
-    <a href="{@docRoot}training/appbar/index.html">app bar</a> and a floating action button.
-    It also includes a separate layout file with the main content.</dd>
+  <dt><code>app/src/main/java/com.example.myfirstapp/MainActivity.java</code></dt>
+  <dd>This file appears in Android Studio after the New Project wizard finishes.
+    It contains the class definition for the activity you created earlier. When you build
+    and run the app, the {@link android.app.Activity} starts and loads the
+    layout file that says "Hello World!"</dd>
 
-  <dt><code>app/src/main/res/layout/content_my.xml</code></dt>
-  <dd>This XML layout file resides in {@code activity_my.xml}, and contains some settings and
-  a {@code TextView} element that displays the message, "Hello world!".</dd>
+  <dt><code>app/src/main/res/layout/activity_main.xml</code></dt>
+  <dd>This XML file defines the layout of the activity. It contains a {@code TextView}
+    element with the text "Hello world!".</dd>
 
-  <dt><code>app/src/main/java/com.mycompany.myfirstapp/MyActivity.java</code></dt>
-  <dd>A tab for this file appears in Android Studio when the New Project workflow finishes. When you
-    select the file you see the class definition for the activity you created. When you build and
-    run the app, the {@link android.app.Activity} class starts the activity and loads the layout file
-    that says "Hello World!"</dd>
   <dt><code>app/src/main/AndroidManifest.xml</code></dt>
   <dd>The <a href="{@docRoot}guide/topics/manifest/manifest-intro.html">manifest file</a> describes
     the fundamental characteristics of the app and defines each of its components. You'll revisit
@@ -143,15 +113,15 @@
     <ul>
       <li><code>compiledSdkVersion</code> is the platform version against which you will compile
         your app. By default, this is set to the latest version of Android available in your SDK.
-        (It should be Android 4.1 or greater; if you don't have such a version available, you must
-        install one using the <a href="{@docRoot}studio/intro/update.html">SDK Manager</a>.)
+        By default, this is set to the latest version of Android SDK installed on your
+        development machine.
         You can still build your app to support older versions, but setting this to the latest
         version allows you to enable new features and optimize your app for a great user experience
         on the latest devices.</li>
       <li><code>applicationId</code> is the fully qualified package name for your application that
-        you specified during the New Project workflow.</li>
+        you specified in the New Project wizard.</li>
       <li><code>minSdkVersion</code> is the Minimum SDK version you specified during the New Project
-        workflow. This is the earliest version of the Android SDK that your app supports.</li>
+        wizard. This is the earliest version of the Android SDK that your app supports.</li>
       <li><code>targetSdkVersion</code> indicates the highest version of Android with which you have
         tested your application. As new versions of Android become available, you should
         test your app on the new version and update this value to match the latest API level and
@@ -172,8 +142,8 @@
     for various <a href="{@docRoot}training/multiscreen/screendensities.html">densities</a>.
 </dd>
   <dt><code>layout/</code></dt>
-    <dd>Directory for files that define your app's user interface like {@code activity_my.xml},
-      discussed above, which describes a basic layout for the {@code MyActivity}
+    <dd>Directory for files that define your app's user interface like {@code activity_main.xml},
+      discussed above, which describes a basic layout for the {@code MainActivity}
       class.</dd>
   <dt><code>menu/</code></dt>
     <dd>Directory for files that define your app's menu items.</dd>
diff --git a/docs/html/training/basics/firstapp/index.jd b/docs/html/training/basics/firstapp/index.jd
index cb5073f..48b7190 100644
--- a/docs/html/training/basics/firstapp/index.jd
+++ b/docs/html/training/basics/firstapp/index.jd
@@ -23,25 +23,10 @@
 
 <p>Welcome to Android application development!</p>
 
-<p>This class teaches you how to build your first Android app. You’ll learn how to create an Android
-project and run a debuggable version of the app. You'll also learn some fundamentals of Android app
-design, including how to build a simple user interface and handle user input.</p>
+<p>This class teaches you how to build your first Android app. You’ll learn how
+  to create an Android project with Android Studio and run a debuggable version
+  of the app. You'll also learn some fundamentals of Android app design,
+  including how to build a simple user interface and handle user input.</p>
 
-<h2>Set Up Your Environment</h2>
-
-<p>Before you start this class, be sure you have your development environment set up. You need
-to:</p>
-<ol>
-  <li>Download <a href="{@docRoot}studio/index.html">Android Studio</a>.</li>
-  <li>Download the latest SDK tools and platforms using the
-  <a href="{@docRoot}tools/help/sdk-manager.html">SDK Manager</a>.</li>
-</ol>
-
-<p class="note"><strong>Note:</strong> Although most of this training class
-expects that you're using Android Studio, some procedures include alternative
-instructions for using
-the SDK tools from the command line instead.</p>
-
-<p>This class uses a tutorial format to create a small Android app that teaches
-you some fundamental concepts about Android development, so it's important that you follow each
-step.</p>
+<p>Before you start this class, download and install
+  <a href="{@docRoot}studio/index.html">Android Studio</a>.</p>
\ No newline at end of file
diff --git a/docs/html/training/basics/firstapp/running-app.jd b/docs/html/training/basics/firstapp/running-app.jd
index 21fb64d..e809871 100755
--- a/docs/html/training/basics/firstapp/running-app.jd
+++ b/docs/html/training/basics/firstapp/running-app.jd
@@ -26,7 +26,6 @@
 <ul>
   <li><a href="{@docRoot}tools/device.html">Using Hardware Devices</a></li>
   <li><a href="{@docRoot}tools/devices/managing-avds.html">Managing AVDs with AVD Manager</a></li>
-  <li><a href="{@docRoot}tools/projects/index.html">Managing Projects</a></li>
 </ul>
 
 
@@ -34,27 +33,20 @@
 </div>
 
 
-<p>If you followed the <a href="creating-project.html">previous lesson</a> to create an
-Android project, it includes a default set of "Hello World" source files that allow you to
-immediately run the app.</p>
-
-<p>How you run your app depends on two things: whether you have a real device running Android and
-whether you're using Android Studio. This lesson shows you how to install and run your app on a
-real device and on the Android emulator, and in both cases with either Android Studio or the command
-line tools.</p>
+<p>In the <a href="creating-project.html">previous lesson</a>, you created an
+  Android project. The project contains a default app that displays
+  "Hello World". In this lesson, you will run the app on a device or emulator.</p>
 
 <h2 id="RealDevice">Run on a Real Device</h2>
 
-<p>If you have a device running Android, here's how to install and run your app.</p>
-
-<h3>Set up your device</h3>
+<p>Set up your device as follows:</p>
 
 <ol>
-  <li>Plug in your device to your development machine with a USB cable.
+  <li>Connect your device to your development machine with a USB cable.
     If you're developing on Windows, you might need to install the appropriate USB driver for your
-    device. For help installing drivers, see the <a href="{@docRoot}tools/extras/oem-usb.html">OEM
+    device. For help installing drivers, see the <a href="{@docRoot}studio/run/oem-usb.html">OEM
     USB Drivers</a> document.</li>
-  <li>Enable <strong>USB debugging</strong> on your device. On Android 4.0 and newer, go to
+  <li>Enable <strong>USB debugging</strong> on your device by going to
     <strong>Settings > Developer options</strong>.
         <p class="note"><strong>Note:</strong> On Android 4.2 and newer, <strong>Developer
         options</strong> is hidden by default. To make it available, go
@@ -63,73 +55,61 @@
   </li>
 </ol>
 
-<h3>Run the app from Android Studio</h3>
+<p>Run the app from Android Studio as follows:</p>
+
 <ol>
-  <li>Select one of your project's files and click
-<strong>Run</strong> <img
-src="{@docRoot}images/tools/as-run.png" style="vertical-align:baseline;margin:0; max-height:1em" />
-from the toolbar.</li>
-  <li>In the <strong>Choose Device</strong> window that appears, select the
-  <strong>Choose a running device</strong> radio button, select your device, and click <strong>OK
-  </strong>.</li>
+  <li>In Android Studio, select your project and click
+    <strong>Run</strong> <img src="{@docRoot}images/tools/as-run.png"
+    style="vertical-align:baseline;margin:0; max-height:1em" />
+    from the toolbar.</li>
+  <li>In the <strong>Select Deployment Target</strong> window,
+    select your device, and click <strong>OK</strong>.</li>
 </ol>
 <p>Android Studio installs the app on your connected device and starts it.</p>
 
 
 <h2 id="Emulator">Run on the Emulator</h2>
 
-<p>Whether you're using Android Studio or the command line, to run your app on the emulator you need
-to first create an <a href="{@docRoot}tools/devices/index.html">Android Virtual Device</a> (AVD). An
-AVD is a device configuration for the Android emulator that allows you to model a specific
-device.</p>
+<p>Before you run your app on an emulator, you need to create an
+  <a href="{@docRoot}tools/devices/index.html">Android Virtual Device</a> (AVD)
+  definition. An AVD definition defines the characteristics of an Android phone,
+  tablet, Android Wear, or Android TV device that you want to simulate in the
+  Android Emulator.</p>
 
-
-<h3>Create an AVD</h3>
+<p>Create an AVD Definition as follows:</p>
 <ol>
-  <li>Launch the Android Virtual Device Manager:
-    <ul>
-      <li>In Android Studio, select <strong>Tools &gt; Android &gt; AVD Manager</strong>, or click
-  the AVD Manager icon <img src="{@docRoot}images/tools/avd-manager-studio.png"
-  style="vertical-align:bottom;margin:0;height:19px"> in the toolbar. The
-  <em>AVD Manager</em> screen appears.</li>
-      <li>Or, from the command line, change directories to
-      <code>sdk/</code> and execute:
-        <pre class="no-pretty-print">tools/android avd</pre>
-        <p class="note"><strong>Note:</strong> The AVD Manager that appears
-        when launched from the command line is different from the version in
-        Android Studio, so the following instructions may not all apply.</p>
-        </li>
-    </ul>
-
-  </li>
+  <li>Launch the Android Virtual Device Manager by selecting
+    <strong>Tools &gt; Android &gt; AVD Manager</strong>, or by clicking
+    the AVD Manager icon <img src="{@docRoot}images/tools/avd-manager-studio.png"
+    style="vertical-align:bottom;margin:0;height:19px"> in the toolbar.</li>
   <li>On the AVD Manager main screen, click <strong>Create Virtual Device</strong>.</li>
-  <li>In the Select Hardware window, select a device configuration, such as Nexus 6,
-  then click <strong>Next</strong>.
+  <li>In the Select Hardware page, select a phone device, such as Nexus 6,
+    then click <strong>Next</strong>.
   </li>
-  <li>Select the desired system version for the AVD and click <strong>Next</strong>.
+  <li>In the Select Image page, choose the desired system image for the AVD and
+    click <strong>Next</strong>.
   </li>
-  <li>Verify the configuration settings, then click <strong>Finish</strong>.
+  <li>Verify the configuration settings (for your first AVD, leave all the
+    settings as they are), and then click <strong>Finish</strong>.
   </li>
 </ol>
 
 <p>For more information about using AVDs, see
-<a href="{@docRoot}tools/devices/managing-avds.html">Managing AVDs with AVD Manager</a>.</p>
+<a href="{@docRoot}studio/run/managing-avds.html">Create and Manage Virtual Devices</a>.</p>
 
-<h3>Run the app from Android Studio</h3>
+<p>Run the app from Android Studio as follows:</p>
 <ol>
-  <li>In <strong>Android Studio</strong>, select your project and click <strong>Run</strong>
-    <img src="{@docRoot}images/tools/as-run.png" style="vertical-align:baseline;margin:0; max-height:1em" /> from the toolbar.</li>
-  <li>In the <strong>Choose Device</strong> window, click the <strong>Launch emulator</strong> radio
-    button.</li>
-  <li>From the <strong>Android virtual device</strong> pull-down menu, select the emulator
-    you created, and click <strong>OK</strong>.</li>
+  <li>In <strong>Android Studio</strong>, select your project and click
+    <strong>Run</strong> <img src="{@docRoot}images/tools/as-run.png"
+    style="vertical-align:baseline;margin:0; max-height:1em" />
+    from the toolbar.</li>
+  <li>In the <strong>Select Deployment Target</strong> window,
+    select your emulator and click <strong>OK</strong>.</li>
 </ol>
-<p>It can take a few minutes for the emulator to load itself. You may have to unlock the screen.
+<p>It can take a few minutes for the emulator to start. You may have to unlock the screen.
 When you do, <em>My First App</em> appears on the emulator screen.</p>
 
 
 <p>That's how you build and run your Android app on the emulator!
 To start developing, continue to the <a href="building-ui.html">next
-lesson</a>.</p>
-
-
+lesson</a>.</p>
\ No newline at end of file
diff --git a/docs/html/training/basics/firstapp/starting-activity.jd b/docs/html/training/basics/firstapp/starting-activity.jd
index e84e17e..ebf42cb 100644
--- a/docs/html/training/basics/firstapp/starting-activity.jd
+++ b/docs/html/training/basics/firstapp/starting-activity.jd
@@ -19,9 +19,7 @@
 <ol>
   <li><a href="#RespondToButton">Respond to the Send Button</a></li>
   <li><a href="#BuildIntent">Build an Intent</a></li>
-  <!-- <li><a href="#StartActivity">Start the Second Activity</a></li> -->
   <li><a href="#CreateActivity">Create the Second Activity</a></li>
-  <li><a href="#ReceiveIntent">Receive the Intent</a></li>
   <li><a href="#DisplayMessage">Display the Message</a></li>
 </ol>
 
@@ -33,55 +31,53 @@
 
 <p>After completing the <a href="building-ui.html">previous lesson</a>, you have an app that
 shows an activity (a single screen) with a text field and a button. In this lesson, you’ll add some
-code to <code>MyActivity</code> that
+code to <code>MainActivity</code> that
 starts a new activity when the user clicks the Send button.</p>
 
 
 <h2 id="RespondToButton">Respond to the Send Button</h2>
 
 <ol>
-<li>In Android Studio, from the <code>res/layout</code> directory, edit the <code>content_my.xml</code>
-file.</li>
-<li>Add the <a
-href="{@docRoot}reference/android/view/View.html#attr_android:onClick">{@code android:onClick}</a>
-attribute to the {@link android.widget.Button &lt;Button&gt;} element.
+  <li>In the file <code>res/layout/activity_main.xml</code>, add the
+    <a href="{@docRoot}reference/android/view/View.html#attr_android:onClick">{@code android:onClick}</a>
+    attribute to the {@link android.widget.Button &lt;Button&gt;} element as
+    shown below:
+    <pre>&lt;Button
+      android:layout_width="wrap_content"
+      android:layout_height="wrap_content"
+      android:text="@string/button_send"
+      <b>android:onClick="sendMessage"</b> />
+    </pre>
+    <p>This attribute tells the system to call the <code>sendMessage()</code>
+      method in your activity whenever a user clicks on the button.</p>
+  </li>
 
-<p class="code-caption">res/layout/content_my.xml</p>
-<pre>
-&lt;Button
-    android:layout_width="wrap_content"
-    android:layout_height="wrap_content"
-    android:text="@string/button_send"
-    android:onClick="sendMessage" />
-</pre>
+  <li>In the file <code>java/com.example.myfirstapp/MainActivity.java</code>,
+    add the <code>sendMessage()</code> method stub as shown below:
 
-<p>The <a
-href="{@docRoot}reference/android/view/View.html#attr_android:onClick">{@code
-android:onClick}</a> attribute’s value, <code>"sendMessage"</code>, is the name of a method in your
-activity that the system calls when the user clicks the button.</p>
-</li>
-<li>In the <code>java/com.mycompany.myfirstapp</code> directory, open the <code>MyActivity.java</code> file.</li>
-<li>Within the <code>MyActivity</code> class, add the {@code sendMessage()} method stub shown
-below.
+    <pre>public class MainActivity extends AppCompatActivity {
+    &#64;Override
+    protected void onCreate(Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+        setContentView(R.layout.activity_main);
+    }
 
-<p class="code-caption">java/com.mycompany.myfirstapp/MyActivity.java</p>
-<pre>
-/** Called when the user clicks the Send button */
-public void sendMessage(View view) {
-    // Do something in response to button
-}
-</pre>
+    <b>/** Called when the user clicks the Send button */
+    public void sendMessage(View view) {
+        // Do something in response to button
+    }</b>
+}</pre>
 
-<p>In order for the system to match this method to the method name given to <a
-href="{@docRoot}reference/android/view/View.html#attr_android:onClick">{@code android:onClick}</a>,
-the signature must be exactly as shown. Specifically, the method must:</p>
+    <p>In order for the system to match this method to the method name given to <a
+      href="{@docRoot}reference/android/view/View.html#attr_android:onClick">{@code android:onClick}</a>,
+      the signature must be exactly as shown. Specifically, the method must:</p>
 
-<ul>
-<li>Be public</li>
-<li>Have a void return value</li>
-<li>Have a {@link android.view.View} as the only parameter (this will be the {@link
-android.view.View} that was clicked)</li>
-</ul>
+    <ul>
+    <li>Be public</li>
+    <li>Have a void return value</li>
+    <li>Have a {@link android.view.View} as the only parameter (this will be the {@link
+    android.view.View} that was clicked)</li>
+    </ul>
 
 </li>
 </ol>
@@ -90,422 +86,147 @@
 another activity.</p>
 
 <h2 id="BuildIntent">Build an Intent</h2>
+<p>An {@link android.content.Intent} is an object that provides runtime binding
+  between separate components (such as two activities). The
+  {@link android.content.Intent} represents an app’s "intent to do something."
+  You can use intents for a wide variety of tasks, but in this lesson, your intent
+  starts another activity.</p>
 
-<ol>
-<li>In <code>MyActivity.java</code>, inside the {@code sendMessage()} method, create an
-{@link android.content.Intent} to start an activity called {@code DisplayMessageActivity} with the
-following code:
+<p>In <code>MainActivity.java</code>, add the code shown below to
+  <code>sendMessage()</code>:</p>
 
-<p class="code-caption">java/com.mycompany.myfirstapp/MyActivity.java</p>
-<pre>
-public void sendMessage(View view) {
-  Intent intent = new Intent(this, DisplayMessageActivity.class);
-}
-</pre>
-
-<div class="sidebox-wrapper">
-<div class="sidebox">
-<h3>Intents</h3>
-<p>An {@link android.content.Intent} is an object that provides runtime binding between separate
-components (such as two activities). The {@link android.content.Intent} represents an
-app’s "intent to do something." You can use intents for a wide
-variety of tasks, but most often they’re used to start another activity. For more information, see
-<a href="{@docRoot}guide/components/intents-filters.html ">Intents and Intent Filters</a>.</p>
-</div>
-</div>
-
-<p class="note"><strong>Note:</strong> The reference to {@code DisplayMessageActivity}
-will raise an error if you’re using an IDE such as Android Studio because the class doesn’t exist yet.
-Ignore the error for now; you’ll create the class soon.</p>
-
-<p>The constructor used here takes two parameters:</p>
-<ul>
-  <li>A {@link
-android.content.Context} as its first parameter ({@code this} is used because the {@link
-android.app.Activity} class is a subclass of {@link android.content.Context})
-  <li>The {@link java.lang.Class} of the app component to which the system should deliver
-the {@link android.content.Intent} (in this case, the activity that should be started)
-</ul>
-
-<p>Android Studio indicates that you must import the {@link android.content.Intent} class.</p>
-
-</li>
-<li>At the top of the file, import the {@link android.content.Intent} class:
-<p class="code-caption">java/com.mycompany.myfirstapp/MyActivity.java</p>
-<pre>
-import android.content.Intent;
-</pre>
-<p class="note"><strong>Tip:</strong> In Android Studio, press Alt + Enter (option + return on Mac)
-  to import missing classes.</p>
-</li>
-
-<!-- I didn't think this was necessary
-<div class="sidebox-wrapper">
-<div class="sidebox">
-  <h3>Sending an intent to other apps</h3>
-  <p>The intent created in this lesson is what's considered an <em>explicit intent</em>, because the
-{@link android.content.Intent}
-specifies the exact app component to which the intent should be given. However, intents
-can also be <em>implicit</em>, in which case the {@link android.content.Intent} does not specify
-the desired component, but allows any app installed on the device to respond to the intent
-as long as it satisfies the meta-data specifications for the action that's specified in various
-{@link android.content.Intent} parameters. For more information, see the class about <a
-href="{@docRoot}training/basics/intents/index.html">Interacting with Other Apps</a>.</p>
-</div>
-</div>
--->
-
-<li>Inside the {@code sendMessage()} method,
-use {@link android.app.Activity#findViewById findViewById()} to get the
-{@link android.widget.EditText} element.
-<p class="code-caption">java/com.mycompany.myfirstapp/MyActivity.java</p>
-<pre>
-public void sendMessage(View view) {
-  Intent intent = new Intent(this, DisplayMessageActivity.class);
-  EditText editText = (EditText) findViewById(R.id.edit_message);
-}
-</pre>
-</li>
-
-<li>At the top of the file, import the {@link android.widget.EditText} class.
-  <p>In Android Studio, press Alt + Enter (option + return on Mac) to import missing classes.</p>
-</li>
-
-<li>Assign the text to a local <code>message</code> variable, and use the
-{@link android.content.Intent#putExtra putExtra()} method to add its text value to the intent.
-<p class="code-caption">java/com.mycompany.myfirstapp/MyActivity.java</p>
-<pre>
-public void sendMessage(View view) {
-  Intent intent = new Intent(this, DisplayMessageActivity.class);
-  EditText editText = (EditText) findViewById(R.id.edit_message);
-  String message = editText.getText().toString();
-  intent.putExtra(EXTRA_MESSAGE, message);
-}
-</pre>
-
-<p>An {@link android.content.Intent} can carry data types as key-value
-pairs called <em>extras</em>. The {@link android.content.Intent#putExtra putExtra()} method takes the
-key name in the first parameter and the value in the second parameter.</p>
-
-</li>
-<li>At the top of the {@code MyActivity} class, add the {@code EXTRA_MESSAGE} definition as
-follows:
-<p class="code-caption">java/com.mycompany.myfirstapp/MyActivity.java</p>
-<pre>
-public class MyActivity extends AppCompatActivity {
-    public final static String EXTRA_MESSAGE = "com.mycompany.myfirstapp.MESSAGE";
-    ...
-}
-</pre>
-
-<p>For the next activity to query the extra data, you should define the key
-for your intent's extra using a public constant. It's generally a good practice to define keys for
-intent extras using your app's package name as a prefix. This ensures the keys are unique, in case
-your app interacts with other apps.</p>
-
-</li>
-
-<!-- <h2 id="StartActivity">Start the Second Activity</h2> -->
-
-<li>In the {@code sendMessage()} method, to finish the intent, call the
-{@link android.app.Activity#startActivity startActivity()} method, passing it the
-{@link android.content.Intent} object created in step 1.
-
-</ol>
-
-<p>With this new code, the complete {@code sendMessage()} method that's invoked by the Send
-button now looks like this:</p>
-<p class="code-caption">java/com.mycompany.myfirstapp/MyActivity.java</p>
-<pre>
-/** Called when the user clicks the Send button */
-public void sendMessage(View view) {
-    Intent intent = new Intent(this, DisplayMessageActivity.class);
-    EditText editText = (EditText) findViewById(R.id.edit_message);
-    String message = editText.getText().toString();
-    intent.putExtra(EXTRA_MESSAGE, message);
-    startActivity(intent);
-}
-</pre>
-
-<p>The system receives this call and starts an instance of the {@link android.app.Activity}
-specified by the {@link android.content.Intent}. Now you need to create the
-{@code DisplayMessageActivity} class in order for this to work.</p>
-
-</li>
-</ol>
-
-
-<h2 id="CreateActivity">Create the Second Activity</h2>
-
-<p>All subclasses of {@link android.app.Activity} must implement the
-{@link android.app.Activity#onCreate onCreate()} method. This method is where the activity receives
-the intent with the message, then renders the message. Also, the
-{@link android.app.Activity#onCreate onCreate()} method must define the activity
-layout with the {@link android.app.Activity#setContentView setContentView()} method. This is where
-the activity performs the initial setup of the activity components.</p>
-
-<h3>Create a new activity using Android Studio</h3>
-
-<p>Android Studio includes a stub for the
-{@link android.app.Activity#onCreate onCreate()} method when you create a new activity. The
-<em>New Android Activity</em> window appears.</p>
-
-<ol>
-  <li>In Android Studio, in the <code>java</code> directory, select the package,
-    <strong>com.mycompany.myfirstapp</strong>, right-click, and select
-    <strong>New > Activity > Blank Activity</strong>.</li>
-  <li>In the <strong>Choose options</strong> window, fill in the activity details:
-    <ul>
-      <li><strong>Activity Name</strong>: DisplayMessageActivity</li>
-      <li><strong>Layout Name</strong>: activity_display_message</li>
-      <li><strong>Title</strong>: My Message</li>
-      <li><strong>Hierarchical Parent</strong>: com.mycompany.myfirstapp.MyActivity</li>
-      <li><strong>Package name</strong>: com.mycompany.myfirstapp</li>
-    </ul>
-    <p>Click <strong>Finish</strong>.</p>
-  </li>
-
-<li>Open the {@code DisplayMessageActivity.java} file.
-
-<p>The class already includes an implementation of the required
-{@link android.app.Activity#onCreate onCreate()} method. You update the implementation of this
-method later.</p>
-
-<!-- Android Studio does not create a Fragment placeholder
-<p>Also, the file includes a <code>PlaceholderFragment</code> class that extends
-{@link android.app.Fragment}. This activity does not implement fragments, but you might use this
-later in the training. Fragments decompose application functionality and UI into reusable modules.
-For more information on fragments, see the
-<a href="{@docRoot}guide/components/fragments.html">Fragments API Guide</a> and follow the training,
-<a href="{@docRoot}training/basics/fragments/index.html">Building A Dynamic UI with Fragments</a>.
-</p>
--->
-</li>
-</ol>
-
-<!-- Not needed for Android Studio
-<p class="note"><strong>Note:</strong> Your activity may look different if you did not use
-the latest version of the ADT plugin. Make sure you install the latest version of the
-<a href="{@docRoot}tools/sdk/eclipse-adt.html">ADT plugin</a> to complete this tutorial.</p>
--->
-
-<p>If you're developing with Android Studio, you can run the app now, but not much happens.
-Clicking the Send button starts the second activity, but it uses
-a default "Hello world" layout provided by the template. You'll soon update the
-activity to instead display a custom text view.</p>
-
-
-<h3>Create the activity without Android Studio</h3>
-
-<p>If you're using a different IDE or the command line tools, do the following:</p>
-
-<ol>
-<li>Create a new file named {@code DisplayMessageActivity.java} in the project's <code>src/</code>
-directory, next to the original {@code MyActivity.java} file.</li>
-<li>Add the following code to the file:
-
-<pre>
-public class DisplayMessageActivity extends AppCompatActivity {
-
+<pre>public class MainActivity extends AppCompatActivity {
+    <b>public final static String EXTRA_MESSAGE = "com.example.myfirstapp.MESSAGE";</b>
     &#64;Override
     protected void onCreate(Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);
-        setContentView(R.layout.activity_display_message);
-
-        if (savedInstanceState == null) {
-            getSupportFragmentManager().beginTransaction()
-                .add(R.id.container, new PlaceholderFragment()).commit();
-        }
+        setContentView(R.layout.activity_main);
     }
 
-    &#64;Override
-    public boolean onOptionsItemSelected(MenuItem item) {
-        // Handle app bar item clicks here. The app bar
-        // automatically handles clicks on the Home/Up button, so long
-        // as you specify a parent activity in AndroidManifest.xml.
-        int id = item.getItemId();
-        if (id == R.id.action_settings) {
-            return true;
-        }
-        return super.onOptionsItemSelected(item);
+    /** Called when the user clicks the Send button */
+    public void sendMessage(View view) {
+        <b>Intent intent = new Intent(this, DisplayMessageActivity.class);
+        EditText editText = (EditText) findViewById(R.id.edit_message);
+        String message = editText.getText().toString();
+        intent.putExtra(EXTRA_MESSAGE, message);
+        startActivity(intent);</b>
     }
+}</pre>
 
-    /**
-     * A placeholder fragment containing a simple view.
-     */
-    public static class PlaceholderFragment extends Fragment {
+<p class="note"><strong>Note: </strong>Android Studio will display
+  <code>Cannot resolve symbol</code> errors because the code references classes
+  like {@link android.content.Intent} and {@link android.widget.EditText}
+  that have not been imported. To import these classes, you can either 1)
+  use Android Studio's "import class" functionality by pressing Alt + Enter
+  (Option + Return on Mac) or 2) manually add import statements at the top of
+  the file.</p>
 
-        public PlaceholderFragment() { }
+<p>There’s a lot going on in <code>sendMessage()</code>, so let’s explain
+  what's going on.</p>
 
-        &#64;Override
-        public View onCreateView(LayoutInflater inflater, ViewGroup container,
-                  Bundle savedInstanceState) {
-              View rootView = inflater.inflate(R.layout.fragment_display_message,
-                      container, false);
-              return rootView;
-        }
-    }
-}
-</pre>
+<p>The {@link android.content.Intent} constructor takes two parameters:</p>
+<ul>
+  <li>A {@link android.content.Context} as its first parameter ({@code this}
+    is used because the {@link android.app.Activity} class is a subclass of
+    {@link android.content.Context})
+  <li>The {@link java.lang.Class} of the app component to which the system
+    should deliver the {@link android.content.Intent} (in this case, the
+    activity that should be started).
+    <p class="note"><strong>Note:</strong> The reference to
+      <code>DisplayMessageActivity</code> will raise an error in Android Studio
+      because the class doesn’t exist yet. Ignore the error for now; you’ll
+      create the class soon.</p>
+</ul>
 
-<p class="note"><strong>Note:</strong> If you are using an IDE other than Android Studio, your project
-does not contain the {@code activity_display_message} layout that's requested by
-{@link android.app.Activity#setContentView setContentView()}. That's OK because
-you will update this method later and won't be using that layout.</p>
+<p>The {@link android.content.Intent#putExtra(String, String) putExtra()}
+  method adds the <code>EditText</code>'s value to the intent. An <code>Intent</code>
+  can carry data types as key-value pairs called <em>extras</em>. Your key is a
+  public constant <code>EXTRA_MESSAGE</code> because the next
+  activity uses the key to retrive the text value. It's a good practice to
+  define keys for intent extras using your app's package name as a prefix. This
+  ensures the keys are unique, in case your app interacts with other apps.</p>
 
-</li>
+<p>The {@link android.app.Activity#startActivity(Intent) startActivity()}
+  method starts an instance of the <code>DisplayMessageActivity</code> specified
+  by the {@link android.content.Intent}. Now you need to create the class.</p>
 
-<li>To your {@code strings.xml} file, add the new activity's title as follows:
-<pre>
-&lt;resources>
-    ...
-    &lt;string name="title_activity_display_message">My Message&lt;/string>
-&lt;/resources>
-</pre>
-</li>
-
-<li>In your manifest file, <code>AndroidManifest.xml</code>, within the <code>Application</code>
-element, add the
-<a href="{@docRoot}guide/topics/manifest/activity-element.html">{@code <activity>}</a> element
-for your {@code DisplayMessageActivity} class, as follows:
-
-<pre>
-&lt;application ... >
-    ...
-    &lt;activity
-        android:name="com.mycompany.myfirstapp.DisplayMessageActivity"
-        android:label="@string/title_activity_display_message"
-        android:parentActivityName="com.mycompany.myfirstapp.MyActivity" >
-        &lt;meta-data
-            android:name="android.support.PARENT_ACTIVITY"
-            android:value="com.mycompany.myfirstapp.MyActivity" />
-    &lt;/activity>
-&lt;/application>
-</pre>
-
-</li>
-</ol>
-
-<p>The <a href="{@docRoot}guide/topics/manifest/activity-element.html#parent">{@code
-android:parentActivityName}</a> attribute declares the name of this activity's parent activity
-within the app's logical hierarchy. The system uses this value
-to implement default navigation behaviors, such as <a
-href="{@docRoot}design/patterns/navigation.html">Up navigation</a> on
-Android 4.1 (API level 16) and higher. You can provide the same navigation behaviors for
-older versions of Android by using the
-<a href="{@docRoot}tools/support-library/index.html">Support Library</a> and adding
-the <a href="{@docRoot}guide/topics/manifest/meta-data-element.html">{@code
-<meta-data>}</a> element as shown here.</p>
-
-<p class="note"><strong>Note:</strong> Your Android SDK should already include
-the latest Android Support Library, which you installed during the
-<a href="{@docRoot}studio/intro/update.html">Adding SDK Packages</a> step.
-When using the templates in Android Studio, the Support Library is automatically added to your app project
-(you can see the library's JAR file listed under <em>Android Dependencies</em>). If you're not using
-Android Studio, you need to manually add the library to your project&mdash;follow the guide for <a
-href="{@docRoot}tools/support-library/setup.html">setting up the Support Library</a>
-then return here.</p>
-
-<p>If you're using a different IDE than Android Studio, don't worry that the app won't yet compile.
-You'll soon update the activity to display a custom text view.</p>
-
-
-<h2 id="ReceiveIntent">Receive the Intent</h2>
-
-<p>Every {@link android.app.Activity} is invoked by an {@link android.content.Intent}, regardless of
-how the user navigated there. You can get the {@link android.content.Intent} that started your
-activity by calling {@link android.app.Activity#getIntent()} and retrieve the data contained
-within the intent.</p>
+<h2 id="CreateActivity">Create the Second Activity</h2>
 
 <ol>
-<li>In the <code>java/com.mycompany.myfirstapp</code> directory, edit the
-  {@code DisplayMessageActivity.java} file.</li>
-<li>Get the intent and assign it to a local variable.
-<pre>
-Intent intent = getIntent();
-</pre>
-</li>
-<li>At the top of the file, import the {@link android.content.Intent} class.
-  <p>In Android Studio, press Alt + Enter (option + return on Mac) to import missing classes.</p>
-</li>
-<li>Extract the message delivered by {@code MyActivity} with the
-{@link android.content.Intent#getStringExtra getStringExtra()} method.
-<pre>
-String message = intent.getStringExtra(MyActivity.EXTRA_MESSAGE);
-</pre>
-</li>
+  <li>In the <b>Project</b> window, right-click the <b>app</b> folder and select
+    <strong>New > Activity > Empty Activity</strong>.</li>
+  <li>In the <strong>Configure Activity</strong> window, enter
+    "DisplayMessageActivity" for <strong>Activity Name</strong> and click
+    <strong>Finish</strong>
+  </li>
 </ol>
 
+<p>Android Studio automatically does three things:</p>
+<ul>
+  <li>Creates the class <code>DisplayMessageActivity.java</code> with an
+   implementation of the required {@link android.app.Activity#onCreate(Bundle) onCreate()}
+    method.</li>
+  <li>Creates the corresponding layout file <code>activity_display_message.xml</code>
+    </li>
+  <li>Adds the required
+    <a href="{@docRoot}guide/topics/manifest/activity-element.html">&lt;activity&gt;</a>
+    element in <code>AndroidManifest.xml</code>.
+</ul>
+
+<p>If you run the app and click the Send button on the first activity, the
+  second activity starts but is empty. This is because the second activity uses
+  the default empty layout provided by the template.</p>
+
 <h2 id="DisplayMessage">Display the Message</h2>
+<p>Now you will modify the second activity to display the message that was passed
+by the first activity.</p>
 
 <ol>
-<li>In the res/layout directory, edit the {@code content_display_message.xml} file.</li>
-<li>Add an {@code android:id} attribute to the {@code RelativeLayout}.
-You need this attribute to reference the object from your app code.</li>
-
-<pre>
-&lt; RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
-...
-android:id="@+id/content"&gt;
-&lt;/RelativeLayout&gt;
-</pre>
-<li>Switch back to editing {@code DisplayMessageActivity.java}.</li>
-
-
-<li>In the {@link android.app.Activity#onCreate onCreate()} method, create a {@link android.widget.TextView} object.
-<pre>
-TextView textView = new TextView(this);
-</pre>
-</li>
-<li>Set the text size and message with {@link android.widget.TextView#setText setText()}.
-<pre>
-textView.setTextSize(40);
-textView.setText(message);
-</pre>
-</li>
-<li>Add the {@link android.widget.TextView} to the {@link android.widget.RelativeLayout}
-identified by {@code R.id.content}.
-<pre>
-RelativeLayout layout = (RelativeLayout) findViewById(R.id.content);
-layout.addView(textView);
-</pre>
-</li>
-<li>At the top of the file, import the {@link android.widget.TextView} class.
-  <p>In Android Studio, press Alt + Enter (option + return on Mac) to import missing classes.</p>
-</li>
-</ol>
-
-<p>The complete {@link android.app.Activity#onCreate onCreate()} method for {@code
-DisplayMessageActivity} now looks like this:</p>
-
-<pre>
-&#64;Override
+  <li>In {@code DisplayMessageActivity.java}, add the following code to the
+    <code>onCreate()</code> method:
+    <pre>&#64;Override
 protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_display_message);
-   Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
-   setSupportActionBar(toolbar);
-
-   FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab);
-   fab.setOnClickListener(new View.OnClickListener() {
-       &#64;Override
-       public void onClick(View view) {
-           Snackbar.make(view, "Replace with your own action", Snackbar.LENGTH_LONG)
-                   .setAction("Action", null)
-                   .show();
-       }
-   });
-   getSupportActionBar().setDisplayHomeAsUpEnabled(true);
 
    Intent intent = getIntent();
-   String message = intent.getStringExtra(MyActivity.EXTRA_MESSAGE);
+   String message = intent.getStringExtra(MainActivity.EXTRA_MESSAGE);
    TextView textView = new TextView(this);
    textView.setTextSize(40);
    textView.setText(message);
 
-   RelativeLayout layout = (RelativeLayout) findViewById(R.id.content);
+   ViewGroup layout = (ViewGroup) findViewById(R.id.activity_display_message);
    layout.addView(textView);
-</pre>
+}</pre>
+  </li>
+  <li>Press Alt + Enter (option + return on Mac) to import missing classes.</li>
+</ol>
+
+<p>There’s a lot going on here, so let’s explain:</p>
+
+<ol>
+  <li>The call {@link android.app.Activity#getIntent()} grabs the intent
+    that started the activity. Every {@link android.app.Activity} is invoked by an
+    {@link android.content.Intent}, regardless of how the user navigated there.
+    The call {@link android.content.Intent#getStringExtra(String) getStringExtra()}
+    retrieves the data from the first activity.</li>
+  <li>You programmatically create a {@link android.widget.TextView} and set
+    its size and message.
+  </li>
+  <li>You add the <code>TextView</code> to the layout identified by
+    {@code R.id.activity_display_message}. You cast the layout to
+    {@link android.view.ViewGroup} because it is the superclass of all layouts and
+    contains the {@link android.view.ViewGroup#addView(View) addView()}
+    method.</li>
+</ol>
+
+<p class="note"><strong>Note: </strong>The XML layout generated by previous
+  versions of Android Studio might not include the <code>android:id</code>
+  attribute. The call <code>findViewById()</code> will fail if the layout
+  does not have the <code>android:id</code> attribute. If this is the case,
+  open <code>activity_display_message.xml</code> and add the attribute
+  <code>android:id="@+id/activity_display_message"</code> to the layout element.
+</p>
 
 <p>You can now run the app. When it opens, type a message in the text field, and click
 <strong>Send</strong>. The second activity replaces the first one on the screen, showing
@@ -513,8 +234,4 @@
 
 <p>That's it, you've built your first Android app!</p>
 
-<p>To learn more, follow the link below to the next class.</p>
-
-
-
-
+<p>To learn more, follow the link below to the next class.</p>
\ No newline at end of file
diff --git a/docs/html/training/contacts-provider/display-contact-badge.jd b/docs/html/training/contacts-provider/display-contact-badge.jd
index 6c9616b..d286440 100644
--- a/docs/html/training/contacts-provider/display-contact-badge.jd
+++ b/docs/html/training/contacts-provider/display-contact-badge.jd
@@ -113,10 +113,10 @@
 <p>
     For Android 3.0 (API level 11) and later, include the following columns in your projection:</p>
 <ul>
-    <li>{@link android.provider.ContactsContract.Contacts#_ID Contacts._ID}</li>
-    <li>{@link android.provider.ContactsContract.Contacts#LOOKUP_KEY Contacts.LOOKUP_KEY}</li>
+    <li>{@link android.provider.BaseColumns#_ID Contacts._ID}</li>
+    <li>{@link android.provider.ContactsContract.ContactsColumns#LOOKUP_KEY Contacts.LOOKUP_KEY}</li>
     <li>
-        {@link android.provider.ContactsContract.Contacts#PHOTO_THUMBNAIL_URI
+        {@link android.provider.ContactsContract.ContactsColumns#PHOTO_THUMBNAIL_URI
         Contacts.PHOTO_THUMBNAIL_URI}
     </li>
 </ul>
@@ -124,8 +124,8 @@
     For Android 2.3.3 (API level 10) and earlier, use the following columns:
 </p>
 <ul>
-    <li>{@link android.provider.ContactsContract.Contacts#_ID Contacts._ID}</li>
-    <li>{@link android.provider.ContactsContract.Contacts#LOOKUP_KEY Contacts.LOOKUP_KEY}</li>
+    <li>{@link android.provider.BaseColumns#_ID Contacts._ID}</li>
+    <li>{@link android.provider.ContactsContract.ContactsColumns#LOOKUP_KEY Contacts.LOOKUP_KEY}</li>
 </ul>
 <p>
     The remainder of this lesson assumes that you've already loaded a
@@ -187,14 +187,14 @@
 </p>
 <p class="note">
     <strong>Note:</strong> The
-    {@link android.provider.ContactsContract.Contacts#PHOTO_THUMBNAIL_URI} column isn't available
+    {@link android.provider.ContactsContract.ContactsColumns#PHOTO_THUMBNAIL_URI} column isn't available
     in platform versions prior to 3.0. For those versions, you must retrieve the URI
     from the {@link android.provider.ContactsContract.Contacts.Photo Contacts.Photo} subtable.
 </p>
 <p>
     First, set up variables for accessing the {@link android.database.Cursor} containing the
-    {@link android.provider.ContactsContract.Contacts#_ID Contacts._ID} and
-    {@link android.provider.ContactsContract.Contacts#LOOKUP_KEY Contacts.LOOKUP_KEY} columns, as
+    {@link android.provider.BaseColumns#_ID Contacts._ID} and
+    {@link android.provider.ContactsContract.ContactsColumns#LOOKUP_KEY Contacts.LOOKUP_KEY} columns, as
     described previously:
 </p>
 <pre>
diff --git a/docs/html/training/contacts-provider/modify-data.jd b/docs/html/training/contacts-provider/modify-data.jd
index 64853ef..e993c56 100644
--- a/docs/html/training/contacts-provider/modify-data.jd
+++ b/docs/html/training/contacts-provider/modify-data.jd
@@ -196,8 +196,8 @@
     Contacts.CONTENT_LOOKUP_URI}, call
     {@link android.provider.ContactsContract.Contacts#getLookupUri
     Contacts.getLookupUri(id, lookupkey)} with the contact's
-    {@link android.provider.ContactsContract.Contacts#_ID Contacts._ID} and
-    {@link android.provider.ContactsContract.Contacts#LOOKUP_KEY Contacts.LOOKUP_KEY} values as
+    {@link android.provider.BaseColumns#_ID Contacts._ID} and
+    {@link android.provider.ContactsContract.ContactsColumns#LOOKUP_KEY Contacts.LOOKUP_KEY} values as
     arguments.
 </p>
 <p>
diff --git a/docs/html/training/contacts-provider/retrieve-details.jd b/docs/html/training/contacts-provider/retrieve-details.jd
index 0de3b67..a463b75 100644
--- a/docs/html/training/contacts-provider/retrieve-details.jd
+++ b/docs/html/training/contacts-provider/retrieve-details.jd
@@ -55,11 +55,11 @@
 <p>
     To retrieve all the details for a contact, search the
     {@link android.provider.ContactsContract.Data} table for any rows that contain the contact's
-    {@link android.provider.ContactsContract.Data#LOOKUP_KEY}. This column is available in
+    {@link android.provider.ContactsContract.ContactsColumns#LOOKUP_KEY}. This column is available in
     the {@link android.provider.ContactsContract.Data} table, because the Contacts
     Provider makes an implicit join between the {@link android.provider.ContactsContract.Contacts}
     table and the {@link android.provider.ContactsContract.Data} table. The
-    {@link android.provider.ContactsContract.Contacts#LOOKUP_KEY} column is described
+    {@link android.provider.ContactsContract.ContactsColumns#LOOKUP_KEY} column is described
     in more detail in the <a href="retrieve-names.html">Retrieving Contact Names</a> lesson.
 </p>
 <p class="note">
@@ -85,9 +85,9 @@
     the data is in different columns depending on the data type.
     To ensure you get all the possible columns for all possible data types, you need to add all the
     column names to your projection. Always retrieve
-    {@link android.provider.ContactsContract.Data#_ID Data._ID} if you're binding the result
+    {@link android.provider.BaseColumns#_ID Data._ID} if you're binding the result
     {@link android.database.Cursor} to a {@link android.widget.ListView}; otherwise, the binding
-    won't work. Also retrieve {@link android.provider.ContactsContract.Data#MIMETYPE Data.MIMETYPE}
+    won't work. Also retrieve {@link android.provider.ContactsContract.DataColumns#MIMETYPE Data.MIMETYPE}
     so you can identify the data type of each row you retrieve. For example:
 </p>
 <pre>
@@ -128,7 +128,7 @@
 <p>
     Define a constant for your selection clause, an array to hold selection arguments, and a
     variable to hold the selection value. Use
-    the {@link android.provider.ContactsContract.Contacts#LOOKUP_KEY Contacts.LOOKUP_KEY} column to
+    the {@link android.provider.ContactsContract.ContactsColumns#LOOKUP_KEY Contacts.LOOKUP_KEY} column to
     find the contact. For example:
 </p>
 <pre>
@@ -153,7 +153,7 @@
 <p>
     Define the sort order you want in the resulting {@link android.database.Cursor}. To
     keep all rows for a particular data type together, sort by
-    {@link android.provider.ContactsContract.Data#MIMETYPE Data.MIMETYPE}. This query argument
+    {@link android.provider.ContactsContract.DataColumns#MIMETYPE Data.MIMETYPE}. This query argument
     groups all email rows together, all phone rows together, and so forth. For example:
 </p>
 <pre>
@@ -299,7 +299,7 @@
     </dt>
     <dd>
         Modify the selection text to search for the
-        {@link android.provider.ContactsContract.Data#MIMETYPE MIMETYPE} value that's specific to
+        {@link android.provider.ContactsContract.DataColumns#MIMETYPE MIMETYPE} value that's specific to
         your data type.
     </dd>
     <dt>
@@ -307,7 +307,7 @@
     </dt>
     <dd>
         Since you're only selecting a single detail type, don't group the returned
-        {@link android.database.Cursor} by {@link android.provider.ContactsContract.Data#MIMETYPE
+        {@link android.database.Cursor} by {@link android.provider.ContactsContract.DataColumns#MIMETYPE
         Data.MIMETYPE}.
     </dd>
 </dl>
@@ -344,9 +344,9 @@
 <h3>Define selection criteria</h3>
 <p>
     Define a search text expression that retrieves rows for a specific contact's
-    {@link android.provider.ContactsContract.Data#LOOKUP_KEY} and the
-    {@link android.provider.ContactsContract.Data#MIMETYPE Data.MIMETYPE} of the details you
-    want. Enclose the {@link android.provider.ContactsContract.Data#MIMETYPE MIMETYPE} value in
+    {@link android.provider.ContactsContract.ContactsColumns#LOOKUP_KEY} and the
+    {@link android.provider.ContactsContract.DataColumns#MIMETYPE Data.MIMETYPE} of the details you
+    want. Enclose the {@link android.provider.ContactsContract.DataColumns#MIMETYPE MIMETYPE} value in
     single quotes by concatenating a "<code>'</code>" (single-quote) character to the start and end
     of the constant; otherwise, the provider interprets the constant as a variable name rather
     than as a string value. You don't need to use a placeholder for this value, because you're
@@ -368,10 +368,10 @@
 <h3>Define a sort order</h3>
 <p>
     Define a sort order for the returned {@link android.database.Cursor}. Since you're retrieving a
-    specific data type, omit the sort on {@link android.provider.ContactsContract.Data#MIMETYPE}.
+    specific data type, omit the sort on {@link android.provider.ContactsContract.DataColumns#MIMETYPE}.
     Instead, if the type of detail data you're searching includes a subtype, sort on it.
     For example, for email data you can sort on
-    {@link android.provider.ContactsContract.CommonDataKinds.Email#TYPE Email.TYPE}:
+    {@link android.provider.ContactsContract.CommonDataKinds.CommonColumns#TYPE Email.TYPE}:
 </p>
 <pre>
     private static final String SORT_ORDER = Email.TYPE + " ASC ";
diff --git a/docs/html/training/contacts-provider/retrieve-names.jd b/docs/html/training/contacts-provider/retrieve-names.jd
index 49d6e95..7d70ceb 100755
--- a/docs/html/training/contacts-provider/retrieve-names.jd
+++ b/docs/html/training/contacts-provider/retrieve-names.jd
@@ -227,7 +227,7 @@
 </pre>
 <p class="note">
     <strong>Note:</strong> Since
-    {@link android.provider.ContactsContract.Contacts#DISPLAY_NAME_PRIMARY
+    {@link android.provider.ContactsContract.ContactNameColumns#DISPLAY_NAME_PRIMARY
     Contacts.DISPLAY_NAME_PRIMARY} requires Android 3.0 (API version 11) or later, setting your
     app's <code>minSdkVersion</code> to 10 or below generates an Android Lint warning in
     Android Studio. To turn off this warning, add the annotation
@@ -261,7 +261,7 @@
     that displays the contacts, you need to call {@link android.app.Activity#findViewById
     Activity.findViewById()} using the parent activity of the
     {@link android.support.v4.app.Fragment}. Use the {@link android.content.Context} of the
-    parent activity when you call {@link android.widget.ListView#setAdapter setAdapter()}.
+    parent activity when you call {@link android.widget.AdapterView#setAdapter setAdapter()}.
     For example:
 </p>
 <pre>
@@ -293,7 +293,7 @@
 </p>
 <p>
     To continue setting up the listener, bind it to the {@link android.widget.ListView} by
-    calling the method {@link android.widget.ListView#setOnItemClickListener
+    calling the method {@link android.widget.AdapterView#setOnItemClickListener
     setOnItemClickListener()} in {@link android.support.v4.app.Fragment#onActivityCreated
     onActivityCreated()}. For example:
 </p>
@@ -318,15 +318,15 @@
     the {@link android.widget.ListView} displays the contact's display name,
     which contains the main form of the contact's name. In Android 3.0 (API version 11) and later,
     the name of this column is
-    {@link android.provider.ContactsContract.Contacts#DISPLAY_NAME_PRIMARY
+    {@link android.provider.ContactsContract.ContactNameColumns#DISPLAY_NAME_PRIMARY
     Contacts.DISPLAY_NAME_PRIMARY}; in versions previous to that, its name is
-    {@link android.provider.ContactsContract.Contacts#DISPLAY_NAME Contacts.DISPLAY_NAME}.
+    {@link android.provider.ContactsContract.ContactsColumns#DISPLAY_NAME Contacts.DISPLAY_NAME}.
 </p>
 <p>
-    The column {@link android.provider.ContactsContract.Contacts#_ID Contacts._ID} is used by the
+    The column {@link android.provider.BaseColumns#_ID Contacts._ID} is used by the
     {@link android.support.v4.widget.SimpleCursorAdapter} binding process.
-    {@link android.provider.ContactsContract.Contacts#_ID Contacts._ID} and
-    {@link android.provider.ContactsContract.Contacts#LOOKUP_KEY} are used together to
+    {@link android.provider.BaseColumns#_ID Contacts._ID} and
+    {@link android.provider.ContactsContract.ContactsColumns#LOOKUP_KEY} are used together to
     construct a content URI for the contact the user selects.
 </p>
 <pre>
@@ -635,7 +635,7 @@
     </li>
     <li>
         The name of the column that contains the custom MIME type value. This name is always
-        {@link android.provider.ContactsContract.Data#MIMETYPE Data.MIMETYPE}.
+        {@link android.provider.ContactsContract.DataColumns#MIMETYPE Data.MIMETYPE}.
     </li>
     <li>
         The custom MIME type value for the data type. As described previously, this is the constant
diff --git a/docs/html/training/graphics/opengl/touch.jd b/docs/html/training/graphics/opengl/touch.jd
index 089ede7..6a961da 100644
--- a/docs/html/training/graphics/opengl/touch.jd
+++ b/docs/html/training/graphics/opengl/touch.jd
@@ -36,7 +36,7 @@
 getting some attention, but what if you want to have users interact with your OpenGL ES graphics?
 The key to making your OpenGL ES application touch interactive is expanding your implementation of
 {@link android.opengl.GLSurfaceView} to override the {@link
-android.opengl.GLSurfaceView#onTouchEvent onTouchEvent()} to listen for touch events.</p>
+android.view.View#onTouchEvent onTouchEvent()} to listen for touch events.</p>
 
 <p>This lesson shows you how to listen for touch events to let users rotate an OpenGL ES object.</p>
 
@@ -44,7 +44,7 @@
 <h2 id="listener">Setup a Touch Listener</h2>
 
 <p>In order to make your OpenGL ES application respond to touch events, you must implement the
-{@link android.opengl.GLSurfaceView#onTouchEvent onTouchEvent()} method in your
+{@link android.view.View#onTouchEvent onTouchEvent()} method in your
 {@link android.opengl.GLSurfaceView} class. The example implementation below shows how to listen for
 {@link android.view.MotionEvent#ACTION_MOVE MotionEvent.ACTION_MOVE} events and translate them to
 an angle of rotation for a shape.</p>
diff --git a/docs/html/training/implementing-navigation/nav-drawer.jd b/docs/html/training/implementing-navigation/nav-drawer.jd
index 679c240..d359a47 100644
--- a/docs/html/training/implementing-navigation/nav-drawer.jd
+++ b/docs/html/training/implementing-navigation/nav-drawer.jd
@@ -148,7 +148,7 @@
 }
 </pre>
 
-<p>This code also calls {@link android.widget.ListView#setOnItemClickListener
+<p>This code also calls {@link android.widget.AdapterView#setOnItemClickListener
 setOnItemClickListener()} to receive click events in the navigation drawer's list.
 The next section shows how to implement this interface
 and change the content view when the user selects an item.</p>
@@ -160,7 +160,7 @@
 <p>When the user selects an item in the drawer's list, the system calls {@link
 android.widget.AdapterView.OnItemClickListener#onItemClick onItemClick()} on the
 {@link android.widget.AdapterView.OnItemClickListener OnItemClickListener} given to
-{@link android.widget.ListView#setOnItemClickListener setOnItemClickListener()}.</p>
+{@link android.widget.AdapterView#setOnItemClickListener setOnItemClickListener()}.</p>
 
 <p>What you do in the {@link
 android.widget.AdapterView.OnItemClickListener#onItemClick onItemClick()} method
diff --git a/docs/html/training/notify-user/build-notification.jd b/docs/html/training/notify-user/build-notification.jd
index 2f96a20..dcc8685 100644
--- a/docs/html/training/notify-user/build-notification.jd
+++ b/docs/html/training/notify-user/build-notification.jd
@@ -134,8 +134,8 @@
 <ul>
 <li>Get an instance of {@link android.app.NotificationManager}.</li>
 
-<li>Use the {@link android.app.NotificationManager#notify notify()} method to issue the
-notification. When you call {@link android.app.NotificationManager#notify notify()}, specify a notification ID.
+<li>Use the {@link android.app.NotificationManager#notify(String, int, Notification)} method to issue the
+notification. When you call {@link android.app.NotificationManager#notify(String, int, Notification)}, specify a notification ID.
 You can use this ID to update the notification later on. This is described in more detail in
 <a href="managing.html">Managing Notifications</a>.</li>
 
diff --git a/docs/html/training/testing/integration-testing/service-testing.jd b/docs/html/training/testing/integration-testing/service-testing.jd
index 60b95ca..7ba00b0 100644
--- a/docs/html/training/testing/integration-testing/service-testing.jd
+++ b/docs/html/training/testing/integration-testing/service-testing.jd
@@ -81,7 +81,7 @@
 <a href="{@docRoot}training/testing/unit-testing/instrumented-unit-tests.html#build">
 Create an Instrumented Unit Test Class</a>.</p>
 
-<p>To create an integration test for your service, add the {@code &#64;RunWith(AndroidJUnit4.class)}
+<p>To create an integration test for your service, add the {@code @RunWith(AndroidJUnit4.class)}
 annotation at the beginning of your test class definition. You also need to specify the
 <a href="{@docRoot}reference/android/support/test/runner/AndroidJUnitRunner.html">
 {@code AndroidJUnitRunner}</a> class that the Android Testing Support Library provides as your
@@ -91,7 +91,7 @@
 
 <p>Next, create a
 <a href="{@docRoot}reference/android/support/test/rule/ServiceTestRule.html">ServiceTestRule</a>
-instance in your test by using the {@code &#64;Rule} annotation.</p>
+instance in your test by using the {@code @Rule} annotation.</p>
 
 <pre>
 &#64;Rule
diff --git a/docs/html/training/testing/ui-testing/espresso-testing.jd b/docs/html/training/testing/ui-testing/espresso-testing.jd
index 7df67e7..d3d31de 100644
--- a/docs/html/training/testing/ui-testing/espresso-testing.jd
+++ b/docs/html/training/testing/ui-testing/espresso-testing.jd
@@ -188,9 +188,9 @@
 {@code ActivityTestRule}</a> to reduce the amount of boilerplate code you need to write. By using
 <a href="{@docRoot}reference/android/support/test/rule/ActivityTestRule.html">
 {@code ActivityTestRule}</a>, the testing framework launches the activity under test
-before each test method annotated with {@code &#64;Test} and before any method annotated with
-{@code &#64;Before}. The framework handles shutting down the activity after the test finishes
-and all methods annotated with {@code &#64;After} are run.</p>
+before each test method annotated with <code>&#64;Test</code> and before any method annotated with
+<code>&#64;Before</code>. The framework handles shutting down the activity after the test finishes
+and all methods annotated with <code>&#64;After</code> are run.</p>
 
 <pre>
 package com.example.android.testing.espresso.BasicSample;
diff --git a/docs/html/training/testing/ui-testing/uiautomator-testing.jd b/docs/html/training/testing/ui-testing/uiautomator-testing.jd
index 5d42107..53f497a 100644
--- a/docs/html/training/testing/ui-testing/uiautomator-testing.jd
+++ b/docs/html/training/testing/ui-testing/uiautomator-testing.jd
@@ -172,7 +172,7 @@
 <a href="{@docRoot}training/testing/unit-testing/instrumented-unit-tests.html#build">
 Create an Instrumented Unit Test Class</a>.
 </p>
-<p>Add the {@code &#64;RunWith(AndroidJUnit4.class)} annotation at the beginning of your test class
+<p>Add the {@code @RunWith(AndroidJUnit4.class)} annotation at the beginning of your test class
 definition. You also need to specify the
 <a href="{@docRoot}reference/android/support/test/runner/AndroidJUnitRunner.html">
 {@code AndroidJUnitRunner}</a> class
@@ -279,7 +279,7 @@
 }
 </pre>
 
-<p>In the example, the {@code &#64;SdkSuppress(minSdkVersion = 18)} statement helps to ensure that
+<p>In the example, the {@code @SdkSuppress(minSdkVersion = 18)} statement helps to ensure that
   tests will only run on devices with Android 4.3 (API level 18) or higher, as required by the
   UI Automator framework.</p>
 
diff --git a/docs/html/training/testing/unit-testing/instrumented-unit-tests.jd b/docs/html/training/testing/unit-testing/instrumented-unit-tests.jd
index f65766d..00622ee 100644
--- a/docs/html/training/testing/unit-testing/instrumented-unit-tests.jd
+++ b/docs/html/training/testing/unit-testing/instrumented-unit-tests.jd
@@ -122,7 +122,7 @@
 creating JUnit 4 test classes and using JUnit 4 assertions and annotations, see
 <a href="local-unit-tests.html#build">Create a Local Unit Test Class</a>.
 </p>
-<p>To create an instrumented JUnit 4 test class, add the {@code &#64;RunWith(AndroidJUnit4.class)}
+<p>To create an instrumented JUnit 4 test class, add the {@code @RunWith(AndroidJUnit4.class)}
 annotation at the beginning of your test class definition. You also need to specify the
 <a href="{@docRoot}reference/android/support/test/runner/AndroidJUnitRunner.html">
 {@code AndroidJUnitRunner}</a> class
@@ -200,8 +200,8 @@
 class="external-link">{@code RunWith}</a> and
 <a href="http://junit.sourceforge.net/javadoc/org/junit/runners/Suite.html"
 class="external-link">{@code Suite}</a> classes. In your test suite, add the
-{@code &#64;RunWith(Suite.class)} and the {@code &#64;Suite.SuitClasses()} annotations. In
-the {@code &#64;Suite.SuiteClasses()} annotation, list the individual test classes or test
+{@code @RunWith(Suite.class)} and the {@code @Suite.SuitClasses()} annotations. In
+the {@code @Suite.SuiteClasses()} annotation, list the individual test classes or test
 suites as arguments.
 </p>
 
diff --git a/docs/html/training/testing/unit-testing/local-unit-tests.jd b/docs/html/training/testing/unit-testing/local-unit-tests.jd
index 25b62fa..8b109ee 100644
--- a/docs/html/training/testing/unit-testing/local-unit-tests.jd
+++ b/docs/html/training/testing/unit-testing/local-unit-tests.jd
@@ -80,7 +80,7 @@
 {@code junit.extensions} package.</p>
 
 <p>To create a basic JUnit 4 test class, create a Java class that contains one or more test methods.
-A test method begins with the {@code &#64;Test} annotation and contains the code to exercise
+A test method begins with the {@code @Test} annotation and contains the code to exercise
 and verify a single functionality in the component that you want to test.</p>
 
 <p>The following example shows how you might implement a local unit test class. The test method
@@ -136,11 +136,11 @@
 <a href="#setup">Set Up Your Testing Environment</a>.
 </li>
 <li>At the beginning of your unit test class definition, add the
-{@code &#64;RunWith(MockitoJUnitRunner.class)} annotation. This annotation tells the Mockito test
+{@code @RunWith(MockitoJUnitRunner.class)} annotation. This annotation tells the Mockito test
 runner to validate that your usage of the framework is correct and simplifies the initialization of
 your mock objects.
 </li>
-<li>To create a mock object for an Android dependency, add the {@code &#64;Mock} annotation before
+<li>To create a mock object for an Android dependency, add the {@code @Mock} annotation before
 the field declaration.</li>
 <li>To stub the behavior of the dependency, you can specify a condition and return
 value when the condition is met by using the {@code when()} and {@code thenReturn()} methods.
diff --git a/docs/html/training/wearables/data-layer/events.jd b/docs/html/training/wearables/data-layer/events.jd
index 20f219d..db0ffcf6 100644
--- a/docs/html/training/wearables/data-layer/events.jd
+++ b/docs/html/training/wearables/data-layer/events.jd
@@ -242,7 +242,7 @@
 per manifest, multiple intent filters per service, multiple actions per filter,
 and multiple data stanzas per filter. Filters can match on a wildcard host or on
 a specific one. To match on a wildcard host, use {@code host="*"}. To match
-on a specific host, specify {@code host=&lt;node_id&gt;}.
+on a specific host, specify {@code host=<node_id>}.
 </p>
 
 <p>
diff --git a/docs/html/training/wearables/notifications/creating.jd b/docs/html/training/wearables/notifications/creating.jd
index 6f8497a..35bb2bd 100644
--- a/docs/html/training/wearables/notifications/creating.jd
+++ b/docs/html/training/wearables/notifications/creating.jd
@@ -28,7 +28,7 @@
 
 <p class="note"><strong>Note:</strong>
 Notifications using {@link android.widget.RemoteViews} are stripped of custom
-layouts and the wearable only displays the text and icons. However, you can create
+layouts and the wearable only displays the text and icons. However, you can 
 <a href="{@docRoot}training/wearables/apps/layouts.html#CustomNotifications">create custom notifications</a>
 that use custom card layouts by creating a wearable app that runs on the wearable device.</p>
 
@@ -58,7 +58,7 @@
 
 <p>To create a notification with the support library, you create an instance of
 {@link android.support.v4.app.NotificationCompat.Builder} and issue the notification by
-passing it to {@link android.support.v4.app.NotificationManagerCompat#notify notify()}. For example:
+passing it to {@link android.support.v4.app.NotificationManagerCompat#notify(int, android.app.Notification) notify()}. For example:
 </p>
 
 <pre>
diff --git a/docs/html/training/wearables/notifications/stacks.jd b/docs/html/training/wearables/notifications/stacks.jd
index 8056fc8..c3f43a7 100644
--- a/docs/html/training/wearables/notifications/stacks.jd
+++ b/docs/html/training/wearables/notifications/stacks.jd
@@ -37,7 +37,7 @@
 
 <p>To create a stack, call {@link android.support.v4.app.NotificationCompat.Builder#setGroup setGroup()}
 for each notification you want in the stack and specify a
-group key. Then call {@link android.support.v4.app.NotificationManagerCompat#notify notify()}
+group key. Then call {@link android.support.v4.app.NotificationManagerCompat#notify(int, android.app.Notification) notify()}
 to send it to the wearable.</p>
 
 <pre style="clear:right">
@@ -59,7 +59,7 @@
 
 <p>Later on, when you create another notification, specify
 the same group key. When you call
-{@link android.support.v4.app.NotificationManagerCompat#notify notify()},
+{@link android.support.v4.app.NotificationManagerCompat#notify(int, android.app.Notification) notify()},
 this notification appears in the same stack as the previous notification,
 instead of as a new card:</p>
 
diff --git a/docs/html/wear/_project.yaml b/docs/html/wear/_project.yaml
new file mode 100644
index 0000000..2a94274
--- /dev/null
+++ b/docs/html/wear/_project.yaml
@@ -0,0 +1,5 @@
+name: "Wear"
+home_url: /wear/
+description: "Small, powerful devices, worn on the body. Useful information when you need it most."
+content_license: cc3-apache2
+buganizer_id: 30209417
diff --git a/docs/html/work/_project.yaml b/docs/html/work/_project.yaml
new file mode 100644
index 0000000..9db0466
--- /dev/null
+++ b/docs/html/work/_project.yaml
@@ -0,0 +1,5 @@
+name: "Work"
+home_url: /work/
+description: "Develop apps for Android for Work to take advantage of security and management features built into Android."
+content_license: cc3-apache2
+buganizer_id: 30209417
diff --git a/docs/html/work/managed-configurations.jd b/docs/html/work/managed-configurations.jd
index 91c0637..76ca82f 100644
--- a/docs/html/work/managed-configurations.jd
+++ b/docs/html/work/managed-configurations.jd
@@ -35,7 +35,10 @@
 </ul>
 
 <p>
-  This guide shows how to implement these configuration settings in your app.
+  This guide shows how to implement managed configuration settings in
+  your app. If you're an EMM developer, refer to the
+  <a href="https://developers.google.com/android/work/build-dpc"
+  >Build a Device Policy Controller</a> guide.
 </p>
 
 <p class="note">
@@ -71,8 +74,8 @@
 
 <ul>
   <li>Declare the managed configurations in your app manifest. Doing
-  so allows the enterprise administrator to read the app's
-  configurations through Google Play APIs.
+    so allows the enterprise administrator to read the app's
+    configurations through Google Play APIs.
   </li>
 
   <li>Whenever the app resumes, use the {@link
@@ -82,11 +85,11 @@
   </li>
 
   <li>Listen for the
-  {@link android.content.Intent#ACTION_APPLICATION_RESTRICTIONS_CHANGED
-  ACTION_APPLICATION_RESTRICTIONS_CHANGED} intent. When you receive this
-  broadcast, check the {@link android.content.RestrictionsManager} to see what
-  the current managed configurations are, and make any necessary changes to your
-  app's behavior.
+    {@link android.content.Intent#ACTION_APPLICATION_RESTRICTIONS_CHANGED
+    ACTION_APPLICATION_RESTRICTIONS_CHANGED} intent. When you receive this
+    broadcast, check the {@link android.content.RestrictionsManager} to see what
+    the current managed configurations are, and make any necessary changes to your
+    app's behavior.
   </li>
 </ul>
 
@@ -96,11 +99,11 @@
 
 <p>
   Your app can support any managed configuration you want to define. You declare the
-  app's managed configurations in a <em>managed configurations file</em>, and declare the
-  configurations file in the manifest. Creating a configurations file allows other
-  apps to examine the managed configurations your app provides. Enterprise Mobility
-  Management (EMM) partners can read your app's configurations by using Google
-  Play APIs.
+  app's managed configurations in a <em>managed configurations file</em>, and declare
+  the configurations file in the manifest. Creating a configurations file allows
+  other apps to examine the managed configurations your app provides. Enterprise
+  Mobility Management (EMM) partners can read your app's configurations by using
+  Google Play APIs.
 </p>
 
 <p>
@@ -138,6 +141,14 @@
 </p>
 
 <p>
+  The managed configuration provider can query the app to find details
+  on the app's available configurations, including their description
+  text. The configurations provider and enterprise administrator can
+  change your app's managed configurations at any time, even when the
+  app is not running.
+</p>
+
+<p>
   For example, suppose your app can be remotely configured to allow or forbid
   it to download data over a cellular connection. Your app could have a
   <code>&lt;restriction&gt;</code> element like this:
@@ -145,7 +156,7 @@
 
 <pre>
 &lt;?xml version="1.0" encoding="utf-8"?&gt;
-&lt;restrictions xmlns:android="http://schemas.android.com/apk/res/android" &gt;
+&lt;restrictions xmlns:android="http://schemas.android.com/apk/res/android"&gt;
 
   &lt;restriction
     android:key="downloadOnCellular"
@@ -158,11 +169,6 @@
 </pre>
 
 <p>
-  The supported types for the <code>android:restrictionType</code> element are
-  documented in the reference for {@link android.content.RestrictionsManager}.
-</p>
-
-<p>
   You use each configuration's <code>android:key</code> attribute to
   read its value from a managed configuration bundle. For this reason,
   each configuration must have a unique key string, and the string
@@ -172,19 +178,145 @@
 <p class="note">
   <strong>Note:</strong> In a production app, <code>android:title</code> and
   <code>android:description</code> should be drawn from a localized resource
-  file, as described in <a href=
-  "{@docRoot}guide/topics/resources/localization.html">Localizing with
-  Resources</a>.
+  file, as described in
+  <a href="{@docRoot}guide/topics/resources/localization.html"
+  >Localizing with Resources</a>.
 </p>
 
-<p>
-  The managed configuration provider can query the app to find details
-  on the app's available configurations, including their description
-  text. Configurations providers and enterprise administrators can
-  change your app's managed configurations at any time, even when the
-  app is not running.
+<p id="nested-restrictions">
+  An app can define one or multiple nested restriction elements using
+  the restriction types
+  {@link android.content.RestrictionEntry#TYPE_BUNDLE bundle} and
+  {@link android.content.RestrictionEntry#TYPE_BUNDLE_ARRAY bundle_array}.
+  For example, an app with multiple VPN connection options could define
+  each VPN server configuration in a bundle, with multiple bundles grouped
+  together in a bundle array:
 </p>
 
+<pre>
+&lt;?xml version="1.0" encoding="utf-8"?&gt;
+&lt;restrictions xmlns:android="http://schemas.android.com/apk/res/android" &gt;
+
+  &lt;restriction
+    android:key="vpn_configuration_list"
+    android:restrictionType="bundle_array"&gt;
+    &lt;restriction
+      android:key="vpn_configuration"
+      android:restrictionType="bundle"&gt;
+      &lt;restriction
+        android:key="vpn_server"
+        android:restrictionType="string"/&gt;
+      &lt;restriction
+        android:key="vpn_username"
+        android:restrictionType="string"/&gt;
+      &lt;restriction
+        android:key="vpn_password"
+        android:restrictionType="string"/&gt;
+    &lt;/restriction&gt;
+  &lt;/restriction&gt;
+
+&lt;/restrictions&gt;
+</pre>
+
+<p>
+  The supported types for the <code>android:restrictionType</code> element
+  are listed in <a href="#restriction-types">Table 1</a> and documented in
+  the reference for {@link android.content.RestrictionsManager} and
+  {@link android.content.RestrictionEntry}.
+</p>
+
+<p class="table-caption" id="restriction-types">
+  <strong>Table 1.</strong> Restriction entry types and usage.
+</p>
+<table>
+  <tbody>
+    <tr>
+      <th>Type</th>
+      <th>android:restrictionType</th>
+      <th>Typical usage</th>
+    </tr>
+    <tr>
+      <td>
+        {@link android.content.RestrictionEntry#TYPE_BOOLEAN TYPE_BOOLEAN}
+      </td>
+      <td><code>"bool"</code></td>
+      <td>
+        A boolean value, true or false.
+      </td>
+    </tr>
+    <tr>
+      <td>
+        {@link android.content.RestrictionEntry#TYPE_STRING TYPE_STRING}
+      </td>
+      <td><code>"string"</code></td>
+      <td>
+        A string value, such as a name.
+      </td>
+    </tr>
+    <tr>
+      <td>
+        {@link android.content.RestrictionEntry#TYPE_INTEGER TYPE_INTEGER}
+      </td>
+      <td><code>"integer"</code></td>
+      <td>
+        An integer with a value from
+        {@link java.lang.Integer#MIN_VALUE MIN_VALUE} to
+        {@link java.lang.Integer#MAX_VALUE MAX_VALUE}.
+      </td>
+    </tr>
+    <tr>
+      <td>
+        {@link android.content.RestrictionEntry#TYPE_CHOICE TYPE_CHOICE}
+      </td>
+      <td><code>"choice"</code></td>
+      <td>
+        A string value, typically presented as a single-select list.
+      </td>
+    </tr>
+    <tr>
+      <td>
+        {@link android.content.RestrictionEntry#TYPE_MULTI_SELECT TYPE_MULTI_SELECT}
+      </td>
+      <td><code>"multi-select"</code></td>
+      <td>
+        Use this for presenting a multi-select list where more than
+        one entry can be selected, such as for choosing specific
+        titles to white-list.
+      </td>
+    </tr>
+    <tr>
+      <td>
+        {@link android.content.RestrictionEntry#TYPE_NULL TYPE_NULL}
+      </td>
+      <td><code>"hidden"</code></td>
+      <td>
+        Hidden restriction type. Use this type for information that
+        needs to be transferred across but shouldn't be presented to
+        the user in the UI. Stores a single string value.
+      </td>
+    </tr>
+    <tr>
+      <td>{@link android.content.RestrictionEntry#TYPE_BUNDLE TYPE_BUNDLE}</td>
+      <td><code>"bundle"</code></td>
+      <td>
+        Use this for storing {@link android.os.Bundle bundles} of
+        restrictions. Available in Android 6.0 (API level 23).
+      </td>
+    </tr>
+    <tr>
+      <td>
+        {@link android.content.RestrictionEntry#TYPE_BUNDLE_ARRAY TYPE_BUNDLE_ARRAY}
+      </td>
+      <td><code>"bundle_array"</code></td>
+      <td>
+        Use this for storing arrays of restriction
+        <a href="{@docRoot}reference/android/os/Bundle.html"
+        >bundles</a>. Available in Android 6.0 (API level 23).
+      </td>
+    </tr>
+  </tbody>
+</table>
+
 <h2 id="check-configuration">
   Check Managed Configurations
 </h2>
@@ -217,7 +349,7 @@
 <p>
   To get a {@link android.content.RestrictionsManager} object, get the current
   activity with {@link android.app.Fragment#getActivity getActivity()}, then
-  call that activity's {@link android.app.Activity#getSystemService
+  call that activity's {@link android.app.Activity#getSystemService(java.lang.String)
   Activity.getSystemService()} method:
 </p>
 
@@ -267,9 +399,9 @@
   <code>String</code>, and <code>String[]</code>. Once you have the
   managed configurations {@link android.os.Bundle}, you can check the current
   configuration settings with the standard {@link android.os.Bundle} methods for
-  those data types, such as {@link android.os.Bundle#getBoolean getBoolean()}
+  those data types, such as {@link android.os.BaseBundle#getBoolean getBoolean()}
   or
-  {@link android.os.Bundle#getString getString()}.
+  {@link android.os.BaseBundle#getString getString()}.
 </p>
 
 <p class="note">
@@ -292,11 +424,10 @@
 <pre>
 boolean appCanUseCellular;
 
-if appRestrictions.containsKey("downloadOnCellular") {
+if (appRestrictions.containsKey("downloadOnCellular")) {
     appCanUseCellular = appRestrictions.getBoolean("downloadOnCellular");
 } else {
-    // here, cellularDefault is a boolean set with the restriction's
-    // default value
+    // cellularDefault is a boolean using the restriction's default value
     appCanUseCellular = cellularDefault;
 }
 
@@ -305,6 +436,37 @@
     // ...show appropriate notices to user
 }</pre>
 
+<p>
+  To apply multiple <a href="#nested-restrictions">nested restrictions</a>, read
+  the {@link android.content.RestrictionEntry#TYPE_BUNDLE_ARRAY bundle_array}
+  restriction entry as a collection of {@link android.os.Parcelable} objects
+  and cast as a {@link android.os.Bundle}. In this example, each VPN's configuration
+  data is parsed and used to build a list of server connection choices:
+</p>
+
+<pre>
+// VpnConfig is a sample class used store config data, not defined
+List&lt;VpnConfig&gt; vpnConfigs = new ArrayList&lt;&gt;();
+
+Parcelable[] parcelables =
+    appRestrictions.getParcelableArray("vpn_configuration_list");
+
+if (parcelables != null && parcelables.length > 0) {
+    // iterate parcelables and cast as bundle
+    for (int i = 0; i < parcelables.length; i++) {
+        Bundle vpnConfigBundle = (Bundle) parcelables[i];
+        // parse bundle data and store in VpnConfig array
+        vpnConfigs.add(new VpnConfig()
+            .setServer(vpnConfigBundle.getString("vpn_server"))
+            .setUsername(vpnConfigBundle.getString("vpn_username"))
+            .setPassword(vpnConfigBundle.getString("vpn_password")));
+    }
+}
+
+if (!vpnConfigs.isEmpty()) {
+    // ...choose a VPN configuration or prompt user to select from list
+}</pre>
+
 <h2 id="listen-configuration">
   Listen for Managed Configuration Changes
 </h2>
diff --git a/graphics/java/android/graphics/Paint.java b/graphics/java/android/graphics/Paint.java
index 054e29f..a26da9e 100644
--- a/graphics/java/android/graphics/Paint.java
+++ b/graphics/java/android/graphics/Paint.java
@@ -1496,8 +1496,8 @@
     /**
      * Returns the font feature settings. The format is the same as the CSS
      * font-feature-settings attribute:
-     * <a href="http://dev.w3.org/csswg/css-fonts/#propdef-font-feature-settings">
-     *     http://dev.w3.org/csswg/css-fonts/#propdef-font-feature-settings</a>
+     * <a href="https://www.w3.org/TR/css-fonts-3/#font-feature-settings-prop">
+     *     https://www.w3.org/TR/css-fonts-3/#font-feature-settings-prop</a>
      *
      * @return the paint's currently set font feature settings. Default is null.
      *
@@ -1511,8 +1511,8 @@
      * Set font feature settings.
      *
      * The format is the same as the CSS font-feature-settings attribute:
-     * <a href="http://dev.w3.org/csswg/css-fonts/#propdef-font-feature-settings">
-     *     http://dev.w3.org/csswg/css-fonts/#propdef-font-feature-settings</a>
+     * <a href="https://www.w3.org/TR/css-fonts-3/#font-feature-settings-prop">
+     *     https://www.w3.org/TR/css-fonts-3/#font-feature-settings-prop</a>
      *
      * @see #getFontFeatureSettings()
      *
diff --git a/keystore/java/android/security/KeyChain.java b/keystore/java/android/security/KeyChain.java
index f413184..3ab60f8 100644
--- a/keystore/java/android/security/KeyChain.java
+++ b/keystore/java/android/security/KeyChain.java
@@ -192,7 +192,7 @@
      * <li>when permission to access a private key is changed.
      * </ul>
      *
-     * @deprecated Use {@link #ACTION_KEYCHAIN_CHANGED}, {@link #ACTION_STORAGE_CHANGED} or
+     * @deprecated Use {@link #ACTION_KEYCHAIN_CHANGED}, {@link #ACTION_TRUST_STORE_CHANGED} or
      * {@link #ACTION_KEY_ACCESS_CHANGED}. Apps that target a version higher than
      * {@link Build.VERSION_CODES#N_MR1} will not receive this broadcast.
      */
@@ -409,7 +409,7 @@
         if (alias == null) {
             throw new NullPointerException("alias == null");
         }
-        KeyChainConnection keyChainConnection = bind(context);
+        KeyChainConnection keyChainConnection = bind(context.getApplicationContext());
         try {
             final IKeyChainService keyChainService = keyChainConnection.getService();
             final String keyId = keyChainService.requestPrivateKey(alias);
@@ -453,7 +453,7 @@
         if (alias == null) {
             throw new NullPointerException("alias == null");
         }
-        KeyChainConnection keyChainConnection = bind(context);
+        KeyChainConnection keyChainConnection = bind(context.getApplicationContext());
         try {
             IKeyChainService keyChainService = keyChainConnection.getService();
 
diff --git a/libs/hwui/AnimationContext.h b/libs/hwui/AnimationContext.h
index 801fd87..97b53b0 100644
--- a/libs/hwui/AnimationContext.h
+++ b/libs/hwui/AnimationContext.h
@@ -57,7 +57,7 @@
 
 private:
     friend class AnimationContext;
-    AnimationHandle(AnimationContext& context);
+    explicit AnimationHandle(AnimationContext& context);
     AnimationHandle(RenderNode& animatingNode, AnimationContext& context);
     ~AnimationHandle();
 
@@ -75,7 +75,7 @@
 class AnimationContext {
     PREVENT_COPY_AND_ASSIGN(AnimationContext);
 public:
-    ANDROID_API AnimationContext(renderthread::TimeLord& clock);
+    ANDROID_API explicit AnimationContext(renderthread::TimeLord& clock);
     ANDROID_API virtual ~AnimationContext();
 
     nsecs_t frameTimeMs() { return mFrameTimeMs; }
diff --git a/libs/hwui/AnimatorManager.h b/libs/hwui/AnimatorManager.h
index 61f6179..8e6f820 100644
--- a/libs/hwui/AnimatorManager.h
+++ b/libs/hwui/AnimatorManager.h
@@ -35,7 +35,7 @@
 class AnimatorManager {
     PREVENT_COPY_AND_ASSIGN(AnimatorManager);
 public:
-    AnimatorManager(RenderNode& parent);
+    explicit AnimatorManager(RenderNode& parent);
     ~AnimatorManager();
 
     void addAnimator(const sp<BaseRenderNodeAnimator>& animator);
diff --git a/libs/hwui/Caches.h b/libs/hwui/Caches.h
index fe9411d..344ee71 100644
--- a/libs/hwui/Caches.h
+++ b/libs/hwui/Caches.h
@@ -75,7 +75,7 @@
         return sInstance != nullptr;
     }
 private:
-    Caches(RenderState& renderState);
+    explicit Caches(RenderState& renderState);
     static Caches* sInstance;
 
 public:
diff --git a/libs/hwui/CanvasProperty.h b/libs/hwui/CanvasProperty.h
index 6074394..56671bb 100644
--- a/libs/hwui/CanvasProperty.h
+++ b/libs/hwui/CanvasProperty.h
@@ -28,7 +28,7 @@
 class CanvasPropertyPrimitive : public VirtualLightRefBase {
     PREVENT_COPY_AND_ASSIGN(CanvasPropertyPrimitive);
 public:
-    CanvasPropertyPrimitive(float initialValue) : value(initialValue) {}
+    explicit CanvasPropertyPrimitive(float initialValue) : value(initialValue) {}
 
     float value;
 };
@@ -36,7 +36,7 @@
 class CanvasPropertyPaint : public VirtualLightRefBase {
     PREVENT_COPY_AND_ASSIGN(CanvasPropertyPaint);
 public:
-    CanvasPropertyPaint(const SkPaint& initialValue) : value(initialValue) {}
+    explicit CanvasPropertyPaint(const SkPaint& initialValue) : value(initialValue) {}
 
     SkPaint value;
 };
diff --git a/libs/hwui/CanvasState.h b/libs/hwui/CanvasState.h
index ba260d1..22c7e8a 100644
--- a/libs/hwui/CanvasState.h
+++ b/libs/hwui/CanvasState.h
@@ -72,7 +72,7 @@
 
 class CanvasState {
 public:
-    CanvasState(CanvasStateClient& renderer);
+    explicit CanvasState(CanvasStateClient& renderer);
     ~CanvasState();
 
     /**
diff --git a/libs/hwui/DeviceInfo.h b/libs/hwui/DeviceInfo.h
index f576a4f..e551eb9 100644
--- a/libs/hwui/DeviceInfo.h
+++ b/libs/hwui/DeviceInfo.h
@@ -16,7 +16,6 @@
 #ifndef DEVICEINFO_H
 #define DEVICEINFO_H
 
-#include "Extensions.h"
 #include "utils/Macros.h"
 
 namespace android {
@@ -34,8 +33,6 @@
     // with HWUI_NULL_GPU
     static void initialize();
 
-    const Extensions& extensions() const { return mExtensions; }
-
     int maxTextureSize() const { return mMaxTextureSize; }
 
 private:
@@ -44,7 +41,6 @@
 
     void load();
 
-    Extensions mExtensions;
     int mMaxTextureSize;
 };
 
diff --git a/libs/hwui/Dither.h b/libs/hwui/Dither.h
index b589b80..6af3e83 100644
--- a/libs/hwui/Dither.h
+++ b/libs/hwui/Dither.h
@@ -37,7 +37,7 @@
  */
 class Dither {
 public:
-    Dither(Caches& caches);
+    explicit Dither(Caches& caches);
 
     void clear();
     void setupProgram(Program& program, GLuint* textureUnit);
diff --git a/libs/hwui/FrameInfo.h b/libs/hwui/FrameInfo.h
index 0baca39..afab84c 100644
--- a/libs/hwui/FrameInfo.h
+++ b/libs/hwui/FrameInfo.h
@@ -65,7 +65,7 @@
 
 class ANDROID_API UiFrameInfoBuilder {
 public:
-    UiFrameInfoBuilder(int64_t* buffer) : mBuffer(buffer) {
+    explicit UiFrameInfoBuilder(int64_t* buffer) : mBuffer(buffer) {
         memset(mBuffer, 0, UI_THREAD_FRAME_INFO_SIZE * sizeof(int64_t));
     }
 
diff --git a/libs/hwui/FrameInfoVisualizer.h b/libs/hwui/FrameInfoVisualizer.h
index fc958b8..d60c002 100644
--- a/libs/hwui/FrameInfoVisualizer.h
+++ b/libs/hwui/FrameInfoVisualizer.h
@@ -40,7 +40,7 @@
 
 class FrameInfoVisualizer {
 public:
-    FrameInfoVisualizer(FrameInfoSource& source);
+    explicit FrameInfoVisualizer(FrameInfoSource& source);
     ~FrameInfoVisualizer();
 
     bool consumeProperties();
diff --git a/libs/hwui/GradientCache.h b/libs/hwui/GradientCache.h
index dccd450..49be19a 100644
--- a/libs/hwui/GradientCache.h
+++ b/libs/hwui/GradientCache.h
@@ -103,7 +103,7 @@
  */
 class GradientCache: public OnEntryRemoved<GradientCacheEntry, Texture*> {
 public:
-    GradientCache(Extensions& extensions);
+    explicit GradientCache(Extensions& extensions);
     ~GradientCache();
 
     /**
diff --git a/libs/hwui/JankTracker.h b/libs/hwui/JankTracker.h
index 84b8c3f..a23dd78 100644
--- a/libs/hwui/JankTracker.h
+++ b/libs/hwui/JankTracker.h
@@ -56,7 +56,7 @@
 // TODO: Replace DrawProfiler with this
 class JankTracker {
 public:
-    JankTracker(nsecs_t frameIntervalNanos);
+    explicit JankTracker(nsecs_t frameIntervalNanos);
     ~JankTracker();
 
     void addFrame(const FrameInfo& frame);
diff --git a/libs/hwui/Matrix.h b/libs/hwui/Matrix.h
index 9cde5d6..ba9cbbe 100644
--- a/libs/hwui/Matrix.h
+++ b/libs/hwui/Matrix.h
@@ -81,11 +81,11 @@
         loadIdentity();
     }
 
-    Matrix4(const float* v) {
+    explicit Matrix4(const float* v) {
         load(v);
     }
 
-    Matrix4(const SkMatrix& v) {
+    Matrix4(const SkMatrix& v) {  // NOLINT, implicit
         load(v);
     }
 
diff --git a/libs/hwui/PatchCache.h b/libs/hwui/PatchCache.h
index 4e587fb..6e6a730 100644
--- a/libs/hwui/PatchCache.h
+++ b/libs/hwui/PatchCache.h
@@ -51,7 +51,7 @@
 
 class PatchCache {
 public:
-    PatchCache(RenderState& renderState);
+    explicit PatchCache(RenderState& renderState);
     ~PatchCache();
 
     const Patch* get(const AssetAtlas::Entry* entry,
diff --git a/libs/hwui/PathCache.h b/libs/hwui/PathCache.h
index 6368ddd..e1fcc31 100644
--- a/libs/hwui/PathCache.h
+++ b/libs/hwui/PathCache.h
@@ -288,7 +288,7 @@
 
     class PathProcessor: public TaskProcessor<SkBitmap*> {
     public:
-        PathProcessor(Caches& caches);
+        explicit PathProcessor(Caches& caches);
         ~PathProcessor() { }
 
         virtual void onProcess(const sp<Task<SkBitmap*> >& task) override;
diff --git a/libs/hwui/PixelBuffer.cpp b/libs/hwui/PixelBuffer.cpp
index 165c7db..2a96b69 100644
--- a/libs/hwui/PixelBuffer.cpp
+++ b/libs/hwui/PixelBuffer.cpp
@@ -37,8 +37,6 @@
 
     uint8_t* map(AccessMode mode = kAccessMode_ReadWrite) override;
 
-    uint8_t* getMappedPointer() const override;
-
     void upload(uint32_t x, uint32_t y, uint32_t width, uint32_t height, int offset) override;
 
 protected:
@@ -64,10 +62,6 @@
     mAccessMode = kAccessMode_None;
 }
 
-uint8_t* CpuPixelBuffer::getMappedPointer() const {
-    return mAccessMode == kAccessMode_None ? nullptr : mBuffer.get();
-}
-
 void CpuPixelBuffer::upload(uint32_t x, uint32_t y, uint32_t width, uint32_t height, int offset) {
     glTexSubImage2D(GL_TEXTURE_2D, 0, x, y, width, height,
             mFormat, GL_UNSIGNED_BYTE, &mBuffer[offset]);
@@ -84,8 +78,6 @@
 
     uint8_t* map(AccessMode mode = kAccessMode_ReadWrite) override;
 
-    uint8_t* getMappedPointer() const override;
-
     void upload(uint32_t x, uint32_t y, uint32_t width, uint32_t height, int offset) override;
 
 protected:
@@ -142,10 +134,6 @@
     }
 }
 
-uint8_t* GpuPixelBuffer::getMappedPointer() const {
-    return mMappedPointer;
-}
-
 void GpuPixelBuffer::upload(uint32_t x, uint32_t y, uint32_t width, uint32_t height, int offset) {
     // If the buffer is not mapped, unmap() will not bind it
     mCaches.pixelBufferState().bind(mBuffer);
diff --git a/libs/hwui/PixelBuffer.h b/libs/hwui/PixelBuffer.h
index bbef36b..9536bc8 100644
--- a/libs/hwui/PixelBuffer.h
+++ b/libs/hwui/PixelBuffer.h
@@ -99,12 +99,6 @@
     }
 
     /**
-     * Returns the currently mapped pointer. Returns NULL if the buffer
-     * is not mapped.
-     */
-    virtual uint8_t* getMappedPointer() const = 0;
-
-    /**
      * Upload the specified rectangle of this pixel buffer as a
      * GL_TEXTURE_2D texture. Calling this method will trigger
      * an unmap() if necessary.
@@ -199,8 +193,7 @@
     /**
      * Unmaps this buffer, if needed. After the buffer is unmapped,
      * the pointer previously returned by map() becomes invalid and
-     * should not be used. After calling this method, getMappedPointer()
-     * will always return NULL.
+     * should not be used.
      */
     virtual void unmap() = 0;
 
diff --git a/libs/hwui/ProgramCache.h b/libs/hwui/ProgramCache.h
index 1dadda1..9ac885b 100644
--- a/libs/hwui/ProgramCache.h
+++ b/libs/hwui/ProgramCache.h
@@ -40,7 +40,7 @@
  */
 class ProgramCache {
 public:
-    ProgramCache(Extensions& extensions);
+    explicit ProgramCache(Extensions& extensions);
     ~ProgramCache();
 
     Program* get(const ProgramDescription& description);
diff --git a/libs/hwui/RecordingCanvas.cpp b/libs/hwui/RecordingCanvas.cpp
index 4528a38..6dbcd3f 100644
--- a/libs/hwui/RecordingCanvas.cpp
+++ b/libs/hwui/RecordingCanvas.cpp
@@ -20,6 +20,7 @@
 #include "RecordedOp.h"
 #include "RenderNode.h"
 #include "VectorDrawable.h"
+#include "hwui/MinikinUtils.h"
 
 namespace android {
 namespace uirenderer {
@@ -541,14 +542,20 @@
     drawTextDecorations(x, y, totalAdvance, paint);
 }
 
-void RecordingCanvas::drawGlyphsOnPath(const uint16_t* glyphs, int glyphCount, const SkPath& path,
-            float hOffset, float vOffset, const SkPaint& paint) {
-    if (!glyphs || glyphCount <= 0 || PaintUtils::paintWillNotDrawText(paint)) return;
-    glyphs = refBuffer<glyph_t>(glyphs, glyphCount);
-    addOp(alloc().create_trivial<TextOnPathOp>(
-            *(mState.currentSnapshot()->transform),
-            getRecordedClip(),
-            refPaint(&paint), glyphs, glyphCount, refPath(&path), hOffset, vOffset));
+void RecordingCanvas::drawLayoutOnPath(const minikin::Layout& layout, float hOffset, float vOffset,
+        const SkPaint& paint, const SkPath& path, size_t start, size_t end) {
+    uint16_t glyphs[1];
+    for (size_t i = start; i < end; i++) {
+        glyphs[0] = layout.getGlyphId(i);
+        float x = hOffset + layout.getX(i);
+        float y = vOffset + layout.getY(i);
+        if (PaintUtils::paintWillNotDrawText(paint)) return;
+        const uint16_t* tempGlyphs = refBuffer<glyph_t>(glyphs, 1);
+        addOp(alloc().create_trivial<TextOnPathOp>(
+                *(mState.currentSnapshot()->transform),
+                getRecordedClip(),
+                refPaint(&paint), tempGlyphs, 1, refPath(&path), x, y));
+    }
 }
 
 void RecordingCanvas::drawBitmap(const SkBitmap* bitmap, const SkPaint* paint) {
diff --git a/libs/hwui/RecordingCanvas.h b/libs/hwui/RecordingCanvas.h
index 372be24..11773d4 100644
--- a/libs/hwui/RecordingCanvas.h
+++ b/libs/hwui/RecordingCanvas.h
@@ -196,8 +196,8 @@
             const SkPaint& paint, float x, float y,
             float boundsLeft, float boundsTop, float boundsRight, float boundsBottom,
             float totalAdvance) override;
-    virtual void drawGlyphsOnPath(const uint16_t* glyphs, int count, const SkPath& path,
-            float hOffset, float vOffset, const SkPaint& paint) override;
+    virtual void drawLayoutOnPath(const minikin::Layout& layout, float hOffset, float vOffset,
+            const SkPaint& paint, const SkPath& path, size_t start, size_t end) override;
 
 private:
     const ClipBase* getRecordedClip() {
diff --git a/libs/hwui/Rect.h b/libs/hwui/Rect.h
index 5786668..eb05e91 100644
--- a/libs/hwui/Rect.h
+++ b/libs/hwui/Rect.h
@@ -73,14 +73,14 @@
             bottom(height) {
     }
 
-    inline Rect(const SkIRect& rect):
+    inline Rect(const SkIRect& rect):  // NOLINT, implicit
             left(rect.fLeft),
             top(rect.fTop),
             right(rect.fRight),
             bottom(rect.fBottom) {
     }
 
-    inline Rect(const SkRect& rect):
+    inline Rect(const SkRect& rect):  // NOLINT, implicit
             left(rect.fLeft),
             top(rect.fTop),
             right(rect.fRight),
diff --git a/libs/hwui/RenderBufferCache.h b/libs/hwui/RenderBufferCache.h
index f77f4c9..6444331 100644
--- a/libs/hwui/RenderBufferCache.h
+++ b/libs/hwui/RenderBufferCache.h
@@ -82,7 +82,7 @@
             mBuffer(nullptr), mFormat(format), mWidth(width), mHeight(height) {
         }
 
-        RenderBufferEntry(RenderBuffer* buffer):
+        explicit RenderBufferEntry(RenderBuffer* buffer):
             mBuffer(buffer), mFormat(buffer->getFormat()),
             mWidth(buffer->getWidth()), mHeight(buffer->getHeight()) {
         }
diff --git a/libs/hwui/ResourceCache.h b/libs/hwui/ResourceCache.h
index 4583c8d..3ac7864 100644
--- a/libs/hwui/ResourceCache.h
+++ b/libs/hwui/ResourceCache.h
@@ -42,7 +42,7 @@
 class ResourceReference {
 public:
 
-    ResourceReference(ResourceType type) {
+    explicit ResourceReference(ResourceType type) {
         refCount = 0; destroyed = false; resourceType = type;
     }
 
diff --git a/libs/hwui/SkiaCanvas.cpp b/libs/hwui/SkiaCanvas.cpp
index 99ea831..09775496 100644
--- a/libs/hwui/SkiaCanvas.cpp
+++ b/libs/hwui/SkiaCanvas.cpp
@@ -18,6 +18,7 @@
 
 #include "CanvasProperty.h"
 #include "VectorDrawable.h"
+#include "hwui/MinikinUtils.h"
 
 #include <SkDrawable.h>
 #include <SkDevice.h>
@@ -25,6 +26,7 @@
 #include <SkDrawFilter.h>
 #include <SkGraphics.h>
 #include <SkImage.h>
+#include <SkRSXform.h>
 #include <SkShader.h>
 #include <SkTemplates.h>
 
@@ -624,9 +626,32 @@
     drawTextDecorations(x, y, totalAdvance, paint);
 }
 
-void SkiaCanvas::drawGlyphsOnPath(const uint16_t* glyphs, int count, const SkPath& path,
-        float hOffset, float vOffset, const SkPaint& paint) {
-    mCanvas->drawTextOnPathHV(glyphs, count << 1, path, hOffset, vOffset, paint);
+void SkiaCanvas::drawLayoutOnPath(const minikin::Layout& layout, float hOffset, float vOffset,
+        const SkPaint& paint, const SkPath& path, size_t start, size_t end) {
+    const int N = end - start;
+    SkAutoSMalloc<1024> storage(N * (sizeof(uint16_t) + sizeof(SkRSXform)));
+    SkRSXform* xform = (SkRSXform*)storage.get();
+    uint16_t* glyphs = (uint16_t*)(xform + N);
+    SkPathMeasure meas(path, false);
+
+    for (size_t i = start; i < end; i++) {
+        glyphs[i - start] = layout.getGlyphId(i);
+        float x = hOffset + layout.getX(i);
+        float y = vOffset + layout.getY(i);
+
+        SkPoint pos;
+        SkVector tan;
+        if (!meas.getPosTan(x, &pos, &tan)) {
+            pos.set(x, y);
+            tan.set(1, 0);
+        }
+        xform[i - start].fSCos = tan.x();
+        xform[i - start].fSSin = tan.y();
+        xform[i - start].fTx   = pos.x() - tan.y() * y;
+        xform[i - start].fTy   = pos.y() + tan.x() * y;
+    }
+
+    this->asSkCanvas()->drawTextRSXform(glyphs, sizeof(uint16_t) * N, xform, nullptr, paint);
 }
 
 // ----------------------------------------------------------------------------
diff --git a/libs/hwui/SkiaCanvas.h b/libs/hwui/SkiaCanvas.h
index c76971c..0e506f4 100644
--- a/libs/hwui/SkiaCanvas.h
+++ b/libs/hwui/SkiaCanvas.h
@@ -161,8 +161,8 @@
             const SkPaint& paint, float x, float y,
             float boundsLeft, float boundsTop, float boundsRight, float boundsBottom,
             float totalAdvance) override;
-    virtual void drawGlyphsOnPath(const uint16_t* glyphs, int count, const SkPath& path,
-            float hOffset, float vOffset, const SkPaint& paint) override;
+    virtual void drawLayoutOnPath(const minikin::Layout& layout, float hOffset, float vOffset,
+            const SkPaint& paint, const SkPath& path, size_t start, size_t end) override;
 
 private:
     struct SaveRec {
diff --git a/libs/hwui/SkiaCanvasProxy.cpp b/libs/hwui/SkiaCanvasProxy.cpp
index f264a35..fded604 100644
--- a/libs/hwui/SkiaCanvasProxy.cpp
+++ b/libs/hwui/SkiaCanvasProxy.cpp
@@ -23,6 +23,7 @@
 #include <SkPixelRef.h>
 #include <SkRect.h>
 #include <SkRRect.h>
+#include <SkRSXform.h>
 #include <SkSurface.h>
 
 #include <memory>
@@ -323,9 +324,9 @@
     // by Minikin then it had already computed these bounds.  Unfortunately,
     // there is no way to capture those bounds as part of the Skia drawPosText
     // API so we need to do that computation again here.
-    SkRect bounds;
+    SkRect bounds = SkRect::MakeEmpty();
     for (int i = 0; i < glyphs.count; i++) {
-        SkRect glyphBounds;
+        SkRect glyphBounds = SkRect::MakeEmpty();
         glyphs.paint.measureText(&glyphs.glyphIDs[i], sizeof(uint16_t), &glyphBounds);
         glyphBounds.offset(pos[i].fX, pos[i].fY);
         bounds.join(glyphBounds);
@@ -348,11 +349,26 @@
 
 void SkiaCanvasProxy::onDrawTextOnPath(const void* text, size_t byteLength, const SkPath& path,
         const SkMatrix* matrix, const SkPaint& origPaint) {
-    // convert to glyphIDs if necessary
-    GlyphIDConverter glyphs(text, byteLength, origPaint);
-    mCanvas->drawGlyphsOnPath(glyphs.glyphIDs, glyphs.count, path, 0, 0, glyphs.paint);
+    SkDEBUGFAIL("SkiaCanvasProxy::onDrawTextOnPath is not supported");
 }
 
+void SkiaCanvasProxy::onDrawTextRSXform(const void* text, size_t byteLength,
+        const SkRSXform xform[], const SkRect* cullRect, const SkPaint& paint) {
+    GlyphIDConverter glyphs(text, byteLength, paint); // Just get count
+    SkMatrix localM, currM, origM;
+    mCanvas->getMatrix(&currM);
+    origM = currM;
+    for (int i = 0; i < glyphs.count; i++) {
+        localM.setRSXform(*xform++);
+        currM.setConcat(origM, localM);
+        mCanvas->setMatrix(currM);
+        this->onDrawText((char*)text + (byteLength / glyphs.count * i),
+                         byteLength / glyphs.count, 0, 0, paint);
+    }
+    mCanvas->setMatrix(origM);
+}
+
+
 void SkiaCanvasProxy::onDrawTextBlob(const SkTextBlob* blob, SkScalar x, SkScalar y,
         const SkPaint& paint) {
     SkDEBUGFAIL("SkiaCanvasProxy::onDrawTextBlob is not supported");
diff --git a/libs/hwui/SkiaCanvasProxy.h b/libs/hwui/SkiaCanvasProxy.h
index d1c9c6b..3ee8c6e 100644
--- a/libs/hwui/SkiaCanvasProxy.h
+++ b/libs/hwui/SkiaCanvasProxy.h
@@ -39,7 +39,7 @@
  */
 class ANDROID_API SkiaCanvasProxy : public SkCanvas {
 public:
-    SkiaCanvasProxy(Canvas* canvas, bool filterHwuiCalls = false);
+    explicit SkiaCanvasProxy(Canvas* canvas, bool filterHwuiCalls = false);
     virtual ~SkiaCanvasProxy() {}
 
 protected:
@@ -81,6 +81,8 @@
                                 SkScalar constY, const SkPaint&) override;
     virtual void onDrawTextOnPath(const void* text, size_t byteLength, const SkPath& path,
                                   const SkMatrix* matrix, const SkPaint&) override;
+    virtual void onDrawTextRSXform(const void* text, size_t byteLength, const SkRSXform[],
+                                   const SkRect* cullRect, const SkPaint& paint);
     virtual void onDrawTextBlob(const SkTextBlob* blob, SkScalar x, SkScalar y,
                                 const SkPaint& paint) override;
 
diff --git a/libs/hwui/TextDropShadowCache.h b/libs/hwui/TextDropShadowCache.h
index d536c40..13e8774 100644
--- a/libs/hwui/TextDropShadowCache.h
+++ b/libs/hwui/TextDropShadowCache.h
@@ -111,7 +111,7 @@
  * Alpha texture used to represent a shadow.
  */
 struct ShadowTexture: public Texture {
-    ShadowTexture(Caches& caches): Texture(caches) {
+    explicit ShadowTexture(Caches& caches): Texture(caches) {
     }
 
     float left;
@@ -121,7 +121,7 @@
 class TextDropShadowCache: public OnEntryRemoved<ShadowText, ShadowTexture*> {
 public:
     TextDropShadowCache();
-    TextDropShadowCache(uint32_t maxByteSize);
+    explicit TextDropShadowCache(uint32_t maxByteSize);
     ~TextDropShadowCache();
 
     /**
diff --git a/libs/hwui/Texture.h b/libs/hwui/Texture.h
index 9749f73..b72742f 100644
--- a/libs/hwui/Texture.h
+++ b/libs/hwui/Texture.h
@@ -34,7 +34,7 @@
  */
 class Texture : public GpuMemoryTracker {
 public:
-    Texture(Caches& caches)
+    explicit Texture(Caches& caches)
         : GpuMemoryTracker(GpuObjectType::Texture)
         , mCaches(caches)
     { }
@@ -171,7 +171,7 @@
 
 class AutoTexture {
 public:
-    AutoTexture(Texture* texture)
+    explicit AutoTexture(Texture* texture)
             : texture(texture) {}
     ~AutoTexture() {
         if (texture && texture->cleanup) {
diff --git a/libs/hwui/hwui/Canvas.cpp b/libs/hwui/hwui/Canvas.cpp
index 461363f..b18e794 100644
--- a/libs/hwui/hwui/Canvas.cpp
+++ b/libs/hwui/hwui/Canvas.cpp
@@ -185,13 +185,7 @@
     }
 
     void operator()(size_t start, size_t end) {
-        uint16_t glyphs[1];
-        for (size_t i = start; i < end; i++) {
-            glyphs[0] = layout.getGlyphId(i);
-            float x = hOffset + layout.getX(i);
-            float y = vOffset + layout.getY(i);
-            canvas->drawGlyphsOnPath(glyphs, 1, path, x, y, paint);
-        }
+        canvas->drawLayoutOnPath(layout, hOffset, vOffset, paint, path, start, end);
     }
 private:
     const minikin::Layout& layout;
diff --git a/libs/hwui/hwui/Canvas.h b/libs/hwui/hwui/Canvas.h
index 0b42099..57db0f2 100644
--- a/libs/hwui/hwui/Canvas.h
+++ b/libs/hwui/hwui/Canvas.h
@@ -26,6 +26,10 @@
 #include <SkCanvas.h>
 #include <SkMatrix.h>
 
+namespace minikin {
+    class Layout;
+}
+
 namespace android {
 
 namespace uirenderer {
@@ -242,10 +246,8 @@
             const SkPaint& paint, float x, float y,
             float boundsLeft, float boundsTop, float boundsRight, float boundsBottom,
             float totalAdvance) = 0;
-    /** drawTextOnPath: count is of glyphs */
-    virtual void drawGlyphsOnPath(const uint16_t* glyphs, int count, const SkPath& path,
-            float hOffset, float vOffset, const SkPaint& paint) = 0;
-
+    virtual void drawLayoutOnPath(const minikin::Layout& layout, float hOffset, float vOffset,
+            const SkPaint& paint, const SkPath& path, size_t start, size_t end) = 0;
     friend class DrawTextFunctor;
     friend class DrawTextOnPathFunctor;
     friend class uirenderer::SkiaCanvasProxy;
diff --git a/libs/hwui/renderthread/RenderTask.h b/libs/hwui/renderthread/RenderTask.h
index 89c3a7d..9ea671b 100644
--- a/libs/hwui/renderthread/RenderTask.h
+++ b/libs/hwui/renderthread/RenderTask.h
@@ -73,7 +73,7 @@
 
 class MethodInvokeRenderTask : public RenderTask {
 public:
-    MethodInvokeRenderTask(RunnableMethod method)
+    explicit MethodInvokeRenderTask(RunnableMethod method)
         : mMethod(method), mReturnPtr(nullptr) {}
 
     void* payload() { return mData; }
diff --git a/libs/hwui/thread/Barrier.h b/libs/hwui/thread/Barrier.h
index 0a7acb0..17f82ba9 100644
--- a/libs/hwui/thread/Barrier.h
+++ b/libs/hwui/thread/Barrier.h
@@ -24,7 +24,7 @@
 
 class Barrier {
 public:
-    Barrier(Condition::WakeUpType type = Condition::WAKE_UP_ALL) : mType(type), mOpened(false) { }
+    explicit Barrier(Condition::WakeUpType type = Condition::WAKE_UP_ALL) : mType(type), mOpened(false) { }
     ~Barrier() { }
 
     void open() {
diff --git a/libs/hwui/thread/Future.h b/libs/hwui/thread/Future.h
index a3ff3bc..177eebd 100644
--- a/libs/hwui/thread/Future.h
+++ b/libs/hwui/thread/Future.h
@@ -27,7 +27,7 @@
 template<typename T>
 class Future: public LightRefBase<Future<T> > {
 public:
-    Future(Condition::WakeUpType type = Condition::WAKE_UP_ONE): mBarrier(type), mResult() { }
+    explicit Future(Condition::WakeUpType type = Condition::WAKE_UP_ONE): mBarrier(type), mResult() { }
     ~Future() { }
 
     /**
diff --git a/libs/hwui/thread/Signal.h b/libs/hwui/thread/Signal.h
index d4cfeeb..93e6f4c 100644
--- a/libs/hwui/thread/Signal.h
+++ b/libs/hwui/thread/Signal.h
@@ -26,7 +26,7 @@
 
 class Signal {
 public:
-    Signal(Condition::WakeUpType type = Condition::WAKE_UP_ALL) : mType(type), mSignaled(false) { }
+    explicit Signal(Condition::WakeUpType type = Condition::WAKE_UP_ALL) : mType(type), mSignaled(false) { }
     ~Signal() { }
 
     void signal() {
diff --git a/libs/hwui/thread/TaskManager.h b/libs/hwui/thread/TaskManager.h
index e4808f7..0e4ffdc 100644
--- a/libs/hwui/thread/TaskManager.h
+++ b/libs/hwui/thread/TaskManager.h
@@ -78,7 +78,7 @@
 
     class WorkerThread: public Thread {
     public:
-        WorkerThread(const String8 name): mSignal(Condition::WAKE_UP_ONE), mName(name) { }
+        explicit WorkerThread(const String8 name): mSignal(Condition::WAKE_UP_ONE), mName(name) { }
 
         bool addTask(const TaskWrapper& task);
         size_t getTaskCount() const;
diff --git a/libs/hwui/thread/TaskProcessor.h b/libs/hwui/thread/TaskProcessor.h
index 82538e9..5867450 100644
--- a/libs/hwui/thread/TaskProcessor.h
+++ b/libs/hwui/thread/TaskProcessor.h
@@ -36,7 +36,7 @@
 template<typename T>
 class TaskProcessor: public TaskProcessorBase {
 public:
-    TaskProcessor(TaskManager* manager): mManager(manager) { }
+    explicit TaskProcessor(TaskManager* manager): mManager(manager) { }
     virtual ~TaskProcessor() { }
 
     void add(const sp<Task<T> >& task) {
diff --git a/media/java/android/media/ImageReader.java b/media/java/android/media/ImageReader.java
index 682512c..2cbeb3a2 100644
--- a/media/java/android/media/ImageReader.java
+++ b/media/java/android/media/ImageReader.java
@@ -520,6 +520,31 @@
         }
     }
 
+    /**
+     * Discard any free buffers owned by this ImageReader.
+     *
+     * <p>
+     * Generally, the ImageReader caches buffers for reuse once they have been
+     * allocated, for best performance. However, sometimes it may be important to
+     * release all the cached, unused buffers to save on memory.
+     * </p>
+     * <p>
+     * Calling this method will discard all free cached buffers. This does not include any buffers
+     * associated with Images acquired from the ImageReader, any filled buffers waiting to be
+     * acquired, and any buffers currently in use by the source rendering buffers into the
+     * ImageReader's Surface.
+     * <p>
+     * The ImageReader continues to be usable after this call, but may need to reallocate buffers
+     * when more buffers are needed for rendering.
+     * </p>
+     * @hide
+     */
+    public void discardFreeBuffers() {
+        synchronized (mCloseLock) {
+            nativeDiscardFreeBuffers();
+        }
+    }
+
     @Override
     protected void finalize() throws Throwable {
         try {
@@ -872,6 +897,7 @@
     private synchronized native void nativeReleaseImage(Image i);
     private synchronized native Surface nativeGetSurface();
     private synchronized native int nativeDetachImage(Image i);
+    private synchronized native void nativeDiscardFreeBuffers();
 
     /**
      * @return A return code {@code ACQUIRE_*}
diff --git a/media/java/android/media/MediaRecorder.java b/media/java/android/media/MediaRecorder.java
index 8971ac5..abbace1 100644
--- a/media/java/android/media/MediaRecorder.java
+++ b/media/java/android/media/MediaRecorder.java
@@ -746,6 +746,27 @@
     }
 
     /**
+     * Sets the video encoding profile for recording. Call this method before prepare().
+     * Prepare() may perform additional checks on the parameter to make sure whether the
+     * specified profile and level are applicable, and sometimes the passed profile or
+     * level will be discarded due to codec capablity or to ensure the video recording
+     * can proceed smoothly based on the capabilities of the platform.
+     * @hide
+     * @param profile declared in {@link MediaCodecInfo.CodecProfileLevel}.
+     * @param level declared in {@link MediaCodecInfo.CodecProfileLevel}.
+     */
+    public void setVideoEncodingProfileLevel(int profile, int level) {
+        if (profile <= 0)  {
+            throw new IllegalArgumentException("Video encoding profile is not positive");
+        }
+        if (level <= 0)  {
+            throw new IllegalArgumentException("Video encoding level is not positive");
+        }
+        setParameter("video-param-encoder-profile=" + profile);
+        setParameter("video-param-encoder-level=" + level);
+    }
+
+    /**
      * Currently not implemented. It does nothing.
      * @deprecated Time lapse mode video recording using camera still image capture
      * is not desirable, and will not be supported.
diff --git a/media/java/android/media/MediaScannerConnection.java b/media/java/android/media/MediaScannerConnection.java
index d714672..471fa2c 100644
--- a/media/java/android/media/MediaScannerConnection.java
+++ b/media/java/android/media/MediaScannerConnection.java
@@ -133,6 +133,10 @@
                 }
                 try {
                     mContext.unbindService(this);
+                    if (mClient instanceof ClientProxy) {
+                        mClient = null;
+                    }
+                    mService = null;
                 } catch (IllegalArgumentException ex) {
                     if (false) {
                         Log.v(TAG, "disconnect failed: " + ex);
@@ -205,6 +209,7 @@
         void scanNextPath() {
             if (mNextPath >= mPaths.length) {
                 mConnection.disconnect();
+                mConnection = null;
                 return;
             }
             String mimeType = mMimeTypes != null ? mMimeTypes[mNextPath] : null;
diff --git a/media/jni/android_media_ImageReader.cpp b/media/jni/android_media_ImageReader.cpp
index c3993ae..724fc02 100644
--- a/media/jni/android_media_ImageReader.cpp
+++ b/media/jni/android_media_ImageReader.cpp
@@ -611,6 +611,23 @@
     return OK;
 }
 
+static void ImageReader_discardFreeBuffers(JNIEnv* env, jobject thiz) {
+    ALOGV("%s:", __FUNCTION__);
+    JNIImageReaderContext* ctx = ImageReader_getContext(env, thiz);
+    if (ctx == NULL) {
+        jniThrowException(env, "java/lang/IllegalStateException", "ImageReader was already closed");
+        return;
+    }
+
+    BufferItemConsumer* bufferConsumer = ctx->getBufferConsumer();
+    status_t res = bufferConsumer->discardFreeBuffers();
+    if (res != OK) {
+        ALOGE("Buffer discard failed: %s (%d)", strerror(-res), res);
+        jniThrowRuntimeException(env,
+                "nativeDicardFreebuffers failed");
+    }
+}
+
 static jobject ImageReader_getSurface(JNIEnv* env, jobject thiz)
 {
     ALOGV("%s: ", __FUNCTION__);
@@ -773,6 +790,7 @@
     {"nativeImageSetup",       "(Landroid/media/Image;)I",   (void*)ImageReader_imageSetup },
     {"nativeGetSurface",       "()Landroid/view/Surface;",   (void*)ImageReader_getSurface },
     {"nativeDetachImage",      "(Landroid/media/Image;)I",   (void*)ImageReader_detachImage },
+    {"nativeDiscardFreeBuffers", "()V",                      (void*)ImageReader_discardFreeBuffers }
 };
 
 static const JNINativeMethod gImageMethods[] = {
diff --git a/packages/CaptivePortalLogin/src/com/android/captiveportallogin/CaptivePortalLoginActivity.java b/packages/CaptivePortalLogin/src/com/android/captiveportallogin/CaptivePortalLoginActivity.java
index 6fb8b51..b58c87a 100644
--- a/packages/CaptivePortalLogin/src/com/android/captiveportallogin/CaptivePortalLoginActivity.java
+++ b/packages/CaptivePortalLogin/src/com/android/captiveportallogin/CaptivePortalLoginActivity.java
@@ -96,7 +96,7 @@
         // Exit app if Network disappears.
         final NetworkCapabilities networkCapabilities = mCm.getNetworkCapabilities(mNetwork);
         if (networkCapabilities == null) {
-            finish();
+            finishAndRemoveTask();
             return;
         }
         mNetworkCallback = new NetworkCallback() {
@@ -163,7 +163,7 @@
                 mCaptivePortal.useNetwork();
                 break;
         }
-        finish();
+        finishAndRemoveTask();
     }
 
     @Override
diff --git a/packages/DocumentsUI/perf-tests/src/com/android/documentsui/FilesJankPerfTest.java b/packages/DocumentsUI/perf-tests/src/com/android/documentsui/FilesJankPerfTest.java
index cb2d904..9925d5b 100644
--- a/packages/DocumentsUI/perf-tests/src/com/android/documentsui/FilesJankPerfTest.java
+++ b/packages/DocumentsUI/perf-tests/src/com/android/documentsui/FilesJankPerfTest.java
@@ -56,6 +56,10 @@
         final Intent intent = new Intent(context, FilesActivity.class);
         intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
         mActivity = getInstrumentation().startActivitySync(intent);
+        try {
+            device.setOrientationNatural();
+        } catch (RemoteException e) {
+        }
     }
 
     public void tearDownInLoop() {
@@ -63,6 +67,11 @@
             mActivity.finish();
             mActivity = null;
         }
+        try {
+            final UiDevice device = UiDevice.getInstance(getInstrumentation());
+            device.unfreezeRotation();
+        } catch (RemoteException e) {
+        }
     }
 
     public void setupAndOpenInLoop() throws Exception {
diff --git a/packages/DocumentsUI/res/values-af/strings.xml b/packages/DocumentsUI/res/values-af/strings.xml
index bc00af7..673c8d4 100644
--- a/packages/DocumentsUI/res/values-af/strings.xml
+++ b/packages/DocumentsUI/res/values-af/strings.xml
@@ -16,7 +16,7 @@
 
 <resources xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
-    <string name="app_label" msgid="2783841764617238354">"Dokumente"</string>
+    <string name="app_label" msgid="1551050262492398204">"Lêers"</string>
     <string name="downloads_label" msgid="959113951084633612">"Aflaaie"</string>
     <string name="title_open" msgid="4353228937663917801">"Maak oop vanuit"</string>
     <string name="title_save" msgid="2433679664882857999">"Stoor na"</string>
diff --git a/packages/DocumentsUI/res/values-am/strings.xml b/packages/DocumentsUI/res/values-am/strings.xml
index c1689fb..cc00163 100644
--- a/packages/DocumentsUI/res/values-am/strings.xml
+++ b/packages/DocumentsUI/res/values-am/strings.xml
@@ -16,7 +16,7 @@
 
 <resources xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
-    <string name="app_label" msgid="2783841764617238354">"ሰነዶች"</string>
+    <string name="app_label" msgid="1551050262492398204">"ፋይሎች"</string>
     <string name="downloads_label" msgid="959113951084633612">"የወረዱ"</string>
     <string name="title_open" msgid="4353228937663917801">"ክፈት ከ"</string>
     <string name="title_save" msgid="2433679664882857999">"አስቀምጥ ወደ"</string>
diff --git a/packages/DocumentsUI/res/values-ar/strings.xml b/packages/DocumentsUI/res/values-ar/strings.xml
index 620143b..ce53e2d 100644
--- a/packages/DocumentsUI/res/values-ar/strings.xml
+++ b/packages/DocumentsUI/res/values-ar/strings.xml
@@ -16,7 +16,7 @@
 
 <resources xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
-    <string name="app_label" msgid="2783841764617238354">"مستندات"</string>
+    <string name="app_label" msgid="1551050262492398204">"الملفات"</string>
     <string name="downloads_label" msgid="959113951084633612">"التنزيلات"</string>
     <string name="title_open" msgid="4353228937663917801">"فتح من"</string>
     <string name="title_save" msgid="2433679664882857999">"حفظ في"</string>
diff --git a/packages/DocumentsUI/res/values-az-rAZ/strings.xml b/packages/DocumentsUI/res/values-az-rAZ/strings.xml
index 988697c..f064feb 100644
--- a/packages/DocumentsUI/res/values-az-rAZ/strings.xml
+++ b/packages/DocumentsUI/res/values-az-rAZ/strings.xml
@@ -16,7 +16,7 @@
 
 <resources xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
-    <string name="app_label" msgid="2783841764617238354">"Sənədlər"</string>
+    <string name="app_label" msgid="1551050262492398204">"Fayllar"</string>
     <string name="downloads_label" msgid="959113951084633612">"Endirmələr"</string>
     <string name="title_open" msgid="4353228937663917801">"Vasitəsilə açın"</string>
     <string name="title_save" msgid="2433679664882857999">"buraya saxlayın"</string>
diff --git a/packages/DocumentsUI/res/values-b+sr+Latn/strings.xml b/packages/DocumentsUI/res/values-b+sr+Latn/strings.xml
index d38a431..1488466 100644
--- a/packages/DocumentsUI/res/values-b+sr+Latn/strings.xml
+++ b/packages/DocumentsUI/res/values-b+sr+Latn/strings.xml
@@ -16,7 +16,7 @@
 
 <resources xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
-    <string name="app_label" msgid="2783841764617238354">"Dokumenti"</string>
+    <string name="app_label" msgid="1551050262492398204">"Datoteke"</string>
     <string name="downloads_label" msgid="959113951084633612">"Preuzimanja"</string>
     <string name="title_open" msgid="4353228937663917801">"Otvori sa"</string>
     <string name="title_save" msgid="2433679664882857999">"Sačuvaj u"</string>
diff --git a/packages/DocumentsUI/res/values-be-rBY/strings.xml b/packages/DocumentsUI/res/values-be-rBY/strings.xml
index be6988f..2fb069e 100644
--- a/packages/DocumentsUI/res/values-be-rBY/strings.xml
+++ b/packages/DocumentsUI/res/values-be-rBY/strings.xml
@@ -16,7 +16,7 @@
 
 <resources xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
-    <string name="app_label" msgid="2783841764617238354">"Дакументы"</string>
+    <string name="app_label" msgid="1551050262492398204">"Файлы"</string>
     <string name="downloads_label" msgid="959113951084633612">"Спампоўкі"</string>
     <string name="title_open" msgid="4353228937663917801">"Адкрыць з"</string>
     <string name="title_save" msgid="2433679664882857999">"Захаваць у"</string>
diff --git a/packages/DocumentsUI/res/values-bg/strings.xml b/packages/DocumentsUI/res/values-bg/strings.xml
index c35075e..ab9d228 100644
--- a/packages/DocumentsUI/res/values-bg/strings.xml
+++ b/packages/DocumentsUI/res/values-bg/strings.xml
@@ -16,7 +16,7 @@
 
 <resources xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
-    <string name="app_label" msgid="2783841764617238354">"Документи"</string>
+    <string name="app_label" msgid="1551050262492398204">"Файлове"</string>
     <string name="downloads_label" msgid="959113951084633612">"Изтегляния"</string>
     <string name="title_open" msgid="4353228937663917801">"Отваряне от"</string>
     <string name="title_save" msgid="2433679664882857999">"Запазване във:"</string>
diff --git a/packages/DocumentsUI/res/values-bn-rBD/strings.xml b/packages/DocumentsUI/res/values-bn-rBD/strings.xml
index 334a7ef7..3b2171d 100644
--- a/packages/DocumentsUI/res/values-bn-rBD/strings.xml
+++ b/packages/DocumentsUI/res/values-bn-rBD/strings.xml
@@ -16,7 +16,7 @@
 
 <resources xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
-    <string name="app_label" msgid="2783841764617238354">"দস্তাবেজগুলি"</string>
+    <string name="app_label" msgid="1551050262492398204">"ফাইল"</string>
     <string name="downloads_label" msgid="959113951084633612">"ডাউনলোডগুলি"</string>
     <string name="title_open" msgid="4353228937663917801">"এখান থেকে খুলুন"</string>
     <string name="title_save" msgid="2433679664882857999">"এতে সংরক্ষণ করুন"</string>
diff --git a/packages/DocumentsUI/res/values-bs-rBA/strings.xml b/packages/DocumentsUI/res/values-bs-rBA/strings.xml
index 7bdb458..5df3e53 100644
--- a/packages/DocumentsUI/res/values-bs-rBA/strings.xml
+++ b/packages/DocumentsUI/res/values-bs-rBA/strings.xml
@@ -16,7 +16,7 @@
 
 <resources xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
-    <string name="app_label" msgid="2783841764617238354">"Dokumenti"</string>
+    <string name="app_label" msgid="1551050262492398204">"Fajlovi"</string>
     <string name="downloads_label" msgid="959113951084633612">"Preuzimanja"</string>
     <string name="title_open" msgid="4353228937663917801">"Otvori iz"</string>
     <string name="title_save" msgid="2433679664882857999">"Sačuvaj u"</string>
diff --git a/packages/DocumentsUI/res/values-ca/strings.xml b/packages/DocumentsUI/res/values-ca/strings.xml
index 01a037f..40e67cf 100644
--- a/packages/DocumentsUI/res/values-ca/strings.xml
+++ b/packages/DocumentsUI/res/values-ca/strings.xml
@@ -16,7 +16,7 @@
 
 <resources xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
-    <string name="app_label" msgid="2783841764617238354">"Documents"</string>
+    <string name="app_label" msgid="1551050262492398204">"Fitxers"</string>
     <string name="downloads_label" msgid="959113951084633612">"Baixades"</string>
     <string name="title_open" msgid="4353228937663917801">"Obre des de"</string>
     <string name="title_save" msgid="2433679664882857999">"Desa a"</string>
diff --git a/packages/DocumentsUI/res/values-cs/strings.xml b/packages/DocumentsUI/res/values-cs/strings.xml
index 8a0d0bf..0132bda 100644
--- a/packages/DocumentsUI/res/values-cs/strings.xml
+++ b/packages/DocumentsUI/res/values-cs/strings.xml
@@ -16,7 +16,7 @@
 
 <resources xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
-    <string name="app_label" msgid="2783841764617238354">"Dokumenty"</string>
+    <string name="app_label" msgid="1551050262492398204">"Soubory"</string>
     <string name="downloads_label" msgid="959113951084633612">"Stahování"</string>
     <string name="title_open" msgid="4353228937663917801">"Otevřít"</string>
     <string name="title_save" msgid="2433679664882857999">"Uložit do"</string>
diff --git a/packages/DocumentsUI/res/values-da/strings.xml b/packages/DocumentsUI/res/values-da/strings.xml
index 98117cb..b47326e 100644
--- a/packages/DocumentsUI/res/values-da/strings.xml
+++ b/packages/DocumentsUI/res/values-da/strings.xml
@@ -16,7 +16,7 @@
 
 <resources xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
-    <string name="app_label" msgid="2783841764617238354">"Dokumenter"</string>
+    <string name="app_label" msgid="1551050262492398204">"Filer"</string>
     <string name="downloads_label" msgid="959113951084633612">"Downloads"</string>
     <string name="title_open" msgid="4353228937663917801">"Åbn fra"</string>
     <string name="title_save" msgid="2433679664882857999">"Gem i"</string>
diff --git a/packages/DocumentsUI/res/values-de/strings.xml b/packages/DocumentsUI/res/values-de/strings.xml
index 9a7cd85..123bf19 100644
--- a/packages/DocumentsUI/res/values-de/strings.xml
+++ b/packages/DocumentsUI/res/values-de/strings.xml
@@ -16,7 +16,7 @@
 
 <resources xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
-    <string name="app_label" msgid="2783841764617238354">"Dokumente"</string>
+    <string name="app_label" msgid="1551050262492398204">"Dateien"</string>
     <string name="downloads_label" msgid="959113951084633612">"Downloads"</string>
     <string name="title_open" msgid="4353228937663917801">"Öffnen von"</string>
     <string name="title_save" msgid="2433679664882857999">"Speichern unter"</string>
diff --git a/packages/DocumentsUI/res/values-el/strings.xml b/packages/DocumentsUI/res/values-el/strings.xml
index 39f0f47..5a199d7 100644
--- a/packages/DocumentsUI/res/values-el/strings.xml
+++ b/packages/DocumentsUI/res/values-el/strings.xml
@@ -16,7 +16,7 @@
 
 <resources xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
-    <string name="app_label" msgid="2783841764617238354">"Έγγραφα"</string>
+    <string name="app_label" msgid="1551050262492398204">"Αρχεία"</string>
     <string name="downloads_label" msgid="959113951084633612">"Λήψεις"</string>
     <string name="title_open" msgid="4353228937663917801">"Άνοιγμα από"</string>
     <string name="title_save" msgid="2433679664882857999">"Αποθήκευση σε"</string>
diff --git a/packages/DocumentsUI/res/values-en-rAU/strings.xml b/packages/DocumentsUI/res/values-en-rAU/strings.xml
index a871ac0..f2b25b8 100644
--- a/packages/DocumentsUI/res/values-en-rAU/strings.xml
+++ b/packages/DocumentsUI/res/values-en-rAU/strings.xml
@@ -16,7 +16,7 @@
 
 <resources xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
-    <string name="app_label" msgid="2783841764617238354">"Documents"</string>
+    <string name="app_label" msgid="1551050262492398204">"Files"</string>
     <string name="downloads_label" msgid="959113951084633612">"Downloads"</string>
     <string name="title_open" msgid="4353228937663917801">"Open from"</string>
     <string name="title_save" msgid="2433679664882857999">"Save to"</string>
@@ -109,7 +109,7 @@
       <item quantity="one">Copied <xliff:g id="COUNT_0">%1$d</xliff:g> file to clipboard.</item>
     </plurals>
     <string name="clipboard_files_cannot_paste" msgid="2878324825602325706">"Cannot paste the selected files in this location."</string>
-    <string name="menu_rename" msgid="7678802479104285353">"rename"</string>
+    <string name="menu_rename" msgid="7678802479104285353">"Rename"</string>
     <string name="rename_error" msgid="4203041674883412606">"Failed to rename document"</string>
     <string name="menu_eject_root" msgid="2768224615494227325">"Eject"</string>
     <string name="notification_copy_files_converted_title" msgid="3153573223054275181">"Some files were converted"</string>
diff --git a/packages/DocumentsUI/res/values-en-rGB/strings.xml b/packages/DocumentsUI/res/values-en-rGB/strings.xml
index a871ac0..f2b25b8 100644
--- a/packages/DocumentsUI/res/values-en-rGB/strings.xml
+++ b/packages/DocumentsUI/res/values-en-rGB/strings.xml
@@ -16,7 +16,7 @@
 
 <resources xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
-    <string name="app_label" msgid="2783841764617238354">"Documents"</string>
+    <string name="app_label" msgid="1551050262492398204">"Files"</string>
     <string name="downloads_label" msgid="959113951084633612">"Downloads"</string>
     <string name="title_open" msgid="4353228937663917801">"Open from"</string>
     <string name="title_save" msgid="2433679664882857999">"Save to"</string>
@@ -109,7 +109,7 @@
       <item quantity="one">Copied <xliff:g id="COUNT_0">%1$d</xliff:g> file to clipboard.</item>
     </plurals>
     <string name="clipboard_files_cannot_paste" msgid="2878324825602325706">"Cannot paste the selected files in this location."</string>
-    <string name="menu_rename" msgid="7678802479104285353">"rename"</string>
+    <string name="menu_rename" msgid="7678802479104285353">"Rename"</string>
     <string name="rename_error" msgid="4203041674883412606">"Failed to rename document"</string>
     <string name="menu_eject_root" msgid="2768224615494227325">"Eject"</string>
     <string name="notification_copy_files_converted_title" msgid="3153573223054275181">"Some files were converted"</string>
diff --git a/packages/DocumentsUI/res/values-en-rIN/strings.xml b/packages/DocumentsUI/res/values-en-rIN/strings.xml
index a871ac0..f2b25b8 100644
--- a/packages/DocumentsUI/res/values-en-rIN/strings.xml
+++ b/packages/DocumentsUI/res/values-en-rIN/strings.xml
@@ -16,7 +16,7 @@
 
 <resources xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
-    <string name="app_label" msgid="2783841764617238354">"Documents"</string>
+    <string name="app_label" msgid="1551050262492398204">"Files"</string>
     <string name="downloads_label" msgid="959113951084633612">"Downloads"</string>
     <string name="title_open" msgid="4353228937663917801">"Open from"</string>
     <string name="title_save" msgid="2433679664882857999">"Save to"</string>
@@ -109,7 +109,7 @@
       <item quantity="one">Copied <xliff:g id="COUNT_0">%1$d</xliff:g> file to clipboard.</item>
     </plurals>
     <string name="clipboard_files_cannot_paste" msgid="2878324825602325706">"Cannot paste the selected files in this location."</string>
-    <string name="menu_rename" msgid="7678802479104285353">"rename"</string>
+    <string name="menu_rename" msgid="7678802479104285353">"Rename"</string>
     <string name="rename_error" msgid="4203041674883412606">"Failed to rename document"</string>
     <string name="menu_eject_root" msgid="2768224615494227325">"Eject"</string>
     <string name="notification_copy_files_converted_title" msgid="3153573223054275181">"Some files were converted"</string>
diff --git a/packages/DocumentsUI/res/values-es-rUS/strings.xml b/packages/DocumentsUI/res/values-es-rUS/strings.xml
index fb4d13c..1cd7428 100644
--- a/packages/DocumentsUI/res/values-es-rUS/strings.xml
+++ b/packages/DocumentsUI/res/values-es-rUS/strings.xml
@@ -16,7 +16,7 @@
 
 <resources xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
-    <string name="app_label" msgid="2783841764617238354">"Documentos"</string>
+    <string name="app_label" msgid="1551050262492398204">"Archivos"</string>
     <string name="downloads_label" msgid="959113951084633612">"Descargas"</string>
     <string name="title_open" msgid="4353228937663917801">"Abrir desde"</string>
     <string name="title_save" msgid="2433679664882857999">"Guardar en"</string>
diff --git a/packages/DocumentsUI/res/values-es/strings.xml b/packages/DocumentsUI/res/values-es/strings.xml
index 41ace13..e3de716 100644
--- a/packages/DocumentsUI/res/values-es/strings.xml
+++ b/packages/DocumentsUI/res/values-es/strings.xml
@@ -16,7 +16,7 @@
 
 <resources xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
-    <string name="app_label" msgid="2783841764617238354">"Documentos"</string>
+    <string name="app_label" msgid="1551050262492398204">"Archivos"</string>
     <string name="downloads_label" msgid="959113951084633612">"Descargas"</string>
     <string name="title_open" msgid="4353228937663917801">"Abrir desde"</string>
     <string name="title_save" msgid="2433679664882857999">"Guardar en"</string>
diff --git a/packages/DocumentsUI/res/values-et-rEE/strings.xml b/packages/DocumentsUI/res/values-et-rEE/strings.xml
index 31a6726..91f9204 100644
--- a/packages/DocumentsUI/res/values-et-rEE/strings.xml
+++ b/packages/DocumentsUI/res/values-et-rEE/strings.xml
@@ -16,7 +16,7 @@
 
 <resources xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
-    <string name="app_label" msgid="2783841764617238354">"Dokumendid"</string>
+    <string name="app_label" msgid="1551050262492398204">"Failid"</string>
     <string name="downloads_label" msgid="959113951084633612">"Allalaadimised"</string>
     <string name="title_open" msgid="4353228937663917801">"Ava asukohast:"</string>
     <string name="title_save" msgid="2433679664882857999">"Salvesta:"</string>
diff --git a/packages/DocumentsUI/res/values-eu-rES/strings.xml b/packages/DocumentsUI/res/values-eu-rES/strings.xml
index 8810f99..34db965 100644
--- a/packages/DocumentsUI/res/values-eu-rES/strings.xml
+++ b/packages/DocumentsUI/res/values-eu-rES/strings.xml
@@ -16,7 +16,7 @@
 
 <resources xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
-    <string name="app_label" msgid="2783841764617238354">"Dokumentuak"</string>
+    <string name="app_label" msgid="1551050262492398204">"Fitxategiak"</string>
     <string name="downloads_label" msgid="959113951084633612">"Deskargak"</string>
     <string name="title_open" msgid="4353228937663917801">"Ireki hemendik"</string>
     <string name="title_save" msgid="2433679664882857999">"Gorde hemen"</string>
diff --git a/packages/DocumentsUI/res/values-fa/strings.xml b/packages/DocumentsUI/res/values-fa/strings.xml
index 39074e0..4db84b9 100644
--- a/packages/DocumentsUI/res/values-fa/strings.xml
+++ b/packages/DocumentsUI/res/values-fa/strings.xml
@@ -16,7 +16,7 @@
 
 <resources xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
-    <string name="app_label" msgid="2783841764617238354">"اسناد"</string>
+    <string name="app_label" msgid="1551050262492398204">"Files"</string>
     <string name="downloads_label" msgid="959113951084633612">"بارگیری‌ها"</string>
     <string name="title_open" msgid="4353228937663917801">"باز کردن از"</string>
     <string name="title_save" msgid="2433679664882857999">"ذخیره در"</string>
diff --git a/packages/DocumentsUI/res/values-fi/strings.xml b/packages/DocumentsUI/res/values-fi/strings.xml
index cc87026..d1d0032 100644
--- a/packages/DocumentsUI/res/values-fi/strings.xml
+++ b/packages/DocumentsUI/res/values-fi/strings.xml
@@ -16,7 +16,7 @@
 
 <resources xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
-    <string name="app_label" msgid="2783841764617238354">"Asiakirjat"</string>
+    <string name="app_label" msgid="1551050262492398204">"Tiedostot"</string>
     <string name="downloads_label" msgid="959113951084633612">"Lataukset"</string>
     <string name="title_open" msgid="4353228937663917801">"Avaa sijainnista"</string>
     <string name="title_save" msgid="2433679664882857999">"Tallenna kohteeseen"</string>
diff --git a/packages/DocumentsUI/res/values-fr-rCA/strings.xml b/packages/DocumentsUI/res/values-fr-rCA/strings.xml
index acac67a2..ae76565 100644
--- a/packages/DocumentsUI/res/values-fr-rCA/strings.xml
+++ b/packages/DocumentsUI/res/values-fr-rCA/strings.xml
@@ -16,7 +16,7 @@
 
 <resources xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
-    <string name="app_label" msgid="2783841764617238354">"Documents"</string>
+    <string name="app_label" msgid="1551050262492398204">"Fichiers"</string>
     <string name="downloads_label" msgid="959113951084633612">"Téléchargements"</string>
     <string name="title_open" msgid="4353228937663917801">"Ouvrir à partir de"</string>
     <string name="title_save" msgid="2433679664882857999">"Enregistrer dans"</string>
diff --git a/packages/DocumentsUI/res/values-fr/strings.xml b/packages/DocumentsUI/res/values-fr/strings.xml
index 9a11333..5f45aae 100644
--- a/packages/DocumentsUI/res/values-fr/strings.xml
+++ b/packages/DocumentsUI/res/values-fr/strings.xml
@@ -16,7 +16,7 @@
 
 <resources xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
-    <string name="app_label" msgid="2783841764617238354">"Docs"</string>
+    <string name="app_label" msgid="1551050262492398204">"Fichiers"</string>
     <string name="downloads_label" msgid="959113951084633612">"Téléchargements"</string>
     <string name="title_open" msgid="4353228937663917801">"Ouvrir à partir de"</string>
     <string name="title_save" msgid="2433679664882857999">"Enregistrer sous"</string>
diff --git a/packages/DocumentsUI/res/values-gl-rES/strings.xml b/packages/DocumentsUI/res/values-gl-rES/strings.xml
index 645de56..46a5fb0 100644
--- a/packages/DocumentsUI/res/values-gl-rES/strings.xml
+++ b/packages/DocumentsUI/res/values-gl-rES/strings.xml
@@ -16,7 +16,7 @@
 
 <resources xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
-    <string name="app_label" msgid="2783841764617238354">"Documentos"</string>
+    <string name="app_label" msgid="1551050262492398204">"Ficheiros"</string>
     <string name="downloads_label" msgid="959113951084633612">"Descargas"</string>
     <string name="title_open" msgid="4353228937663917801">"Abrir desde"</string>
     <string name="title_save" msgid="2433679664882857999">"Gardar en"</string>
diff --git a/packages/DocumentsUI/res/values-gu-rIN/strings.xml b/packages/DocumentsUI/res/values-gu-rIN/strings.xml
index 7fa1b24..974d1f2 100644
--- a/packages/DocumentsUI/res/values-gu-rIN/strings.xml
+++ b/packages/DocumentsUI/res/values-gu-rIN/strings.xml
@@ -16,7 +16,7 @@
 
 <resources xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
-    <string name="app_label" msgid="2783841764617238354">"દસ્તાવેજો"</string>
+    <string name="app_label" msgid="1551050262492398204">"ફાઇલો"</string>
     <string name="downloads_label" msgid="959113951084633612">"ડાઉનલોડ્સ"</string>
     <string name="title_open" msgid="4353228937663917801">"અહીંથી ખોલો"</string>
     <string name="title_save" msgid="2433679664882857999">"આમાં સાચવો"</string>
diff --git a/packages/DocumentsUI/res/values-hi/strings.xml b/packages/DocumentsUI/res/values-hi/strings.xml
index da69875..ff0faed 100644
--- a/packages/DocumentsUI/res/values-hi/strings.xml
+++ b/packages/DocumentsUI/res/values-hi/strings.xml
@@ -16,7 +16,7 @@
 
 <resources xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
-    <string name="app_label" msgid="2783841764617238354">"दस्तावेज़"</string>
+    <string name="app_label" msgid="1551050262492398204">"फ़ाइल"</string>
     <string name="downloads_label" msgid="959113951084633612">"डाउनलोड"</string>
     <string name="title_open" msgid="4353228937663917801">"यहां से खोलें"</string>
     <string name="title_save" msgid="2433679664882857999">"यहां सहेजें"</string>
diff --git a/packages/DocumentsUI/res/values-hr/strings.xml b/packages/DocumentsUI/res/values-hr/strings.xml
index 030fedb..dfaebd3 100644
--- a/packages/DocumentsUI/res/values-hr/strings.xml
+++ b/packages/DocumentsUI/res/values-hr/strings.xml
@@ -16,7 +16,7 @@
 
 <resources xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
-    <string name="app_label" msgid="2783841764617238354">"Dokumenti"</string>
+    <string name="app_label" msgid="1551050262492398204">"Datoteke"</string>
     <string name="downloads_label" msgid="959113951084633612">"Preuzimanja"</string>
     <string name="title_open" msgid="4353228937663917801">"Otvori iz"</string>
     <string name="title_save" msgid="2433679664882857999">"Spremi u"</string>
diff --git a/packages/DocumentsUI/res/values-hu/strings.xml b/packages/DocumentsUI/res/values-hu/strings.xml
index 2224592..0044081 100644
--- a/packages/DocumentsUI/res/values-hu/strings.xml
+++ b/packages/DocumentsUI/res/values-hu/strings.xml
@@ -16,7 +16,7 @@
 
 <resources xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
-    <string name="app_label" msgid="2783841764617238354">"Dokumentumok"</string>
+    <string name="app_label" msgid="1551050262492398204">"Fájlok"</string>
     <string name="downloads_label" msgid="959113951084633612">"Letöltések"</string>
     <string name="title_open" msgid="4353228937663917801">"Megnyitás innen"</string>
     <string name="title_save" msgid="2433679664882857999">"Mentés ide"</string>
diff --git a/packages/DocumentsUI/res/values-hy-rAM/strings.xml b/packages/DocumentsUI/res/values-hy-rAM/strings.xml
index 5d63784..f4c85c3 100644
--- a/packages/DocumentsUI/res/values-hy-rAM/strings.xml
+++ b/packages/DocumentsUI/res/values-hy-rAM/strings.xml
@@ -16,7 +16,7 @@
 
 <resources xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
-    <string name="app_label" msgid="2783841764617238354">"Փաստաթղթեր"</string>
+    <string name="app_label" msgid="1551050262492398204">"Ֆայլեր"</string>
     <string name="downloads_label" msgid="959113951084633612">"Ներբեռնումներ"</string>
     <string name="title_open" msgid="4353228937663917801">"Բացել այստեղից"</string>
     <string name="title_save" msgid="2433679664882857999">"Պահել այստեղ"</string>
diff --git a/packages/DocumentsUI/res/values-in/strings.xml b/packages/DocumentsUI/res/values-in/strings.xml
index 2e8b0ea..964c69a 100644
--- a/packages/DocumentsUI/res/values-in/strings.xml
+++ b/packages/DocumentsUI/res/values-in/strings.xml
@@ -16,7 +16,7 @@
 
 <resources xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
-    <string name="app_label" msgid="2783841764617238354">"Dokumen"</string>
+    <string name="app_label" msgid="1551050262492398204">"File"</string>
     <string name="downloads_label" msgid="959113951084633612">"Unduhan"</string>
     <string name="title_open" msgid="4353228937663917801">"Buka dari"</string>
     <string name="title_save" msgid="2433679664882857999">"Simpan ke"</string>
diff --git a/packages/DocumentsUI/res/values-is-rIS/strings.xml b/packages/DocumentsUI/res/values-is-rIS/strings.xml
index 0cb8387..983090c 100644
--- a/packages/DocumentsUI/res/values-is-rIS/strings.xml
+++ b/packages/DocumentsUI/res/values-is-rIS/strings.xml
@@ -16,7 +16,7 @@
 
 <resources xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
-    <string name="app_label" msgid="2783841764617238354">"Skjöl"</string>
+    <string name="app_label" msgid="1551050262492398204">"Skrár"</string>
     <string name="downloads_label" msgid="959113951084633612">"Niðurhal"</string>
     <string name="title_open" msgid="4353228937663917801">"Opna frá"</string>
     <string name="title_save" msgid="2433679664882857999">"Vista í"</string>
diff --git a/packages/DocumentsUI/res/values-it/strings.xml b/packages/DocumentsUI/res/values-it/strings.xml
index eb06d5f..df287fe 100644
--- a/packages/DocumentsUI/res/values-it/strings.xml
+++ b/packages/DocumentsUI/res/values-it/strings.xml
@@ -16,7 +16,7 @@
 
 <resources xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
-    <string name="app_label" msgid="2783841764617238354">"Documenti"</string>
+    <string name="app_label" msgid="1551050262492398204">"File"</string>
     <string name="downloads_label" msgid="959113951084633612">"Download"</string>
     <string name="title_open" msgid="4353228937663917801">"Apri da"</string>
     <string name="title_save" msgid="2433679664882857999">"Salva in"</string>
diff --git a/packages/DocumentsUI/res/values-iw/strings.xml b/packages/DocumentsUI/res/values-iw/strings.xml
index 2d81be7..19e3790 100644
--- a/packages/DocumentsUI/res/values-iw/strings.xml
+++ b/packages/DocumentsUI/res/values-iw/strings.xml
@@ -16,7 +16,7 @@
 
 <resources xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
-    <string name="app_label" msgid="2783841764617238354">"מסמכים"</string>
+    <string name="app_label" msgid="1551050262492398204">"קבצים"</string>
     <string name="downloads_label" msgid="959113951084633612">"הורדות"</string>
     <string name="title_open" msgid="4353228937663917801">"פתח מ-"</string>
     <string name="title_save" msgid="2433679664882857999">"שמור ב-"</string>
diff --git a/packages/DocumentsUI/res/values-ja/strings.xml b/packages/DocumentsUI/res/values-ja/strings.xml
index 200202f..3cee741 100644
--- a/packages/DocumentsUI/res/values-ja/strings.xml
+++ b/packages/DocumentsUI/res/values-ja/strings.xml
@@ -16,7 +16,7 @@
 
 <resources xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
-    <string name="app_label" msgid="2783841764617238354">"ドキュメント"</string>
+    <string name="app_label" msgid="1551050262492398204">"ファイル"</string>
     <string name="downloads_label" msgid="959113951084633612">"ダウンロード"</string>
     <string name="title_open" msgid="4353228937663917801">"次から開く:"</string>
     <string name="title_save" msgid="2433679664882857999">"次に保存:"</string>
diff --git a/packages/DocumentsUI/res/values-ka-rGE/strings.xml b/packages/DocumentsUI/res/values-ka-rGE/strings.xml
index 57e565d..ccb96a7 100644
--- a/packages/DocumentsUI/res/values-ka-rGE/strings.xml
+++ b/packages/DocumentsUI/res/values-ka-rGE/strings.xml
@@ -16,7 +16,7 @@
 
 <resources xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
-    <string name="app_label" msgid="2783841764617238354">"დოკუმენტები"</string>
+    <string name="app_label" msgid="1551050262492398204">"ფაილები"</string>
     <string name="downloads_label" msgid="959113951084633612">"ჩამოტვირთვები"</string>
     <string name="title_open" msgid="4353228937663917801">"გახსნა აქედან:"</string>
     <string name="title_save" msgid="2433679664882857999">"შენახვა აქ:"</string>
diff --git a/packages/DocumentsUI/res/values-kk-rKZ/strings.xml b/packages/DocumentsUI/res/values-kk-rKZ/strings.xml
index d2b89ea..2925361 100644
--- a/packages/DocumentsUI/res/values-kk-rKZ/strings.xml
+++ b/packages/DocumentsUI/res/values-kk-rKZ/strings.xml
@@ -16,7 +16,7 @@
 
 <resources xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
-    <string name="app_label" msgid="2783841764617238354">"Құжаттар"</string>
+    <string name="app_label" msgid="1551050262492398204">"Файлдар"</string>
     <string name="downloads_label" msgid="959113951084633612">"Жүктеулер"</string>
     <string name="title_open" msgid="4353228937663917801">"Мынадан ашу:"</string>
     <string name="title_save" msgid="2433679664882857999">"Сақталатын орны"</string>
diff --git a/packages/DocumentsUI/res/values-km-rKH/strings.xml b/packages/DocumentsUI/res/values-km-rKH/strings.xml
index f618c1a..808a63e 100644
--- a/packages/DocumentsUI/res/values-km-rKH/strings.xml
+++ b/packages/DocumentsUI/res/values-km-rKH/strings.xml
@@ -16,7 +16,7 @@
 
 <resources xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
-    <string name="app_label" msgid="2783841764617238354">"ឯកសារ"</string>
+    <string name="app_label" msgid="1551050262492398204">"ឯកសារ"</string>
     <string name="downloads_label" msgid="959113951084633612">"ទាញយក"</string>
     <string name="title_open" msgid="4353228937663917801">"បើក​ពី"</string>
     <string name="title_save" msgid="2433679664882857999">"រក្សា​ទុក​ទៅ"</string>
diff --git a/packages/DocumentsUI/res/values-kn-rIN/strings.xml b/packages/DocumentsUI/res/values-kn-rIN/strings.xml
index 0679776..9e83f2a 100644
--- a/packages/DocumentsUI/res/values-kn-rIN/strings.xml
+++ b/packages/DocumentsUI/res/values-kn-rIN/strings.xml
@@ -16,7 +16,7 @@
 
 <resources xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
-    <string name="app_label" msgid="2783841764617238354">"ಡಾಕ್ಯುಮೆಂಟ್‌ಗಳು"</string>
+    <string name="app_label" msgid="1551050262492398204">"ಫೈಲ್‌ಗಳು"</string>
     <string name="downloads_label" msgid="959113951084633612">"ಡೌನ್‌ಲೋಡ್‌ಗಳು"</string>
     <string name="title_open" msgid="4353228937663917801">"ಇದರ ಮೂಲಕ ತೆರೆಯಿರಿ"</string>
     <string name="title_save" msgid="2433679664882857999">"ಇವುಗಳಲ್ಲಿ ಉಳಿಸಿ"</string>
diff --git a/packages/DocumentsUI/res/values-ko/strings.xml b/packages/DocumentsUI/res/values-ko/strings.xml
index ffb1363..c990d9f 100644
--- a/packages/DocumentsUI/res/values-ko/strings.xml
+++ b/packages/DocumentsUI/res/values-ko/strings.xml
@@ -16,7 +16,7 @@
 
 <resources xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
-    <string name="app_label" msgid="2783841764617238354">"문서"</string>
+    <string name="app_label" msgid="1551050262492398204">"파일"</string>
     <string name="downloads_label" msgid="959113951084633612">"다운로드"</string>
     <string name="title_open" msgid="4353228937663917801">"열기:"</string>
     <string name="title_save" msgid="2433679664882857999">"저장 위치:"</string>
diff --git a/packages/DocumentsUI/res/values-ky-rKG/strings.xml b/packages/DocumentsUI/res/values-ky-rKG/strings.xml
index 9d5d475..5c1d71a 100644
--- a/packages/DocumentsUI/res/values-ky-rKG/strings.xml
+++ b/packages/DocumentsUI/res/values-ky-rKG/strings.xml
@@ -16,7 +16,7 @@
 
 <resources xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
-    <string name="app_label" msgid="2783841764617238354">"Документтер"</string>
+    <string name="app_label" msgid="1551050262492398204">"Файлдар"</string>
     <string name="downloads_label" msgid="959113951084633612">"Жүктөлүп алынгандар"</string>
     <string name="title_open" msgid="4353228937663917801">"Кийинкиден ачуу:"</string>
     <string name="title_save" msgid="2433679664882857999">"Кийинкиге сактоо:"</string>
diff --git a/packages/DocumentsUI/res/values-lo-rLA/strings.xml b/packages/DocumentsUI/res/values-lo-rLA/strings.xml
index 0f66f55..cb1bad3 100644
--- a/packages/DocumentsUI/res/values-lo-rLA/strings.xml
+++ b/packages/DocumentsUI/res/values-lo-rLA/strings.xml
@@ -16,7 +16,7 @@
 
 <resources xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
-    <string name="app_label" msgid="2783841764617238354">"ເອ​ກະ​ສານ"</string>
+    <string name="app_label" msgid="1551050262492398204">"​ໄຟລ໌"</string>
     <string name="downloads_label" msgid="959113951084633612">"ການດາວໂຫລດ"</string>
     <string name="title_open" msgid="4353228937663917801">"ເປີດ​ຈາກ"</string>
     <string name="title_save" msgid="2433679664882857999">"ບັນທຶກໄປທີ່"</string>
diff --git a/packages/DocumentsUI/res/values-lt/strings.xml b/packages/DocumentsUI/res/values-lt/strings.xml
index 02ee8f6..5e5dbfa 100644
--- a/packages/DocumentsUI/res/values-lt/strings.xml
+++ b/packages/DocumentsUI/res/values-lt/strings.xml
@@ -16,7 +16,7 @@
 
 <resources xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
-    <string name="app_label" msgid="2783841764617238354">"Dokumentai"</string>
+    <string name="app_label" msgid="1551050262492398204">"Failai"</string>
     <string name="downloads_label" msgid="959113951084633612">"Atsisiuntimai"</string>
     <string name="title_open" msgid="4353228937663917801">"Atidaryti iš"</string>
     <string name="title_save" msgid="2433679664882857999">"Išsaugoti į"</string>
diff --git a/packages/DocumentsUI/res/values-lv/strings.xml b/packages/DocumentsUI/res/values-lv/strings.xml
index b4ae3fc..56a9deb 100644
--- a/packages/DocumentsUI/res/values-lv/strings.xml
+++ b/packages/DocumentsUI/res/values-lv/strings.xml
@@ -16,7 +16,7 @@
 
 <resources xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
-    <string name="app_label" msgid="2783841764617238354">"Dokumenti"</string>
+    <string name="app_label" msgid="1551050262492398204">"Faili"</string>
     <string name="downloads_label" msgid="959113951084633612">"Lejupielādes"</string>
     <string name="title_open" msgid="4353228937663917801">"Atvēršana no:"</string>
     <string name="title_save" msgid="2433679664882857999">"Saglabāšana:"</string>
diff --git a/packages/DocumentsUI/res/values-mk-rMK/strings.xml b/packages/DocumentsUI/res/values-mk-rMK/strings.xml
index 9df2aad..58bfc99 100644
--- a/packages/DocumentsUI/res/values-mk-rMK/strings.xml
+++ b/packages/DocumentsUI/res/values-mk-rMK/strings.xml
@@ -16,7 +16,7 @@
 
 <resources xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
-    <string name="app_label" msgid="2783841764617238354">"Документи"</string>
+    <string name="app_label" msgid="1551050262492398204">"Датотеки"</string>
     <string name="downloads_label" msgid="959113951084633612">"Преземања"</string>
     <string name="title_open" msgid="4353228937663917801">"Отвори од"</string>
     <string name="title_save" msgid="2433679664882857999">"Зачувај во"</string>
diff --git a/packages/DocumentsUI/res/values-ml-rIN/strings.xml b/packages/DocumentsUI/res/values-ml-rIN/strings.xml
index 8c3b885..54d32a5 100644
--- a/packages/DocumentsUI/res/values-ml-rIN/strings.xml
+++ b/packages/DocumentsUI/res/values-ml-rIN/strings.xml
@@ -16,7 +16,7 @@
 
 <resources xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
-    <string name="app_label" msgid="2783841764617238354">"പ്രമാണങ്ങൾ"</string>
+    <string name="app_label" msgid="1551050262492398204">"ഫയലുകൾ"</string>
     <string name="downloads_label" msgid="959113951084633612">"ഡൗണ്‍ലോഡുകൾ"</string>
     <string name="title_open" msgid="4353228937663917801">"ഇതിൽ നിന്നും തുറക്കുക"</string>
     <string name="title_save" msgid="2433679664882857999">"ഇതില്‍‌ സംരക്ഷിക്കുക"</string>
diff --git a/packages/DocumentsUI/res/values-mn-rMN/strings.xml b/packages/DocumentsUI/res/values-mn-rMN/strings.xml
index 234e1a9..7b7f6c9 100644
--- a/packages/DocumentsUI/res/values-mn-rMN/strings.xml
+++ b/packages/DocumentsUI/res/values-mn-rMN/strings.xml
@@ -16,7 +16,7 @@
 
 <resources xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
-    <string name="app_label" msgid="2783841764617238354">"Документүүд"</string>
+    <string name="app_label" msgid="1551050262492398204">"Файл"</string>
     <string name="downloads_label" msgid="959113951084633612">"Таталт"</string>
     <string name="title_open" msgid="4353228937663917801">"Нээх"</string>
     <string name="title_save" msgid="2433679664882857999">"Хадгалах"</string>
diff --git a/packages/DocumentsUI/res/values-mr-rIN/strings.xml b/packages/DocumentsUI/res/values-mr-rIN/strings.xml
index e204c46..a501a72 100644
--- a/packages/DocumentsUI/res/values-mr-rIN/strings.xml
+++ b/packages/DocumentsUI/res/values-mr-rIN/strings.xml
@@ -16,7 +16,7 @@
 
 <resources xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
-    <string name="app_label" msgid="2783841764617238354">"दस्तऐवज"</string>
+    <string name="app_label" msgid="1551050262492398204">"फायली"</string>
     <string name="downloads_label" msgid="959113951084633612">"डाउनलोड"</string>
     <string name="title_open" msgid="4353228937663917801">"वरून उघडा"</string>
     <string name="title_save" msgid="2433679664882857999">"येथे जतन करा"</string>
diff --git a/packages/DocumentsUI/res/values-ms-rMY/strings.xml b/packages/DocumentsUI/res/values-ms-rMY/strings.xml
index a16fa4c..139d021 100644
--- a/packages/DocumentsUI/res/values-ms-rMY/strings.xml
+++ b/packages/DocumentsUI/res/values-ms-rMY/strings.xml
@@ -16,7 +16,7 @@
 
 <resources xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
-    <string name="app_label" msgid="2783841764617238354">"Dokumen"</string>
+    <string name="app_label" msgid="1551050262492398204">"Fail"</string>
     <string name="downloads_label" msgid="959113951084633612">"Muat turun"</string>
     <string name="title_open" msgid="4353228937663917801">"Buka dari"</string>
     <string name="title_save" msgid="2433679664882857999">"Simpan ke"</string>
diff --git a/packages/DocumentsUI/res/values-my-rMM/strings.xml b/packages/DocumentsUI/res/values-my-rMM/strings.xml
index fef5e87..366c484 100644
--- a/packages/DocumentsUI/res/values-my-rMM/strings.xml
+++ b/packages/DocumentsUI/res/values-my-rMM/strings.xml
@@ -16,7 +16,7 @@
 
 <resources xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
-    <string name="app_label" msgid="2783841764617238354">"စာရွက်စာတန်းများ"</string>
+    <string name="app_label" msgid="1551050262492398204">"ဖိုင်များ"</string>
     <string name="downloads_label" msgid="959113951084633612">"ဒေါင်းလုဒ်များ"</string>
     <string name="title_open" msgid="4353228937663917801">"မှ ဖွင့်ပါ"</string>
     <string name="title_save" msgid="2433679664882857999">"သို့ သိမ်းပါ"</string>
diff --git a/packages/DocumentsUI/res/values-nb/strings.xml b/packages/DocumentsUI/res/values-nb/strings.xml
index d3b1996..e7b057b 100644
--- a/packages/DocumentsUI/res/values-nb/strings.xml
+++ b/packages/DocumentsUI/res/values-nb/strings.xml
@@ -16,7 +16,7 @@
 
 <resources xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
-    <string name="app_label" msgid="2783841764617238354">"Dokumenter"</string>
+    <string name="app_label" msgid="1551050262492398204">"Filer"</string>
     <string name="downloads_label" msgid="959113951084633612">"Nedlastinger"</string>
     <string name="title_open" msgid="4353228937663917801">"Åpne fra"</string>
     <string name="title_save" msgid="2433679664882857999">"Lagre i"</string>
diff --git a/packages/DocumentsUI/res/values-ne-rNP/strings.xml b/packages/DocumentsUI/res/values-ne-rNP/strings.xml
index ab8f8b1..62fbc1a 100644
--- a/packages/DocumentsUI/res/values-ne-rNP/strings.xml
+++ b/packages/DocumentsUI/res/values-ne-rNP/strings.xml
@@ -16,7 +16,7 @@
 
 <resources xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
-    <string name="app_label" msgid="2783841764617238354">"कागजातहरू"</string>
+    <string name="app_label" msgid="1551050262492398204">"फाइलहरू"</string>
     <string name="downloads_label" msgid="959113951084633612">"डाउनलोडहरू"</string>
     <string name="title_open" msgid="4353228937663917801">"यसबाट खोल्नुहोस्"</string>
     <string name="title_save" msgid="2433679664882857999">"यसमा सुरक्षित गर्नुहोस्"</string>
diff --git a/packages/DocumentsUI/res/values-nl/strings.xml b/packages/DocumentsUI/res/values-nl/strings.xml
index 6eb9aac..446e4b0 100644
--- a/packages/DocumentsUI/res/values-nl/strings.xml
+++ b/packages/DocumentsUI/res/values-nl/strings.xml
@@ -16,7 +16,7 @@
 
 <resources xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
-    <string name="app_label" msgid="2783841764617238354">"Documenten"</string>
+    <string name="app_label" msgid="1551050262492398204">"Bestanden"</string>
     <string name="downloads_label" msgid="959113951084633612">"Downloads"</string>
     <string name="title_open" msgid="4353228937663917801">"Openen vanuit"</string>
     <string name="title_save" msgid="2433679664882857999">"Opslaan in"</string>
diff --git a/packages/DocumentsUI/res/values-pa-rIN/strings.xml b/packages/DocumentsUI/res/values-pa-rIN/strings.xml
index f53cccf..db1bf33 100644
--- a/packages/DocumentsUI/res/values-pa-rIN/strings.xml
+++ b/packages/DocumentsUI/res/values-pa-rIN/strings.xml
@@ -16,7 +16,7 @@
 
 <resources xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
-    <string name="app_label" msgid="2783841764617238354">"ਦਸਤਾਵੇਜ਼"</string>
+    <string name="app_label" msgid="1551050262492398204">"ਫ਼ਾਈਲਾਂ"</string>
     <string name="downloads_label" msgid="959113951084633612">"ਡਾਊਨਲੋਡ"</string>
     <string name="title_open" msgid="4353228937663917801">"ਤੋਂ ਖੋਲ੍ਹੋ"</string>
     <string name="title_save" msgid="2433679664882857999">"ਇਸ ਵਿੱਚ ਰੱਖਿਅਤ ਕਰੋ"</string>
diff --git a/packages/DocumentsUI/res/values-pl/strings.xml b/packages/DocumentsUI/res/values-pl/strings.xml
index 33baba9..835cbd3 100644
--- a/packages/DocumentsUI/res/values-pl/strings.xml
+++ b/packages/DocumentsUI/res/values-pl/strings.xml
@@ -16,7 +16,7 @@
 
 <resources xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
-    <string name="app_label" msgid="2783841764617238354">"Dokumenty"</string>
+    <string name="app_label" msgid="1551050262492398204">"Pliki"</string>
     <string name="downloads_label" msgid="959113951084633612">"Pobrane"</string>
     <string name="title_open" msgid="4353228937663917801">"Otwórz z"</string>
     <string name="title_save" msgid="2433679664882857999">"Zapisz w"</string>
diff --git a/packages/DocumentsUI/res/values-pt-rBR/strings.xml b/packages/DocumentsUI/res/values-pt-rBR/strings.xml
index 718d70f..2134499 100644
--- a/packages/DocumentsUI/res/values-pt-rBR/strings.xml
+++ b/packages/DocumentsUI/res/values-pt-rBR/strings.xml
@@ -16,7 +16,7 @@
 
 <resources xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
-    <string name="app_label" msgid="2783841764617238354">"Documentos"</string>
+    <string name="app_label" msgid="1551050262492398204">"Arquivos"</string>
     <string name="downloads_label" msgid="959113951084633612">"Downloads"</string>
     <string name="title_open" msgid="4353228937663917801">"Abrir de"</string>
     <string name="title_save" msgid="2433679664882857999">"Salvar em"</string>
diff --git a/packages/DocumentsUI/res/values-pt-rPT/strings.xml b/packages/DocumentsUI/res/values-pt-rPT/strings.xml
index e382def..f8b54a4 100644
--- a/packages/DocumentsUI/res/values-pt-rPT/strings.xml
+++ b/packages/DocumentsUI/res/values-pt-rPT/strings.xml
@@ -16,7 +16,7 @@
 
 <resources xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
-    <string name="app_label" msgid="2783841764617238354">"Documentos"</string>
+    <string name="app_label" msgid="1551050262492398204">"Ficheiros"</string>
     <string name="downloads_label" msgid="959113951084633612">"Transferências"</string>
     <string name="title_open" msgid="4353228937663917801">"Abrir de"</string>
     <string name="title_save" msgid="2433679664882857999">"Guardar em"</string>
diff --git a/packages/DocumentsUI/res/values-pt/strings.xml b/packages/DocumentsUI/res/values-pt/strings.xml
index 718d70f..2134499 100644
--- a/packages/DocumentsUI/res/values-pt/strings.xml
+++ b/packages/DocumentsUI/res/values-pt/strings.xml
@@ -16,7 +16,7 @@
 
 <resources xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
-    <string name="app_label" msgid="2783841764617238354">"Documentos"</string>
+    <string name="app_label" msgid="1551050262492398204">"Arquivos"</string>
     <string name="downloads_label" msgid="959113951084633612">"Downloads"</string>
     <string name="title_open" msgid="4353228937663917801">"Abrir de"</string>
     <string name="title_save" msgid="2433679664882857999">"Salvar em"</string>
diff --git a/packages/DocumentsUI/res/values-ro/strings.xml b/packages/DocumentsUI/res/values-ro/strings.xml
index 8bf3880..a10a1db 100644
--- a/packages/DocumentsUI/res/values-ro/strings.xml
+++ b/packages/DocumentsUI/res/values-ro/strings.xml
@@ -16,7 +16,7 @@
 
 <resources xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
-    <string name="app_label" msgid="2783841764617238354">"Documente"</string>
+    <string name="app_label" msgid="1551050262492398204">"Fișiere"</string>
     <string name="downloads_label" msgid="959113951084633612">"Descărcări"</string>
     <string name="title_open" msgid="4353228937663917801">"Deschideți din"</string>
     <string name="title_save" msgid="2433679664882857999">"Salvați în"</string>
diff --git a/packages/DocumentsUI/res/values-ru/strings.xml b/packages/DocumentsUI/res/values-ru/strings.xml
index eb7278e..d4a3365 100644
--- a/packages/DocumentsUI/res/values-ru/strings.xml
+++ b/packages/DocumentsUI/res/values-ru/strings.xml
@@ -16,7 +16,7 @@
 
 <resources xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
-    <string name="app_label" msgid="2783841764617238354">"Документы"</string>
+    <string name="app_label" msgid="1551050262492398204">"Файлы"</string>
     <string name="downloads_label" msgid="959113951084633612">"Загрузки"</string>
     <string name="title_open" msgid="4353228937663917801">"Открыть"</string>
     <string name="title_save" msgid="2433679664882857999">"Сохранить"</string>
diff --git a/packages/DocumentsUI/res/values-si-rLK/strings.xml b/packages/DocumentsUI/res/values-si-rLK/strings.xml
index 956a59c..9fd9be8 100644
--- a/packages/DocumentsUI/res/values-si-rLK/strings.xml
+++ b/packages/DocumentsUI/res/values-si-rLK/strings.xml
@@ -16,7 +16,7 @@
 
 <resources xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
-    <string name="app_label" msgid="2783841764617238354">"ලේඛන"</string>
+    <string name="app_label" msgid="1551050262492398204">"ගොනු"</string>
     <string name="downloads_label" msgid="959113951084633612">"බාගැනීම්"</string>
     <string name="title_open" msgid="4353228937663917801">"විවෘත වන්නේ"</string>
     <string name="title_save" msgid="2433679664882857999">"සුරකින්නේ"</string>
diff --git a/packages/DocumentsUI/res/values-sk/strings.xml b/packages/DocumentsUI/res/values-sk/strings.xml
index c760868..1336694 100644
--- a/packages/DocumentsUI/res/values-sk/strings.xml
+++ b/packages/DocumentsUI/res/values-sk/strings.xml
@@ -16,7 +16,7 @@
 
 <resources xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
-    <string name="app_label" msgid="2783841764617238354">"Dokumenty"</string>
+    <string name="app_label" msgid="1551050262492398204">"Súbory"</string>
     <string name="downloads_label" msgid="959113951084633612">"Stiahnuté súbory"</string>
     <string name="title_open" msgid="4353228937663917801">"Otvoriť z"</string>
     <string name="title_save" msgid="2433679664882857999">"Uložiť do"</string>
diff --git a/packages/DocumentsUI/res/values-sl/strings.xml b/packages/DocumentsUI/res/values-sl/strings.xml
index 5a46141..a6a5fa4 100644
--- a/packages/DocumentsUI/res/values-sl/strings.xml
+++ b/packages/DocumentsUI/res/values-sl/strings.xml
@@ -16,7 +16,7 @@
 
 <resources xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
-    <string name="app_label" msgid="2783841764617238354">"Dokumenti"</string>
+    <string name="app_label" msgid="1551050262492398204">"Datoteke"</string>
     <string name="downloads_label" msgid="959113951084633612">"Prenosi"</string>
     <string name="title_open" msgid="4353228937663917801">"Odpri iz mape"</string>
     <string name="title_save" msgid="2433679664882857999">"Shrani v"</string>
diff --git a/packages/DocumentsUI/res/values-sq-rAL/strings.xml b/packages/DocumentsUI/res/values-sq-rAL/strings.xml
index 732996a..0f041a3 100644
--- a/packages/DocumentsUI/res/values-sq-rAL/strings.xml
+++ b/packages/DocumentsUI/res/values-sq-rAL/strings.xml
@@ -16,7 +16,7 @@
 
 <resources xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
-    <string name="app_label" msgid="2783841764617238354">"Dokumente"</string>
+    <string name="app_label" msgid="1551050262492398204">"Skedarët"</string>
     <string name="downloads_label" msgid="959113951084633612">"Shkarkimet"</string>
     <string name="title_open" msgid="4353228937663917801">"Hap nga"</string>
     <string name="title_save" msgid="2433679664882857999">"Ruaje te"</string>
diff --git a/packages/DocumentsUI/res/values-sr/strings.xml b/packages/DocumentsUI/res/values-sr/strings.xml
index 21aadee..cd2e4df 100644
--- a/packages/DocumentsUI/res/values-sr/strings.xml
+++ b/packages/DocumentsUI/res/values-sr/strings.xml
@@ -16,7 +16,7 @@
 
 <resources xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
-    <string name="app_label" msgid="2783841764617238354">"Документи"</string>
+    <string name="app_label" msgid="1551050262492398204">"Датотеке"</string>
     <string name="downloads_label" msgid="959113951084633612">"Преузимања"</string>
     <string name="title_open" msgid="4353228937663917801">"Отвори са"</string>
     <string name="title_save" msgid="2433679664882857999">"Сачувај у"</string>
diff --git a/packages/DocumentsUI/res/values-sv/strings.xml b/packages/DocumentsUI/res/values-sv/strings.xml
index 5ef9ab2..4f23527 100644
--- a/packages/DocumentsUI/res/values-sv/strings.xml
+++ b/packages/DocumentsUI/res/values-sv/strings.xml
@@ -16,7 +16,7 @@
 
 <resources xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
-    <string name="app_label" msgid="2783841764617238354">"Dokument"</string>
+    <string name="app_label" msgid="1551050262492398204">"Filer"</string>
     <string name="downloads_label" msgid="959113951084633612">"Nedladdningar"</string>
     <string name="title_open" msgid="4353228937663917801">"Öppna från"</string>
     <string name="title_save" msgid="2433679664882857999">"Spara till"</string>
diff --git a/packages/DocumentsUI/res/values-sw/strings.xml b/packages/DocumentsUI/res/values-sw/strings.xml
index 82bc4bb..ac63582 100644
--- a/packages/DocumentsUI/res/values-sw/strings.xml
+++ b/packages/DocumentsUI/res/values-sw/strings.xml
@@ -16,7 +16,7 @@
 
 <resources xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
-    <string name="app_label" msgid="2783841764617238354">"Hati"</string>
+    <string name="app_label" msgid="1551050262492398204">"Faili"</string>
     <string name="downloads_label" msgid="959113951084633612">"Vipakuliwa"</string>
     <string name="title_open" msgid="4353228937663917801">"Fungua kutoka"</string>
     <string name="title_save" msgid="2433679664882857999">"Hifadhi kwenye"</string>
diff --git a/packages/DocumentsUI/res/values-ta-rIN/strings.xml b/packages/DocumentsUI/res/values-ta-rIN/strings.xml
index 1573299..f29370b 100644
--- a/packages/DocumentsUI/res/values-ta-rIN/strings.xml
+++ b/packages/DocumentsUI/res/values-ta-rIN/strings.xml
@@ -16,7 +16,7 @@
 
 <resources xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
-    <string name="app_label" msgid="2783841764617238354">"ஆவணங்கள்"</string>
+    <string name="app_label" msgid="1551050262492398204">"கோப்புகள்"</string>
     <string name="downloads_label" msgid="959113951084633612">"இறக்கங்கள்"</string>
     <string name="title_open" msgid="4353228937663917801">"இதில் திற"</string>
     <string name="title_save" msgid="2433679664882857999">"இதில் சேமி"</string>
diff --git a/packages/DocumentsUI/res/values-te-rIN/strings.xml b/packages/DocumentsUI/res/values-te-rIN/strings.xml
index 3bb9720..38bb007 100644
--- a/packages/DocumentsUI/res/values-te-rIN/strings.xml
+++ b/packages/DocumentsUI/res/values-te-rIN/strings.xml
@@ -16,7 +16,7 @@
 
 <resources xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
-    <string name="app_label" msgid="2783841764617238354">"పత్రాలు"</string>
+    <string name="app_label" msgid="1551050262492398204">"ఫైల్‌లు"</string>
     <string name="downloads_label" msgid="959113951084633612">"డౌన్‌లోడ్‌లు"</string>
     <string name="title_open" msgid="4353228937663917801">"ఇక్కడి నుండి తెరువు"</string>
     <string name="title_save" msgid="2433679664882857999">"ఇందులో సేవ్ చేయి"</string>
diff --git a/packages/DocumentsUI/res/values-th/strings.xml b/packages/DocumentsUI/res/values-th/strings.xml
index 7c587c3..f64be88 100644
--- a/packages/DocumentsUI/res/values-th/strings.xml
+++ b/packages/DocumentsUI/res/values-th/strings.xml
@@ -16,7 +16,7 @@
 
 <resources xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
-    <string name="app_label" msgid="2783841764617238354">"เอกสาร"</string>
+    <string name="app_label" msgid="1551050262492398204">"ไฟล์"</string>
     <string name="downloads_label" msgid="959113951084633612">"การดาวน์โหลด"</string>
     <string name="title_open" msgid="4353228937663917801">"เปิดจาก"</string>
     <string name="title_save" msgid="2433679664882857999">"บันทึกไปยัง"</string>
diff --git a/packages/DocumentsUI/res/values-tl/strings.xml b/packages/DocumentsUI/res/values-tl/strings.xml
index 63c2334..22474469 100644
--- a/packages/DocumentsUI/res/values-tl/strings.xml
+++ b/packages/DocumentsUI/res/values-tl/strings.xml
@@ -16,7 +16,7 @@
 
 <resources xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
-    <string name="app_label" msgid="2783841764617238354">"Mga Dokumento"</string>
+    <string name="app_label" msgid="1551050262492398204">"Mga File"</string>
     <string name="downloads_label" msgid="959113951084633612">"Mga Download"</string>
     <string name="title_open" msgid="4353228937663917801">"Buksan mula sa"</string>
     <string name="title_save" msgid="2433679664882857999">"I-save sa"</string>
diff --git a/packages/DocumentsUI/res/values-tr/strings.xml b/packages/DocumentsUI/res/values-tr/strings.xml
index 402d320..9dcc0e1 100644
--- a/packages/DocumentsUI/res/values-tr/strings.xml
+++ b/packages/DocumentsUI/res/values-tr/strings.xml
@@ -16,7 +16,7 @@
 
 <resources xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
-    <string name="app_label" msgid="2783841764617238354">"Dokümanlar"</string>
+    <string name="app_label" msgid="1551050262492398204">"Dosyalar"</string>
     <string name="downloads_label" msgid="959113951084633612">"İndirilenler"</string>
     <string name="title_open" msgid="4353228937663917801">"Şuradan aç:"</string>
     <string name="title_save" msgid="2433679664882857999">"Şuraya kaydet:"</string>
diff --git a/packages/DocumentsUI/res/values-uk/strings.xml b/packages/DocumentsUI/res/values-uk/strings.xml
index e95539f..6d28f41 100644
--- a/packages/DocumentsUI/res/values-uk/strings.xml
+++ b/packages/DocumentsUI/res/values-uk/strings.xml
@@ -16,7 +16,7 @@
 
 <resources xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
-    <string name="app_label" msgid="2783841764617238354">"Документи"</string>
+    <string name="app_label" msgid="1551050262492398204">"Файли"</string>
     <string name="downloads_label" msgid="959113951084633612">"Завантаження"</string>
     <string name="title_open" msgid="4353228937663917801">"Відкрити"</string>
     <string name="title_save" msgid="2433679664882857999">"Зберегти в"</string>
diff --git a/packages/DocumentsUI/res/values-ur-rPK/strings.xml b/packages/DocumentsUI/res/values-ur-rPK/strings.xml
index 7c81eba..54289f8b 100644
--- a/packages/DocumentsUI/res/values-ur-rPK/strings.xml
+++ b/packages/DocumentsUI/res/values-ur-rPK/strings.xml
@@ -16,7 +16,7 @@
 
 <resources xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
-    <string name="app_label" msgid="2783841764617238354">"دستاویزات"</string>
+    <string name="app_label" msgid="1551050262492398204">"فائلیں"</string>
     <string name="downloads_label" msgid="959113951084633612">"ڈاؤن لوڈز"</string>
     <string name="title_open" msgid="4353228937663917801">"کھولیں از"</string>
     <string name="title_save" msgid="2433679664882857999">"اس میں محفوظ کریں"</string>
diff --git a/packages/DocumentsUI/res/values-uz-rUZ/strings.xml b/packages/DocumentsUI/res/values-uz-rUZ/strings.xml
index 5090409..de13d51 100644
--- a/packages/DocumentsUI/res/values-uz-rUZ/strings.xml
+++ b/packages/DocumentsUI/res/values-uz-rUZ/strings.xml
@@ -16,7 +16,7 @@
 
 <resources xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
-    <string name="app_label" msgid="2783841764617238354">"Hujjatlar"</string>
+    <string name="app_label" msgid="1551050262492398204">"Fayllar"</string>
     <string name="downloads_label" msgid="959113951084633612">"Yuklanmalar"</string>
     <string name="title_open" msgid="4353228937663917801">"Ochish"</string>
     <string name="title_save" msgid="2433679664882857999">"Saqlash"</string>
diff --git a/packages/DocumentsUI/res/values-vi/strings.xml b/packages/DocumentsUI/res/values-vi/strings.xml
index b9c99b6..37f29a8 100644
--- a/packages/DocumentsUI/res/values-vi/strings.xml
+++ b/packages/DocumentsUI/res/values-vi/strings.xml
@@ -16,7 +16,7 @@
 
 <resources xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
-    <string name="app_label" msgid="2783841764617238354">"Tài liệu"</string>
+    <string name="app_label" msgid="1551050262492398204">"Tệp"</string>
     <string name="downloads_label" msgid="959113951084633612">"Tải xuống"</string>
     <string name="title_open" msgid="4353228937663917801">"Mở từ"</string>
     <string name="title_save" msgid="2433679664882857999">"Lưu vào"</string>
diff --git a/packages/DocumentsUI/res/values-zh-rCN/strings.xml b/packages/DocumentsUI/res/values-zh-rCN/strings.xml
index 718ce0d..61f125b 100644
--- a/packages/DocumentsUI/res/values-zh-rCN/strings.xml
+++ b/packages/DocumentsUI/res/values-zh-rCN/strings.xml
@@ -16,7 +16,7 @@
 
 <resources xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
-    <string name="app_label" msgid="2783841764617238354">"文档"</string>
+    <string name="app_label" msgid="1551050262492398204">"文件"</string>
     <string name="downloads_label" msgid="959113951084633612">"下载"</string>
     <string name="title_open" msgid="4353228937663917801">"打开文件"</string>
     <string name="title_save" msgid="2433679664882857999">"保存文件"</string>
diff --git a/packages/DocumentsUI/res/values-zh-rHK/strings.xml b/packages/DocumentsUI/res/values-zh-rHK/strings.xml
index 552c858..5fcf5af 100644
--- a/packages/DocumentsUI/res/values-zh-rHK/strings.xml
+++ b/packages/DocumentsUI/res/values-zh-rHK/strings.xml
@@ -16,7 +16,7 @@
 
 <resources xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
-    <string name="app_label" msgid="2783841764617238354">"文件"</string>
+    <string name="app_label" msgid="1551050262492398204">"檔案"</string>
     <string name="downloads_label" msgid="959113951084633612">"下載"</string>
     <string name="title_open" msgid="4353228937663917801">"開啟檔案"</string>
     <string name="title_save" msgid="2433679664882857999">"儲存至"</string>
diff --git a/packages/DocumentsUI/res/values-zh-rTW/strings.xml b/packages/DocumentsUI/res/values-zh-rTW/strings.xml
index 1a6a883..baa6df9 100644
--- a/packages/DocumentsUI/res/values-zh-rTW/strings.xml
+++ b/packages/DocumentsUI/res/values-zh-rTW/strings.xml
@@ -16,7 +16,7 @@
 
 <resources xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
-    <string name="app_label" msgid="2783841764617238354">"文件"</string>
+    <string name="app_label" msgid="1551050262492398204">"檔案"</string>
     <string name="downloads_label" msgid="959113951084633612">"下載"</string>
     <string name="title_open" msgid="4353228937663917801">"開啟檔案"</string>
     <string name="title_save" msgid="2433679664882857999">"儲存至"</string>
diff --git a/packages/DocumentsUI/res/values-zu/strings.xml b/packages/DocumentsUI/res/values-zu/strings.xml
index 285047e..1177941 100644
--- a/packages/DocumentsUI/res/values-zu/strings.xml
+++ b/packages/DocumentsUI/res/values-zu/strings.xml
@@ -16,7 +16,7 @@
 
 <resources xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
-    <string name="app_label" msgid="2783841764617238354">"Amadokhumenti"</string>
+    <string name="app_label" msgid="1551050262492398204">"Amafayela"</string>
     <string name="downloads_label" msgid="959113951084633612">"Okulandiwe"</string>
     <string name="title_open" msgid="4353228937663917801">"Vula kusuka ku-"</string>
     <string name="title_save" msgid="2433679664882857999">"Londoloza ku-"</string>
diff --git a/packages/DocumentsUI/res/values/dimens.xml b/packages/DocumentsUI/res/values/dimens.xml
index 5f1b349..7cda341 100644
--- a/packages/DocumentsUI/res/values/dimens.xml
+++ b/packages/DocumentsUI/res/values/dimens.xml
@@ -46,4 +46,6 @@
     <dimen name="drag_shadow_width">160dp</dimen>
     <dimen name="drag_shadow_height">48dp</dimen>
 
+    <dimen name="autoscroll_edge_height">32dp</dimen>
+
 </resources>
diff --git a/packages/DocumentsUI/src/com/android/documentsui/Shared.java b/packages/DocumentsUI/src/com/android/documentsui/Shared.java
index 0cd568a..c1db87d 100644
--- a/packages/DocumentsUI/src/com/android/documentsui/Shared.java
+++ b/packages/DocumentsUI/src/com/android/documentsui/Shared.java
@@ -21,7 +21,6 @@
 import android.content.Context;
 import android.content.Intent;
 import android.content.res.Configuration;
-import android.net.Uri;
 import android.os.Looper;
 import android.provider.DocumentsContract;
 import android.text.TextUtils;
@@ -30,10 +29,6 @@
 import android.util.Log;
 import android.view.WindowManager;
 
-import com.android.documentsui.model.DocumentInfo;
-import com.android.documentsui.model.RootInfo;
-
-import java.io.FileNotFoundException;
 import java.text.Collator;
 import java.util.ArrayList;
 import java.util.List;
diff --git a/packages/DocumentsUI/src/com/android/documentsui/ThumbnailCache.java b/packages/DocumentsUI/src/com/android/documentsui/ThumbnailCache.java
index ecde685..639d4fb 100644
--- a/packages/DocumentsUI/src/com/android/documentsui/ThumbnailCache.java
+++ b/packages/DocumentsUI/src/com/android/documentsui/ThumbnailCache.java
@@ -111,6 +111,13 @@
         return Result.obtainMiss();
     }
 
+    /**
+     * Puts a thumbnail for the given uri and size in to the cache.
+     * @param uri the uri of the thumbnail
+     * @param size the size of the thumbnail
+     * @param thumbnail the thumbnail to put in cache
+     * @param lastModified last modified value of the thumbnail to track its validity
+     */
     public void putThumbnail(Uri uri, Point size, Bitmap thumbnail, long lastModified) {
         Pair<Uri, Point> cacheKey = Pair.create(uri, size);
 
@@ -130,14 +137,33 @@
         }
     }
 
+    /**
+     * Removes all thumbnail cache associated to the given uri.
+     * @param uri the uri which thumbnail cache to remove
+     */
+    public void removeUri(Uri uri) {
+        TreeMap<Point, Pair<Uri, Point>> sizeMap;
+        synchronized (mSizeIndex) {
+            sizeMap = mSizeIndex.get(uri);
+        }
+
+        if (sizeMap != null) {
+            // Create an array to hold all values to avoid ConcurrentModificationException because
+            // removeKey() will be called by LruCache but we can't modify the map while we're
+            // iterating over the collection of values.
+            for (Pair<Uri, Point> index : sizeMap.values().toArray(new Pair[0])) {
+                mCache.remove(index);
+            }
+        }
+    }
+
     private void removeKey(Uri uri, Point size) {
         TreeMap<Point, Pair<Uri, Point>> sizeMap;
         synchronized (mSizeIndex) {
             sizeMap = mSizeIndex.get(uri);
         }
 
-        // LruCache tells us to remove a key, which should exist, so sizeMap can't be null.
-        assert (sizeMap != null);
+        assert(sizeMap != null);
         synchronized (sizeMap) {
             sizeMap.remove(size);
         }
diff --git a/packages/DocumentsUI/src/com/android/documentsui/dirlist/BandController.java b/packages/DocumentsUI/src/com/android/documentsui/dirlist/BandController.java
index eb53ec1..5ab85c1 100644
--- a/packages/DocumentsUI/src/com/android/documentsui/dirlist/BandController.java
+++ b/packages/DocumentsUI/src/com/android/documentsui/dirlist/BandController.java
@@ -19,6 +19,7 @@
 import static com.android.documentsui.Shared.DEBUG;
 import static com.android.documentsui.dirlist.ModelBackedDocumentsAdapter.ITEM_TYPE_DIRECTORY;
 import static com.android.documentsui.dirlist.ModelBackedDocumentsAdapter.ITEM_TYPE_DOCUMENT;
+import static com.android.documentsui.dirlist.ViewAutoScroller.NOT_SET;
 
 import android.graphics.Point;
 import android.graphics.Rect;
@@ -39,6 +40,8 @@
 import com.android.documentsui.Events.MotionInputEvent;
 import com.android.documentsui.R;
 import com.android.documentsui.dirlist.MultiSelectManager.Selection;
+import com.android.documentsui.dirlist.ViewAutoScroller.ScrollActionDelegate;
+import com.android.documentsui.dirlist.ViewAutoScroller.ScrollDistanceDelegate;
 
 import java.util.ArrayList;
 import java.util.Collections;
@@ -54,15 +57,14 @@
  */
 public class BandController extends RecyclerView.OnScrollListener {
 
-    private static final int NOT_SET = -1;
-
     private static final String TAG = "BandController";
+    private static final int AUTOSCROLL_EDGE_HEIGHT = 1;
 
     private final Runnable mModelBuilder;
     private final SelectionEnvironment mEnvironment;
     private final DocumentsAdapter mAdapter;
     private final MultiSelectManager mSelectionManager;
-    private final Runnable mViewScroller = new ViewScroller();
+    private final Runnable mViewScroller;
     private final GridModel.OnSelectionChangedListener mGridListener;
 
     @Nullable private Rect mBounds;
@@ -70,9 +72,6 @@
     @Nullable private Point mOrigin;
     @Nullable private BandController.GridModel mModel;
 
-    // The time at which the current band selection-induced scroll began. If no scroll is in
-    // progress, the value is NOT_SET.
-    private long mScrollStartTime = NOT_SET;
     private Selection mSelection;
 
     public BandController(
@@ -114,6 +113,25 @@
         mSelectionManager = selectionManager;
 
         mEnvironment.addOnScrollListener(this);
+        mViewScroller = new ViewAutoScroller(
+                AUTOSCROLL_EDGE_HEIGHT,
+                new ScrollDistanceDelegate() {
+                    @Override
+                    public Point getCurrentPosition() {
+                        return mCurrentPosition;
+                    }
+
+                    @Override
+                    public int getViewHeight() {
+                        return mEnvironment.getHeight();
+                    }
+
+                    @Override
+                    public boolean isActive() {
+                        return BandController.this.isActive();
+                    }
+                },
+                env);
 
         mAdapter.registerAdapterDataObserver(
                 new RecyclerView.AdapterDataObserver() {
@@ -173,6 +191,10 @@
         };
     }
 
+    private boolean isActive() {
+        return mModel != null;
+    }
+
     void bindSelection(Selection selection) {
         mSelection = selection;
     }
@@ -212,10 +234,6 @@
         return isActive();
     }
 
-    private boolean isActive() {
-        return mModel != null;
-    }
-
     /**
      * Handle a change in layout by cleaning up and getting rid of the old model and creating
      * a new model which will track the new layout.
@@ -336,112 +354,6 @@
         return mSelectionManager.notifyBeforeItemStateChange(id, nextState);
     }
 
-    private class ViewScroller implements Runnable {
-        /**
-         * The number of milliseconds of scrolling at which scroll speed continues to increase.
-         * At first, the scroll starts slowly; then, the rate of scrolling increases until it
-         * reaches its maximum value at after this many milliseconds.
-         */
-        private static final long SCROLL_ACCELERATION_LIMIT_TIME_MS = 2000;
-
-        @Override
-        public void run() {
-            // Compute the number of pixels the pointer's y-coordinate is past the view.
-            // Negative values mean the pointer is at or before the top of the view, and
-            // positive values mean that the pointer is at or after the bottom of the view. Note
-            // that one additional pixel is added here so that the view still scrolls when the
-            // pointer is exactly at the top or bottom.
-            int pixelsPastView = 0;
-            if (mCurrentPosition.y <= 0) {
-                pixelsPastView = mCurrentPosition.y - 1;
-            } else if (mCurrentPosition.y >= mEnvironment.getHeight() - 1) {
-                pixelsPastView = mCurrentPosition.y - mEnvironment.getHeight() + 1;
-            }
-
-            if (!isActive() || pixelsPastView == 0) {
-                // If band selection is inactive, or if it is active but not at the edge of the
-                // view, no scrolling is necessary.
-                mScrollStartTime = NOT_SET;
-                return;
-            }
-
-            if (mScrollStartTime == NOT_SET) {
-                // If the pointer was previously not at the edge of the view but now is, set the
-                // start time for the scroll.
-                mScrollStartTime = System.currentTimeMillis();
-            }
-
-            // Compute the number of pixels to scroll, and scroll that many pixels.
-            final int numPixels = computeScrollDistance(
-                    pixelsPastView, System.currentTimeMillis() - mScrollStartTime);
-            mEnvironment.scrollBy(numPixels);
-
-            mEnvironment.removeCallback(mViewScroller);
-            mEnvironment.runAtNextFrame(this);
-        }
-
-        /**
-         * Computes the number of pixels to scroll based on how far the pointer is past the end
-         * of the view and how long it has been there. Roughly based on ItemTouchHelper's
-         * algorithm for computing the number of pixels to scroll when an item is dragged to the
-         * end of a {@link RecyclerView}.
-         * @param pixelsPastView
-         * @param scrollDuration
-         * @return
-         */
-        private int computeScrollDistance(int pixelsPastView, long scrollDuration) {
-            final int maxScrollStep = mEnvironment.getHeight();
-            final int direction = (int) Math.signum(pixelsPastView);
-            final int absPastView = Math.abs(pixelsPastView);
-
-            // Calculate the ratio of how far out of the view the pointer currently resides to
-            // the entire height of the view.
-            final float outOfBoundsRatio = Math.min(
-                    1.0f, (float) absPastView / mEnvironment.getHeight());
-            // Interpolate this ratio and use it to compute the maximum scroll that should be
-            // possible for this step.
-            final float cappedScrollStep =
-                    direction * maxScrollStep * smoothOutOfBoundsRatio(outOfBoundsRatio);
-
-            // Likewise, calculate the ratio of the time spent in the scroll to the limit.
-            final float timeRatio = Math.min(
-                    1.0f, (float) scrollDuration / SCROLL_ACCELERATION_LIMIT_TIME_MS);
-            // Interpolate this ratio and use it to compute the final number of pixels to
-            // scroll.
-            final int numPixels = (int) (cappedScrollStep * smoothTimeRatio(timeRatio));
-
-            // If the final number of pixels to scroll ends up being 0, the view should still
-            // scroll at least one pixel.
-            return numPixels != 0 ? numPixels : direction;
-        }
-
-        /**
-         * Interpolates the given out of bounds ratio on a curve which starts at (0,0) and ends
-         * at (1,1) and quickly approaches 1 near the start of that interval. This ensures that
-         * drags that are at the edge or barely past the edge of the view still cause sufficient
-         * scrolling. The equation y=(x-1)^5+1 is used, but this could also be tweaked if
-         * needed.
-         * @param ratio A ratio which is in the range [0, 1].
-         * @return A "smoothed" value, also in the range [0, 1].
-         */
-        private float smoothOutOfBoundsRatio(float ratio) {
-            return (float) Math.pow(ratio - 1.0f, 5) + 1.0f;
-        }
-
-        /**
-         * Interpolates the given time ratio on a curve which starts at (0,0) and ends at (1,1)
-         * and stays close to 0 for most input values except those very close to 1. This ensures
-         * that scrolls start out very slowly but speed up drastically after the scroll has been
-         * in progress close to SCROLL_ACCELERATION_LIMIT_TIME_MS. The equation y=x^5 is used,
-         * but this could also be tweaked if needed.
-         * @param ratio A ratio which is in the range [0, 1].
-         * @return A "smoothed" value, also in the range [0, 1].
-         */
-        private float smoothTimeRatio(float ratio) {
-            return (float) Math.pow(ratio, 5);
-        }
-    };
-
     @Override
     public void onScrolled(RecyclerView recyclerView, int dx, int dy) {
         if (!isActive()) {
@@ -1110,16 +1022,13 @@
      * Provides functionality for BandController. Exists primarily to tests that are
      * fully isolated from RecyclerView.
      */
-    interface SelectionEnvironment {
+    interface SelectionEnvironment extends ScrollActionDelegate {
         void showBand(Rect rect);
         void hideBand();
         void addOnScrollListener(RecyclerView.OnScrollListener listener);
         void removeOnScrollListener(RecyclerView.OnScrollListener listener);
-        void scrollBy(int dy);
         int getHeight();
         void invalidateView();
-        void runAtNextFrame(Runnable r);
-        void removeCallback(Runnable r);
         Point createAbsolutePoint(Point relativePoint);
         Rect getAbsoluteRectForChildViewAt(int index);
         int getAdapterPositionAt(int index);
diff --git a/packages/DocumentsUI/src/com/android/documentsui/dirlist/DirectoryDragListener.java b/packages/DocumentsUI/src/com/android/documentsui/dirlist/DirectoryDragListener.java
index 0860f4c..f0a7aae 100644
--- a/packages/DocumentsUI/src/com/android/documentsui/dirlist/DirectoryDragListener.java
+++ b/packages/DocumentsUI/src/com/android/documentsui/dirlist/DirectoryDragListener.java
@@ -45,4 +45,4 @@
     public boolean handleDropEventChecked(View v, DragEvent event) {
         return mDragHost.handleDropEvent(v, event);
     }
-}
+}
\ No newline at end of file
diff --git a/packages/DocumentsUI/src/com/android/documentsui/dirlist/DirectoryFragment.java b/packages/DocumentsUI/src/com/android/documentsui/dirlist/DirectoryFragment.java
index ca7b2ca..db19881 100644
--- a/packages/DocumentsUI/src/com/android/documentsui/dirlist/DirectoryFragment.java
+++ b/packages/DocumentsUI/src/com/android/documentsui/dirlist/DirectoryFragment.java
@@ -42,6 +42,7 @@
 import android.net.Uri;
 import android.os.AsyncTask;
 import android.os.Bundle;
+import android.os.Handler;
 import android.os.Parcelable;
 import android.provider.DocumentsContract;
 import android.provider.DocumentsContract.Document;
@@ -74,7 +75,6 @@
 import com.android.documentsui.BaseActivity;
 import com.android.documentsui.DirectoryLoader;
 import com.android.documentsui.DirectoryResult;
-import com.android.documentsui.clipping.DocumentClipper;
 import com.android.documentsui.DocumentsActivity;
 import com.android.documentsui.DocumentsApplication;
 import com.android.documentsui.Events.InputEvent;
@@ -93,6 +93,8 @@
 import com.android.documentsui.Snackbars;
 import com.android.documentsui.State;
 import com.android.documentsui.State.ViewMode;
+import com.android.documentsui.ThumbnailCache;
+import com.android.documentsui.clipping.DocumentClipper;
 import com.android.documentsui.clipping.UrisSupplier;
 import com.android.documentsui.dirlist.MultiSelectManager.Selection;
 import com.android.documentsui.dirlist.UserInputHandler.DocumentDetails;
@@ -140,6 +142,9 @@
     private static final String TAG = "DirectoryFragment";
     private static final int LOADER_ID = 42;
 
+    private static final int CACHE_EVICT_LIMIT = 100;
+    private static final int REFRESH_SPINNER_DISMISS_DELAY = 500;
+
     private Model mModel;
     private MultiSelectManager mSelectionMgr;
     private Model.UpdateListener mModelUpdateListener = new ModelUpdateListener();
@@ -183,7 +188,7 @@
     private @Nullable BandController mBandController;
     private @Nullable ActionMode mActionMode;
 
-    private DirectoryDragListener mOnDragListener;
+    private DragScrollListener mOnDragListener;
     private MenuManager mMenuManager;
 
     @Override
@@ -210,7 +215,8 @@
 
         mRecView.setItemAnimator(new DirectoryItemAnimator(getActivity()));
 
-        mOnDragListener = new DirectoryDragListener(this);
+        mOnDragListener = DragScrollListener.create(
+                getActivity(), new DirectoryDragListener(this), mRecView);
 
         // Make the recycler and the empty views responsive to drop events.
         mRecView.setOnDragListener(mOnDragListener);
@@ -1609,6 +1615,17 @@
 
     @Override
     public void onRefresh() {
+        // Remove thumbnail cache. We do this not because we're worried about stale thumbnails as it
+        // should be covered by last modified value we store in thumbnail cache, but rather to give
+        // the user a greater sense that contents are being reloaded.
+        ThumbnailCache cache = DocumentsApplication.getThumbnailCache(getContext());
+        String[] ids = mModel.getModelIds();
+        int numOfEvicts = Math.min(ids.length, CACHE_EVICT_LIMIT);
+        for (int i = 0; i < numOfEvicts; ++i) {
+            cache.removeUri(mModel.getItemUri(ids[i]));
+        }
+
+        // Trigger loading
         getLoaderManager().restartLoader(LOADER_ID, null, this);
     }
 
@@ -1678,7 +1695,11 @@
 
         mTuner.onModelLoaded(mModel, mType, mSearchMode);
 
-        mRefreshLayout.setRefreshing(false);
+        if (mRefreshLayout.isRefreshing()) {
+            new Handler().postDelayed(
+                    () -> mRefreshLayout.setRefreshing(false),
+                    REFRESH_SPINNER_DISMISS_DELAY);
+        }
     }
 
     @Override
diff --git a/packages/DocumentsUI/src/com/android/documentsui/dirlist/DragScrollListener.java b/packages/DocumentsUI/src/com/android/documentsui/dirlist/DragScrollListener.java
new file mode 100644
index 0000000..898a4a2
--- /dev/null
+++ b/packages/DocumentsUI/src/com/android/documentsui/dirlist/DragScrollListener.java
@@ -0,0 +1,167 @@
+/*
+ * Copyright (C) 2016 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.documentsui.dirlist;
+
+import android.content.Context;
+import android.graphics.Point;
+import android.view.DragEvent;
+import android.view.View;
+import android.view.View.OnDragListener;
+
+import com.android.documentsui.ItemDragListener;
+import com.android.documentsui.ItemDragListener.DragHost;
+import com.android.documentsui.dirlist.ViewAutoScroller.ScrollActionDelegate;
+import com.android.documentsui.dirlist.ViewAutoScroller.ScrollDistanceDelegate;
+import com.android.documentsui.R;
+
+import java.util.function.BooleanSupplier;
+import java.util.function.IntSupplier;
+
+import javax.annotation.Nullable;
+
+/**
+ * This class acts as a middle-man handler for potential auto-scrolling before passing the dragEvent
+ * onto {@link DirectoryDragListener}.
+ */
+class DragScrollListener implements OnDragListener {
+
+    private final ItemDragListener<? extends DragHost> mDragHandler;
+    private final IntSupplier mHeight;
+    private final BooleanSupplier mCanScrollUp;
+    private final BooleanSupplier mCanScrollDown;
+    private final int mAutoScrollEdgeHeight;
+    private final Runnable mDragScroller;
+
+    private boolean mDragHappening;
+    private @Nullable Point mCurrentPosition;
+
+    private DragScrollListener(
+            Context context,
+            ItemDragListener<? extends DragHost> dragHandler,
+            IntSupplier heightSupplier,
+            BooleanSupplier scrollUpSupplier,
+            BooleanSupplier scrollDownSupplier,
+            ViewAutoScroller.ScrollActionDelegate actionDelegate) {
+        mDragHandler = dragHandler;
+        mAutoScrollEdgeHeight = (int) context.getResources()
+                .getDimension(R.dimen.autoscroll_edge_height);
+        mHeight = heightSupplier;
+        mCanScrollUp = scrollUpSupplier;
+        mCanScrollDown = scrollDownSupplier;
+
+        ScrollDistanceDelegate distanceDelegate = new ScrollDistanceDelegate() {
+            @Override
+            public Point getCurrentPosition() {
+                return mCurrentPosition;
+            }
+
+            @Override
+            public int getViewHeight() {
+                return mHeight.getAsInt();
+            }
+
+            @Override
+            public boolean isActive() {
+                return mDragHappening;
+            }
+        };
+
+        mDragScroller = new ViewAutoScroller(
+                mAutoScrollEdgeHeight, distanceDelegate, actionDelegate);
+    }
+
+    static DragScrollListener create(
+            Context context, ItemDragListener<? extends DragHost> dragHandler, View scrollView) {
+        ScrollActionDelegate actionDelegate = new ScrollActionDelegate() {
+            @Override
+            public void scrollBy(int dy) {
+                scrollView.scrollBy(0, dy);
+            }
+
+            @Override
+            public void runAtNextFrame(Runnable r) {
+                scrollView.postOnAnimation(r);
+
+            }
+
+            @Override
+            public void removeCallback(Runnable r) {
+                scrollView.removeCallbacks(r);
+            }
+        };
+        DragScrollListener listener = new DragScrollListener(
+                context,
+                dragHandler,
+                scrollView::getHeight,
+                () -> {
+                    return scrollView.canScrollVertically(-1);
+                },
+                () -> {
+                    return scrollView.canScrollVertically(1);
+                },
+                actionDelegate);
+        return listener;
+    }
+
+    @Override
+    public boolean onDrag(View v, DragEvent event) {
+        boolean handled = false;
+        switch (event.getAction()) {
+            case DragEvent.ACTION_DRAG_STARTED:
+                mDragHappening = true;
+                break;
+            case DragEvent.ACTION_DRAG_ENDED:
+                mDragHappening = false;
+                break;
+            case DragEvent.ACTION_DRAG_ENTERED:
+                handled = insideDragZone();
+                break;
+            case DragEvent.ACTION_DRAG_LOCATION:
+                handled = handleLocationEvent(v, event.getX(), event.getY());
+                break;
+            default:
+                break;
+        }
+
+        if (!handled) {
+            handled = mDragHandler.onDrag(v, event);
+        }
+
+        return handled;
+    }
+
+    private boolean handleLocationEvent(View v, float x, float y) {
+        mCurrentPosition = new Point(Math.round(v.getX() + x), Math.round(v.getY() + y));
+        if (insideDragZone()) {
+            mDragScroller.run();
+            return true;
+        }
+        return false;
+    }
+
+    private boolean insideDragZone() {
+        if (mCurrentPosition == null) {
+            return false;
+        }
+
+        boolean shouldScrollUp = mCurrentPosition.y < mAutoScrollEdgeHeight
+                && mCanScrollUp.getAsBoolean();
+        boolean shouldScrollDown = mCurrentPosition.y > mHeight.getAsInt() - mAutoScrollEdgeHeight
+                && mCanScrollDown.getAsBoolean();
+        return shouldScrollUp || shouldScrollDown;
+    }
+}
\ No newline at end of file
diff --git a/packages/DocumentsUI/src/com/android/documentsui/dirlist/TouchSwipeRefreshLayout.java b/packages/DocumentsUI/src/com/android/documentsui/dirlist/TouchSwipeRefreshLayout.java
index 42634ba..32bb5b1 100644
--- a/packages/DocumentsUI/src/com/android/documentsui/dirlist/TouchSwipeRefreshLayout.java
+++ b/packages/DocumentsUI/src/com/android/documentsui/dirlist/TouchSwipeRefreshLayout.java
@@ -17,6 +17,8 @@
 package com.android.documentsui.dirlist;
 
 import android.content.Context;
+import android.content.res.TypedArray;
+import android.support.annotation.ColorRes;
 import android.support.v4.widget.SwipeRefreshLayout;
 import android.util.AttributeSet;
 import android.view.MotionEvent;
@@ -28,12 +30,20 @@
  */
 public class TouchSwipeRefreshLayout extends SwipeRefreshLayout {
 
+    private static final int[] COLOR_RES = new int[] { android.R.attr.colorAccent };
+    private static int COLOR_ACCENT_INDEX = 0;
+
     public TouchSwipeRefreshLayout(Context context) {
         this(context, null);
     }
 
     public TouchSwipeRefreshLayout(Context context, AttributeSet attrs) {
         super(context, attrs);
+
+        TypedArray a = context.obtainStyledAttributes(COLOR_RES);
+        @ColorRes int colorId = a.getResourceId(COLOR_ACCENT_INDEX, -1);
+        a.recycle();
+        setColorSchemeResources(colorId);
     }
 
     @Override
diff --git a/packages/DocumentsUI/src/com/android/documentsui/dirlist/ViewAutoScroller.java b/packages/DocumentsUI/src/com/android/documentsui/dirlist/ViewAutoScroller.java
new file mode 100644
index 0000000..5ef68ca
--- /dev/null
+++ b/packages/DocumentsUI/src/com/android/documentsui/dirlist/ViewAutoScroller.java
@@ -0,0 +1,193 @@
+/*
+ * Copyright (C) 2016 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+package com.android.documentsui.dirlist;
+
+import android.graphics.Point;
+import android.support.annotation.VisibleForTesting;
+
+import java.util.function.IntSupplier;
+import java.util.function.LongSupplier;
+
+/**
+ * Provides auto-scrolling upon request when user's interaction with the application
+ * introduces a natural intent to scroll. Used by {@link BandController} and
+ * {@link DragScrollListener} to allow auto scrolling when user either does band selection, or
+ * attempting to drag and drop files to somewhere off the current screen.
+ */
+public final class ViewAutoScroller implements Runnable {
+    public static final int NOT_SET = -1;
+    /**
+     * The number of milliseconds of scrolling at which scroll speed continues to increase.
+     * At first, the scroll starts slowly; then, the rate of scrolling increases until it
+     * reaches its maximum value at after this many milliseconds.
+     */
+    private static final long SCROLL_ACCELERATION_LIMIT_TIME_MS = 2000;
+
+    // Top and bottom inner buffer such that user's cursor does not have to be exactly off screen
+    // for auto scrolling to begin
+    private final int mTopBottomThreshold;
+    private final ScrollDistanceDelegate mCalcDelegate;
+    private final ScrollActionDelegate mUiDelegate;
+    private final LongSupplier mCurrentTime;
+
+    private long mScrollStartTime = NOT_SET;
+
+    public ViewAutoScroller(
+            int topBottomThreshold,
+            ScrollDistanceDelegate calcDelegate,
+            ScrollActionDelegate uiDelegate) {
+        this(topBottomThreshold, calcDelegate, uiDelegate, System::currentTimeMillis);
+    }
+
+    @VisibleForTesting
+    ViewAutoScroller(
+            int topBottomThreshold,
+            ScrollDistanceDelegate calcDelegate,
+            ScrollActionDelegate uiDelegate,
+            LongSupplier clock) {
+        mTopBottomThreshold = topBottomThreshold;
+        mCalcDelegate = calcDelegate;
+        mUiDelegate = uiDelegate;
+        mCurrentTime = clock;
+    }
+
+    /**
+     * Attempts to smooth-scroll the view at the given UI frame. Application should be
+     * responsible to do any clean up (such as unsubscribing scrollListeners) after the run has
+     * finished, and re-run this method on the next UI frame if applicable.
+     */
+    @Override
+    public void run() {
+        // Compute the number of pixels the pointer's y-coordinate is past the view.
+        // Negative values mean the pointer is at or before the top of the view, and
+        // positive values mean that the pointer is at or after the bottom of the view. Note
+        // that top/bottom threshold is added here so that the view still scrolls when the
+        // pointer are in these buffer pixels.
+        int pixelsPastView = 0;
+
+        if (mCalcDelegate.getCurrentPosition().y <= mTopBottomThreshold) {
+            pixelsPastView = mCalcDelegate.getCurrentPosition().y - mTopBottomThreshold;
+        } else if (mCalcDelegate.getCurrentPosition().y >= mCalcDelegate.getViewHeight()
+                - mTopBottomThreshold) {
+            pixelsPastView = mCalcDelegate.getCurrentPosition().y - mCalcDelegate.getViewHeight()
+                    + mTopBottomThreshold;
+        }
+
+        if (!mCalcDelegate.isActive() || pixelsPastView == 0) {
+            // If the operation that started the scrolling is no longer inactive, or if it is active
+            // but not at the edge of the view, no scrolling is necessary.
+            mScrollStartTime = NOT_SET;
+            return;
+        }
+
+        if (mScrollStartTime == NOT_SET) {
+            // If the pointer was previously not at the edge of the view but now is, set the
+            // start time for the scroll.
+            mScrollStartTime = mCurrentTime.getAsLong();
+        }
+
+        // Compute the number of pixels to scroll, and scroll that many pixels.
+        final int numPixels = computeScrollDistance(
+                pixelsPastView, mCurrentTime.getAsLong() - mScrollStartTime);
+        mUiDelegate.scrollBy(numPixels);
+
+        // Remove callback to this, and then properly run at next frame again
+        mUiDelegate.removeCallback(this);
+        mUiDelegate.runAtNextFrame(this);
+    }
+
+    /**
+     * Computes the number of pixels to scroll based on how far the pointer is past the end
+     * of the view and how long it has been there. Roughly based on ItemTouchHelper's
+     * algorithm for computing the number of pixels to scroll when an item is dragged to the
+     * end of a view.
+     * @param pixelsPastView
+     * @param scrollDuration
+     * @return
+     */
+    public int computeScrollDistance(int pixelsPastView, long scrollDuration) {
+        final int maxScrollStep = mCalcDelegate.getViewHeight();
+        final int direction = (int) Math.signum(pixelsPastView);
+        final int absPastView = Math.abs(pixelsPastView);
+
+        // Calculate the ratio of how far out of the view the pointer currently resides to
+        // the entire height of the view.
+        final float outOfBoundsRatio = Math.min(
+                1.0f, (float) absPastView / mCalcDelegate.getViewHeight());
+        // Interpolate this ratio and use it to compute the maximum scroll that should be
+        // possible for this step.
+        final float cappedScrollStep =
+                direction * maxScrollStep * smoothOutOfBoundsRatio(outOfBoundsRatio);
+
+        // Likewise, calculate the ratio of the time spent in the scroll to the limit.
+        final float timeRatio = Math.min(
+                1.0f, (float) scrollDuration / SCROLL_ACCELERATION_LIMIT_TIME_MS);
+        // Interpolate this ratio and use it to compute the final number of pixels to
+        // scroll.
+        final int numPixels = (int) (cappedScrollStep * smoothTimeRatio(timeRatio));
+
+        // If the final number of pixels to scroll ends up being 0, the view should still
+        // scroll at least one pixel.
+        return numPixels != 0 ? numPixels : direction;
+    }
+
+    /**
+     * Interpolates the given out of bounds ratio on a curve which starts at (0,0) and ends
+     * at (1,1) and quickly approaches 1 near the start of that interval. This ensures that
+     * drags that are at the edge or barely past the edge of the view still cause sufficient
+     * scrolling. The equation y=(x-1)^5+1 is used, but this could also be tweaked if
+     * needed.
+     * @param ratio A ratio which is in the range [0, 1].
+     * @return A "smoothed" value, also in the range [0, 1].
+     */
+    private float smoothOutOfBoundsRatio(float ratio) {
+        return (float) Math.pow(ratio - 1.0f, 5) + 1.0f;
+    }
+
+    /**
+     * Interpolates the given time ratio on a curve which starts at (0,0) and ends at (1,1)
+     * and stays close to 0 for most input values except those very close to 1. This ensures
+     * that scrolls start out very slowly but speed up drastically after the scroll has been
+     * in progress close to SCROLL_ACCELERATION_LIMIT_TIME_MS. The equation y=x^5 is used,
+     * but this could also be tweaked if needed.
+     * @param ratio A ratio which is in the range [0, 1].
+     * @return A "smoothed" value, also in the range [0, 1].
+     */
+    private float smoothTimeRatio(float ratio) {
+        return (float) Math.pow(ratio, 5);
+    }
+
+    /**
+     * Used by {@link run} to properly calculate the proper amount of pixels to scroll given time
+     * passed since scroll started, and to properly scroll / proper listener clean up if necessary.
+     */
+    interface ScrollDistanceDelegate {
+        public Point getCurrentPosition();
+        public int getViewHeight();
+        public boolean isActive();
+    }
+
+    /**
+     * Used by {@link run} to do UI tasks, such as scrolling and rerunning at next UI cycle.
+     */
+    interface ScrollActionDelegate {
+        public void scrollBy(int dy);
+        public void runAtNextFrame(Runnable r);
+        public void removeCallback(Runnable r);
+    }
+}
\ No newline at end of file
diff --git a/packages/DocumentsUI/src/com/android/documentsui/services/CopyJob.java b/packages/DocumentsUI/src/com/android/documentsui/services/CopyJob.java
index c8f6a64..8eabbe4 100644
--- a/packages/DocumentsUI/src/com/android/documentsui/services/CopyJob.java
+++ b/packages/DocumentsUI/src/com/android/documentsui/services/CopyJob.java
@@ -273,6 +273,8 @@
         try {
             final ContentResolver resolver = appContext.getContentResolver();
             final Iterable<Uri> uris = srcs.getUris(appContext);
+
+            int docProcessed = 0;
             for (Uri uri : uris) {
                 DocumentInfo doc = DocumentInfo.fromUri(resolver, uri);
                 if (canCopy(doc, stack.root)) {
@@ -280,11 +282,16 @@
                 } else {
                     onFileFailed(doc);
                 }
+                ++docProcessed;
 
                 if (isCanceled()) {
                     return;
                 }
             }
+
+            // If docProcessed is different than the count claimed by UrisSupplier, add the number
+            // to failedFileCount.
+            failedFileCount += (srcs.getItemCount() - docProcessed);
         } catch(IOException e) {
             failedFileCount += srcs.getItemCount();
             throw new ResourceException("Failed to open the list of docs to copy.", e);
diff --git a/packages/DocumentsUI/src/com/android/documentsui/services/DeleteJob.java b/packages/DocumentsUI/src/com/android/documentsui/services/DeleteJob.java
index 64bc1a7..5a36818 100644
--- a/packages/DocumentsUI/src/com/android/documentsui/services/DeleteJob.java
+++ b/packages/DocumentsUI/src/com/android/documentsui/services/DeleteJob.java
@@ -120,6 +120,10 @@
 
                 ++mDocsProcessed;
             }
+
+            // If mDocProcessed is different than the count claimed by UrisSupplier, add the number
+            // to failedFileCount.
+            failedFileCount += (this.srcs.getItemCount() - mDocsProcessed);
             Metrics.logFileOperation(service, operationType, srcs, null);
         } catch(IOException e) {
             Log.e(TAG, "Failed to get list of docs or parent source.", e);
diff --git a/packages/DocumentsUI/tests/src/com/android/documentsui/ActivityTest.java b/packages/DocumentsUI/tests/src/com/android/documentsui/ActivityTest.java
index 8ad30d7..1400fe6 100644
--- a/packages/DocumentsUI/tests/src/com/android/documentsui/ActivityTest.java
+++ b/packages/DocumentsUI/tests/src/com/android/documentsui/ActivityTest.java
@@ -113,14 +113,22 @@
         mClient = mResolver.acquireUnstableContentProviderClient(getTestingProviderAuthority());
         mDocsHelper = new DocumentsProviderHelper(getTestingProviderAuthority(), mClient);
 
+        device.setOrientationNatural();
         setupTestingRoots();
 
         launchActivity();
         resetStorage();
+
+        // Since at the launch of activity, ROOT_0 and ROOT_1 have no files, drawer will
+        // automatically open for phone devices. Espresso register click() as (x, y) MotionEvents,
+        // so if a drawer is on top of a file we want to select, it will actually click the drawer.
+        // Thus to start a clean state, we always try to close first.
+        bots.roots.closeDrawer();
     }
 
     @Override
     public void tearDown() throws Exception {
+        device.unfreezeRotation();
         mClient.release();
         super.tearDown();
     }
diff --git a/packages/DocumentsUI/tests/src/com/android/documentsui/FileManagementUiTest.java b/packages/DocumentsUI/tests/src/com/android/documentsui/FileManagementUiTest.java
index 623f68a..44f417d 100644
--- a/packages/DocumentsUI/tests/src/com/android/documentsui/FileManagementUiTest.java
+++ b/packages/DocumentsUI/tests/src/com/android/documentsui/FileManagementUiTest.java
@@ -67,17 +67,6 @@
         bots.directory.waitForDocument("Kung Fu Panda");
     }
 
-    public void testDeleteDocument() throws Exception {
-        bots.directory.clickDocument("file1.png");
-        device.waitForIdle();
-        bots.main.clickToolbarItem(R.id.menu_delete);
-
-        bots.main.clickDialogOkButton();
-        device.waitForIdle();
-
-        bots.directory.assertDocumentsAbsent("file1.png");
-    }
-
     public void testKeyboard_CutDocument() throws Exception {
         bots.directory.clickDocument("file1.png");
         device.waitForIdle();
@@ -111,7 +100,7 @@
         bots.directory.waitForDocument("file1.png");
     }
 
-    public void testDeleteDocument_Cancel() throws Exception {
+    public void testDeleteDocument_Cancel_ThenOK() throws Exception {
         bots.directory.clickDocument("file1.png");
         device.waitForIdle();
         bots.main.clickToolbarItem(R.id.menu_delete);
@@ -119,5 +108,13 @@
         bots.main.clickDialogCancelButton();
 
         bots.directory.waitForDocument("file1.png");
+
+        device.waitForIdle();
+        bots.main.clickToolbarItem(R.id.menu_delete);
+
+        bots.main.clickDialogOkButton();
+        device.waitForIdle();
+
+        bots.directory.assertDocumentsAbsent("file1.png");
     }
 }
diff --git a/packages/DocumentsUI/tests/src/com/android/documentsui/ThumbnailCacheTest.java b/packages/DocumentsUI/tests/src/com/android/documentsui/ThumbnailCacheTest.java
index dda4918..ee6ab01 100644
--- a/packages/DocumentsUI/tests/src/com/android/documentsui/ThumbnailCacheTest.java
+++ b/packages/DocumentsUI/tests/src/com/android/documentsui/ThumbnailCacheTest.java
@@ -176,6 +176,18 @@
         assertSame(SMALL_BITMAP, result.getThumbnail());
     }
 
+    @Test
+    public void testRemoveUri() {
+        mCache.putThumbnail(URI_0, MID_SIZE, MIDSIZE_BITMAP, LAST_MODIFIED);
+        mCache.putThumbnail(URI_0, SMALL_SIZE, SMALL_BITMAP, LAST_MODIFIED);
+        mCache.putThumbnail(URI_1, MID_SIZE, MIDSIZE_BITMAP, LAST_MODIFIED);
+
+        mCache.removeUri(URI_0);
+
+        assertMiss(mCache.getThumbnail(URI_0, MID_SIZE));
+        assertHitExact(mCache.getThumbnail(URI_1, MID_SIZE));
+    }
+
     private static void assertMiss(Result result) {
         assertEquals(Result.CACHE_MISS, result.getStatus());
         assertFalse(result.isExactHit());
diff --git a/packages/DocumentsUI/tests/src/com/android/documentsui/dirlist/ViewAutoScrollerTest.java b/packages/DocumentsUI/tests/src/com/android/documentsui/dirlist/ViewAutoScrollerTest.java
new file mode 100644
index 0000000..e2aaa84
--- /dev/null
+++ b/packages/DocumentsUI/tests/src/com/android/documentsui/dirlist/ViewAutoScrollerTest.java
@@ -0,0 +1,136 @@
+/*
+ * Copyright (C) 2016 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.documentsui.dirlist;
+
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
+import android.graphics.Point;
+import android.support.test.filters.SmallTest;
+import android.support.test.runner.AndroidJUnit4;
+
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+import java.util.function.IntConsumer;
+
+@RunWith(AndroidJUnit4.class)
+@SmallTest
+public final class ViewAutoScrollerTest {
+
+    private static final int VIEW_HEIGHT = 100;
+    private static final int EDGE_HEIGHT = 10;
+
+    private ViewAutoScroller mAutoScroller;
+    private Point mPoint;
+    private boolean mActive;
+    private ViewAutoScroller.ScrollDistanceDelegate mDistanceDelegate;
+    private ViewAutoScroller.ScrollActionDelegate mActionDelegate;
+    private IntConsumer mScrollAssert;
+
+    @Before
+    public void setUp() {
+        mActive = false;
+        mPoint = new Point();
+        mDistanceDelegate = new ViewAutoScroller.ScrollDistanceDelegate() {
+            @Override
+            public boolean isActive() {
+                return mActive;
+            }
+
+            @Override
+            public int getViewHeight() {
+                return VIEW_HEIGHT;
+            }
+
+            @Override
+            public Point getCurrentPosition() {
+                return mPoint;
+            }
+        };
+        mActionDelegate = new ViewAutoScroller.ScrollActionDelegate() {
+            @Override
+            public void scrollBy(int dy) {
+                mScrollAssert.accept(dy);
+            }
+
+            @Override
+            public void runAtNextFrame(Runnable r) {
+            }
+
+            @Override
+            public void removeCallback(Runnable r) {
+            }
+        };
+        mAutoScroller = new ViewAutoScroller(
+                EDGE_HEIGHT, mDistanceDelegate, mActionDelegate, new TestClock()::getCurrentTime);
+    }
+
+    @Test
+    public void testCursorNotInScrollZone() {
+        mPoint = new Point(0, VIEW_HEIGHT/2);
+        mScrollAssert = (int dy) -> {
+            // Should not have called this method
+            fail("Received unexpected scroll event");
+            assertTrue(false);
+        };
+        mAutoScroller.run();
+    }
+
+    @Test
+    public void testCursorInScrollZone_notActive() {
+        mActive = false;
+        mPoint = new Point(0, EDGE_HEIGHT - 1);
+        mScrollAssert = (int dy) -> {
+            // Should not have called this method
+            fail("Received unexpected scroll event");
+            assertTrue(false);
+        };
+        mAutoScroller.run();
+    }
+
+    @Test
+    public void testCursorInScrollZone_top() {
+        mActive = true;
+        mPoint = new Point(0, EDGE_HEIGHT - 1);
+        int expectedScrollDistance = mAutoScroller.computeScrollDistance(-1, 1);
+        mScrollAssert = (int dy) -> {
+            assertTrue(dy == expectedScrollDistance);
+        };
+        mAutoScroller.run();
+    }
+
+    @Test
+    public void testCursorInScrollZone_bottom() {
+        mActive = true;
+        mPoint = new Point(0, VIEW_HEIGHT - EDGE_HEIGHT + 1);
+        int expectedScrollDistance = mAutoScroller.computeScrollDistance(1, 1);
+        mScrollAssert = (int dy) -> {
+            assertTrue(dy == expectedScrollDistance);
+        };
+        mAutoScroller.run();
+    }
+
+    class TestClock {
+        private int timesCalled = 0;
+
+        public long getCurrentTime() {
+            return ++timesCalled;
+        }
+    }
+}
diff --git a/packages/EasterEgg/AndroidManifest.xml b/packages/EasterEgg/AndroidManifest.xml
index 50e8b5c..fbc2386 100644
--- a/packages/EasterEgg/AndroidManifest.xml
+++ b/packages/EasterEgg/AndroidManifest.xml
@@ -31,6 +31,7 @@
                   android:label="@string/app_name">
             <intent-filter>
                 <action android:name="android.service.quicksettings.action.QS_TILE_PREFERENCES" />
+                <action android:name="android.intent.action.MAIN" />
             </intent-filter>
         </activity>
 
diff --git a/packages/EasterEgg/res/drawable/collar.xml b/packages/EasterEgg/res/drawable/collar.xml
index 6c0d90a..5e4d0fd 100644
--- a/packages/EasterEgg/res/drawable/collar.xml
+++ b/packages/EasterEgg/res/drawable/collar.xml
@@ -18,5 +18,5 @@
         android:height="48dp"
         android:viewportWidth="48.0"
         android:viewportHeight="48.0">
-    <path android:name="collar" android:fillColor="#FF000000" android:pathData="M9,18.4h30v1.6h-30z"/>
+    <path android:name="collar" android:fillColor="#FF000000" android:pathData="M9,18.4h30v1.7h-30z"/>
 </vector>
diff --git a/packages/EasterEgg/res/drawable/leg1.xml b/packages/EasterEgg/res/drawable/leg1.xml
index 6257333..d72c746 100644
--- a/packages/EasterEgg/res/drawable/leg1.xml
+++ b/packages/EasterEgg/res/drawable/leg1.xml
@@ -18,5 +18,5 @@
         android:height="48dp"
         android:viewportWidth="48.0"
         android:viewportHeight="48.0">
-    <path android:name="leg1" android:fillColor="#FF000000" android:pathData="M9,38h5v5h-5z"/>
+    <path android:name="leg1" android:fillColor="#FF000000" android:pathData="M9,37h5v6h-5z"/>
 </vector>
diff --git a/packages/EasterEgg/res/drawable/leg2.xml b/packages/EasterEgg/res/drawable/leg2.xml
index 73352f6..a772a87 100644
--- a/packages/EasterEgg/res/drawable/leg2.xml
+++ b/packages/EasterEgg/res/drawable/leg2.xml
@@ -18,5 +18,5 @@
         android:height="48dp"
         android:viewportWidth="48.0"
         android:viewportHeight="48.0">
-    <path android:name="leg2" android:fillColor="#FF000000" android:pathData="M16,38h5v5h-5z"/>
+    <path android:name="leg2" android:fillColor="#FF000000" android:pathData="M16,37h5v6h-5z"/>
 </vector>
diff --git a/packages/EasterEgg/res/drawable/leg2_shadow.xml b/packages/EasterEgg/res/drawable/leg2_shadow.xml
index 77f4893..b01bd69 100644
--- a/packages/EasterEgg/res/drawable/leg2_shadow.xml
+++ b/packages/EasterEgg/res/drawable/leg2_shadow.xml
@@ -18,5 +18,5 @@
         android:height="48dp"
         android:viewportWidth="48.0"
         android:viewportHeight="48.0">
-    <path android:name="leg2_shadow" android:fillColor="#FF000000" android:pathData="M16,38h5v1h-5z"/>
+    <path android:name="leg2_shadow" android:fillColor="#FF000000" android:pathData="M16,37h5v3h-5z"/>
 </vector>
diff --git a/packages/EasterEgg/res/drawable/leg3.xml b/packages/EasterEgg/res/drawable/leg3.xml
index 53dea5c..d471236 100644
--- a/packages/EasterEgg/res/drawable/leg3.xml
+++ b/packages/EasterEgg/res/drawable/leg3.xml
@@ -18,5 +18,5 @@
         android:height="48dp"
         android:viewportWidth="48.0"
         android:viewportHeight="48.0">
-    <path android:name="leg3" android:fillColor="#FF000000" android:pathData="M27,38h5v5h-5z"/>
+    <path android:name="leg3" android:fillColor="#FF000000" android:pathData="M27,37h5v6h-5z"/>
 </vector>
diff --git a/packages/EasterEgg/res/drawable/leg4.xml b/packages/EasterEgg/res/drawable/leg4.xml
index f2ce73e..e5868eb 100644
--- a/packages/EasterEgg/res/drawable/leg4.xml
+++ b/packages/EasterEgg/res/drawable/leg4.xml
@@ -18,5 +18,5 @@
         android:height="48dp"
         android:viewportWidth="48.0"
         android:viewportHeight="48.0">
-    <path android:name="leg4" android:fillColor="#FF000000" android:pathData="M34,38h5v5h-5z"/>
+    <path android:name="leg4" android:fillColor="#FF000000" android:pathData="M34,37h5v6h-5z"/>
 </vector>
diff --git a/packages/EasterEgg/res/layout/cat_view.xml b/packages/EasterEgg/res/layout/cat_view.xml
index 82ced2f2..85b494d 100644
--- a/packages/EasterEgg/res/layout/cat_view.xml
+++ b/packages/EasterEgg/res/layout/cat_view.xml
@@ -20,12 +20,14 @@
     android:minHeight="?android:attr/listPreferredItemHeightSmall"
     android:paddingStart="?android:attr/listPreferredItemPaddingStart"
     android:paddingEnd="?android:attr/listPreferredItemPaddingEnd"
+    android:paddingTop="8dp"
+    android:paddingBottom="8dp"
     android:background="?android:attr/selectableItemBackgroundBorderless"
     android:gravity="center_horizontal"
     android:clipToPadding="false">
 
     <FrameLayout
-        android:layout_width="wrap_content"
+        android:layout_width="96dp"
         android:layout_height="wrap_content">
 
         <ImageView
@@ -33,6 +35,7 @@
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
             android:padding="10dp"
+            android:layout_gravity="center"
             android:scaleType="fitCenter" />
 
         <LinearLayout
diff --git a/packages/EasterEgg/res/values/dimens.xml b/packages/EasterEgg/res/values/dimens.xml
new file mode 100644
index 0000000..e9dcebd
--- /dev/null
+++ b/packages/EasterEgg/res/values/dimens.xml
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+Copyright (C) 2016 The Android Open Source Project
+
+   Licensed under the Apache License, Version 2.0 (the "License");
+    you may not use this file except in compliance with the License.
+    You may obtain a copy of the License at
+
+         http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS,
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+    See the License for the specific language governing permissions and
+    limitations under the License.
+-->
+<resources xmlns:android="http://schemas.android.com/apk/res/android">
+    <dimen name="neko_display_size">64dp</dimen>
+</resources>
diff --git a/packages/EasterEgg/res/values/strings.xml b/packages/EasterEgg/res/values/strings.xml
index a2440c7b..8478a43 100644
--- a/packages/EasterEgg/res/values/strings.xml
+++ b/packages/EasterEgg/res/values/strings.xml
@@ -21,6 +21,7 @@
     <string name="notification_title" translatable="false">A cat is here.</string>
     <string name="default_cat_name" translatable="false">Cat #%s</string>
     <string name="directory_name" translatable="false">Cats</string>
+    <string name="confirm_delete" translatable="false">Forget %s?</string>
     <string-array name="food_names" translatable="false">
         <item>Empty dish</item>
         <item>Bits</item>
diff --git a/packages/EasterEgg/src/com/android/egg/neko/Cat.java b/packages/EasterEgg/src/com/android/egg/neko/Cat.java
index f74a229..a4df372 100644
--- a/packages/EasterEgg/src/com/android/egg/neko/Cat.java
+++ b/packages/EasterEgg/src/com/android/egg/neko/Cat.java
@@ -24,6 +24,7 @@
 import android.graphics.drawable.Icon;
 import android.os.Bundle;
 
+import java.io.ByteArrayOutputStream;
 import java.util.Random;
 import java.util.concurrent.ThreadLocalRandom;
 
@@ -142,7 +143,7 @@
         mSeed = seed;
 
         setName(context.getString(R.string.default_cat_name,
-                String.valueOf(mSeed).substring(0, 3)));
+                String.valueOf(mSeed % 1000)));
 
         final Random nsr = notSoRandom(seed);
 
@@ -174,10 +175,10 @@
         } else {
             if (nsr.nextFloat() < 0.25f) {
                 mFootType = 2;
-                tint(0xFFFFFFFF, D.foot1, D.foot2);
+                tint(0xFFFFFFFF, D.foot1, D.foot3);
             } else if (nsr.nextFloat() < 0.25f) {
                 mFootType = 3; // maybe -2 would be better? meh.
-                tint(0xFFFFFFFF, D.foot3, D.foot4);
+                tint(0xFFFFFFFF, D.foot2, D.foot4);
             } else if (nsr.nextFloat() < 0.1f) {
                 mFootType = 1;
                 tint(0xFFFFFFFF, (Drawable) choose(nsr, D.foot1, D.foot2, D.foot3, D.foot4));
@@ -208,7 +209,7 @@
                 .addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
         return new Notification.Builder(context)
                 .setSmallIcon(Icon.createWithResource(context, R.drawable.stat_icon))
-                .setLargeIcon(createLargeIcon(context))
+                .setLargeIcon(createNotificationLargeIcon(context))
                 .setColor(getBodyColor())
                 .setPriority(Notification.PRIORITY_LOW)
                 .setContentTitle(context.getString(R.string.notification_title))
@@ -258,11 +259,24 @@
         return result;
     }
 
-    public Icon createLargeIcon(Context context) {
-        final Resources res = context.getResources();
-        final int w = res.getDimensionPixelSize(android.R.dimen.notification_large_icon_width);
-        final int h = res.getDimensionPixelSize(android.R.dimen.notification_large_icon_height);
+    public static Icon recompressIcon(Icon bitmapIcon) {
+        if (bitmapIcon.getType() != Icon.TYPE_BITMAP) return bitmapIcon;
+        final Bitmap bits = bitmapIcon.getBitmap();
+        final ByteArrayOutputStream ostream = new ByteArrayOutputStream(
+                bits.getWidth() * bits.getHeight() * 2); // guess 50% compression
+        final boolean ok = bits.compress(Bitmap.CompressFormat.PNG, 100, ostream);
+        if (!ok) return null;
+        return Icon.createWithData(ostream.toByteArray(), 0, ostream.size());
+    }
 
+    public Icon createNotificationLargeIcon(Context context) {
+        final Resources res = context.getResources();
+        final int w = 2*res.getDimensionPixelSize(android.R.dimen.notification_large_icon_width);
+        final int h = 2*res.getDimensionPixelSize(android.R.dimen.notification_large_icon_height);
+        return recompressIcon(createIcon(context, w, h));
+    }
+
+    public Icon createIcon(Context context, int w, int h) {
         Bitmap result = Bitmap.createBitmap(w, h, Bitmap.Config.ARGB_8888);
         final Canvas canvas = new Canvas(result);
         final Paint pt = new Paint();
diff --git a/packages/EasterEgg/src/com/android/egg/neko/NekoLand.java b/packages/EasterEgg/src/com/android/egg/neko/NekoLand.java
index 3629162..f59f0d9 100644
--- a/packages/EasterEgg/src/com/android/egg/neko/NekoLand.java
+++ b/packages/EasterEgg/src/com/android/egg/neko/NekoLand.java
@@ -59,6 +59,8 @@
     public static boolean DEBUG = false;
     public static boolean DEBUG_NOTIFICATIONS = false;
 
+    private static final int EXPORT_BITMAP_SIZE = 600;
+
     private static final int STORAGE_PERM_REQUEST = 123;
 
     private static boolean CAT_GEN = false;
@@ -146,7 +148,9 @@
         final EditText text = (EditText) view.findViewById(android.R.id.edit);
         text.setText(cat.getName());
         text.setSelection(cat.getName().length());
-        Drawable catIcon = cat.createLargeIcon(this).loadDrawable(this);
+        final int size = context.getResources()
+                .getDimensionPixelSize(android.R.dimen.app_icon_size);
+        Drawable catIcon = cat.createIcon(this, size, size).loadDrawable(this);
         new AlertDialog.Builder(context)
                 .setTitle(" ")
                 .setIcon(catIcon)
@@ -181,10 +185,36 @@
                     .inflate(R.layout.cat_view, parent, false));
         }
 
+        private void setContextGroupVisible(final CatHolder holder, boolean vis) {
+            final View group = holder.contextGroup;
+            if (vis && group.getVisibility() != View.VISIBLE) {
+                group.setAlpha(0);
+                group.setVisibility(View.VISIBLE);
+                group.animate().alpha(1.0f).setDuration(333);
+                Runnable hideAction = new Runnable() {
+                    @Override
+                    public void run() {
+                        setContextGroupVisible(holder, false);
+                    }
+                };
+                group.setTag(hideAction);
+                group.postDelayed(hideAction, 5000);
+            } else if (!vis && group.getVisibility() == View.VISIBLE) {
+                group.removeCallbacks((Runnable) group.getTag());
+                group.animate().alpha(0f).setDuration(250).withEndAction(new Runnable() {
+                    @Override
+                    public void run() {
+                        group.setVisibility(View.INVISIBLE);
+                    }
+                });
+            }
+        }
+
         @Override
         public void onBindViewHolder(final CatHolder holder, int position) {
             Context context = holder.itemView.getContext();
-            holder.imageView.setImageIcon(mCats[position].createLargeIcon(context));
+            final int size = context.getResources().getDimensionPixelSize(R.dimen.neko_display_size);
+            holder.imageView.setImageIcon(mCats[position].createIcon(context, size, size));
             holder.textView.setText(mCats[position].getName());
             holder.itemView.setOnClickListener(new View.OnClickListener() {
                 @Override
@@ -195,30 +225,30 @@
             holder.itemView.setOnLongClickListener(new OnLongClickListener() {
                 @Override
                 public boolean onLongClick(View v) {
-                    holder.contextGroup.removeCallbacks((Runnable) holder.contextGroup.getTag());
-                    holder.contextGroup.setVisibility(View.VISIBLE);
-                    Runnable hideAction = new Runnable() {
-                        @Override
-                        public void run() {
-                            holder.contextGroup.setVisibility(View.INVISIBLE);
-                        }
-                    };
-                    holder.contextGroup.setTag(hideAction);
-                    holder.contextGroup.postDelayed(hideAction, 5000);
+                    setContextGroupVisible(holder, true);
                     return true;
                 }
             });
             holder.delete.setOnClickListener(new View.OnClickListener() {
                 @Override
                 public void onClick(View v) {
-                    holder.contextGroup.setVisibility(View.INVISIBLE);
-                    holder.contextGroup.removeCallbacks((Runnable) holder.contextGroup.getTag());
-                    onCatRemove(mCats[holder.getAdapterPosition()]);
+                    setContextGroupVisible(holder, false);
+                    new AlertDialog.Builder(NekoLand.this)
+                        .setTitle(getString(R.string.confirm_delete, mCats[position].getName()))
+                        .setNegativeButton(android.R.string.cancel, null)
+                        .setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() {
+                            @Override
+                            public void onClick(DialogInterface dialog, int which) {
+                                onCatRemove(mCats[holder.getAdapterPosition()]);
+                            }
+                        })
+                        .show();
                 }
             });
             holder.share.setOnClickListener(new View.OnClickListener() {
                 @Override
                 public void onClick(View v) {
+                    setContextGroupVisible(holder, false);
                     Cat cat = mCats[holder.getAdapterPosition()];
                     if (checkSelfPermission(Manifest.permission.WRITE_EXTERNAL_STORAGE)
                             != PackageManager.PERMISSION_GRANTED) {
@@ -248,7 +278,7 @@
             return;
         }
         final File png = new File(dir, cat.getName().replaceAll("[/ #:]+", "_") + ".png");
-        Bitmap bitmap = cat.createBitmap(512, 512);
+        Bitmap bitmap = cat.createBitmap(EXPORT_BITMAP_SIZE, EXPORT_BITMAP_SIZE);
         if (bitmap != null) {
             try {
                 OutputStream os = new FileOutputStream(png);
diff --git a/packages/PrintSpooler/src/com/android/printspooler/ui/PrintActivity.java b/packages/PrintSpooler/src/com/android/printspooler/ui/PrintActivity.java
index 906a146..1d50a24 100644
--- a/packages/PrintSpooler/src/com/android/printspooler/ui/PrintActivity.java
+++ b/packages/PrintSpooler/src/com/android/printspooler/ui/PrintActivity.java
@@ -264,6 +264,8 @@
     public void onCreate(Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);
 
+        setTitle(R.string.print_dialog);
+
         Bundle extras = getIntent().getExtras();
 
         mPrintJob = extras.getParcelable(PrintManager.EXTRA_PRINT_JOB);
@@ -322,7 +324,6 @@
         // Now that we are bound to the local print spooler service
         // and the printer registry loaded the historical printers
         // we can show the UI without flickering.
-        setTitle(R.string.print_dialog);
         setContentView(R.layout.print_activity);
 
         try {
diff --git a/packages/SettingsLib/res/values-uz-rUZ/strings.xml b/packages/SettingsLib/res/values-uz-rUZ/strings.xml
index 6879600..9022ad3 100644
--- a/packages/SettingsLib/res/values-uz-rUZ/strings.xml
+++ b/packages/SettingsLib/res/values-uz-rUZ/strings.xml
@@ -75,7 +75,7 @@
     <string name="bluetooth_pairing_will_share_phonebook" msgid="4982239145676394429">"Agar ulanishga ruxsat bersangiz, ulangan vaqtda kontakt va qo‘ng‘iroqlaringiz tarixiga kirishi mumkin."</string>
     <string name="bluetooth_pairing_error_message" msgid="3748157733635947087">"<xliff:g id="DEVICE_NAME">%1$s</xliff:g> bilan biriktirib bo‘lmadi."</string>
     <string name="bluetooth_pairing_pin_error_message" msgid="8337234855188925274">"<xliff:g id="DEVICE_NAME">%1$s</xliff:g> qurilmasiga ulanib bo‘lmadi, chunki PIN-kod yoki parol noto‘g‘ri kiritildi."</string>
-    <string name="bluetooth_pairing_device_down_error_message" msgid="7870998403045801381">"Quyidagi qurilma javob bermayapti: <xliff:g id="DEVICE_NAME">%1$s</xliff:g>."</string>
+    <string name="bluetooth_pairing_device_down_error_message" msgid="7870998403045801381">"“<xliff:g id="DEVICE_NAME">%1$s</xliff:g>” qurilmasi bilan aloqa o‘rnatib bo‘lmayapti."</string>
     <string name="bluetooth_pairing_rejected_error_message" msgid="1648157108520832454">"<xliff:g id="DEVICE_NAME">%1$s</xliff:g> biriktirish so‘rovini rad qildi."</string>
     <string name="accessibility_wifi_off" msgid="1166761729660614716">"Wi-Fi o‘chiq."</string>
     <string name="accessibility_no_wifi" msgid="8834610636137374508">"Wi-Fi o‘chiq."</string>
diff --git a/packages/SettingsProvider/res/values/defaults.xml b/packages/SettingsProvider/res/values/defaults.xml
index 978ca94..f7e9541 100644
--- a/packages/SettingsProvider/res/values/defaults.xml
+++ b/packages/SettingsProvider/res/values/defaults.xml
@@ -153,7 +153,7 @@
     <integer name="def_download_manager_recommended_max_bytes_over_mobile">-1</integer>
 
     <!-- Default for Settings.Secure.LONG_PRESS_TIMEOUT_MILLIS -->
-    <integer name="def_long_press_timeout_millis">500</integer>
+    <integer name="def_long_press_timeout_millis">400</integer>
 
     <!-- Default for Settings.Secure.SHOW_IME_WITH_HARD_KEYBOARD -->
     <bool name="def_show_ime_with_hard_keyboard">false</bool>
diff --git a/packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java b/packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java
index 1928f92..d27f1f8 100644
--- a/packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java
+++ b/packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java
@@ -1202,6 +1202,11 @@
                 restriction = UserManager.DISALLOW_CONFIG_VPN;
                 break;
 
+            case Settings.Global.SAFE_BOOT_DISALLOWED:
+                if ("1".equals(value)) return false;
+                restriction = UserManager.DISALLOW_SAFE_BOOT;
+                break;
+
             default:
                 if (setting != null && setting.startsWith(Settings.Global.DATA_ROAMING)) {
                     if ("0".equals(value)) return false;
@@ -2085,7 +2090,7 @@
         }
 
         private final class UpgradeController {
-            private static final int SETTINGS_VERSION = 129;
+            private static final int SETTINGS_VERSION = 130;
 
             private final int mUserId;
 
@@ -2376,6 +2381,32 @@
                     currentVersion = 129;
                 }
 
+                if (currentVersion == 129) {
+                    // default longpress timeout changed from 500 to 400. If unchanged from the old
+                    // default, update to the new default.
+                    final SettingsState systemSecureSettings =
+                            getSecureSettingsLocked(userId);
+                    final String oldValue = systemSecureSettings.getSettingLocked(
+                            Settings.Secure.LONG_PRESS_TIMEOUT).getValue();
+                    if (TextUtils.equals("500", oldValue)) {
+                        systemSecureSettings.insertSettingLocked(
+                                Settings.Secure.LONG_PRESS_TIMEOUT,
+                                String.valueOf(getContext().getResources().getInteger(
+                                        R.integer.def_long_press_timeout_millis)),
+                                SettingsState.SYSTEM_PACKAGE_NAME);
+                    }
+                    currentVersion = 130;
+                }
+
+                if (currentVersion != newVersion) {
+                    Slog.w("SettingsProvider", "warning: upgrading settings database to version "
+                            + newVersion + " left it at "
+                            + currentVersion + " instead; this is probably a bug", new Throwable());
+                    if (DEBUG) {
+                        throw new RuntimeException("db upgrade error");
+                    }
+                }
+
                 // vXXX: Add new settings above this point.
 
                 // Return the current version.
diff --git a/packages/Shell/res/values-af/strings.xml b/packages/Shell/res/values-af/strings.xml
index 51679f7..391017e 100644
--- a/packages/Shell/res/values-af/strings.xml
+++ b/packages/Shell/res/values-af/strings.xml
@@ -21,7 +21,7 @@
     <string name="bugreport_finished_title" msgid="4429132808670114081">"Foutverslag <xliff:g id="ID">#%d</xliff:g> is vasgevang"</string>
     <string name="bugreport_updating_title" msgid="4423539949559634214">"Voeg tans besonderhede by die foutverslag"</string>
     <string name="bugreport_updating_wait" msgid="3322151947853929470">"Wag asseblief …"</string>
-    <string name="bugreport_finished_text" product="watch" msgid="8389172248433597683">"Swiep na links om jou foutverslag te deel"</string>
+    <string name="bugreport_finished_text" product="watch" msgid="1223616207145252689">"Die foutverslag sal binnekort op die foon verskyn"</string>
     <string name="bugreport_finished_text" product="default" msgid="8353769438382138847">"Tik om jou foutverslag te deel"</string>
     <string name="bugreport_finished_pending_screenshot_text" product="watch" msgid="1474435374470177193">"Tik om jou foutverslag sonder \'n skermkiekie te deel, of wag totdat die skermkiekie gereed is"</string>
     <string name="bugreport_finished_pending_screenshot_text" product="default" msgid="1474435374470177193">"Tik om jou foutverslag sonder \'n skermkiekie te deel, of wag totdat die skermkiekie gereed is"</string>
diff --git a/packages/Shell/res/values-am/strings.xml b/packages/Shell/res/values-am/strings.xml
index f04e882..dccf9dd 100644
--- a/packages/Shell/res/values-am/strings.xml
+++ b/packages/Shell/res/values-am/strings.xml
@@ -21,7 +21,7 @@
     <string name="bugreport_finished_title" msgid="4429132808670114081">"የሳንካ ሪፖርት <xliff:g id="ID">#%d</xliff:g> ተወስዷል"</string>
     <string name="bugreport_updating_title" msgid="4423539949559634214">"ዝርዝሮችን ወደ የሳንካ ሪፖርቱ በማከል ላይ"</string>
     <string name="bugreport_updating_wait" msgid="3322151947853929470">"እባክዎ ይጠብቁ…"</string>
-    <string name="bugreport_finished_text" product="watch" msgid="8389172248433597683">"የሳንካ ሪፖርትዎን ለማጋራት ወደ ግራ ያንሸራትቱ"</string>
+    <string name="bugreport_finished_text" product="watch" msgid="1223616207145252689">"የሳንካ ሪፖርቱ ከትንሽ ጊዜ በኋላ በስልኩ ላይ ይመጣል"</string>
     <string name="bugreport_finished_text" product="default" msgid="8353769438382138847">"የሳንካ ሪፖርትዎን ለማጋራት መታ ያድርጉ"</string>
     <string name="bugreport_finished_pending_screenshot_text" product="watch" msgid="1474435374470177193">"የእርስዎን የሳንካ ሪፖርት ያለ ቅጽበታዊ ማያ ገጽ ለማጋራት መታ ያድርጉ ወይም ቅጽበታዊ ማያ ገጹ እስኪጨርስ ይጠብቁ"</string>
     <string name="bugreport_finished_pending_screenshot_text" product="default" msgid="1474435374470177193">"የእርስዎን የሳንካ ሪፖርት ያለ ቅጽበታዊ ማያ ገጽ ለማጋራት መታ ያድርጉ ወይም ቅጽበታዊ ማያ ገጹ እስኪጨርስ ይጠብቁ"</string>
diff --git a/packages/Shell/res/values-ar/strings.xml b/packages/Shell/res/values-ar/strings.xml
index 37516a1..d2e3cc5 100644
--- a/packages/Shell/res/values-ar/strings.xml
+++ b/packages/Shell/res/values-ar/strings.xml
@@ -21,7 +21,7 @@
     <string name="bugreport_finished_title" msgid="4429132808670114081">"تم تسجيل تقرير الخطأ <xliff:g id="ID">#%d</xliff:g>."</string>
     <string name="bugreport_updating_title" msgid="4423539949559634214">"إضافة تفاصيل إلى تقرير الخطأ"</string>
     <string name="bugreport_updating_wait" msgid="3322151947853929470">"الرجاء الانتظار…"</string>
-    <string name="bugreport_finished_text" product="watch" msgid="8389172248433597683">"مرر بسرعة لليمين لمشاركة تقرير الخطأ"</string>
+    <string name="bugreport_finished_text" product="watch" msgid="1223616207145252689">"سيظهر تقرير الخطأ على الهاتف بعد قليل"</string>
     <string name="bugreport_finished_text" product="default" msgid="8353769438382138847">"انقر لمشاركة تقرير الخطأ."</string>
     <string name="bugreport_finished_pending_screenshot_text" product="watch" msgid="1474435374470177193">"انقر لمشاركة تقرير الأخطاء بدون لقطة شاشة أو انتظر حتى انتهاء لقطة الشاشة"</string>
     <string name="bugreport_finished_pending_screenshot_text" product="default" msgid="1474435374470177193">"انقر لمشاركة تقرير الأخطاء بدون لقطة شاشة أو انتظر حتى انتهاء لقطة الشاشة"</string>
diff --git a/packages/Shell/res/values-az-rAZ/strings.xml b/packages/Shell/res/values-az-rAZ/strings.xml
index 303467b..9e6c84b 100644
--- a/packages/Shell/res/values-az-rAZ/strings.xml
+++ b/packages/Shell/res/values-az-rAZ/strings.xml
@@ -21,7 +21,7 @@
     <string name="bugreport_finished_title" msgid="4429132808670114081">"Baq hesabatı <xliff:g id="ID">#%d</xliff:g> alındı"</string>
     <string name="bugreport_updating_title" msgid="4423539949559634214">"Detallar baq hesabatına əlavə olunur"</string>
     <string name="bugreport_updating_wait" msgid="3322151947853929470">"Lütfən, gözləyin..."</string>
-    <string name="bugreport_finished_text" product="watch" msgid="8389172248433597683">"Baq raportunu paylaşmaq üçün sola sürüşdürün"</string>
+    <string name="bugreport_finished_text" product="watch" msgid="1223616207145252689">"Baq həlli tezliklə telefonda görünəcək"</string>
     <string name="bugreport_finished_text" product="default" msgid="8353769438382138847">"Baq hesabatınızı paylaşmaq üçün tıklayın"</string>
     <string name="bugreport_finished_pending_screenshot_text" product="watch" msgid="1474435374470177193">"baq hesabatınızı skrinşot olmadan paylaşmaq üçün tıklayın, skrinşotun tamamlanması üçün isə gözləyin"</string>
     <string name="bugreport_finished_pending_screenshot_text" product="default" msgid="1474435374470177193">"baq hesabatınızı skrinşot olmadan paylaşmaq üçün tıklayın, skrinşotun tamamlanması üçün isə gözləyin"</string>
diff --git a/packages/Shell/res/values-b+sr+Latn/strings.xml b/packages/Shell/res/values-b+sr+Latn/strings.xml
index 185b690..3c7c7e8 100644
--- a/packages/Shell/res/values-b+sr+Latn/strings.xml
+++ b/packages/Shell/res/values-b+sr+Latn/strings.xml
@@ -21,7 +21,7 @@
     <string name="bugreport_finished_title" msgid="4429132808670114081">"Izveštaj o grešci <xliff:g id="ID">#%d</xliff:g> je snimljen"</string>
     <string name="bugreport_updating_title" msgid="4423539949559634214">"Dodaju se detalji u izveštaj o grešci"</string>
     <string name="bugreport_updating_wait" msgid="3322151947853929470">"Sačekajte..."</string>
-    <string name="bugreport_finished_text" product="watch" msgid="8389172248433597683">"Prevucite ulevo da biste delili izveštaj o greškama"</string>
+    <string name="bugreport_finished_text" product="watch" msgid="1223616207145252689">"Izveštaj o grešci će se uskoro pojaviti na telefonu"</string>
     <string name="bugreport_finished_text" product="default" msgid="8353769438382138847">"Dodirnite da biste delili izveštaj o grešci"</string>
     <string name="bugreport_finished_pending_screenshot_text" product="watch" msgid="1474435374470177193">"Dodirnite za deljenje izveštaja o grešci bez snimka ekrana ili sačekajte da se napravi snimak ekrana"</string>
     <string name="bugreport_finished_pending_screenshot_text" product="default" msgid="1474435374470177193">"Dodirnite za deljenje izveštaja o grešci bez snimka ekrana ili sačekajte da se napravi snimak ekrana"</string>
diff --git a/packages/Shell/res/values-be-rBY/strings.xml b/packages/Shell/res/values-be-rBY/strings.xml
index fb29fbc..7e7fc79 100644
--- a/packages/Shell/res/values-be-rBY/strings.xml
+++ b/packages/Shell/res/values-be-rBY/strings.xml
@@ -21,7 +21,7 @@
     <string name="bugreport_finished_title" msgid="4429132808670114081">"Справаздача <xliff:g id="ID">#%d</xliff:g> пра памылку зафіксавана"</string>
     <string name="bugreport_updating_title" msgid="4423539949559634214">"Дадаванне падрабязнасцей да справаздачы пра памылкі"</string>
     <string name="bugreport_updating_wait" msgid="3322151947853929470">"Калі ласка, пачакайце..."</string>
-    <string name="bugreport_finished_text" product="watch" msgid="8389172248433597683">"Правядзіце пальцам налева, каб абагуліць сваю справаздачу пра памылку"</string>
+    <string name="bugreport_finished_text" product="watch" msgid="1223616207145252689">"Паведамленне пра памылку хутка з\'явіцца на тэлефоне"</string>
     <string name="bugreport_finished_text" product="default" msgid="8353769438382138847">"Дакраніцеся, каб абагуліць сваю справаздачу пра памылку"</string>
     <string name="bugreport_finished_pending_screenshot_text" product="watch" msgid="1474435374470177193">"Краніце, каб абагуліць справаздачу пра памылку без здымка экрана, або чакайце атрымання здымка."</string>
     <string name="bugreport_finished_pending_screenshot_text" product="default" msgid="1474435374470177193">"Краніце, каб абагуліць справаздачу пра памылку без здымка экрана, або чакайце атрымання здымка."</string>
diff --git a/packages/Shell/res/values-bg/strings.xml b/packages/Shell/res/values-bg/strings.xml
index 0787900..ed8caaf 100644
--- a/packages/Shell/res/values-bg/strings.xml
+++ b/packages/Shell/res/values-bg/strings.xml
@@ -21,7 +21,7 @@
     <string name="bugreport_finished_title" msgid="4429132808670114081">"Сигналът за програмна грешка „<xliff:g id="ID">#%d</xliff:g>“ е заснет"</string>
     <string name="bugreport_updating_title" msgid="4423539949559634214">"Подробностите се добавят към сигнала за пр. грешка"</string>
     <string name="bugreport_updating_wait" msgid="3322151947853929470">"Моля, изчакайте…"</string>
-    <string name="bugreport_finished_text" product="watch" msgid="8389172248433597683">"Прекарайте пръст наляво, за да споделите сигнала си за програмна грешка"</string>
+    <string name="bugreport_finished_text" product="watch" msgid="1223616207145252689">"Сигналът за програмна грешка скоро ще се покаже на телефона"</string>
     <string name="bugreport_finished_text" product="default" msgid="8353769438382138847">"Докоснете, за да споделите сигнала си за програмна грешка"</string>
     <string name="bugreport_finished_pending_screenshot_text" product="watch" msgid="1474435374470177193">"Докоснете, за да споделите сигнала за прогр. грешка без екранна снимка, или изчакайте завършването й"</string>
     <string name="bugreport_finished_pending_screenshot_text" product="default" msgid="1474435374470177193">"Докоснете, за да споделите сигнала за прогр. грешка без екранна снимка, или изчакайте завършването й"</string>
diff --git a/packages/Shell/res/values-bn-rBD/strings.xml b/packages/Shell/res/values-bn-rBD/strings.xml
index a51950a..b7d550c 100644
--- a/packages/Shell/res/values-bn-rBD/strings.xml
+++ b/packages/Shell/res/values-bn-rBD/strings.xml
@@ -21,7 +21,7 @@
     <string name="bugreport_finished_title" msgid="4429132808670114081">"ত্রুটির প্রতিবেদন <xliff:g id="ID">#%d</xliff:g> ক্যাপচার করা হয়েছে"</string>
     <string name="bugreport_updating_title" msgid="4423539949559634214">"ত্রুটির প্রতিবেদনে বিশদ বিবরণ যোগ করা হচ্ছে"</string>
     <string name="bugreport_updating_wait" msgid="3322151947853929470">"অনুগ্রহ করে অপেক্ষা করুন..."</string>
-    <string name="bugreport_finished_text" product="watch" msgid="8389172248433597683">"আপনার বাগ রিপোর্ট শেয়ার করতে বামে সোয়াইপ করুন"</string>
+    <string name="bugreport_finished_text" product="watch" msgid="1223616207145252689">"ফোনে শীঘ্রই ত্রুটির প্রতিবেদন দেখা যাবে"</string>
     <string name="bugreport_finished_text" product="default" msgid="8353769438382138847">"আপনার ত্রুটির প্রতিবেদন শেয়ার করতে আলতো চাপ দিন"</string>
     <string name="bugreport_finished_pending_screenshot_text" product="watch" msgid="1474435374470177193">"কোনো স্ক্রীনশট ছাড়াই ত্রুটির প্রতিবেদন শেয়ার করতে আলতো চাপ দিন বা সম্পন্ন করতে স্ক্রীনশটের জন্য অপেক্ষা করুন"</string>
     <string name="bugreport_finished_pending_screenshot_text" product="default" msgid="1474435374470177193">"কোনো স্ক্রীনশট ছাড়াই ত্রুটির প্রতিবেদন শেয়ার করতে আলতো চাপ দিন বা সম্পন্ন করতে স্ক্রীনশটের জন্য অপেক্ষা করুন"</string>
diff --git a/packages/Shell/res/values-bs-rBA/strings.xml b/packages/Shell/res/values-bs-rBA/strings.xml
index 80dddb5..88d247d 100644
--- a/packages/Shell/res/values-bs-rBA/strings.xml
+++ b/packages/Shell/res/values-bs-rBA/strings.xml
@@ -21,7 +21,7 @@
     <string name="bugreport_finished_title" msgid="4429132808670114081">"Izvještaj o grešci <xliff:g id="ID">#%d</xliff:g> je snimljen"</string>
     <string name="bugreport_updating_title" msgid="4423539949559634214">"Dodavanje detalja u izvještaj o greškama"</string>
     <string name="bugreport_updating_wait" msgid="3322151947853929470">"Pričekajte..."</string>
-    <string name="bugreport_finished_text" product="watch" msgid="8389172248433597683">"Prevucite lijevo da podijelite izvještaj o greškama"</string>
+    <string name="bugreport_finished_text" product="watch" msgid="1223616207145252689">"Izvještaj o greškama će se ubrzo pojaviti na ekranu"</string>
     <string name="bugreport_finished_text" product="default" msgid="8353769438382138847">"Dodirnite da biste podijelili izvještaj o grešci"</string>
     <string name="bugreport_finished_pending_screenshot_text" product="watch" msgid="1474435374470177193">"Dodirnite da podijelite izveštaj o greškama bez snimka ekrana ili sačekajte da snimak bude gotov"</string>
     <string name="bugreport_finished_pending_screenshot_text" product="default" msgid="1474435374470177193">"Dodirnite da podijelite izveštaj o greškama bez snimka ekrana ili sačekajte da snimak bude gotov"</string>
diff --git a/packages/Shell/res/values-ca/strings.xml b/packages/Shell/res/values-ca/strings.xml
index f8ed813..d570a54 100644
--- a/packages/Shell/res/values-ca/strings.xml
+++ b/packages/Shell/res/values-ca/strings.xml
@@ -21,7 +21,7 @@
     <string name="bugreport_finished_title" msgid="4429132808670114081">"S\'ha capturat l\'informe d\'errors <xliff:g id="ID">#%d</xliff:g>"</string>
     <string name="bugreport_updating_title" msgid="4423539949559634214">"S\'estan afegint detalls a l\'informe d\'errors"</string>
     <string name="bugreport_updating_wait" msgid="3322151947853929470">"Espera…"</string>
-    <string name="bugreport_finished_text" product="watch" msgid="8389172248433597683">"Llisca cap a l\'esquerra per compartir l\'informe d\'errors."</string>
+    <string name="bugreport_finished_text" product="watch" msgid="1223616207145252689">"L\'informe d\'errors es mostrarà al telèfon aviat"</string>
     <string name="bugreport_finished_text" product="default" msgid="8353769438382138847">"Toca per compartir l\'informe d\'errors"</string>
     <string name="bugreport_finished_pending_screenshot_text" product="watch" msgid="1474435374470177193">"Toca per compartir l\'informe d\'errors sense captura de pantalla o espera que es creï la captura"</string>
     <string name="bugreport_finished_pending_screenshot_text" product="default" msgid="1474435374470177193">"Toca per compartir l\'informe d\'errors sense captura de pantalla o espera que es creï la captura"</string>
diff --git a/packages/Shell/res/values-cs/strings.xml b/packages/Shell/res/values-cs/strings.xml
index 4e41b79..f05a9ba 100644
--- a/packages/Shell/res/values-cs/strings.xml
+++ b/packages/Shell/res/values-cs/strings.xml
@@ -21,7 +21,7 @@
     <string name="bugreport_finished_title" msgid="4429132808670114081">"Zpráva o chybě <xliff:g id="ID">#%d</xliff:g> byla vytvořena"</string>
     <string name="bugreport_updating_title" msgid="4423539949559634214">"Přidávání podrobností do zprávy o chybě"</string>
     <string name="bugreport_updating_wait" msgid="3322151947853929470">"Čekejte prosím…"</string>
-    <string name="bugreport_finished_text" product="watch" msgid="8389172248433597683">"Chcete-li hlášení chyby sdílet, přejeďte doleva."</string>
+    <string name="bugreport_finished_text" product="watch" msgid="1223616207145252689">"Na telefonu se brzy zobrazí zpráva o chybě."</string>
     <string name="bugreport_finished_text" product="default" msgid="8353769438382138847">"Zprávu o chybě můžete sdílet klepnutím"</string>
     <string name="bugreport_finished_pending_screenshot_text" product="watch" msgid="1474435374470177193">"Klepnutím můžete zprávu o chybě sdílet bez snímku obrazovky, nebo vyčkejte, než se snímek připraví"</string>
     <string name="bugreport_finished_pending_screenshot_text" product="default" msgid="1474435374470177193">"Klepnutím můžete zprávu o chybě sdílet bez snímku obrazovky, nebo vyčkejte, než se snímek připraví"</string>
diff --git a/packages/Shell/res/values-da/strings.xml b/packages/Shell/res/values-da/strings.xml
index 19e800bf..3675eeb 100644
--- a/packages/Shell/res/values-da/strings.xml
+++ b/packages/Shell/res/values-da/strings.xml
@@ -21,7 +21,7 @@
     <string name="bugreport_finished_title" msgid="4429132808670114081">"Fejrapporten <xliff:g id="ID">#%d</xliff:g> blev gemt"</string>
     <string name="bugreport_updating_title" msgid="4423539949559634214">"Tilføjelse af oplysninger til fejlrapporten"</string>
     <string name="bugreport_updating_wait" msgid="3322151947853929470">"Vent et øjeblik…"</string>
-    <string name="bugreport_finished_text" product="watch" msgid="8389172248433597683">"Stryg til venstre for at dele din fejlrapport"</string>
+    <string name="bugreport_finished_text" product="watch" msgid="1223616207145252689">"Fejlrapporten vises på telefonen om et øjeblik"</string>
     <string name="bugreport_finished_text" product="default" msgid="8353769438382138847">"Tryk for at dele din fejlrapport"</string>
     <string name="bugreport_finished_pending_screenshot_text" product="watch" msgid="1474435374470177193">"Tryk for at dele din fejlrapport uden et skærmbillede, eller vent på, at skærmbilledet fuldføres"</string>
     <string name="bugreport_finished_pending_screenshot_text" product="default" msgid="1474435374470177193">"Tryk for at dele din fejlrapport uden et skærmbillede, eller vent på, at skærmbilledet fuldføres"</string>
diff --git a/packages/Shell/res/values-de/strings.xml b/packages/Shell/res/values-de/strings.xml
index 0235824..543ccdd 100644
--- a/packages/Shell/res/values-de/strings.xml
+++ b/packages/Shell/res/values-de/strings.xml
@@ -21,7 +21,7 @@
     <string name="bugreport_finished_title" msgid="4429132808670114081">"Fehlerbericht <xliff:g id="ID">#%d</xliff:g> erfasst"</string>
     <string name="bugreport_updating_title" msgid="4423539949559634214">"Informationen werden zum Fehlerbericht hinzugefügt"</string>
     <string name="bugreport_updating_wait" msgid="3322151947853929470">"Bitte warten…"</string>
-    <string name="bugreport_finished_text" product="watch" msgid="8389172248433597683">"Wische nach links, um deinen Fehlerbericht zu teilen."</string>
+    <string name="bugreport_finished_text" product="watch" msgid="1223616207145252689">"Der Fehlerbericht wird in Kürze auf dem Smartphone angezeigt"</string>
     <string name="bugreport_finished_text" product="default" msgid="8353769438382138847">"Zum Teilen des Fehlerberichts tippen"</string>
     <string name="bugreport_finished_pending_screenshot_text" product="watch" msgid="1474435374470177193">"Tippe, um den Fehlerbericht ohne Screenshot zu teilen, oder warte auf den Screenshot"</string>
     <string name="bugreport_finished_pending_screenshot_text" product="default" msgid="1474435374470177193">"Tippe, um den Fehlerbericht ohne Screenshot zu teilen, oder warte auf den Screenshot"</string>
diff --git a/packages/Shell/res/values-el/strings.xml b/packages/Shell/res/values-el/strings.xml
index 4bed10c..a0222d8 100644
--- a/packages/Shell/res/values-el/strings.xml
+++ b/packages/Shell/res/values-el/strings.xml
@@ -21,7 +21,7 @@
     <string name="bugreport_finished_title" msgid="4429132808670114081">"Έγινε λήψη της αναφοράς σφάλματος <xliff:g id="ID">#%d</xliff:g>"</string>
     <string name="bugreport_updating_title" msgid="4423539949559634214">"Προσθήκη λεπτομερειών στην αναφορά σφάλματος"</string>
     <string name="bugreport_updating_wait" msgid="3322151947853929470">"Περιμένετε…"</string>
-    <string name="bugreport_finished_text" product="watch" msgid="8389172248433597683">"Σύρετε προς τα αριστερά για κοινή χρήση της αναφοράς σφαλμάτων"</string>
+    <string name="bugreport_finished_text" product="watch" msgid="1223616207145252689">"Η αναφορά σφαλμάτων θα εμφανιστεί σύντομα στο τηλέφωνο"</string>
     <string name="bugreport_finished_text" product="default" msgid="8353769438382138847">"Πατήστε για κοινή χρήση της αναφοράς σφάλματος"</string>
     <string name="bugreport_finished_pending_screenshot_text" product="watch" msgid="1474435374470177193">"Πατήστε για κοινοποίηση της αναφοράς σφάλματος χωρίς στιγμιότυπο οθόνης ή περιμένετε να ολοκληρωθεί"</string>
     <string name="bugreport_finished_pending_screenshot_text" product="default" msgid="1474435374470177193">"Πατήστε για κοινοποίηση της αναφοράς σφάλματος χωρίς στιγμιότυπο οθόνης ή περιμένετε να ολοκληρωθεί"</string>
diff --git a/packages/Shell/res/values-en-rAU/strings.xml b/packages/Shell/res/values-en-rAU/strings.xml
index 15b587b..55cfd60 100644
--- a/packages/Shell/res/values-en-rAU/strings.xml
+++ b/packages/Shell/res/values-en-rAU/strings.xml
@@ -21,7 +21,7 @@
     <string name="bugreport_finished_title" msgid="4429132808670114081">"Bug report <xliff:g id="ID">#%d</xliff:g> captured"</string>
     <string name="bugreport_updating_title" msgid="4423539949559634214">"Adding details to the bug report"</string>
     <string name="bugreport_updating_wait" msgid="3322151947853929470">"Please wait…"</string>
-    <string name="bugreport_finished_text" product="watch" msgid="8389172248433597683">"Swipe left to share your bug report"</string>
+    <string name="bugreport_finished_text" product="watch" msgid="1223616207145252689">"The bug report will appear on the phone shortly"</string>
     <string name="bugreport_finished_text" product="default" msgid="8353769438382138847">"Tap to share your bug report"</string>
     <string name="bugreport_finished_pending_screenshot_text" product="watch" msgid="1474435374470177193">"Tap to share your bug report without a screenshot or wait for the screenshot to finish"</string>
     <string name="bugreport_finished_pending_screenshot_text" product="default" msgid="1474435374470177193">"Tap to share your bug report without a screenshot or wait for the screenshot to finish"</string>
diff --git a/packages/Shell/res/values-en-rGB/strings.xml b/packages/Shell/res/values-en-rGB/strings.xml
index 15b587b..55cfd60 100644
--- a/packages/Shell/res/values-en-rGB/strings.xml
+++ b/packages/Shell/res/values-en-rGB/strings.xml
@@ -21,7 +21,7 @@
     <string name="bugreport_finished_title" msgid="4429132808670114081">"Bug report <xliff:g id="ID">#%d</xliff:g> captured"</string>
     <string name="bugreport_updating_title" msgid="4423539949559634214">"Adding details to the bug report"</string>
     <string name="bugreport_updating_wait" msgid="3322151947853929470">"Please wait…"</string>
-    <string name="bugreport_finished_text" product="watch" msgid="8389172248433597683">"Swipe left to share your bug report"</string>
+    <string name="bugreport_finished_text" product="watch" msgid="1223616207145252689">"The bug report will appear on the phone shortly"</string>
     <string name="bugreport_finished_text" product="default" msgid="8353769438382138847">"Tap to share your bug report"</string>
     <string name="bugreport_finished_pending_screenshot_text" product="watch" msgid="1474435374470177193">"Tap to share your bug report without a screenshot or wait for the screenshot to finish"</string>
     <string name="bugreport_finished_pending_screenshot_text" product="default" msgid="1474435374470177193">"Tap to share your bug report without a screenshot or wait for the screenshot to finish"</string>
diff --git a/packages/Shell/res/values-en-rIN/strings.xml b/packages/Shell/res/values-en-rIN/strings.xml
index 15b587b..55cfd60 100644
--- a/packages/Shell/res/values-en-rIN/strings.xml
+++ b/packages/Shell/res/values-en-rIN/strings.xml
@@ -21,7 +21,7 @@
     <string name="bugreport_finished_title" msgid="4429132808670114081">"Bug report <xliff:g id="ID">#%d</xliff:g> captured"</string>
     <string name="bugreport_updating_title" msgid="4423539949559634214">"Adding details to the bug report"</string>
     <string name="bugreport_updating_wait" msgid="3322151947853929470">"Please wait…"</string>
-    <string name="bugreport_finished_text" product="watch" msgid="8389172248433597683">"Swipe left to share your bug report"</string>
+    <string name="bugreport_finished_text" product="watch" msgid="1223616207145252689">"The bug report will appear on the phone shortly"</string>
     <string name="bugreport_finished_text" product="default" msgid="8353769438382138847">"Tap to share your bug report"</string>
     <string name="bugreport_finished_pending_screenshot_text" product="watch" msgid="1474435374470177193">"Tap to share your bug report without a screenshot or wait for the screenshot to finish"</string>
     <string name="bugreport_finished_pending_screenshot_text" product="default" msgid="1474435374470177193">"Tap to share your bug report without a screenshot or wait for the screenshot to finish"</string>
diff --git a/packages/Shell/res/values-es-rUS/strings.xml b/packages/Shell/res/values-es-rUS/strings.xml
index b7398db..dac7fdb 100644
--- a/packages/Shell/res/values-es-rUS/strings.xml
+++ b/packages/Shell/res/values-es-rUS/strings.xml
@@ -21,7 +21,7 @@
     <string name="bugreport_finished_title" msgid="4429132808670114081">"Se capturó el informe de errores <xliff:g id="ID">#%d</xliff:g>"</string>
     <string name="bugreport_updating_title" msgid="4423539949559634214">"Agregando detalles al informe de errores"</string>
     <string name="bugreport_updating_wait" msgid="3322151947853929470">"Espera…"</string>
-    <string name="bugreport_finished_text" product="watch" msgid="8389172248433597683">"Desliza el dedo hacia la izquierda para compartir el informe de errores."</string>
+    <string name="bugreport_finished_text" product="watch" msgid="1223616207145252689">"El informe de errores aparecerá en el teléfono en breve"</string>
     <string name="bugreport_finished_text" product="default" msgid="8353769438382138847">"Toca para compartir el informe de errores"</string>
     <string name="bugreport_finished_pending_screenshot_text" product="watch" msgid="1474435374470177193">"Toca para compartir tu informe de errores sin una captura de pantalla o espera a que finalice"</string>
     <string name="bugreport_finished_pending_screenshot_text" product="default" msgid="1474435374470177193">"Toca para compartir tu informe de errores sin una captura de pantalla o espera a que finalice"</string>
diff --git a/packages/Shell/res/values-es/strings.xml b/packages/Shell/res/values-es/strings.xml
index 81d8078..b090b8a3 100644
--- a/packages/Shell/res/values-es/strings.xml
+++ b/packages/Shell/res/values-es/strings.xml
@@ -21,7 +21,7 @@
     <string name="bugreport_finished_title" msgid="4429132808670114081">"Informe de errores <xliff:g id="ID">#%d</xliff:g> capturado"</string>
     <string name="bugreport_updating_title" msgid="4423539949559634214">"Añadiendo detalles al informe de errores"</string>
     <string name="bugreport_updating_wait" msgid="3322151947853929470">"Espera…"</string>
-    <string name="bugreport_finished_text" product="watch" msgid="8389172248433597683">"Desliza el dedo hacia la izquierda para compartir el informe de error"</string>
+    <string name="bugreport_finished_text" product="watch" msgid="1223616207145252689">"El informe de errores aparecerá en el teléfono en breve"</string>
     <string name="bugreport_finished_text" product="default" msgid="8353769438382138847">"Toca para compartir el informe de errores"</string>
     <string name="bugreport_finished_pending_screenshot_text" product="watch" msgid="1474435374470177193">"Toca para compartir el informe de errores sin captura de pantalla o espera a que se haga la captura."</string>
     <string name="bugreport_finished_pending_screenshot_text" product="default" msgid="1474435374470177193">"Toca para compartir el informe de errores sin captura de pantalla o espera a que se haga la captura."</string>
diff --git a/packages/Shell/res/values-et-rEE/strings.xml b/packages/Shell/res/values-et-rEE/strings.xml
index edf1c09..aaae44b 100644
--- a/packages/Shell/res/values-et-rEE/strings.xml
+++ b/packages/Shell/res/values-et-rEE/strings.xml
@@ -21,7 +21,7 @@
     <string name="bugreport_finished_title" msgid="4429132808670114081">"Jäädvustati veaaruanne <xliff:g id="ID">#%d</xliff:g>"</string>
     <string name="bugreport_updating_title" msgid="4423539949559634214">"Üksikasjade lisamine veaaruandesse"</string>
     <string name="bugreport_updating_wait" msgid="3322151947853929470">"Oodake …"</string>
-    <string name="bugreport_finished_text" product="watch" msgid="8389172248433597683">"Veaaruande jagamiseks pühkige vasakule"</string>
+    <string name="bugreport_finished_text" product="watch" msgid="1223616207145252689">"Veaaruanne kuvatakse telefonis peagi"</string>
     <string name="bugreport_finished_text" product="default" msgid="8353769438382138847">"Veaaruande jagamiseks puudutage"</string>
     <string name="bugreport_finished_pending_screenshot_text" product="watch" msgid="1474435374470177193">"Puudutage, et veaaruannet ilma ekraanipildita jagada, või oodake, kuni ekraanipilt tehtud saab."</string>
     <string name="bugreport_finished_pending_screenshot_text" product="default" msgid="1474435374470177193">"Puudutage, et veaaruannet ilma ekraanipildita jagada, või oodake, kuni ekraanipilt tehtud saab."</string>
diff --git a/packages/Shell/res/values-eu-rES/strings.xml b/packages/Shell/res/values-eu-rES/strings.xml
index 1a220ea..f60e589 100644
--- a/packages/Shell/res/values-eu-rES/strings.xml
+++ b/packages/Shell/res/values-eu-rES/strings.xml
@@ -21,7 +21,7 @@
     <string name="bugreport_finished_title" msgid="4429132808670114081">"Akatsen <xliff:g id="ID">#%d</xliff:g> txostena egin da"</string>
     <string name="bugreport_updating_title" msgid="4423539949559634214">"Akatsen txostenean xehetasunak gehitzen"</string>
     <string name="bugreport_updating_wait" msgid="3322151947853929470">"Itxaron, mesedez…"</string>
-    <string name="bugreport_finished_text" product="watch" msgid="8389172248433597683">"Programa-akatsen txostena partekatzeko, pasatu hatza ezkerrera"</string>
+    <string name="bugreport_finished_text" product="watch" msgid="1223616207145252689">"Akatsen txostena telefonoan agertuko da laster"</string>
     <string name="bugreport_finished_text" product="default" msgid="8353769438382138847">"Sakatu akatsen txostena partekatzeko"</string>
     <string name="bugreport_finished_pending_screenshot_text" product="watch" msgid="1474435374470177193">"Sakatu akatsen txostena argazkirik gabe partekatzeko edo itxaron pantaila-argazkia atera arte"</string>
     <string name="bugreport_finished_pending_screenshot_text" product="default" msgid="1474435374470177193">"Sakatu akatsen txostena argazkirik gabe partekatzeko edo itxaron pantaila-argazkia atera arte"</string>
diff --git a/packages/Shell/res/values-fa/strings.xml b/packages/Shell/res/values-fa/strings.xml
index 0a5b84e..f3e92d2 100644
--- a/packages/Shell/res/values-fa/strings.xml
+++ b/packages/Shell/res/values-fa/strings.xml
@@ -21,7 +21,7 @@
     <string name="bugreport_finished_title" msgid="4429132808670114081">"گزارش اشکال <xliff:g id="ID">#%d</xliff:g> ثبت شد"</string>
     <string name="bugreport_updating_title" msgid="4423539949559634214">"اضافه کردن جزئیات به گزارش اشکال"</string>
     <string name="bugreport_updating_wait" msgid="3322151947853929470">"لطفاً منتظر بمانید..."</string>
-    <string name="bugreport_finished_text" product="watch" msgid="8389172248433597683">"برای اشتراک‌گذاری گزارش اشکال، به تندی آن را به چپ بکشید"</string>
+    <string name="bugreport_finished_text" product="watch" msgid="1223616207145252689">"گزارش مشکل به‌زودی در تلفن نشان داده می‌شود"</string>
     <string name="bugreport_finished_text" product="default" msgid="8353769438382138847">"برای به اشتراک گذاشتن گزارش اشکال، ضربه بزنید"</string>
     <string name="bugreport_finished_pending_screenshot_text" product="watch" msgid="1474435374470177193">"برای اشتراک‌گذاری گزارش مشکل بدون عکس صفحه‌نمایش، ضربه بزنید یا صبر کنید تا عکس صفحه‌نمایش گرفته شود."</string>
     <string name="bugreport_finished_pending_screenshot_text" product="default" msgid="1474435374470177193">"برای اشتراک‌گذاری گزارش مشکل بدون عکس صفحه‌نمایش، ضربه بزنید یا صبر کنید تا عکس صفحه‌نمایش گرفته شود."</string>
diff --git a/packages/Shell/res/values-fi/strings.xml b/packages/Shell/res/values-fi/strings.xml
index 894217e..a790cd9 100644
--- a/packages/Shell/res/values-fi/strings.xml
+++ b/packages/Shell/res/values-fi/strings.xml
@@ -21,7 +21,7 @@
     <string name="bugreport_finished_title" msgid="4429132808670114081">"Virheraportti <xliff:g id="ID">#%d</xliff:g> tallennettu"</string>
     <string name="bugreport_updating_title" msgid="4423539949559634214">"Lisätään tietoja virheraporttiin"</string>
     <string name="bugreport_updating_wait" msgid="3322151947853929470">"Odota…"</string>
-    <string name="bugreport_finished_text" product="watch" msgid="8389172248433597683">"Jaa virheraportti pyyhkäisemällä vasemmalle"</string>
+    <string name="bugreport_finished_text" product="watch" msgid="1223616207145252689">"Virheraportti näkyy puhelimessa pian."</string>
     <string name="bugreport_finished_text" product="default" msgid="8353769438382138847">"Jaa virheraportti napauttamalla."</string>
     <string name="bugreport_finished_pending_screenshot_text" product="watch" msgid="1474435374470177193">"Jaa virheraportti ilman kuvakaappausta napauttamalla tai odota, että kuvakaappaus latautuu."</string>
     <string name="bugreport_finished_pending_screenshot_text" product="default" msgid="1474435374470177193">"Jaa virheraportti ilman kuvakaappausta napauttamalla tai odota, että kuvakaappaus latautuu."</string>
diff --git a/packages/Shell/res/values-fr-rCA/strings.xml b/packages/Shell/res/values-fr-rCA/strings.xml
index 495d26d..baacdd1 100644
--- a/packages/Shell/res/values-fr-rCA/strings.xml
+++ b/packages/Shell/res/values-fr-rCA/strings.xml
@@ -21,7 +21,7 @@
     <string name="bugreport_finished_title" msgid="4429132808670114081">"Rapport de bogue <xliff:g id="ID">#%d</xliff:g> enregistré"</string>
     <string name="bugreport_updating_title" msgid="4423539949559634214">"Ajout de détails au rapport de bogue"</string>
     <string name="bugreport_updating_wait" msgid="3322151947853929470">"Veuillez patienter…"</string>
-    <string name="bugreport_finished_text" product="watch" msgid="8389172248433597683">"Faites glisser le doigt vers la gauche pour partager votre rapport de bogue."</string>
+    <string name="bugreport_finished_text" product="watch" msgid="1223616207145252689">"Le rapport de bogue s\'affichera bientôt sur le téléphone"</string>
     <string name="bugreport_finished_text" product="default" msgid="8353769438382138847">"Touchez ici pour partager votre rapport de bogue"</string>
     <string name="bugreport_finished_pending_screenshot_text" product="watch" msgid="1474435374470177193">"Touchez pour partager le rapport de bogue sans saisie d\'écran ou attendez que la saisie soit prête"</string>
     <string name="bugreport_finished_pending_screenshot_text" product="default" msgid="1474435374470177193">"Touchez pour partager le rapport de bogue sans saisie d\'écran ou attendez que la saisie soit prête"</string>
diff --git a/packages/Shell/res/values-fr/strings.xml b/packages/Shell/res/values-fr/strings.xml
index 0465916..506cd68f9 100644
--- a/packages/Shell/res/values-fr/strings.xml
+++ b/packages/Shell/res/values-fr/strings.xml
@@ -21,7 +21,7 @@
     <string name="bugreport_finished_title" msgid="4429132808670114081">"Le rapport de bug \"<xliff:g id="ID">#%d</xliff:g>\" a bien été enregistré"</string>
     <string name="bugreport_updating_title" msgid="4423539949559634214">"Ajout d\'informations au rapport de bug"</string>
     <string name="bugreport_updating_wait" msgid="3322151947853929470">"Veuillez patienter…"</string>
-    <string name="bugreport_finished_text" product="watch" msgid="8389172248433597683">"Faites glisser le doigt vers la gauche pour partager votre rapport d\'erreur."</string>
+    <string name="bugreport_finished_text" product="watch" msgid="1223616207145252689">"Le rapport de bug s\'affichera bientôt sur le téléphone."</string>
     <string name="bugreport_finished_text" product="default" msgid="8353769438382138847">"Appuyer pour partager votre rapport de bug"</string>
     <string name="bugreport_finished_pending_screenshot_text" product="watch" msgid="1474435374470177193">"Appuyer pour partager rapport de bug sans capture d\'écran ou attendre finalisation capture d\'écran"</string>
     <string name="bugreport_finished_pending_screenshot_text" product="default" msgid="1474435374470177193">"Appuyer pour partager rapport de bug sans capture d\'écran ou attendre finalisation capture d\'écran"</string>
diff --git a/packages/Shell/res/values-gl-rES/strings.xml b/packages/Shell/res/values-gl-rES/strings.xml
index a06a49b..d2a39fd 100644
--- a/packages/Shell/res/values-gl-rES/strings.xml
+++ b/packages/Shell/res/values-gl-rES/strings.xml
@@ -21,7 +21,7 @@
     <string name="bugreport_finished_title" msgid="4429132808670114081">"Rexistrouse o informe de erros <xliff:g id="ID">#%d</xliff:g>"</string>
     <string name="bugreport_updating_title" msgid="4423539949559634214">"Engadindo detalles ao informe de erro"</string>
     <string name="bugreport_updating_wait" msgid="3322151947853929470">"Agarda..."</string>
-    <string name="bugreport_finished_text" product="watch" msgid="8389172248433597683">"Pasa o dedo á esquerda para compartir o teu informe de erros"</string>
+    <string name="bugreport_finished_text" product="watch" msgid="1223616207145252689">"O informe de erros aparecerá no teléfono en breve"</string>
     <string name="bugreport_finished_text" product="default" msgid="8353769438382138847">"Toca para compartir o teu informe de erros"</string>
     <string name="bugreport_finished_pending_screenshot_text" product="watch" msgid="1474435374470177193">"Toca para compartir o informe de erros sen captura de pantalla ou agarda a que finalice a captura"</string>
     <string name="bugreport_finished_pending_screenshot_text" product="default" msgid="1474435374470177193">"Toca para compartir o informe de erros sen captura de pantalla ou agarda a que finalice a captura"</string>
diff --git a/packages/Shell/res/values-gu-rIN/strings.xml b/packages/Shell/res/values-gu-rIN/strings.xml
index 83a0ab6..849f1ea 100644
--- a/packages/Shell/res/values-gu-rIN/strings.xml
+++ b/packages/Shell/res/values-gu-rIN/strings.xml
@@ -21,7 +21,7 @@
     <string name="bugreport_finished_title" msgid="4429132808670114081">"બગ રિપોર્ટ <xliff:g id="ID">#%d</xliff:g> કૅપ્ચર કરી"</string>
     <string name="bugreport_updating_title" msgid="4423539949559634214">"બગ રિપોર્ટમાં વિગતો ઉમેરવી"</string>
     <string name="bugreport_updating_wait" msgid="3322151947853929470">"કૃપા કરીને રાહ જુઓ…"</string>
-    <string name="bugreport_finished_text" product="watch" msgid="8389172248433597683">"તમારી બગ રિપોર્ટ શેર કરવા માટે ડાબે સ્વાઇપ કરો"</string>
+    <string name="bugreport_finished_text" product="watch" msgid="1223616207145252689">"બગ રિપોર્ટ ટૂંક સમયમાં ફોન પર દેખાશે"</string>
     <string name="bugreport_finished_text" product="default" msgid="8353769438382138847">"તમારી બગ રિપોર્ટ શેર કરવા ટૅપ કરો"</string>
     <string name="bugreport_finished_pending_screenshot_text" product="watch" msgid="1474435374470177193">"સ્ક્રીનશૉટ વગર અથવા સ્ક્રીનશૉટ સમાપ્ત થવાની રાહ જોયા વગર તમારી બગ રિપોર્ટ શેર કરવા ટૅપ કરો"</string>
     <string name="bugreport_finished_pending_screenshot_text" product="default" msgid="1474435374470177193">"સ્ક્રીનશૉટ વગર અથવા સ્ક્રીનશૉટ સમાપ્ત થવાની રાહ જોયા વગર તમારી બગ રિપોર્ટ શેર કરવા ટૅપ કરો"</string>
diff --git a/packages/Shell/res/values-hi/strings.xml b/packages/Shell/res/values-hi/strings.xml
index 9086d89..fc314af 100644
--- a/packages/Shell/res/values-hi/strings.xml
+++ b/packages/Shell/res/values-hi/strings.xml
@@ -21,7 +21,7 @@
     <string name="bugreport_finished_title" msgid="4429132808670114081">"बग रिपोर्ट <xliff:g id="ID">#%d</xliff:g> कैप्चर की गई"</string>
     <string name="bugreport_updating_title" msgid="4423539949559634214">"बग रिपोर्ट में विवरण जोड़े जा रहे हैं"</string>
     <string name="bugreport_updating_wait" msgid="3322151947853929470">"कृपया प्रतीक्षा करें…"</string>
-    <string name="bugreport_finished_text" product="watch" msgid="8389172248433597683">"अपनी बग रिपोर्ट साझा करने के लिए बाएं स्वाइप करें"</string>
+    <string name="bugreport_finished_text" product="watch" msgid="1223616207145252689">"बग रिपोर्ट थोड़ी ही देर में फ़ोन पर दिखाई देगी"</string>
     <string name="bugreport_finished_text" product="default" msgid="8353769438382138847">"अपनी बग रिपोर्ट साझा करने के लिए टैप करें"</string>
     <string name="bugreport_finished_pending_screenshot_text" product="watch" msgid="1474435374470177193">"अपनी बग रिपोर्ट को बिना स्क्रीनशॉट साझा करने हेतु टैप करें या स्क्रीनशॉट पूरा होने की प्रतीक्षा करें"</string>
     <string name="bugreport_finished_pending_screenshot_text" product="default" msgid="1474435374470177193">"अपनी बग रिपोर्ट को बिना स्क्रीनशॉट साझा करने हेतु टैप करें या स्क्रीनशॉट पूरा होने की प्रतीक्षा करें"</string>
diff --git a/packages/Shell/res/values-hr/strings.xml b/packages/Shell/res/values-hr/strings.xml
index 24b657b..ed48fd9 100644
--- a/packages/Shell/res/values-hr/strings.xml
+++ b/packages/Shell/res/values-hr/strings.xml
@@ -21,7 +21,7 @@
     <string name="bugreport_finished_title" msgid="4429132808670114081">"Izvješće o programskoj pogrešci <xliff:g id="ID">#%d</xliff:g> snimljeno"</string>
     <string name="bugreport_updating_title" msgid="4423539949559634214">"Dodavanje pojedinosti u izvješće o progr. pogrešci"</string>
     <string name="bugreport_updating_wait" msgid="3322151947853929470">"Pričekajte..."</string>
-    <string name="bugreport_finished_text" product="watch" msgid="8389172248433597683">"Prijeđite prstom ulijevo da biste poslali izvješće o programskim pogreškama"</string>
+    <string name="bugreport_finished_text" product="watch" msgid="1223616207145252689">"Izvješće o programskoj pogrešci uskoro će se pojaviti na telefonu"</string>
     <string name="bugreport_finished_text" product="default" msgid="8353769438382138847">"Dodirnite da biste podijelili izvješće o programskoj pogrešci"</string>
     <string name="bugreport_finished_pending_screenshot_text" product="watch" msgid="1474435374470177193">"Dodirnite za dijeljenje izvješća o pogrešci bez snimke zaslona ili pričekajte da se izradi snimka"</string>
     <string name="bugreport_finished_pending_screenshot_text" product="default" msgid="1474435374470177193">"Dodirnite za dijeljenje izvješća o pogrešci bez snimke zaslona ili pričekajte da se izradi snimka"</string>
diff --git a/packages/Shell/res/values-hu/strings.xml b/packages/Shell/res/values-hu/strings.xml
index a8c5c76..b7def06 100644
--- a/packages/Shell/res/values-hu/strings.xml
+++ b/packages/Shell/res/values-hu/strings.xml
@@ -21,7 +21,7 @@
     <string name="bugreport_finished_title" msgid="4429132808670114081">"Hibajelentés (<xliff:g id="ID">#%d</xliff:g>) rögzítve"</string>
     <string name="bugreport_updating_title" msgid="4423539949559634214">"Információk hozzáadása a hibajelentéshez"</string>
     <string name="bugreport_updating_wait" msgid="3322151947853929470">"Kérjük, várjon..."</string>
-    <string name="bugreport_finished_text" product="watch" msgid="8389172248433597683">"Húzza ujját balra a hibajelentés megosztásához"</string>
+    <string name="bugreport_finished_text" product="watch" msgid="1223616207145252689">"A hibajelentés hamarosan megjelenik a telefonon."</string>
     <string name="bugreport_finished_text" product="default" msgid="8353769438382138847">"Koppintson a hibajelentés megosztásához"</string>
     <string name="bugreport_finished_pending_screenshot_text" product="watch" msgid="1474435374470177193">"Koppintson ide, ha képernyőkép nélkül osztaná meg a hibajelentést, vagy várjon a képernyőképre."</string>
     <string name="bugreport_finished_pending_screenshot_text" product="default" msgid="1474435374470177193">"Koppintson ide, ha képernyőkép nélkül osztaná meg a hibajelentést, vagy várjon a képernyőképre."</string>
diff --git a/packages/Shell/res/values-hy-rAM/strings.xml b/packages/Shell/res/values-hy-rAM/strings.xml
index 56627f4..27e25c6 100644
--- a/packages/Shell/res/values-hy-rAM/strings.xml
+++ b/packages/Shell/res/values-hy-rAM/strings.xml
@@ -21,7 +21,7 @@
     <string name="bugreport_finished_title" msgid="4429132808670114081">"<xliff:g id="ID">#%d</xliff:g> վրիպակի զեկույցը գրանցվեց"</string>
     <string name="bugreport_updating_title" msgid="4423539949559634214">"Տվյալների ավելացում վրիպակի զեկույցում"</string>
     <string name="bugreport_updating_wait" msgid="3322151947853929470">"Խնդրում ենք սպասել…"</string>
-    <string name="bugreport_finished_text" product="watch" msgid="8389172248433597683">"Սահեցրեք ձախ՝ սխալի հաշվետվությունը համօգտագործելու համար"</string>
+    <string name="bugreport_finished_text" product="watch" msgid="1223616207145252689">"Վրիպակների մասին հաշվետվությունը շուտով կստանաք հեռախոսին"</string>
     <string name="bugreport_finished_text" product="default" msgid="8353769438382138847">"Հպեք՝ վրիպակի զեկույցը տրամադրելու համար"</string>
     <string name="bugreport_finished_pending_screenshot_text" product="watch" msgid="1474435374470177193">"Հպեք՝ վրիպակի զեկույցն առանց էկրանի պատկերի ուղարկելու համար կամ սպասեք էկրանի պատկերի ստեղծմանը"</string>
     <string name="bugreport_finished_pending_screenshot_text" product="default" msgid="1474435374470177193">"Հպեք՝ վրիպակի զեկույցն առանց էկրանի պատկերի ուղարկելու համար կամ սպասեք էկրանի պատկերի ստեղծմանը"</string>
diff --git a/packages/Shell/res/values-in/strings.xml b/packages/Shell/res/values-in/strings.xml
index 90700c7..d4851e3 100644
--- a/packages/Shell/res/values-in/strings.xml
+++ b/packages/Shell/res/values-in/strings.xml
@@ -21,7 +21,7 @@
     <string name="bugreport_finished_title" msgid="4429132808670114081">"Laporan bug <xliff:g id="ID">#%d</xliff:g> dijepret"</string>
     <string name="bugreport_updating_title" msgid="4423539949559634214">"Menambahkan detail ke laporan bug"</string>
     <string name="bugreport_updating_wait" msgid="3322151947853929470">"Harap tunggu..."</string>
-    <string name="bugreport_finished_text" product="watch" msgid="8389172248433597683">"Gesek ke kiri untuk membagikan laporan bug Anda"</string>
+    <string name="bugreport_finished_text" product="watch" msgid="1223616207145252689">"Laporan bug akan segera muncul di ponsel"</string>
     <string name="bugreport_finished_text" product="default" msgid="8353769438382138847">"Ketuk untuk membagikan laporan bug"</string>
     <string name="bugreport_finished_pending_screenshot_text" product="watch" msgid="1474435374470177193">"Ketuk untuk membagikan laporan bug tanpa tangkapan layar atau menunggu tangkapan layar selesai"</string>
     <string name="bugreport_finished_pending_screenshot_text" product="default" msgid="1474435374470177193">"Ketuk untuk membagikan laporan bug tanpa tangkapan layar atau menunggu tangkapan layar selesai"</string>
diff --git a/packages/Shell/res/values-is-rIS/strings.xml b/packages/Shell/res/values-is-rIS/strings.xml
index dc21b35..872c029 100644
--- a/packages/Shell/res/values-is-rIS/strings.xml
+++ b/packages/Shell/res/values-is-rIS/strings.xml
@@ -21,7 +21,7 @@
     <string name="bugreport_finished_title" msgid="4429132808670114081">"Villutilkynning <xliff:g id="ID">#%d</xliff:g> búin til"</string>
     <string name="bugreport_updating_title" msgid="4423539949559634214">"Bætir upplýsingum við villutilkynningu"</string>
     <string name="bugreport_updating_wait" msgid="3322151947853929470">"Augnablik..."</string>
-    <string name="bugreport_finished_text" product="watch" msgid="8389172248433597683">"Strjúktu til vinstri til að deila villuskýrslunni"</string>
+    <string name="bugreport_finished_text" product="watch" msgid="1223616207145252689">"Villuskýrslan birtist brátt í símanum"</string>
     <string name="bugreport_finished_text" product="default" msgid="8353769438382138847">"Ýttu til að deila villutilkynningunni"</string>
     <string name="bugreport_finished_pending_screenshot_text" product="watch" msgid="1474435374470177193">"Ýttu til að deila villutilkynningunni án skjámyndar eða hinkraðu þangað til skjámyndin er tilbúin"</string>
     <string name="bugreport_finished_pending_screenshot_text" product="default" msgid="1474435374470177193">"Ýttu til að deila villutilkynningunni án skjámyndar eða hinkraðu þangað til skjámyndin er tilbúin"</string>
diff --git a/packages/Shell/res/values-it/strings.xml b/packages/Shell/res/values-it/strings.xml
index 0fd6c7a..d1e7c09 100644
--- a/packages/Shell/res/values-it/strings.xml
+++ b/packages/Shell/res/values-it/strings.xml
@@ -21,7 +21,7 @@
     <string name="bugreport_finished_title" msgid="4429132808670114081">"Segnalazione di bug <xliff:g id="ID">#%d</xliff:g> acquisita"</string>
     <string name="bugreport_updating_title" msgid="4423539949559634214">"Aggiunta di dettagli alla segnalazione di bug"</string>
     <string name="bugreport_updating_wait" msgid="3322151947853929470">"Attendi..."</string>
-    <string name="bugreport_finished_text" product="watch" msgid="8389172248433597683">"Scorri verso sinistra per condividere il rapporto sui bug"</string>
+    <string name="bugreport_finished_text" product="watch" msgid="1223616207145252689">"La segnalazione di bug comparirà a breve sul telefono"</string>
     <string name="bugreport_finished_text" product="default" msgid="8353769438382138847">"Tocca per condividere la segnalazione di bug"</string>
     <string name="bugreport_finished_pending_screenshot_text" product="watch" msgid="1474435374470177193">"Tocca per inviare la segnalazione del bug senza screenshot o attendi che lo screenshot sia completo"</string>
     <string name="bugreport_finished_pending_screenshot_text" product="default" msgid="1474435374470177193">"Tocca per inviare la segnalazione del bug senza screenshot o attendi che lo screenshot sia completo"</string>
diff --git a/packages/Shell/res/values-iw/strings.xml b/packages/Shell/res/values-iw/strings.xml
index b3f9d02..be4b190 100644
--- a/packages/Shell/res/values-iw/strings.xml
+++ b/packages/Shell/res/values-iw/strings.xml
@@ -21,7 +21,7 @@
     <string name="bugreport_finished_title" msgid="4429132808670114081">"הדוח על הבאג <xliff:g id="ID">#%d</xliff:g> צולם"</string>
     <string name="bugreport_updating_title" msgid="4423539949559634214">"מוסיף פרטים לדוח על הבאג"</string>
     <string name="bugreport_updating_wait" msgid="3322151947853929470">"המתן…"</string>
-    <string name="bugreport_finished_text" product="watch" msgid="8389172248433597683">"החלק שמאלה כדי לשתף את דוח הבאגים"</string>
+    <string name="bugreport_finished_text" product="watch" msgid="1223616207145252689">"הדוח על הבאג יופיע בטלפון בקרוב"</string>
     <string name="bugreport_finished_text" product="default" msgid="8353769438382138847">"הקש כדי לשתף את הדוח על הבאג"</string>
     <string name="bugreport_finished_pending_screenshot_text" product="watch" msgid="1474435374470177193">"הקש כדי לשתף את הדוח על הבאג ללא צילום מסך, או המתן להשלמת צילום המסך"</string>
     <string name="bugreport_finished_pending_screenshot_text" product="default" msgid="1474435374470177193">"הקש כדי לשתף את הדוח על הבאג ללא צילום מסך, או המתן להשלמת צילום המסך"</string>
diff --git a/packages/Shell/res/values-ja/strings.xml b/packages/Shell/res/values-ja/strings.xml
index eca0ea0..c6682d9 100644
--- a/packages/Shell/res/values-ja/strings.xml
+++ b/packages/Shell/res/values-ja/strings.xml
@@ -21,7 +21,7 @@
     <string name="bugreport_finished_title" msgid="4429132808670114081">"バグレポート <xliff:g id="ID">#%d</xliff:g> の記録完了"</string>
     <string name="bugreport_updating_title" msgid="4423539949559634214">"バグレポートに詳細情報を追加しています"</string>
     <string name="bugreport_updating_wait" msgid="3322151947853929470">"お待ちください…"</string>
-    <string name="bugreport_finished_text" product="watch" msgid="8389172248433597683">"バグレポートを共有するには左にスワイプ"</string>
+    <string name="bugreport_finished_text" product="watch" msgid="1223616207145252689">"バグレポートはまもなくスマートフォンに表示されます"</string>
     <string name="bugreport_finished_text" product="default" msgid="8353769438382138847">"バグレポートを共有するにはタップします"</string>
     <string name="bugreport_finished_pending_screenshot_text" product="watch" msgid="1474435374470177193">"タップしてバグレポートをスクリーンショットなしで共有するか、スクリーンショット完成までお待ちください"</string>
     <string name="bugreport_finished_pending_screenshot_text" product="default" msgid="1474435374470177193">"タップしてバグレポートをスクリーンショットなしで共有するか、スクリーンショット完成までお待ちください"</string>
diff --git a/packages/Shell/res/values-ka-rGE/strings.xml b/packages/Shell/res/values-ka-rGE/strings.xml
index 43cdeee..f97f94a 100644
--- a/packages/Shell/res/values-ka-rGE/strings.xml
+++ b/packages/Shell/res/values-ka-rGE/strings.xml
@@ -21,7 +21,7 @@
     <string name="bugreport_finished_title" msgid="4429132808670114081">"ხარვეზების შესახებ ანგარიში <xliff:g id="ID">#%d</xliff:g> აღბეჭდილია"</string>
     <string name="bugreport_updating_title" msgid="4423539949559634214">"ხარვეზის შესახებ ანგარიშს დეტალები ემატება"</string>
     <string name="bugreport_updating_wait" msgid="3322151947853929470">"გთხოვთ, მოითმინოთ..."</string>
-    <string name="bugreport_finished_text" product="watch" msgid="8389172248433597683">"გაასრიალეთ მარცხნივ თქვენი ხარვეზის შეტყობინების გასაზიარებლად"</string>
+    <string name="bugreport_finished_text" product="watch" msgid="1223616207145252689">"ხარვეზის შესახებ ანგარიში ტელეფონის ეკრანზე მალე გამოჩნდება."</string>
     <string name="bugreport_finished_text" product="default" msgid="8353769438382138847">"შეეხეთ ხარვეზების შესახებ ანგარიშის გასაზიარებლად"</string>
     <string name="bugreport_finished_pending_screenshot_text" product="watch" msgid="1474435374470177193">"შეეხეთ ხარვეზის შესახებ ანგარიშის ეკრანის ანაბეჭდის გარეშე გასაზიარებლად, ან დაელოდეთ მის შექმნას"</string>
     <string name="bugreport_finished_pending_screenshot_text" product="default" msgid="1474435374470177193">"შეეხეთ ხარვეზის შესახებ ანგარიშის ეკრანის ანაბეჭდის გარეშე გასაზიარებლად, ან დაელოდეთ მის შექმნას"</string>
diff --git a/packages/Shell/res/values-kk-rKZ/strings.xml b/packages/Shell/res/values-kk-rKZ/strings.xml
index 7d1218f..3d49f4c 100644
--- a/packages/Shell/res/values-kk-rKZ/strings.xml
+++ b/packages/Shell/res/values-kk-rKZ/strings.xml
@@ -21,7 +21,7 @@
     <string name="bugreport_finished_title" msgid="4429132808670114081">"<xliff:g id="ID">#%d</xliff:g> қате туралы есебі жазып алынды"</string>
     <string name="bugreport_updating_title" msgid="4423539949559634214">"Қате туралы есепке мәліметтер қосылуда"</string>
     <string name="bugreport_updating_wait" msgid="3322151947853929470">"Күте тұрыңыз…"</string>
-    <string name="bugreport_finished_text" product="watch" msgid="8389172248433597683">"Қате туралы есепті бөлісу үшін солға жанаңыз"</string>
+    <string name="bugreport_finished_text" product="watch" msgid="1223616207145252689">"Көп ұзамай қате туралы есеп телефон экранына шығады"</string>
     <string name="bugreport_finished_text" product="default" msgid="8353769438382138847">"Қате туралы есепті бөлісу үшін түртіңіз"</string>
     <string name="bugreport_finished_pending_screenshot_text" product="watch" msgid="1474435374470177193">"Қате туралы есепті скриншотсыз бөлісу үшін түртіңіз немесе скриншот сақталып болғанша күтіңіз"</string>
     <string name="bugreport_finished_pending_screenshot_text" product="default" msgid="1474435374470177193">"Қате туралы есепті скриншотсыз бөлісу үшін түртіңіз немесе скриншот сақталып болғанша күтіңіз"</string>
diff --git a/packages/Shell/res/values-km-rKH/strings.xml b/packages/Shell/res/values-km-rKH/strings.xml
index c9633db7f4..a73cfaa 100644
--- a/packages/Shell/res/values-km-rKH/strings.xml
+++ b/packages/Shell/res/values-km-rKH/strings.xml
@@ -21,7 +21,7 @@
     <string name="bugreport_finished_title" msgid="4429132808670114081">"<xliff:g id="ID">#%d</xliff:g> របាយការណ៍កំហុសត្រូវបានថត"</string>
     <string name="bugreport_updating_title" msgid="4423539949559634214">"កំពុងបន្ថែមព័ត៌មានលម្អិតទៅរបាយការណ៍កំហុស"</string>
     <string name="bugreport_updating_wait" msgid="3322151947853929470">"សូម​រង់ចាំ…"</string>
-    <string name="bugreport_finished_text" product="watch" msgid="8389172248433597683">"អូស​ទៅ​ឆ្វេង​​ ដើម្បី​ចែក​រំលែក​របាយការណ៍​កំហុស​របស់​អ្នក"</string>
+    <string name="bugreport_finished_text" product="watch" msgid="1223616207145252689">"របាយការណ៍កំហុសនេះនឹងបង្ហាញនៅលើទូរស័ព្ទរបស់អ្នកនាពេលបន្តិចទៀតនេះ"</string>
     <string name="bugreport_finished_text" product="default" msgid="8353769438382138847">"ប៉ះដើម្បីចែករំលែករបាយការណ៍កំហុសរបស់អ្នក"</string>
     <string name="bugreport_finished_pending_screenshot_text" product="watch" msgid="1474435374470177193">"ប៉ះដើម្បីចែករំលែករបាយការណ៍កំហុសរបស់អ្នកដោយមិនចាំបាច់មានរូបថតអេក្រង់ ឬរង់ចាំការបញ្ចប់ការថតអេក្រង់"</string>
     <string name="bugreport_finished_pending_screenshot_text" product="default" msgid="1474435374470177193">"ប៉ះដើម្បីចែករំលែករបាយការណ៍កំហុសរបស់អ្នកដោយមិនចាំបាច់មានរូបថតអេក្រង់ ឬរង់ចាំការបញ្ចប់ការថតអេក្រង់"</string>
diff --git a/packages/Shell/res/values-kn-rIN/strings.xml b/packages/Shell/res/values-kn-rIN/strings.xml
index fc8d03c..117400a 100644
--- a/packages/Shell/res/values-kn-rIN/strings.xml
+++ b/packages/Shell/res/values-kn-rIN/strings.xml
@@ -21,7 +21,7 @@
     <string name="bugreport_finished_title" msgid="4429132808670114081">"ದೋಷ ವರದಿಯ <xliff:g id="ID">#%d</xliff:g> ಅನ್ನು ಕ್ಯಾಪ್ಚರ್ ಮಾಡಿಕೊಳ್ಳಲಾಗಿದೆ"</string>
     <string name="bugreport_updating_title" msgid="4423539949559634214">"ಬಗ್ ವರದಿಗೆ ವಿವರಗಳನ್ನು ಸೇರಿಸಲಾಗುತ್ತಿದೆ"</string>
     <string name="bugreport_updating_wait" msgid="3322151947853929470">"ದಯವಿಟ್ಟು ನಿರೀಕ್ಷಿಸಿ..."</string>
-    <string name="bugreport_finished_text" product="watch" msgid="8389172248433597683">"ನಿಮ್ಮ ದೋಷ ವರದಿಯನ್ನು ಹಂಚಿಕೊಳ್ಳಲು ಎಡಕ್ಕೆ ಸ್ವೈಪ್‌ ಮಾಡಿ"</string>
+    <string name="bugreport_finished_text" product="watch" msgid="1223616207145252689">"ಬಗ್ ವರದಿ ಶೀಘ್ರದಲ್ಲೇ ಫೋನ್‌ನಲ್ಲಿ ಗೋಚರಿಸಲಿದೆ"</string>
     <string name="bugreport_finished_text" product="default" msgid="8353769438382138847">"ನಿಮ್ಮ ಬಗ್ ವರದಿಯನ್ನು ಹಂಚಿಕೊಳ್ಳಲು ಟ್ಯಾಪ್ ಮಾಡಿ"</string>
     <string name="bugreport_finished_pending_screenshot_text" product="watch" msgid="1474435374470177193">"ಸ್ಕ್ರೀನ್‌ಶಾಟ್‌ ಇಲ್ಲದೇ ನಿಮ್ಮ ಬಗ್ ವರದಿಯನ್ನು ಹಂಚಿಕೊಳ್ಳಲು ಟ್ಯಾಪ್ ಮಾಡಿ ಅಥವಾ ಸ್ಕ್ರೀನ್‌ಶಾಟ್‌ ಪೂರ್ತಿಯಾಗುವವರೆಗೂ ನಿರೀಕ್ಷಿಸಿ"</string>
     <string name="bugreport_finished_pending_screenshot_text" product="default" msgid="1474435374470177193">"ಸ್ಕ್ರೀನ್‌ಶಾಟ್‌ ಇಲ್ಲದೇ ನಿಮ್ಮ ಬಗ್ ವರದಿಯನ್ನು ಹಂಚಿಕೊಳ್ಳಲು ಟ್ಯಾಪ್ ಮಾಡಿ ಅಥವಾ ಸ್ಕ್ರೀನ್‌ಶಾಟ್‌ ಪೂರ್ತಿಯಾಗುವವರೆಗೂ ನಿರೀಕ್ಷಿಸಿ"</string>
diff --git a/packages/Shell/res/values-ko/strings.xml b/packages/Shell/res/values-ko/strings.xml
index d382fb1..6fde072 100644
--- a/packages/Shell/res/values-ko/strings.xml
+++ b/packages/Shell/res/values-ko/strings.xml
@@ -21,7 +21,7 @@
     <string name="bugreport_finished_title" msgid="4429132808670114081">"버그 신고 <xliff:g id="ID">#%d</xliff:g> 캡처됨"</string>
     <string name="bugreport_updating_title" msgid="4423539949559634214">"세부정보를 버그 보고서에 추가"</string>
     <string name="bugreport_updating_wait" msgid="3322151947853929470">"잠시 기다려 주세요..."</string>
-    <string name="bugreport_finished_text" product="watch" msgid="8389172248433597683">"왼쪽으로 스와이프하여 버그 신고서를 공유하세요."</string>
+    <string name="bugreport_finished_text" product="watch" msgid="1223616207145252689">"곧 버그 보고서가 휴대전화에 표시됩니다."</string>
     <string name="bugreport_finished_text" product="default" msgid="8353769438382138847">"버그 신고를 공유하려면 탭하세요."</string>
     <string name="bugreport_finished_pending_screenshot_text" product="watch" msgid="1474435374470177193">"스크린샷 없이 버그 신고서를 공유하려면 탭하고 그렇지 않으면 스크린샷이 완료될 때까지 기다려 주세요."</string>
     <string name="bugreport_finished_pending_screenshot_text" product="default" msgid="1474435374470177193">"스크린샷 없이 버그 신고서를 공유하려면 탭하고 그렇지 않으면 스크린샷이 완료될 때까지 기다려 주세요."</string>
diff --git a/packages/Shell/res/values-ky-rKG/strings.xml b/packages/Shell/res/values-ky-rKG/strings.xml
index fe2dde4..2c97277 100644
--- a/packages/Shell/res/values-ky-rKG/strings.xml
+++ b/packages/Shell/res/values-ky-rKG/strings.xml
@@ -21,7 +21,7 @@
     <string name="bugreport_finished_title" msgid="4429132808670114081">"Мүчүлүштүк тууралуу билдирүү <xliff:g id="ID">#%d</xliff:g> жаздырылды"</string>
     <string name="bugreport_updating_title" msgid="4423539949559634214">"Мүчүлүштүк жөнүндө кабардын чоо-жайы кошулууда"</string>
     <string name="bugreport_updating_wait" msgid="3322151947853929470">"Күтө туруңуз…"</string>
-    <string name="bugreport_finished_text" product="watch" msgid="8389172248433597683">"Ката жөнүндө кабар менен бөлүшүү үчүн солго серпип коюңуз"</string>
+    <string name="bugreport_finished_text" product="watch" msgid="1223616207145252689">"Мүчүлүштүктөр жөнүндө кабар жакында телефонго чыгат"</string>
     <string name="bugreport_finished_text" product="default" msgid="8353769438382138847">"Мүчүлүштүк тууралуу билдирүүңүздү бөлүшүү үчүн таптап коюңуз"</string>
     <string name="bugreport_finished_pending_screenshot_text" product="watch" msgid="1474435374470177193">"Мүчүлүштүк тууралуу билдирүүңүздү скриншотсуз бөлүшүү үчүн таптап коюңуз же скриншот даяр болгуча күтө туруңуз"</string>
     <string name="bugreport_finished_pending_screenshot_text" product="default" msgid="1474435374470177193">"Мүчүлүштүк тууралуу билдирүүңүздү скриншотсуз бөлүшүү үчүн таптап коюңуз же скриншот даяр болгуча күтө туруңуз"</string>
diff --git a/packages/Shell/res/values-lo-rLA/strings.xml b/packages/Shell/res/values-lo-rLA/strings.xml
index 2cc1573..0673c51 100644
--- a/packages/Shell/res/values-lo-rLA/strings.xml
+++ b/packages/Shell/res/values-lo-rLA/strings.xml
@@ -21,7 +21,7 @@
     <string name="bugreport_finished_title" msgid="4429132808670114081">"ບັນທຶກລາຍງານຂໍ້ຜິດພາດ <xliff:g id="ID">#%d</xliff:g> ແລ້ວ"</string>
     <string name="bugreport_updating_title" msgid="4423539949559634214">"ກຳລັງເພີ່ມລາຍລະອຽດໃສ່ລາຍງານຂໍ້ຜິດພາດ"</string>
     <string name="bugreport_updating_wait" msgid="3322151947853929470">"ກະລຸນາລໍຖ້າ..."</string>
-    <string name="bugreport_finished_text" product="watch" msgid="8389172248433597683">"​ປັດ​ໄປ​ຊ້າຍ​ເພື່ອ​ສົ່ງ​ລາຍ​ງານ​ຂໍ້​ຜິດ​ພາດ​ຂອງ​ທ່ານ"</string>
+    <string name="bugreport_finished_text" product="watch" msgid="1223616207145252689">"ລາຍງານຂໍ້ຜິດພາດຈະປາກົດໃນໂທລະສັບໃນໄວໆນີ້"</string>
     <string name="bugreport_finished_text" product="default" msgid="8353769438382138847">"ແຕະເພື່ອແບ່ງປັນລາຍງານຂໍ້ຜິດພາດຂອງທ່ານ"</string>
     <string name="bugreport_finished_pending_screenshot_text" product="watch" msgid="1474435374470177193">"ແຕະເພື່ອແບ່ງປັນລາຍງານຂໍ້ຜິດພາດຂອງທ່ານໂດຍບໍ່ໃຊ້ຮູບໜ້າຈໍ ຫຼື ລໍຖ້າໃຫ້ຮູບໜ້າຈໍແລ້ວໆ"</string>
     <string name="bugreport_finished_pending_screenshot_text" product="default" msgid="1474435374470177193">"ແຕະເພື່ອແບ່ງປັນລາຍງານຂໍ້ຜິດພາດຂອງທ່ານໂດຍບໍ່ໃຊ້ຮູບໜ້າຈໍ ຫຼື ລໍຖ້າໃຫ້ຮູບໜ້າຈໍແລ້ວໆ"</string>
diff --git a/packages/Shell/res/values-lt/strings.xml b/packages/Shell/res/values-lt/strings.xml
index 23fba5f..8d7f0de 100644
--- a/packages/Shell/res/values-lt/strings.xml
+++ b/packages/Shell/res/values-lt/strings.xml
@@ -21,7 +21,7 @@
     <string name="bugreport_finished_title" msgid="4429132808670114081">"Pranešimas apie riktą (<xliff:g id="ID">#%d</xliff:g>) užfiksuotas"</string>
     <string name="bugreport_updating_title" msgid="4423539949559634214">"Pridedama informacijos prie pranešimo apie riktą"</string>
     <string name="bugreport_updating_wait" msgid="3322151947853929470">"Palaukite…"</string>
-    <string name="bugreport_finished_text" product="watch" msgid="8389172248433597683">"Perbraukite kairėn, kad bendrintumėte rikto ataskaitą"</string>
+    <string name="bugreport_finished_text" product="watch" msgid="1223616207145252689">"Pranešimai apie riktus netrukus bus rodomi telefone"</string>
     <string name="bugreport_finished_text" product="default" msgid="8353769438382138847">"Palieskite, kad bendrintumėte pranešimą apie riktą"</string>
     <string name="bugreport_finished_pending_screenshot_text" product="watch" msgid="1474435374470177193">"Palieskite ir bendrinkite pranešimą apie riktą be ekrano kopijos arba palaukite, kol ji bus sukurta"</string>
     <string name="bugreport_finished_pending_screenshot_text" product="default" msgid="1474435374470177193">"Palieskite ir bendrinkite pranešimą apie riktą be ekrano kopijos arba palaukite, kol ji bus sukurta"</string>
diff --git a/packages/Shell/res/values-lv/strings.xml b/packages/Shell/res/values-lv/strings.xml
index d6bfee3..f2258a5 100644
--- a/packages/Shell/res/values-lv/strings.xml
+++ b/packages/Shell/res/values-lv/strings.xml
@@ -21,7 +21,7 @@
     <string name="bugreport_finished_title" msgid="4429132808670114081">"Kļūdas pārskats <xliff:g id="ID">#%d</xliff:g> reģistrēts"</string>
     <string name="bugreport_updating_title" msgid="4423539949559634214">"Informācijas pievienošana kļūdas pārskatam"</string>
     <string name="bugreport_updating_wait" msgid="3322151947853929470">"Lūdzu, uzgaidiet..."</string>
-    <string name="bugreport_finished_text" product="watch" msgid="8389172248433597683">"Velciet pa kreisi, lai kopīgotu savu kļūdu ziņojumu."</string>
+    <string name="bugreport_finished_text" product="watch" msgid="1223616207145252689">"Tālrunī pēc brīža būs redzams kļūdu pārskats"</string>
     <string name="bugreport_finished_text" product="default" msgid="8353769438382138847">"Pieskarieties, lai kopīgotu kļūdas pārskatu."</string>
     <string name="bugreport_finished_pending_screenshot_text" product="watch" msgid="1474435374470177193">"Pieskarieties, lai kopīgotu kļūdas pārskatu bez ekrānuzņēmuma vai gaidiet ekrānuzņēmumu."</string>
     <string name="bugreport_finished_pending_screenshot_text" product="default" msgid="1474435374470177193">"Pieskarieties, lai kopīgotu kļūdas pārskatu bez ekrānuzņēmuma vai gaidiet ekrānuzņēmumu."</string>
diff --git a/packages/Shell/res/values-mk-rMK/strings.xml b/packages/Shell/res/values-mk-rMK/strings.xml
index 3ce9436..f90f4ea 100644
--- a/packages/Shell/res/values-mk-rMK/strings.xml
+++ b/packages/Shell/res/values-mk-rMK/strings.xml
@@ -21,7 +21,7 @@
     <string name="bugreport_finished_title" msgid="4429132808670114081">"Извештајот за грешки <xliff:g id="ID">#%d</xliff:g> е снимен"</string>
     <string name="bugreport_updating_title" msgid="4423539949559634214">"Се додаваат детали на извештајот за грешка"</string>
     <string name="bugreport_updating_wait" msgid="3322151947853929470">"Почекајте..."</string>
-    <string name="bugreport_finished_text" product="watch" msgid="8389172248433597683">"Повлечете налево за да споделите пријава за грешка"</string>
+    <string name="bugreport_finished_text" product="watch" msgid="1223616207145252689">"Извештајот за грешки наскоро ќе се појави на телефонот"</string>
     <string name="bugreport_finished_text" product="default" msgid="8353769438382138847">"Допрете за да го споделите извештајот за грешки"</string>
     <string name="bugreport_finished_pending_screenshot_text" product="watch" msgid="1474435374470177193">"Допрете за споделување извештај за грешки без слика од екранот или почекајте да се подготви сликата"</string>
     <string name="bugreport_finished_pending_screenshot_text" product="default" msgid="1474435374470177193">"Допрете за споделување извештај за грешки без слика од екранот или почекајте да се подготви сликата"</string>
diff --git a/packages/Shell/res/values-ml-rIN/strings.xml b/packages/Shell/res/values-ml-rIN/strings.xml
index 13d6ee4..930f723 100644
--- a/packages/Shell/res/values-ml-rIN/strings.xml
+++ b/packages/Shell/res/values-ml-rIN/strings.xml
@@ -21,7 +21,7 @@
     <string name="bugreport_finished_title" msgid="4429132808670114081">"ബഗ് റിപ്പോർട്ട് <xliff:g id="ID">#%d</xliff:g> ക്യാപ്ചർ ചെയ്തു"</string>
     <string name="bugreport_updating_title" msgid="4423539949559634214">"ബഗ് റിപ്പോർട്ടിലേക്ക് വിശദാംശങ്ങൾ ചേർക്കുന്നു"</string>
     <string name="bugreport_updating_wait" msgid="3322151947853929470">"കാത്തിരിക്കുക..."</string>
-    <string name="bugreport_finished_text" product="watch" msgid="8389172248433597683">"നിങ്ങളുടെ ബഗ് റിപ്പോർട്ട് പങ്കിടുന്നതിന് ഇടത്തേയ്‌ക്ക് സ്വൈപ്പുചെയ്യുക"</string>
+    <string name="bugreport_finished_text" product="watch" msgid="1223616207145252689">"ബഗ് റിപ്പോർട്ട് താമസിയാതെ ഫോണിൽ ദൃശ്യമാകും"</string>
     <string name="bugreport_finished_text" product="default" msgid="8353769438382138847">"നിങ്ങളുടെ ബഗ് റിപ്പോർട്ട് പങ്കിടാൻ ടാപ്പുചെയ്യുക"</string>
     <string name="bugreport_finished_pending_screenshot_text" product="watch" msgid="1474435374470177193">"സ്ക്രീൻഷോട്ട് കൂടാതെയോ സ്ക്രീൻഷോട്ട് പൂർത്തിയാകുന്നതിന് കാക്കാതെയോ നിങ്ങളുടെ ബഗ് റിപ്പോർട്ട് പങ്കിടാൻ ടാപ്പുചെയ്യുക"</string>
     <string name="bugreport_finished_pending_screenshot_text" product="default" msgid="1474435374470177193">"സ്ക്രീൻഷോട്ട് കൂടാതെയോ സ്ക്രീൻഷോട്ട് പൂർത്തിയാകുന്നതിന് കാക്കാതെയോ നിങ്ങളുടെ ബഗ് റിപ്പോർട്ട് പങ്കിടാൻ ടാപ്പുചെയ്യുക"</string>
diff --git a/packages/Shell/res/values-mn-rMN/strings.xml b/packages/Shell/res/values-mn-rMN/strings.xml
index 591e542..6bde789 100644
--- a/packages/Shell/res/values-mn-rMN/strings.xml
+++ b/packages/Shell/res/values-mn-rMN/strings.xml
@@ -21,7 +21,7 @@
     <string name="bugreport_finished_title" msgid="4429132808670114081">"Програмд гарсан алдааны мэдээллийн <xliff:g id="ID">#%d</xliff:g>-г бүртгэгдлээ"</string>
     <string name="bugreport_updating_title" msgid="4423539949559634214">"Алдааны тайланд дэлгэрэнгүй мэдээлэл нэмж байна"</string>
     <string name="bugreport_updating_wait" msgid="3322151947853929470">"Түр хүлээнэ үү..."</string>
-    <string name="bugreport_finished_text" product="watch" msgid="8389172248433597683">"Өөрийн согог репортыг хуваалцахын тулд зүүн шудрана уу"</string>
+    <string name="bugreport_finished_text" product="watch" msgid="1223616207145252689">"Утсанд удахгүй алдааны тайлан гарч ирэх болно"</string>
     <string name="bugreport_finished_text" product="default" msgid="8353769438382138847">"Програмд гарсан алдааны мэдээллээ хуваалцах бол дарна уу"</string>
     <string name="bugreport_finished_pending_screenshot_text" product="watch" msgid="1474435374470177193">"Алдааны тайлангаа дэлгэцээс авсан зураггүйгээр хуваалцах бол дарж, эсвэл дэлгэцээс авсан зургийг бэлэн болтол нь хүлээнэ үү"</string>
     <string name="bugreport_finished_pending_screenshot_text" product="default" msgid="1474435374470177193">"Алдааны тайлангаа дэлгэцээс авсан зураггүйгээр хуваалцах бол дарж, эсвэл дэлгэцээс авсан зургийг бэлэн болтол нь хүлээнэ үү"</string>
diff --git a/packages/Shell/res/values-mr-rIN/strings.xml b/packages/Shell/res/values-mr-rIN/strings.xml
index 035ac01..084901a 100644
--- a/packages/Shell/res/values-mr-rIN/strings.xml
+++ b/packages/Shell/res/values-mr-rIN/strings.xml
@@ -21,7 +21,7 @@
     <string name="bugreport_finished_title" msgid="4429132808670114081">"दोष अहवाल <xliff:g id="ID">#%d</xliff:g> कॅप्चर केला"</string>
     <string name="bugreport_updating_title" msgid="4423539949559634214">"दोष अहवालामध्‍ये तपशील जोडत आहे"</string>
     <string name="bugreport_updating_wait" msgid="3322151947853929470">"कृपया प्रतीक्षा करा..."</string>
-    <string name="bugreport_finished_text" product="watch" msgid="8389172248433597683">"आपला दोष अहवाल सामायिक करण्यासाठी डावीकडे स्वाइप करा"</string>
+    <string name="bugreport_finished_text" product="watch" msgid="1223616207145252689">"फोनवर दोष अहवाल लवकरच दिसेल"</string>
     <string name="bugreport_finished_text" product="default" msgid="8353769438382138847">"आपला दोष अहवाल सामायिक करण्यासाठी टॅप करा"</string>
     <string name="bugreport_finished_pending_screenshot_text" product="watch" msgid="1474435374470177193">"स्क्रीनशॉट शिवाय आपला दोष अहवाल सामायिक करण्यासाठी टॅप करा किंवा समाप्त करण्यासाठी स्क्रीनशॉटची प्रतीक्षा करा"</string>
     <string name="bugreport_finished_pending_screenshot_text" product="default" msgid="1474435374470177193">"स्क्रीनशॉट शिवाय आपला दोष अहवाल सामायिक करण्यासाठी टॅप करा किंवा समाप्त करण्यासाठी स्क्रीनशॉटची प्रतीक्षा करा"</string>
diff --git a/packages/Shell/res/values-ms-rMY/strings.xml b/packages/Shell/res/values-ms-rMY/strings.xml
index 085152f..36e70c5 100644
--- a/packages/Shell/res/values-ms-rMY/strings.xml
+++ b/packages/Shell/res/values-ms-rMY/strings.xml
@@ -21,7 +21,7 @@
     <string name="bugreport_finished_title" msgid="4429132808670114081">"Laporan pepijat <xliff:g id="ID">#%d</xliff:g> telah ditangkap"</string>
     <string name="bugreport_updating_title" msgid="4423539949559634214">"Menambahkan butiran pada laporan pepijat"</string>
     <string name="bugreport_updating_wait" msgid="3322151947853929470">"Sila tunggu…"</string>
-    <string name="bugreport_finished_text" product="watch" msgid="8389172248433597683">"Leret ke kiri untuk berkongsi laporan pepijat anda"</string>
+    <string name="bugreport_finished_text" product="watch" msgid="1223616207145252689">"Laporan pepijat akan dipaparkan pada telefon sebentar lagi"</string>
     <string name="bugreport_finished_text" product="default" msgid="8353769438382138847">"Ketik untuk berkongsi laporan pepijat anda"</string>
     <string name="bugreport_finished_pending_screenshot_text" product="watch" msgid="1474435374470177193">"Ketik untuk berkongsi laporan pepijat anda tanpa tangkapan skrin atau tunggu tangkapan skrin selesai"</string>
     <string name="bugreport_finished_pending_screenshot_text" product="default" msgid="1474435374470177193">"Ketik untuk berkongsi laporan pepijat anda tanpa tangkapan skrin atau tunggu tangkapan skrin selesai"</string>
diff --git a/packages/Shell/res/values-my-rMM/strings.xml b/packages/Shell/res/values-my-rMM/strings.xml
index 7b9608e..ece4a869 100644
--- a/packages/Shell/res/values-my-rMM/strings.xml
+++ b/packages/Shell/res/values-my-rMM/strings.xml
@@ -21,7 +21,7 @@
     <string name="bugreport_finished_title" msgid="4429132808670114081">"ချွတ်ယွင်းမှုအစီရင်ခံချက် <xliff:g id="ID">#%d</xliff:g> ကိုရယူထားပြီးပါပြီ"</string>
     <string name="bugreport_updating_title" msgid="4423539949559634214">"ချွတ်ယွင်းချက်အစီရင်ခံချက်သို့ အသေးစိတ်များပေါင်းထည့်ရန်"</string>
     <string name="bugreport_updating_wait" msgid="3322151947853929470">"ခေတ္တစောင့်ပါ..."</string>
-    <string name="bugreport_finished_text" product="watch" msgid="8389172248433597683">"သင်၏ ဘာဂ် အစီရင်ခံစာကို မျှပေးရန် ဘယ်ဘက်သို့ ပွတ်ဆွဲရန်"</string>
+    <string name="bugreport_finished_text" product="watch" msgid="1223616207145252689">"ချွတ်ယွင်းချက်အစီရင်ခံစာကို မကြာခင် ဖုန်းထဲတွင် မြင်တွေ့ရပါလိမ့်မည်"</string>
     <string name="bugreport_finished_text" product="default" msgid="8353769438382138847">"သင့်ချွတ်ယွင်းမှုအစီရင်ခံချက်ကို မျှဝေရန် တို့ပါ"</string>
     <string name="bugreport_finished_pending_screenshot_text" product="watch" msgid="1474435374470177193">"ချွတ်ယွင်းချက်အစီရင်ခံစာကို ဖန်သားပြင်ဓာတ်ပုံမှတ်တမ်းမပါဘဲ မျှဝေရန် တို့ပါ သို့မဟုတ် ဖန်သားပြင်ဓာတ်ပုံမှတ်တမ်းတင်ခြင်း ပြီးဆုံးသည်အထိ စောင့်ပါ"</string>
     <string name="bugreport_finished_pending_screenshot_text" product="default" msgid="1474435374470177193">"ချွတ်ယွင်းချက်အစီရင်ခံစာကို ဖန်သားပြင်ဓာတ်ပုံမှတ်တမ်းမပါဘဲ မျှဝေရန် တို့ပါ သို့မဟုတ် ဖန်သားပြင်ဓာတ်ပုံမှတ်တမ်းတင်ခြင်း ပြီးဆုံးသည်အထိ စောင့်ပါ"</string>
diff --git a/packages/Shell/res/values-nb/strings.xml b/packages/Shell/res/values-nb/strings.xml
index 43fb97b..0d5db30 100644
--- a/packages/Shell/res/values-nb/strings.xml
+++ b/packages/Shell/res/values-nb/strings.xml
@@ -21,7 +21,7 @@
     <string name="bugreport_finished_title" msgid="4429132808670114081">"Feilrapporten <xliff:g id="ID">#%d</xliff:g> er fullført"</string>
     <string name="bugreport_updating_title" msgid="4423539949559634214">"Legger til detaljer i feilrapporten"</string>
     <string name="bugreport_updating_wait" msgid="3322151947853929470">"Vent litt"</string>
-    <string name="bugreport_finished_text" product="watch" msgid="8389172248433597683">"Sveip til venstre for å dele feilrapporten din"</string>
+    <string name="bugreport_finished_text" product="watch" msgid="1223616207145252689">"Feilrapporten vises snart på telefonen"</string>
     <string name="bugreport_finished_text" product="default" msgid="8353769438382138847">"Trykk for å dele feilrapporten"</string>
     <string name="bugreport_finished_pending_screenshot_text" product="watch" msgid="1474435374470177193">"Trykk for å dele feilrapporten uten noen skjermdump, eller vent til skjermdumpen er klar"</string>
     <string name="bugreport_finished_pending_screenshot_text" product="default" msgid="1474435374470177193">"Trykk for å dele feilrapporten uten noen skjermdump, eller vent til skjermdumpen er klar"</string>
diff --git a/packages/Shell/res/values-ne-rNP/strings.xml b/packages/Shell/res/values-ne-rNP/strings.xml
index 4ffa422..d71cb9f 100644
--- a/packages/Shell/res/values-ne-rNP/strings.xml
+++ b/packages/Shell/res/values-ne-rNP/strings.xml
@@ -21,7 +21,7 @@
     <string name="bugreport_finished_title" msgid="4429132808670114081">"बग रिपोर्ट <xliff:g id="ID">#%d</xliff:g>लाई कैद गरियो"</string>
     <string name="bugreport_updating_title" msgid="4423539949559634214">"बग रिपोर्टमा विवरणहरू थप्दै"</string>
     <string name="bugreport_updating_wait" msgid="3322151947853929470">"कृपया प्रतीक्षा गर्नुहोला..."</string>
-    <string name="bugreport_finished_text" product="watch" msgid="8389172248433597683">"तपाईँको बग रिपोर्ट साझेदारी गर्न बायाँ स्वाइप गर्नुहोस्"</string>
+    <string name="bugreport_finished_text" product="watch" msgid="1223616207145252689">"उक्त बग सम्बन्धी रिपोर्ट चाँडै नै यस फोनमा देखा पर्नेछ"</string>
     <string name="bugreport_finished_text" product="default" msgid="8353769438382138847">"तपाईंको बग रिपोर्टलाई साझेदारी गर्न ट्याप गर्नुहोस्"</string>
     <string name="bugreport_finished_pending_screenshot_text" product="watch" msgid="1474435374470177193">"तपाईँको बग रिपोर्टलाई स्क्रिनसट बिना साझेदारी गर्नका लागि ट्याप गर्नुहोस् वा स्क्रिनसट लिने प्रक्रिया पूरा हुन प्रतीक्षा गर्नुहोस्"</string>
     <string name="bugreport_finished_pending_screenshot_text" product="default" msgid="1474435374470177193">"तपाईँको बग रिपोर्टलाई स्क्रिनसट बिना साझेदारी गर्नका लागि ट्याप गर्नुहोस् वा स्क्रिनसट लिने प्रक्रिया पूरा हुन प्रतीक्षा गर्नुहोस्"</string>
diff --git a/packages/Shell/res/values-nl/strings.xml b/packages/Shell/res/values-nl/strings.xml
index 1b60f0d..c13ad36 100644
--- a/packages/Shell/res/values-nl/strings.xml
+++ b/packages/Shell/res/values-nl/strings.xml
@@ -21,7 +21,7 @@
     <string name="bugreport_finished_title" msgid="4429132808670114081">"Bugrapport <xliff:g id="ID">#%d</xliff:g> is vastgelegd"</string>
     <string name="bugreport_updating_title" msgid="4423539949559634214">"Details toevoegen aan het bugrapport"</string>
     <string name="bugreport_updating_wait" msgid="3322151947853929470">"Even geduld…"</string>
-    <string name="bugreport_finished_text" product="watch" msgid="8389172248433597683">"Veeg naar links om je bugmelding te delen"</string>
+    <string name="bugreport_finished_text" product="watch" msgid="1223616207145252689">"Het bugrapport wordt over enkele ogenblikken op de telefoon weergegeven"</string>
     <string name="bugreport_finished_text" product="default" msgid="8353769438382138847">"Tik om je bugrapport te delen"</string>
     <string name="bugreport_finished_pending_screenshot_text" product="watch" msgid="1474435374470177193">"Tik om je bugrapport te delen zonder screenshot of wacht tot het screenshot is voltooid"</string>
     <string name="bugreport_finished_pending_screenshot_text" product="default" msgid="1474435374470177193">"Tik om je bugrapport te delen zonder screenshot of wacht tot het screenshot is voltooid"</string>
diff --git a/packages/Shell/res/values-pa-rIN/strings.xml b/packages/Shell/res/values-pa-rIN/strings.xml
index db8b29f..f0bf46e 100644
--- a/packages/Shell/res/values-pa-rIN/strings.xml
+++ b/packages/Shell/res/values-pa-rIN/strings.xml
@@ -21,7 +21,7 @@
     <string name="bugreport_finished_title" msgid="4429132808670114081">"ਬੱਗ ਰਿਪੋਰਟ <xliff:g id="ID">#%d</xliff:g> ਕੈਪਚਰ ਕੀਤੀ ਗਈ"</string>
     <string name="bugreport_updating_title" msgid="4423539949559634214">"ਬੱਗ ਰਿਪੋਰਟ ਵਿੱਚ ਵੇਰਵਿਆਂ ਨੂੰ ਸ਼ਾਮਲ ਕੀਤਾ ਜਾ ਰਿਹਾ ਹੈ"</string>
     <string name="bugreport_updating_wait" msgid="3322151947853929470">"ਕਿਰਪਾ ਕਰਕੇ ਉਡੀਕ ਕਰੋ..."</string>
-    <string name="bugreport_finished_text" product="watch" msgid="8389172248433597683">"ਤੁਹਾਡੀ ਬਗ ਰਿਪੋਰਟ ਸ਼ੇਅਰ ਕਰਨ ਲਈ ਖੱਬੇ ਪਾਸੇ ਸਵਾਈਪ ਕਰੋ"</string>
+    <string name="bugreport_finished_text" product="watch" msgid="1223616207145252689">"ਬੱਗ ਰਿਪੋਰਟ ਜਲਦ ਹੀ ਫ਼ੋਨ \'ਤੇ ਵਿਖਾਈ ਦੇਵੇਗੀ"</string>
     <string name="bugreport_finished_text" product="default" msgid="8353769438382138847">"ਆਪਣੀ ਬੱਗ ਰਿਪੋਰਟ ਸਾਂਝੀ ਕਰਨ ਲਈ ਟੈਪ ਕਰੋ"</string>
     <string name="bugreport_finished_pending_screenshot_text" product="watch" msgid="1474435374470177193">"ਸਕ੍ਰੀਨਸ਼ਾਟ ਦੇ ਬਿਨਾਂ ਆਪਣੀ ਬੱਗ ਰਿਪੋਰਟ ਨੂੰ ਸਾਂਝੀ ਕਰਨ ਲਈ ਟੈਪ ਕਰੋ ਜਾਂ ਸਕ੍ਰੀਨਸ਼ਾਟ ਦੇ ਪੂਰੇ ਹੋਣ ਦੀ ਉਡੀਕ ਕਰੋ"</string>
     <string name="bugreport_finished_pending_screenshot_text" product="default" msgid="1474435374470177193">"ਸਕ੍ਰੀਨਸ਼ਾਟ ਦੇ ਬਿਨਾਂ ਆਪਣੀ ਬੱਗ ਰਿਪੋਰਟ ਨੂੰ ਸਾਂਝੀ ਕਰਨ ਲਈ ਟੈਪ ਕਰੋ ਜਾਂ ਸਕ੍ਰੀਨਸ਼ਾਟ ਦੇ ਪੂਰੇ ਹੋਣ ਦੀ ਉਡੀਕ ਕਰੋ"</string>
diff --git a/packages/Shell/res/values-pl/strings.xml b/packages/Shell/res/values-pl/strings.xml
index d0375b6..73cd181 100644
--- a/packages/Shell/res/values-pl/strings.xml
+++ b/packages/Shell/res/values-pl/strings.xml
@@ -21,7 +21,7 @@
     <string name="bugreport_finished_title" msgid="4429132808670114081">"Raport o błędzie <xliff:g id="ID">#%d</xliff:g> został zapisany"</string>
     <string name="bugreport_updating_title" msgid="4423539949559634214">"Dodaję szczegóły do raportu o błędzie"</string>
     <string name="bugreport_updating_wait" msgid="3322151947853929470">"Czekaj..."</string>
-    <string name="bugreport_finished_text" product="watch" msgid="8389172248433597683">"Przesuń palcem w lewo, by udostępnić swoje zgłoszenie błędu"</string>
+    <string name="bugreport_finished_text" product="watch" msgid="1223616207145252689">"Raport o błędzie będzie się pojawiał na telefonie przez chwilę"</string>
     <string name="bugreport_finished_text" product="default" msgid="8353769438382138847">"Kliknij, by udostępnić raport o błędzie"</string>
     <string name="bugreport_finished_pending_screenshot_text" product="watch" msgid="1474435374470177193">"Kliknij, by udostępnić raport o błędzie bez zrzutu ekranu, lub poczekaj, aż zostanie on wygenerowany"</string>
     <string name="bugreport_finished_pending_screenshot_text" product="default" msgid="1474435374470177193">"Kliknij, by udostępnić raport o błędzie bez zrzutu ekranu, lub poczekaj, aż zostanie on wygenerowany"</string>
diff --git a/packages/Shell/res/values-pt-rBR/strings.xml b/packages/Shell/res/values-pt-rBR/strings.xml
index 12cf2e4..2947122 100644
--- a/packages/Shell/res/values-pt-rBR/strings.xml
+++ b/packages/Shell/res/values-pt-rBR/strings.xml
@@ -21,7 +21,7 @@
     <string name="bugreport_finished_title" msgid="4429132808670114081">"Relatório do bug <xliff:g id="ID">#%d</xliff:g> capturado"</string>
     <string name="bugreport_updating_title" msgid="4423539949559634214">"Adicionando detalhes ao relatório do bug"</string>
     <string name="bugreport_updating_wait" msgid="3322151947853929470">"Aguarde…"</string>
-    <string name="bugreport_finished_text" product="watch" msgid="8389172248433597683">"Deslize para a esquerda para compartilhar seu relatório de bugs"</string>
+    <string name="bugreport_finished_text" product="watch" msgid="1223616207145252689">"O relatório de bugs será exibido no smartphone em breve"</string>
     <string name="bugreport_finished_text" product="default" msgid="8353769438382138847">"Toque para compartilhar seu relatório do bug"</string>
     <string name="bugreport_finished_pending_screenshot_text" product="watch" msgid="1474435374470177193">"Toque para compartilhar seu relatório de bug sem captura de tela ou aguarde a conclusão"</string>
     <string name="bugreport_finished_pending_screenshot_text" product="default" msgid="1474435374470177193">"Toque para compartilhar seu relatório de bug sem captura de tela ou aguarde a conclusão"</string>
diff --git a/packages/Shell/res/values-pt-rPT/strings.xml b/packages/Shell/res/values-pt-rPT/strings.xml
index 2148f97..0b08fd6 100644
--- a/packages/Shell/res/values-pt-rPT/strings.xml
+++ b/packages/Shell/res/values-pt-rPT/strings.xml
@@ -21,7 +21,7 @@
     <string name="bugreport_finished_title" msgid="4429132808670114081">"Relatório de erro <xliff:g id="ID">#%d</xliff:g> criado"</string>
     <string name="bugreport_updating_title" msgid="4423539949559634214">"A adicionar detalhes ao relatório de erro"</string>
     <string name="bugreport_updating_wait" msgid="3322151947853929470">"Aguarde..."</string>
-    <string name="bugreport_finished_text" product="watch" msgid="8389172248433597683">"Deslizar rapidamente para a esquerda para partilhar o seu relatório de erros"</string>
+    <string name="bugreport_finished_text" product="watch" msgid="1223616207145252689">"O relatório de erro será apresentado brevemente no telemóvel"</string>
     <string name="bugreport_finished_text" product="default" msgid="8353769438382138847">"Toque para partilhar o relatório de erro"</string>
     <string name="bugreport_finished_pending_screenshot_text" product="watch" msgid="1474435374470177193">"Toque para partilhar o relatório de erro sem uma captura de ecrã ou aguarde a conclusão da mesma"</string>
     <string name="bugreport_finished_pending_screenshot_text" product="default" msgid="1474435374470177193">"Toque para partilhar o relatório de erro sem uma captura de ecrã ou aguarde a conclusão da mesma"</string>
diff --git a/packages/Shell/res/values-pt/strings.xml b/packages/Shell/res/values-pt/strings.xml
index 12cf2e4..2947122 100644
--- a/packages/Shell/res/values-pt/strings.xml
+++ b/packages/Shell/res/values-pt/strings.xml
@@ -21,7 +21,7 @@
     <string name="bugreport_finished_title" msgid="4429132808670114081">"Relatório do bug <xliff:g id="ID">#%d</xliff:g> capturado"</string>
     <string name="bugreport_updating_title" msgid="4423539949559634214">"Adicionando detalhes ao relatório do bug"</string>
     <string name="bugreport_updating_wait" msgid="3322151947853929470">"Aguarde…"</string>
-    <string name="bugreport_finished_text" product="watch" msgid="8389172248433597683">"Deslize para a esquerda para compartilhar seu relatório de bugs"</string>
+    <string name="bugreport_finished_text" product="watch" msgid="1223616207145252689">"O relatório de bugs será exibido no smartphone em breve"</string>
     <string name="bugreport_finished_text" product="default" msgid="8353769438382138847">"Toque para compartilhar seu relatório do bug"</string>
     <string name="bugreport_finished_pending_screenshot_text" product="watch" msgid="1474435374470177193">"Toque para compartilhar seu relatório de bug sem captura de tela ou aguarde a conclusão"</string>
     <string name="bugreport_finished_pending_screenshot_text" product="default" msgid="1474435374470177193">"Toque para compartilhar seu relatório de bug sem captura de tela ou aguarde a conclusão"</string>
diff --git a/packages/Shell/res/values-ro/strings.xml b/packages/Shell/res/values-ro/strings.xml
index 4e57b60..e154563 100644
--- a/packages/Shell/res/values-ro/strings.xml
+++ b/packages/Shell/res/values-ro/strings.xml
@@ -21,7 +21,7 @@
     <string name="bugreport_finished_title" msgid="4429132808670114081">"Raportul de eroare <xliff:g id="ID">#%d</xliff:g> a fost creat"</string>
     <string name="bugreport_updating_title" msgid="4423539949559634214">"Se adaugă detaliile la raportul de eroare"</string>
     <string name="bugreport_updating_wait" msgid="3322151947853929470">"Așteptați…"</string>
-    <string name="bugreport_finished_text" product="watch" msgid="8389172248433597683">"Glisați la stânga pentru a trimite raportul de erori"</string>
+    <string name="bugreport_finished_text" product="watch" msgid="1223616207145252689">"Raportul de eroare va apărea curând pe telefon"</string>
     <string name="bugreport_finished_text" product="default" msgid="8353769438382138847">"Atingeți pentru a trimite raportul de eroare"</string>
     <string name="bugreport_finished_pending_screenshot_text" product="watch" msgid="1474435374470177193">"Atingeți ca să trimiteți raportul de eroare fără captură de ecran sau așteptați finalizarea acesteia"</string>
     <string name="bugreport_finished_pending_screenshot_text" product="default" msgid="1474435374470177193">"Atingeți ca să trimiteți raportul de eroare fără captură de ecran sau așteptați finalizarea acesteia"</string>
diff --git a/packages/Shell/res/values-ru/strings.xml b/packages/Shell/res/values-ru/strings.xml
index 62647ca..9ad590e 100644
--- a/packages/Shell/res/values-ru/strings.xml
+++ b/packages/Shell/res/values-ru/strings.xml
@@ -21,7 +21,7 @@
     <string name="bugreport_finished_title" msgid="4429132808670114081">"Отчет об ошибке <xliff:g id="ID">#%d</xliff:g> сохранен"</string>
     <string name="bugreport_updating_title" msgid="4423539949559634214">"Добавление данных в отчет об ошибке"</string>
     <string name="bugreport_updating_wait" msgid="3322151947853929470">"Подождите…"</string>
-    <string name="bugreport_finished_text" product="watch" msgid="8389172248433597683">"Проведите влево, чтобы отправить отчет"</string>
+    <string name="bugreport_finished_text" product="watch" msgid="1223616207145252689">"Отчет об ошибке скоро появится на телефоне"</string>
     <string name="bugreport_finished_text" product="default" msgid="8353769438382138847">"Нажмите, чтобы отправить отчет об ошибке."</string>
     <string name="bugreport_finished_pending_screenshot_text" product="watch" msgid="1474435374470177193">"Нажмите, чтобы отправить отчет об ошибке сразу, или подождите, пока будет сохранен скриншот."</string>
     <string name="bugreport_finished_pending_screenshot_text" product="default" msgid="1474435374470177193">"Нажмите, чтобы отправить отчет об ошибке сразу, или подождите, пока будет сохранен скриншот."</string>
diff --git a/packages/Shell/res/values-si-rLK/strings.xml b/packages/Shell/res/values-si-rLK/strings.xml
index 0b1d478..ecc134e 100644
--- a/packages/Shell/res/values-si-rLK/strings.xml
+++ b/packages/Shell/res/values-si-rLK/strings.xml
@@ -21,7 +21,7 @@
     <string name="bugreport_finished_title" msgid="4429132808670114081">"දෝෂ වාර්තා <xliff:g id="ID">#%d</xliff:g> ග්‍රහණය කර ගන්නා ලදී"</string>
     <string name="bugreport_updating_title" msgid="4423539949559634214">"දෝෂ වාර්තාව වෙත විස්තර එක් කිරීම"</string>
     <string name="bugreport_updating_wait" msgid="3322151947853929470">"කරුණාකර රැඳී සිටින්න..."</string>
-    <string name="bugreport_finished_text" product="watch" msgid="8389172248433597683">"ඔබගේ දෝෂ වාර්තාව බෙදාගැනීමට වමට ස්වයිප් කරන්න"</string>
+    <string name="bugreport_finished_text" product="watch" msgid="1223616207145252689">"දෝෂ වාර්තාව ඉක්මනින් දුරකථනය මත දිස් වනු ඇත"</string>
     <string name="bugreport_finished_text" product="default" msgid="8353769438382138847">"ඔබගේ දෝෂ වාර්තාව බෙදා ගැනීමට තට්ටු කරන්න"</string>
     <string name="bugreport_finished_pending_screenshot_text" product="watch" msgid="1474435374470177193">"තිර රුවක් රහිතව ඔබගේ දෝෂ වාර්තාව බෙදා ගැනීමට තට්ටු කරන්න නැතහොත් තිර රුව ගැනීම අවසන් වන තෙක් රැඳෙන්න"</string>
     <string name="bugreport_finished_pending_screenshot_text" product="default" msgid="1474435374470177193">"තිර රුවක් රහිතව ඔබගේ දෝෂ වාර්තාව බෙදා ගැනීමට තට්ටු කරන්න නැතහොත් තිර රුව ගැනීම අවසන් වන තෙක් රැඳෙන්න"</string>
diff --git a/packages/Shell/res/values-sk/strings.xml b/packages/Shell/res/values-sk/strings.xml
index 3e3a0e4..733287e 100644
--- a/packages/Shell/res/values-sk/strings.xml
+++ b/packages/Shell/res/values-sk/strings.xml
@@ -21,7 +21,7 @@
     <string name="bugreport_finished_title" msgid="4429132808670114081">"Hlásenie chyby <xliff:g id="ID">#%d</xliff:g> bolo zaznamenané"</string>
     <string name="bugreport_updating_title" msgid="4423539949559634214">"Pridanie podrobností o hlásení chyby"</string>
     <string name="bugreport_updating_wait" msgid="3322151947853929470">"Čakajte prosím…"</string>
-    <string name="bugreport_finished_text" product="watch" msgid="8389172248433597683">"Ak chcete hlásenie o chybe zdieľať, prejdite prstom doľava."</string>
+    <string name="bugreport_finished_text" product="watch" msgid="1223616207145252689">"Hlásenie chyby sa čoskoro zobrazí na telefóne"</string>
     <string name="bugreport_finished_text" product="default" msgid="8353769438382138847">"Hlásenie chyby môžete zdieľať klepnutím"</string>
     <string name="bugreport_finished_pending_screenshot_text" product="watch" msgid="1474435374470177193">"Klepnutím zdieľajte hlásenie chyby bez snímky obrazovky alebo počkajte na dokončenie snímky obrazovky"</string>
     <string name="bugreport_finished_pending_screenshot_text" product="default" msgid="1474435374470177193">"Klepnutím zdieľajte hlásenie chyby bez snímky obrazovky alebo počkajte na dokončenie snímky obrazovky"</string>
diff --git a/packages/Shell/res/values-sl/strings.xml b/packages/Shell/res/values-sl/strings.xml
index 6b07e46..31c944c 100644
--- a/packages/Shell/res/values-sl/strings.xml
+++ b/packages/Shell/res/values-sl/strings.xml
@@ -21,7 +21,7 @@
     <string name="bugreport_finished_title" msgid="4429132808670114081">"Poročilo o napaki <xliff:g id="ID">#%d</xliff:g> zajeto"</string>
     <string name="bugreport_updating_title" msgid="4423539949559634214">"Dodajanje podrobnosti v poročilo o napakah"</string>
     <string name="bugreport_updating_wait" msgid="3322151947853929470">"Počakajte ..."</string>
-    <string name="bugreport_finished_text" product="watch" msgid="8389172248433597683">"Povlecite v levo, če želite poslati sporočilo o napaki"</string>
+    <string name="bugreport_finished_text" product="watch" msgid="1223616207145252689">"Poročilo o napakah bo kmalu prikazano v telefonu"</string>
     <string name="bugreport_finished_text" product="default" msgid="8353769438382138847">"Dotaknite se, če želite poročilo o napaki dati v skupno rabo"</string>
     <string name="bugreport_finished_pending_screenshot_text" product="watch" msgid="1474435374470177193">"Dotaknite se za pošiljanje poročila o napakah brez posnetka zaslona ali počakajte, da se ta dokonča"</string>
     <string name="bugreport_finished_pending_screenshot_text" product="default" msgid="1474435374470177193">"Dotaknite se za pošiljanje poročila o napakah brez posnetka zaslona ali počakajte, da se ta dokonča"</string>
diff --git a/packages/Shell/res/values-sq-rAL/strings.xml b/packages/Shell/res/values-sq-rAL/strings.xml
index 08c77c2..b97c6eb 100644
--- a/packages/Shell/res/values-sq-rAL/strings.xml
+++ b/packages/Shell/res/values-sq-rAL/strings.xml
@@ -21,7 +21,7 @@
     <string name="bugreport_finished_title" msgid="4429132808670114081">"Raporti i defekteve në kod <xliff:g id="ID">#%d</xliff:g> u regjistrua"</string>
     <string name="bugreport_updating_title" msgid="4423539949559634214">"Po shtohen detajet te raporti i defekteve në kod"</string>
     <string name="bugreport_updating_wait" msgid="3322151947853929470">"Qëndro në pritje..."</string>
-    <string name="bugreport_finished_text" product="watch" msgid="8389172248433597683">"Rrëshqit majtas për të ndarë raportin e defektit në kod"</string>
+    <string name="bugreport_finished_text" product="watch" msgid="1223616207145252689">"Raporti i defektit nëkod do të shfaqet së shpejti në telefon"</string>
     <string name="bugreport_finished_text" product="default" msgid="8353769438382138847">"Trokit për të ndarë raportin e defekteve në kod"</string>
     <string name="bugreport_finished_pending_screenshot_text" product="watch" msgid="1474435374470177193">"Trokit për të ndarë raportin e defekteve në kod pa një pamje çasti ose prit që pamja e çastit të përfundojë"</string>
     <string name="bugreport_finished_pending_screenshot_text" product="default" msgid="1474435374470177193">"Trokit për të ndarë raportin e defekteve në kod pa një pamje çasti ose prit që pamja e çastit të përfundojë"</string>
diff --git a/packages/Shell/res/values-sr/strings.xml b/packages/Shell/res/values-sr/strings.xml
index 72a5dc8..c9547c0 100644
--- a/packages/Shell/res/values-sr/strings.xml
+++ b/packages/Shell/res/values-sr/strings.xml
@@ -21,7 +21,7 @@
     <string name="bugreport_finished_title" msgid="4429132808670114081">"Извештај о грешци <xliff:g id="ID">#%d</xliff:g> је снимљен"</string>
     <string name="bugreport_updating_title" msgid="4423539949559634214">"Додају се детаљи у извештај о грешци"</string>
     <string name="bugreport_updating_wait" msgid="3322151947853929470">"Сачекајте..."</string>
-    <string name="bugreport_finished_text" product="watch" msgid="8389172248433597683">"Превуците улево да бисте делили извештај о грешкама"</string>
+    <string name="bugreport_finished_text" product="watch" msgid="1223616207145252689">"Извештај о грешци ће се ускоро појавити на телефону"</string>
     <string name="bugreport_finished_text" product="default" msgid="8353769438382138847">"Додирните да бисте делили извештај о грешци"</string>
     <string name="bugreport_finished_pending_screenshot_text" product="watch" msgid="1474435374470177193">"Додирните за дељење извештаја о грешци без снимка екрана или сачекајте да се направи снимак екрана"</string>
     <string name="bugreport_finished_pending_screenshot_text" product="default" msgid="1474435374470177193">"Додирните за дељење извештаја о грешци без снимка екрана или сачекајте да се направи снимак екрана"</string>
diff --git a/packages/Shell/res/values-sv/strings.xml b/packages/Shell/res/values-sv/strings.xml
index 52ff7c5..dcc38db 100644
--- a/packages/Shell/res/values-sv/strings.xml
+++ b/packages/Shell/res/values-sv/strings.xml
@@ -21,7 +21,7 @@
     <string name="bugreport_finished_title" msgid="4429132808670114081">"Felrapporten <xliff:g id="ID">#%d</xliff:g> har skapats"</string>
     <string name="bugreport_updating_title" msgid="4423539949559634214">"Lägger till information i felrapporten"</string>
     <string name="bugreport_updating_wait" msgid="3322151947853929470">"Vänta …"</string>
-    <string name="bugreport_finished_text" product="watch" msgid="8389172248433597683">"Svep åt vänster om du vill dela felrapporten"</string>
+    <string name="bugreport_finished_text" product="watch" msgid="1223616207145252689">"Felrapporten visas på mobilen inom kort"</string>
     <string name="bugreport_finished_text" product="default" msgid="8353769438382138847">"Tryck om du vill dela felrapporten"</string>
     <string name="bugreport_finished_pending_screenshot_text" product="watch" msgid="1474435374470177193">"Tryck om du vill dela felrapporten utan en skärmdump eller vänta tills skärmdumpen är klar"</string>
     <string name="bugreport_finished_pending_screenshot_text" product="default" msgid="1474435374470177193">"Tryck om du vill dela felrapporten utan en skärmdump eller vänta tills skärmdumpen är klar"</string>
diff --git a/packages/Shell/res/values-sw/strings.xml b/packages/Shell/res/values-sw/strings.xml
index b31b54f..83f205d 100644
--- a/packages/Shell/res/values-sw/strings.xml
+++ b/packages/Shell/res/values-sw/strings.xml
@@ -21,7 +21,7 @@
     <string name="bugreport_finished_title" msgid="4429132808670114081">"Ripoti ya hitilafu ya <xliff:g id="ID">#%d</xliff:g> imerekodiwa"</string>
     <string name="bugreport_updating_title" msgid="4423539949559634214">"Inaongeza maelezo kwenye ripoti ya hitilafu"</string>
     <string name="bugreport_updating_wait" msgid="3322151947853929470">"Tafadhali subiri…"</string>
-    <string name="bugreport_finished_text" product="watch" msgid="8389172248433597683">"Telezesha kidole kushoto ili ushiriki ripoti yako ya hitilafu"</string>
+    <string name="bugreport_finished_text" product="watch" msgid="1223616207145252689">"Tutatuma ripoti ya hitilafu kwenye simu baada ya muda mfupi"</string>
     <string name="bugreport_finished_text" product="default" msgid="8353769438382138847">"Gonga ili ushiriki ripoti yako ya hitilafu"</string>
     <string name="bugreport_finished_pending_screenshot_text" product="watch" msgid="1474435374470177193">"Gonga ili ushiriki ripoti yako ya hitilafu bila picha ya skrini au usubiri picha ya skrini itayarishwe"</string>
     <string name="bugreport_finished_pending_screenshot_text" product="default" msgid="1474435374470177193">"Gonga ili ushiriki ripoti yako ya hitilafu bila picha ya skrini au usubiri picha ya skrini itayarishwe"</string>
diff --git a/packages/Shell/res/values-ta-rIN/strings.xml b/packages/Shell/res/values-ta-rIN/strings.xml
index bd727ea..2a83db0 100644
--- a/packages/Shell/res/values-ta-rIN/strings.xml
+++ b/packages/Shell/res/values-ta-rIN/strings.xml
@@ -21,7 +21,7 @@
     <string name="bugreport_finished_title" msgid="4429132808670114081">"பிழை அறிக்கை <xliff:g id="ID">#%d</xliff:g> எடுக்கப்பட்டது"</string>
     <string name="bugreport_updating_title" msgid="4423539949559634214">"பிழை அறிக்கையில் விவரங்களைச் சேர்க்கிறது"</string>
     <string name="bugreport_updating_wait" msgid="3322151947853929470">"காத்திருக்கவும்…"</string>
-    <string name="bugreport_finished_text" product="watch" msgid="8389172248433597683">"பிழை அறிக்கையைப் பகிர இடது புறமாகத் தேய்க்கவும்"</string>
+    <string name="bugreport_finished_text" product="watch" msgid="1223616207145252689">"பிழை அறிக்கை சிறிது நேரத்தில் மொபைலில் தோன்றும்"</string>
     <string name="bugreport_finished_text" product="default" msgid="8353769438382138847">"பிழை அறிக்கையைப் பகிர, தட்டவும்"</string>
     <string name="bugreport_finished_pending_screenshot_text" product="watch" msgid="1474435374470177193">"ஸ்கிரீன்ஷாட் இல்லாமல் பிழை அறிக்கையைப் பகிர, தட்டவும் அல்லது ஸ்கிரீன்ஷாட் முடியும்வரை காத்திருக்கவும்"</string>
     <string name="bugreport_finished_pending_screenshot_text" product="default" msgid="1474435374470177193">"ஸ்கிரீன்ஷாட் இல்லாமல் பிழை அறிக்கையைப் பகிர, தட்டவும் அல்லது ஸ்கிரீன்ஷாட் முடியும்வரை காத்திருக்கவும்"</string>
diff --git a/packages/Shell/res/values-te-rIN/strings.xml b/packages/Shell/res/values-te-rIN/strings.xml
index a6beb3c..47074fd 100644
--- a/packages/Shell/res/values-te-rIN/strings.xml
+++ b/packages/Shell/res/values-te-rIN/strings.xml
@@ -21,7 +21,7 @@
     <string name="bugreport_finished_title" msgid="4429132808670114081">"బగ్ నివేదిక <xliff:g id="ID">#%d</xliff:g> సంగ్రహించబడింది"</string>
     <string name="bugreport_updating_title" msgid="4423539949559634214">"బగ్ నివేదికకు వివరాలను జోడిస్తోంది"</string>
     <string name="bugreport_updating_wait" msgid="3322151947853929470">"దయచేసి వేచి ఉండండి..."</string>
-    <string name="bugreport_finished_text" product="watch" msgid="8389172248433597683">"మీ బగ్ నివేదికను భాగస్వామ్యం చేయడానికి ఎడమవైపుకు స్వైప్ చేయండి"</string>
+    <string name="bugreport_finished_text" product="watch" msgid="1223616207145252689">"బగ్ నివేదిక త్వరలో ఫోన్‌లో కనిపిస్తుంది"</string>
     <string name="bugreport_finished_text" product="default" msgid="8353769438382138847">"మీ బగ్ నివేదికను భాగస్వామ్యం చేయడానికి నొక్కండి"</string>
     <string name="bugreport_finished_pending_screenshot_text" product="watch" msgid="1474435374470177193">"స్క్రీన్‌షాట్ లేకుండా మీ బగ్ నివే. భాగ. చేయడానికి నొక్కండి లేదా స్క్రీన్‌షాట్ ముగిసేదాకా వేచి ఉండండి"</string>
     <string name="bugreport_finished_pending_screenshot_text" product="default" msgid="1474435374470177193">"స్క్రీన్‌షాట్ లేకుండా మీ బగ్ నివే. భాగ. చేయడానికి నొక్కండి లేదా స్క్రీన్‌షాట్ ముగిసేదాకా వేచి ఉండండి"</string>
diff --git a/packages/Shell/res/values-th/strings.xml b/packages/Shell/res/values-th/strings.xml
index d76bf12..dddb3b0 100644
--- a/packages/Shell/res/values-th/strings.xml
+++ b/packages/Shell/res/values-th/strings.xml
@@ -21,7 +21,7 @@
     <string name="bugreport_finished_title" msgid="4429132808670114081">"บันทึกรายงานข้อบกพร่อง <xliff:g id="ID">#%d</xliff:g> แล้ว"</string>
     <string name="bugreport_updating_title" msgid="4423539949559634214">"กำลังเพิ่มรายละเอียดในรายงานข้อบกพร่อง"</string>
     <string name="bugreport_updating_wait" msgid="3322151947853929470">"โปรดรอสักครู่…"</string>
-    <string name="bugreport_finished_text" product="watch" msgid="8389172248433597683">"กวาดไปทางซ้ายเพื่อแชร์รายงานข้อบกพร่อง"</string>
+    <string name="bugreport_finished_text" product="watch" msgid="1223616207145252689">"รายงานข้อบกพร่องจะปรากฏบนโทรศัพท์ในไม่ช้า"</string>
     <string name="bugreport_finished_text" product="default" msgid="8353769438382138847">"แตะเพื่อแชร์รายงานข้อบกพร่องของคุณ"</string>
     <string name="bugreport_finished_pending_screenshot_text" product="watch" msgid="1474435374470177193">"แตะเพื่อแชร์รายงานข้อบกพร่องของคุณโดยไม่มีภาพหน้าจอ หรือรอให้ภาพหน้าจอเสร็จสมบูรณ์"</string>
     <string name="bugreport_finished_pending_screenshot_text" product="default" msgid="1474435374470177193">"แตะเพื่อแชร์รายงานข้อบกพร่องของคุณโดยไม่มีภาพหน้าจอ หรือรอให้ภาพหน้าจอเสร็จสมบูรณ์"</string>
diff --git a/packages/Shell/res/values-tl/strings.xml b/packages/Shell/res/values-tl/strings.xml
index fc556e1..28805c8 100644
--- a/packages/Shell/res/values-tl/strings.xml
+++ b/packages/Shell/res/values-tl/strings.xml
@@ -21,7 +21,7 @@
     <string name="bugreport_finished_title" msgid="4429132808670114081">"Na-capture ang ulat ng bug na <xliff:g id="ID">#%d</xliff:g>"</string>
     <string name="bugreport_updating_title" msgid="4423539949559634214">"Pagdaragdag ng mga detalye sa ulat ng bug"</string>
     <string name="bugreport_updating_wait" msgid="3322151947853929470">"Mangyaring maghintay..."</string>
-    <string name="bugreport_finished_text" product="watch" msgid="8389172248433597683">"Mag-swipe pakaliwa upang ibahagi ang iyong ulat ng bug"</string>
+    <string name="bugreport_finished_text" product="watch" msgid="1223616207145252689">"Lalabas sa telepono ang ulat ng bug pagkalipas ng ilang sandali"</string>
     <string name="bugreport_finished_text" product="default" msgid="8353769438382138847">"Mag-tap upang ibahagi ang iyong ulat ng bug"</string>
     <string name="bugreport_finished_pending_screenshot_text" product="watch" msgid="1474435374470177193">"Mag-tap para ibahagi ang iyong ulat ng bug nang walang screenshot o hintaying matapos ang screenshot"</string>
     <string name="bugreport_finished_pending_screenshot_text" product="default" msgid="1474435374470177193">"Mag-tap para ibahagi ang iyong ulat ng bug nang walang screenshot o hintaying matapos ang screenshot"</string>
diff --git a/packages/Shell/res/values-tr/strings.xml b/packages/Shell/res/values-tr/strings.xml
index f2b02c3..d444d78 100644
--- a/packages/Shell/res/values-tr/strings.xml
+++ b/packages/Shell/res/values-tr/strings.xml
@@ -21,7 +21,7 @@
     <string name="bugreport_finished_title" msgid="4429132808670114081">"Hata raporu (<xliff:g id="ID">#%d</xliff:g>) yakalandı"</string>
     <string name="bugreport_updating_title" msgid="4423539949559634214">"Hata raporuna ayrıntılar ekleniyor"</string>
     <string name="bugreport_updating_wait" msgid="3322151947853929470">"Lütfen bekleyin…"</string>
-    <string name="bugreport_finished_text" product="watch" msgid="8389172248433597683">"Hata raporunuzu paylaşmak için hızlıca sola kaydırın"</string>
+    <string name="bugreport_finished_text" product="watch" msgid="1223616207145252689">"Hata raporu kısa süre içinde telefonda görüntülenecektir"</string>
     <string name="bugreport_finished_text" product="default" msgid="8353769438382138847">"Hata raporunuzu paylaşmak için hafifçe dokunun"</string>
     <string name="bugreport_finished_pending_screenshot_text" product="watch" msgid="1474435374470177193">"Hata raporunu ekran görüntüsüz paylaşmak için dokunun veya bitirmek için ekran görüntüsünü bekleyin"</string>
     <string name="bugreport_finished_pending_screenshot_text" product="default" msgid="1474435374470177193">"Hata raporunu ekran görüntüsüz paylaşmak için dokunun veya bitirmek için ekran görüntüsünü bekleyin"</string>
diff --git a/packages/Shell/res/values-uk/strings.xml b/packages/Shell/res/values-uk/strings.xml
index 919a2b5..3bb101f 100644
--- a/packages/Shell/res/values-uk/strings.xml
+++ b/packages/Shell/res/values-uk/strings.xml
@@ -21,7 +21,7 @@
     <string name="bugreport_finished_title" msgid="4429132808670114081">"Повідомлення про помилку <xliff:g id="ID">#%d</xliff:g> створено"</string>
     <string name="bugreport_updating_title" msgid="4423539949559634214">"Додаються деталі до повідомлення про помилку"</string>
     <string name="bugreport_updating_wait" msgid="3322151947853929470">"Зачекайте…"</string>
-    <string name="bugreport_finished_text" product="watch" msgid="8389172248433597683">"Проведіть пальцем ліворуч, щоб надіслати звіт про помилки"</string>
+    <string name="bugreport_finished_text" product="watch" msgid="1223616207145252689">"Звіт про помилку невдовзі з’явиться на телефоні"</string>
     <string name="bugreport_finished_text" product="default" msgid="8353769438382138847">"Торкніться, щоб надіслати повідомлення про помилку"</string>
     <string name="bugreport_finished_pending_screenshot_text" product="watch" msgid="1474435374470177193">"Торкніться, щоб надіслати повідомлення про помилку без знімка екрана або зачекайте на знімок"</string>
     <string name="bugreport_finished_pending_screenshot_text" product="default" msgid="1474435374470177193">"Торкніться, щоб надіслати повідомлення про помилку без знімка екрана або зачекайте на знімок"</string>
diff --git a/packages/Shell/res/values-ur-rPK/strings.xml b/packages/Shell/res/values-ur-rPK/strings.xml
index d97a693..3f85bf4 100644
--- a/packages/Shell/res/values-ur-rPK/strings.xml
+++ b/packages/Shell/res/values-ur-rPK/strings.xml
@@ -21,7 +21,7 @@
     <string name="bugreport_finished_title" msgid="4429132808670114081">"بگ رپورٹ <xliff:g id="ID">#%d</xliff:g> کیپچر ہو گئی"</string>
     <string name="bugreport_updating_title" msgid="4423539949559634214">"بگ رپورٹ میں تفصیلات شامل کی جا رہی ہیں"</string>
     <string name="bugreport_updating_wait" msgid="3322151947853929470">"براہ کرم انتظار کریں…"</string>
-    <string name="bugreport_finished_text" product="watch" msgid="8389172248433597683">"اپنی بگ رپورٹ کا اشتراک کرنے کیلئے بائیں سوائپ کریں"</string>
+    <string name="bugreport_finished_text" product="watch" msgid="1223616207145252689">"بگ رپورٹ فون پر تھوڑی دیر میں ظاہر ہوگی"</string>
     <string name="bugreport_finished_text" product="default" msgid="8353769438382138847">"اپنی بگ رپورٹ کا اشتراک کرنے کیلئے تھپتھپائیں"</string>
     <string name="bugreport_finished_pending_screenshot_text" product="watch" msgid="1474435374470177193">"بغیر اسکرین شاٹ کے بگ رپورٹ کا اشتراک کرنے کیلئے تھپتھپائیں یا اسکرین شاٹ کے ختم ہونے کا انتظار کریں"</string>
     <string name="bugreport_finished_pending_screenshot_text" product="default" msgid="1474435374470177193">"بغیر اسکرین شاٹ کے بگ رپورٹ کا اشتراک کرنے کیلئے تھپتھپائیں یا اسکرین شاٹ کے ختم ہونے کا انتظار کریں"</string>
diff --git a/packages/Shell/res/values-uz-rUZ/strings.xml b/packages/Shell/res/values-uz-rUZ/strings.xml
index 605fc12..0738ece 100644
--- a/packages/Shell/res/values-uz-rUZ/strings.xml
+++ b/packages/Shell/res/values-uz-rUZ/strings.xml
@@ -21,7 +21,7 @@
     <string name="bugreport_finished_title" msgid="4429132808670114081">"Xatoliklar hisoboti (<xliff:g id="ID">#%d</xliff:g>) yozib olindi"</string>
     <string name="bugreport_updating_title" msgid="4423539949559634214">"Xatoliklar hisobotiga tafsilotlar qo‘shilmoqda"</string>
     <string name="bugreport_updating_wait" msgid="3322151947853929470">"Iltimos, kuting…"</string>
-    <string name="bugreport_finished_text" product="watch" msgid="8389172248433597683">"Xatolik hisobotini yuborish uchun barmog‘ingiz bilan chapga suring"</string>
+    <string name="bugreport_finished_text" product="watch" msgid="1223616207145252689">"Xatoliklar hisoboti tez orada telefonda paydo bo‘ladi"</string>
     <string name="bugreport_finished_text" product="default" msgid="8353769438382138847">"Xatoliklar hisobotini ulashish uchun bosing"</string>
     <string name="bugreport_finished_pending_screenshot_text" product="watch" msgid="1474435374470177193">"Xatoliklar hisobotini darhol yuborish uchun shu yerga bosing yoki skrinshot saqlanguncha kuting"</string>
     <string name="bugreport_finished_pending_screenshot_text" product="default" msgid="1474435374470177193">"Xatoliklar hisobotini darhol yuborish uchun shu yerga bosing yoki skrinshot saqlanguncha kuting"</string>
diff --git a/packages/Shell/res/values-vi/strings.xml b/packages/Shell/res/values-vi/strings.xml
index e9b5a9d..f988801 100644
--- a/packages/Shell/res/values-vi/strings.xml
+++ b/packages/Shell/res/values-vi/strings.xml
@@ -21,7 +21,7 @@
     <string name="bugreport_finished_title" msgid="4429132808670114081">"Đã chụp báo cáo lỗi <xliff:g id="ID">#%d</xliff:g>"</string>
     <string name="bugreport_updating_title" msgid="4423539949559634214">"Đang thêm thông tin chi tiết vào báo cáo lỗi"</string>
     <string name="bugreport_updating_wait" msgid="3322151947853929470">"Vui lòng đợi…"</string>
-    <string name="bugreport_finished_text" product="watch" msgid="8389172248433597683">"Vuốt sang trái để chia sẻ báo cáo lỗi của bạn"</string>
+    <string name="bugreport_finished_text" product="watch" msgid="1223616207145252689">"Báo cáo lỗi sẽ xuất hiện ngay trên điện thoại"</string>
     <string name="bugreport_finished_text" product="default" msgid="8353769438382138847">"Nhấn để chia sẻ báo cáo lỗi của bạn"</string>
     <string name="bugreport_finished_pending_screenshot_text" product="watch" msgid="1474435374470177193">"Bấm để chia sẻ báo cáo lỗi mà không cần ảnh chụp màn hình hoặc đợi hoàn tất ảnh chụp màn hình"</string>
     <string name="bugreport_finished_pending_screenshot_text" product="default" msgid="1474435374470177193">"Bấm để chia sẻ báo cáo lỗi mà không cần ảnh chụp màn hình hoặc đợi hoàn tất ảnh chụp màn hình"</string>
diff --git a/packages/Shell/res/values-zh-rCN/strings.xml b/packages/Shell/res/values-zh-rCN/strings.xml
index 4538868..a42534c 100644
--- a/packages/Shell/res/values-zh-rCN/strings.xml
+++ b/packages/Shell/res/values-zh-rCN/strings.xml
@@ -21,7 +21,7 @@
     <string name="bugreport_finished_title" msgid="4429132808670114081">"已获取错误报告 <xliff:g id="ID">#%d</xliff:g>"</string>
     <string name="bugreport_updating_title" msgid="4423539949559634214">"正在向错误报告添加详细信息"</string>
     <string name="bugreport_updating_wait" msgid="3322151947853929470">"请稍候…"</string>
-    <string name="bugreport_finished_text" product="watch" msgid="8389172248433597683">"向左滑动即可分享错误报告"</string>
+    <string name="bugreport_finished_text" product="watch" msgid="1223616207145252689">"错误报告将很快显示在手机上"</string>
     <string name="bugreport_finished_text" product="default" msgid="8353769438382138847">"点按即可分享您的错误报告"</string>
     <string name="bugreport_finished_pending_screenshot_text" product="watch" msgid="1474435374470177193">"点按即可分享不含屏幕截图的错误报告;您也可以等待屏幕截图完成"</string>
     <string name="bugreport_finished_pending_screenshot_text" product="default" msgid="1474435374470177193">"点按即可分享不含屏幕截图的错误报告;您也可以等待屏幕截图完成"</string>
diff --git a/packages/Shell/res/values-zh-rHK/strings.xml b/packages/Shell/res/values-zh-rHK/strings.xml
index 8433d22..6004621 100644
--- a/packages/Shell/res/values-zh-rHK/strings.xml
+++ b/packages/Shell/res/values-zh-rHK/strings.xml
@@ -21,7 +21,7 @@
     <string name="bugreport_finished_title" msgid="4429132808670114081">"已擷取錯誤報告 <xliff:g id="ID">#%d</xliff:g>"</string>
     <string name="bugreport_updating_title" msgid="4423539949559634214">"正在新增錯誤報告詳細資訊"</string>
     <string name="bugreport_updating_wait" msgid="3322151947853929470">"請稍候…"</string>
-    <string name="bugreport_finished_text" product="watch" msgid="8389172248433597683">"向左滑動即可分享錯誤報告"</string>
+    <string name="bugreport_finished_text" product="watch" msgid="1223616207145252689">"錯誤報告即將在手機上顯示"</string>
     <string name="bugreport_finished_text" product="default" msgid="8353769438382138847">"輕按即可分享錯誤報告"</string>
     <string name="bugreport_finished_pending_screenshot_text" product="watch" msgid="1474435374470177193">"輕按以分享錯誤報告 (不包含螢幕擷圖),或等待螢幕畫面擷取完成"</string>
     <string name="bugreport_finished_pending_screenshot_text" product="default" msgid="1474435374470177193">"輕按以分享錯誤報告 (不包含螢幕擷圖),或等待螢幕畫面擷取完成"</string>
diff --git a/packages/Shell/res/values-zh-rTW/strings.xml b/packages/Shell/res/values-zh-rTW/strings.xml
index 85dde84..1b7bee3 100644
--- a/packages/Shell/res/values-zh-rTW/strings.xml
+++ b/packages/Shell/res/values-zh-rTW/strings.xml
@@ -21,7 +21,7 @@
     <string name="bugreport_finished_title" msgid="4429132808670114081">"已擷取錯誤報告 <xliff:g id="ID">#%d</xliff:g>"</string>
     <string name="bugreport_updating_title" msgid="4423539949559634214">"正在新增錯誤報告詳細資訊"</string>
     <string name="bugreport_updating_wait" msgid="3322151947853929470">"請稍候…"</string>
-    <string name="bugreport_finished_text" product="watch" msgid="8389172248433597683">"向左滑動即可分享錯誤報告"</string>
+    <string name="bugreport_finished_text" product="watch" msgid="1223616207145252689">"系統即將在手機上顯示錯誤報告"</string>
     <string name="bugreport_finished_text" product="default" msgid="8353769438382138847">"輕觸即可分享錯誤報告"</string>
     <string name="bugreport_finished_pending_screenshot_text" product="watch" msgid="1474435374470177193">"輕觸即可分享無螢幕擷圖的錯誤報告;您也可以等候螢幕畫面擷取完畢"</string>
     <string name="bugreport_finished_pending_screenshot_text" product="default" msgid="1474435374470177193">"輕觸即可分享無螢幕擷圖的錯誤報告;您也可以等候螢幕畫面擷取完畢"</string>
diff --git a/packages/Shell/res/values-zu/strings.xml b/packages/Shell/res/values-zu/strings.xml
index a12a2b7..c1165ea 100644
--- a/packages/Shell/res/values-zu/strings.xml
+++ b/packages/Shell/res/values-zu/strings.xml
@@ -21,7 +21,7 @@
     <string name="bugreport_finished_title" msgid="4429132808670114081">"Umbiko wesiphazamisi ongu-<xliff:g id="ID">#%d</xliff:g> uthwetshuliwe"</string>
     <string name="bugreport_updating_title" msgid="4423539949559634214">"Ingeza imininingwane kumbiko wesiphazamisi"</string>
     <string name="bugreport_updating_wait" msgid="3322151947853929470">"Sicela ulinde..."</string>
-    <string name="bugreport_finished_text" product="watch" msgid="8389172248433597683">"Swayiphela kwesokunxele ukuze wabelane umbiko wesiphazamiso sakho"</string>
+    <string name="bugreport_finished_text" product="watch" msgid="1223616207145252689">"Umbiko wesiphazamisi uzobonakala efonini maduze"</string>
     <string name="bugreport_finished_text" product="default" msgid="8353769438382138847">"Thepha ukuze wabelane ngombiko wakho wesiphazamisi"</string>
     <string name="bugreport_finished_pending_screenshot_text" product="watch" msgid="1474435374470177193">"Thepha ukuze wabelane ngombiko wesiphazamisi ngaphandle kwesithombe-skrini noma ulinde isithombe-skrini ukuthi siqede"</string>
     <string name="bugreport_finished_pending_screenshot_text" product="default" msgid="1474435374470177193">"Thepha ukuze wabelane ngombiko wesiphazamisi ngaphandle kwesithombe-skrini noma ulinde isithombe-skrini ukuthi siqede"</string>
diff --git a/packages/SystemUI/AndroidManifest.xml b/packages/SystemUI/AndroidManifest.xml
index 36fbb6a..c0a34ae 100644
--- a/packages/SystemUI/AndroidManifest.xml
+++ b/packages/SystemUI/AndroidManifest.xml
@@ -391,7 +391,7 @@
             android:theme="@style/PipTheme"
             android:launchMode="singleTop"
             android:taskAffinity=""
-            android:configChanges="screenSize|smallestScreenSize|screenLayout|orientation"
+            android:configChanges="screenSize|smallestScreenSize|screenLayout|orientation|locale|layoutDirection"
             android:resizeableActivity="true"
             android:supportsPictureInPicture="true"
             androidprv:alwaysFocusable="true"
@@ -401,7 +401,7 @@
             android:exported="true"
             android:theme="@style/PipTheme"
             android:taskAffinity=""
-            android:configChanges="screenSize|smallestScreenSize|screenLayout|orientation"
+            android:configChanges="screenSize|smallestScreenSize|screenLayout|orientation|locale|layoutDirection"
             android:resizeableActivity="true"
             android:supportsPictureInPicture="true"
             android:excludeFromRecents="true" />
diff --git a/packages/SystemUI/res/values-az-rAZ/strings.xml b/packages/SystemUI/res/values-az-rAZ/strings.xml
index b32035a..34f743c 100644
--- a/packages/SystemUI/res/values-az-rAZ/strings.xml
+++ b/packages/SystemUI/res/values-az-rAZ/strings.xml
@@ -145,8 +145,7 @@
     <string name="accessibility_data_connection_4g" msgid="7741000750630089612">"4G"</string>
     <string name="accessibility_data_connection_4g_plus" msgid="3032226872470658661">"4G+"</string>
     <string name="accessibility_data_connection_lte" msgid="5413468808637540658">"LTE"</string>
-    <!-- no translation found for accessibility_data_connection_lte_plus (361876866906946007) -->
-    <skip />
+    <string name="accessibility_data_connection_lte_plus" msgid="361876866906946007">"LTE+"</string>
     <string name="accessibility_data_connection_cdma" msgid="6132648193978823023">"CDMA"</string>
     <string name="accessibility_data_connection_roaming" msgid="5977362333466556094">"Rominq"</string>
     <string name="accessibility_data_connection_edge" msgid="4477457051631979278">"Edge"</string>
@@ -319,12 +318,9 @@
     <string name="quick_settings_cellular_detail_data_limit" msgid="56011158504994128">"<xliff:g id="DATA_LIMIT">%s</xliff:g> limit"</string>
     <string name="quick_settings_cellular_detail_data_warning" msgid="2440098045692399009">"<xliff:g id="DATA_LIMIT">%s</xliff:g> xəbərdarlığı"</string>
     <string name="quick_settings_work_mode_label" msgid="6244915274350490429">"İş rejimi"</string>
-    <!-- no translation found for quick_settings_night_display_label (3577098011487644395) -->
-    <skip />
-    <!-- no translation found for quick_settings_night_display_summary_on (1814901757887526769) -->
-    <skip />
-    <!-- no translation found for quick_settings_night_display_summary_off (7892102914128777905) -->
-    <skip />
+    <string name="quick_settings_night_display_label" msgid="3577098011487644395">"Gecə işığı"</string>
+    <string name="quick_settings_night_display_summary_on" msgid="1814901757887526769">"Gecə işığı aktivdir, deaktiv etmək üçün tıklayın"</string>
+    <string name="quick_settings_night_display_summary_off" msgid="7892102914128777905">"Gecə işığı deaktivdir, aktiv etmək üçün tıklayın"</string>
     <string name="recents_empty_message" msgid="808480104164008572">"Son elementlər yoxdur"</string>
     <string name="recents_empty_message_dismissed_all" msgid="2791312568666558651">"Hərşeyi təmizlədiniz"</string>
     <string name="recents_app_info_button_label" msgid="2890317189376000030">"Tətbiq haqqında"</string>
diff --git a/packages/SystemUI/res/values-b+sr+Latn/strings.xml b/packages/SystemUI/res/values-b+sr+Latn/strings.xml
index 2438ed7..6ee38e8 100644
--- a/packages/SystemUI/res/values-b+sr+Latn/strings.xml
+++ b/packages/SystemUI/res/values-b+sr+Latn/strings.xml
@@ -146,8 +146,7 @@
     <string name="accessibility_data_connection_4g" msgid="7741000750630089612">"4G"</string>
     <string name="accessibility_data_connection_4g_plus" msgid="3032226872470658661">"4G+"</string>
     <string name="accessibility_data_connection_lte" msgid="5413468808637540658">"LTE"</string>
-    <!-- no translation found for accessibility_data_connection_lte_plus (361876866906946007) -->
-    <skip />
+    <string name="accessibility_data_connection_lte_plus" msgid="361876866906946007">"LTE+"</string>
     <string name="accessibility_data_connection_cdma" msgid="6132648193978823023">"CDMA"</string>
     <string name="accessibility_data_connection_roaming" msgid="5977362333466556094">"Roming"</string>
     <string name="accessibility_data_connection_edge" msgid="4477457051631979278">"Edge"</string>
@@ -321,12 +320,9 @@
     <string name="quick_settings_cellular_detail_data_limit" msgid="56011158504994128">"Ograničenje od <xliff:g id="DATA_LIMIT">%s</xliff:g>"</string>
     <string name="quick_settings_cellular_detail_data_warning" msgid="2440098045692399009">"Upozorenje za <xliff:g id="DATA_LIMIT">%s</xliff:g>"</string>
     <string name="quick_settings_work_mode_label" msgid="6244915274350490429">"Režim rada"</string>
-    <!-- no translation found for quick_settings_night_display_label (3577098011487644395) -->
-    <skip />
-    <!-- no translation found for quick_settings_night_display_summary_on (1814901757887526769) -->
-    <skip />
-    <!-- no translation found for quick_settings_night_display_summary_off (7892102914128777905) -->
-    <skip />
+    <string name="quick_settings_night_display_label" msgid="3577098011487644395">"Noćno svetlo"</string>
+    <string name="quick_settings_night_display_summary_on" msgid="1814901757887526769">"Noćno svetlo je uključeno, dodirnite da biste ga isključili"</string>
+    <string name="quick_settings_night_display_summary_off" msgid="7892102914128777905">"Noćno svetlo je isključeno, dodirnite da biste ga uključili"</string>
     <string name="recents_empty_message" msgid="808480104164008572">"Nema nedavnih stavki"</string>
     <string name="recents_empty_message_dismissed_all" msgid="2791312568666558651">"Obrisali ste sve"</string>
     <string name="recents_app_info_button_label" msgid="2890317189376000030">"Informacije o aplikaciji"</string>
diff --git a/packages/SystemUI/res/values-bg/strings.xml b/packages/SystemUI/res/values-bg/strings.xml
index 315d68d..6939f06 100644
--- a/packages/SystemUI/res/values-bg/strings.xml
+++ b/packages/SystemUI/res/values-bg/strings.xml
@@ -145,8 +145,7 @@
     <string name="accessibility_data_connection_4g" msgid="7741000750630089612">"4G"</string>
     <string name="accessibility_data_connection_4g_plus" msgid="3032226872470658661">"4G+"</string>
     <string name="accessibility_data_connection_lte" msgid="5413468808637540658">"LTE"</string>
-    <!-- no translation found for accessibility_data_connection_lte_plus (361876866906946007) -->
-    <skip />
+    <string name="accessibility_data_connection_lte_plus" msgid="361876866906946007">"LTE+"</string>
     <string name="accessibility_data_connection_cdma" msgid="6132648193978823023">"CDMA"</string>
     <string name="accessibility_data_connection_roaming" msgid="5977362333466556094">"Роуминг"</string>
     <string name="accessibility_data_connection_edge" msgid="4477457051631979278">"Edge"</string>
@@ -319,12 +318,9 @@
     <string name="quick_settings_cellular_detail_data_limit" msgid="56011158504994128">"Ограничение от <xliff:g id="DATA_LIMIT">%s</xliff:g>"</string>
     <string name="quick_settings_cellular_detail_data_warning" msgid="2440098045692399009">"Предупреждение: <xliff:g id="DATA_LIMIT">%s</xliff:g>"</string>
     <string name="quick_settings_work_mode_label" msgid="6244915274350490429">"Работен режим"</string>
-    <!-- no translation found for quick_settings_night_display_label (3577098011487644395) -->
-    <skip />
-    <!-- no translation found for quick_settings_night_display_summary_on (1814901757887526769) -->
-    <skip />
-    <!-- no translation found for quick_settings_night_display_summary_off (7892102914128777905) -->
-    <skip />
+    <string name="quick_settings_night_display_label" msgid="3577098011487644395">"Нощно осветление"</string>
+    <string name="quick_settings_night_display_summary_on" msgid="1814901757887526769">"Функцията за нощно осветление е включена. Докоснете, за да я изключите"</string>
+    <string name="quick_settings_night_display_summary_off" msgid="7892102914128777905">"Функцията за нощно осветление е изключена. Докоснете, за да я включите"</string>
     <string name="recents_empty_message" msgid="808480104164008572">"Няма скорошни елементи"</string>
     <string name="recents_empty_message_dismissed_all" msgid="2791312568666558651">"Изчистихте всичко"</string>
     <string name="recents_app_info_button_label" msgid="2890317189376000030">"Информация за приложението"</string>
diff --git a/packages/SystemUI/res/values-bn-rBD/strings.xml b/packages/SystemUI/res/values-bn-rBD/strings.xml
index 20dc978..c074c31 100644
--- a/packages/SystemUI/res/values-bn-rBD/strings.xml
+++ b/packages/SystemUI/res/values-bn-rBD/strings.xml
@@ -145,8 +145,7 @@
     <string name="accessibility_data_connection_4g" msgid="7741000750630089612">"4G"</string>
     <string name="accessibility_data_connection_4g_plus" msgid="3032226872470658661">"4G+"</string>
     <string name="accessibility_data_connection_lte" msgid="5413468808637540658">"LTE"</string>
-    <!-- no translation found for accessibility_data_connection_lte_plus (361876866906946007) -->
-    <skip />
+    <string name="accessibility_data_connection_lte_plus" msgid="361876866906946007">"LTE+"</string>
     <string name="accessibility_data_connection_cdma" msgid="6132648193978823023">"CDMA"</string>
     <string name="accessibility_data_connection_roaming" msgid="5977362333466556094">"রোমিং"</string>
     <string name="accessibility_data_connection_edge" msgid="4477457051631979278">"Edge"</string>
@@ -319,12 +318,9 @@
     <string name="quick_settings_cellular_detail_data_limit" msgid="56011158504994128">"সীমা <xliff:g id="DATA_LIMIT">%s</xliff:g>"</string>
     <string name="quick_settings_cellular_detail_data_warning" msgid="2440098045692399009">"<xliff:g id="DATA_LIMIT">%s</xliff:g> সতর্কতা"</string>
     <string name="quick_settings_work_mode_label" msgid="6244915274350490429">"কাজের মোড"</string>
-    <!-- no translation found for quick_settings_night_display_label (3577098011487644395) -->
-    <skip />
-    <!-- no translation found for quick_settings_night_display_summary_on (1814901757887526769) -->
-    <skip />
-    <!-- no translation found for quick_settings_night_display_summary_off (7892102914128777905) -->
-    <skip />
+    <string name="quick_settings_night_display_label" msgid="3577098011487644395">"নাইট লাইট"</string>
+    <string name="quick_settings_night_display_summary_on" msgid="1814901757887526769">"নাইট লাইট চালু আছে, বন্ধ করতে আলতো চাপুন"</string>
+    <string name="quick_settings_night_display_summary_off" msgid="7892102914128777905">"নাইট লাইট বন্ধ আছে, চালু করতে আলতো চাপুন"</string>
     <string name="recents_empty_message" msgid="808480104164008572">"কোনো সাম্প্রতিক আইটেম নেই"</string>
     <string name="recents_empty_message_dismissed_all" msgid="2791312568666558651">"আপনি সবকিছু সাফ করেছেন"</string>
     <string name="recents_app_info_button_label" msgid="2890317189376000030">"অ্যাপ্লিকেশানের তথ্য"</string>
diff --git a/packages/SystemUI/res/values-bs-rBA/strings.xml b/packages/SystemUI/res/values-bs-rBA/strings.xml
index 3fc1738..c12aa13 100644
--- a/packages/SystemUI/res/values-bs-rBA/strings.xml
+++ b/packages/SystemUI/res/values-bs-rBA/strings.xml
@@ -146,8 +146,7 @@
     <string name="accessibility_data_connection_4g" msgid="7741000750630089612">"4G"</string>
     <string name="accessibility_data_connection_4g_plus" msgid="3032226872470658661">"4G+"</string>
     <string name="accessibility_data_connection_lte" msgid="5413468808637540658">"LTE"</string>
-    <!-- no translation found for accessibility_data_connection_lte_plus (361876866906946007) -->
-    <skip />
+    <string name="accessibility_data_connection_lte_plus" msgid="361876866906946007">"LTE+"</string>
     <string name="accessibility_data_connection_cdma" msgid="6132648193978823023">"CDMA"</string>
     <string name="accessibility_data_connection_roaming" msgid="5977362333466556094">"Roming"</string>
     <string name="accessibility_data_connection_edge" msgid="4477457051631979278">"Edge"</string>
@@ -321,12 +320,9 @@
     <string name="quick_settings_cellular_detail_data_limit" msgid="56011158504994128">"Ograničenje <xliff:g id="DATA_LIMIT">%s</xliff:g>"</string>
     <string name="quick_settings_cellular_detail_data_warning" msgid="2440098045692399009">"Upozorenje <xliff:g id="DATA_LIMIT">%s</xliff:g>"</string>
     <string name="quick_settings_work_mode_label" msgid="6244915274350490429">"Poslovni režim"</string>
-    <!-- no translation found for quick_settings_night_display_label (3577098011487644395) -->
-    <skip />
-    <!-- no translation found for quick_settings_night_display_summary_on (1814901757887526769) -->
-    <skip />
-    <!-- no translation found for quick_settings_night_display_summary_off (7892102914128777905) -->
-    <skip />
+    <string name="quick_settings_night_display_label" msgid="3577098011487644395">"Noćno svjetlo"</string>
+    <string name="quick_settings_night_display_summary_on" msgid="1814901757887526769">"Noćno svjetlo je uključeno, dodirnite da isključite"</string>
+    <string name="quick_settings_night_display_summary_off" msgid="7892102914128777905">"Noćno svjetlo je isključeno, dodirnite da uključite"</string>
     <string name="recents_empty_message" msgid="808480104164008572">"Nema nedavnih stavki"</string>
     <string name="recents_empty_message_dismissed_all" msgid="2791312568666558651">"Sve ste obrisali"</string>
     <string name="recents_app_info_button_label" msgid="2890317189376000030">"Informacije o aplikaciji"</string>
diff --git a/packages/SystemUI/res/values-ca/strings.xml b/packages/SystemUI/res/values-ca/strings.xml
index 1cb56a2..3720a89 100644
--- a/packages/SystemUI/res/values-ca/strings.xml
+++ b/packages/SystemUI/res/values-ca/strings.xml
@@ -145,8 +145,7 @@
     <string name="accessibility_data_connection_4g" msgid="7741000750630089612">"4G"</string>
     <string name="accessibility_data_connection_4g_plus" msgid="3032226872470658661">"4G+"</string>
     <string name="accessibility_data_connection_lte" msgid="5413468808637540658">"LTE"</string>
-    <!-- no translation found for accessibility_data_connection_lte_plus (361876866906946007) -->
-    <skip />
+    <string name="accessibility_data_connection_lte_plus" msgid="361876866906946007">"LTE+"</string>
     <string name="accessibility_data_connection_cdma" msgid="6132648193978823023">"CDMA"</string>
     <string name="accessibility_data_connection_roaming" msgid="5977362333466556094">"Itinerància"</string>
     <string name="accessibility_data_connection_edge" msgid="4477457051631979278">"Vora"</string>
@@ -319,12 +318,9 @@
     <string name="quick_settings_cellular_detail_data_limit" msgid="56011158504994128">"Límit: <xliff:g id="DATA_LIMIT">%s</xliff:g>"</string>
     <string name="quick_settings_cellular_detail_data_warning" msgid="2440098045692399009">"Advertiment: <xliff:g id="DATA_LIMIT">%s</xliff:g>"</string>
     <string name="quick_settings_work_mode_label" msgid="6244915274350490429">"Mode de feina"</string>
-    <!-- no translation found for quick_settings_night_display_label (3577098011487644395) -->
-    <skip />
-    <!-- no translation found for quick_settings_night_display_summary_on (1814901757887526769) -->
-    <skip />
-    <!-- no translation found for quick_settings_night_display_summary_off (7892102914128777905) -->
-    <skip />
+    <string name="quick_settings_night_display_label" msgid="3577098011487644395">"Llum nocturna"</string>
+    <string name="quick_settings_night_display_summary_on" msgid="1814901757887526769">"La llum nocturna està encesa; toca aquí per apagar-la"</string>
+    <string name="quick_settings_night_display_summary_off" msgid="7892102914128777905">"La llum nocturna està apagada; toca aquí per encendre-la"</string>
     <string name="recents_empty_message" msgid="808480104164008572">"No hi ha cap element recent"</string>
     <string name="recents_empty_message_dismissed_all" msgid="2791312568666558651">"Ho has esborrat tot"</string>
     <string name="recents_app_info_button_label" msgid="2890317189376000030">"Informació de l\'aplicació"</string>
diff --git a/packages/SystemUI/res/values-cs/strings.xml b/packages/SystemUI/res/values-cs/strings.xml
index a0696ba5..850c264 100644
--- a/packages/SystemUI/res/values-cs/strings.xml
+++ b/packages/SystemUI/res/values-cs/strings.xml
@@ -147,8 +147,7 @@
     <string name="accessibility_data_connection_4g" msgid="7741000750630089612">"4G"</string>
     <string name="accessibility_data_connection_4g_plus" msgid="3032226872470658661">"4G+"</string>
     <string name="accessibility_data_connection_lte" msgid="5413468808637540658">"LTE"</string>
-    <!-- no translation found for accessibility_data_connection_lte_plus (361876866906946007) -->
-    <skip />
+    <string name="accessibility_data_connection_lte_plus" msgid="361876866906946007">"LTE+"</string>
     <string name="accessibility_data_connection_cdma" msgid="6132648193978823023">"CDMA"</string>
     <string name="accessibility_data_connection_roaming" msgid="5977362333466556094">"Roaming"</string>
     <string name="accessibility_data_connection_edge" msgid="4477457051631979278">"Edge"</string>
@@ -325,12 +324,9 @@
     <string name="quick_settings_cellular_detail_data_limit" msgid="56011158504994128">"Limit: <xliff:g id="DATA_LIMIT">%s</xliff:g>"</string>
     <string name="quick_settings_cellular_detail_data_warning" msgid="2440098045692399009">"Upozornění při <xliff:g id="DATA_LIMIT">%s</xliff:g>"</string>
     <string name="quick_settings_work_mode_label" msgid="6244915274350490429">"Pracovní režim"</string>
-    <!-- no translation found for quick_settings_night_display_label (3577098011487644395) -->
-    <skip />
-    <!-- no translation found for quick_settings_night_display_summary_on (1814901757887526769) -->
-    <skip />
-    <!-- no translation found for quick_settings_night_display_summary_off (7892102914128777905) -->
-    <skip />
+    <string name="quick_settings_night_display_label" msgid="3577098011487644395">"Noční režim"</string>
+    <string name="quick_settings_night_display_summary_on" msgid="1814901757887526769">"Noční režim je zapnut, klepnutím jej vypnete"</string>
+    <string name="quick_settings_night_display_summary_off" msgid="7892102914128777905">"Noční režim je vypnut, klepnutím jej zapnete"</string>
     <string name="recents_empty_message" msgid="808480104164008572">"Žádné nedávné položky"</string>
     <string name="recents_empty_message_dismissed_all" msgid="2791312568666558651">"Vše je vymazáno"</string>
     <string name="recents_app_info_button_label" msgid="2890317189376000030">"Informace o aplikaci"</string>
diff --git a/packages/SystemUI/res/values-da/strings.xml b/packages/SystemUI/res/values-da/strings.xml
index 4729564..0415c08 100644
--- a/packages/SystemUI/res/values-da/strings.xml
+++ b/packages/SystemUI/res/values-da/strings.xml
@@ -145,8 +145,7 @@
     <string name="accessibility_data_connection_4g" msgid="7741000750630089612">"4G"</string>
     <string name="accessibility_data_connection_4g_plus" msgid="3032226872470658661">"Over 4G"</string>
     <string name="accessibility_data_connection_lte" msgid="5413468808637540658">"LTE"</string>
-    <!-- no translation found for accessibility_data_connection_lte_plus (361876866906946007) -->
-    <skip />
+    <string name="accessibility_data_connection_lte_plus" msgid="361876866906946007">"LTE+"</string>
     <string name="accessibility_data_connection_cdma" msgid="6132648193978823023">"CDMA"</string>
     <string name="accessibility_data_connection_roaming" msgid="5977362333466556094">"Roaming"</string>
     <string name="accessibility_data_connection_edge" msgid="4477457051631979278">"Edge"</string>
@@ -319,12 +318,9 @@
     <string name="quick_settings_cellular_detail_data_limit" msgid="56011158504994128">"Grænse: <xliff:g id="DATA_LIMIT">%s</xliff:g>"</string>
     <string name="quick_settings_cellular_detail_data_warning" msgid="2440098045692399009">"Advarsel ved <xliff:g id="DATA_LIMIT">%s</xliff:g>"</string>
     <string name="quick_settings_work_mode_label" msgid="6244915274350490429">"Arbejdstilstand"</string>
-    <!-- no translation found for quick_settings_night_display_label (3577098011487644395) -->
-    <skip />
-    <!-- no translation found for quick_settings_night_display_summary_on (1814901757887526769) -->
-    <skip />
-    <!-- no translation found for quick_settings_night_display_summary_off (7892102914128777905) -->
-    <skip />
+    <string name="quick_settings_night_display_label" msgid="3577098011487644395">"Nattelys"</string>
+    <string name="quick_settings_night_display_summary_on" msgid="1814901757887526769">"Nattelys er tændt. Tryk for at slukke"</string>
+    <string name="quick_settings_night_display_summary_off" msgid="7892102914128777905">"Nattelys er slukket. Tryk for at tænde"</string>
     <string name="recents_empty_message" msgid="808480104164008572">"Ingen nye elementer"</string>
     <string name="recents_empty_message_dismissed_all" msgid="2791312568666558651">"Du har ryddet alt"</string>
     <string name="recents_app_info_button_label" msgid="2890317189376000030">"Oplysninger om applikationen"</string>
diff --git a/packages/SystemUI/res/values-de/strings.xml b/packages/SystemUI/res/values-de/strings.xml
index acddb06..9dfda70 100644
--- a/packages/SystemUI/res/values-de/strings.xml
+++ b/packages/SystemUI/res/values-de/strings.xml
@@ -145,8 +145,7 @@
     <string name="accessibility_data_connection_4g" msgid="7741000750630089612">"4G"</string>
     <string name="accessibility_data_connection_4g_plus" msgid="3032226872470658661">"4G+"</string>
     <string name="accessibility_data_connection_lte" msgid="5413468808637540658">"LTE"</string>
-    <!-- no translation found for accessibility_data_connection_lte_plus (361876866906946007) -->
-    <skip />
+    <string name="accessibility_data_connection_lte_plus" msgid="361876866906946007">"LTE+"</string>
     <string name="accessibility_data_connection_cdma" msgid="6132648193978823023">"CDMA"</string>
     <string name="accessibility_data_connection_roaming" msgid="5977362333466556094">"Roaming"</string>
     <string name="accessibility_data_connection_edge" msgid="4477457051631979278">"Edge"</string>
@@ -321,12 +320,9 @@
     <string name="quick_settings_cellular_detail_data_limit" msgid="56011158504994128">"<xliff:g id="DATA_LIMIT">%s</xliff:g> Datenlimit"</string>
     <string name="quick_settings_cellular_detail_data_warning" msgid="2440098045692399009">"Warnung für <xliff:g id="DATA_LIMIT">%s</xliff:g>"</string>
     <string name="quick_settings_work_mode_label" msgid="6244915274350490429">"Arbeitsmodus"</string>
-    <!-- no translation found for quick_settings_night_display_label (3577098011487644395) -->
-    <skip />
-    <!-- no translation found for quick_settings_night_display_summary_on (1814901757887526769) -->
-    <skip />
-    <!-- no translation found for quick_settings_night_display_summary_off (7892102914128777905) -->
-    <skip />
+    <string name="quick_settings_night_display_label" msgid="3577098011487644395">"Nachtlicht"</string>
+    <string name="quick_settings_night_display_summary_on" msgid="1814901757887526769">"Nachtlicht an, zum Deaktivieren tippen"</string>
+    <string name="quick_settings_night_display_summary_off" msgid="7892102914128777905">"Nachtlicht aus, zum Aktivieren tippen"</string>
     <string name="recents_empty_message" msgid="808480104164008572">"Keine kürzlich verwendeten Elemente"</string>
     <string name="recents_empty_message_dismissed_all" msgid="2791312568666558651">"Du hast alles gelöscht"</string>
     <string name="recents_app_info_button_label" msgid="2890317189376000030">"App-Info"</string>
diff --git a/packages/SystemUI/res/values-el/strings.xml b/packages/SystemUI/res/values-el/strings.xml
index d4f3591..3b66b59 100644
--- a/packages/SystemUI/res/values-el/strings.xml
+++ b/packages/SystemUI/res/values-el/strings.xml
@@ -145,8 +145,7 @@
     <string name="accessibility_data_connection_4g" msgid="7741000750630089612">"4G"</string>
     <string name="accessibility_data_connection_4g_plus" msgid="3032226872470658661">"4G+"</string>
     <string name="accessibility_data_connection_lte" msgid="5413468808637540658">"LTE"</string>
-    <!-- no translation found for accessibility_data_connection_lte_plus (361876866906946007) -->
-    <skip />
+    <string name="accessibility_data_connection_lte_plus" msgid="361876866906946007">"LTE+"</string>
     <string name="accessibility_data_connection_cdma" msgid="6132648193978823023">"CDMA"</string>
     <string name="accessibility_data_connection_roaming" msgid="5977362333466556094">"Περιαγωγή"</string>
     <string name="accessibility_data_connection_edge" msgid="4477457051631979278">"Edge"</string>
@@ -319,12 +318,9 @@
     <string name="quick_settings_cellular_detail_data_limit" msgid="56011158504994128">"Όριο <xliff:g id="DATA_LIMIT">%s</xliff:g>"</string>
     <string name="quick_settings_cellular_detail_data_warning" msgid="2440098045692399009">"Προειδοποίηση για <xliff:g id="DATA_LIMIT">%s</xliff:g>"</string>
     <string name="quick_settings_work_mode_label" msgid="6244915274350490429">"Λειτουργία εργασίας"</string>
-    <!-- no translation found for quick_settings_night_display_label (3577098011487644395) -->
-    <skip />
-    <!-- no translation found for quick_settings_night_display_summary_on (1814901757887526769) -->
-    <skip />
-    <!-- no translation found for quick_settings_night_display_summary_off (7892102914128777905) -->
-    <skip />
+    <string name="quick_settings_night_display_label" msgid="3577098011487644395">"Νυχτερινός φωτισμός"</string>
+    <string name="quick_settings_night_display_summary_on" msgid="1814901757887526769">"Ο Νυχτερινός φωτισμός είναι ενεργοποιημένος. Πατήστε για απενεργοποίηση."</string>
+    <string name="quick_settings_night_display_summary_off" msgid="7892102914128777905">"Ο Νυχτερινός φωτισμός είναι απενεργοποιημένος. Πατήστε για ενεργοποίηση."</string>
     <string name="recents_empty_message" msgid="808480104164008572">"Δεν υπάρχουν πρόσφατα στοιχεία"</string>
     <string name="recents_empty_message_dismissed_all" msgid="2791312568666558651">"Έχει γίνει εκκαθάριση όλων των στοιχείων"</string>
     <string name="recents_app_info_button_label" msgid="2890317189376000030">"Πληροφορίες εφαρμογής"</string>
diff --git a/packages/SystemUI/res/values-es-rUS/strings.xml b/packages/SystemUI/res/values-es-rUS/strings.xml
index 1991679..3b985e3 100644
--- a/packages/SystemUI/res/values-es-rUS/strings.xml
+++ b/packages/SystemUI/res/values-es-rUS/strings.xml
@@ -145,8 +145,7 @@
     <string name="accessibility_data_connection_4g" msgid="7741000750630089612">"4G"</string>
     <string name="accessibility_data_connection_4g_plus" msgid="3032226872470658661">"4G+"</string>
     <string name="accessibility_data_connection_lte" msgid="5413468808637540658">"LTE"</string>
-    <!-- no translation found for accessibility_data_connection_lte_plus (361876866906946007) -->
-    <skip />
+    <string name="accessibility_data_connection_lte_plus" msgid="361876866906946007">"LTE+"</string>
     <string name="accessibility_data_connection_cdma" msgid="6132648193978823023">"CDMA"</string>
     <string name="accessibility_data_connection_roaming" msgid="5977362333466556094">"Roaming"</string>
     <string name="accessibility_data_connection_edge" msgid="4477457051631979278">"Edge"</string>
@@ -321,12 +320,9 @@
     <string name="quick_settings_cellular_detail_data_limit" msgid="56011158504994128">"Límite de <xliff:g id="DATA_LIMIT">%s</xliff:g>"</string>
     <string name="quick_settings_cellular_detail_data_warning" msgid="2440098045692399009">"Advertencia de <xliff:g id="DATA_LIMIT">%s</xliff:g>"</string>
     <string name="quick_settings_work_mode_label" msgid="6244915274350490429">"Modo de trabajo"</string>
-    <!-- no translation found for quick_settings_night_display_label (3577098011487644395) -->
-    <skip />
-    <!-- no translation found for quick_settings_night_display_summary_on (1814901757887526769) -->
-    <skip />
-    <!-- no translation found for quick_settings_night_display_summary_off (7892102914128777905) -->
-    <skip />
+    <string name="quick_settings_night_display_label" msgid="3577098011487644395">"Luz nocturna"</string>
+    <string name="quick_settings_night_display_summary_on" msgid="1814901757887526769">"Presiona para desactivar la Luz nocturna"</string>
+    <string name="quick_settings_night_display_summary_off" msgid="7892102914128777905">"Presiona para activar la Luz nocturna"</string>
     <string name="recents_empty_message" msgid="808480104164008572">"No hay elementos recientes"</string>
     <string name="recents_empty_message_dismissed_all" msgid="2791312568666558651">"Todo borrado"</string>
     <string name="recents_app_info_button_label" msgid="2890317189376000030">"Información de la aplicación"</string>
diff --git a/packages/SystemUI/res/values-es/strings.xml b/packages/SystemUI/res/values-es/strings.xml
index e727f59..bc6c071 100644
--- a/packages/SystemUI/res/values-es/strings.xml
+++ b/packages/SystemUI/res/values-es/strings.xml
@@ -145,8 +145,7 @@
     <string name="accessibility_data_connection_4g" msgid="7741000750630089612">"4G"</string>
     <string name="accessibility_data_connection_4g_plus" msgid="3032226872470658661">"4G+"</string>
     <string name="accessibility_data_connection_lte" msgid="5413468808637540658">"LTE"</string>
-    <!-- no translation found for accessibility_data_connection_lte_plus (361876866906946007) -->
-    <skip />
+    <string name="accessibility_data_connection_lte_plus" msgid="361876866906946007">"LTE+"</string>
     <string name="accessibility_data_connection_cdma" msgid="6132648193978823023">"CDMA"</string>
     <string name="accessibility_data_connection_roaming" msgid="5977362333466556094">"Itinerancia"</string>
     <string name="accessibility_data_connection_edge" msgid="4477457051631979278">"Tipo Edge"</string>
@@ -321,12 +320,9 @@
     <string name="quick_settings_cellular_detail_data_limit" msgid="56011158504994128">"Límite de <xliff:g id="DATA_LIMIT">%s</xliff:g>"</string>
     <string name="quick_settings_cellular_detail_data_warning" msgid="2440098045692399009">"Advertencia de <xliff:g id="DATA_LIMIT">%s</xliff:g>"</string>
     <string name="quick_settings_work_mode_label" msgid="6244915274350490429">"Modo de trabajo"</string>
-    <!-- no translation found for quick_settings_night_display_label (3577098011487644395) -->
-    <skip />
-    <!-- no translation found for quick_settings_night_display_summary_on (1814901757887526769) -->
-    <skip />
-    <!-- no translation found for quick_settings_night_display_summary_off (7892102914128777905) -->
-    <skip />
+    <string name="quick_settings_night_display_label" msgid="3577098011487644395">"Luz nocturna"</string>
+    <string name="quick_settings_night_display_summary_on" msgid="1814901757887526769">"Luz nocturna activada; toca aquí para desactivarla"</string>
+    <string name="quick_settings_night_display_summary_off" msgid="7892102914128777905">"Luz nocturna desactivada; toca aquí para activarla"</string>
     <string name="recents_empty_message" msgid="808480104164008572">"No hay elementos recientes"</string>
     <string name="recents_empty_message_dismissed_all" msgid="2791312568666558651">"Has rechazado todo"</string>
     <string name="recents_app_info_button_label" msgid="2890317189376000030">"Información de la aplicación"</string>
diff --git a/packages/SystemUI/res/values-et-rEE/strings.xml b/packages/SystemUI/res/values-et-rEE/strings.xml
index ebb2e41..ca605d4 100644
--- a/packages/SystemUI/res/values-et-rEE/strings.xml
+++ b/packages/SystemUI/res/values-et-rEE/strings.xml
@@ -145,8 +145,7 @@
     <string name="accessibility_data_connection_4g" msgid="7741000750630089612">"4G"</string>
     <string name="accessibility_data_connection_4g_plus" msgid="3032226872470658661">"4G+"</string>
     <string name="accessibility_data_connection_lte" msgid="5413468808637540658">"LTE"</string>
-    <!-- no translation found for accessibility_data_connection_lte_plus (361876866906946007) -->
-    <skip />
+    <string name="accessibility_data_connection_lte_plus" msgid="361876866906946007">"LTE+"</string>
     <string name="accessibility_data_connection_cdma" msgid="6132648193978823023">"CDMA"</string>
     <string name="accessibility_data_connection_roaming" msgid="5977362333466556094">"Rändlus"</string>
     <string name="accessibility_data_connection_edge" msgid="4477457051631979278">"Serv"</string>
@@ -321,12 +320,9 @@
     <string name="quick_settings_cellular_detail_data_limit" msgid="56011158504994128">"Limiit: <xliff:g id="DATA_LIMIT">%s</xliff:g>"</string>
     <string name="quick_settings_cellular_detail_data_warning" msgid="2440098045692399009">"<xliff:g id="DATA_LIMIT">%s</xliff:g> hoiatus"</string>
     <string name="quick_settings_work_mode_label" msgid="6244915274350490429">"Töörežiim"</string>
-    <!-- no translation found for quick_settings_night_display_label (3577098011487644395) -->
-    <skip />
-    <!-- no translation found for quick_settings_night_display_summary_on (1814901757887526769) -->
-    <skip />
-    <!-- no translation found for quick_settings_night_display_summary_off (7892102914128777905) -->
-    <skip />
+    <string name="quick_settings_night_display_label" msgid="3577098011487644395">"Öövalgus"</string>
+    <string name="quick_settings_night_display_summary_on" msgid="1814901757887526769">"Öövalgus on sees, puudutage väljalülitamiseks"</string>
+    <string name="quick_settings_night_display_summary_off" msgid="7892102914128777905">"Öövalgus on väljas, puudutage sisselülitamiseks"</string>
     <string name="recents_empty_message" msgid="808480104164008572">"Hiljutisi üksusi pole"</string>
     <string name="recents_empty_message_dismissed_all" msgid="2791312568666558651">"Olete kõik ära kustutanud"</string>
     <string name="recents_app_info_button_label" msgid="2890317189376000030">"Rakenduste teave"</string>
diff --git a/packages/SystemUI/res/values-eu-rES/strings.xml b/packages/SystemUI/res/values-eu-rES/strings.xml
index a871b5b..519464c 100644
--- a/packages/SystemUI/res/values-eu-rES/strings.xml
+++ b/packages/SystemUI/res/values-eu-rES/strings.xml
@@ -145,8 +145,7 @@
     <string name="accessibility_data_connection_4g" msgid="7741000750630089612">"4G"</string>
     <string name="accessibility_data_connection_4g_plus" msgid="3032226872470658661">"4G+"</string>
     <string name="accessibility_data_connection_lte" msgid="5413468808637540658">"LTE"</string>
-    <!-- no translation found for accessibility_data_connection_lte_plus (361876866906946007) -->
-    <skip />
+    <string name="accessibility_data_connection_lte_plus" msgid="361876866906946007">"LTE+"</string>
     <string name="accessibility_data_connection_cdma" msgid="6132648193978823023">"CDMA"</string>
     <string name="accessibility_data_connection_roaming" msgid="5977362333466556094">"Ibiltaritza"</string>
     <string name="accessibility_data_connection_edge" msgid="4477457051631979278">"EDGE"</string>
@@ -321,12 +320,9 @@
     <string name="quick_settings_cellular_detail_data_limit" msgid="56011158504994128">"Muga: <xliff:g id="DATA_LIMIT">%s</xliff:g>"</string>
     <string name="quick_settings_cellular_detail_data_warning" msgid="2440098045692399009">"Abisua: <xliff:g id="DATA_LIMIT">%s</xliff:g>"</string>
     <string name="quick_settings_work_mode_label" msgid="6244915274350490429">"Lan modua"</string>
-    <!-- no translation found for quick_settings_night_display_label (3577098011487644395) -->
-    <skip />
-    <!-- no translation found for quick_settings_night_display_summary_on (1814901757887526769) -->
-    <skip />
-    <!-- no translation found for quick_settings_night_display_summary_off (7892102914128777905) -->
-    <skip />
+    <string name="quick_settings_night_display_label" msgid="3577098011487644395">"Gaueko argia"</string>
+    <string name="quick_settings_night_display_summary_on" msgid="1814901757887526769">"Aktibatuta dago gaueko argia. Sakatu desaktibatzeko."</string>
+    <string name="quick_settings_night_display_summary_off" msgid="7892102914128777905">"Desaktibatuta dago gaueko argia. Sakatu aktibatzeko."</string>
     <string name="recents_empty_message" msgid="808480104164008572">"Ez dago azkenaldi honetako ezer"</string>
     <string name="recents_empty_message_dismissed_all" msgid="2791312568666558651">"Dena garbitu duzu"</string>
     <string name="recents_app_info_button_label" msgid="2890317189376000030">"Aplikazioaren informazioa"</string>
diff --git a/packages/SystemUI/res/values-fr-rCA/strings.xml b/packages/SystemUI/res/values-fr-rCA/strings.xml
index 497f1ad..2fa5edb 100644
--- a/packages/SystemUI/res/values-fr-rCA/strings.xml
+++ b/packages/SystemUI/res/values-fr-rCA/strings.xml
@@ -145,8 +145,7 @@
     <string name="accessibility_data_connection_4g" msgid="7741000750630089612">"4G"</string>
     <string name="accessibility_data_connection_4g_plus" msgid="3032226872470658661">"4G+"</string>
     <string name="accessibility_data_connection_lte" msgid="5413468808637540658">"LTE"</string>
-    <!-- no translation found for accessibility_data_connection_lte_plus (361876866906946007) -->
-    <skip />
+    <string name="accessibility_data_connection_lte_plus" msgid="361876866906946007">"LTE+"</string>
     <string name="accessibility_data_connection_cdma" msgid="6132648193978823023">"CDMA"</string>
     <string name="accessibility_data_connection_roaming" msgid="5977362333466556094">"Itinérance"</string>
     <string name="accessibility_data_connection_edge" msgid="4477457051631979278">"EDGE"</string>
@@ -321,12 +320,9 @@
     <string name="quick_settings_cellular_detail_data_limit" msgid="56011158504994128">"Limite : <xliff:g id="DATA_LIMIT">%s</xliff:g>"</string>
     <string name="quick_settings_cellular_detail_data_warning" msgid="2440098045692399009">"Avertissement : <xliff:g id="DATA_LIMIT">%s</xliff:g>"</string>
     <string name="quick_settings_work_mode_label" msgid="6244915274350490429">"Mode Travail"</string>
-    <!-- no translation found for quick_settings_night_display_label (3577098011487644395) -->
-    <skip />
-    <!-- no translation found for quick_settings_night_display_summary_on (1814901757887526769) -->
-    <skip />
-    <!-- no translation found for quick_settings_night_display_summary_off (7892102914128777905) -->
-    <skip />
+    <string name="quick_settings_night_display_label" msgid="3577098011487644395">"Éclairage nocturne"</string>
+    <string name="quick_settings_night_display_summary_on" msgid="1814901757887526769">"Le mode Éclairage nocturne est activé. Touchez ici pour le désactiver."</string>
+    <string name="quick_settings_night_display_summary_off" msgid="7892102914128777905">"Le mode Éclairage nocturne est désactivé. Touchez ici pour l\'activer."</string>
     <string name="recents_empty_message" msgid="808480104164008572">"Aucun élément récent"</string>
     <string name="recents_empty_message_dismissed_all" msgid="2791312568666558651">"Vous avez tout effacé"</string>
     <string name="recents_app_info_button_label" msgid="2890317189376000030">"Détails de l\'application"</string>
diff --git a/packages/SystemUI/res/values-fr/strings.xml b/packages/SystemUI/res/values-fr/strings.xml
index 11d2308..73f5a55 100644
--- a/packages/SystemUI/res/values-fr/strings.xml
+++ b/packages/SystemUI/res/values-fr/strings.xml
@@ -145,8 +145,7 @@
     <string name="accessibility_data_connection_4g" msgid="7741000750630089612">"4G"</string>
     <string name="accessibility_data_connection_4g_plus" msgid="3032226872470658661">"4G+"</string>
     <string name="accessibility_data_connection_lte" msgid="5413468808637540658">"LTE"</string>
-    <!-- no translation found for accessibility_data_connection_lte_plus (361876866906946007) -->
-    <skip />
+    <string name="accessibility_data_connection_lte_plus" msgid="361876866906946007">"LTE+"</string>
     <string name="accessibility_data_connection_cdma" msgid="6132648193978823023">"CDMA"</string>
     <string name="accessibility_data_connection_roaming" msgid="5977362333466556094">"Itinérance"</string>
     <string name="accessibility_data_connection_edge" msgid="4477457051631979278">"EDGE"</string>
@@ -321,12 +320,9 @@
     <string name="quick_settings_cellular_detail_data_limit" msgid="56011158504994128">"<xliff:g id="DATA_LIMIT">%s</xliff:g> au maximum"</string>
     <string name="quick_settings_cellular_detail_data_warning" msgid="2440098045692399009">"Avertissement : <xliff:g id="DATA_LIMIT">%s</xliff:g>"</string>
     <string name="quick_settings_work_mode_label" msgid="6244915274350490429">"Mode Travail"</string>
-    <!-- no translation found for quick_settings_night_display_label (3577098011487644395) -->
-    <skip />
-    <!-- no translation found for quick_settings_night_display_summary_on (1814901757887526769) -->
-    <skip />
-    <!-- no translation found for quick_settings_night_display_summary_off (7892102914128777905) -->
-    <skip />
+    <string name="quick_settings_night_display_label" msgid="3577098011487644395">"Éclairage nocturne"</string>
+    <string name="quick_settings_night_display_summary_on" msgid="1814901757887526769">"Éclairage nocturne activé, appuyer pour désactiver"</string>
+    <string name="quick_settings_night_display_summary_off" msgid="7892102914128777905">"Éclairage nocturne désactivé, appuyer pour activer"</string>
     <string name="recents_empty_message" msgid="808480104164008572">"Aucun élément récent"</string>
     <string name="recents_empty_message_dismissed_all" msgid="2791312568666558651">"Vous avez tout effacé."</string>
     <string name="recents_app_info_button_label" msgid="2890317189376000030">"Infos application"</string>
diff --git a/packages/SystemUI/res/values-gl-rES/strings.xml b/packages/SystemUI/res/values-gl-rES/strings.xml
index 7ca0114..3a44b1b 100644
--- a/packages/SystemUI/res/values-gl-rES/strings.xml
+++ b/packages/SystemUI/res/values-gl-rES/strings.xml
@@ -145,8 +145,7 @@
     <string name="accessibility_data_connection_4g" msgid="7741000750630089612">"4G"</string>
     <string name="accessibility_data_connection_4g_plus" msgid="3032226872470658661">"4G+"</string>
     <string name="accessibility_data_connection_lte" msgid="5413468808637540658">"LTE"</string>
-    <!-- no translation found for accessibility_data_connection_lte_plus (361876866906946007) -->
-    <skip />
+    <string name="accessibility_data_connection_lte_plus" msgid="361876866906946007">"LTE+"</string>
     <string name="accessibility_data_connection_cdma" msgid="6132648193978823023">"CDMA"</string>
     <string name="accessibility_data_connection_roaming" msgid="5977362333466556094">"Itinerancia"</string>
     <string name="accessibility_data_connection_edge" msgid="4477457051631979278">"Edge"</string>
@@ -321,12 +320,9 @@
     <string name="quick_settings_cellular_detail_data_limit" msgid="56011158504994128">"Límite de <xliff:g id="DATA_LIMIT">%s</xliff:g>"</string>
     <string name="quick_settings_cellular_detail_data_warning" msgid="2440098045692399009">"Advertencia <xliff:g id="DATA_LIMIT">%s</xliff:g>"</string>
     <string name="quick_settings_work_mode_label" msgid="6244915274350490429">"Modo de traballo"</string>
-    <!-- no translation found for quick_settings_night_display_label (3577098011487644395) -->
-    <skip />
-    <!-- no translation found for quick_settings_night_display_summary_on (1814901757887526769) -->
-    <skip />
-    <!-- no translation found for quick_settings_night_display_summary_off (7892102914128777905) -->
-    <skip />
+    <string name="quick_settings_night_display_label" msgid="3577098011487644395">"Luz nocturna"</string>
+    <string name="quick_settings_night_display_summary_on" msgid="1814901757887526769">"A función Luz nocturna está activada. Toca para desactivala"</string>
+    <string name="quick_settings_night_display_summary_off" msgid="7892102914128777905">"A función Luz nocturna está desactivada. Toca para activala"</string>
     <string name="recents_empty_message" msgid="808480104164008572">"Non hai elementos recentes"</string>
     <string name="recents_empty_message_dismissed_all" msgid="2791312568666558651">"Borraches todo"</string>
     <string name="recents_app_info_button_label" msgid="2890317189376000030">"Información da aplicación"</string>
diff --git a/packages/SystemUI/res/values-gu-rIN/strings.xml b/packages/SystemUI/res/values-gu-rIN/strings.xml
index 1362367..7a0b30d 100644
--- a/packages/SystemUI/res/values-gu-rIN/strings.xml
+++ b/packages/SystemUI/res/values-gu-rIN/strings.xml
@@ -145,8 +145,7 @@
     <string name="accessibility_data_connection_4g" msgid="7741000750630089612">"4G"</string>
     <string name="accessibility_data_connection_4g_plus" msgid="3032226872470658661">"4G+"</string>
     <string name="accessibility_data_connection_lte" msgid="5413468808637540658">"LTE"</string>
-    <!-- no translation found for accessibility_data_connection_lte_plus (361876866906946007) -->
-    <skip />
+    <string name="accessibility_data_connection_lte_plus" msgid="361876866906946007">"LTE+"</string>
     <string name="accessibility_data_connection_cdma" msgid="6132648193978823023">"CDMA"</string>
     <string name="accessibility_data_connection_roaming" msgid="5977362333466556094">"રોમિંગ"</string>
     <string name="accessibility_data_connection_edge" msgid="4477457051631979278">"Edge"</string>
@@ -319,12 +318,9 @@
     <string name="quick_settings_cellular_detail_data_limit" msgid="56011158504994128">"<xliff:g id="DATA_LIMIT">%s</xliff:g> મર્યાદા"</string>
     <string name="quick_settings_cellular_detail_data_warning" msgid="2440098045692399009">"<xliff:g id="DATA_LIMIT">%s</xliff:g> ચેતવણી"</string>
     <string name="quick_settings_work_mode_label" msgid="6244915274350490429">"કાર્ય મોડ"</string>
-    <!-- no translation found for quick_settings_night_display_label (3577098011487644395) -->
-    <skip />
-    <!-- no translation found for quick_settings_night_display_summary_on (1814901757887526769) -->
-    <skip />
-    <!-- no translation found for quick_settings_night_display_summary_off (7892102914128777905) -->
-    <skip />
+    <string name="quick_settings_night_display_label" msgid="3577098011487644395">"રાત્રિ પ્રકાશ"</string>
+    <string name="quick_settings_night_display_summary_on" msgid="1814901757887526769">"રાત્રિ પ્રકાશ ચાલુ છે, બંધ કરવા માટે ટપ કરો"</string>
+    <string name="quick_settings_night_display_summary_off" msgid="7892102914128777905">"રાત્રિ પ્રકાશ બંધ છે, ચાલુ કરવા માટે ટૅપ કરો"</string>
     <string name="recents_empty_message" msgid="808480104164008572">"કોઇ તાજેતરની આઇટમ્સ નથી"</string>
     <string name="recents_empty_message_dismissed_all" msgid="2791312568666558651">"તમે બધું સાફ કર્યું"</string>
     <string name="recents_app_info_button_label" msgid="2890317189376000030">"ઍપ્લિકેશન માહિતી"</string>
diff --git a/packages/SystemUI/res/values-hi/strings.xml b/packages/SystemUI/res/values-hi/strings.xml
index 4dbb5cc..f9323e8 100644
--- a/packages/SystemUI/res/values-hi/strings.xml
+++ b/packages/SystemUI/res/values-hi/strings.xml
@@ -145,8 +145,7 @@
     <string name="accessibility_data_connection_4g" msgid="7741000750630089612">"4G"</string>
     <string name="accessibility_data_connection_4g_plus" msgid="3032226872470658661">"4G+"</string>
     <string name="accessibility_data_connection_lte" msgid="5413468808637540658">"LTE"</string>
-    <!-- no translation found for accessibility_data_connection_lte_plus (361876866906946007) -->
-    <skip />
+    <string name="accessibility_data_connection_lte_plus" msgid="361876866906946007">"LTE+"</string>
     <string name="accessibility_data_connection_cdma" msgid="6132648193978823023">"CDMA"</string>
     <string name="accessibility_data_connection_roaming" msgid="5977362333466556094">"रोमिंग"</string>
     <string name="accessibility_data_connection_edge" msgid="4477457051631979278">"किनारा"</string>
@@ -319,12 +318,9 @@
     <string name="quick_settings_cellular_detail_data_limit" msgid="56011158504994128">"<xliff:g id="DATA_LIMIT">%s</xliff:g> सीमा"</string>
     <string name="quick_settings_cellular_detail_data_warning" msgid="2440098045692399009">"<xliff:g id="DATA_LIMIT">%s</xliff:g> चेतावनी"</string>
     <string name="quick_settings_work_mode_label" msgid="6244915274350490429">"कार्य मोड"</string>
-    <!-- no translation found for quick_settings_night_display_label (3577098011487644395) -->
-    <skip />
-    <!-- no translation found for quick_settings_night_display_summary_on (1814901757887526769) -->
-    <skip />
-    <!-- no translation found for quick_settings_night_display_summary_off (7892102914128777905) -->
-    <skip />
+    <string name="quick_settings_night_display_label" msgid="3577098011487644395">"नाइट लाइट"</string>
+    <string name="quick_settings_night_display_summary_on" msgid="1814901757887526769">"नाइट लाइट चालू है, बंद करने के लिए टैप करें"</string>
+    <string name="quick_settings_night_display_summary_off" msgid="7892102914128777905">"नाइट लाइट बंद है, चालू करने के लिए टैप करें"</string>
     <string name="recents_empty_message" msgid="808480104164008572">"हाल ही का कोई आइटम नहीं"</string>
     <string name="recents_empty_message_dismissed_all" msgid="2791312568666558651">"आपने सब कुछ साफ़ कर दिया है"</string>
     <string name="recents_app_info_button_label" msgid="2890317189376000030">"एप्‍लिकेशन जानकारी"</string>
diff --git a/packages/SystemUI/res/values-hr/strings.xml b/packages/SystemUI/res/values-hr/strings.xml
index 1ecd209..4f0f5ce 100644
--- a/packages/SystemUI/res/values-hr/strings.xml
+++ b/packages/SystemUI/res/values-hr/strings.xml
@@ -146,8 +146,7 @@
     <string name="accessibility_data_connection_4g" msgid="7741000750630089612">"4G"</string>
     <string name="accessibility_data_connection_4g_plus" msgid="3032226872470658661">"4G i više"</string>
     <string name="accessibility_data_connection_lte" msgid="5413468808637540658">"LTE"</string>
-    <!-- no translation found for accessibility_data_connection_lte_plus (361876866906946007) -->
-    <skip />
+    <string name="accessibility_data_connection_lte_plus" msgid="361876866906946007">"LTE+"</string>
     <string name="accessibility_data_connection_cdma" msgid="6132648193978823023">"CDMA"</string>
     <string name="accessibility_data_connection_roaming" msgid="5977362333466556094">"Roaming"</string>
     <string name="accessibility_data_connection_edge" msgid="4477457051631979278">"Edge"</string>
@@ -321,12 +320,9 @@
     <string name="quick_settings_cellular_detail_data_limit" msgid="56011158504994128">"Ograničenje od <xliff:g id="DATA_LIMIT">%s</xliff:g>"</string>
     <string name="quick_settings_cellular_detail_data_warning" msgid="2440098045692399009">"Upozorenje <xliff:g id="DATA_LIMIT">%s</xliff:g>"</string>
     <string name="quick_settings_work_mode_label" msgid="6244915274350490429">"Način rada"</string>
-    <!-- no translation found for quick_settings_night_display_label (3577098011487644395) -->
-    <skip />
-    <!-- no translation found for quick_settings_night_display_summary_on (1814901757887526769) -->
-    <skip />
-    <!-- no translation found for quick_settings_night_display_summary_off (7892102914128777905) -->
-    <skip />
+    <string name="quick_settings_night_display_label" msgid="3577098011487644395">"Noćno svjetlo"</string>
+    <string name="quick_settings_night_display_summary_on" msgid="1814901757887526769">"Noćno je svjetlo uključeno, dodirnite da biste ga isključili"</string>
+    <string name="quick_settings_night_display_summary_off" msgid="7892102914128777905">"Noćno je svjetlo isključeno, dodirnite da biste ga uključili"</string>
     <string name="recents_empty_message" msgid="808480104164008572">"Nema nedavnih stavki"</string>
     <string name="recents_empty_message_dismissed_all" msgid="2791312568666558651">"Izbrisali ste sve"</string>
     <string name="recents_app_info_button_label" msgid="2890317189376000030">"Informacije o aplikaciji"</string>
diff --git a/packages/SystemUI/res/values-hu/strings.xml b/packages/SystemUI/res/values-hu/strings.xml
index ec42306..45e189a 100644
--- a/packages/SystemUI/res/values-hu/strings.xml
+++ b/packages/SystemUI/res/values-hu/strings.xml
@@ -145,8 +145,7 @@
     <string name="accessibility_data_connection_4g" msgid="7741000750630089612">"4G"</string>
     <string name="accessibility_data_connection_4g_plus" msgid="3032226872470658661">"4G+"</string>
     <string name="accessibility_data_connection_lte" msgid="5413468808637540658">"LTE"</string>
-    <!-- no translation found for accessibility_data_connection_lte_plus (361876866906946007) -->
-    <skip />
+    <string name="accessibility_data_connection_lte_plus" msgid="361876866906946007">"LTE+"</string>
     <string name="accessibility_data_connection_cdma" msgid="6132648193978823023">"CDMA"</string>
     <string name="accessibility_data_connection_roaming" msgid="5977362333466556094">"Barangolás"</string>
     <string name="accessibility_data_connection_edge" msgid="4477457051631979278">"Edge"</string>
@@ -319,12 +318,9 @@
     <string name="quick_settings_cellular_detail_data_limit" msgid="56011158504994128">"<xliff:g id="DATA_LIMIT">%s</xliff:g> korlát"</string>
     <string name="quick_settings_cellular_detail_data_warning" msgid="2440098045692399009">"Figyelem! <xliff:g id="DATA_LIMIT">%s</xliff:g>"</string>
     <string name="quick_settings_work_mode_label" msgid="6244915274350490429">"Munka mód"</string>
-    <!-- no translation found for quick_settings_night_display_label (3577098011487644395) -->
-    <skip />
-    <!-- no translation found for quick_settings_night_display_summary_on (1814901757887526769) -->
-    <skip />
-    <!-- no translation found for quick_settings_night_display_summary_off (7892102914128777905) -->
-    <skip />
+    <string name="quick_settings_night_display_label" msgid="3577098011487644395">"Éjszakai fény"</string>
+    <string name="quick_settings_night_display_summary_on" msgid="1814901757887526769">"Éjszakai fény bekapcsolva, koppintson a kikapcsoláshoz"</string>
+    <string name="quick_settings_night_display_summary_off" msgid="7892102914128777905">"Éjszakai fény kikapcsolva, koppintson a bekapcsoláshoz"</string>
     <string name="recents_empty_message" msgid="808480104164008572">"Nincsenek mostanában használt elemek"</string>
     <string name="recents_empty_message_dismissed_all" msgid="2791312568666558651">"Mindent törölt"</string>
     <string name="recents_app_info_button_label" msgid="2890317189376000030">"Az alkalmazás adatai"</string>
diff --git a/packages/SystemUI/res/values-hy-rAM/strings.xml b/packages/SystemUI/res/values-hy-rAM/strings.xml
index b1a363b..875eeea 100644
--- a/packages/SystemUI/res/values-hy-rAM/strings.xml
+++ b/packages/SystemUI/res/values-hy-rAM/strings.xml
@@ -145,8 +145,7 @@
     <string name="accessibility_data_connection_4g" msgid="7741000750630089612">"4G"</string>
     <string name="accessibility_data_connection_4g_plus" msgid="3032226872470658661">"4G+"</string>
     <string name="accessibility_data_connection_lte" msgid="5413468808637540658">"LTE"</string>
-    <!-- no translation found for accessibility_data_connection_lte_plus (361876866906946007) -->
-    <skip />
+    <string name="accessibility_data_connection_lte_plus" msgid="361876866906946007">"LTE+"</string>
     <string name="accessibility_data_connection_cdma" msgid="6132648193978823023">"CDMA"</string>
     <string name="accessibility_data_connection_roaming" msgid="5977362333466556094">"Ռոումինգ"</string>
     <string name="accessibility_data_connection_edge" msgid="4477457051631979278">"Edge"</string>
@@ -319,12 +318,9 @@
     <string name="quick_settings_cellular_detail_data_limit" msgid="56011158504994128">"Սահմանաչափ՝ <xliff:g id="DATA_LIMIT">%s</xliff:g>"</string>
     <string name="quick_settings_cellular_detail_data_warning" msgid="2440098045692399009">"<xliff:g id="DATA_LIMIT">%s</xliff:g> զգուշացում"</string>
     <string name="quick_settings_work_mode_label" msgid="6244915274350490429">"Աշխատանքային ռեժիմ"</string>
-    <!-- no translation found for quick_settings_night_display_label (3577098011487644395) -->
-    <skip />
-    <!-- no translation found for quick_settings_night_display_summary_on (1814901757887526769) -->
-    <skip />
-    <!-- no translation found for quick_settings_night_display_summary_off (7892102914128777905) -->
-    <skip />
+    <string name="quick_settings_night_display_label" msgid="3577098011487644395">"Գիշերային լույս"</string>
+    <string name="quick_settings_night_display_summary_on" msgid="1814901757887526769">"Գիշերային լույսը միացված է, հպեք՝ անջատելու համար"</string>
+    <string name="quick_settings_night_display_summary_off" msgid="7892102914128777905">"Գիշերային լույսն անջատված է, հպեք՝ միացնելու համար"</string>
     <string name="recents_empty_message" msgid="808480104164008572">"Վերջին տարրեր չկան"</string>
     <string name="recents_empty_message_dismissed_all" msgid="2791312568666558651">"Դուք ջնջել եք ամենը"</string>
     <string name="recents_app_info_button_label" msgid="2890317189376000030">"Հավելվածի մասին"</string>
diff --git a/packages/SystemUI/res/values-is-rIS/strings.xml b/packages/SystemUI/res/values-is-rIS/strings.xml
index 6430f6e..dbd80d3 100644
--- a/packages/SystemUI/res/values-is-rIS/strings.xml
+++ b/packages/SystemUI/res/values-is-rIS/strings.xml
@@ -145,8 +145,7 @@
     <string name="accessibility_data_connection_4g" msgid="7741000750630089612">"4G"</string>
     <string name="accessibility_data_connection_4g_plus" msgid="3032226872470658661">"4G+"</string>
     <string name="accessibility_data_connection_lte" msgid="5413468808637540658">"LTE"</string>
-    <!-- no translation found for accessibility_data_connection_lte_plus (361876866906946007) -->
-    <skip />
+    <string name="accessibility_data_connection_lte_plus" msgid="361876866906946007">"LTE+"</string>
     <string name="accessibility_data_connection_cdma" msgid="6132648193978823023">"CDMA"</string>
     <string name="accessibility_data_connection_roaming" msgid="5977362333466556094">"Reiki"</string>
     <string name="accessibility_data_connection_edge" msgid="4477457051631979278">"Edge"</string>
@@ -319,12 +318,9 @@
     <string name="quick_settings_cellular_detail_data_limit" msgid="56011158504994128">"<xliff:g id="DATA_LIMIT">%s</xliff:g> hámark"</string>
     <string name="quick_settings_cellular_detail_data_warning" msgid="2440098045692399009">"<xliff:g id="DATA_LIMIT">%s</xliff:g> viðvörun"</string>
     <string name="quick_settings_work_mode_label" msgid="6244915274350490429">"Vinnustilling"</string>
-    <!-- no translation found for quick_settings_night_display_label (3577098011487644395) -->
-    <skip />
-    <!-- no translation found for quick_settings_night_display_summary_on (1814901757887526769) -->
-    <skip />
-    <!-- no translation found for quick_settings_night_display_summary_off (7892102914128777905) -->
-    <skip />
+    <string name="quick_settings_night_display_label" msgid="3577098011487644395">"Næturljós"</string>
+    <string name="quick_settings_night_display_summary_on" msgid="1814901757887526769">"Kveikt á næturljósi, ýttu til að slökkva"</string>
+    <string name="quick_settings_night_display_summary_off" msgid="7892102914128777905">"Slökkt á næturljósi, ýttu til að kveikja"</string>
     <string name="recents_empty_message" msgid="808480104164008572">"Engin nýleg atriði"</string>
     <string name="recents_empty_message_dismissed_all" msgid="2791312568666558651">"Þú hefur hreinsað allt"</string>
     <string name="recents_app_info_button_label" msgid="2890317189376000030">"Forritsupplýsingar"</string>
diff --git a/packages/SystemUI/res/values-it/strings.xml b/packages/SystemUI/res/values-it/strings.xml
index 0693519..8f1db5a 100644
--- a/packages/SystemUI/res/values-it/strings.xml
+++ b/packages/SystemUI/res/values-it/strings.xml
@@ -321,8 +321,8 @@
     <string name="quick_settings_cellular_detail_data_warning" msgid="2440098045692399009">"Avviso <xliff:g id="DATA_LIMIT">%s</xliff:g>"</string>
     <string name="quick_settings_work_mode_label" msgid="6244915274350490429">"Modalità Lavoro"</string>
     <string name="quick_settings_night_display_label" msgid="3577098011487644395">"Luminosità notturna"</string>
-    <string name="quick_settings_night_display_summary_on" msgid="1814901757887526769">"Luminosità notturna attiva; tocca per disattivarla"</string>
-    <string name="quick_settings_night_display_summary_off" msgid="7892102914128777905">"Luminosità notturna non attiva; tocca per attivarla"</string>
+    <string name="quick_settings_night_display_summary_on" msgid="1814901757887526769">"Luminosità notturna attiva, tocca per disattivarla"</string>
+    <string name="quick_settings_night_display_summary_off" msgid="7892102914128777905">"Luminosità notturna disattivata, tocca per attivarla"</string>
     <string name="recents_empty_message" msgid="808480104164008572">"Nessun elemento recente"</string>
     <string name="recents_empty_message_dismissed_all" msgid="2791312568666558651">"Hai cancellato tutto"</string>
     <string name="recents_app_info_button_label" msgid="2890317189376000030">"Informazioni sull\'applicazione"</string>
diff --git a/packages/SystemUI/res/values-ja/strings.xml b/packages/SystemUI/res/values-ja/strings.xml
index f65b675..ab75021 100644
--- a/packages/SystemUI/res/values-ja/strings.xml
+++ b/packages/SystemUI/res/values-ja/strings.xml
@@ -145,8 +145,7 @@
     <string name="accessibility_data_connection_4g" msgid="7741000750630089612">"4G"</string>
     <string name="accessibility_data_connection_4g_plus" msgid="3032226872470658661">"4G+"</string>
     <string name="accessibility_data_connection_lte" msgid="5413468808637540658">"LTE"</string>
-    <!-- no translation found for accessibility_data_connection_lte_plus (361876866906946007) -->
-    <skip />
+    <string name="accessibility_data_connection_lte_plus" msgid="361876866906946007">"LTE+"</string>
     <string name="accessibility_data_connection_cdma" msgid="6132648193978823023">"CDMA"</string>
     <string name="accessibility_data_connection_roaming" msgid="5977362333466556094">"ローミング中"</string>
     <string name="accessibility_data_connection_edge" msgid="4477457051631979278">"EDGE"</string>
@@ -321,12 +320,9 @@
     <string name="quick_settings_cellular_detail_data_limit" msgid="56011158504994128">"上限: <xliff:g id="DATA_LIMIT">%s</xliff:g>"</string>
     <string name="quick_settings_cellular_detail_data_warning" msgid="2440098045692399009">"警告: 上限は<xliff:g id="DATA_LIMIT">%s</xliff:g>です"</string>
     <string name="quick_settings_work_mode_label" msgid="6244915274350490429">"Work モード"</string>
-    <!-- no translation found for quick_settings_night_display_label (3577098011487644395) -->
-    <skip />
-    <!-- no translation found for quick_settings_night_display_summary_on (1814901757887526769) -->
-    <skip />
-    <!-- no translation found for quick_settings_night_display_summary_off (7892102914128777905) -->
-    <skip />
+    <string name="quick_settings_night_display_label" msgid="3577098011487644395">"読書灯"</string>
+    <string name="quick_settings_night_display_summary_on" msgid="1814901757887526769">"読書灯 ON: タップすると OFF になります"</string>
+    <string name="quick_settings_night_display_summary_off" msgid="7892102914128777905">"読書灯 OFF: タップすると ON になります"</string>
     <string name="recents_empty_message" msgid="808480104164008572">"最近のタスクはありません"</string>
     <string name="recents_empty_message_dismissed_all" msgid="2791312568666558651">"すべてのタスクを消去しました"</string>
     <string name="recents_app_info_button_label" msgid="2890317189376000030">"アプリ情報"</string>
diff --git a/packages/SystemUI/res/values-ka-rGE/strings.xml b/packages/SystemUI/res/values-ka-rGE/strings.xml
index 1c74219..f4f7ddd 100644
--- a/packages/SystemUI/res/values-ka-rGE/strings.xml
+++ b/packages/SystemUI/res/values-ka-rGE/strings.xml
@@ -145,8 +145,7 @@
     <string name="accessibility_data_connection_4g" msgid="7741000750630089612">"4G"</string>
     <string name="accessibility_data_connection_4g_plus" msgid="3032226872470658661">"4G+"</string>
     <string name="accessibility_data_connection_lte" msgid="5413468808637540658">"LTE"</string>
-    <!-- no translation found for accessibility_data_connection_lte_plus (361876866906946007) -->
-    <skip />
+    <string name="accessibility_data_connection_lte_plus" msgid="361876866906946007">"LTE+"</string>
     <string name="accessibility_data_connection_cdma" msgid="6132648193978823023">"CDMA"</string>
     <string name="accessibility_data_connection_roaming" msgid="5977362333466556094">"როუმინგი"</string>
     <string name="accessibility_data_connection_edge" msgid="4477457051631979278">"Edge"</string>
@@ -319,12 +318,9 @@
     <string name="quick_settings_cellular_detail_data_limit" msgid="56011158504994128">"ლიმიტი: <xliff:g id="DATA_LIMIT">%s</xliff:g>"</string>
     <string name="quick_settings_cellular_detail_data_warning" msgid="2440098045692399009">"<xliff:g id="DATA_LIMIT">%s</xliff:g> გაფრთხილება"</string>
     <string name="quick_settings_work_mode_label" msgid="6244915274350490429">"სამსახურის რეჟიმი"</string>
-    <!-- no translation found for quick_settings_night_display_label (3577098011487644395) -->
-    <skip />
-    <!-- no translation found for quick_settings_night_display_summary_on (1814901757887526769) -->
-    <skip />
-    <!-- no translation found for quick_settings_night_display_summary_off (7892102914128777905) -->
-    <skip />
+    <string name="quick_settings_night_display_label" msgid="3577098011487644395">"ღამის განათება"</string>
+    <string name="quick_settings_night_display_summary_on" msgid="1814901757887526769">"ღამის განათება ჩართულია, შეეხეთ გამოსართავად"</string>
+    <string name="quick_settings_night_display_summary_off" msgid="7892102914128777905">"ღამის განათება გამორთულია, შეეხეთ ჩასართავად"</string>
     <string name="recents_empty_message" msgid="808480104164008572">"ბოლოს გამოყენებული ერთეულები არ არის"</string>
     <string name="recents_empty_message_dismissed_all" msgid="2791312568666558651">"ყველაფერი გასუფთავდა"</string>
     <string name="recents_app_info_button_label" msgid="2890317189376000030">"აპლიკაციის შესახებ"</string>
diff --git a/packages/SystemUI/res/values-kk-rKZ/strings.xml b/packages/SystemUI/res/values-kk-rKZ/strings.xml
index 53cff4b..cb41a0e 100644
--- a/packages/SystemUI/res/values-kk-rKZ/strings.xml
+++ b/packages/SystemUI/res/values-kk-rKZ/strings.xml
@@ -145,8 +145,7 @@
     <string name="accessibility_data_connection_4g" msgid="7741000750630089612">"4Г"</string>
     <string name="accessibility_data_connection_4g_plus" msgid="3032226872470658661">"4G+"</string>
     <string name="accessibility_data_connection_lte" msgid="5413468808637540658">"ҰМД"</string>
-    <!-- no translation found for accessibility_data_connection_lte_plus (361876866906946007) -->
-    <skip />
+    <string name="accessibility_data_connection_lte_plus" msgid="361876866906946007">"LTE+"</string>
     <string name="accessibility_data_connection_cdma" msgid="6132648193978823023">"CDMA (кодтармен бөлінген бірнеше қол жетімділік)"</string>
     <string name="accessibility_data_connection_roaming" msgid="5977362333466556094">"Роуминг"</string>
     <string name="accessibility_data_connection_edge" msgid="4477457051631979278">"EDGE (ұялы байланыстар жүйесіне арналған жетілдірілген деректер шамалары)"</string>
@@ -319,12 +318,9 @@
     <string name="quick_settings_cellular_detail_data_limit" msgid="56011158504994128">"<xliff:g id="DATA_LIMIT">%s</xliff:g> шегі"</string>
     <string name="quick_settings_cellular_detail_data_warning" msgid="2440098045692399009">"<xliff:g id="DATA_LIMIT">%s</xliff:g> туралы ескерту"</string>
     <string name="quick_settings_work_mode_label" msgid="6244915274350490429">"Жұмыс режимі"</string>
-    <!-- no translation found for quick_settings_night_display_label (3577098011487644395) -->
-    <skip />
-    <!-- no translation found for quick_settings_night_display_summary_on (1814901757887526769) -->
-    <skip />
-    <!-- no translation found for quick_settings_night_display_summary_off (7892102914128777905) -->
-    <skip />
+    <string name="quick_settings_night_display_label" msgid="3577098011487644395">"Түнгі жарық"</string>
+    <string name="quick_settings_night_display_summary_on" msgid="1814901757887526769">"Түнгі жарық қосулы, өшіру үшін оны түртіңіз"</string>
+    <string name="quick_settings_night_display_summary_off" msgid="7892102914128777905">"Түнгі жарық өшірулі, қосу үшін оны түртіңіз"</string>
     <string name="recents_empty_message" msgid="808480104164008572">"Жақындағы элементтер жоқ"</string>
     <string name="recents_empty_message_dismissed_all" msgid="2791312568666558651">"Сіз барлығын өшірдіңіз"</string>
     <string name="recents_app_info_button_label" msgid="2890317189376000030">"Қолданба туралы ақпарат"</string>
diff --git a/packages/SystemUI/res/values-km-rKH/strings.xml b/packages/SystemUI/res/values-km-rKH/strings.xml
index 20704e1..6bd184d 100644
--- a/packages/SystemUI/res/values-km-rKH/strings.xml
+++ b/packages/SystemUI/res/values-km-rKH/strings.xml
@@ -145,8 +145,7 @@
     <string name="accessibility_data_connection_4g" msgid="7741000750630089612">"4G"</string>
     <string name="accessibility_data_connection_4g_plus" msgid="3032226872470658661">"4G+"</string>
     <string name="accessibility_data_connection_lte" msgid="5413468808637540658">"LTE"</string>
-    <!-- no translation found for accessibility_data_connection_lte_plus (361876866906946007) -->
-    <skip />
+    <string name="accessibility_data_connection_lte_plus" msgid="361876866906946007">"LTE+"</string>
     <string name="accessibility_data_connection_cdma" msgid="6132648193978823023">"CDMA"</string>
     <string name="accessibility_data_connection_roaming" msgid="5977362333466556094">"រ៉ូ​មីង"</string>
     <string name="accessibility_data_connection_edge" msgid="4477457051631979278">"Edge"</string>
@@ -319,12 +318,9 @@
     <string name="quick_settings_cellular_detail_data_limit" msgid="56011158504994128">"ដែន​កំណត់ <xliff:g id="DATA_LIMIT">%s</xliff:g>"</string>
     <string name="quick_settings_cellular_detail_data_warning" msgid="2440098045692399009">"<xliff:g id="DATA_LIMIT">%s</xliff:g> ការ​ព្រមាន"</string>
     <string name="quick_settings_work_mode_label" msgid="6244915274350490429">"របៀបការងារ"</string>
-    <!-- no translation found for quick_settings_night_display_label (3577098011487644395) -->
-    <skip />
-    <!-- no translation found for quick_settings_night_display_summary_on (1814901757887526769) -->
-    <skip />
-    <!-- no translation found for quick_settings_night_display_summary_off (7892102914128777905) -->
-    <skip />
+    <string name="quick_settings_night_display_label" msgid="3577098011487644395">"ពន្លឺពេលយប់"</string>
+    <string name="quick_settings_night_display_summary_on" msgid="1814901757887526769">"ពន្លឺពេលយប់បើកហើយ ប៉ះដើម្បីបិទ"</string>
+    <string name="quick_settings_night_display_summary_off" msgid="7892102914128777905">"ពន្លឺពេលយប់បិទហើយ ប៉ះដើម្បីបើក"</string>
     <string name="recents_empty_message" msgid="808480104164008572">"មិនមានធាតុថ្មីៗទេ"</string>
     <string name="recents_empty_message_dismissed_all" msgid="2791312568666558651">"អ្នកបានជម្រះអ្វីៗទាំងអស់"</string>
     <string name="recents_app_info_button_label" msgid="2890317189376000030">"ព័ត៌មាន​កម្មវិធី"</string>
diff --git a/packages/SystemUI/res/values-kn-rIN/strings.xml b/packages/SystemUI/res/values-kn-rIN/strings.xml
index 48c4bd9..960c952 100644
--- a/packages/SystemUI/res/values-kn-rIN/strings.xml
+++ b/packages/SystemUI/res/values-kn-rIN/strings.xml
@@ -145,8 +145,7 @@
     <string name="accessibility_data_connection_4g" msgid="7741000750630089612">"4G"</string>
     <string name="accessibility_data_connection_4g_plus" msgid="3032226872470658661">"4G+"</string>
     <string name="accessibility_data_connection_lte" msgid="5413468808637540658">"LTE"</string>
-    <!-- no translation found for accessibility_data_connection_lte_plus (361876866906946007) -->
-    <skip />
+    <string name="accessibility_data_connection_lte_plus" msgid="361876866906946007">"LTE+"</string>
     <string name="accessibility_data_connection_cdma" msgid="6132648193978823023">"CDMA"</string>
     <string name="accessibility_data_connection_roaming" msgid="5977362333466556094">"ರೋಮಿಂಗ್"</string>
     <string name="accessibility_data_connection_edge" msgid="4477457051631979278">"ಎಡ್ಜ್‌"</string>
@@ -319,12 +318,9 @@
     <string name="quick_settings_cellular_detail_data_limit" msgid="56011158504994128">"<xliff:g id="DATA_LIMIT">%s</xliff:g> ಮಿತಿ"</string>
     <string name="quick_settings_cellular_detail_data_warning" msgid="2440098045692399009">"<xliff:g id="DATA_LIMIT">%s</xliff:g> ಎಚ್ಚರಿಕೆ"</string>
     <string name="quick_settings_work_mode_label" msgid="6244915274350490429">"ಕೆಲಸದ ಮೋಡ್"</string>
-    <!-- no translation found for quick_settings_night_display_label (3577098011487644395) -->
-    <skip />
-    <!-- no translation found for quick_settings_night_display_summary_on (1814901757887526769) -->
-    <skip />
-    <!-- no translation found for quick_settings_night_display_summary_off (7892102914128777905) -->
-    <skip />
+    <string name="quick_settings_night_display_label" msgid="3577098011487644395">"ನೈಟ್ ಲೈಟ್"</string>
+    <string name="quick_settings_night_display_summary_on" msgid="1814901757887526769">"ನೈಟ್ ಲೈಟ್ ಆನ್ ಆಗಿದೆ, ಆಫ್ ಮಾಡಲು ಟ್ಯಾಪ್ ಮಾಡಿ"</string>
+    <string name="quick_settings_night_display_summary_off" msgid="7892102914128777905">"ನೈಟ್ ಲೈಟ್ ಆಫ್ ಆಗಿದೆ, ಆನ್ ಮಾಡಲು ಟ್ಯಾಪ್ ಮಾಡಿ"</string>
     <string name="recents_empty_message" msgid="808480104164008572">"ಯಾವುದೇ ಇತ್ತೀಚಿನ ಐಟಂಗಳಿಲ್ಲ"</string>
     <string name="recents_empty_message_dismissed_all" msgid="2791312568666558651">"ನೀವು ಎಲ್ಲವನ್ನೂ ತೆರವುಗೊಳಿಸಿರುವಿರಿ"</string>
     <string name="recents_app_info_button_label" msgid="2890317189376000030">"ಅಪ್ಲಿಕೇಶನ್ ಮಾಹಿತಿ"</string>
diff --git a/packages/SystemUI/res/values-ko/strings.xml b/packages/SystemUI/res/values-ko/strings.xml
index 260ab89..825092f 100644
--- a/packages/SystemUI/res/values-ko/strings.xml
+++ b/packages/SystemUI/res/values-ko/strings.xml
@@ -145,8 +145,7 @@
     <string name="accessibility_data_connection_4g" msgid="7741000750630089612">"4G"</string>
     <string name="accessibility_data_connection_4g_plus" msgid="3032226872470658661">"4G 이상"</string>
     <string name="accessibility_data_connection_lte" msgid="5413468808637540658">"LTE"</string>
-    <!-- no translation found for accessibility_data_connection_lte_plus (361876866906946007) -->
-    <skip />
+    <string name="accessibility_data_connection_lte_plus" msgid="361876866906946007">"LTE+"</string>
     <string name="accessibility_data_connection_cdma" msgid="6132648193978823023">"CDMA"</string>
     <string name="accessibility_data_connection_roaming" msgid="5977362333466556094">"로밍"</string>
     <string name="accessibility_data_connection_edge" msgid="4477457051631979278">"Edge"</string>
@@ -321,12 +320,9 @@
     <string name="quick_settings_cellular_detail_data_limit" msgid="56011158504994128">"한도: <xliff:g id="DATA_LIMIT">%s</xliff:g>"</string>
     <string name="quick_settings_cellular_detail_data_warning" msgid="2440098045692399009">"<xliff:g id="DATA_LIMIT">%s</xliff:g> 경고"</string>
     <string name="quick_settings_work_mode_label" msgid="6244915274350490429">"작업 모드"</string>
-    <!-- no translation found for quick_settings_night_display_label (3577098011487644395) -->
-    <skip />
-    <!-- no translation found for quick_settings_night_display_summary_on (1814901757887526769) -->
-    <skip />
-    <!-- no translation found for quick_settings_night_display_summary_off (7892102914128777905) -->
-    <skip />
+    <string name="quick_settings_night_display_label" msgid="3577098011487644395">"야간 조명"</string>
+    <string name="quick_settings_night_display_summary_on" msgid="1814901757887526769">"야간 조명 사용 설정됨, 사용 중지하려면 탭"</string>
+    <string name="quick_settings_night_display_summary_off" msgid="7892102914128777905">"야간 조명 사용 중지됨, 사용 설정하려면 탭"</string>
     <string name="recents_empty_message" msgid="808480104164008572">"최근 항목이 없습니다."</string>
     <string name="recents_empty_message_dismissed_all" msgid="2791312568666558651">"모든 항목을 삭제했습니다."</string>
     <string name="recents_app_info_button_label" msgid="2890317189376000030">"애플리케이션 정보"</string>
diff --git a/packages/SystemUI/res/values-ky-rKG/strings.xml b/packages/SystemUI/res/values-ky-rKG/strings.xml
index e5bbac3..e1daa6c 100644
--- a/packages/SystemUI/res/values-ky-rKG/strings.xml
+++ b/packages/SystemUI/res/values-ky-rKG/strings.xml
@@ -145,8 +145,7 @@
     <string name="accessibility_data_connection_4g" msgid="7741000750630089612">"4G"</string>
     <string name="accessibility_data_connection_4g_plus" msgid="3032226872470658661">"4G+"</string>
     <string name="accessibility_data_connection_lte" msgid="5413468808637540658">"LTE"</string>
-    <!-- no translation found for accessibility_data_connection_lte_plus (361876866906946007) -->
-    <skip />
+    <string name="accessibility_data_connection_lte_plus" msgid="361876866906946007">"LTE+"</string>
     <string name="accessibility_data_connection_cdma" msgid="6132648193978823023">"CDMA"</string>
     <string name="accessibility_data_connection_roaming" msgid="5977362333466556094">"Роуминг"</string>
     <string name="accessibility_data_connection_edge" msgid="4477457051631979278">"Edge"</string>
@@ -319,12 +318,9 @@
     <string name="quick_settings_cellular_detail_data_limit" msgid="56011158504994128">"<xliff:g id="DATA_LIMIT">%s</xliff:g> чектөө"</string>
     <string name="quick_settings_cellular_detail_data_warning" msgid="2440098045692399009">"<xliff:g id="DATA_LIMIT">%s</xliff:g> эскертүү"</string>
     <string name="quick_settings_work_mode_label" msgid="6244915274350490429">"Иштөө режими"</string>
-    <!-- no translation found for quick_settings_night_display_label (3577098011487644395) -->
-    <skip />
-    <!-- no translation found for quick_settings_night_display_summary_on (1814901757887526769) -->
-    <skip />
-    <!-- no translation found for quick_settings_night_display_summary_off (7892102914128777905) -->
-    <skip />
+    <string name="quick_settings_night_display_label" msgid="3577098011487644395">"Түнкү жарык"</string>
+    <string name="quick_settings_night_display_summary_on" msgid="1814901757887526769">"Түнкү жарык күйүк, өчүрүү үчүн таптап коюңуз"</string>
+    <string name="quick_settings_night_display_summary_off" msgid="7892102914128777905">"Түнкү жарык өчүк, күйгүзүү үчүн таптап коюңуз"</string>
     <string name="recents_empty_message" msgid="808480104164008572">"Акыркы колдонмолор жок"</string>
     <string name="recents_empty_message_dismissed_all" msgid="2791312568666558651">"Баарын тазаладыңыз"</string>
     <string name="recents_app_info_button_label" msgid="2890317189376000030">"Колдонмо жөнүндө маалымат"</string>
diff --git a/packages/SystemUI/res/values-ldrtl/config.xml b/packages/SystemUI/res/values-ldrtl/config.xml
new file mode 100644
index 0000000..40604c1
--- /dev/null
+++ b/packages/SystemUI/res/values-ldrtl/config.xml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2016 The Android Open Source Project
+
+     Licensed under the Apache License, Version 2.0 (the "License");
+     you may not use this file except in compliance with the License.
+     You may obtain a copy of the License at
+
+          http://www.apache.org/licenses/LICENSE-2.0
+
+     Unless required by applicable law or agreed to in writing, software
+     distributed under the License is distributed on an "AS IS" BASIS,
+     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     See the License for the specific language governing permissions and
+     limitations under the License.
+-->
+
+<resources>
+    <!-- Bounds [left top right bottom] on screen for picture-in-picture (PIP) windows,
+         when the PIP menu is shown with settings. -->
+    <string translatable="false" name="pip_settings_bounds">"778 54 1258 324"</string>
+</resources>
diff --git a/packages/SystemUI/res/values-lt/strings.xml b/packages/SystemUI/res/values-lt/strings.xml
index 267e582..1a90226 100644
--- a/packages/SystemUI/res/values-lt/strings.xml
+++ b/packages/SystemUI/res/values-lt/strings.xml
@@ -147,8 +147,7 @@
     <string name="accessibility_data_connection_4g" msgid="7741000750630089612">"4G"</string>
     <string name="accessibility_data_connection_4g_plus" msgid="3032226872470658661">"4G+"</string>
     <string name="accessibility_data_connection_lte" msgid="5413468808637540658">"LTE"</string>
-    <!-- no translation found for accessibility_data_connection_lte_plus (361876866906946007) -->
-    <skip />
+    <string name="accessibility_data_connection_lte_plus" msgid="361876866906946007">"LTE+"</string>
     <string name="accessibility_data_connection_cdma" msgid="6132648193978823023">"CDMA"</string>
     <string name="accessibility_data_connection_roaming" msgid="5977362333466556094">"Tarptinklinis ryšys"</string>
     <string name="accessibility_data_connection_edge" msgid="4477457051631979278">"Kraštas"</string>
@@ -323,12 +322,9 @@
     <string name="quick_settings_cellular_detail_data_limit" msgid="56011158504994128">"Limitas: <xliff:g id="DATA_LIMIT">%s</xliff:g>"</string>
     <string name="quick_settings_cellular_detail_data_warning" msgid="2440098045692399009">"<xliff:g id="DATA_LIMIT">%s</xliff:g> įspėjimas"</string>
     <string name="quick_settings_work_mode_label" msgid="6244915274350490429">"Darbo režimas"</string>
-    <!-- no translation found for quick_settings_night_display_label (3577098011487644395) -->
-    <skip />
-    <!-- no translation found for quick_settings_night_display_summary_on (1814901757887526769) -->
-    <skip />
-    <!-- no translation found for quick_settings_night_display_summary_off (7892102914128777905) -->
-    <skip />
+    <string name="quick_settings_night_display_label" msgid="3577098011487644395">"Nakties šviesa"</string>
+    <string name="quick_settings_night_display_summary_on" msgid="1814901757887526769">"Nakties šviesa įjungta. Palieskite, kad išjungtumėte"</string>
+    <string name="quick_settings_night_display_summary_off" msgid="7892102914128777905">"Nakties šviesa išjungta. Palieskite, kad įjungtumėte"</string>
     <string name="recents_empty_message" msgid="808480104164008572">"Nėra jokių naujausių elementų"</string>
     <string name="recents_empty_message_dismissed_all" msgid="2791312568666558651">"Viską išvalėte"</string>
     <string name="recents_app_info_button_label" msgid="2890317189376000030">"Programos informacija"</string>
diff --git a/packages/SystemUI/res/values-lv/strings.xml b/packages/SystemUI/res/values-lv/strings.xml
index 98a7d2e..f719f98 100644
--- a/packages/SystemUI/res/values-lv/strings.xml
+++ b/packages/SystemUI/res/values-lv/strings.xml
@@ -146,8 +146,7 @@
     <string name="accessibility_data_connection_4g" msgid="7741000750630089612">"4G"</string>
     <string name="accessibility_data_connection_4g_plus" msgid="3032226872470658661">"4G+"</string>
     <string name="accessibility_data_connection_lte" msgid="5413468808637540658">"LTE"</string>
-    <!-- no translation found for accessibility_data_connection_lte_plus (361876866906946007) -->
-    <skip />
+    <string name="accessibility_data_connection_lte_plus" msgid="361876866906946007">"LTE+"</string>
     <string name="accessibility_data_connection_cdma" msgid="6132648193978823023">"CDMA"</string>
     <string name="accessibility_data_connection_roaming" msgid="5977362333466556094">"Viesabonēšana"</string>
     <string name="accessibility_data_connection_edge" msgid="4477457051631979278">"EDGE"</string>
@@ -321,12 +320,9 @@
     <string name="quick_settings_cellular_detail_data_limit" msgid="56011158504994128">"Ierobežojums: <xliff:g id="DATA_LIMIT">%s</xliff:g>"</string>
     <string name="quick_settings_cellular_detail_data_warning" msgid="2440098045692399009">"<xliff:g id="DATA_LIMIT">%s</xliff:g> brīdinājums"</string>
     <string name="quick_settings_work_mode_label" msgid="6244915274350490429">"Darba režīms"</string>
-    <!-- no translation found for quick_settings_night_display_label (3577098011487644395) -->
-    <skip />
-    <!-- no translation found for quick_settings_night_display_summary_on (1814901757887526769) -->
-    <skip />
-    <!-- no translation found for quick_settings_night_display_summary_off (7892102914128777905) -->
-    <skip />
+    <string name="quick_settings_night_display_label" msgid="3577098011487644395">"Nakts režīms"</string>
+    <string name="quick_settings_night_display_summary_on" msgid="1814901757887526769">"Nakts režīms ir ieslēgts. Pieskarieties, lai to izslēgtu."</string>
+    <string name="quick_settings_night_display_summary_off" msgid="7892102914128777905">"Nakts režīms ir izslēgts. Pieskarieties, lai to ieslēgtu."</string>
     <string name="recents_empty_message" msgid="808480104164008572">"Nav nesenu vienumu"</string>
     <string name="recents_empty_message_dismissed_all" msgid="2791312568666558651">"Visi uzdevumi ir notīrīti"</string>
     <string name="recents_app_info_button_label" msgid="2890317189376000030">"Informācija par lietojumprogrammu"</string>
diff --git a/packages/SystemUI/res/values-mk-rMK/strings.xml b/packages/SystemUI/res/values-mk-rMK/strings.xml
index 7884db0..f1f98da 100644
--- a/packages/SystemUI/res/values-mk-rMK/strings.xml
+++ b/packages/SystemUI/res/values-mk-rMK/strings.xml
@@ -145,8 +145,7 @@
     <string name="accessibility_data_connection_4g" msgid="7741000750630089612">"4G"</string>
     <string name="accessibility_data_connection_4g_plus" msgid="3032226872470658661">"4G+"</string>
     <string name="accessibility_data_connection_lte" msgid="5413468808637540658">"LTE"</string>
-    <!-- no translation found for accessibility_data_connection_lte_plus (361876866906946007) -->
-    <skip />
+    <string name="accessibility_data_connection_lte_plus" msgid="361876866906946007">"LTE+"</string>
     <string name="accessibility_data_connection_cdma" msgid="6132648193978823023">"CDMA"</string>
     <string name="accessibility_data_connection_roaming" msgid="5977362333466556094">"Роаминг"</string>
     <string name="accessibility_data_connection_edge" msgid="4477457051631979278">"Edge"</string>
@@ -319,12 +318,9 @@
     <string name="quick_settings_cellular_detail_data_limit" msgid="56011158504994128">"Лимит: <xliff:g id="DATA_LIMIT">%s</xliff:g>"</string>
     <string name="quick_settings_cellular_detail_data_warning" msgid="2440098045692399009">"Предупредување за <xliff:g id="DATA_LIMIT">%s</xliff:g>"</string>
     <string name="quick_settings_work_mode_label" msgid="6244915274350490429">"Режим на работа"</string>
-    <!-- no translation found for quick_settings_night_display_label (3577098011487644395) -->
-    <skip />
-    <!-- no translation found for quick_settings_night_display_summary_on (1814901757887526769) -->
-    <skip />
-    <!-- no translation found for quick_settings_night_display_summary_off (7892102914128777905) -->
-    <skip />
+    <string name="quick_settings_night_display_label" msgid="3577098011487644395">"Ноќно светло"</string>
+    <string name="quick_settings_night_display_summary_on" msgid="1814901757887526769">"Ноќното светло е вклучено, допрете за да се исклучи"</string>
+    <string name="quick_settings_night_display_summary_off" msgid="7892102914128777905">"Ноќното светло е исклучено, допрете за да се вклучи"</string>
     <string name="recents_empty_message" msgid="808480104164008572">"Нема неодамнешни ставки"</string>
     <string name="recents_empty_message_dismissed_all" msgid="2791312568666558651">"Исчистивте сѐ"</string>
     <string name="recents_app_info_button_label" msgid="2890317189376000030">"Информации за апликацијата"</string>
diff --git a/packages/SystemUI/res/values-ml-rIN/strings.xml b/packages/SystemUI/res/values-ml-rIN/strings.xml
index 2a90ee4..9080b48 100644
--- a/packages/SystemUI/res/values-ml-rIN/strings.xml
+++ b/packages/SystemUI/res/values-ml-rIN/strings.xml
@@ -145,8 +145,7 @@
     <string name="accessibility_data_connection_4g" msgid="7741000750630089612">"4G"</string>
     <string name="accessibility_data_connection_4g_plus" msgid="3032226872470658661">"4G+"</string>
     <string name="accessibility_data_connection_lte" msgid="5413468808637540658">"LTE"</string>
-    <!-- no translation found for accessibility_data_connection_lte_plus (361876866906946007) -->
-    <skip />
+    <string name="accessibility_data_connection_lte_plus" msgid="361876866906946007">"LTE+"</string>
     <string name="accessibility_data_connection_cdma" msgid="6132648193978823023">"CDMA"</string>
     <string name="accessibility_data_connection_roaming" msgid="5977362333466556094">"റോമിംഗ്"</string>
     <string name="accessibility_data_connection_edge" msgid="4477457051631979278">"Edge"</string>
@@ -319,12 +318,9 @@
     <string name="quick_settings_cellular_detail_data_limit" msgid="56011158504994128">"<xliff:g id="DATA_LIMIT">%s</xliff:g> പരിധി"</string>
     <string name="quick_settings_cellular_detail_data_warning" msgid="2440098045692399009">"<xliff:g id="DATA_LIMIT">%s</xliff:g> മുന്നറിയിപ്പ്"</string>
     <string name="quick_settings_work_mode_label" msgid="6244915274350490429">"പ്രവർത്തന മോഡ്"</string>
-    <!-- no translation found for quick_settings_night_display_label (3577098011487644395) -->
-    <skip />
-    <!-- no translation found for quick_settings_night_display_summary_on (1814901757887526769) -->
-    <skip />
-    <!-- no translation found for quick_settings_night_display_summary_off (7892102914128777905) -->
-    <skip />
+    <string name="quick_settings_night_display_label" msgid="3577098011487644395">"നൈറ്റ് ലൈറ്റ്"</string>
+    <string name="quick_settings_night_display_summary_on" msgid="1814901757887526769">"നൈറ്റ് ലൈറ്റ് ഓണാണ്, ഓഫാക്കുന്നതിന് ടാപ്പുചെയ്യുക"</string>
+    <string name="quick_settings_night_display_summary_off" msgid="7892102914128777905">"നൈറ്റ് ലൈറ്റ് ഓഫാണ്, ഓണാക്കുന്നതിന് ടാപ്പുചെയ്യുക"</string>
     <string name="recents_empty_message" msgid="808480104164008572">"സമീപകാല ഇനങ്ങൾ ഒന്നുമില്ല"</string>
     <string name="recents_empty_message_dismissed_all" msgid="2791312568666558651">"നിങ്ങൾ എല്ലാം മായ്ച്ചിരിക്കുന്നു"</string>
     <string name="recents_app_info_button_label" msgid="2890317189376000030">"ആപ്പ് വിവരം"</string>
diff --git a/packages/SystemUI/res/values-mn-rMN/strings.xml b/packages/SystemUI/res/values-mn-rMN/strings.xml
index 23c206b..231359c 100644
--- a/packages/SystemUI/res/values-mn-rMN/strings.xml
+++ b/packages/SystemUI/res/values-mn-rMN/strings.xml
@@ -143,8 +143,7 @@
     <string name="accessibility_data_connection_4g" msgid="7741000750630089612">"4G"</string>
     <string name="accessibility_data_connection_4g_plus" msgid="3032226872470658661">"4G+"</string>
     <string name="accessibility_data_connection_lte" msgid="5413468808637540658">"LTE"</string>
-    <!-- no translation found for accessibility_data_connection_lte_plus (361876866906946007) -->
-    <skip />
+    <string name="accessibility_data_connection_lte_plus" msgid="361876866906946007">"LTE+"</string>
     <string name="accessibility_data_connection_cdma" msgid="6132648193978823023">"CDMA"</string>
     <string name="accessibility_data_connection_roaming" msgid="5977362333466556094">"Рүүминг"</string>
     <string name="accessibility_data_connection_edge" msgid="4477457051631979278">"Edge"</string>
@@ -317,12 +316,9 @@
     <string name="quick_settings_cellular_detail_data_limit" msgid="56011158504994128">"<xliff:g id="DATA_LIMIT">%s</xliff:g> хязгаар"</string>
     <string name="quick_settings_cellular_detail_data_warning" msgid="2440098045692399009">"<xliff:g id="DATA_LIMIT">%s</xliff:g> анхааруулга"</string>
     <string name="quick_settings_work_mode_label" msgid="6244915274350490429">"Ажлын горим"</string>
-    <!-- no translation found for quick_settings_night_display_label (3577098011487644395) -->
-    <skip />
-    <!-- no translation found for quick_settings_night_display_summary_on (1814901757887526769) -->
-    <skip />
-    <!-- no translation found for quick_settings_night_display_summary_off (7892102914128777905) -->
-    <skip />
+    <string name="quick_settings_night_display_label" msgid="3577098011487644395">"Шөнийн гэрэл"</string>
+    <string name="quick_settings_night_display_summary_on" msgid="1814901757887526769">"Шөнийн гэрэл асаалттай байна. Унтраахын тулд товшино уу"</string>
+    <string name="quick_settings_night_display_summary_off" msgid="7892102914128777905">"Шөнийн гэрэл унтраалттай байна. Асаахын тулд товшино уу"</string>
     <string name="recents_empty_message" msgid="808480104164008572">"Сүүлийн үеийн зүйл байхгүй"</string>
     <string name="recents_empty_message_dismissed_all" msgid="2791312568666558651">"Та бүгдийг нь устгасан"</string>
     <string name="recents_app_info_button_label" msgid="2890317189376000030">"Аппликешны мэдээлэл"</string>
diff --git a/packages/SystemUI/res/values-mr-rIN/strings.xml b/packages/SystemUI/res/values-mr-rIN/strings.xml
index 1dc2931..99105ca 100644
--- a/packages/SystemUI/res/values-mr-rIN/strings.xml
+++ b/packages/SystemUI/res/values-mr-rIN/strings.xml
@@ -145,8 +145,7 @@
     <string name="accessibility_data_connection_4g" msgid="7741000750630089612">"4G"</string>
     <string name="accessibility_data_connection_4g_plus" msgid="3032226872470658661">"4G+"</string>
     <string name="accessibility_data_connection_lte" msgid="5413468808637540658">"LTE"</string>
-    <!-- no translation found for accessibility_data_connection_lte_plus (361876866906946007) -->
-    <skip />
+    <string name="accessibility_data_connection_lte_plus" msgid="361876866906946007">"LTE+"</string>
     <string name="accessibility_data_connection_cdma" msgid="6132648193978823023">"CDMA"</string>
     <string name="accessibility_data_connection_roaming" msgid="5977362333466556094">"रोमिंग"</string>
     <string name="accessibility_data_connection_edge" msgid="4477457051631979278">"Edge"</string>
@@ -319,12 +318,9 @@
     <string name="quick_settings_cellular_detail_data_limit" msgid="56011158504994128">"<xliff:g id="DATA_LIMIT">%s</xliff:g> मर्यादा"</string>
     <string name="quick_settings_cellular_detail_data_warning" msgid="2440098045692399009">"<xliff:g id="DATA_LIMIT">%s</xliff:g> चेतावणी"</string>
     <string name="quick_settings_work_mode_label" msgid="6244915274350490429">"कार्य मोड"</string>
-    <!-- no translation found for quick_settings_night_display_label (3577098011487644395) -->
-    <skip />
-    <!-- no translation found for quick_settings_night_display_summary_on (1814901757887526769) -->
-    <skip />
-    <!-- no translation found for quick_settings_night_display_summary_off (7892102914128777905) -->
-    <skip />
+    <string name="quick_settings_night_display_label" msgid="3577098011487644395">"रात्रीचा प्रकाश"</string>
+    <string name="quick_settings_night_display_summary_on" msgid="1814901757887526769">"रात्रीचा प्रकाश चालू आहे, बंद करण्यासाठी टॅप करा"</string>
+    <string name="quick_settings_night_display_summary_off" msgid="7892102914128777905">"रात्रीचा प्रकाश बंद आहे, चालू करण्यासाठी टॅप करा"</string>
     <string name="recents_empty_message" msgid="808480104164008572">"अलीकडील कोणतेही आयटम नाहीत"</string>
     <string name="recents_empty_message_dismissed_all" msgid="2791312568666558651">"आपण सर्वकाही साफ केले"</string>
     <string name="recents_app_info_button_label" msgid="2890317189376000030">"अनुप्रयोग माहिती"</string>
diff --git a/packages/SystemUI/res/values-ms-rMY/strings.xml b/packages/SystemUI/res/values-ms-rMY/strings.xml
index 4f1af5e6..400fdb6 100644
--- a/packages/SystemUI/res/values-ms-rMY/strings.xml
+++ b/packages/SystemUI/res/values-ms-rMY/strings.xml
@@ -145,8 +145,7 @@
     <string name="accessibility_data_connection_4g" msgid="7741000750630089612">"4G"</string>
     <string name="accessibility_data_connection_4g_plus" msgid="3032226872470658661">"4G+"</string>
     <string name="accessibility_data_connection_lte" msgid="5413468808637540658">"LTE"</string>
-    <!-- no translation found for accessibility_data_connection_lte_plus (361876866906946007) -->
-    <skip />
+    <string name="accessibility_data_connection_lte_plus" msgid="361876866906946007">"LTE+"</string>
     <string name="accessibility_data_connection_cdma" msgid="6132648193978823023">"CDMA"</string>
     <string name="accessibility_data_connection_roaming" msgid="5977362333466556094">"Perayauan"</string>
     <string name="accessibility_data_connection_edge" msgid="4477457051631979278">"Edge"</string>
@@ -319,12 +318,9 @@
     <string name="quick_settings_cellular_detail_data_limit" msgid="56011158504994128">"<xliff:g id="DATA_LIMIT">%s</xliff:g> had"</string>
     <string name="quick_settings_cellular_detail_data_warning" msgid="2440098045692399009">"Amaran <xliff:g id="DATA_LIMIT">%s</xliff:g>"</string>
     <string name="quick_settings_work_mode_label" msgid="6244915274350490429">"Mod kerja"</string>
-    <!-- no translation found for quick_settings_night_display_label (3577098011487644395) -->
-    <skip />
-    <!-- no translation found for quick_settings_night_display_summary_on (1814901757887526769) -->
-    <skip />
-    <!-- no translation found for quick_settings_night_display_summary_off (7892102914128777905) -->
-    <skip />
+    <string name="quick_settings_night_display_label" msgid="3577098011487644395">"Cahaya Malam"</string>
+    <string name="quick_settings_night_display_summary_on" msgid="1814901757887526769">"Cahaya Malam dihidupkan, ketik untuk mematikannya"</string>
+    <string name="quick_settings_night_display_summary_off" msgid="7892102914128777905">"Cahaya Malam dimatikan, ketik untuk menghidupkannya"</string>
     <string name="recents_empty_message" msgid="808480104164008572">"Tiada item terbaharu"</string>
     <string name="recents_empty_message_dismissed_all" msgid="2791312568666558651">"Anda telah mengetepikan semua item"</string>
     <string name="recents_app_info_button_label" msgid="2890317189376000030">"Maklumat Aplikasi"</string>
diff --git a/packages/SystemUI/res/values-my-rMM/strings.xml b/packages/SystemUI/res/values-my-rMM/strings.xml
index e263bcc..bd5874d 100644
--- a/packages/SystemUI/res/values-my-rMM/strings.xml
+++ b/packages/SystemUI/res/values-my-rMM/strings.xml
@@ -319,8 +319,8 @@
     <string name="quick_settings_cellular_detail_data_warning" msgid="2440098045692399009">"<xliff:g id="DATA_LIMIT">%s</xliff:g> သတိပေးချက်"</string>
     <string name="quick_settings_work_mode_label" msgid="6244915274350490429">"အလုပ် မုဒ်"</string>
     <string name="quick_settings_night_display_label" msgid="3577098011487644395">"ညအလင်းရောင်"</string>
-    <string name="quick_settings_night_display_summary_on" msgid="1814901757887526769">"ညအလင်းရောင်ကိုဖွင့်ထားသည်၊ ပိတ်ရန်တို့ပါ"</string>
-    <string name="quick_settings_night_display_summary_off" msgid="7892102914128777905">"ညအလင်းရောင်ကိုပိတ်ထားသည်၊ ဖွင့်ရန်တို့ပါ"</string>
+    <string name="quick_settings_night_display_summary_on" msgid="1814901757887526769">"ညအလင်းရောင်ကို ဖွင့်ထားသည်၊ ပိတ်ရန်တို့ပါ"</string>
+    <string name="quick_settings_night_display_summary_off" msgid="7892102914128777905">"ညအလင်းရောင်ကို ပိတ်ထားသည်၊ ဖွင့်ရန်တို့ပါ"</string>
     <string name="recents_empty_message" msgid="808480104164008572">"မကြာမီကဖွင့်ထားသည်များ မရှိပါ"</string>
     <string name="recents_empty_message_dismissed_all" msgid="2791312568666558651">"သင်အားလုံးကို ရှင်းလင်းပြီးပါပြီ"</string>
     <string name="recents_app_info_button_label" msgid="2890317189376000030">"အပလီကေးရှင်းအင်ဖို"</string>
diff --git a/packages/SystemUI/res/values-nb/strings.xml b/packages/SystemUI/res/values-nb/strings.xml
index 42bd748..179d90a 100644
--- a/packages/SystemUI/res/values-nb/strings.xml
+++ b/packages/SystemUI/res/values-nb/strings.xml
@@ -145,8 +145,7 @@
     <string name="accessibility_data_connection_4g" msgid="7741000750630089612">"4G"</string>
     <string name="accessibility_data_connection_4g_plus" msgid="3032226872470658661">"4G+"</string>
     <string name="accessibility_data_connection_lte" msgid="5413468808637540658">"LTE"</string>
-    <!-- no translation found for accessibility_data_connection_lte_plus (361876866906946007) -->
-    <skip />
+    <string name="accessibility_data_connection_lte_plus" msgid="361876866906946007">"LTE+"</string>
     <string name="accessibility_data_connection_cdma" msgid="6132648193978823023">"CDMA"</string>
     <string name="accessibility_data_connection_roaming" msgid="5977362333466556094">"Roaming"</string>
     <string name="accessibility_data_connection_edge" msgid="4477457051631979278">"Edge"</string>
@@ -319,12 +318,9 @@
     <string name="quick_settings_cellular_detail_data_limit" msgid="56011158504994128">"Grense på <xliff:g id="DATA_LIMIT">%s</xliff:g>"</string>
     <string name="quick_settings_cellular_detail_data_warning" msgid="2440098045692399009">"Advarsel for <xliff:g id="DATA_LIMIT">%s</xliff:g>"</string>
     <string name="quick_settings_work_mode_label" msgid="6244915274350490429">"Arbeidsmodus"</string>
-    <!-- no translation found for quick_settings_night_display_label (3577098011487644395) -->
-    <skip />
-    <!-- no translation found for quick_settings_night_display_summary_on (1814901757887526769) -->
-    <skip />
-    <!-- no translation found for quick_settings_night_display_summary_off (7892102914128777905) -->
-    <skip />
+    <string name="quick_settings_night_display_label" msgid="3577098011487644395">"Nattlys"</string>
+    <string name="quick_settings_night_display_summary_on" msgid="1814901757887526769">"Nattlys er på, trykk for å slå av"</string>
+    <string name="quick_settings_night_display_summary_off" msgid="7892102914128777905">"Nattlys er av, trykk for å slå på"</string>
     <string name="recents_empty_message" msgid="808480104164008572">"Ingen nylige elementer"</string>
     <string name="recents_empty_message_dismissed_all" msgid="2791312568666558651">"Du har fjernet alt"</string>
     <string name="recents_app_info_button_label" msgid="2890317189376000030">"Appinformasjon"</string>
diff --git a/packages/SystemUI/res/values-nl/strings.xml b/packages/SystemUI/res/values-nl/strings.xml
index 302d0aa..1015379 100644
--- a/packages/SystemUI/res/values-nl/strings.xml
+++ b/packages/SystemUI/res/values-nl/strings.xml
@@ -145,8 +145,7 @@
     <string name="accessibility_data_connection_4g" msgid="7741000750630089612">"4G"</string>
     <string name="accessibility_data_connection_4g_plus" msgid="3032226872470658661">"4G+"</string>
     <string name="accessibility_data_connection_lte" msgid="5413468808637540658">"LTE"</string>
-    <!-- no translation found for accessibility_data_connection_lte_plus (361876866906946007) -->
-    <skip />
+    <string name="accessibility_data_connection_lte_plus" msgid="361876866906946007">"LTE+"</string>
     <string name="accessibility_data_connection_cdma" msgid="6132648193978823023">"CDMA"</string>
     <string name="accessibility_data_connection_roaming" msgid="5977362333466556094">"Roaming"</string>
     <string name="accessibility_data_connection_edge" msgid="4477457051631979278">"Edge"</string>
@@ -319,12 +318,9 @@
     <string name="quick_settings_cellular_detail_data_limit" msgid="56011158504994128">"Limiet van <xliff:g id="DATA_LIMIT">%s</xliff:g>"</string>
     <string name="quick_settings_cellular_detail_data_warning" msgid="2440098045692399009">"Waarschuwing voor <xliff:g id="DATA_LIMIT">%s</xliff:g>"</string>
     <string name="quick_settings_work_mode_label" msgid="6244915274350490429">"Werkmodus"</string>
-    <!-- no translation found for quick_settings_night_display_label (3577098011487644395) -->
-    <skip />
-    <!-- no translation found for quick_settings_night_display_summary_on (1814901757887526769) -->
-    <skip />
-    <!-- no translation found for quick_settings_night_display_summary_off (7892102914128777905) -->
-    <skip />
+    <string name="quick_settings_night_display_label" msgid="3577098011487644395">"Nachtverlichting"</string>
+    <string name="quick_settings_night_display_summary_on" msgid="1814901757887526769">"Nachtverlichting is ingeschakeld. Tik om deze uit te schakelen."</string>
+    <string name="quick_settings_night_display_summary_off" msgid="7892102914128777905">"Nachtverlichting is uitgeschakeld. Tik om deze in te schakelen."</string>
     <string name="recents_empty_message" msgid="808480104164008572">"Geen recente items"</string>
     <string name="recents_empty_message_dismissed_all" msgid="2791312568666558651">"Je hebt alles gewist"</string>
     <string name="recents_app_info_button_label" msgid="2890317189376000030">"App-informatie"</string>
diff --git a/packages/SystemUI/res/values-pa-rIN/strings.xml b/packages/SystemUI/res/values-pa-rIN/strings.xml
index e0edfa3..90334b0 100644
--- a/packages/SystemUI/res/values-pa-rIN/strings.xml
+++ b/packages/SystemUI/res/values-pa-rIN/strings.xml
@@ -145,8 +145,7 @@
     <string name="accessibility_data_connection_4g" msgid="7741000750630089612">"4G"</string>
     <string name="accessibility_data_connection_4g_plus" msgid="3032226872470658661">"4G+"</string>
     <string name="accessibility_data_connection_lte" msgid="5413468808637540658">"LTE"</string>
-    <!-- no translation found for accessibility_data_connection_lte_plus (361876866906946007) -->
-    <skip />
+    <string name="accessibility_data_connection_lte_plus" msgid="361876866906946007">"LTE+"</string>
     <string name="accessibility_data_connection_cdma" msgid="6132648193978823023">"CDMA"</string>
     <string name="accessibility_data_connection_roaming" msgid="5977362333466556094">"ਰੋਮਿੰਗ"</string>
     <string name="accessibility_data_connection_edge" msgid="4477457051631979278">"ਕਿਨਾਰਾ"</string>
@@ -319,12 +318,9 @@
     <string name="quick_settings_cellular_detail_data_limit" msgid="56011158504994128">"<xliff:g id="DATA_LIMIT">%s</xliff:g> ਸੀਮਾ"</string>
     <string name="quick_settings_cellular_detail_data_warning" msgid="2440098045692399009">"<xliff:g id="DATA_LIMIT">%s</xliff:g> ਚਿਤਾਵਨੀ"</string>
     <string name="quick_settings_work_mode_label" msgid="6244915274350490429">"ਕੰਮ ਮੋਡ"</string>
-    <!-- no translation found for quick_settings_night_display_label (3577098011487644395) -->
-    <skip />
-    <!-- no translation found for quick_settings_night_display_summary_on (1814901757887526769) -->
-    <skip />
-    <!-- no translation found for quick_settings_night_display_summary_off (7892102914128777905) -->
-    <skip />
+    <string name="quick_settings_night_display_label" msgid="3577098011487644395">"ਰਾਤਰੀ ਲਾਈਟ"</string>
+    <string name="quick_settings_night_display_summary_on" msgid="1814901757887526769">"ਰਾਤਰੀ ਲਾਈਟ ਚਾਲੂ ਹੈ, ਬੰਦ ਕਰਨ ਲਈ ਟੈਪ ਕਰੋ"</string>
+    <string name="quick_settings_night_display_summary_off" msgid="7892102914128777905">"ਰਾਤਰੀ ਲਾਈਟ ਬੰਦ ਹੈ, ਚਾਲੂ ਕਰਨ ਲਈ ਟੈਪ ਕਰੋ"</string>
     <string name="recents_empty_message" msgid="808480104164008572">"ਕੋਈ ਹਾਲੀਆ ਆਈਟਮਾਂ ਨਹੀਂ"</string>
     <string name="recents_empty_message_dismissed_all" msgid="2791312568666558651">"ਤੁਸੀਂ ਸਭ ਕੁਝ ਸਾਫ਼ ਕਰ ਦਿੱਤਾ ਹੈ"</string>
     <string name="recents_app_info_button_label" msgid="2890317189376000030">"ਐਪਲੀਕੇਸ਼ਨ ਜਾਣਕਾਰੀ"</string>
diff --git a/packages/SystemUI/res/values-pl/strings.xml b/packages/SystemUI/res/values-pl/strings.xml
index b057a14..40caea2 100644
--- a/packages/SystemUI/res/values-pl/strings.xml
+++ b/packages/SystemUI/res/values-pl/strings.xml
@@ -147,8 +147,7 @@
     <string name="accessibility_data_connection_4g" msgid="7741000750630089612">"4G"</string>
     <string name="accessibility_data_connection_4g_plus" msgid="3032226872470658661">"4G+"</string>
     <string name="accessibility_data_connection_lte" msgid="5413468808637540658">"LTE"</string>
-    <!-- no translation found for accessibility_data_connection_lte_plus (361876866906946007) -->
-    <skip />
+    <string name="accessibility_data_connection_lte_plus" msgid="361876866906946007">"LTE+"</string>
     <string name="accessibility_data_connection_cdma" msgid="6132648193978823023">"CDMA"</string>
     <string name="accessibility_data_connection_roaming" msgid="5977362333466556094">"Roaming"</string>
     <string name="accessibility_data_connection_edge" msgid="4477457051631979278">"Edge"</string>
@@ -323,12 +322,9 @@
     <string name="quick_settings_cellular_detail_data_limit" msgid="56011158504994128">"Limit <xliff:g id="DATA_LIMIT">%s</xliff:g>"</string>
     <string name="quick_settings_cellular_detail_data_warning" msgid="2440098045692399009">"Ostrzeżenie: <xliff:g id="DATA_LIMIT">%s</xliff:g>"</string>
     <string name="quick_settings_work_mode_label" msgid="6244915274350490429">"Tryb pracy"</string>
-    <!-- no translation found for quick_settings_night_display_label (3577098011487644395) -->
-    <skip />
-    <!-- no translation found for quick_settings_night_display_summary_on (1814901757887526769) -->
-    <skip />
-    <!-- no translation found for quick_settings_night_display_summary_off (7892102914128777905) -->
-    <skip />
+    <string name="quick_settings_night_display_label" msgid="3577098011487644395">"Podświetlenie nocne"</string>
+    <string name="quick_settings_night_display_summary_on" msgid="1814901757887526769">"Podświetlenie nocne włączone – kliknij, by wyłączyć"</string>
+    <string name="quick_settings_night_display_summary_off" msgid="7892102914128777905">"Podświetlenie nocne wyłączone – kliknij, by włączyć"</string>
     <string name="recents_empty_message" msgid="808480104164008572">"Brak ostatnich elementów"</string>
     <string name="recents_empty_message_dismissed_all" msgid="2791312568666558651">"Wszystko zostało wyczyszczone"</string>
     <string name="recents_app_info_button_label" msgid="2890317189376000030">"Informacje o aplikacji"</string>
diff --git a/packages/SystemUI/res/values-ro/strings.xml b/packages/SystemUI/res/values-ro/strings.xml
index bf55e18..6cdf7e1 100644
--- a/packages/SystemUI/res/values-ro/strings.xml
+++ b/packages/SystemUI/res/values-ro/strings.xml
@@ -146,8 +146,7 @@
     <string name="accessibility_data_connection_4g" msgid="7741000750630089612">"4G"</string>
     <string name="accessibility_data_connection_4g_plus" msgid="3032226872470658661">"4G+"</string>
     <string name="accessibility_data_connection_lte" msgid="5413468808637540658">"LTE"</string>
-    <!-- no translation found for accessibility_data_connection_lte_plus (361876866906946007) -->
-    <skip />
+    <string name="accessibility_data_connection_lte_plus" msgid="361876866906946007">"LTE+"</string>
     <string name="accessibility_data_connection_cdma" msgid="6132648193978823023">"CDMA"</string>
     <string name="accessibility_data_connection_roaming" msgid="5977362333466556094">"Roaming"</string>
     <string name="accessibility_data_connection_edge" msgid="4477457051631979278">"EDGE"</string>
@@ -323,12 +322,9 @@
     <string name="quick_settings_cellular_detail_data_limit" msgid="56011158504994128">"Limită de <xliff:g id="DATA_LIMIT">%s</xliff:g>"</string>
     <string name="quick_settings_cellular_detail_data_warning" msgid="2440098045692399009">"Avertizare: <xliff:g id="DATA_LIMIT">%s</xliff:g>"</string>
     <string name="quick_settings_work_mode_label" msgid="6244915274350490429">"Modul de lucru"</string>
-    <!-- no translation found for quick_settings_night_display_label (3577098011487644395) -->
-    <skip />
-    <!-- no translation found for quick_settings_night_display_summary_on (1814901757887526769) -->
-    <skip />
-    <!-- no translation found for quick_settings_night_display_summary_off (7892102914128777905) -->
-    <skip />
+    <string name="quick_settings_night_display_label" msgid="3577098011487644395">"Lumină de noapte"</string>
+    <string name="quick_settings_night_display_summary_on" msgid="1814901757887526769">"Lumina de noapte este activată; atingeți pentru a o dezactiva"</string>
+    <string name="quick_settings_night_display_summary_off" msgid="7892102914128777905">"Lumina de noapte este dezactivată; atingeți pentru a o activa"</string>
     <string name="recents_empty_message" msgid="808480104164008572">"Niciun element recent"</string>
     <string name="recents_empty_message_dismissed_all" msgid="2791312568666558651">"Ați șters tot"</string>
     <string name="recents_app_info_button_label" msgid="2890317189376000030">"Informații despre aplicație"</string>
diff --git a/packages/SystemUI/res/values-ru/strings.xml b/packages/SystemUI/res/values-ru/strings.xml
index 19b97df..ed7c46f 100644
--- a/packages/SystemUI/res/values-ru/strings.xml
+++ b/packages/SystemUI/res/values-ru/strings.xml
@@ -147,8 +147,7 @@
     <string name="accessibility_data_connection_4g" msgid="7741000750630089612">"4G"</string>
     <string name="accessibility_data_connection_4g_plus" msgid="3032226872470658661">"4G+"</string>
     <string name="accessibility_data_connection_lte" msgid="5413468808637540658">"LTE"</string>
-    <!-- no translation found for accessibility_data_connection_lte_plus (361876866906946007) -->
-    <skip />
+    <string name="accessibility_data_connection_lte_plus" msgid="361876866906946007">"LTE+"</string>
     <string name="accessibility_data_connection_cdma" msgid="6132648193978823023">"CDMA"</string>
     <string name="accessibility_data_connection_roaming" msgid="5977362333466556094">"Роуминг"</string>
     <string name="accessibility_data_connection_edge" msgid="4477457051631979278">"Edge"</string>
@@ -325,12 +324,9 @@
     <string name="quick_settings_cellular_detail_data_limit" msgid="56011158504994128">"Ограничение: <xliff:g id="DATA_LIMIT">%s</xliff:g>"</string>
     <string name="quick_settings_cellular_detail_data_warning" msgid="2440098045692399009">"Предупреждение: <xliff:g id="DATA_LIMIT">%s</xliff:g>"</string>
     <string name="quick_settings_work_mode_label" msgid="6244915274350490429">"Рабочий режим"</string>
-    <!-- no translation found for quick_settings_night_display_label (3577098011487644395) -->
-    <skip />
-    <!-- no translation found for quick_settings_night_display_summary_on (1814901757887526769) -->
-    <skip />
-    <!-- no translation found for quick_settings_night_display_summary_off (7892102914128777905) -->
-    <skip />
+    <string name="quick_settings_night_display_label" msgid="3577098011487644395">"Ночной режим"</string>
+    <string name="quick_settings_night_display_summary_on" msgid="1814901757887526769">"Ночной режим включен. Нажмите, чтобы отключить."</string>
+    <string name="quick_settings_night_display_summary_off" msgid="7892102914128777905">"Ночной режим отключен. Нажмите, чтобы включить."</string>
     <string name="recents_empty_message" msgid="808480104164008572">"Недавних приложений нет"</string>
     <string name="recents_empty_message_dismissed_all" msgid="2791312568666558651">"Вы очистили всё"</string>
     <string name="recents_app_info_button_label" msgid="2890317189376000030">"Сведения о приложении"</string>
diff --git a/packages/SystemUI/res/values-si-rLK/strings.xml b/packages/SystemUI/res/values-si-rLK/strings.xml
index 8555fcb..641a047 100644
--- a/packages/SystemUI/res/values-si-rLK/strings.xml
+++ b/packages/SystemUI/res/values-si-rLK/strings.xml
@@ -145,8 +145,7 @@
     <string name="accessibility_data_connection_4g" msgid="7741000750630089612">"4G"</string>
     <string name="accessibility_data_connection_4g_plus" msgid="3032226872470658661">"4G+"</string>
     <string name="accessibility_data_connection_lte" msgid="5413468808637540658">"LTE"</string>
-    <!-- no translation found for accessibility_data_connection_lte_plus (361876866906946007) -->
-    <skip />
+    <string name="accessibility_data_connection_lte_plus" msgid="361876866906946007">"LTE+"</string>
     <string name="accessibility_data_connection_cdma" msgid="6132648193978823023">"CDMA"</string>
     <string name="accessibility_data_connection_roaming" msgid="5977362333466556094">"රෝමිං"</string>
     <string name="accessibility_data_connection_edge" msgid="4477457051631979278">"Edge"</string>
@@ -319,12 +318,9 @@
     <string name="quick_settings_cellular_detail_data_limit" msgid="56011158504994128">"<xliff:g id="DATA_LIMIT">%s</xliff:g> සීමිත"</string>
     <string name="quick_settings_cellular_detail_data_warning" msgid="2440098045692399009">"<xliff:g id="DATA_LIMIT">%s</xliff:g> අවවාද කිරීම"</string>
     <string name="quick_settings_work_mode_label" msgid="6244915274350490429">"වැඩ ප්‍රකාරය"</string>
-    <!-- no translation found for quick_settings_night_display_label (3577098011487644395) -->
-    <skip />
-    <!-- no translation found for quick_settings_night_display_summary_on (1814901757887526769) -->
-    <skip />
-    <!-- no translation found for quick_settings_night_display_summary_off (7892102914128777905) -->
-    <skip />
+    <string name="quick_settings_night_display_label" msgid="3577098011487644395">"රාත්‍රී ආලෝකය"</string>
+    <string name="quick_settings_night_display_summary_on" msgid="1814901757887526769">"රාත්‍රී ආලෝකය ක්‍රියාත්මකයි, ක්‍රියාවිරහිත කිරීමට තට්ටු කරන්න"</string>
+    <string name="quick_settings_night_display_summary_off" msgid="7892102914128777905">"රාත්‍රී ආලෝකය ක්‍රියාවිරහිතයි, ක්‍රියාත්මක කිරීමට තට්ටු කරන්න"</string>
     <string name="recents_empty_message" msgid="808480104164008572">"මෑත අයිතම නැත"</string>
     <string name="recents_empty_message_dismissed_all" msgid="2791312568666558651">"ඔබ සියලු දේ හිස් කර ඇත"</string>
     <string name="recents_app_info_button_label" msgid="2890317189376000030">"යෙදුම් තොරතුරු"</string>
diff --git a/packages/SystemUI/res/values-sk/strings.xml b/packages/SystemUI/res/values-sk/strings.xml
index c439471..ac96132 100644
--- a/packages/SystemUI/res/values-sk/strings.xml
+++ b/packages/SystemUI/res/values-sk/strings.xml
@@ -592,7 +592,7 @@
     <string name="end" msgid="125797972524818282">"Koniec"</string>
     <string name="space" msgid="804232271282109749">"Medzerník"</string>
     <string name="menu_ime" msgid="4943221416525250684">"Prepínač – ponuka/klávesnica"</string>
-    <string name="select_button" msgid="1597989540662710653">"Výber tlačidla, ktoré sa má pridať"</string>
+    <string name="select_button" msgid="1597989540662710653">"Výber tlačidla"</string>
     <string name="add_button" msgid="4134946063432258161">"Pridať tlačidlo"</string>
     <string name="save" msgid="2311877285724540644">"Uložiť"</string>
     <string name="reset" msgid="2448168080964209908">"Obnoviť"</string>
diff --git a/packages/SystemUI/res/values-sl/strings.xml b/packages/SystemUI/res/values-sl/strings.xml
index bc1e00c..38a4cce 100644
--- a/packages/SystemUI/res/values-sl/strings.xml
+++ b/packages/SystemUI/res/values-sl/strings.xml
@@ -147,8 +147,7 @@
     <string name="accessibility_data_connection_4g" msgid="7741000750630089612">"4G"</string>
     <string name="accessibility_data_connection_4g_plus" msgid="3032226872470658661">"4G+"</string>
     <string name="accessibility_data_connection_lte" msgid="5413468808637540658">"LTE"</string>
-    <!-- no translation found for accessibility_data_connection_lte_plus (361876866906946007) -->
-    <skip />
+    <string name="accessibility_data_connection_lte_plus" msgid="361876866906946007">"LTE+"</string>
     <string name="accessibility_data_connection_cdma" msgid="6132648193978823023">"CDMA"</string>
     <string name="accessibility_data_connection_roaming" msgid="5977362333466556094">"Gostovanje"</string>
     <string name="accessibility_data_connection_edge" msgid="4477457051631979278">"Edge"</string>
@@ -325,12 +324,9 @@
     <string name="quick_settings_cellular_detail_data_limit" msgid="56011158504994128">"Omejitev: <xliff:g id="DATA_LIMIT">%s</xliff:g>"</string>
     <string name="quick_settings_cellular_detail_data_warning" msgid="2440098045692399009">"Opozorilo – <xliff:g id="DATA_LIMIT">%s</xliff:g>"</string>
     <string name="quick_settings_work_mode_label" msgid="6244915274350490429">"Način za delo"</string>
-    <!-- no translation found for quick_settings_night_display_label (3577098011487644395) -->
-    <skip />
-    <!-- no translation found for quick_settings_night_display_summary_on (1814901757887526769) -->
-    <skip />
-    <!-- no translation found for quick_settings_night_display_summary_off (7892102914128777905) -->
-    <skip />
+    <string name="quick_settings_night_display_label" msgid="3577098011487644395">"Nočna svetloba"</string>
+    <string name="quick_settings_night_display_summary_on" msgid="1814901757887526769">"Nočna svetloba je vklopljena. Dotaknite se, če jo želite izklopiti."</string>
+    <string name="quick_settings_night_display_summary_off" msgid="7892102914128777905">"Nočna svetloba je izklopljena. Dotaknite se, če jo želite vklopiti."</string>
     <string name="recents_empty_message" msgid="808480104164008572">"Ni nedavnih elementov"</string>
     <string name="recents_empty_message_dismissed_all" msgid="2791312568666558651">"Vse te počistili"</string>
     <string name="recents_app_info_button_label" msgid="2890317189376000030">"Podatki o aplikaciji"</string>
diff --git a/packages/SystemUI/res/values-sq-rAL/strings.xml b/packages/SystemUI/res/values-sq-rAL/strings.xml
index 054b136..dab11af 100644
--- a/packages/SystemUI/res/values-sq-rAL/strings.xml
+++ b/packages/SystemUI/res/values-sq-rAL/strings.xml
@@ -145,8 +145,7 @@
     <string name="accessibility_data_connection_4g" msgid="7741000750630089612">"4G"</string>
     <string name="accessibility_data_connection_4g_plus" msgid="3032226872470658661">"4G+"</string>
     <string name="accessibility_data_connection_lte" msgid="5413468808637540658">"LTE"</string>
-    <!-- no translation found for accessibility_data_connection_lte_plus (361876866906946007) -->
-    <skip />
+    <string name="accessibility_data_connection_lte_plus" msgid="361876866906946007">"LTE+"</string>
     <string name="accessibility_data_connection_cdma" msgid="6132648193978823023">"Lidhje CDMA"</string>
     <string name="accessibility_data_connection_roaming" msgid="5977362333466556094">"Roaming"</string>
     <string name="accessibility_data_connection_edge" msgid="4477457051631979278">"Edge"</string>
@@ -319,12 +318,9 @@
     <string name="quick_settings_cellular_detail_data_limit" msgid="56011158504994128">"Kufiri: <xliff:g id="DATA_LIMIT">%s</xliff:g>"</string>
     <string name="quick_settings_cellular_detail_data_warning" msgid="2440098045692399009">"Paralajmërim për kufirin prej <xliff:g id="DATA_LIMIT">%s</xliff:g>"</string>
     <string name="quick_settings_work_mode_label" msgid="6244915274350490429">"Modaliteti i punës"</string>
-    <!-- no translation found for quick_settings_night_display_label (3577098011487644395) -->
-    <skip />
-    <!-- no translation found for quick_settings_night_display_summary_on (1814901757887526769) -->
-    <skip />
-    <!-- no translation found for quick_settings_night_display_summary_off (7892102914128777905) -->
-    <skip />
+    <string name="quick_settings_night_display_label" msgid="3577098011487644395">"Drita e natës"</string>
+    <string name="quick_settings_night_display_summary_on" msgid="1814901757887526769">"Drita e natës është joaktive, trokit për ta çaktivizuar"</string>
+    <string name="quick_settings_night_display_summary_off" msgid="7892102914128777905">"Drita e natës është joaktive, trokit për ta aktivizuar"</string>
     <string name="recents_empty_message" msgid="808480104164008572">"Nuk ka asnjë artikull të fundit"</string>
     <string name="recents_empty_message_dismissed_all" msgid="2791312568666558651">"I ke pastruar të gjitha"</string>
     <string name="recents_app_info_button_label" msgid="2890317189376000030">"Informacioni i aplikacionit"</string>
diff --git a/packages/SystemUI/res/values-sr/strings.xml b/packages/SystemUI/res/values-sr/strings.xml
index ecdcabc..8a649a3 100644
--- a/packages/SystemUI/res/values-sr/strings.xml
+++ b/packages/SystemUI/res/values-sr/strings.xml
@@ -146,8 +146,7 @@
     <string name="accessibility_data_connection_4g" msgid="7741000750630089612">"4G"</string>
     <string name="accessibility_data_connection_4g_plus" msgid="3032226872470658661">"4G+"</string>
     <string name="accessibility_data_connection_lte" msgid="5413468808637540658">"LTE"</string>
-    <!-- no translation found for accessibility_data_connection_lte_plus (361876866906946007) -->
-    <skip />
+    <string name="accessibility_data_connection_lte_plus" msgid="361876866906946007">"LTE+"</string>
     <string name="accessibility_data_connection_cdma" msgid="6132648193978823023">"CDMA"</string>
     <string name="accessibility_data_connection_roaming" msgid="5977362333466556094">"Роминг"</string>
     <string name="accessibility_data_connection_edge" msgid="4477457051631979278">"Edge"</string>
@@ -321,12 +320,9 @@
     <string name="quick_settings_cellular_detail_data_limit" msgid="56011158504994128">"Ограничење од <xliff:g id="DATA_LIMIT">%s</xliff:g>"</string>
     <string name="quick_settings_cellular_detail_data_warning" msgid="2440098045692399009">"Упозорење за <xliff:g id="DATA_LIMIT">%s</xliff:g>"</string>
     <string name="quick_settings_work_mode_label" msgid="6244915274350490429">"Режим рада"</string>
-    <!-- no translation found for quick_settings_night_display_label (3577098011487644395) -->
-    <skip />
-    <!-- no translation found for quick_settings_night_display_summary_on (1814901757887526769) -->
-    <skip />
-    <!-- no translation found for quick_settings_night_display_summary_off (7892102914128777905) -->
-    <skip />
+    <string name="quick_settings_night_display_label" msgid="3577098011487644395">"Ноћно светло"</string>
+    <string name="quick_settings_night_display_summary_on" msgid="1814901757887526769">"Ноћно светло је укључено, додирните да бисте га искључили"</string>
+    <string name="quick_settings_night_display_summary_off" msgid="7892102914128777905">"Ноћно светло је искључено, додирните да бисте га укључили"</string>
     <string name="recents_empty_message" msgid="808480104164008572">"Нема недавних ставки"</string>
     <string name="recents_empty_message_dismissed_all" msgid="2791312568666558651">"Обрисали сте све"</string>
     <string name="recents_app_info_button_label" msgid="2890317189376000030">"Информације о апликацији"</string>
diff --git a/packages/SystemUI/res/values-sv/strings.xml b/packages/SystemUI/res/values-sv/strings.xml
index 62dbecb..5164d34 100644
--- a/packages/SystemUI/res/values-sv/strings.xml
+++ b/packages/SystemUI/res/values-sv/strings.xml
@@ -145,8 +145,7 @@
     <string name="accessibility_data_connection_4g" msgid="7741000750630089612">"4G"</string>
     <string name="accessibility_data_connection_4g_plus" msgid="3032226872470658661">"4G+"</string>
     <string name="accessibility_data_connection_lte" msgid="5413468808637540658">"LTE"</string>
-    <!-- no translation found for accessibility_data_connection_lte_plus (361876866906946007) -->
-    <skip />
+    <string name="accessibility_data_connection_lte_plus" msgid="361876866906946007">"LTE+"</string>
     <string name="accessibility_data_connection_cdma" msgid="6132648193978823023">"CDMA"</string>
     <string name="accessibility_data_connection_roaming" msgid="5977362333466556094">"Roaming"</string>
     <string name="accessibility_data_connection_edge" msgid="4477457051631979278">"Edge"</string>
@@ -319,12 +318,9 @@
     <string name="quick_settings_cellular_detail_data_limit" msgid="56011158504994128">"Gräns: <xliff:g id="DATA_LIMIT">%s</xliff:g>"</string>
     <string name="quick_settings_cellular_detail_data_warning" msgid="2440098045692399009">"Varning <xliff:g id="DATA_LIMIT">%s</xliff:g>"</string>
     <string name="quick_settings_work_mode_label" msgid="6244915274350490429">"Arbetsläge"</string>
-    <!-- no translation found for quick_settings_night_display_label (3577098011487644395) -->
-    <skip />
-    <!-- no translation found for quick_settings_night_display_summary_on (1814901757887526769) -->
-    <skip />
-    <!-- no translation found for quick_settings_night_display_summary_off (7892102914128777905) -->
-    <skip />
+    <string name="quick_settings_night_display_label" msgid="3577098011487644395">"Nattljus"</string>
+    <string name="quick_settings_night_display_summary_on" msgid="1814901757887526769">"Nattljus har aktiverats. Tryck för att inaktivera"</string>
+    <string name="quick_settings_night_display_summary_off" msgid="7892102914128777905">"Nattljus har inaktiverats. Tryck för att aktivera"</string>
     <string name="recents_empty_message" msgid="808480104164008572">"Listan med de senaste åtgärderna är tom"</string>
     <string name="recents_empty_message_dismissed_all" msgid="2791312568666558651">"Du har tömt listan"</string>
     <string name="recents_app_info_button_label" msgid="2890317189376000030">"Appinformation"</string>
diff --git a/packages/SystemUI/res/values-ta-rIN/strings.xml b/packages/SystemUI/res/values-ta-rIN/strings.xml
index e50da0c..ace768a 100644
--- a/packages/SystemUI/res/values-ta-rIN/strings.xml
+++ b/packages/SystemUI/res/values-ta-rIN/strings.xml
@@ -145,8 +145,7 @@
     <string name="accessibility_data_connection_4g" msgid="7741000750630089612">"4G"</string>
     <string name="accessibility_data_connection_4g_plus" msgid="3032226872470658661">"4G+"</string>
     <string name="accessibility_data_connection_lte" msgid="5413468808637540658">"LTE"</string>
-    <!-- no translation found for accessibility_data_connection_lte_plus (361876866906946007) -->
-    <skip />
+    <string name="accessibility_data_connection_lte_plus" msgid="361876866906946007">"LTE+"</string>
     <string name="accessibility_data_connection_cdma" msgid="6132648193978823023">"CDMA"</string>
     <string name="accessibility_data_connection_roaming" msgid="5977362333466556094">"ரோமிங்"</string>
     <string name="accessibility_data_connection_edge" msgid="4477457051631979278">"Edge"</string>
@@ -319,12 +318,9 @@
     <string name="quick_settings_cellular_detail_data_limit" msgid="56011158504994128">"<xliff:g id="DATA_LIMIT">%s</xliff:g> வரம்பு"</string>
     <string name="quick_settings_cellular_detail_data_warning" msgid="2440098045692399009">"<xliff:g id="DATA_LIMIT">%s</xliff:g> எச்சரிக்கை"</string>
     <string name="quick_settings_work_mode_label" msgid="6244915274350490429">"பணிப் பயன்முறை"</string>
-    <!-- no translation found for quick_settings_night_display_label (3577098011487644395) -->
-    <skip />
-    <!-- no translation found for quick_settings_night_display_summary_on (1814901757887526769) -->
-    <skip />
-    <!-- no translation found for quick_settings_night_display_summary_off (7892102914128777905) -->
-    <skip />
+    <string name="quick_settings_night_display_label" msgid="3577098011487644395">"இரவு ஒளி"</string>
+    <string name="quick_settings_night_display_summary_on" msgid="1814901757887526769">"இரவு ஒளி இயக்கப்பட்டுள்ளது. முடக்க, தட்டவும்"</string>
+    <string name="quick_settings_night_display_summary_off" msgid="7892102914128777905">"இரவு ஒளி முடக்கப்பட்டுள்ளது. இயக்க, தட்டவும்"</string>
     <string name="recents_empty_message" msgid="808480104164008572">"சமீபத்திய பணிகள் இல்லை"</string>
     <string name="recents_empty_message_dismissed_all" msgid="2791312568666558651">"எல்லாவற்றையும் அழித்துவிட்டீர்கள்"</string>
     <string name="recents_app_info_button_label" msgid="2890317189376000030">"பயன்பாட்டு தகவல்"</string>
diff --git a/packages/SystemUI/res/values-te-rIN/strings.xml b/packages/SystemUI/res/values-te-rIN/strings.xml
index b87342b..0b38abc 100644
--- a/packages/SystemUI/res/values-te-rIN/strings.xml
+++ b/packages/SystemUI/res/values-te-rIN/strings.xml
@@ -145,8 +145,7 @@
     <string name="accessibility_data_connection_4g" msgid="7741000750630089612">"4G"</string>
     <string name="accessibility_data_connection_4g_plus" msgid="3032226872470658661">"4G+"</string>
     <string name="accessibility_data_connection_lte" msgid="5413468808637540658">"LTE"</string>
-    <!-- no translation found for accessibility_data_connection_lte_plus (361876866906946007) -->
-    <skip />
+    <string name="accessibility_data_connection_lte_plus" msgid="361876866906946007">"LTE+"</string>
     <string name="accessibility_data_connection_cdma" msgid="6132648193978823023">"CDMA"</string>
     <string name="accessibility_data_connection_roaming" msgid="5977362333466556094">"రోమింగ్"</string>
     <string name="accessibility_data_connection_edge" msgid="4477457051631979278">"ఎడ్జ్"</string>
@@ -319,12 +318,9 @@
     <string name="quick_settings_cellular_detail_data_limit" msgid="56011158504994128">"<xliff:g id="DATA_LIMIT">%s</xliff:g> పరిమితి"</string>
     <string name="quick_settings_cellular_detail_data_warning" msgid="2440098045692399009">"<xliff:g id="DATA_LIMIT">%s</xliff:g> హెచ్చరిక"</string>
     <string name="quick_settings_work_mode_label" msgid="6244915274350490429">"పని మోడ్"</string>
-    <!-- no translation found for quick_settings_night_display_label (3577098011487644395) -->
-    <skip />
-    <!-- no translation found for quick_settings_night_display_summary_on (1814901757887526769) -->
-    <skip />
-    <!-- no translation found for quick_settings_night_display_summary_off (7892102914128777905) -->
-    <skip />
+    <string name="quick_settings_night_display_label" msgid="3577098011487644395">"రాత్రి కాంతి"</string>
+    <string name="quick_settings_night_display_summary_on" msgid="1814901757887526769">"రాత్రి కాంతి ఆన్‌లో ఉంది, ఆఫ్ చేయడానికి నొక్కండి"</string>
+    <string name="quick_settings_night_display_summary_off" msgid="7892102914128777905">"రాత్రి కాంతి ఆఫ్‌లో ఉంది, ఆన్ చేయడానికి నొక్కండి"</string>
     <string name="recents_empty_message" msgid="808480104164008572">"ఇటీవలి అంశాలు ఏవీ లేవు"</string>
     <string name="recents_empty_message_dismissed_all" msgid="2791312568666558651">"మీరు అన్నింటినీ తీసివేసారు"</string>
     <string name="recents_app_info_button_label" msgid="2890317189376000030">"అనువర్తన సమాచారం"</string>
diff --git a/packages/SystemUI/res/values-tl/strings.xml b/packages/SystemUI/res/values-tl/strings.xml
index f1b153e..3ad94eb 100644
--- a/packages/SystemUI/res/values-tl/strings.xml
+++ b/packages/SystemUI/res/values-tl/strings.xml
@@ -145,8 +145,7 @@
     <string name="accessibility_data_connection_4g" msgid="7741000750630089612">"4G"</string>
     <string name="accessibility_data_connection_4g_plus" msgid="3032226872470658661">"4G+"</string>
     <string name="accessibility_data_connection_lte" msgid="5413468808637540658">"LTE"</string>
-    <!-- no translation found for accessibility_data_connection_lte_plus (361876866906946007) -->
-    <skip />
+    <string name="accessibility_data_connection_lte_plus" msgid="361876866906946007">"LTE+"</string>
     <string name="accessibility_data_connection_cdma" msgid="6132648193978823023">"CDMA"</string>
     <string name="accessibility_data_connection_roaming" msgid="5977362333466556094">"Roaming"</string>
     <string name="accessibility_data_connection_edge" msgid="4477457051631979278">"Edge"</string>
@@ -319,12 +318,9 @@
     <string name="quick_settings_cellular_detail_data_limit" msgid="56011158504994128">"<xliff:g id="DATA_LIMIT">%s</xliff:g> ang limitasyon"</string>
     <string name="quick_settings_cellular_detail_data_warning" msgid="2440098045692399009">"Babala sa <xliff:g id="DATA_LIMIT">%s</xliff:g>"</string>
     <string name="quick_settings_work_mode_label" msgid="6244915274350490429">"Work mode"</string>
-    <!-- no translation found for quick_settings_night_display_label (3577098011487644395) -->
-    <skip />
-    <!-- no translation found for quick_settings_night_display_summary_on (1814901757887526769) -->
-    <skip />
-    <!-- no translation found for quick_settings_night_display_summary_off (7892102914128777905) -->
-    <skip />
+    <string name="quick_settings_night_display_label" msgid="3577098011487644395">"Night Light"</string>
+    <string name="quick_settings_night_display_summary_on" msgid="1814901757887526769">"Naka-on ang Night Light, i-tap upang i-off"</string>
+    <string name="quick_settings_night_display_summary_off" msgid="7892102914128777905">"Naka-off ang Night Light, i-tap upang i-on"</string>
     <string name="recents_empty_message" msgid="808480104164008572">"Walang mga kamakailang item"</string>
     <string name="recents_empty_message_dismissed_all" msgid="2791312568666558651">"Na-clear mo ang lahat"</string>
     <string name="recents_app_info_button_label" msgid="2890317189376000030">"Impormasyon ng Application"</string>
diff --git a/packages/SystemUI/res/values-tr/strings.xml b/packages/SystemUI/res/values-tr/strings.xml
index b6329e2..88a4f746 100644
--- a/packages/SystemUI/res/values-tr/strings.xml
+++ b/packages/SystemUI/res/values-tr/strings.xml
@@ -145,8 +145,7 @@
     <string name="accessibility_data_connection_4g" msgid="7741000750630089612">"4G"</string>
     <string name="accessibility_data_connection_4g_plus" msgid="3032226872470658661">"4G+"</string>
     <string name="accessibility_data_connection_lte" msgid="5413468808637540658">"LTE"</string>
-    <!-- no translation found for accessibility_data_connection_lte_plus (361876866906946007) -->
-    <skip />
+    <string name="accessibility_data_connection_lte_plus" msgid="361876866906946007">"LTE+"</string>
     <string name="accessibility_data_connection_cdma" msgid="6132648193978823023">"CDMA"</string>
     <string name="accessibility_data_connection_roaming" msgid="5977362333466556094">"Dolaşımda"</string>
     <string name="accessibility_data_connection_edge" msgid="4477457051631979278">"Edge"</string>
@@ -319,12 +318,9 @@
     <string name="quick_settings_cellular_detail_data_limit" msgid="56011158504994128">"Sınır: <xliff:g id="DATA_LIMIT">%s</xliff:g>"</string>
     <string name="quick_settings_cellular_detail_data_warning" msgid="2440098045692399009">"<xliff:g id="DATA_LIMIT">%s</xliff:g> uyarısı"</string>
     <string name="quick_settings_work_mode_label" msgid="6244915274350490429">"Çalışma modu"</string>
-    <!-- no translation found for quick_settings_night_display_label (3577098011487644395) -->
-    <skip />
-    <!-- no translation found for quick_settings_night_display_summary_on (1814901757887526769) -->
-    <skip />
-    <!-- no translation found for quick_settings_night_display_summary_off (7892102914128777905) -->
-    <skip />
+    <string name="quick_settings_night_display_label" msgid="3577098011487644395">"Gece Işığı"</string>
+    <string name="quick_settings_night_display_summary_on" msgid="1814901757887526769">"Geçe Işığı açık, kapatmak için dokunun"</string>
+    <string name="quick_settings_night_display_summary_off" msgid="7892102914128777905">"Gece Işığı kapalı, açmak için dokunun"</string>
     <string name="recents_empty_message" msgid="808480104164008572">"Yeni öğe yok"</string>
     <string name="recents_empty_message_dismissed_all" msgid="2791312568666558651">"Her şeyi sildiniz"</string>
     <string name="recents_app_info_button_label" msgid="2890317189376000030">"Uygulama Bilgileri"</string>
diff --git a/packages/SystemUI/res/values-uk/strings.xml b/packages/SystemUI/res/values-uk/strings.xml
index 6e93153..4820554 100644
--- a/packages/SystemUI/res/values-uk/strings.xml
+++ b/packages/SystemUI/res/values-uk/strings.xml
@@ -147,8 +147,7 @@
     <string name="accessibility_data_connection_4g" msgid="7741000750630089612">"4G"</string>
     <string name="accessibility_data_connection_4g_plus" msgid="3032226872470658661">"4G+"</string>
     <string name="accessibility_data_connection_lte" msgid="5413468808637540658">"LTE"</string>
-    <!-- no translation found for accessibility_data_connection_lte_plus (361876866906946007) -->
-    <skip />
+    <string name="accessibility_data_connection_lte_plus" msgid="361876866906946007">"LTE+"</string>
     <string name="accessibility_data_connection_cdma" msgid="6132648193978823023">"CDMA"</string>
     <string name="accessibility_data_connection_roaming" msgid="5977362333466556094">"Роумінг"</string>
     <string name="accessibility_data_connection_edge" msgid="4477457051631979278">"Edge"</string>
@@ -325,12 +324,9 @@
     <string name="quick_settings_cellular_detail_data_limit" msgid="56011158504994128">"Обмеження: <xliff:g id="DATA_LIMIT">%s</xliff:g>"</string>
     <string name="quick_settings_cellular_detail_data_warning" msgid="2440098045692399009">"Застереження: <xliff:g id="DATA_LIMIT">%s</xliff:g>"</string>
     <string name="quick_settings_work_mode_label" msgid="6244915274350490429">"Робочий режим"</string>
-    <!-- no translation found for quick_settings_night_display_label (3577098011487644395) -->
-    <skip />
-    <!-- no translation found for quick_settings_night_display_summary_on (1814901757887526769) -->
-    <skip />
-    <!-- no translation found for quick_settings_night_display_summary_off (7892102914128777905) -->
-    <skip />
+    <string name="quick_settings_night_display_label" msgid="3577098011487644395">"Нічний режим"</string>
+    <string name="quick_settings_night_display_summary_on" msgid="1814901757887526769">"Нічний режим увімкнено. Торкніться, щоб вимкнути його"</string>
+    <string name="quick_settings_night_display_summary_off" msgid="7892102914128777905">"Нічний режим вимкнено. Торкніться, щоб увімкнути його"</string>
     <string name="recents_empty_message" msgid="808480104164008572">"Немає нещодавніх завдань"</string>
     <string name="recents_empty_message_dismissed_all" msgid="2791312568666558651">"Ви очистили все"</string>
     <string name="recents_app_info_button_label" msgid="2890317189376000030">"Інформація про додаток"</string>
diff --git a/packages/SystemUI/res/values-ur-rPK/strings.xml b/packages/SystemUI/res/values-ur-rPK/strings.xml
index cae3a0a..967c688 100644
--- a/packages/SystemUI/res/values-ur-rPK/strings.xml
+++ b/packages/SystemUI/res/values-ur-rPK/strings.xml
@@ -145,8 +145,7 @@
     <string name="accessibility_data_connection_4g" msgid="7741000750630089612">"4G"</string>
     <string name="accessibility_data_connection_4g_plus" msgid="3032226872470658661">"4G+‎"</string>
     <string name="accessibility_data_connection_lte" msgid="5413468808637540658">"LTE"</string>
-    <!-- no translation found for accessibility_data_connection_lte_plus (361876866906946007) -->
-    <skip />
+    <string name="accessibility_data_connection_lte_plus" msgid="361876866906946007">"LTE+‎"</string>
     <string name="accessibility_data_connection_cdma" msgid="6132648193978823023">"CDMA"</string>
     <string name="accessibility_data_connection_roaming" msgid="5977362333466556094">"رومنگ"</string>
     <string name="accessibility_data_connection_edge" msgid="4477457051631979278">"Edge"</string>
@@ -319,12 +318,9 @@
     <string name="quick_settings_cellular_detail_data_limit" msgid="56011158504994128">"<xliff:g id="DATA_LIMIT">%s</xliff:g> حد"</string>
     <string name="quick_settings_cellular_detail_data_warning" msgid="2440098045692399009">"<xliff:g id="DATA_LIMIT">%s</xliff:g> وارننگ"</string>
     <string name="quick_settings_work_mode_label" msgid="6244915274350490429">"کام موڈ"</string>
-    <!-- no translation found for quick_settings_night_display_label (3577098011487644395) -->
-    <skip />
-    <!-- no translation found for quick_settings_night_display_summary_on (1814901757887526769) -->
-    <skip />
-    <!-- no translation found for quick_settings_night_display_summary_off (7892102914128777905) -->
-    <skip />
+    <string name="quick_settings_night_display_label" msgid="3577098011487644395">"نائٹ لائٹ"</string>
+    <string name="quick_settings_night_display_summary_on" msgid="1814901757887526769">"نائٹ لائٹ آن ہے، آف کرنے کیلئے تھپتھپائیں"</string>
+    <string name="quick_settings_night_display_summary_off" msgid="7892102914128777905">"نائٹ لائٹ آف ہے، آن کرنے کیلئے تھپتھپائیں"</string>
     <string name="recents_empty_message" msgid="808480104164008572">"کوئی حالیہ آئٹم نہیں"</string>
     <string name="recents_empty_message_dismissed_all" msgid="2791312568666558651">"آپ نے سب کچھ صاف کر دیا ہے"</string>
     <string name="recents_app_info_button_label" msgid="2890317189376000030">"ایپلیکیشن کی معلومات"</string>
diff --git a/packages/SystemUI/res/values-uz-rUZ/strings.xml b/packages/SystemUI/res/values-uz-rUZ/strings.xml
index 6a95798..6dec3f6 100644
--- a/packages/SystemUI/res/values-uz-rUZ/strings.xml
+++ b/packages/SystemUI/res/values-uz-rUZ/strings.xml
@@ -145,8 +145,7 @@
     <string name="accessibility_data_connection_4g" msgid="7741000750630089612">"4G"</string>
     <string name="accessibility_data_connection_4g_plus" msgid="3032226872470658661">"4G+"</string>
     <string name="accessibility_data_connection_lte" msgid="5413468808637540658">"LTE"</string>
-    <!-- no translation found for accessibility_data_connection_lte_plus (361876866906946007) -->
-    <skip />
+    <string name="accessibility_data_connection_lte_plus" msgid="361876866906946007">"LTE+"</string>
     <string name="accessibility_data_connection_cdma" msgid="6132648193978823023">"CDMA"</string>
     <string name="accessibility_data_connection_roaming" msgid="5977362333466556094">"Rouming"</string>
     <string name="accessibility_data_connection_edge" msgid="4477457051631979278">"Edge"</string>
@@ -321,12 +320,9 @@
     <string name="quick_settings_cellular_detail_data_limit" msgid="56011158504994128">"Cheklov: <xliff:g id="DATA_LIMIT">%s</xliff:g>"</string>
     <string name="quick_settings_cellular_detail_data_warning" msgid="2440098045692399009">"Ogohlantirish: <xliff:g id="DATA_LIMIT">%s</xliff:g>"</string>
     <string name="quick_settings_work_mode_label" msgid="6244915274350490429">"Ish rejimi"</string>
-    <!-- no translation found for quick_settings_night_display_label (3577098011487644395) -->
-    <skip />
-    <!-- no translation found for quick_settings_night_display_summary_on (1814901757887526769) -->
-    <skip />
-    <!-- no translation found for quick_settings_night_display_summary_off (7892102914128777905) -->
-    <skip />
+    <string name="quick_settings_night_display_label" msgid="3577098011487644395">"Tungi rejim"</string>
+    <string name="quick_settings_night_display_summary_on" msgid="1814901757887526769">"Tunji rejim yoniq, o‘chirish uchun bosing"</string>
+    <string name="quick_settings_night_display_summary_off" msgid="7892102914128777905">"Tunji rejim o‘chiq, yoqish uchun bosing"</string>
     <string name="recents_empty_message" msgid="808480104164008572">"Hozircha hech narsa yo‘q"</string>
     <string name="recents_empty_message_dismissed_all" msgid="2791312568666558651">"Hammasi o‘chirildi"</string>
     <string name="recents_app_info_button_label" msgid="2890317189376000030">"Ilova haqida ma’lumot"</string>
diff --git a/packages/SystemUI/res/values-vi/strings.xml b/packages/SystemUI/res/values-vi/strings.xml
index 385054a..cf7cdfa 100644
--- a/packages/SystemUI/res/values-vi/strings.xml
+++ b/packages/SystemUI/res/values-vi/strings.xml
@@ -145,8 +145,7 @@
     <string name="accessibility_data_connection_4g" msgid="7741000750630089612">"4G"</string>
     <string name="accessibility_data_connection_4g_plus" msgid="3032226872470658661">"4G+"</string>
     <string name="accessibility_data_connection_lte" msgid="5413468808637540658">"LTE"</string>
-    <!-- no translation found for accessibility_data_connection_lte_plus (361876866906946007) -->
-    <skip />
+    <string name="accessibility_data_connection_lte_plus" msgid="361876866906946007">"LTE+"</string>
     <string name="accessibility_data_connection_cdma" msgid="6132648193978823023">"CDMA"</string>
     <string name="accessibility_data_connection_roaming" msgid="5977362333466556094">"Chuyển vùng"</string>
     <string name="accessibility_data_connection_edge" msgid="4477457051631979278">"Cạnh"</string>
@@ -319,12 +318,9 @@
     <string name="quick_settings_cellular_detail_data_limit" msgid="56011158504994128">"Giới hạn <xliff:g id="DATA_LIMIT">%s</xliff:g>"</string>
     <string name="quick_settings_cellular_detail_data_warning" msgid="2440098045692399009">"Cảnh báo <xliff:g id="DATA_LIMIT">%s</xliff:g>"</string>
     <string name="quick_settings_work_mode_label" msgid="6244915274350490429">"Chế độ làm việc"</string>
-    <!-- no translation found for quick_settings_night_display_label (3577098011487644395) -->
-    <skip />
-    <!-- no translation found for quick_settings_night_display_summary_on (1814901757887526769) -->
-    <skip />
-    <!-- no translation found for quick_settings_night_display_summary_off (7892102914128777905) -->
-    <skip />
+    <string name="quick_settings_night_display_label" msgid="3577098011487644395">"Đèn đọc sách"</string>
+    <string name="quick_settings_night_display_summary_on" msgid="1814901757887526769">"Đèn đọc sách được bật, nhấn để tắt"</string>
+    <string name="quick_settings_night_display_summary_off" msgid="7892102914128777905">"Đèn đọc sách bị tắt, nhấn để bật"</string>
     <string name="recents_empty_message" msgid="808480104164008572">"Không có mục gần đây nào"</string>
     <string name="recents_empty_message_dismissed_all" msgid="2791312568666558651">"Bạn đã xóa mọi nội dung"</string>
     <string name="recents_app_info_button_label" msgid="2890317189376000030">"Thông tin ứng dụng"</string>
diff --git a/packages/SystemUI/res/values-zh-rCN/strings.xml b/packages/SystemUI/res/values-zh-rCN/strings.xml
index e0d7bba..bdeb188 100644
--- a/packages/SystemUI/res/values-zh-rCN/strings.xml
+++ b/packages/SystemUI/res/values-zh-rCN/strings.xml
@@ -145,8 +145,7 @@
     <string name="accessibility_data_connection_4g" msgid="7741000750630089612">"4G"</string>
     <string name="accessibility_data_connection_4g_plus" msgid="3032226872470658661">"4G+"</string>
     <string name="accessibility_data_connection_lte" msgid="5413468808637540658">"LTE"</string>
-    <!-- no translation found for accessibility_data_connection_lte_plus (361876866906946007) -->
-    <skip />
+    <string name="accessibility_data_connection_lte_plus" msgid="361876866906946007">"LTE+"</string>
     <string name="accessibility_data_connection_cdma" msgid="6132648193978823023">"CDMA"</string>
     <string name="accessibility_data_connection_roaming" msgid="5977362333466556094">"漫游中"</string>
     <string name="accessibility_data_connection_edge" msgid="4477457051631979278">"EDGE"</string>
@@ -319,12 +318,9 @@
     <string name="quick_settings_cellular_detail_data_limit" msgid="56011158504994128">"上限为<xliff:g id="DATA_LIMIT">%s</xliff:g>"</string>
     <string name="quick_settings_cellular_detail_data_warning" msgid="2440098045692399009">"<xliff:g id="DATA_LIMIT">%s</xliff:g>警告"</string>
     <string name="quick_settings_work_mode_label" msgid="6244915274350490429">"工作模式"</string>
-    <!-- no translation found for quick_settings_night_display_label (3577098011487644395) -->
-    <skip />
-    <!-- no translation found for quick_settings_night_display_summary_on (1814901757887526769) -->
-    <skip />
-    <!-- no translation found for quick_settings_night_display_summary_off (7892102914128777905) -->
-    <skip />
+    <string name="quick_settings_night_display_label" msgid="3577098011487644395">"夜间模式"</string>
+    <string name="quick_settings_night_display_summary_on" msgid="1814901757887526769">"夜间模式已开启,点按即可关闭"</string>
+    <string name="quick_settings_night_display_summary_off" msgid="7892102914128777905">"夜间模式已关闭,点按即可开启"</string>
     <string name="recents_empty_message" msgid="808480104164008572">"近期没有任何内容"</string>
     <string name="recents_empty_message_dismissed_all" msgid="2791312568666558651">"您已清除所有内容"</string>
     <string name="recents_app_info_button_label" msgid="2890317189376000030">"应用信息"</string>
diff --git a/packages/SystemUI/res/values-zh-rHK/strings.xml b/packages/SystemUI/res/values-zh-rHK/strings.xml
index 0a90156..bf23c9d 100644
--- a/packages/SystemUI/res/values-zh-rHK/strings.xml
+++ b/packages/SystemUI/res/values-zh-rHK/strings.xml
@@ -145,8 +145,7 @@
     <string name="accessibility_data_connection_4g" msgid="7741000750630089612">"4G"</string>
     <string name="accessibility_data_connection_4g_plus" msgid="3032226872470658661">"4G+"</string>
     <string name="accessibility_data_connection_lte" msgid="5413468808637540658">"LTE"</string>
-    <!-- no translation found for accessibility_data_connection_lte_plus (361876866906946007) -->
-    <skip />
+    <string name="accessibility_data_connection_lte_plus" msgid="361876866906946007">"LTE+"</string>
     <string name="accessibility_data_connection_cdma" msgid="6132648193978823023">"CDMA"</string>
     <string name="accessibility_data_connection_roaming" msgid="5977362333466556094">"漫遊"</string>
     <string name="accessibility_data_connection_edge" msgid="4477457051631979278">"Edge"</string>
@@ -321,12 +320,9 @@
     <string name="quick_settings_cellular_detail_data_limit" msgid="56011158504994128">"上限為 <xliff:g id="DATA_LIMIT">%s</xliff:g>"</string>
     <string name="quick_settings_cellular_detail_data_warning" msgid="2440098045692399009">"<xliff:g id="DATA_LIMIT">%s</xliff:g> 警告"</string>
     <string name="quick_settings_work_mode_label" msgid="6244915274350490429">"工作模式"</string>
-    <!-- no translation found for quick_settings_night_display_label (3577098011487644395) -->
-    <skip />
-    <!-- no translation found for quick_settings_night_display_summary_on (1814901757887526769) -->
-    <skip />
-    <!-- no translation found for quick_settings_night_display_summary_off (7892102914128777905) -->
-    <skip />
+    <string name="quick_settings_night_display_label" msgid="3577098011487644395">"夜燈模式"</string>
+    <string name="quick_settings_night_display_summary_on" msgid="1814901757887526769">"夜燈模式已開啟,輕按即可關閉"</string>
+    <string name="quick_settings_night_display_summary_off" msgid="7892102914128777905">"夜燈模式已關閉,輕按即可開啟"</string>
     <string name="recents_empty_message" msgid="808480104164008572">"沒有最近項目"</string>
     <string name="recents_empty_message_dismissed_all" msgid="2791312568666558651">"您已清除所有項目"</string>
     <string name="recents_app_info_button_label" msgid="2890317189376000030">"應用程式資料"</string>
diff --git a/packages/SystemUI/res/values-zh-rTW/strings.xml b/packages/SystemUI/res/values-zh-rTW/strings.xml
index b70cc7b..4bec5a7 100644
--- a/packages/SystemUI/res/values-zh-rTW/strings.xml
+++ b/packages/SystemUI/res/values-zh-rTW/strings.xml
@@ -145,8 +145,7 @@
     <string name="accessibility_data_connection_4g" msgid="7741000750630089612">"4G"</string>
     <string name="accessibility_data_connection_4g_plus" msgid="3032226872470658661">"4G+"</string>
     <string name="accessibility_data_connection_lte" msgid="5413468808637540658">"LTE"</string>
-    <!-- no translation found for accessibility_data_connection_lte_plus (361876866906946007) -->
-    <skip />
+    <string name="accessibility_data_connection_lte_plus" msgid="361876866906946007">"LTE+"</string>
     <string name="accessibility_data_connection_cdma" msgid="6132648193978823023">"CDMA"</string>
     <string name="accessibility_data_connection_roaming" msgid="5977362333466556094">"漫遊中"</string>
     <string name="accessibility_data_connection_edge" msgid="4477457051631979278">"Edge"</string>
@@ -319,12 +318,9 @@
     <string name="quick_settings_cellular_detail_data_limit" msgid="56011158504994128">"上限為 <xliff:g id="DATA_LIMIT">%s</xliff:g>"</string>
     <string name="quick_settings_cellular_detail_data_warning" msgid="2440098045692399009">"<xliff:g id="DATA_LIMIT">%s</xliff:g> 警告"</string>
     <string name="quick_settings_work_mode_label" msgid="6244915274350490429">"工作模式"</string>
-    <!-- no translation found for quick_settings_night_display_label (3577098011487644395) -->
-    <skip />
-    <!-- no translation found for quick_settings_night_display_summary_on (1814901757887526769) -->
-    <skip />
-    <!-- no translation found for quick_settings_night_display_summary_off (7892102914128777905) -->
-    <skip />
+    <string name="quick_settings_night_display_label" msgid="3577098011487644395">"夜燈"</string>
+    <string name="quick_settings_night_display_summary_on" msgid="1814901757887526769">"夜燈功能已開啟,輕觸即可關閉"</string>
+    <string name="quick_settings_night_display_summary_off" msgid="7892102914128777905">"夜燈功能已關閉,輕觸即可開啟"</string>
     <string name="recents_empty_message" msgid="808480104164008572">"最近沒有任何項目"</string>
     <string name="recents_empty_message_dismissed_all" msgid="2791312568666558651">"您已清除所有工作"</string>
     <string name="recents_app_info_button_label" msgid="2890317189376000030">"應用程式資訊"</string>
diff --git a/packages/SystemUI/src/com/android/systemui/qs/PagedTileLayout.java b/packages/SystemUI/src/com/android/systemui/qs/PagedTileLayout.java
index 71bd798..afedbe3 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/PagedTileLayout.java
+++ b/packages/SystemUI/src/com/android/systemui/qs/PagedTileLayout.java
@@ -10,6 +10,7 @@
 import android.view.LayoutInflater;
 import android.view.View;
 import android.view.ViewGroup;
+
 import com.android.systemui.R;
 import com.android.systemui.qs.QSPanel.QSTileLayout;
 import com.android.systemui.qs.QSPanel.TileRecord;
@@ -207,6 +208,7 @@
             }
             if (DEBUG) Log.d(TAG, "Size: " + mNumPages);
             mPageIndicator.setNumPages(mNumPages);
+            mDecorGroup.setVisibility(mNumPages > 1 ? View.VISIBLE : View.GONE);
             setAdapter(mAdapter);
             mAdapter.notifyDataSetChanged();
             setCurrentItem(0, false);
@@ -238,7 +240,8 @@
                 maxHeight = height;
             }
         }
-        setMeasuredDimension(getMeasuredWidth(), maxHeight + mDecorGroup.getMeasuredHeight());
+        setMeasuredDimension(getMeasuredWidth(), maxHeight
+                + (mDecorGroup.getVisibility() != View.GONE ? mDecorGroup.getMeasuredHeight() : 0));
     }
 
     private final Runnable mDistribute = new Runnable() {
diff --git a/packages/SystemUI/src/com/android/systemui/qs/QSAnimator.java b/packages/SystemUI/src/com/android/systemui/qs/QSAnimator.java
index fb40c65..8613aeb 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/QSAnimator.java
+++ b/packages/SystemUI/src/com/android/systemui/qs/QSAnimator.java
@@ -230,7 +230,9 @@
             // Fade in the tiles/labels as we reach the final position.
             mFirstPageDelayedAnimator = new TouchAnimator.Builder()
                     .setStartDelay(EXPANDED_TILE_DELAY)
-                    .addFloat(mQsPanel.getTileLayout(), "alpha", 0, 1).build();
+                    .addFloat(mQsPanel.getTileLayout(), "alpha", 0, 1)
+                    .addFloat(mQsPanel.getFooter().getView(), "alpha", 0, 1).build();
+            mAllViews.add(mQsPanel.getFooter().getView());
             Path path = new Path();
             path.moveTo(0, 0);
             path.cubicTo(0, 0, 0, 1, 1, 1);
diff --git a/packages/SystemUI/src/com/android/systemui/qs/QSDetail.java b/packages/SystemUI/src/com/android/systemui/qs/QSDetail.java
index 4343f62..90b2e90 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/QSDetail.java
+++ b/packages/SystemUI/src/com/android/systemui/qs/QSDetail.java
@@ -67,7 +67,7 @@
     private boolean mTriggeredExpand;
     private int mOpenX;
     private int mOpenY;
-    private boolean mAnimating;
+    private boolean mAnimatingOpen;
     private boolean mSwitchState;
 
     public QSDetail(Context context, @Nullable AttributeSet attrs) {
@@ -214,7 +214,7 @@
 
     protected void animateDetailVisibleDiff(int x, int y, boolean visibleDiff, AnimatorListener listener) {
         if (visibleDiff) {
-            mAnimating = true;
+            mAnimatingOpen = mDetailAdapter != null;
             if (mFullyExpanded || mDetailAdapter != null) {
                 setAlpha(1);
                 mClipper.animateCircularClip(x, y, mDetailAdapter != null, listener);
@@ -246,7 +246,7 @@
             mQsDetailHeader.setClickable(false);
         } else {
             mQsDetailHeaderSwitch.setVisibility(VISIBLE);
-            handleToggleStateChanged(toggleState);
+            handleToggleStateChanged(toggleState, adapter.getToggleEnabled());
             mQsDetailHeader.setClickable(true);
             mQsDetailHeader.setOnClickListener(new OnClickListener() {
                 @Override
@@ -259,13 +259,12 @@
         }
     }
 
-    private void handleToggleStateChanged(boolean state) {
+    private void handleToggleStateChanged(boolean state, boolean toggleEnabled) {
         mSwitchState = state;
-        if (mAnimating) {
+        if (mAnimatingOpen) {
             return;
         }
         mQsDetailHeaderSwitch.setChecked(state);
-        final boolean toggleEnabled = mDetailAdapter != null && mDetailAdapter.getToggleEnabled();
         mQsDetailHeader.setEnabled(toggleEnabled);
         mQsDetailHeaderSwitch.setEnabled(toggleEnabled);
     }
@@ -284,7 +283,8 @@
     }
 
     private void checkPendingAnimations() {
-        handleToggleStateChanged(mSwitchState);
+        handleToggleStateChanged(mSwitchState,
+                            mDetailAdapter != null && mDetailAdapter.getToggleEnabled());
     }
 
     protected QSPanel.Callback mQsPanelCallback = new QSPanel.Callback() {
@@ -293,7 +293,8 @@
             post(new Runnable() {
                 @Override
                 public void run() {
-                    handleToggleStateChanged(state);
+                    handleToggleStateChanged(state,
+                            mDetailAdapter != null && mDetailAdapter.getToggleEnabled());
                 }
             });
         }
@@ -324,7 +325,7 @@
             // If we have been cancelled, remove the listener so that onAnimationEnd doesn't get
             // called, this will avoid accidentally turning off the grid when we don't want to.
             animation.removeListener(this);
-            mAnimating = false;
+            mAnimatingOpen = false;
             checkPendingAnimations();
         };
 
@@ -335,7 +336,7 @@
                 mQsPanel.setGridContentVisibility(false);
                 mHeader.setVisibility(View.INVISIBLE);
             }
-            mAnimating = false;
+            mAnimatingOpen = false;
             checkPendingAnimations();
         }
     };
diff --git a/packages/SystemUI/src/com/android/systemui/qs/QSPanel.java b/packages/SystemUI/src/com/android/systemui/qs/QSPanel.java
index 1e9acf3..7ad5054 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/QSPanel.java
+++ b/packages/SystemUI/src/com/android/systemui/qs/QSPanel.java
@@ -23,7 +23,6 @@
 import android.os.Handler;
 import android.os.Message;
 import android.util.AttributeSet;
-import android.util.Log;
 import android.view.LayoutInflater;
 import android.view.View;
 import android.widget.ImageView;
@@ -512,6 +511,10 @@
         return null;
     }
 
+    public QSFooter getFooter() {
+        return mFooter;
+    }
+
     private class H extends Handler {
         private static final int SHOW_DETAIL = 1;
         private static final int SET_TILE_VISIBILITY = 2;
diff --git a/packages/SystemUI/src/com/android/systemui/qs/tiles/NightDisplayTile.java b/packages/SystemUI/src/com/android/systemui/qs/tiles/NightDisplayTile.java
index 9a3549e..2d1f753 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/tiles/NightDisplayTile.java
+++ b/packages/SystemUI/src/com/android/systemui/qs/tiles/NightDisplayTile.java
@@ -74,7 +74,7 @@
 
     @Override
     public Intent getLongClickIntent() {
-        return new Intent(Settings.ACTION_DISPLAY_SETTINGS);
+        return new Intent(Settings.ACTION_NIGHT_DISPLAY_SETTINGS);
     }
 
     @Override
diff --git a/packages/SystemUI/src/com/android/systemui/shortcut/ShortcutKeyDispatcher.java b/packages/SystemUI/src/com/android/systemui/shortcut/ShortcutKeyDispatcher.java
index 0aeb7b4..15d26f9 100644
--- a/packages/SystemUI/src/com/android/systemui/shortcut/ShortcutKeyDispatcher.java
+++ b/packages/SystemUI/src/com/android/systemui/shortcut/ShortcutKeyDispatcher.java
@@ -25,6 +25,8 @@
 import android.content.pm.ServiceInfo;
 import android.content.res.Configuration;
 import android.os.RemoteException;
+import android.os.UserHandle;
+import android.util.ArraySet;
 import android.util.DisplayMetrics;
 import android.util.Log;
 import android.view.IWindowManager;
@@ -39,6 +41,7 @@
 import com.android.systemui.R;
 import com.android.systemui.SystemUI;
 import com.android.systemui.recents.Recents;
+import com.android.systemui.recents.misc.SystemServicesProxy;
 import com.android.systemui.stackdivider.Divider;
 import com.android.systemui.stackdivider.DividerView;
 import com.android.systemui.statusbar.phone.NavigationBarGestureHelper;
@@ -102,8 +105,16 @@
                 int dockMode = (shortcutCode == SC_DOCK_LEFT)
                         ? ActivityManager.DOCKED_STACK_CREATE_MODE_TOP_OR_LEFT
                         : ActivityManager.DOCKED_STACK_CREATE_MODE_BOTTOM_OR_RIGHT;
-                recents.dockTopTask(NavigationBarGestureHelper.DRAG_MODE_NONE, dockMode, null,
-                        MetricsEvent.WINDOW_DOCK_SHORTCUTS);
+                List<ActivityManager.RecentTaskInfo> taskList =
+                        SystemServicesProxy.getInstance(mContext).getRecentTasks(1,
+                                UserHandle.USER_CURRENT, false, new ArraySet<>());
+                recents.showRecents(
+                        false /* triggeredFromAltTab */,
+                        false /* fromHome */);
+                if (!taskList.isEmpty()) {
+                    SystemServicesProxy.getInstance(mContext).startTaskInDockedMode(
+                            taskList.get(0).id, dockMode);
+                }
             } else {
                 // If there is already a docked window, we respond by resizing the docking pane.
                 DividerView dividerView = getComponent(Divider.class).getView();
@@ -111,11 +122,11 @@
                 int dividerPosition = dividerView.getCurrentPosition();
                 DividerSnapAlgorithm.SnapTarget currentTarget =
                         snapAlgorithm.calculateNonDismissingSnapTarget(dividerPosition);
-                int increment = (shortcutCode == SC_DOCK_LEFT) ? -1 : 1;
-                DividerSnapAlgorithm.SnapTarget target = snapAlgorithm.cycleNonDismissTarget(
-                        currentTarget, increment);
+                DividerSnapAlgorithm.SnapTarget target = (shortcutCode == SC_DOCK_LEFT)
+                        ? snapAlgorithm.getPreviousTarget(currentTarget)
+                        : snapAlgorithm.getNextTarget(currentTarget);
                 dividerView.startDragging(true /* animate */, false /* touching */);
-                dividerView.stopDragging(target.position, 0f, true /* avoidDismissStart */,
+                dividerView.stopDragging(target.position, 0f, false /* avoidDismissStart */,
                         true /* logMetrics */);
             }
         } catch (RemoteException e) {
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/ActivatableNotificationView.java b/packages/SystemUI/src/com/android/systemui/statusbar/ActivatableNotificationView.java
index 42c9a126..9afb384 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/ActivatableNotificationView.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/ActivatableNotificationView.java
@@ -137,11 +137,13 @@
 
     private float mNormalBackgroundVisibilityAmount;
     private ValueAnimator mFadeInFromDarkAnimator;
+    private float mDimmedBackgroundFadeInAmount = -1;
     private ValueAnimator.AnimatorUpdateListener mBackgroundVisibilityUpdater
             = new ValueAnimator.AnimatorUpdateListener() {
         @Override
         public void onAnimationUpdate(ValueAnimator animation) {
             setNormalBackgroundVisibilityAmount(mBackgroundNormal.getAlpha());
+            mDimmedBackgroundFadeInAmount = mBackgroundDimmed.getAlpha();
         }
     };
     private AnimatorListenerAdapter mFadeInEndListener = new AnimatorListenerAdapter() {
@@ -149,6 +151,7 @@
         public void onAnimationEnd(Animator animation) {
             super.onAnimationEnd(animation);
             mFadeInFromDarkAnimator = null;
+            mDimmedBackgroundFadeInAmount = -1;
             updateBackground();
         }
     };
@@ -597,7 +600,10 @@
     }
 
     protected void updateBackgroundAlpha(float transformationAmount) {
-        mBgAlpha = isChildInGroup() && mDimmed ? transformationAmount : 1f;
+        mBgAlpha =  isChildInGroup() && mDimmed ? transformationAmount : 1f;
+        if (mDimmedBackgroundFadeInAmount != -1) {
+            mBgAlpha *= mDimmedBackgroundFadeInAmount;
+        }
         mBackgroundDimmed.setAlpha(mBgAlpha);
     }
 
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java
index d62d34d..d93889c 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java
@@ -40,7 +40,6 @@
 import android.content.pm.PackageManager.NameNotFoundException;
 import android.content.pm.UserInfo;
 import android.content.res.Configuration;
-import android.content.res.Resources;
 import android.database.ContentObserver;
 import android.graphics.Rect;
 import android.graphics.drawable.Drawable;
@@ -971,18 +970,15 @@
         }
     }
 
-    protected View bindVetoButtonClickListener(View row, final StatusBarNotification n) {
-        View vetoButton = row.findViewById(R.id.veto);
-        vetoButton.setOnClickListener(new View.OnClickListener() {
+    protected void bindDismissListener(final ExpandableNotificationRow row) {
+        row.setOnDismissListener(new View.OnClickListener() {
             public void onClick(View v) {
                 // Accessibility feedback
                 v.announceForAccessibility(
                         mContext.getString(R.string.accessibility_notification_dismissed));
-                performRemoveNotification(n, false /* removeView */);
+                performRemoveNotification(row.getStatusBarNotification(), false /* removeView */);
             }
         });
-        vetoButton.setImportantForAccessibility(View.IMPORTANT_FOR_ACCESSIBILITY_NO);
-        return vetoButton;
     }
 
     protected void performRemoveNotification(StatusBarNotification n, boolean removeView) {
@@ -1659,9 +1655,7 @@
         }
 
         workAroundBadLayerDrawableOpacity(row);
-        View vetoButton = bindVetoButtonClickListener(row, sbn);
-        vetoButton.setContentDescription(mContext.getString(
-                R.string.accessibility_remove_notification));
+        bindDismissListener(row);
 
         // NB: the large icon is now handled entirely by the template
 
@@ -2421,10 +2415,6 @@
         updateHeadsUp(key, entry, shouldPeek, alertAgain);
         updateNotifications();
 
-        // Update the veto button accordingly (and as a result, whether this row is
-        // swipe-dismissable)
-        bindVetoButtonClickListener(entry.row, notification);
-
         if (!notification.isClearable()) {
             // The user may have performed a dismiss action on the notification, since it's
             // not clearable we should snap it back.
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/ExpandableNotificationRow.java b/packages/SystemUI/src/com/android/systemui/statusbar/ExpandableNotificationRow.java
index f09eae8..58d402b 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/ExpandableNotificationRow.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/ExpandableNotificationRow.java
@@ -109,7 +109,6 @@
     private int mHeadsUpHeight;
     private View mVetoButton;
     private int mNotificationColor;
-    private boolean mClearable;
     private ExpansionLogger mLogger;
     private String mLoggingKey;
     private NotificationSettingsIconRow mSettingsIconRow;
@@ -280,7 +279,6 @@
         mPublicLayout.onNotificationUpdated(entry);
         mShowingPublicInitialized = false;
         updateNotificationColor();
-        updateClearability();
         if (mIsSummaryWithChildren) {
             mChildrenContainer.recreateNotificationHeader(mExpandClickListener, mEntry.notification);
             mChildrenContainer.onNotificationUpdated();
@@ -779,6 +777,14 @@
         return mGroupParentWhenDismissed;
     }
 
+    public void performDismiss() {
+        mVetoButton.performClick();
+    }
+
+    public void setOnDismissListener(OnClickListener listener) {
+        mVetoButton.setOnClickListener(listener);
+    }
+
     public interface ExpansionLogger {
         public void logNotificationExpansion(String key, boolean userAction, boolean expanded);
     }
@@ -880,6 +886,9 @@
             }
         });
         mVetoButton = findViewById(R.id.veto);
+        mVetoButton.setImportantForAccessibility(View.IMPORTANT_FOR_ACCESSIBILITY_NO);
+        mVetoButton.setContentDescription(mContext.getString(
+                R.string.accessibility_remove_notification));
 
         // Add the views that we translate to reveal the gear
         mTranslateableViews = new ArrayList<View>();
@@ -893,6 +902,10 @@
         mTranslateableViews.remove(mGutsStub);
     }
 
+    public View getVetoButton() {
+        return mVetoButton;
+    }
+
     public void resetTranslation() {
         if (mTranslateableViews != null) {
             for (int i = 0; i < mTranslateableViews.size(); i++) {
@@ -1109,7 +1122,7 @@
         mPrivateLayout.setUserExpanding(userLocked);
         if (mIsSummaryWithChildren) {
             mChildrenContainer.setUserLocked(userLocked);
-            if (userLocked || (!userLocked && !isGroupExpanded())) {
+            if (userLocked || !isGroupExpanded()) {
                 updateBackgroundForGroupState();
             }
         }
@@ -1157,10 +1170,25 @@
     }
 
     /**
-     * @return Can the underlying notification be cleared?
+     * @return Can the underlying notification be cleared? This can be different from whether the
+     *         notification can be dismissed in case notifications are sensitive on the lockscreen.
+     * @see #canViewBeDismissed()
      */
     public boolean isClearable() {
-        return mStatusBarNotification != null && mStatusBarNotification.isClearable();
+        if (mStatusBarNotification == null || !mStatusBarNotification.isClearable()) {
+            return false;
+        }
+        if (mIsSummaryWithChildren) {
+            List<ExpandableNotificationRow> notificationChildren =
+                    mChildrenContainer.getNotificationChildren();
+            for (int i = 0; i < notificationChildren.size(); i++) {
+                ExpandableNotificationRow child = notificationChildren.get(i);
+                if (!child.isClearable()) {
+                    return false;
+                }
+            }
+        }
+        return true;
     }
 
     @Override
@@ -1317,7 +1345,6 @@
         NotificationContentView showingLayout = getShowingLayout();
         showingLayout.updateBackgroundColor(animated);
         mPrivateLayout.updateExpandButtons(isExpandable());
-        updateClearability();
         mShowingPublicInitialized = true;
     }
 
@@ -1357,12 +1384,12 @@
         return mIsHeadsUp;
     }
 
-    private void updateClearability() {
-        // public versions cannot be dismissed
-        mVetoButton.setVisibility(canViewBeDismissed() ? View.VISIBLE : View.GONE);
-    }
-
-    private boolean canViewBeDismissed() {
+    /**
+     * @return Whether this view is allowed to be dismissed. Only valid for visible notifications as
+     *         otherwise some state might not be updated. To request about the general clearability
+     *         see {@link #isClearable()}.
+     */
+    public boolean canViewBeDismissed() {
         return isClearable() && (!mShowingPublic || !mSensitiveHiddenInGeneral);
     }
 
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/NotificationHeaderViewWrapper.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/NotificationHeaderViewWrapper.java
index 7794d5b..3e4c758 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/NotificationHeaderViewWrapper.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/NotificationHeaderViewWrapper.java
@@ -240,7 +240,11 @@
         // Also, the notification might have been modified during the animation, so background
         // might be null here.
         if (iconDrawable != null) {
-            iconDrawable.mutate().setColorFilter(mIconColorFilter);
+            Drawable d = iconDrawable.mutate();
+            // DrawableContainer ignores the color filter if it's already set, so clear it first to
+            // get it set and invalidated properly.
+            d.setColorFilter(null);
+            d.setColorFilter(mIconColorFilter);
         }
     }
 
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelView.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelView.java
index e4aa103..af85101 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelView.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelView.java
@@ -209,6 +209,9 @@
 
     public void setTouchDisabled(boolean disabled) {
         mTouchDisabled = disabled;
+        if (mTouchDisabled && mTracking) {
+            onTrackingStopped(true /* expanded */);
+        }
     }
 
     @Override
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
index 2cdcff3..3249091 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
@@ -17,6 +17,19 @@
 package com.android.systemui.statusbar.phone;
 
 
+import static android.app.StatusBarManager.NAVIGATION_HINT_BACK_ALT;
+import static android.app.StatusBarManager.NAVIGATION_HINT_IME_SHOWN;
+import static android.app.StatusBarManager.WINDOW_STATE_HIDDEN;
+import static android.app.StatusBarManager.WINDOW_STATE_SHOWING;
+import static android.app.StatusBarManager.windowStateToString;
+import static com.android.systemui.statusbar.phone.BarTransitions.MODE_LIGHTS_OUT;
+import static com.android.systemui.statusbar.phone.BarTransitions.MODE_LIGHTS_OUT_TRANSPARENT;
+import static com.android.systemui.statusbar.phone.BarTransitions.MODE_OPAQUE;
+import static com.android.systemui.statusbar.phone.BarTransitions.MODE_SEMI_TRANSPARENT;
+import static com.android.systemui.statusbar.phone.BarTransitions.MODE_TRANSLUCENT;
+import static com.android.systemui.statusbar.phone.BarTransitions.MODE_TRANSPARENT;
+import static com.android.systemui.statusbar.phone.BarTransitions.MODE_WARNING;
+
 import android.animation.Animator;
 import android.animation.AnimatorListenerAdapter;
 import android.annotation.NonNull;
@@ -78,6 +91,7 @@
 import android.service.notification.NotificationListenerService;
 import android.service.notification.NotificationListenerService.RankingMap;
 import android.service.notification.StatusBarNotification;
+import android.telecom.TelecomManager;
 import android.util.ArraySet;
 import android.util.DisplayMetrics;
 import android.util.EventLog;
@@ -99,6 +113,7 @@
 import android.view.animation.Interpolator;
 import android.widget.ImageView;
 import android.widget.TextView;
+
 import com.android.internal.logging.MetricsLogger;
 import com.android.internal.logging.MetricsProto.MetricsEvent;
 import com.android.internal.statusbar.NotificationVisibility;
@@ -117,7 +132,6 @@
 import com.android.systemui.Prefs;
 import com.android.systemui.R;
 import com.android.systemui.SystemUIFactory;
-import com.android.systemui.assist.AssistManager;
 import com.android.systemui.classifier.FalsingLog;
 import com.android.systemui.classifier.FalsingManager;
 import com.android.systemui.doze.DozeHost;
@@ -172,7 +186,8 @@
 import com.android.systemui.statusbar.policy.UserSwitcherController;
 import com.android.systemui.statusbar.policy.ZenModeController;
 import com.android.systemui.statusbar.stack.NotificationStackScrollLayout;
-import com.android.systemui.statusbar.stack.NotificationStackScrollLayout.OnChildLocationsChangedListener;
+import com.android.systemui.statusbar.stack.NotificationStackScrollLayout
+        .OnChildLocationsChangedListener;
 import com.android.systemui.statusbar.stack.StackStateAnimator;
 import com.android.systemui.statusbar.stack.StackViewState;
 import com.android.systemui.volume.VolumeComponent;
@@ -186,19 +201,6 @@
 import java.util.List;
 import java.util.Map;
 
-import static android.app.StatusBarManager.NAVIGATION_HINT_BACK_ALT;
-import static android.app.StatusBarManager.NAVIGATION_HINT_IME_SHOWN;
-import static android.app.StatusBarManager.WINDOW_STATE_HIDDEN;
-import static android.app.StatusBarManager.WINDOW_STATE_SHOWING;
-import static android.app.StatusBarManager.windowStateToString;
-import static com.android.systemui.statusbar.phone.BarTransitions.MODE_LIGHTS_OUT;
-import static com.android.systemui.statusbar.phone.BarTransitions.MODE_LIGHTS_OUT_TRANSPARENT;
-import static com.android.systemui.statusbar.phone.BarTransitions.MODE_OPAQUE;
-import static com.android.systemui.statusbar.phone.BarTransitions.MODE_SEMI_TRANSPARENT;
-import static com.android.systemui.statusbar.phone.BarTransitions.MODE_TRANSLUCENT;
-import static com.android.systemui.statusbar.phone.BarTransitions.MODE_TRANSPARENT;
-import static com.android.systemui.statusbar.phone.BarTransitions.MODE_WARNING;
-
 public class PhoneStatusBar extends BaseStatusBar implements DemoMode,
         DragDownHelper.DragDownCallback, ActivityStarter, OnUnlockMethodChangedListener,
         HeadsUpManager.OnHeadsUpChangedListener, DisplayManager.DisplayListener {
@@ -1305,9 +1307,29 @@
     };
 
     private final View.OnTouchListener mHomeActionListener = new View.OnTouchListener() {
+        public boolean mBlockedThisTouch;
+
         @Override
         public boolean onTouch(View v, MotionEvent event) {
+            if (mBlockedThisTouch && event.getActionMasked() != MotionEvent.ACTION_DOWN) {
+                return true;
+            }
+            // If an incoming call is ringing, HOME is totally disabled.
+            // (The user is already on the InCallUI at this point,
+            // and his ONLY options are to answer or reject the call.)
             switch (event.getAction()) {
+                case MotionEvent.ACTION_DOWN:
+                    mBlockedThisTouch = false;
+                    TelecomManager telecomManager = mContext.getSystemService(TelecomManager.class);
+                    if (telecomManager != null && telecomManager.isRinging()) {
+                        if (mStatusBarKeyguardViewManager.isShowing()) {
+                            Log.i(TAG, "Ignoring HOME; there's a ringing incoming call. " +
+                                    "No heads up");
+                            mBlockedThisTouch = true;
+                            return true;
+                        }
+                    }
+                    break;
                 case MotionEvent.ACTION_UP:
                 case MotionEvent.ACTION_CANCEL:
                     awakenDreams();
@@ -1362,7 +1384,7 @@
 
         prepareNavigationBarView();
 
-        mWindowManager.updateViewLayout(mNavigationBarView, getNavigationBarLayoutParams());
+        mWindowManager.updateViewLayout(mNavigationBarView, mNavigationBarView.getLayoutParams());
     }
 
     private void notifyNavigationBarScreenOn(boolean screenOn) {
@@ -3509,7 +3531,6 @@
 
         repositionNavigationBar();
         updateRowStates();
-        mIconController.defineSlots();
         mScreenPinningRequest.onConfigurationChanged();
         mNetworkController.onConfigurationChanged();
     }
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarIconController.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarIconController.java
index a326806..dbe7f96 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarIconController.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarIconController.java
@@ -115,6 +115,8 @@
 
     public StatusBarIconController(Context context, View statusBar, View keyguardStatusBar,
             PhoneStatusBar phoneStatusBar) {
+        super(context.getResources().getStringArray(
+                com.android.internal.R.array.config_statusBarIcons));
         mContext = context;
         mPhoneStatusBar = phoneStatusBar;
         mSystemIconArea = (LinearLayout) statusBar.findViewById(R.id.system_icon_area);
@@ -140,7 +142,6 @@
         mDarkModeIconColorSingleTone = context.getColor(R.color.dark_mode_icon_color_single_tone);
         mLightModeIconColorSingleTone = context.getColor(R.color.light_mode_icon_color_single_tone);
         mHandler = new Handler();
-        defineSlots();
         loadDimens();
 
         TunerService.get(mContext).addTunable(this, ICON_BLACKLIST);
@@ -204,11 +205,6 @@
                 R.dimen.status_bar_icon_padding);
     }
 
-    public void defineSlots() {
-        defineSlots(mContext.getResources().getStringArray(
-                com.android.internal.R.array.config_statusBarIcons));
-    }
-
     private void addSystemIcon(int index, StatusBarIcon icon) {
         String slot = getSlot(index);
         int viewIndex = getViewIndex(index);
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarIconList.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarIconList.java
index 6821879..660672d 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarIconList.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarIconList.java
@@ -25,14 +25,11 @@
     private ArrayList<String> mSlots = new ArrayList<>();
     private ArrayList<StatusBarIcon> mIcons = new ArrayList<>();
 
-    public void defineSlots(String[] slots) {
-        mSlots.clear();
+    public StatusBarIconList(String[] slots) {
         final int N = slots.length;
         for (int i=0; i < N; i++) {
             mSlots.add(slots[i]);
-            if (mIcons.size() < mSlots.size()) {
-                mIcons.add(null);
-            }
+            mIcons.add(null);
         }
     }
 
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarWindowManager.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarWindowManager.java
index 888e19c..5271481 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarWindowManager.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarWindowManager.java
@@ -16,11 +16,16 @@
 
 package com.android.systemui.statusbar.phone;
 
+import android.app.ActivityManagerNative;
+import android.app.IActivityManager;
 import android.content.Context;
 import android.content.pm.ActivityInfo;
 import android.content.res.Resources;
 import android.graphics.PixelFormat;
+import android.os.RemoteException;
 import android.os.SystemProperties;
+import android.os.Trace;
+import android.util.Log;
 import android.view.Gravity;
 import android.view.View;
 import android.view.ViewGroup;
@@ -41,11 +46,16 @@
  */
 public class StatusBarWindowManager implements RemoteInputController.Callback {
 
+    private static final String TAG = "StatusBarWindowManager";
+
     private final Context mContext;
     private final WindowManager mWindowManager;
+    private final IActivityManager mActivityManager;
     private View mStatusBarView;
     private WindowManager.LayoutParams mLp;
     private WindowManager.LayoutParams mLpChanged;
+    private boolean mHasTopUi;
+    private boolean mHasTopUiChanged;
     private int mBarHeight;
     private final boolean mKeyguardScreenRotation;
     private final float mScreenBrightnessDoze;
@@ -54,6 +64,7 @@
     public StatusBarWindowManager(Context context) {
         mContext = context;
         mWindowManager = (WindowManager) context.getSystemService(Context.WINDOW_SERVICE);
+        mActivityManager = ActivityManagerNative.getDefault();
         mKeyguardScreenRotation = shouldEnableKeyguardScreenRotation();
         mScreenBrightnessDoze = mContext.getResources().getInteger(
                 com.android.internal.R.integer.config_screenBrightnessDoze) / 255f;
@@ -193,9 +204,18 @@
         applyFitsSystemWindows(state);
         applyModalFlag(state);
         applyBrightness(state);
+        applyHasTopUi(state);
         if (mLp.copyFrom(mLpChanged) != 0) {
             mWindowManager.updateViewLayout(mStatusBarView, mLp);
         }
+        if (mHasTopUi != mHasTopUiChanged) {
+            try {
+                mActivityManager.setHasTopUi(mHasTopUiChanged);
+            } catch (RemoteException e) {
+                Log.e(TAG, "Failed to call setHasTopUi", e);
+            }
+            mHasTopUi = mHasTopUiChanged;
+        }
     }
 
     private void applyForceStatusBarVisibleFlag(State state) {
@@ -224,6 +244,10 @@
         }
     }
 
+    private void applyHasTopUi(State state) {
+        mHasTopUiChanged = isExpanded(state);
+    }
+
     public void setKeyguardShowing(boolean showing) {
         mCurrentState.keyguardShowing = showing;
         apply(mCurrentState);
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayout.java b/packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayout.java
index 839a20b..43336a0 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayout.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayout.java
@@ -824,20 +824,20 @@
 
     public static void performDismiss(View v, NotificationGroupManager groupManager,
             boolean fromAccessibility) {
-        if (v instanceof ExpandableNotificationRow) {
-            ExpandableNotificationRow row = (ExpandableNotificationRow) v;
-            if (groupManager.isOnlyChildInGroup(row.getStatusBarNotification())) {
-                ExpandableNotificationRow groupSummary =
-                        groupManager.getLogicalGroupSummary(row.getStatusBarNotification());
-                if (groupSummary.isClearable()) {
-                    performDismiss(groupSummary, groupManager, fromAccessibility);
-                }
-            }
-            row.setDismissed(true, fromAccessibility);
+        if (!(v instanceof ExpandableNotificationRow)) {
+            return;
         }
-        final View veto = v.findViewById(R.id.veto);
-        if (veto != null && veto.getVisibility() != View.GONE) {
-            veto.performClick();
+        ExpandableNotificationRow row = (ExpandableNotificationRow) v;
+        if (groupManager.isOnlyChildInGroup(row.getStatusBarNotification())) {
+            ExpandableNotificationRow groupSummary =
+                    groupManager.getLogicalGroupSummary(row.getStatusBarNotification());
+            if (groupSummary.isClearable()) {
+                performDismiss(groupSummary, groupManager, fromAccessibility);
+            }
+        }
+        row.setDismissed(true, fromAccessibility);
+        if (row.isClearable()) {
+            row.performDismiss();
         }
         if (DEBUG) Log.v(TAG, "onChildDismissed: " + v);
     }
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/stack/StackScrollAlgorithm.java b/packages/SystemUI/src/com/android/systemui/statusbar/stack/StackScrollAlgorithm.java
index 77834da..c9e4eac 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/stack/StackScrollAlgorithm.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/stack/StackScrollAlgorithm.java
@@ -173,14 +173,14 @@
     }
 
     public static boolean canChildBeDismissed(View v) {
-        if (v instanceof ExpandableNotificationRow) {
-            ExpandableNotificationRow row = (ExpandableNotificationRow) v;
-            if (row.areGutsExposed()) {
-                return false;
-            }
+        if (!(v instanceof ExpandableNotificationRow)) {
+            return false;
         }
-        final View veto = v.findViewById(R.id.veto);
-        return (veto != null && veto.getVisibility() != View.GONE);
+        ExpandableNotificationRow row = (ExpandableNotificationRow) v;
+        if (row.areGutsExposed()) {
+            return false;
+        }
+        return row.canViewBeDismissed();
     }
 
     /**
diff --git a/packages/SystemUI/src/com/android/systemui/tv/pip/PipManager.java b/packages/SystemUI/src/com/android/systemui/tv/pip/PipManager.java
index 5cc2d01..5e4854c 100644
--- a/packages/SystemUI/src/com/android/systemui/tv/pip/PipManager.java
+++ b/packages/SystemUI/src/com/android/systemui/tv/pip/PipManager.java
@@ -196,7 +196,23 @@
         }
         mInitialized = true;
         mContext = context;
-        Resources res = context.getResources();
+
+        mActivityManager = ActivityManagerNative.getDefault();
+        SystemServicesProxy.getInstance(context).registerTaskStackListener(mTaskStackListener);
+        IntentFilter intentFilter = new IntentFilter();
+        intentFilter.addAction(Intent.ACTION_MEDIA_RESOURCE_GRANTED);
+        mContext.registerReceiver(mBroadcastReceiver, intentFilter);
+        mOnboardingShown = Prefs.getBoolean(
+                mContext, TV_PICTURE_IN_PICTURE_ONBOARDING_SHOWN, false);
+
+        loadConfigurationsAndApply();
+        mPipRecentsOverlayManager = new PipRecentsOverlayManager(context);
+        mMediaSessionManager =
+                (MediaSessionManager) mContext.getSystemService(Context.MEDIA_SESSION_SERVICE);
+    }
+
+    private void loadConfigurationsAndApply() {
+        Resources res = mContext.getResources();
         mDefaultPipBounds = Rect.unflattenFromString(res.getString(
                 com.android.internal.R.string.config_defaultPictureInPictureBounds));
         mSettingsPipBounds = Rect.unflattenFromString(res.getString(
@@ -209,25 +225,19 @@
                 R.string.pip_recents_focused_bounds));
         mRecentsFocusChangedAnimationDurationMs = res.getInteger(
                 R.integer.recents_tv_pip_focus_anim_duration);
-        mPipBounds = mDefaultPipBounds;
 
-        mActivityManager = ActivityManagerNative.getDefault();
-        SystemServicesProxy.getInstance(context).registerTaskStackListener(mTaskStackListener);
-        IntentFilter intentFilter = new IntentFilter();
-        intentFilter.addAction(Intent.ACTION_MEDIA_RESOURCE_GRANTED);
-        mContext.registerReceiver(mBroadcastReceiver, intentFilter);
-        mOnboardingShown = Prefs.getBoolean(
-                mContext, TV_PICTURE_IN_PICTURE_ONBOARDING_SHOWN, false);
-
-        mPipRecentsOverlayManager = new PipRecentsOverlayManager(context);
-        mMediaSessionManager =
-                (MediaSessionManager) mContext.getSystemService(Context.MEDIA_SESSION_SERVICE);
+        // Reset the PIP bounds and apply. PIP bounds can be changed by two reasons.
+        //   1. Configuration changed due to the language change (RTL <-> RTL)
+        //   2. SystemUI restarts after the crash
+        mPipBounds = isSettingsShown() ? mSettingsPipBounds : mDefaultPipBounds;
+        resizePinnedStack(getPinnedStackInfo() == null ? STATE_NO_PIP : STATE_PIP_OVERLAY);
     }
 
     /**
      * Updates the PIP per configuration changed.
      */
     void onConfigurationChanged() {
+        loadConfigurationsAndApply();
         mPipRecentsOverlayManager.onConfigurationChanged(mContext);
     }
 
@@ -443,6 +453,16 @@
         return mState != STATE_NO_PIP;
     }
 
+    private StackInfo getPinnedStackInfo() {
+        StackInfo stackInfo = null;
+        try {
+            stackInfo = mActivityManager.getStackInfo(PINNED_STACK_ID);
+        } catch (RemoteException e) {
+            Log.e(TAG, "getStackInfo failed", e);
+        }
+        return stackInfo;
+    }
+
     private void handleMediaResourceGranted(String[] packageNames) {
         if (mState == STATE_NO_PIP) {
             mLastPackagesResourceGranted = packageNames;
@@ -525,7 +545,18 @@
         return PLAYBACK_STATE_UNAVAILABLE;
     }
 
-    private static boolean isSettingsShown(ComponentName topActivity) {
+    private boolean isSettingsShown() {
+        List<RunningTaskInfo> runningTasks;
+        try {
+            runningTasks = mActivityManager.getTasks(1, 0);
+            if (runningTasks == null || runningTasks.size() == 0) {
+                return false;
+            }
+        } catch (RemoteException e) {
+            Log.d(TAG, "Failed to detect top activity", e);
+            return false;
+        }
+        ComponentName topActivity = runningTasks.get(0).topActivity;
         for (Pair<String, String> componentName : sSettingsPackageAndClassNamePairList) {
             String packageName = componentName.first;
             if (topActivity.getPackageName().equals(packageName)) {
@@ -544,16 +575,10 @@
             if (mState != STATE_NO_PIP) {
                 boolean hasPip = false;
 
-                StackInfo stackInfo = null;
-                try {
-                    stackInfo = mActivityManager.getStackInfo(PINNED_STACK_ID);
-                    if (stackInfo == null) {
-                        Log.w(TAG, "There is no pinned stack");
-                        closePipInternal(false);
-                        return;
-                    }
-                } catch (RemoteException e) {
-                    Log.e(TAG, "getStackInfo failed", e);
+                StackInfo stackInfo = getPinnedStackInfo();
+                if (stackInfo == null || stackInfo.taskIds == null) {
+                    Log.w(TAG, "There is nothing in pinned stack");
+                    closePipInternal(false);
                     return;
                 }
                 for (int i = stackInfo.taskIds.length - 1; i >= 0; --i) {
@@ -570,20 +595,10 @@
                 }
             }
             if (mState == STATE_PIP_OVERLAY) {
-                try {
-                    List<RunningTaskInfo> runningTasks = mActivityManager.getTasks(1, 0);
-                    if (runningTasks == null || runningTasks.size() == 0) {
-                        return;
-                    }
-                    RunningTaskInfo topTask = runningTasks.get(0);
-                    Rect bounds = isSettingsShown(topTask.topActivity)
-                          ? mSettingsPipBounds : mDefaultPipBounds;
-                    if (mPipBounds != bounds) {
-                        mPipBounds = bounds;
-                        resizePinnedStack(STATE_PIP_OVERLAY);
-                    }
-                } catch (RemoteException e) {
-                    Log.d(TAG, "Failed to detect top activity", e);
+                Rect bounds = isSettingsShown() ? mSettingsPipBounds : mDefaultPipBounds;
+                if (mPipBounds != bounds) {
+                    mPipBounds = bounds;
+                    resizePinnedStack(STATE_PIP_OVERLAY);
                 }
             }
         }
@@ -591,15 +606,9 @@
         @Override
         public void onActivityPinned() {
             if (DEBUG) Log.d(TAG, "onActivityPinned()");
-            StackInfo stackInfo = null;
-            try {
-                stackInfo = mActivityManager.getStackInfo(PINNED_STACK_ID);
-                if (stackInfo == null) {
-                    Log.w(TAG, "Cannot find pinned stack");
-                    return;
-                }
-            } catch (RemoteException e) {
-                Log.e(TAG, "getStackInfo failed", e);
+            StackInfo stackInfo = getPinnedStackInfo();
+            if (stackInfo == null) {
+                Log.w(TAG, "Cannot find pinned stack");
                 return;
             }
             if (DEBUG) Log.d(TAG, "PINNED_STACK:" + stackInfo);
diff --git a/services/core/java/com/android/server/BluetoothManagerService.java b/services/core/java/com/android/server/BluetoothManagerService.java
index 8c5887f..8b243e7 100644
--- a/services/core/java/com/android/server/BluetoothManagerService.java
+++ b/services/core/java/com/android/server/BluetoothManagerService.java
@@ -35,10 +35,12 @@
 import android.content.Intent;
 import android.content.IntentFilter;
 import android.content.ServiceConnection;
+import android.content.pm.ApplicationInfo;
 import android.content.pm.PackageManager;
 import android.content.pm.UserInfo;
 import android.database.ContentObserver;
 import android.os.Binder;
+import android.os.Build;
 import android.os.Handler;
 import android.os.IBinder;
 import android.os.Looper;
@@ -151,6 +153,8 @@
     private final Map <Integer, ProfileServiceConnections> mProfileServices =
             new HashMap <Integer, ProfileServiceConnections>();
 
+    private final boolean mPermissionReviewRequired;
+
     private void registerForAirplaneMode(IntentFilter filter) {
         final ContentResolver resolver = mContext.getContentResolver();
         final String airplaneModeRadios = Settings.Global.getString(resolver,
@@ -243,6 +247,11 @@
         mHandler = new BluetoothHandler(IoThread.get().getLooper());
 
         mContext = context;
+
+        mPermissionReviewRequired = Build.PERMISSIONS_REVIEW_REQUIRED
+                    || context.getResources().getBoolean(
+                com.android.internal.R.bool.config_permissionReviewRequired);
+
         mBluetooth = null;
         mBluetoothBinder = null;
         mBluetoothGatt = null;
@@ -644,15 +653,26 @@
         return true;
     }
 
-    public boolean enable() {
-        if ((Binder.getCallingUid() != Process.SYSTEM_UID) &&
-            (!checkIfCallerIsForegroundUser())) {
-            Slog.w(TAG,"enable(): not allowed for non-active and non system user");
-            return false;
+    public boolean enable(String packageName) throws RemoteException {
+        final int callingUid = Binder.getCallingUid();
+        final boolean callerSystem = UserHandle.getAppId(callingUid) == Process.SYSTEM_UID;
+
+        if (!callerSystem) {
+            if (!checkIfCallerIsForegroundUser()) {
+                Slog.w(TAG, "enable(): not allowed for non-active and non system user");
+                return false;
+            }
+
+            mContext.enforceCallingOrSelfPermission(BLUETOOTH_ADMIN_PERM,
+                    "Need BLUETOOTH ADMIN permission");
+
+            if (!isEnabled() && mPermissionReviewRequired
+                    && startConsentUiIfNeeded(packageName, callingUid,
+                            BluetoothAdapter.ACTION_REQUEST_ENABLE)) {
+                return false;
+            }
         }
 
-        mContext.enforceCallingOrSelfPermission(BLUETOOTH_ADMIN_PERM,
-                                                "Need BLUETOOTH ADMIN permission");
         if (DBG) {
             Slog.d(TAG,"enable():  mBluetooth =" + mBluetooth +
                     " mBinding = " + mBinding + " mState = " + mState);
@@ -668,14 +688,24 @@
         return true;
     }
 
-    public boolean disable(boolean persist) {
-        mContext.enforceCallingOrSelfPermission(BLUETOOTH_ADMIN_PERM,
-                                                "Need BLUETOOTH ADMIN permissicacheNameAndAddresson");
+    public boolean disable(String packageName, boolean persist) throws RemoteException {
+        final int callingUid = Binder.getCallingUid();
+        final boolean callerSystem = UserHandle.getAppId(callingUid) == Process.SYSTEM_UID;
 
-        if ((Binder.getCallingUid() != Process.SYSTEM_UID) &&
-            (!checkIfCallerIsForegroundUser())) {
-            Slog.w(TAG,"disable(): not allowed for non-active and non system user");
-            return false;
+        if (!callerSystem) {
+            if (!checkIfCallerIsForegroundUser()) {
+                Slog.w(TAG, "disable(): not allowed for non-active and non system user");
+                return false;
+            }
+
+            mContext.enforceCallingOrSelfPermission(BLUETOOTH_ADMIN_PERM,
+                    "Need BLUETOOTH ADMIN permission");
+
+            if (isEnabled() && mPermissionReviewRequired
+                    && startConsentUiIfNeeded(packageName, callingUid,
+                            BluetoothAdapter.ACTION_REQUEST_DISABLE)) {
+                return false;
+            }
         }
 
         if (DBG) {
@@ -696,6 +726,31 @@
         return true;
     }
 
+    private boolean startConsentUiIfNeeded(String packageName,
+            int callingUid, String intentAction) throws RemoteException {
+        try {
+            // Validate the package only if we are going to use it
+            ApplicationInfo applicationInfo = mContext.getPackageManager()
+                    .getApplicationInfoAsUser(packageName,
+                            PackageManager.MATCH_DEBUG_TRIAGED_MISSING,
+                            UserHandle.getUserId(callingUid));
+            if (applicationInfo.uid != callingUid) {
+                throw new SecurityException("Package " + callingUid
+                        + " not in uid " + callingUid);
+            }
+
+            // Legacy apps in permission review mode trigger a user prompt
+            if (applicationInfo.targetSdkVersion < Build.VERSION_CODES.M) {
+                Intent intent = new Intent(intentAction);
+                mContext.startActivity(intent);
+                return true;
+            }
+        } catch (PackageManager.NameNotFoundException e) {
+            throw new RemoteException(e.getMessage());
+        }
+        return false;
+    }
+
     public void unbindAndFinish() {
         if (DBG) {
             Slog.d(TAG,"unbindAndFinish(): " + mBluetooth +
diff --git a/services/core/java/com/android/server/ConnectivityService.java b/services/core/java/com/android/server/ConnectivityService.java
index c32fc78..31e5d0b 100644
--- a/services/core/java/com/android/server/ConnectivityService.java
+++ b/services/core/java/com/android/server/ConnectivityService.java
@@ -1577,6 +1577,16 @@
                 "ConnectivityService");
     }
 
+    private void enforceConnectivityRestrictedNetworksPermission() {
+        try {
+            mContext.enforceCallingOrSelfPermission(
+                    android.Manifest.permission.CONNECTIVITY_USE_RESTRICTED_NETWORKS,
+                    "ConnectivityService");
+            return;
+        } catch (SecurityException e) { /* fallback to ConnectivityInternalPermission */ }
+        enforceConnectivityInternalPermission();
+    }
+
     private void enforceKeepalivePermission() {
         mContext.enforceCallingOrSelfPermission(KeepaliveTracker.PERMISSION, "ConnectivityService");
     }
@@ -4112,7 +4122,7 @@
 
     private void enforceNetworkRequestPermissions(NetworkCapabilities networkCapabilities) {
         if (networkCapabilities.hasCapability(NET_CAPABILITY_NOT_RESTRICTED) == false) {
-            enforceConnectivityInternalPermission();
+            enforceConnectivityRestrictedNetworksPermission();
         } else {
             enforceChangePermission();
         }
diff --git a/services/core/java/com/android/server/NetworkManagementService.java b/services/core/java/com/android/server/NetworkManagementService.java
index be6364e..f2a2b3d 100644
--- a/services/core/java/com/android/server/NetworkManagementService.java
+++ b/services/core/java/com/android/server/NetworkManagementService.java
@@ -2751,4 +2751,19 @@
     public void removeInterfaceFromLocalNetwork(String iface) {
         modifyInterfaceInNetwork("remove", "local", iface);
     }
+
+    @Override
+    public int removeRoutesFromLocalNetwork(List<RouteInfo> routes) {
+        int failures = 0;
+
+        for (RouteInfo route : routes) {
+            try {
+                modifyRoute("remove", "local", route);
+            } catch (IllegalStateException e) {
+                failures++;
+            }
+        }
+
+        return failures;
+    }
 }
diff --git a/services/core/java/com/android/server/am/ActiveServices.java b/services/core/java/com/android/server/am/ActiveServices.java
index 01de9f4..d496e7a 100755
--- a/services/core/java/com/android/server/am/ActiveServices.java
+++ b/services/core/java/com/android/server/am/ActiveServices.java
@@ -368,7 +368,7 @@
         // we do not start the service and launch a review activity if the calling app
         // is in the foreground passing it a pending intent to start the service when
         // review is completed.
-        if (Build.PERMISSIONS_REVIEW_REQUIRED) {
+        if (mAm.mPermissionReviewRequired || Build.PERMISSIONS_REVIEW_REQUIRED) {
             if (!requestStartTargetPermissionsReviewIfNeededLocked(r, callingPackage,
                     callingUid, service, callerFg, userId)) {
                 return null;
@@ -891,7 +891,7 @@
         // we schedule binding to the service but do not start its process, then
         // we launch a review activity to which is passed a callback to invoke
         // when done to start the bound service's process to completing the binding.
-        if (Build.PERMISSIONS_REVIEW_REQUIRED) {
+        if (mAm.mPermissionReviewRequired || Build.PERMISSIONS_REVIEW_REQUIRED) {
             if (mAm.getPackageManagerInternalLocked().isPermissionsReviewRequired(
                     s.packageName, s.userId)) {
 
diff --git a/services/core/java/com/android/server/am/ActivityManagerService.java b/services/core/java/com/android/server/am/ActivityManagerService.java
index 0c9a0bb..5bd0065 100644
--- a/services/core/java/com/android/server/am/ActivityManagerService.java
+++ b/services/core/java/com/android/server/am/ActivityManagerService.java
@@ -63,6 +63,7 @@
 import org.xmlpull.v1.XmlSerializer;
 
 import android.Manifest;
+import android.Manifest.permission;
 import android.annotation.NonNull;
 import android.annotation.UserIdInt;
 import android.app.Activity;
@@ -1569,6 +1570,8 @@
     // being called for multiwindow assist in a single session.
     private int mViSessionId = 1000;
 
+    final boolean mPermissionReviewRequired;
+
     final class KillHandler extends Handler {
         static final int KILL_PROCESS_GROUP_MSG = 4000;
 
@@ -2624,6 +2627,9 @@
 
         Slog.i(TAG, "Memory class: " + ActivityManager.staticGetMemoryClass());
 
+        mPermissionReviewRequired = mContext.getResources().getBoolean(
+                com.android.internal.R.bool.config_permissionReviewRequired);
+
         mHandlerThread = new ServiceThread(TAG,
                 android.os.Process.THREAD_PRIORITY_FOREGROUND, false /*allowIo*/);
         mHandlerThread.start();
@@ -2962,8 +2968,6 @@
      * {@link ActivityStack#setResumedActivityLocked} when an activity is resumed.
      */
     void setResumedActivityUncheckLocked(ActivityRecord r, String reason) {
-        r.state = ActivityState.RESUMED;
-
         if (r.task.isApplicationTask()) {
             if (mCurAppTimeTracker != r.appTimeTracker) {
                 // We are switching app tracking.  Complete the current one.
@@ -6247,6 +6251,9 @@
             enqueueUidChangeLocked(uidRec, -1, UidRecord.CHANGE_ACTIVE);
         }
         proc.uidRecord = uidRec;
+
+        // Reset render thread tid if it was already set, so new process can set it again.
+        proc.renderThreadTid = 0;
         uidRec.numProcs++;
         mProcessNames.put(proc.processName, proc.uid, proc);
         if (proc.isolated) {
@@ -8574,7 +8581,8 @@
             if (uri == null) {
                 owner.removeUriPermissionsLocked(mode);
             } else {
-                owner.removeUriPermissionLocked(new GrantUri(userId, uri, false), mode);
+                final boolean prefix = (mode & Intent.FLAG_GRANT_PREFIX_URI_PERMISSION) != 0;
+                owner.removeUriPermissionLocked(new GrantUri(userId, uri, prefix), mode);
             }
         }
     }
@@ -10724,7 +10732,7 @@
                     // If permissions need a review before any of the app components can run,
                     // we return no provider and launch a review activity if the calling app
                     // is in the foreground.
-                    if (Build.PERMISSIONS_REVIEW_REQUIRED) {
+                    if (mPermissionReviewRequired || Build.PERMISSIONS_REVIEW_REQUIRED) {
                         if (!requestTargetProviderPermissionsReviewIfNeededLocked(cpi, r, userId)) {
                             return null;
                         }
@@ -12631,6 +12639,42 @@
         }
     }
 
+    @Override
+    public void setHasTopUi(boolean hasTopUi) throws RemoteException {
+        if (checkCallingPermission(permission.INTERNAL_SYSTEM_WINDOW) != PERMISSION_GRANTED) {
+            String msg = "Permission Denial: setHasTopUi() from pid="
+                    + Binder.getCallingPid()
+                    + ", uid=" + Binder.getCallingUid()
+                    + " requires " + permission.INTERNAL_SYSTEM_WINDOW;
+            Slog.w(TAG, msg);
+            throw new SecurityException(msg);
+        }
+        final int pid = Binder.getCallingPid();
+        final long origId = Binder.clearCallingIdentity();
+        try {
+            synchronized (this) {
+                boolean changed = false;
+                ProcessRecord pr;
+                synchronized (mPidsSelfLocked) {
+                    pr = mPidsSelfLocked.get(pid);
+                    if (pr == null) {
+                        Slog.w(TAG, "setHasTopUi called on unknown pid: " + pid);
+                        return;
+                    }
+                    if (pr.hasTopUi != hasTopUi) {
+                        pr.hasTopUi = hasTopUi;
+                        changed = true;
+                    }
+                }
+                if (changed) {
+                    updateOomAdjLocked(pr);
+                }
+            }
+        } finally {
+            Binder.restoreCallingIdentity(origId);
+        }
+    }
+
     public final void enterSafeMode() {
         synchronized(this) {
             // It only makes sense to do this before the system is ready
@@ -19118,7 +19162,7 @@
             // facilitate this, here we need to determine whether or not it
             // is currently showing UI.
             app.systemNoUi = true;
-            if (app == TOP_APP) {
+            if (app == TOP_APP || app.hasTopUi) {
                 app.systemNoUi = false;
                 app.curSchedGroup = ProcessList.SCHED_GROUP_TOP_APP;
                 app.adjType = "pers-top-activity";
@@ -19147,7 +19191,7 @@
         int procState;
         boolean foregroundActivities = false;
         BroadcastQueue queue;
-        if (app == TOP_APP) {
+        if (app == TOP_APP || app.hasTopUi) {
             // The last app on the list is the foreground app.
             adj = ProcessList.FOREGROUND_APP_ADJ;
             schedGroup = ProcessList.SCHED_GROUP_TOP_APP;
diff --git a/services/core/java/com/android/server/am/ActivityRecord.java b/services/core/java/com/android/server/am/ActivityRecord.java
index f9ec10b..06932b6 100755
--- a/services/core/java/com/android/server/am/ActivityRecord.java
+++ b/services/core/java/com/android/server/am/ActivityRecord.java
@@ -447,17 +447,10 @@
             return;
         }
         try {
-            // Make sure fontScale is always equal to global. For fullscreen apps, config is
-            // the shared EMPTY config, which has default fontScale of 1.0. We don't want it
-            // to be applied as an override config.
-            Configuration overrideConfig = new Configuration(config);
-            overrideConfig.fontScale = service.mConfiguration.fontScale;
-
             if (DEBUG_CONFIGURATION) Slog.v(TAG, "Sending new config to " + this + " " +
-                    "reportToActivity=" + reportToActivity + " and config: " + overrideConfig);
+                    "reportToActivity=" + reportToActivity + " and config: " + config);
 
-            app.thread.scheduleActivityConfigurationChanged(
-                    appToken, overrideConfig, reportToActivity);
+            app.thread.scheduleActivityConfigurationChanged(appToken, config, reportToActivity);
         } catch (RemoteException e) {
             // If process died, whatever.
         }
diff --git a/services/core/java/com/android/server/am/ActivityStack.java b/services/core/java/com/android/server/am/ActivityStack.java
index e4c7c8b..99e3ebc 100644
--- a/services/core/java/com/android/server/am/ActivityStack.java
+++ b/services/core/java/com/android/server/am/ActivityStack.java
@@ -1245,7 +1245,7 @@
             r.stopped = true;
             r.state = ActivityState.STOPPED;
 
-            mWindowManager.notifyAppStopped(r.appToken, true);
+            mWindowManager.notifyAppStopped(r.appToken);
 
             if (getVisibleBehindActivity() == r) {
                 mStackSupervisor.requestVisibleBehindLocked(r, false);
@@ -2122,6 +2122,7 @@
         // TODO: move mResumedActivity to stack supervisor,
         // there should only be 1 global copy of resumed activity.
         mResumedActivity = r;
+        r.state = ActivityState.RESUMED;
         mService.setResumedActivityUncheckLocked(r, reason);
         r.task.touchActiveTime();
         mRecentTasks.addLocked(r.task);
@@ -2468,13 +2469,12 @@
                     // Do over!
                     mStackSupervisor.scheduleResumeTopActivities();
                 }
-                if (mStackSupervisor.reportResumedActivityLocked(next)) {
-                    mNoAnimActivities.clear();
-                    if (DEBUG_STACK) mStackSupervisor.validateTopActivitiesLocked();
-                    return true;
+                if (!next.visible || next.stopped) {
+                    mWindowManager.setAppVisibility(next.appToken, true);
                 }
+                completeResumeLocked(next);
                 if (DEBUG_STACK) mStackSupervisor.validateTopActivitiesLocked();
-                return false;
+                return true;
             }
 
             try {
@@ -2495,7 +2495,7 @@
 
                 // Well the app will no longer be stopped.
                 // Clear app token stopped state in window manager if needed.
-                mWindowManager.notifyAppStopped(next.appToken, false);
+                mWindowManager.notifyAppResumed(next.appToken, next.stopped);
 
                 EventLog.writeEvent(EventLogTags.AM_RESUME_ACTIVITY, next.userId,
                         System.identityHashCode(next), next.task.taskId, next.shortComponentName);
@@ -4754,19 +4754,8 @@
             if (DEBUG_STATES) {
                 Slog.d(TAG_STATES, "Resumed after relaunch " + r);
             }
-            r.state = ActivityState.RESUMED;
-            // Relaunch-resume could happen either when the app is already in the front,
-            // or while it's being brought to front. In the latter case, it's marked RESUMED
-            // but not yet visible (or stopped). We need to complete the resume here as the
-            // code in resumeTopActivityInnerLocked to complete the resume might be skipped.
-            if (!r.visible || r.stopped) {
-                mWindowManager.setAppVisibility(r.appToken, true);
-                setResumedActivityLocked(r, "relaunchActivityLocked");
-                completeResumeLocked(r);
-            } else {
-                r.results = null;
-                r.newIntents = null;
-            }
+            r.results = null;
+            r.newIntents = null;
             mService.showUnsupportedZoomDialogIfNeededLocked(r);
             mService.showAskCompatModeDialogLocked(r);
         } else {
diff --git a/services/core/java/com/android/server/am/ActivityStarter.java b/services/core/java/com/android/server/am/ActivityStarter.java
index 399ca9e..7a6b13b 100644
--- a/services/core/java/com/android/server/am/ActivityStarter.java
+++ b/services/core/java/com/android/server/am/ActivityStarter.java
@@ -103,6 +103,7 @@
 import android.os.Bundle;
 import android.os.IBinder;
 import android.os.PowerManagerInternal;
+import android.os.Process;
 import android.os.RemoteException;
 import android.os.SystemClock;
 import android.os.UserHandle;
@@ -132,6 +133,9 @@
     private static final String TAG_CONFIGURATION = TAG + POSTFIX_CONFIGURATION;
     private static final String TAG_USER_LEAVING = TAG + POSTFIX_USER_LEAVING;
 
+    // TODO b/30204367 remove when the platform fully supports ephemeral applications
+    private static final boolean USE_DEFAULT_EPHEMERAL_LAUNCHER = false;
+
     private final ActivityManagerService mService;
     private final ActivityStackSupervisor mSupervisor;
     private ActivityStartInterceptor mInterceptor;
@@ -412,7 +416,8 @@
         // If permissions need a review before any of the app components can run, we
         // launch the review activity and pass a pending intent to start the activity
         // we are to launching now after the review is completed.
-        if (Build.PERMISSIONS_REVIEW_REQUIRED && aInfo != null) {
+        if ((mService.mPermissionReviewRequired
+                || Build.PERMISSIONS_REVIEW_REQUIRED) && aInfo != null) {
             if (mService.getPackageManagerInternalLocked().isPermissionsReviewRequired(
                     aInfo.packageName, userId)) {
                 IIntentSender target = mService.getIntentSenderLocked(
@@ -456,39 +461,13 @@
         // starts either the intent we resolved here [on install error] or the ephemeral
         // app [on install success].
         if (rInfo != null && rInfo.ephemeralResolveInfo != null) {
-            // Create a pending intent to start the intent resolved here.
-            final IIntentSender failureTarget = mService.getIntentSenderLocked(
-                    ActivityManager.INTENT_SENDER_ACTIVITY, callingPackage,
-                    Binder.getCallingUid(), userId, null, null, 0, new Intent[]{ intent },
-                    new String[]{ resolvedType },
-                    PendingIntent.FLAG_CANCEL_CURRENT | PendingIntent.FLAG_ONE_SHOT
-                            | PendingIntent.FLAG_IMMUTABLE, null);
-
-            // Create a pending intent to start the ephemeral application; force it to be
-            // directed to the ephemeral package.
-            ephemeralIntent.setPackage(rInfo.ephemeralResolveInfo.getPackageName());
-            final IIntentSender ephemeralTarget = mService.getIntentSenderLocked(
-                    ActivityManager.INTENT_SENDER_ACTIVITY, callingPackage,
-                    Binder.getCallingUid(), userId, null, null, 0, new Intent[]{ ephemeralIntent },
-                    new String[]{ resolvedType },
-                    PendingIntent.FLAG_CANCEL_CURRENT | PendingIntent.FLAG_ONE_SHOT
-                            | PendingIntent.FLAG_IMMUTABLE, null);
-
-            int flags = intent.getFlags();
-            intent = new Intent();
-            intent.setFlags(flags
-                    | Intent.FLAG_ACTIVITY_NEW_TASK
-                    | Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS);
-            intent.putExtra(Intent.EXTRA_PACKAGE_NAME,
-                    rInfo.ephemeralResolveInfo.getPackageName());
-            intent.putExtra(Intent.EXTRA_EPHEMERAL_FAILURE, new IntentSender(failureTarget));
-            intent.putExtra(Intent.EXTRA_EPHEMERAL_SUCCESS, new IntentSender(ephemeralTarget));
-
+            intent = buildEphemeralInstallerIntent(intent, ephemeralIntent,
+                    rInfo.ephemeralResolveInfo.getPackageName(), callingPackage, resolvedType,
+                    userId);
             resolvedType = null;
             callingUid = realCallingUid;
             callingPid = realCallingPid;
 
-            rInfo = rInfo.ephemeralInstaller;
             aInfo = mSupervisor.resolveActivity(intent, rInfo, startFlags, null /*profilerInfo*/);
         }
 
@@ -543,6 +522,60 @@
         return err;
     }
 
+    /**
+     * Builds and returns an intent to launch the ephemeral installer.
+     */
+    private Intent buildEphemeralInstallerIntent(Intent launchIntent, Intent origIntent,
+            String ephemeralPackage, String callingPackage, String resolvedType, int userId) {
+        final Intent nonEphemeralIntent = new Intent(origIntent);
+        nonEphemeralIntent.setFlags(nonEphemeralIntent.getFlags() | Intent.FLAG_IGNORE_EPHEMERAL);
+        // Intent that is launched if the ephemeral package couldn't be installed
+        // for any reason.
+        final IIntentSender failureIntentTarget = mService.getIntentSenderLocked(
+                ActivityManager.INTENT_SENDER_ACTIVITY, callingPackage,
+                Binder.getCallingUid(), userId, null /*token*/, null /*resultWho*/, 1,
+                new Intent[]{ nonEphemeralIntent }, new String[]{ resolvedType },
+                PendingIntent.FLAG_CANCEL_CURRENT | PendingIntent.FLAG_ONE_SHOT
+                | PendingIntent.FLAG_IMMUTABLE, null /*bOptions*/);
+
+        final Intent ephemeralIntent;
+        if (USE_DEFAULT_EPHEMERAL_LAUNCHER) {
+            // Force the intent to be directed to the ephemeral package
+            ephemeralIntent = new Intent(origIntent);
+            ephemeralIntent.setPackage(ephemeralPackage);
+        } else {
+            // Success intent goes back to the installer
+            // TODO; do we need any extras for the installer?
+            ephemeralIntent = new Intent(launchIntent);
+            ephemeralIntent.setData(null);
+        }
+
+        // Intent that is eventually launched if the ephemeral package was
+        // installed successfully. This will actually be launched by a platform
+        // broadcast receiver.
+        final IIntentSender successIntentTarget = mService.getIntentSenderLocked(
+                ActivityManager.INTENT_SENDER_ACTIVITY, callingPackage,
+                Binder.getCallingUid(), userId, null /*token*/, null /*resultWho*/, 0,
+                new Intent[]{ ephemeralIntent }, new String[]{ resolvedType },
+                PendingIntent.FLAG_CANCEL_CURRENT | PendingIntent.FLAG_ONE_SHOT
+                | PendingIntent.FLAG_IMMUTABLE, null /*bOptions*/);
+
+        // Finally build the actual intent to launch the ephemeral installer
+        int flags = launchIntent.getFlags();
+        final Intent intent = new Intent();
+        intent.setFlags(flags
+                | Intent.FLAG_ACTIVITY_NEW_TASK
+                | Intent.FLAG_ACTIVITY_CLEAR_TASK
+                | Intent.FLAG_ACTIVITY_NO_HISTORY
+                | Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS);
+        intent.putExtra(Intent.EXTRA_PACKAGE_NAME, ephemeralPackage);
+        intent.putExtra(Intent.EXTRA_EPHEMERAL_FAILURE, new IntentSender(failureIntentTarget));
+        intent.putExtra(Intent.EXTRA_EPHEMERAL_SUCCESS, new IntentSender(successIntentTarget));
+        // TODO: Remove when the platform has fully implemented ephemeral apps
+        intent.setData(origIntent.getData());
+        return intent;
+    }
+
     void postStartActivityUncheckedProcessing(
             ActivityRecord r, int result, int prevFocusedStackId, ActivityRecord sourceRecord,
             ActivityStack targetStack) {
@@ -895,13 +928,15 @@
             throw new IllegalArgumentException("intents are length different than resolvedTypes");
         }
 
+        final int realCallingPid = Binder.getCallingPid();
+        final int realCallingUid = Binder.getCallingUid();
 
         int callingPid;
         if (callingUid >= 0) {
             callingPid = -1;
         } else if (caller == null) {
-            callingPid = Binder.getCallingPid();
-            callingUid = Binder.getCallingUid();
+            callingPid = realCallingPid;
+            callingUid = realCallingUid;
         } else {
             callingPid = callingUid = -1;
         }
@@ -942,7 +977,8 @@
                             i == intents.length - 1 ? bOptions : null);
                     int res = startActivityLocked(caller, intent, null /*ephemeralIntent*/,
                             resolvedTypes[i], aInfo, null /*rInfo*/, null, null, resultTo, null, -1,
-                            callingPid, callingUid, callingPackage, callingPid, callingUid, 0,
+                            callingPid, callingUid, callingPackage,
+                            realCallingPid, realCallingUid, 0,
                             options, false, componentSpecified, outActivity, null, null);
                     if (res < 0) {
                         return res;
diff --git a/services/core/java/com/android/server/am/BroadcastQueue.java b/services/core/java/com/android/server/am/BroadcastQueue.java
index a279290..4399e36 100644
--- a/services/core/java/com/android/server/am/BroadcastQueue.java
+++ b/services/core/java/com/android/server/am/BroadcastQueue.java
@@ -618,7 +618,7 @@
         // the broadcast and if the calling app is in the foreground and the broadcast is
         // explicit we launch the review UI passing it a pending intent to send the skipped
         // broadcast.
-        if (Build.PERMISSIONS_REVIEW_REQUIRED) {
+        if (mService.mPermissionReviewRequired || Build.PERMISSIONS_REVIEW_REQUIRED) {
             if (!requestStartTargetPermissionsReviewIfNeededLocked(r, filter.packageName,
                     filter.owningUserId)) {
                 r.delivery[index] = BroadcastRecord.DELIVERY_SKIPPED;
@@ -1124,7 +1124,8 @@
             // the broadcast and if the calling app is in the foreground and the broadcast is
             // explicit we launch the review UI passing it a pending intent to send the skipped
             // broadcast.
-            if (Build.PERMISSIONS_REVIEW_REQUIRED && !skip) {
+            if ((mService.mPermissionReviewRequired
+                    || Build.PERMISSIONS_REVIEW_REQUIRED) && !skip) {
                 if (!requestStartTargetPermissionsReviewIfNeededLocked(r,
                         info.activityInfo.packageName, UserHandle.getUserId(
                                 info.activityInfo.applicationInfo.uid))) {
diff --git a/services/core/java/com/android/server/am/PendingIntentRecord.java b/services/core/java/com/android/server/am/PendingIntentRecord.java
index 2467a90..9c08453 100644
--- a/services/core/java/com/android/server/am/PendingIntentRecord.java
+++ b/services/core/java/com/android/server/am/PendingIntentRecord.java
@@ -38,6 +38,7 @@
 
 import java.io.PrintWriter;
 import java.lang.ref.WeakReference;
+import java.util.Objects;
 
 final class PendingIntentRecord extends IIntentSender.Stub {
     private static final String TAG = TAG_WITH_CLASS_NAME ? "PendingIntentRecord" : TAG_AM;
@@ -102,7 +103,7 @@
             if (requestResolvedType != null) {
                 hash = (ODD_PRIME_NUMBER*hash) + requestResolvedType.hashCode();
             }
-            hash = (ODD_PRIME_NUMBER*hash) + _p.hashCode();
+            hash = (ODD_PRIME_NUMBER*hash) + (_p != null ? _p.hashCode() : 0);
             hash = (ODD_PRIME_NUMBER*hash) + _t;
             hashCode = hash;
             //Slog.i(ActivityManagerService.TAG, this + " hashCode=0x"
@@ -121,20 +122,14 @@
                 if (userId != other.userId){
                     return false;
                 }
-                if (!packageName.equals(other.packageName)) {
+                if (!Objects.equals(packageName, other.packageName)) {
                     return false;
                 }
                 if (activity != other.activity) {
                     return false;
                 }
-                if (who != other.who) {
-                    if (who != null) {
-                        if (!who.equals(other.who)) {
-                            return false;
-                        }
-                    } else if (other.who != null) {
-                        return false;
-                    }
+                if (!Objects.equals(who, other.who)) {
+                    return false;
                 }
                 if (requestCode != other.requestCode) {
                     return false;
@@ -148,14 +143,8 @@
                         return false;
                     }
                 }
-                if (requestResolvedType != other.requestResolvedType) {
-                    if (requestResolvedType != null) {
-                        if (!requestResolvedType.equals(other.requestResolvedType)) {
-                            return false;
-                        }
-                    } else if (other.requestResolvedType != null) {
-                        return false;
-                    }
+                if (!Objects.equals(requestResolvedType, other.requestResolvedType)) {
+                    return false;
                 }
                 if (flags != other.flags) {
                     return false;
diff --git a/services/core/java/com/android/server/am/PreBootBroadcaster.java b/services/core/java/com/android/server/am/PreBootBroadcaster.java
index a7d09d0..b24edb9 100644
--- a/services/core/java/com/android/server/am/PreBootBroadcaster.java
+++ b/services/core/java/com/android/server/am/PreBootBroadcaster.java
@@ -21,6 +21,7 @@
 import android.app.AppOpsManager;
 import android.app.Notification;
 import android.app.NotificationManager;
+import android.app.PendingIntent;
 import android.content.ComponentName;
 import android.content.Context;
 import android.content.IIntentReceiver;
@@ -50,6 +51,7 @@
     private final ActivityManagerService mService;
     private final int mUserId;
     private final ProgressReporter mProgress;
+    private final boolean mQuiet;
 
     private final Intent mIntent;
     private final List<ResolveInfo> mTargets;
@@ -61,16 +63,13 @@
         mService = service;
         mUserId = userId;
         mProgress = progress;
+        mQuiet = quiet;
 
         mIntent = new Intent(Intent.ACTION_PRE_BOOT_COMPLETED);
         mIntent.addFlags(Intent.FLAG_RECEIVER_BOOT_UPGRADE | Intent.FLAG_DEBUG_TRIAGED_MISSING);
 
         mTargets = mService.mContext.getPackageManager().queryBroadcastReceiversAsUser(mIntent,
                 MATCH_SYSTEM_ONLY, UserHandle.of(userId));
-
-        if (!quiet) {
-            mHandler.obtainMessage(MSG_SHOW).sendToTarget();
-        }
     }
 
     public void sendNext() {
@@ -87,6 +86,10 @@
             return;
         }
 
+        if (!mQuiet) {
+            mHandler.obtainMessage(MSG_SHOW, mTargets.size(), mIndex).sendToTarget();
+        }
+
         final ResolveInfo ri = mTargets.get(mIndex++);
         final ComponentName componentName = ri.activityInfo.getComponentName();
 
@@ -121,13 +124,26 @@
             final Context context = mService.mContext;
             final NotificationManager notifManager = context
                     .getSystemService(NotificationManager.class);
+            final int max = msg.arg1;
+            final int index = msg.arg2;
 
             switch (msg.what) {
                 case MSG_SHOW:
                     final CharSequence title = context
-                            .getText(R.string.android_upgrading_notification_title);
-                    final CharSequence message = context
-                            .getText(R.string.android_upgrading_notification_body);
+                            .getText(R.string.android_upgrading_title);
+
+                    final Intent intent = new Intent();
+                    intent.setClassName("com.android.settings",
+                            "com.android.settings.HelpTrampoline");
+                    intent.putExtra(Intent.EXTRA_TEXT, "help_url_upgrading");
+
+                    final PendingIntent contentIntent;
+                    if (context.getPackageManager().resolveActivity(intent, 0) != null) {
+                        contentIntent = PendingIntent.getActivity(context, 0, intent, 0);
+                    } else {
+                        contentIntent = null;
+                    }
+
                     final Notification notif = new Notification.Builder(mService.mContext)
                             .setSmallIcon(R.drawable.stat_sys_adb)
                             .setWhen(0)
@@ -138,8 +154,9 @@
                             .setColor(context.getColor(
                                     com.android.internal.R.color.system_notification_accent_color))
                             .setContentTitle(title)
-                            .setContentText(message)
+                            .setContentIntent(contentIntent)
                             .setVisibility(Notification.VISIBILITY_PUBLIC)
+                            .setProgress(max, index, false)
                             .build();
                     notifManager.notifyAsUser(TAG, 0, notif, UserHandle.of(mUserId));
                     break;
diff --git a/services/core/java/com/android/server/am/ProcessRecord.java b/services/core/java/com/android/server/am/ProcessRecord.java
index dad383d..e74b3a3 100644
--- a/services/core/java/com/android/server/am/ProcessRecord.java
+++ b/services/core/java/com/android/server/am/ProcessRecord.java
@@ -116,6 +116,8 @@
     boolean repForegroundActivities; // Last reported foreground activities.
     boolean systemNoUi;         // This is a system process, but not currently showing UI.
     boolean hasShownUi;         // Has UI been shown in this process since it was started?
+    boolean hasTopUi;           // Is this process currently showing "top-level" UI that is not an
+                                // activity?
     boolean pendingUiClean;     // Want to clean up resources from showing UI?
     boolean hasAboveClient;     // Bound using BIND_ABOVE_CLIENT, so want to be lower
     boolean treatLikeActivity;  // Bound using BIND_TREAT_LIKE_ACTIVITY
diff --git a/services/core/java/com/android/server/am/TaskRecord.java b/services/core/java/com/android/server/am/TaskRecord.java
index 7393e6a..b2b752c 100644
--- a/services/core/java/com/android/server/am/TaskRecord.java
+++ b/services/core/java/com/android/server/am/TaskRecord.java
@@ -1537,11 +1537,6 @@
                 ? Configuration.ORIENTATION_PORTRAIT
                 : Configuration.ORIENTATION_LANDSCAPE;
 
-        // Always set fontScale to be euqal to global. Can't set to 0, as that makes the override
-        // config not equal to EMPTY. Also can't set to 1, as Configuration.updateFrom will use
-        // the override scale as long as it's non-zero, and we'll always use 1.
-        config.fontScale = serviceConfig.fontScale;
-
         // For calculating screen layout, we need to use the non-decor inset screen area for the
         // calculation for compatibility reasons, i.e. screen area without system bars that could
         // never go away in Honeycomb.
@@ -1603,9 +1598,6 @@
         newScreenLayout = (newScreenLayout & ~SCREENLAYOUT_SIZE_MASK)
                 | (overrideScreenLayout & SCREENLAYOUT_SIZE_MASK);
         mOverrideConfig.screenLayout = newScreenLayout;
-        // we never override the fontScale, however we need to copy over the global value
-        // so that the default 1.0 doesn't get applied as an override.
-        mOverrideConfig.fontScale = globalConfig.fontScale;
     }
 
     static Rect validateBounds(Rect bounds) {
diff --git a/services/core/java/com/android/server/audio/AudioService.java b/services/core/java/com/android/server/audio/AudioService.java
index db67e00..3174c70 100644
--- a/services/core/java/com/android/server/audio/AudioService.java
+++ b/services/core/java/com/android/server/audio/AudioService.java
@@ -1136,8 +1136,11 @@
         final int currentUser = getCurrentUserId();
 
         // Check the current user restriction.
-        boolean masterMute = mUserManagerInternal.getUserRestriction(
-                    currentUser, UserManager.DISALLOW_ADJUST_VOLUME);
+        boolean masterMute =
+                mUserManagerInternal.getUserRestriction(currentUser,
+                        UserManager.DISALLLOW_UNMUTE_DEVICE)
+                        || mUserManagerInternal.getUserRestriction(currentUser,
+                        UserManager.DISALLOW_ADJUST_VOLUME);
         if (mUseFixedVolume) {
             masterMute = false;
             AudioSystem.setMasterVolume(1.0f);
@@ -5384,9 +5387,11 @@
             // Update speaker mute state.
             {
                 final boolean wasRestricted =
-                        prevRestrictions.getBoolean(UserManager.DISALLOW_ADJUST_VOLUME);
+                        prevRestrictions.getBoolean(UserManager.DISALLOW_ADJUST_VOLUME)
+                                || prevRestrictions.getBoolean(UserManager.DISALLLOW_UNMUTE_DEVICE);
                 final boolean isRestricted =
-                        newRestrictions.getBoolean(UserManager.DISALLOW_ADJUST_VOLUME);
+                        newRestrictions.getBoolean(UserManager.DISALLOW_ADJUST_VOLUME)
+                                || newRestrictions.getBoolean(UserManager.DISALLLOW_UNMUTE_DEVICE);
                 if (wasRestricted != isRestricted) {
                     setMasterMuteInternalNoCallerCheck(isRestricted, /* flags =*/ 0, userId);
                 }
diff --git a/services/core/java/com/android/server/connectivity/PermissionMonitor.java b/services/core/java/com/android/server/connectivity/PermissionMonitor.java
index eb1c77e..e084ff8 100644
--- a/services/core/java/com/android/server/connectivity/PermissionMonitor.java
+++ b/services/core/java/com/android/server/connectivity/PermissionMonitor.java
@@ -18,6 +18,7 @@
 
 import static android.Manifest.permission.CHANGE_NETWORK_STATE;
 import static android.Manifest.permission.CONNECTIVITY_INTERNAL;
+import static android.Manifest.permission.CONNECTIVITY_USE_RESTRICTED_NETWORKS;
 import static android.content.pm.ApplicationInfo.FLAG_SYSTEM;
 import static android.content.pm.ApplicationInfo.FLAG_UPDATED_SYSTEM_APP;
 import static android.content.pm.PackageManager.GET_PERMISSIONS;
@@ -65,10 +66,10 @@
     private final BroadcastReceiver mIntentReceiver;
 
     // Values are User IDs.
-    private final Set<Integer> mUsers = new HashSet<Integer>();
+    private final Set<Integer> mUsers = new HashSet<>();
 
     // Keys are App IDs. Values are true for SYSTEM permission and false for NETWORK permission.
-    private final Map<Integer, Boolean> mApps = new HashMap<Integer, Boolean>();
+    private final Map<Integer, Boolean> mApps = new HashMap<>();
 
     public PermissionMonitor(Context context, INetworkManagementService netd) {
         mContext = context;
@@ -126,14 +127,14 @@
             }
 
             boolean isNetwork = hasNetworkPermission(app);
-            boolean isSystem = hasSystemPermission(app);
+            boolean hasRestrictedPermission = hasRestrictedNetworkPermission(app);
 
-            if (isNetwork || isSystem) {
+            if (isNetwork || hasRestrictedPermission) {
                 Boolean permission = mApps.get(uid);
                 // If multiple packages share a UID (cf: android:sharedUserId) and ask for different
                 // permissions, don't downgrade (i.e., if it's already SYSTEM, leave it as is).
                 if (permission == null || permission == NETWORK) {
-                    mApps.put(uid, isSystem);
+                    mApps.put(uid, hasRestrictedPermission);
                 }
             }
         }
@@ -164,12 +165,13 @@
         return hasPermission(app, CHANGE_NETWORK_STATE);
     }
 
-    private boolean hasSystemPermission(PackageInfo app) {
+    private boolean hasRestrictedNetworkPermission(PackageInfo app) {
         int flags = app.applicationInfo != null ? app.applicationInfo.flags : 0;
         if ((flags & FLAG_SYSTEM) != 0 || (flags & FLAG_UPDATED_SYSTEM_APP) != 0) {
             return true;
         }
-        return hasPermission(app, CONNECTIVITY_INTERNAL);
+        return hasPermission(app, CONNECTIVITY_INTERNAL)
+                || hasPermission(app, CONNECTIVITY_USE_RESTRICTED_NETWORKS);
     }
 
     private int[] toIntArray(List<Integer> list) {
@@ -181,8 +183,8 @@
     }
 
     private void update(Set<Integer> users, Map<Integer, Boolean> apps, boolean add) {
-        List<Integer> network = new ArrayList<Integer>();
-        List<Integer> system = new ArrayList<Integer>();
+        List<Integer> network = new ArrayList<>();
+        List<Integer> system = new ArrayList<>();
         for (Entry<Integer, Boolean> app : apps.entrySet()) {
             List<Integer> list = app.getValue() ? system : network;
             for (int user : users) {
@@ -209,7 +211,7 @@
         }
         mUsers.add(user);
 
-        Set<Integer> users = new HashSet<Integer>();
+        Set<Integer> users = new HashSet<>();
         users.add(user);
         update(users, mApps, true);
     }
@@ -221,7 +223,7 @@
         }
         mUsers.remove(user);
 
-        Set<Integer> users = new HashSet<Integer>();
+        Set<Integer> users = new HashSet<>();
         users.add(user);
         update(users, mApps, false);
     }
@@ -234,9 +236,9 @@
         try {
             final PackageInfo app = mPackageManager.getPackageInfo(name, GET_PERMISSIONS);
             final boolean isNetwork = hasNetworkPermission(app);
-            final boolean isSystem = hasSystemPermission(app);
-            if (isNetwork || isSystem) {
-                currentPermission = isSystem;
+            final boolean hasRestrictedPermission = hasRestrictedNetworkPermission(app);
+            if (isNetwork || hasRestrictedPermission) {
+                currentPermission = hasRestrictedPermission;
             }
         } catch (NameNotFoundException e) {
             // App not found.
@@ -257,7 +259,7 @@
         if (permission != mApps.get(appUid)) {
             mApps.put(appUid, permission);
 
-            Map<Integer, Boolean> apps = new HashMap<Integer, Boolean>();
+            Map<Integer, Boolean> apps = new HashMap<>();
             apps.put(appUid, permission);
             update(mUsers, apps, true);
         }
@@ -268,7 +270,7 @@
             loge("Invalid app in onAppRemoved: " + appUid);
             return;
         }
-        Map<Integer, Boolean> apps = new HashMap<Integer, Boolean>();
+        Map<Integer, Boolean> apps = new HashMap<>();
 
         Boolean permission = null;
         String[] packages = mPackageManager.getPackagesForUid(appUid);
diff --git a/services/core/java/com/android/server/connectivity/tethering/IPv6TetheringInterfaceServices.java b/services/core/java/com/android/server/connectivity/tethering/IPv6TetheringInterfaceServices.java
index b742838..a58d243 100644
--- a/services/core/java/com/android/server/connectivity/tethering/IPv6TetheringInterfaceServices.java
+++ b/services/core/java/com/android/server/connectivity/tethering/IPv6TetheringInterfaceServices.java
@@ -157,8 +157,17 @@
             }
         } else {
             if (mLastLocalRoutes != null && !mLastLocalRoutes.isEmpty()) {
-                // TODO: Remove only locally added network routes.
-                // mNMSwervice.removeInterfaceFromLocalNetwork(mIfName);
+                try {
+                    final int removalFailures =
+                            mNMService.removeRoutesFromLocalNetwork(mLastLocalRoutes);
+                    if (removalFailures > 0) {
+                        Log.e(TAG,
+                                String.format("Failed to remove %d IPv6 routes from local table.",
+                                removalFailures));
+                    }
+                } catch (RemoteException e) {
+                    Log.e(TAG, "Failed to remove IPv6 routes from local table: ", e);
+                }
             }
         }
 
diff --git a/services/core/java/com/android/server/job/JobPackageTracker.java b/services/core/java/com/android/server/job/JobPackageTracker.java
index ba96b74..82e2eb4 100644
--- a/services/core/java/com/android/server/job/JobPackageTracker.java
+++ b/services/core/java/com/android/server/job/JobPackageTracker.java
@@ -395,7 +395,10 @@
             return 0;
         }
         final long now = SystemClock.uptimeMillis();
-        long time = cur.getActiveTime(now) + cur.getPendingTime(now);
+        long time = 0;
+        if (cur != null) {
+            time += cur.getActiveTime(now) + cur.getPendingTime(now);
+        }
         long period = mCurDataSet.getTotalTime(now);
         if (last != null) {
             time += last.getActiveTime(now) + last.getPendingTime(now);
diff --git a/services/core/java/com/android/server/pm/LauncherAppsService.java b/services/core/java/com/android/server/pm/LauncherAppsService.java
index b4dd587..cd5bcd4 100644
--- a/services/core/java/com/android/server/pm/LauncherAppsService.java
+++ b/services/core/java/com/android/server/pm/LauncherAppsService.java
@@ -459,9 +459,8 @@
             }
             // Note the target activity doesn't have to be exported.
 
-            // TODO Use sourceBounds
-
             intents[0].addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
+            intents[0].setSourceBounds(sourceBounds);
 
             return startShortcutIntentsAsPublisher(
                     intents, packageName, startActivityOptions, userId);
diff --git a/services/core/java/com/android/server/pm/PackageManagerService.java b/services/core/java/com/android/server/pm/PackageManagerService.java
index de0515a..716e297 100644
--- a/services/core/java/com/android/server/pm/PackageManagerService.java
+++ b/services/core/java/com/android/server/pm/PackageManagerService.java
@@ -179,6 +179,7 @@
 import android.os.Message;
 import android.os.Parcel;
 import android.os.ParcelFileDescriptor;
+import android.os.PatternMatcher;
 import android.os.Process;
 import android.os.RemoteCallbackList;
 import android.os.RemoteException;
@@ -1124,6 +1125,8 @@
     final @NonNull String mServicesSystemSharedLibraryPackageName;
     final @NonNull String mSharedSystemSharedLibraryPackageName;
 
+    final boolean mPermissionReviewRequired;
+
     private final PackageUsage mPackageUsage = new PackageUsage();
     private final CompilerStats mCompilerStats = new CompilerStats();
 
@@ -2050,6 +2053,7 @@
 
     public PackageManagerService(Context context, Installer installer,
             boolean factoryTest, boolean onlyCore) {
+        Trace.traceBegin(TRACE_TAG_PACKAGE_MANAGER, "create package manager");
         EventLog.writeEvent(EventLogTags.BOOT_PROGRESS_PMS_START,
                 SystemClock.uptimeMillis());
 
@@ -2058,6 +2062,10 @@
         }
 
         mContext = context;
+
+        mPermissionReviewRequired = context.getResources().getBoolean(
+                R.bool.config_permissionReviewRequired);
+
         mFactoryTest = factoryTest;
         mOnlyCore = onlyCore;
         mMetrics = new DisplayMetrics();
@@ -2102,10 +2110,12 @@
 
         getDefaultDisplayMetrics(context, mMetrics);
 
+        Trace.traceBegin(TRACE_TAG_PACKAGE_MANAGER, "get system config");
         SystemConfig systemConfig = SystemConfig.getInstance();
         mGlobalGids = systemConfig.getGlobalGids();
         mSystemPermissions = systemConfig.getSystemPermissions();
         mAvailableFeatures = systemConfig.getAvailableFeatures();
+        Trace.traceEnd(TRACE_TAG_PACKAGE_MANAGER);
 
         mProtectedPackages = new ProtectedPackages(mContext);
 
@@ -2151,7 +2161,9 @@
 
             mFoundPolicyFile = SELinuxMMAC.readInstallPolicy();
 
+            Trace.traceBegin(TRACE_TAG_PACKAGE_MANAGER, "read user settings");
             mFirstBoot = !mSettings.readLPw(sUserManager.getUsers(false));
+            Trace.traceEnd(TRACE_TAG_PACKAGE_MANAGER);
 
             if (mFirstBoot) {
                 requestCopyPreoptedFiles();
@@ -2195,6 +2207,7 @@
              * Ensure all external libraries have had dexopt run on them.
              */
             if (mSharedLibraries.size() > 0) {
+                Trace.traceBegin(TRACE_TAG_PACKAGE_MANAGER, "dexopt");
                 // NOTE: For now, we're compiling these system "shared libraries"
                 // (and framework jars) into all available architectures. It's possible
                 // to compile them only when we come across an app that uses them (there's
@@ -2228,6 +2241,7 @@
                         }
                     }
                 }
+                Trace.traceEnd(TRACE_TAG_PACKAGE_MANAGER);
             }
 
             File frameworkDir = new File(Environment.getRootDirectory(), "framework");
@@ -2582,7 +2596,9 @@
             ver.databaseVersion = Settings.CURRENT_DATABASE_VERSION;
 
             // can downgrade to reader
+            Trace.traceBegin(TRACE_TAG_PACKAGE_MANAGER, "write settings");
             mSettings.writeLPr();
+            Trace.traceEnd(TRACE_TAG_PACKAGE_MANAGER);
 
             // Perform dexopt on all apps that mark themselves as coreApps. We do this pretty
             // early on (before the package manager declares itself as early) because other
@@ -2678,7 +2694,9 @@
         // Now after opening every single application zip, make sure they
         // are all flushed.  Not really needed, but keeps things nice and
         // tidy.
+        Trace.traceBegin(TRACE_TAG_PACKAGE_MANAGER, "GC");
         Runtime.getRuntime().gc();
+        Trace.traceEnd(TRACE_TAG_PACKAGE_MANAGER);
 
         // The initial scanning above does many calls into installd while
         // holding the mPackages lock, but we're mostly interested in yelling
@@ -2687,6 +2705,7 @@
 
         // Expose private service for system components to use.
         LocalServices.addService(PackageManagerInternal.class, new PackageManagerInternalImpl());
+        Trace.traceEnd(TRACE_TAG_PACKAGE_MANAGER);
     }
 
     @Override
@@ -3982,7 +4001,7 @@
             // their permissions as always granted runtime ones since we need
             // to keep the review required permission flag per user while an
             // install permission's state is shared across all users.
-            if (Build.PERMISSIONS_REVIEW_REQUIRED
+            if ((mPermissionReviewRequired || Build.PERMISSIONS_REVIEW_REQUIRED)
                     && pkg.applicationInfo.targetSdkVersion < Build.VERSION_CODES.M
                     && bp.isRuntime()) {
                 return;
@@ -4093,7 +4112,7 @@
             // their permissions as always granted runtime ones since we need
             // to keep the review required permission flag per user while an
             // install permission's state is shared across all users.
-            if (Build.PERMISSIONS_REVIEW_REQUIRED
+            if ((mPermissionReviewRequired || Build.PERMISSIONS_REVIEW_REQUIRED)
                     && pkg.applicationInfo.targetSdkVersion < Build.VERSION_CODES.M
                     && bp.isRuntime()) {
                 return;
@@ -4727,20 +4746,6 @@
 
             final ResolveInfo bestChoice =
                     chooseBestActivity(intent, resolvedType, flags, query, userId);
-
-            if (isEphemeralAllowed(intent, query, userId)) {
-                Trace.traceBegin(TRACE_TAG_PACKAGE_MANAGER, "resolveEphemeral");
-                final EphemeralResolveInfo ai =
-                        getEphemeralResolveInfo(intent, resolvedType, userId);
-                if (ai != null) {
-                    if (DEBUG_EPHEMERAL) {
-                        Slog.v(TAG, "Returning an EphemeralResolveInfo");
-                    }
-                    bestChoice.ephemeralInstaller = mEphemeralInstallerInfo;
-                    bestChoice.ephemeralResolveInfo = ai;
-                }
-                Trace.traceEnd(TRACE_TAG_PACKAGE_MANAGER);
-            }
             return bestChoice;
         } finally {
             Trace.traceEnd(TRACE_TAG_PACKAGE_MANAGER);
@@ -4781,9 +4786,9 @@
                 false, false, false, userId);
     }
 
-
     private boolean isEphemeralAllowed(
-            Intent intent, List<ResolveInfo> resolvedActivites, int userId) {
+            Intent intent, List<ResolveInfo> resolvedActivities, int userId,
+            boolean skipPackageCheck) {
         // Short circuit and return early if possible.
         if (DISABLE_EPHEMERAL_APPS) {
             return false;
@@ -4798,18 +4803,21 @@
         if (intent.getComponent() != null) {
             return false;
         }
-        if (intent.getPackage() != null) {
+        if ((intent.getFlags() & Intent.FLAG_IGNORE_EPHEMERAL) != 0) {
+            return false;
+        }
+        if (!skipPackageCheck && intent.getPackage() != null) {
             return false;
         }
         final boolean isWebUri = hasWebURI(intent);
-        if (!isWebUri) {
+        if (!isWebUri || intent.getData().getHost() == null) {
             return false;
         }
         // Deny ephemeral apps if the user chose _ALWAYS or _ALWAYS_ASK for intent resolution.
         synchronized (mPackages) {
-            final int count = resolvedActivites.size();
+            final int count = (resolvedActivities == null ? 0 : resolvedActivities.size());
             for (int n = 0; n < count; n++) {
-                ResolveInfo info = resolvedActivites.get(n);
+                ResolveInfo info = resolvedActivities.get(n);
                 String packageName = info.activityInfo.packageName;
                 PackageSetting ps = mSettings.mPackages.get(packageName);
                 if (ps != null) {
@@ -4831,19 +4839,19 @@
         return true;
     }
 
-    private EphemeralResolveInfo getEphemeralResolveInfo(Intent intent, String resolvedType,
-            int userId) {
-        final int ephemeralPrefixMask = Global.getInt(mContext.getContentResolver(),
+    private static EphemeralResolveInfo getEphemeralResolveInfo(
+            Context context, EphemeralResolverConnection resolverConnection, Intent intent,
+            String resolvedType, int userId, String packageName) {
+        final int ephemeralPrefixMask = Global.getInt(context.getContentResolver(),
                 Global.EPHEMERAL_HASH_PREFIX_MASK, DEFAULT_EPHEMERAL_HASH_PREFIX_MASK);
-        final int ephemeralPrefixCount = Global.getInt(mContext.getContentResolver(),
+        final int ephemeralPrefixCount = Global.getInt(context.getContentResolver(),
                 Global.EPHEMERAL_HASH_PREFIX_COUNT, DEFAULT_EPHEMERAL_HASH_PREFIX_COUNT);
         final EphemeralDigest digest = new EphemeralDigest(intent.getData(), ephemeralPrefixMask,
                 ephemeralPrefixCount);
         final int[] shaPrefix = digest.getDigestPrefix();
         final byte[][] digestBytes = digest.getDigestBytes();
         final List<EphemeralResolveInfo> ephemeralResolveInfoList =
-                mEphemeralResolverConnection.getEphemeralResolveInfoList(
-                        shaPrefix, ephemeralPrefixMask);
+                resolverConnection.getEphemeralResolveInfoList(shaPrefix, ephemeralPrefixMask);
         if (ephemeralResolveInfoList == null || ephemeralResolveInfoList.size() == 0) {
             // No hash prefix match; there are no ephemeral apps for this domain.
             return null;
@@ -4860,6 +4868,10 @@
                 if (filters.isEmpty()) {
                     continue;
                 }
+                if (packageName != null
+                        && !packageName.equals(ephemeralApplication.getPackageName())) {
+                    continue;
+                }
                 // We have a domain match; resolve the filters to see if anything matches.
                 final EphemeralIntentResolver ephemeralResolver = new EphemeralIntentResolver();
                 for (int j = filters.size() - 1; j >= 0; --j) {
@@ -5263,8 +5275,12 @@
         }
 
         // reader
+        boolean sortResult = false;
+        boolean addEphemeral = false;
+        boolean matchEphemeralPackage = false;
+        List<ResolveInfo> result;
+        final String pkgName = intent.getPackage();
         synchronized (mPackages) {
-            final String pkgName = intent.getPackage();
             if (pkgName == null) {
                 List<CrossProfileIntentFilter> matchingFilters =
                         getMatchingCrossProfileIntentFilters(intent, resolvedType, userId);
@@ -5272,15 +5288,16 @@
                 ResolveInfo xpResolveInfo  = querySkipCurrentProfileIntents(matchingFilters, intent,
                         resolvedType, flags, userId);
                 if (xpResolveInfo != null) {
-                    List<ResolveInfo> result = new ArrayList<ResolveInfo>(1);
-                    result.add(xpResolveInfo);
-                    return filterIfNotSystemUser(result, userId);
+                    List<ResolveInfo> xpResult = new ArrayList<ResolveInfo>(1);
+                    xpResult.add(xpResolveInfo);
+                    return filterIfNotSystemUser(xpResult, userId);
                 }
 
                 // Check for results in the current profile.
-                List<ResolveInfo> result = mActivities.queryIntent(
-                        intent, resolvedType, flags, userId);
-                result = filterIfNotSystemUser(result, userId);
+                result = filterIfNotSystemUser(mActivities.queryIntent(
+                        intent, resolvedType, flags, userId), userId);
+                addEphemeral =
+                        isEphemeralAllowed(intent, result, userId, false /*skipPackageCheck*/);
 
                 // Check for cross profile results.
                 boolean hasNonNegativePriorityResult = hasNonNegativePriority(result);
@@ -5292,7 +5309,7 @@
                             Collections.singletonList(xpResolveInfo), userId).size() > 0;
                     if (isVisibleToUser) {
                         result.add(xpResolveInfo);
-                        Collections.sort(result, mResolvePrioritySorter);
+                        sortResult = true;
                     }
                 }
                 if (hasWebURI(intent)) {
@@ -5308,28 +5325,61 @@
                             // in the result.
                             result.remove(xpResolveInfo);
                         }
-                        if (result.size() == 0) {
+                        if (result.size() == 0 && !addEphemeral) {
                             result.add(xpDomainInfo.resolveInfo);
                             return result;
                         }
-                    } else if (result.size() <= 1) {
-                        return result;
                     }
-                    result = filterCandidatesWithDomainPreferredActivitiesLPr(intent, flags, result,
-                            xpDomainInfo, userId);
-                    Collections.sort(result, mResolvePrioritySorter);
+                    if (result.size() > 1 || addEphemeral) {
+                        result = filterCandidatesWithDomainPreferredActivitiesLPr(
+                                intent, flags, result, xpDomainInfo, userId);
+                        sortResult = true;
+                    }
                 }
-                return result;
+            } else {
+                final PackageParser.Package pkg = mPackages.get(pkgName);
+                if (pkg != null) {
+                    result = filterIfNotSystemUser(
+                            mActivities.queryIntentForPackage(
+                                    intent, resolvedType, flags, pkg.activities, userId),
+                            userId);
+                } else {
+                    // the caller wants to resolve for a particular package; however, there
+                    // were no installed results, so, try to find an ephemeral result
+                    addEphemeral = isEphemeralAllowed(
+                            intent, null /*result*/, userId, true /*skipPackageCheck*/);
+                    matchEphemeralPackage = true;
+                    result = new ArrayList<ResolveInfo>();
+                }
             }
-            final PackageParser.Package pkg = mPackages.get(pkgName);
-            if (pkg != null) {
-                return filterIfNotSystemUser(
-                        mActivities.queryIntentForPackage(
-                                intent, resolvedType, flags, pkg.activities, userId),
-                        userId);
-            }
-            return new ArrayList<ResolveInfo>();
         }
+        if (addEphemeral) {
+            Trace.traceBegin(TRACE_TAG_PACKAGE_MANAGER, "resolveEphemeral");
+            final EphemeralResolveInfo ai = getEphemeralResolveInfo(
+                    mContext, mEphemeralResolverConnection, intent, resolvedType, userId,
+                    matchEphemeralPackage ? pkgName : null);
+            if (ai != null) {
+                if (DEBUG_EPHEMERAL) {
+                    Slog.v(TAG, "Adding ephemeral installer to the ResolveInfo list");
+                }
+                final ResolveInfo ephemeralInstaller = new ResolveInfo(mEphemeralInstallerInfo);
+                ephemeralInstaller.ephemeralResolveInfo = ai;
+                // make sure this resolver is the default
+                ephemeralInstaller.isDefault = true;
+                ephemeralInstaller.match = IntentFilter.MATCH_CATEGORY_SCHEME_SPECIFIC_PART
+                        | IntentFilter.MATCH_ADJUSTMENT_NORMAL;
+                // add a non-generic filter
+                ephemeralInstaller.filter = new IntentFilter(intent.getAction());
+                ephemeralInstaller.filter.addDataPath(
+                        intent.getData().getPath(), PatternMatcher.PATTERN_LITERAL);
+                result.add(ephemeralInstaller);
+            }
+            Trace.traceEnd(TRACE_TAG_PACKAGE_MANAGER);
+        }
+        if (sortResult) {
+            Collections.sort(result, mResolvePrioritySorter);
+        }
+        return result;
     }
 
     private static class CrossProfileDomainInfo {
@@ -6527,7 +6577,7 @@
     }
 
     private void scanDirTracedLI(File dir, final int parseFlags, int scanFlags, long currentTime) {
-        Trace.traceBegin(TRACE_TAG_PACKAGE_MANAGER, "scanDir");
+        Trace.traceBegin(TRACE_TAG_PACKAGE_MANAGER, "scanDir [" + dir.getAbsolutePath() + "]");
         try {
             scanDirLI(dir, parseFlags, scanFlags, currentTime);
         } finally {
@@ -6645,9 +6695,12 @@
         }
 
         try {
+            Trace.traceBegin(TRACE_TAG_PACKAGE_MANAGER, "collectCertificates");
             PackageParser.collectCertificates(pkg, policyFlags);
         } catch (PackageParserException e) {
             throw PackageManagerException.from(e);
+        } finally {
+            Trace.traceEnd(TRACE_TAG_PACKAGE_MANAGER);
         }
     }
 
@@ -6657,7 +6710,7 @@
      */
     private PackageParser.Package scanPackageTracedLI(File scanFile, final int parseFlags,
             int scanFlags, long currentTime, UserHandle user) throws PackageManagerException {
-        Trace.traceBegin(TRACE_TAG_PACKAGE_MANAGER, "scanPackage");
+        Trace.traceBegin(TRACE_TAG_PACKAGE_MANAGER, "scanPackage [" + scanFile.toString() + "]");
         try {
             return scanPackageLI(scanFile, parseFlags, scanFlags, currentTime, user);
         } finally {
@@ -8284,7 +8337,9 @@
         final String cpuAbiOverride = deriveAbiOverride(pkg.cpuAbiOverride, pkgSetting);
 
         if ((scanFlags & SCAN_NEW_INSTALL) == 0) {
-            derivePackageAbi(pkg, scanFile, cpuAbiOverride, true /* extract libs */);
+            Trace.traceBegin(TRACE_TAG_PACKAGE_MANAGER, "derivePackageAbi");
+            derivePackageAbi(pkg, scanFile, cpuAbiOverride, true /*extractLibs*/);
+            Trace.traceEnd(TRACE_TAG_PACKAGE_MANAGER);
 
             // Some system apps still use directory structure for native libraries
             // in which case we might end up not detecting abi solely based on apk
@@ -8979,12 +9034,15 @@
                 int abi64 = PackageManager.NO_NATIVE_LIBRARIES;
                 if (Build.SUPPORTED_32_BIT_ABIS.length > 0) {
                     if (extractLibs) {
+                        Trace.traceBegin(TRACE_TAG_PACKAGE_MANAGER, "copyNativeBinaries");
                         abi32 = NativeLibraryHelper.copyNativeBinariesForSupportedAbi(handle,
                                 nativeLibraryRoot, Build.SUPPORTED_32_BIT_ABIS,
                                 useIsaSpecificSubdirs);
                     } else {
+                        Trace.traceBegin(TRACE_TAG_PACKAGE_MANAGER, "findSupportedAbi");
                         abi32 = NativeLibraryHelper.findSupportedAbi(handle, Build.SUPPORTED_32_BIT_ABIS);
                     }
+                    Trace.traceEnd(TRACE_TAG_PACKAGE_MANAGER);
                 }
 
                 maybeThrowExceptionForMultiArchCopy(
@@ -8992,12 +9050,15 @@
 
                 if (Build.SUPPORTED_64_BIT_ABIS.length > 0) {
                     if (extractLibs) {
+                        Trace.traceBegin(TRACE_TAG_PACKAGE_MANAGER, "copyNativeBinaries");
                         abi64 = NativeLibraryHelper.copyNativeBinariesForSupportedAbi(handle,
                                 nativeLibraryRoot, Build.SUPPORTED_64_BIT_ABIS,
                                 useIsaSpecificSubdirs);
                     } else {
+                        Trace.traceBegin(TRACE_TAG_PACKAGE_MANAGER, "findSupportedAbi");
                         abi64 = NativeLibraryHelper.findSupportedAbi(handle, Build.SUPPORTED_64_BIT_ABIS);
                     }
+                    Trace.traceEnd(TRACE_TAG_PACKAGE_MANAGER);
                 }
 
                 maybeThrowExceptionForMultiArchCopy(
@@ -9038,11 +9099,14 @@
 
                 final int copyRet;
                 if (extractLibs) {
+                    Trace.traceBegin(TRACE_TAG_PACKAGE_MANAGER, "copyNativeBinaries");
                     copyRet = NativeLibraryHelper.copyNativeBinariesForSupportedAbi(handle,
                             nativeLibraryRoot, abiList, useIsaSpecificSubdirs);
                 } else {
+                    Trace.traceBegin(TRACE_TAG_PACKAGE_MANAGER, "findSupportedAbi");
                     copyRet = NativeLibraryHelper.findSupportedAbi(handle, abiList);
                 }
+                Trace.traceEnd(TRACE_TAG_PACKAGE_MANAGER);
 
                 if (copyRet < 0 && copyRet != PackageManager.NO_NATIVE_LIBRARIES) {
                     throw new PackageManagerException(INSTALL_FAILED_INTERNAL_ERROR,
@@ -9194,15 +9258,17 @@
         mEphemeralInstallerActivity.packageName = pkg.applicationInfo.packageName;
         mEphemeralInstallerActivity.processName = pkg.applicationInfo.packageName;
         mEphemeralInstallerActivity.launchMode = ActivityInfo.LAUNCH_MULTIPLE;
-        mEphemeralInstallerActivity.flags = ActivityInfo.FLAG_EXCLUDE_FROM_RECENTS |
-                ActivityInfo.FLAG_FINISH_ON_CLOSE_SYSTEM_DIALOGS;
+        mEphemeralInstallerActivity.flags = ActivityInfo.FLAG_EXCLUDE_FROM_RECENTS
+                | ActivityInfo.FLAG_FINISH_ON_CLOSE_SYSTEM_DIALOGS;
         mEphemeralInstallerActivity.theme = 0;
         mEphemeralInstallerActivity.exported = true;
         mEphemeralInstallerActivity.enabled = true;
         mEphemeralInstallerInfo.activityInfo = mEphemeralInstallerActivity;
         mEphemeralInstallerInfo.priority = 0;
-        mEphemeralInstallerInfo.preferredOrder = 0;
-        mEphemeralInstallerInfo.match = 0;
+        mEphemeralInstallerInfo.preferredOrder = 1;
+        mEphemeralInstallerInfo.isDefault = true;
+        mEphemeralInstallerInfo.match = IntentFilter.MATCH_CATEGORY_SCHEME_SPECIFIC_PART
+                | IntentFilter.MATCH_ADJUSTMENT_NORMAL;
 
         if (DEBUG_EPHEMERAL) {
             Slog.d(TAG, "Set ephemeral installer activity: " + mEphemeralInstallerComponent);
@@ -9765,6 +9831,7 @@
             }
         }
 
+        Trace.traceBegin(TRACE_TAG_PACKAGE_MANAGER, "grantPermissions");
         // Now update the permissions for all packages, in particular
         // replace the granted permissions of the system packages.
         if ((flags&UPDATE_PERMISSIONS_ALL) != 0) {
@@ -9786,6 +9853,7 @@
                     && Objects.equals(replaceVolumeUuid, volumeUuid);
             grantPermissionsLPw(pkgInfo, replace, changingPkg);
         }
+        Trace.traceEnd(TRACE_TAG_PACKAGE_MANAGER);
     }
 
     private void grantPermissionsLPw(PackageParser.Package pkg, boolean replace,
@@ -9806,8 +9874,6 @@
             return;
         }
 
-        Trace.traceBegin(TRACE_TAG_PACKAGE_MANAGER, "grantPermissions");
-
         PermissionsState permissionsState = ps.getPermissionsState();
         PermissionsState origPermissions = permissionsState;
 
@@ -9884,7 +9950,8 @@
                     // their permissions as always granted runtime ones since we need
                     // to keep the review required permission flag per user while an
                     // install permission's state is shared across all users.
-                    if (!appSupportsRuntimePermissions && !Build.PERMISSIONS_REVIEW_REQUIRED) {
+                    if (!appSupportsRuntimePermissions && !mPermissionReviewRequired
+                            && !Build.PERMISSIONS_REVIEW_REQUIRED) {
                         // For legacy apps dangerous permissions are install time ones.
                         grant = GRANT_INSTALL;
                     } else if (origPermissions.hasInstallPermission(bp.name)) {
@@ -9970,7 +10037,7 @@
                                             changedRuntimePermissionUserIds, userId);
                                 }
                                 // If the app supports runtime permissions no need for a review.
-                                if (Build.PERMISSIONS_REVIEW_REQUIRED
+                                if ((mPermissionReviewRequired || Build.PERMISSIONS_REVIEW_REQUIRED)
                                         && appSupportsRuntimePermissions
                                         && (flags & PackageManager
                                                 .FLAG_PERMISSION_REVIEW_REQUIRED) != 0) {
@@ -9979,7 +10046,8 @@
                                     changedRuntimePermissionUserIds = ArrayUtils.appendInt(
                                             changedRuntimePermissionUserIds, userId);
                                 }
-                            } else if (Build.PERMISSIONS_REVIEW_REQUIRED
+                            } else if ((mPermissionReviewRequired
+                                        || Build.PERMISSIONS_REVIEW_REQUIRED)
                                     && !appSupportsRuntimePermissions) {
                                 // For legacy apps that need a permission review, every new
                                 // runtime permission is granted but it is pending a review.
@@ -10087,8 +10155,6 @@
         for (int userId : changedRuntimePermissionUserIds) {
             mSettings.writeRuntimePermissionsForUserLPr(userId, runtimePermissionsRevoked);
         }
-
-        Trace.traceEnd(TRACE_TAG_PACKAGE_MANAGER);
     }
 
     private boolean isNewPlatformPermissionForPackage(String perm, PackageParser.Package pkg) {
@@ -12302,6 +12368,9 @@
             public void run() {
                 for (int i = 0; i < mRunningInstalls.size(); i++) {
                     final PostInstallData data = mRunningInstalls.valueAt(i);
+                    if (data.res.returnCode != PackageManager.INSTALL_SUCCEEDED) {
+                        continue;
+                    }
                     if (pkgName.equals(data.res.pkg.applicationInfo.packageName)) {
                         // right package; but is it for the right user?
                         for (int uIndex = 0; uIndex < data.res.newUsers.length; uIndex++) {
@@ -16460,7 +16529,7 @@
             // If permission review is enabled and this is a legacy app, mark the
             // permission as requiring a review as this is the initial state.
             int flags = 0;
-            if (Build.PERMISSIONS_REVIEW_REQUIRED
+            if ((mPermissionReviewRequired || Build.PERMISSIONS_REVIEW_REQUIRED)
                     && ps.pkg.applicationInfo.targetSdkVersion < Build.VERSION_CODES.M) {
                 flags |= FLAG_PERMISSION_REVIEW_REQUIRED;
             }
@@ -20330,7 +20399,7 @@
         // permissions to keep per user flag state whether review is needed.
         // Hence, if a new user is added we have to propagate dangerous
         // permission grants for these legacy apps.
-        if (Build.PERMISSIONS_REVIEW_REQUIRED) {
+        if (mPermissionReviewRequired || Build.PERMISSIONS_REVIEW_REQUIRED) {
             updatePermissionsLPw(null, null, UPDATE_PERMISSIONS_ALL
                     | UPDATE_PERMISSIONS_REPLACE_ALL);
         }
@@ -20784,7 +20853,7 @@
         public boolean isPermissionsReviewRequired(String packageName, int userId) {
             synchronized (mPackages) {
                 // If we do not support permission review, done.
-                if (!Build.PERMISSIONS_REVIEW_REQUIRED) {
+                if (!mPermissionReviewRequired && !Build.PERMISSIONS_REVIEW_REQUIRED) {
                     return false;
                 }
 
diff --git a/services/core/java/com/android/server/pm/PackageManagerShellCommand.java b/services/core/java/com/android/server/pm/PackageManagerShellCommand.java
index 5b2a423..61374f3 100644
--- a/services/core/java/com/android/server/pm/PackageManagerShellCommand.java
+++ b/services/core/java/com/android/server/pm/PackageManagerShellCommand.java
@@ -1249,7 +1249,7 @@
                     PackageInstaller.STATUS_FAILURE);
             if (status == PackageInstaller.STATUS_SUCCESS) {
                 if (logSuccess) {
-                    System.out.println("Success");
+                    pw.println("Success");
                 }
             } else {
                 pw.println("Failure ["
diff --git a/services/core/java/com/android/server/pm/ShortcutService.java b/services/core/java/com/android/server/pm/ShortcutService.java
index e6a9739..93693ce 100644
--- a/services/core/java/com/android/server/pm/ShortcutService.java
+++ b/services/core/java/com/android/server/pm/ShortcutService.java
@@ -131,12 +131,8 @@
  * - getIconMaxWidth()/getIconMaxHeight() should use xdpi and ydpi.
  *   -> But TypedValue.applyDimension() doesn't differentiate x and y..?
  *
- * - Default launcher check does take a few ms.  Worth caching.
- *
  * - Detect when already registered instances are passed to APIs again, which might break
  * internal bitmap handling.
- *
- * - Add more call stats.
  */
 public class ShortcutService extends IShortcutService.Stub {
     static final String TAG = "ShortcutService";
@@ -842,12 +838,17 @@
         getLastResetTimeLocked();
     }
 
+    @VisibleForTesting
+    final File getUserFile(@UserIdInt int userId) {
+        return new File(injectUserDataPath(userId), FILENAME_USER_PACKAGES);
+    }
+
     private void saveUserLocked(@UserIdInt int userId) {
-        final File path = new File(injectUserDataPath(userId), FILENAME_USER_PACKAGES);
+        final File path = getUserFile(userId);
         if (DEBUG) {
             Slog.d(TAG, "Saving to " + path);
         }
-        path.mkdirs();
+        path.getParentFile().mkdirs();
         final AtomicFile file = new AtomicFile(path);
         FileOutputStream os = null;
         try {
@@ -890,7 +891,7 @@
 
     @Nullable
     private ShortcutUser loadUserLocked(@UserIdInt int userId) {
-        final File path = new File(injectUserDataPath(userId), FILENAME_USER_PACKAGES);
+        final File path = getUserFile(userId);
         if (DEBUG) {
             Slog.d(TAG, "Loading from " + path);
         }
@@ -1349,16 +1350,21 @@
     }
 
     private void enforceSystemOrShell() {
-        Preconditions.checkState(isCallerSystem() || isCallerShell(),
-                "Caller must be system or shell");
+        if (!(isCallerSystem() || isCallerShell())) {
+            throw new SecurityException("Caller must be system or shell");
+        }
     }
 
     private void enforceShell() {
-        Preconditions.checkState(isCallerShell(), "Caller must be shell");
+        if (!isCallerShell()) {
+            throw new SecurityException("Caller must be shell");
+        }
     }
 
     private void enforceSystem() {
-        Preconditions.checkState(isCallerSystem(), "Caller must be system");
+        if (!isCallerSystem()) {
+            throw new SecurityException("Caller must be system");
+        }
     }
 
     private void enforceResetThrottlingPermission() {
@@ -1466,7 +1472,7 @@
      * Clean up / validate an incoming shortcut.
      * - Make sure all mandatory fields are set.
      * - Make sure the intent's extras are persistable, and them to set
-     * {@link ShortcutInfo#mIntentPersistableExtras}.  Also clear its extras.
+     * {@link ShortcutInfo#mIntentPersistableExtrases}.  Also clear its extras.
      * - Clear flags.
      *
      * TODO Detailed unit tests
@@ -3172,9 +3178,13 @@
 
         enforceShell();
 
-        final int status = (new MyShellCommand()).exec(this, in, out, err, args, resultReceiver);
-
-        resultReceiver.send(status, null);
+        final long token = injectClearCallingIdentity();
+        try {
+            final int status = (new MyShellCommand()).exec(this, in, out, err, args, resultReceiver);
+            resultReceiver.send(status, null);
+        } finally {
+            injectRestoreCallingIdentity(token);
+        }
     }
 
     static class CommandException extends Exception {
@@ -3219,9 +3229,6 @@
             final PrintWriter pw = getOutPrintWriter();
             try {
                 switch (cmd) {
-                    case "reset-package-throttling":
-                        handleResetPackageThrottling();
-                        break;
                     case "reset-throttling":
                         handleResetThrottling();
                         break;
@@ -3240,9 +3247,6 @@
                     case "get-default-launcher":
                         handleGetDefaultLauncher();
                         break;
-                    case "refresh-default-launcher":
-                        handleRefreshDefaultLauncher();
-                        break;
                     case "unload-user":
                         handleUnloadUser();
                         break;
@@ -3268,9 +3272,6 @@
             final PrintWriter pw = getOutPrintWriter();
             pw.println("Usage: cmd shortcut COMMAND [options ...]");
             pw.println();
-            pw.println("cmd shortcut reset-package-throttling [--user USER_ID] PACKAGE");
-            pw.println("    Reset throttling for a package");
-            pw.println();
             pw.println("cmd shortcut reset-throttling [--user USER_ID]");
             pw.println("    Reset throttling for all packages and users");
             pw.println();
@@ -3287,10 +3288,7 @@
             pw.println("    Clear the cached default launcher");
             pw.println();
             pw.println("cmd shortcut get-default-launcher [--user USER_ID]");
-            pw.println("    Show the cached default launcher");
-            pw.println();
-            pw.println("cmd shortcut refresh-default-launcher [--user USER_ID]");
-            pw.println("    Refresh the cached default launcher");
+            pw.println("    Show the default launcher");
             pw.println();
             pw.println("cmd shortcut unload-user [--user USER_ID]");
             pw.println("    Unload a user from the memory");
@@ -3304,7 +3302,7 @@
         private void handleResetThrottling() throws CommandException {
             parseOptions(/* takeUser =*/ true);
 
-            Slog.i(TAG, "cmd: handleResetThrottling");
+            Slog.i(TAG, "cmd: handleResetThrottling: user=" + mUserId);
 
             resetThrottlingInner(mUserId);
         }
@@ -3315,16 +3313,6 @@
             resetAllThrottlingInner();
         }
 
-        private void handleResetPackageThrottling() throws CommandException {
-            parseOptions(/* takeUser =*/ true);
-
-            final String packageName = getNextArgRequired();
-
-            Slog.i(TAG, "cmd: handleResetPackageThrottling: " + packageName);
-
-            resetPackageThrottling(packageName, mUserId);
-        }
-
         private void handleOverrideConfig() throws CommandException {
             final String config = getNextArgRequired();
 
@@ -3370,12 +3358,6 @@
         private void handleGetDefaultLauncher() throws CommandException {
             parseOptions(/* takeUser =*/ true);
 
-            showLauncher();
-        }
-
-        private void handleRefreshDefaultLauncher() throws CommandException {
-            parseOptions(/* takeUser =*/ true);
-
             clearLauncher();
             showLauncher();
         }
@@ -3383,7 +3365,7 @@
         private void handleUnloadUser() throws CommandException {
             parseOptions(/* takeUser =*/ true);
 
-            Slog.i(TAG, "cmd: handleUnloadUser: " + mUserId);
+            Slog.i(TAG, "cmd: handleUnloadUser: user=" + mUserId);
 
             ShortcutService.this.handleCleanupUser(mUserId);
         }
@@ -3392,7 +3374,7 @@
             parseOptions(/* takeUser =*/ true);
             final String packageName = getNextArgRequired();
 
-            Slog.i(TAG, "cmd: handleClearShortcuts: " + mUserId + ", " + packageName);
+            Slog.i(TAG, "cmd: handleClearShortcuts: user" + mUserId + ", " + packageName);
 
             ShortcutService.this.cleanUpPackageForAllLoadedUsers(packageName, mUserId,
                     /* appStillExists = */ true);
diff --git a/services/core/java/com/android/server/pm/UserRestrictionsUtils.java b/services/core/java/com/android/server/pm/UserRestrictionsUtils.java
index 0499757..772c64e 100644
--- a/services/core/java/com/android/server/pm/UserRestrictionsUtils.java
+++ b/services/core/java/com/android/server/pm/UserRestrictionsUtils.java
@@ -105,7 +105,8 @@
             UserManager.DISALLOW_DATA_ROAMING,
             UserManager.DISALLOW_SET_USER_ICON,
             UserManager.DISALLOW_SET_WALLPAPER,
-            UserManager.DISALLOW_OEM_UNLOCK
+            UserManager.DISALLOW_OEM_UNLOCK,
+            UserManager.DISALLLOW_UNMUTE_DEVICE,
     });
 
     /**
@@ -150,7 +151,8 @@
     private static final Set<String> GLOBAL_RESTRICTIONS = Sets.newArraySet(
             UserManager.DISALLOW_ADJUST_VOLUME,
             UserManager.DISALLOW_RUN_IN_BACKGROUND,
-            UserManager.DISALLOW_UNMUTE_MICROPHONE
+            UserManager.DISALLOW_UNMUTE_MICROPHONE,
+            UserManager.DISALLLOW_UNMUTE_DEVICE
     );
 
     /**
@@ -333,6 +335,9 @@
         // set, and in that case even if the restriction is lifted, changing it to ON would be
         // wrong.  So just don't do anything in such a case.  If the user hopes to enable location
         // later, they can do it on the Settings UI.
+        // WARNING: Remember that Settings.Global and Settings.Secure are changeable via adb.
+        // To prevent this from happening for a given user restriction, you have to add a check to
+        // SettingsProvider.isGlobalOrSecureSettingRestrictedForUser.
 
         final ContentResolver cr = context.getContentResolver();
         final long id = Binder.clearCallingIdentity();
@@ -436,6 +441,7 @@
                             manager.setOemUnlockEnabled(false);
                         }
                     }
+                    break;
             }
         } finally {
             Binder.restoreCallingIdentity(id);
diff --git a/services/core/java/com/android/server/policy/PhoneWindowManager.java b/services/core/java/com/android/server/policy/PhoneWindowManager.java
index f0b128e..d39031f 100644
--- a/services/core/java/com/android/server/policy/PhoneWindowManager.java
+++ b/services/core/java/com/android/server/policy/PhoneWindowManager.java
@@ -3061,15 +3061,6 @@
                     return -1;
                 }
 
-                // If an incoming call is ringing, HOME is totally disabled.
-                // (The user is already on the InCallUI at this point,
-                // and his ONLY options are to answer or reject the call.)
-                TelecomManager telecomManager = getTelecommService();
-                if (telecomManager != null && telecomManager.isRinging()) {
-                    Log.i(TAG, "Ignoring HOME; there's a ringing incoming call.");
-                    return -1;
-                }
-
                 // Delay handling home if a double-tap is possible.
                 if (mDoubleTapOnHomeBehavior != DOUBLE_TAP_HOME_NOTHING) {
                     mHandler.removeCallbacks(mHomeDoubleTapTimeoutRunnable); // just in case
diff --git a/services/core/java/com/android/server/power/ShutdownThread.java b/services/core/java/com/android/server/power/ShutdownThread.java
index 8ce2fd9..1dbc6d9 100644
--- a/services/core/java/com/android/server/power/ShutdownThread.java
+++ b/services/core/java/com/android/server/power/ShutdownThread.java
@@ -547,7 +547,7 @@
                             bluetooth.getState() == BluetoothAdapter.STATE_OFF;
                     if (!bluetoothOff) {
                         Log.w(TAG, "Disabling Bluetooth...");
-                        bluetooth.disable(false);  // disable but don't persist new state
+                        bluetooth.disable(mContext.getPackageName(), false);  // disable but don't persist new state
                     }
                 } catch (RemoteException ex) {
                     Log.e(TAG, "RemoteException during bluetooth shutdown", ex);
diff --git a/services/core/java/com/android/server/search/SearchManagerService.java b/services/core/java/com/android/server/search/SearchManagerService.java
index 2e5eb3a..f3b9b18 100644
--- a/services/core/java/com/android/server/search/SearchManagerService.java
+++ b/services/core/java/com/android/server/search/SearchManagerService.java
@@ -141,7 +141,12 @@
     }
 
     private void onUnlockUser(int userId) {
-        getSearchables(userId, true);
+        try {
+            getSearchables(userId, true);
+        } catch (IllegalStateException ignored) {
+            // We're just trying to warm a cache, so we don't mind if the user
+            // was stopped or destroyed before we got here.
+        }
     }
 
     private void onCleanupUser(int userId) {
diff --git a/services/core/java/com/android/server/wm/AppWindowToken.java b/services/core/java/com/android/server/wm/AppWindowToken.java
index 1000043..b7ee022 100644
--- a/services/core/java/com/android/server/wm/AppWindowToken.java
+++ b/services/core/java/com/android/server/wm/AppWindowToken.java
@@ -336,21 +336,41 @@
         }
     }
 
-    // Here we destroy surfaces which have been marked as eligible by the animator, taking care
-    // to ensure the client has finished with them. If the client could still be using them
-    // we will skip destruction and try again when the client has stopped.
     void destroySurfaces() {
+        destroySurfaces(false /*cleanupOnResume*/);
+    }
+
+    /**
+     * Destroy surfaces which have been marked as eligible by the animator, taking care to ensure
+     * the client has finished with them.
+     *
+     * @param cleanupOnResume whether this is done when app is resumed without fully stopped. If
+     * set to true, destroy only surfaces of removed windows, and clear relevant flags of the
+     * others so that they are ready to be reused. If set to false (common case), destroy all
+     * surfaces that's eligible, if the app is already stopped.
+     */
+
+    private void destroySurfaces(boolean cleanupOnResume) {
         final ArrayList<WindowState> allWindows = (ArrayList<WindowState>) allAppWindows.clone();
         final DisplayContentList displayList = new DisplayContentList();
         for (int i = allWindows.size() - 1; i >= 0; i--) {
             final WindowState win = allWindows.get(i);
 
-            if (!(mAppStopped || win.mWindowRemovalAllowed)) {
+            if (!(mAppStopped || win.mWindowRemovalAllowed || cleanupOnResume)) {
                 continue;
             }
 
             win.mWinAnimator.destroyPreservedSurfaceLocked();
 
+            if (cleanupOnResume) {
+                // If the window has an unfinished exit animation, consider that animation
+                // done and mark the window destroying so that it goes through the cleanup.
+                if (win.mAnimatingExit) {
+                    win.mDestroying = true;
+                    win.mAnimatingExit = false;
+                }
+            }
+
             if (!win.mDestroying) {
                 continue;
             }
@@ -360,7 +380,9 @@
                     + " win.mWindowRemovalAllowed=" + win.mWindowRemovalAllowed
                     + " win.mRemoveOnExit=" + win.mRemoveOnExit);
 
-            win.destroyOrSaveSurface();
+            if (!cleanupOnResume || win.mRemoveOnExit) {
+                win.destroyOrSaveSurface();
+            }
             if (win.mRemoveOnExit) {
                 win.remove();
             }
@@ -378,21 +400,30 @@
     }
 
     /**
-     * If the application has stopped it is okay to destroy any surfaces which were keeping alive
-     * in case they were still being used.
+     * Notify that the app is now resumed, and it was not stopped before, perform a clean
+     * up of the surfaces
      */
-    void notifyAppStopped(boolean stopped) {
-        if (DEBUG_ADD_REMOVE) Slog.v(TAG, "notifyAppStopped: stopped=" + stopped + " " + this);
-        mAppStopped = stopped;
-
-        if (stopped) {
-            destroySurfaces();
-            // Remove any starting window that was added for this app if they are still around.
-            mTask.mService.scheduleRemoveStartingWindowLocked(this);
+    void notifyAppResumed(boolean wasStopped) {
+        if (DEBUG_ADD_REMOVE) Slog.v(TAG, "notifyAppResumed: wasStopped=" + wasStopped + " " + this);
+        mAppStopped = false;
+        if (!wasStopped) {
+            destroySurfaces(true /*cleanupOnResume*/);
         }
     }
 
     /**
+     * Notify that the app has stopped, and it is okay to destroy any surfaces which were
+     * keeping alive in case they were still being used.
+     */
+    void notifyAppStopped() {
+        if (DEBUG_ADD_REMOVE) Slog.v(TAG, "notifyAppStopped: " + this);
+        mAppStopped = true;
+        destroySurfaces();
+        // Remove any starting window that was added for this app if they are still around.
+        mTask.mService.scheduleRemoveStartingWindowLocked(this);
+    }
+
+    /**
      * Checks whether we should save surfaces for this app.
      *
      * @return true if the surfaces should be saved, false otherwise.
diff --git a/services/core/java/com/android/server/wm/DragAndDropPermissionsHandler.java b/services/core/java/com/android/server/wm/DragAndDropPermissionsHandler.java
index 1831ff9..7cb6fc3 100644
--- a/services/core/java/com/android/server/wm/DragAndDropPermissionsHandler.java
+++ b/services/core/java/com/android/server/wm/DragAndDropPermissionsHandler.java
@@ -40,6 +40,7 @@
 
     private IBinder mActivityToken = null;
     private IBinder mPermissionOwnerToken = null;
+    private IBinder mTransientToken = null;
 
     DragAndDropPermissionsHandler(ClipData clipData, int sourceUid, String targetPackage, int mode,
                                   int sourceUserId, int targetUserId) {
@@ -80,12 +81,13 @@
     }
 
     @Override
-    public void takeTransient(IBinder permissionOwnerToken) throws RemoteException {
+    public void takeTransient(IBinder transientToken) throws RemoteException {
         if (mActivityToken != null || mPermissionOwnerToken != null) {
             return;
         }
-        mPermissionOwnerToken = permissionOwnerToken;
-        mPermissionOwnerToken.linkToDeath(this, 0);
+        mPermissionOwnerToken = ActivityManagerNative.getDefault().newUriPermissionOwner("drop");
+        mTransientToken = transientToken;
+        mTransientToken.linkToDeath(this, 0);
 
         doTake(mPermissionOwnerToken);
     }
@@ -109,8 +111,9 @@
             }
         } else {
             permissionOwner = mPermissionOwnerToken;
-            mPermissionOwnerToken.unlinkToDeath(this, 0);
             mPermissionOwnerToken = null;
+            mTransientToken.unlinkToDeath(this, 0);
+            mTransientToken = null;
         }
 
         for (int i = 0; i < mUris.size(); ++i) {
diff --git a/services/core/java/com/android/server/wm/WindowManagerService.java b/services/core/java/com/android/server/wm/WindowManagerService.java
index 5a4b7f7..08d42fb 100644
--- a/services/core/java/com/android/server/wm/WindowManagerService.java
+++ b/services/core/java/com/android/server/wm/WindowManagerService.java
@@ -4412,7 +4412,25 @@
     }
 
     @Override
-    public void notifyAppStopped(IBinder token, boolean stopped) {
+    public void notifyAppResumed(IBinder token, boolean wasStopped) {
+        if (!checkCallingPermission(android.Manifest.permission.MANAGE_APP_TOKENS,
+                "notifyAppResumed()")) {
+            throw new SecurityException("Requires MANAGE_APP_TOKENS permission");
+        }
+
+        synchronized(mWindowMap) {
+            final AppWindowToken wtoken;
+            wtoken = findAppWindowToken(token);
+            if (wtoken == null) {
+                Slog.w(TAG_WM, "Attempted to notify resumed of non-existing app token: " + token);
+                return;
+            }
+            wtoken.notifyAppResumed(wasStopped);
+        }
+    }
+
+    @Override
+    public void notifyAppStopped(IBinder token) {
         if (!checkCallingPermission(android.Manifest.permission.MANAGE_APP_TOKENS,
                 "notifyAppStopped()")) {
             throw new SecurityException("Requires MANAGE_APP_TOKENS permission");
@@ -4422,10 +4440,10 @@
             final AppWindowToken wtoken;
             wtoken = findAppWindowToken(token);
             if (wtoken == null) {
-                Slog.w(TAG_WM, "Attempted to set visibility of non-existing app token: " + token);
+                Slog.w(TAG_WM, "Attempted to notify stopped of non-existing app token: " + token);
                 return;
             }
-            wtoken.notifyAppStopped(stopped);
+            wtoken.notifyAppStopped();
         }
     }
 
@@ -7213,7 +7231,6 @@
             return null;
         }
         Configuration config = new Configuration();
-        config.fontScale = 0;
         computeScreenConfigurationLocked(config);
         return config;
     }
@@ -9292,7 +9309,7 @@
             if (task != null && task.mStack.getBoundsAnimating()) {
                 return;
             }
-            w.setInsetsChanged();
+            w.setReportResizeHints();
             boolean configChanged = w.isConfigChanged();
             if (DEBUG_CONFIGURATION && configChanged) {
                 Slog.v(TAG_WM, "Win " + w + " config changed: "
@@ -9304,11 +9321,11 @@
                     + ": configChanged=" + configChanged
                     + " dragResizingChanged=" + dragResizingChanged
                     + " last=" + w.mLastFrame + " frame=" + w.mFrame);
-            w.mLastFrame.set(w.mFrame);
             if (w.mContentInsetsChanged
                     || w.mVisibleInsetsChanged
                     || winAnimator.mSurfaceResized
                     || w.mOutsetsChanged
+                    || w.mFrameSizeChanged
                     || configChanged
                     || dragResizingChanged
                     || !w.isResizedWhileNotDragResizingReported()) {
@@ -9341,6 +9358,7 @@
                 w.mLastVisibleInsets.set(w.mVisibleInsets);
                 w.mLastStableInsets.set(w.mStableInsets);
                 w.mLastOutsets.set(w.mOutsets);
+                w.mLastFrame.set(w.mFrame);
                 makeWindowFreezingScreenIfNeededLocked(w);
                 // If the orientation is changing, or we're starting or ending
                 // a drag resizing action, then we need to hold off on unfreezing
diff --git a/services/core/java/com/android/server/wm/WindowState.java b/services/core/java/com/android/server/wm/WindowState.java
index 21d02f8..cfd9060 100644
--- a/services/core/java/com/android/server/wm/WindowState.java
+++ b/services/core/java/com/android/server/wm/WindowState.java
@@ -300,6 +300,7 @@
     // "Real" frame that the application sees, in display coordinate space.
     final Rect mFrame = new Rect();
     final Rect mLastFrame = new Rect();
+    boolean mFrameSizeChanged = false;
     // Frame that is scaled to the application's coordinate space when in
     // screen size compatibility mode.
     final Rect mCompatFrame = new Rect();
@@ -820,10 +821,10 @@
             final int height = Math.min(mFrame.height(), mContentFrame.height());
             final int width = Math.min(mContentFrame.width(), mFrame.width());
             final DisplayMetrics displayMetrics = getDisplayContent().getDisplayMetrics();
-            final int minVisibleHeight = WindowManagerService.dipToPixel(
-                    MINIMUM_VISIBLE_HEIGHT_IN_DP, displayMetrics);
-            final int minVisibleWidth = WindowManagerService.dipToPixel(
-                    MINIMUM_VISIBLE_WIDTH_IN_DP, displayMetrics);
+            final int minVisibleHeight = Math.min(height, WindowManagerService.dipToPixel(
+                    MINIMUM_VISIBLE_HEIGHT_IN_DP, displayMetrics));
+            final int minVisibleWidth = Math.min(width, WindowManagerService.dipToPixel(
+                    MINIMUM_VISIBLE_WIDTH_IN_DP, displayMetrics));
             final int top = Math.max(mContentFrame.top,
                     Math.min(mFrame.top, mContentFrame.bottom - minVisibleHeight));
             final int left = Math.max(mContentFrame.left + minVisibleWidth - width,
@@ -1050,14 +1051,16 @@
         return mAppToken != null && mAppToken.voiceInteraction;
     }
 
-    boolean setInsetsChanged() {
+    boolean setReportResizeHints() {
         mOverscanInsetsChanged |= !mLastOverscanInsets.equals(mOverscanInsets);
         mContentInsetsChanged |= !mLastContentInsets.equals(mContentInsets);
         mVisibleInsetsChanged |= !mLastVisibleInsets.equals(mVisibleInsets);
         mStableInsetsChanged |= !mLastStableInsets.equals(mStableInsets);
         mOutsetsChanged |= !mLastOutsets.equals(mOutsets);
+        mFrameSizeChanged |= (mLastFrame.width() != mFrame.width()) ||
+                (mLastFrame.height() != mFrame.height());
         return mOverscanInsetsChanged || mContentInsetsChanged || mVisibleInsetsChanged
-                || mOutsetsChanged;
+                || mOutsetsChanged || mFrameSizeChanged;
     }
 
     public DisplayContent getDisplayContent() {
@@ -2339,6 +2342,7 @@
             mVisibleInsetsChanged = false;
             mStableInsetsChanged = false;
             mOutsetsChanged = false;
+            mFrameSizeChanged = false;
             mResizedWhileNotDragResizingReported = true;
             mWinAnimator.mSurfaceResized = false;
         } catch (RemoteException e) {
@@ -2757,12 +2761,12 @@
         // We need to fit it to the display if either
         // a) The task is fullscreen, or we don't have a task (we assume fullscreen for the taskless
         // windows)
-        // b) If it's a child window, we also need to fit it to the display unless
-        // FLAG_LAYOUT_NO_LIMITS is set. This is so we place Popup and similar windows on screen,
+        // b) If it's a secondary app window, we also need to fit it to the display unless
+        // FLAG_LAYOUT_NO_LIMITS is set. This is so we place Popups, dialogs, and similar windows on screen,
         // but SurfaceViews want to be always at a specific location so we don't fit it to the
         // display.
         final boolean fitToDisplay = (task == null || !nonFullscreenTask)
-                || (mIsChildWindow && !noLimits);
+                || ((mAttrs.type != TYPE_BASE_APPLICATION) && !noLimits);
         float x, y;
         int w,h;
 
diff --git a/services/core/java/com/android/server/wm/WindowSurfacePlacer.java b/services/core/java/com/android/server/wm/WindowSurfacePlacer.java
index b8dec49..def6f91 100644
--- a/services/core/java/com/android/server/wm/WindowSurfacePlacer.java
+++ b/services/core/java/com/android/server/wm/WindowSurfacePlacer.java
@@ -973,7 +973,7 @@
             // windows, since that means "perform layout as normal,
             // just don't display").
             if (!gone || !win.mHaveFrame || win.mLayoutNeeded
-                    || ((win.isConfigChanged() || win.setInsetsChanged())
+                    || ((win.isConfigChanged() || win.setReportResizeHints())
                             && !win.isGoneForLayoutLw() &&
                             ((win.mAttrs.privateFlags & PRIVATE_FLAG_KEYGUARD) != 0 ||
                             (win.mHasSurface && win.mAppToken != null &&
diff --git a/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java b/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
index 32fc515..4ba423d 100644
--- a/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
+++ b/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
@@ -3672,12 +3672,16 @@
 
     private boolean isActivePasswordSufficientForUserLocked(
             DevicePolicyData policy, int userHandle, boolean parent) {
-        if (policy.mActivePasswordQuality < getPasswordQuality(null, userHandle, parent)
-                || policy.mActivePasswordLength < getPasswordMinimumLength(
+        final int requiredPasswordQuality = getPasswordQuality(null, userHandle, parent);
+        if (policy.mActivePasswordQuality < requiredPasswordQuality) {
+            return false;
+        }
+        if (requiredPasswordQuality >= DevicePolicyManager.PASSWORD_QUALITY_NUMERIC
+                && policy.mActivePasswordLength < getPasswordMinimumLength(
                         null, userHandle, parent)) {
             return false;
         }
-        if (policy.mActivePasswordQuality != DevicePolicyManager.PASSWORD_QUALITY_COMPLEX) {
+        if (requiredPasswordQuality != DevicePolicyManager.PASSWORD_QUALITY_COMPLEX) {
             return true;
         }
         return policy.mActivePasswordUpperCase >= getPasswordMinimumUpperCase(
@@ -7936,17 +7940,7 @@
         Preconditions.checkNotNull(who, "ComponentName is null");
         synchronized (this) {
             getActiveAdminForCallerLocked(who, DeviceAdminInfo.USES_POLICY_PROFILE_OWNER);
-            int userId = UserHandle.getCallingUserId();
-            long identity = mInjector.binderClearCallingIdentity();
-            try {
-                IAudioService iAudioService = IAudioService.Stub.asInterface(
-                        ServiceManager.getService(Context.AUDIO_SERVICE));
-                iAudioService.setMasterMute(on, 0, mContext.getPackageName(), userId);
-            } catch (RemoteException re) {
-                Slog.e(LOG_TAG, "Failed to setMasterMute", re);
-            } finally {
-                mInjector.binderRestoreCallingIdentity(identity);
-            }
+            setUserRestriction(who, UserManager.DISALLLOW_UNMUTE_DEVICE, on);
         }
     }
 
diff --git a/services/net/java/android/net/apf/ApfFilter.java b/services/net/java/android/net/apf/ApfFilter.java
index 0f812ac..4bb0902 100644
--- a/services/net/java/android/net/apf/ApfFilter.java
+++ b/services/net/java/android/net/apf/ApfFilter.java
@@ -192,6 +192,7 @@
 
     private static final int ICMP6_TYPE_OFFSET = ETH_HEADER_LEN + IPV6_HEADER_LEN;
     private static final int ICMP6_NEIGHBOR_ANNOUNCEMENT = 136;
+    private static final int ICMP6_ROUTER_ADVERTISEMENT = 134;
 
     // NOTE: this must be added to the IPv4 header length in IPV4_HEADER_SIZE_MEMORY_SLOT
     private static final int UDP_DESTINATION_PORT_OFFSET = ETH_HEADER_LEN + 2;
@@ -452,6 +453,16 @@
         Ra(byte[] packet, int length) {
             mPacket = ByteBuffer.wrap(Arrays.copyOf(packet, length));
             mLastSeen = curTime();
+
+            // Sanity check packet in case a packet arrives before we attach RA filter
+            // to our packet socket. b/29586253
+            if (getUint16(mPacket, ETH_ETHERTYPE_OFFSET) != ETH_P_IPV6 ||
+                    uint8(mPacket.get(IPV6_NEXT_HEADER_OFFSET)) != IPPROTO_ICMPV6 ||
+                    uint8(mPacket.get(ICMP6_TYPE_OFFSET)) != ICMP6_ROUTER_ADVERTISEMENT) {
+                throw new IllegalArgumentException("Not an ICMP6 router advertisement");
+            }
+
+
             RaEvent.Builder builder = new RaEvent.Builder();
 
             // Ignore the checksum.
diff --git a/services/tests/servicestests/assets/shortcut/shortcut_legacy_file.xml b/services/tests/servicestests/assets/shortcut/shortcut_legacy_file.xml
new file mode 100644
index 0000000..872dc3a
--- /dev/null
+++ b/services/tests/servicestests/assets/shortcut/shortcut_legacy_file.xml
@@ -0,0 +1,25 @@
+<?xml version='1.0' encoding='utf-8' standalone='yes' ?>
+<!-- Copyright (C) 2016 The Android Open Source Project
+
+     Licensed under the Apache License, Version 2.0 (the "License");
+     you may not use this file except in compliance with the License.
+     You may obtain a copy of the License at
+
+          http://www.apache.org/licenses/LICENSE-2.0
+
+     Unless required by applicable law or agreed to in writing, software
+     distributed under the License is distributed on an "AS IS" BASIS,
+     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     See the License for the specific language governing permissions and
+     limitations under the License.
+-->
+<user locales="en-US" last-app-scan-time="3113976673">
+    <package name="com.android.test.1" call-count="0" last-reset="1468976368772">
+        <package-info version="25" last_udpate_time="1230796800000" />
+        <shortcut id="manifest-shortcut-storage" activity="com.android.test.1/com.android.test.1.Settings" title="Storage" titleid="2131625197" titlename="storage_settings" textid="0" dmessageid="0" intent="#Intent;action=android.settings.INTERNAL_STORAGE_SETTINGS;end" timestamp="1469050672334" rank="4" flags="420" icon-res="2130837747" icon-resname="drawable/ic_shortcut_storage" >
+            <intent-extras>
+                <int name="key" value="12345" />
+            </intent-extras>
+        </shortcut>
+    </package>
+</user>
diff --git a/services/tests/servicestests/src/com/android/server/pm/BaseShortcutManagerTest.java b/services/tests/servicestests/src/com/android/server/pm/BaseShortcutManagerTest.java
index ff1c3b6..ecebbc4 100644
--- a/services/tests/servicestests/src/com/android/server/pm/BaseShortcutManagerTest.java
+++ b/services/tests/servicestests/src/com/android/server/pm/BaseShortcutManagerTest.java
@@ -614,6 +614,14 @@
     protected final Map<Integer, Boolean> mRunningUsers = new HashMap<>();
     protected final Map<Integer, Boolean> mUnlockedUsers = new HashMap<>();
 
+    protected static final String PACKAGE_SYSTEM_LAUNCHER = "com.android.systemlauncher";
+    protected static final String PACKAGE_SYSTEM_LAUNCHER_NAME = "systemlauncher_name";
+    protected static final int PACKAGE_SYSTEM_LAUNCHER_PRIORITY = 0;
+
+    protected static final String PACKAGE_FALLBACK_LAUNCHER = "com.android.settings";
+    protected static final String PACKAGE_FALLBACK_LAUNCHER_NAME = "fallback";
+    protected static final int PACKAGE_FALLBACK_LAUNCHER_PRIORITY = -999;
+
     static {
         QUERY_ALL.setQueryFlags(
                 ShortcutQuery.FLAG_GET_ALL_KINDS);
@@ -1866,4 +1874,40 @@
         }
         return sb.toString();
     }
+
+    protected void prepareGetHomeActivitiesAsUser(ComponentName preferred,
+            List<ResolveInfo> candidates, int userId) {
+        doAnswer(inv -> {
+            ((List) inv.getArguments()[0]).addAll(candidates);
+            return preferred;
+        }).when(mMockPackageManagerInternal).getHomeActivitiesAsUser(any(List.class), eq(userId));
+    }
+
+    protected static ComponentName cn(String packageName, String name) {
+        return new ComponentName(packageName, name);
+    }
+
+    protected static ResolveInfo ri(String packageName, String name, boolean isSystem, int priority) {
+        final ResolveInfo ri = new ResolveInfo();
+        ri.activityInfo = new ActivityInfo();
+        ri.activityInfo.applicationInfo = new ApplicationInfo();
+
+        ri.activityInfo.packageName = packageName;
+        ri.activityInfo.name = name;
+        if (isSystem) {
+            ri.activityInfo.applicationInfo.flags |= ApplicationInfo.FLAG_SYSTEM;
+        }
+        ri.priority = priority;
+        return ri;
+    }
+
+    protected static ResolveInfo getSystemLauncher() {
+        return ri(PACKAGE_SYSTEM_LAUNCHER, PACKAGE_SYSTEM_LAUNCHER_NAME, true,
+                PACKAGE_SYSTEM_LAUNCHER_PRIORITY);
+    }
+
+    protected static ResolveInfo getFallbackLauncher() {
+        return ri(PACKAGE_FALLBACK_LAUNCHER, PACKAGE_FALLBACK_LAUNCHER_NAME, true,
+                PACKAGE_FALLBACK_LAUNCHER_PRIORITY);
+    }
 }
diff --git a/services/tests/servicestests/src/com/android/server/pm/ShortcutManagerTest1.java b/services/tests/servicestests/src/com/android/server/pm/ShortcutManagerTest1.java
index 5206507..c0752e0 100644
--- a/services/tests/servicestests/src/com/android/server/pm/ShortcutManagerTest1.java
+++ b/services/tests/servicestests/src/com/android/server/pm/ShortcutManagerTest1.java
@@ -107,15 +107,6 @@
  -r -g ${ANDROID_PRODUCT_OUT}/data/app/FrameworksServicesTests/FrameworksServicesTests.apk &&
  adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest1 \
  -w com.android.frameworks.servicestests/android.support.test.runner.AndroidJUnitRunner
-
-
- * TODO More tests for pinning + manifest shortcuts
- * TODO Manifest shortcuts + app upgrade -> launcher callback.
- *      Also locale change should trigger launcehr callbacks too, when they use strign resoucres.
- *      (not implemented yet.)
- * TODO: Add checks with assertAllNotHaveIcon()
- * TODO: Detailed test for hasShortcutPermissionInner().
- * TODO: Add tests for the command line functions too.
  */
 @SmallTest
 public class ShortcutManagerTest1 extends BaseShortcutManagerTest {
@@ -2622,10 +2613,12 @@
                     "s1",
                     "Title 1",
                     makeComponent(ShortcutActivity.class),
-            /* icon =*/ null,
-                    makeIntent(Intent.ACTION_ASSIST, ShortcutActivity2.class,
-                            "key1", "val1", "nest", makeBundle("key", 123)),
-            /* rank */ 10);
+                    /* icon =*/ null,
+                    new Intent[] {makeIntent(Intent.ACTION_ASSIST, ShortcutActivity2.class,
+                            "key1", "val1", "nest", makeBundle("key", 123))
+                            .setFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK),
+                    new Intent("act2").setFlags(Intent.FLAG_ACTIVITY_NO_ANIMATION)},
+                    /* rank */ 10);
 
             final ShortcutInfo s1_2 = makeShortcut(
                     "s2",
@@ -2667,10 +2660,19 @@
         });
 
         runWithCaller(LAUNCHER_1, USER_0, () -> {
-            assertEquals(
-                    ShortcutActivity2.class.getName(),
-                    launchShortcutAndGetIntent(CALLING_PACKAGE_1, "s1", USER_0)
-                            .getComponent().getClassName());
+            final Intent[] intents = launchShortcutAndGetIntents(CALLING_PACKAGE_1, "s1", USER_0);
+            assertEquals(ShortcutActivity2.class.getName(),
+                    intents[0].getComponent().getClassName());
+            assertEquals(Intent.ACTION_ASSIST,
+                    intents[0].getAction());
+            assertEquals(Intent.FLAG_ACTIVITY_CLEAR_TASK | Intent.FLAG_ACTIVITY_NEW_TASK,
+                    intents[0].getFlags());
+
+            assertEquals("act2",
+                    intents[1].getAction());
+            assertEquals(Intent.FLAG_ACTIVITY_NO_ANIMATION,
+                    intents[1].getFlags());
+
             assertEquals(
                     ShortcutActivity3.class.getName(),
                     launchShortcutAndGetIntent(CALLING_PACKAGE_1, "s2", USER_0)
@@ -2691,10 +2693,18 @@
 
         runWithCaller(LAUNCHER_1, USER_0, () -> {
             // Not the default launcher, but pinned shortcuts are still lauchable.
-            assertEquals(
-                    ShortcutActivity2.class.getName(),
-                    launchShortcutAndGetIntent(CALLING_PACKAGE_1, "s1", USER_0)
-                            .getComponent().getClassName());
+            final Intent[] intents = launchShortcutAndGetIntents(CALLING_PACKAGE_1, "s1", USER_0);
+            assertEquals(ShortcutActivity2.class.getName(),
+                    intents[0].getComponent().getClassName());
+            assertEquals(Intent.ACTION_ASSIST,
+                    intents[0].getAction());
+            assertEquals(Intent.FLAG_ACTIVITY_CLEAR_TASK | Intent.FLAG_ACTIVITY_NEW_TASK,
+                    intents[0].getFlags());
+
+            assertEquals("act2",
+                    intents[1].getAction());
+            assertEquals(Intent.FLAG_ACTIVITY_NO_ANIMATION,
+                    intents[1].getFlags());
             assertEquals(
                     ShortcutActivity3.class.getName(),
                     launchShortcutAndGetIntent(CALLING_PACKAGE_1, "s2", USER_0)
@@ -4068,7 +4078,7 @@
         });
 
         // Clear data
-                mService.mPackageMonitor.onReceive(getTestContext(),
+        mService.mPackageMonitor.onReceive(getTestContext(),
                 genPackageDataClear(CALLING_PACKAGE_1, USER_10));
 
         // Only manifest shortcuts will remain, and are no longer pinned.
diff --git a/services/tests/servicestests/src/com/android/server/pm/ShortcutManagerTest2.java b/services/tests/servicestests/src/com/android/server/pm/ShortcutManagerTest2.java
index f97355a..54b2a15 100644
--- a/services/tests/servicestests/src/com/android/server/pm/ShortcutManagerTest2.java
+++ b/services/tests/servicestests/src/com/android/server/pm/ShortcutManagerTest2.java
@@ -48,9 +48,11 @@
 import com.android.server.pm.ShortcutService.ConfigConstants;
 
 import java.io.File;
+import java.io.FileWriter;
 import java.io.IOException;
 import java.io.PrintWriter;
 import java.io.StringWriter;
+import java.io.Writer;
 import java.util.Locale;
 
 /**
@@ -100,6 +102,12 @@
 
         assertExpectException(
                 RuntimeException.class,
+                "action must be set",
+                () -> new ShortcutInfo.Builder(getTestContext(), "id")
+                        .setIntents(new Intent[]{new Intent("action"), new Intent()}));
+
+        assertExpectException(
+                RuntimeException.class,
                 "activity cannot be null",
                 () -> new ShortcutInfo.Builder(getTestContext(), "id").setActivity(null));
 
@@ -1967,4 +1975,28 @@
             mService.dump(null, new PrintWriter(new StringWriter()), null);
         });
     }
+
+    /**
+     * Make sure the legacy file format that only supported a single intent per shortcut
+     * can still be read.
+     */
+    public void testLoadLegacySavedFile() throws Exception {
+        final File path = mService.getUserFile(USER_0);
+        path.getParentFile().mkdirs();
+        try (Writer w = new FileWriter(path)) {
+            w.write(readTestAsset("shortcut/shortcut_legacy_file.xml"));
+        };
+        initService();
+        mService.handleUnlockUser(USER_0);
+
+        runWithCaller(CALLING_PACKAGE_1, USER_0, () -> {
+            assertWith(getCallerShortcuts())
+                    .haveIds("manifest-shortcut-storage")
+                    .forShortcutWithId("manifest-shortcut-storage", si -> {
+                        assertEquals("android.settings.INTERNAL_STORAGE_SETTINGS",
+                                si.getIntent().getAction());
+                        assertEquals(12345, si.getIntent().getIntExtra("key", 0));
+                    });
+        });
+    }
 }
diff --git a/services/tests/servicestests/src/com/android/server/pm/ShortcutManagerTest6.java b/services/tests/servicestests/src/com/android/server/pm/ShortcutManagerTest6.java
index ffb2953..5f24637 100644
--- a/services/tests/servicestests/src/com/android/server/pm/ShortcutManagerTest6.java
+++ b/services/tests/servicestests/src/com/android/server/pm/ShortcutManagerTest6.java
@@ -18,7 +18,6 @@
 import static com.android.server.pm.shortcutmanagertest.ShortcutManagerTestUtils.list;
 
 import static org.mockito.Matchers.any;
-import static org.mockito.Matchers.anyInt;
 import static org.mockito.Matchers.eq;
 import static org.mockito.Mockito.doAnswer;
 
@@ -36,51 +35,6 @@
  */
 @SmallTest
 public class ShortcutManagerTest6 extends BaseShortcutManagerTest {
-
-    private static final String PACKAGE_SYSTEM_LAUNCHER = "com.android.systemlauncher";
-    private static final String PACKAGE_SYSTEM_LAUNCHER_NAME = "systemlauncher_name";
-    private static final int PACKAGE_SYSTEM_LAUNCHER_PRIORITY = 0;
-
-    private static final String PACKAGE_FALLBACK_LAUNCHER = "com.android.settings";
-    private static final String PACKAGE_FALLBACK_LAUNCHER_NAME = "fallback";
-    private static final int PACKAGE_FALLBACK_LAUNCHER_PRIORITY = -999;
-
-    private void prepareGetHomeActivitiesAsUser(ComponentName preferred,
-            List<ResolveInfo> candidates, int userId) {
-        doAnswer(inv -> {
-            ((List) inv.getArguments()[0]).addAll(candidates);
-            return preferred;
-        }).when(mMockPackageManagerInternal).getHomeActivitiesAsUser(any(List.class), eq(userId));
-    }
-
-    private static ComponentName cn(String packageName, String name) {
-        return new ComponentName(packageName, name);
-    }
-
-    private static ResolveInfo ri(String packageName, String name, boolean isSystem, int priority) {
-        final ResolveInfo ri = new ResolveInfo();
-        ri.activityInfo = new ActivityInfo();
-        ri.activityInfo.applicationInfo = new ApplicationInfo();
-
-        ri.activityInfo.packageName = packageName;
-        ri.activityInfo.name = name;
-        if (isSystem) {
-            ri.activityInfo.applicationInfo.flags |= ApplicationInfo.FLAG_SYSTEM;
-        }
-        ri.priority = priority;
-        return ri;
-    }
-
-    private static ResolveInfo getSystemLauncher() {
-        return ri(PACKAGE_SYSTEM_LAUNCHER, PACKAGE_SYSTEM_LAUNCHER_NAME, true,
-                PACKAGE_SYSTEM_LAUNCHER_PRIORITY);
-    }
-
-    private static ResolveInfo getFallbackLauncher() {
-        return ri(PACKAGE_FALLBACK_LAUNCHER, PACKAGE_FALLBACK_LAUNCHER_NAME, true,
-                PACKAGE_FALLBACK_LAUNCHER_PRIORITY);
-    }
-
     public void testHasShortcutHostPermissionInner_systemLauncherOnly() {
         // Preferred isn't set, use the system launcher.
         prepareGetHomeActivitiesAsUser(
diff --git a/services/tests/servicestests/src/com/android/server/pm/ShortcutManagerTest7.java b/services/tests/servicestests/src/com/android/server/pm/ShortcutManagerTest7.java
new file mode 100644
index 0000000..f9ff514
--- /dev/null
+++ b/services/tests/servicestests/src/com/android/server/pm/ShortcutManagerTest7.java
@@ -0,0 +1,335 @@
+/*
+ * Copyright (C) 2016 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.android.server.pm;
+
+import static com.android.server.pm.shortcutmanagertest.ShortcutManagerTestUtils.assertContains;
+import static com.android.server.pm.shortcutmanagertest.ShortcutManagerTestUtils.assertExpectException;
+import static com.android.server.pm.shortcutmanagertest.ShortcutManagerTestUtils.assertSuccess;
+import static com.android.server.pm.shortcutmanagertest.ShortcutManagerTestUtils.assertWith;
+import static com.android.server.pm.shortcutmanagertest.ShortcutManagerTestUtils.list;
+import static com.android.server.pm.shortcutmanagertest.ShortcutManagerTestUtils.readAll;
+import static com.android.server.pm.shortcutmanagertest.ShortcutManagerTestUtils.resultContains;
+
+import android.content.ComponentName;
+import android.os.Bundle;
+import android.os.ParcelFileDescriptor;
+import android.os.Process;
+import android.os.RemoteException;
+import android.os.ResultReceiver;
+import android.test.suitebuilder.annotation.SmallTest;
+
+import com.android.frameworks.servicestests.R;
+import com.android.server.pm.ShortcutService.ConfigConstants;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.List;
+import java.util.concurrent.atomic.AtomicInteger;
+
+/**
+ * Unit test for "cmd shortcut"
+ *
+ * Launcher related commands are tested in
+ */
+@SmallTest
+public class ShortcutManagerTest7 extends BaseShortcutManagerTest {
+    private List<String> callShellCommand(String... args) throws IOException, RemoteException {
+
+        // For reset to work, the current time needs to be incrementing.
+        mInjectedCurrentTimeMillis++;
+
+        final AtomicInteger resultCode = new AtomicInteger(Integer.MIN_VALUE);
+
+        final ResultReceiver rr = new ResultReceiver(mHandler) {
+            @Override
+            public void send(int resultCode_, Bundle resultData) {
+                resultCode.set(resultCode_);
+            }
+        };
+        final File out = File.createTempFile("shellout-", ".tmp",
+                getTestContext().getCacheDir());
+        try {
+            try (final ParcelFileDescriptor fd = ParcelFileDescriptor.open(out,
+                    ParcelFileDescriptor.MODE_READ_WRITE)) {
+                mService.onShellCommand(
+                    /* fdin*/ null,
+                    /* fdout*/ fd.getFileDescriptor(),
+                    /* fderr*/ fd.getFileDescriptor(),
+                        args, rr);
+            }
+            return readAll(out);
+        } finally {
+            out.delete();
+        }
+    }
+
+    public void testNonShell() throws Exception {
+        mService.mMaxUpdatesPerInterval = 99;
+
+        mInjectedCallingUid = 12345;
+        assertExpectException(SecurityException.class, "must be shell",
+                () -> callShellCommand("reset-config"));
+
+        mInjectedCallingUid = Process.SYSTEM_UID;
+        assertExpectException(SecurityException.class, "must be shell",
+                () -> callShellCommand("reset-config"));
+
+        assertEquals(99, mService.mMaxUpdatesPerInterval);
+    }
+
+    public void testRoot() throws Exception {
+        mService.mMaxUpdatesPerInterval = 99;
+
+        mInjectedCallingUid = Process.ROOT_UID;
+        assertSuccess(callShellCommand("reset-config"));
+
+        assertEquals(3, mService.mMaxUpdatesPerInterval);
+    }
+
+    public void testRestConfig() throws Exception {
+        mService.mMaxUpdatesPerInterval = 99;
+
+        mInjectedCallingUid = Process.SHELL_UID;
+        assertSuccess(callShellCommand("reset-config"));
+
+        assertEquals(3, mService.mMaxUpdatesPerInterval);
+    }
+
+    public void testOverrideConfig() throws Exception {
+        mService.mMaxUpdatesPerInterval = 99;
+
+        mInjectedCallingUid = Process.SHELL_UID;
+        assertSuccess(callShellCommand("override-config",
+                ConfigConstants.KEY_MAX_UPDATES_PER_INTERVAL + "=1"));
+
+        assertEquals(1, mService.mMaxUpdatesPerInterval);
+    }
+
+    public void testResetThrottling() throws Exception {
+        prepareCrossProfileDataSet();
+
+        runWithCaller(CALLING_PACKAGE_1, USER_0, () -> {
+            assertTrue(mManager.getRemainingCallCount() < 3);
+        });
+        runWithCaller(CALLING_PACKAGE_1, USER_10, () -> {
+            assertTrue(mManager.getRemainingCallCount() < 3);
+        });
+
+        mInjectedCallingUid = Process.SHELL_UID;
+        assertSuccess(callShellCommand("reset-throttling"));
+
+        runWithCaller(CALLING_PACKAGE_1, USER_0, () -> {
+            assertEquals(3, mManager.getRemainingCallCount());
+        });
+        runWithCaller(CALLING_PACKAGE_1, USER_10, () -> {
+            assertTrue(mManager.getRemainingCallCount() < 3);
+        });
+    }
+
+    public void testResetThrottling_user_not_running() throws Exception {
+        prepareCrossProfileDataSet();
+
+        runWithCaller(CALLING_PACKAGE_1, USER_0, () -> {
+            assertTrue(mManager.getRemainingCallCount() < 3);
+        });
+        runWithCaller(CALLING_PACKAGE_1, USER_10, () -> {
+            assertTrue(mManager.getRemainingCallCount() < 3);
+        });
+
+        mInjectedCallingUid = Process.SHELL_UID;
+
+        assertTrue(resultContains(
+                callShellCommand("reset-throttling", "--user", "10"),
+                "User 10 is not running or locked"));
+
+        runWithCaller(CALLING_PACKAGE_1, USER_0, () -> {
+            assertTrue(mManager.getRemainingCallCount() < 3);
+        });
+        runWithCaller(CALLING_PACKAGE_1, USER_10, () -> {
+            assertTrue(mManager.getRemainingCallCount() < 3);
+        });
+    }
+
+    public void testResetThrottling_user_running() throws Exception {
+        prepareCrossProfileDataSet();
+
+        runWithCaller(CALLING_PACKAGE_1, USER_0, () -> {
+            assertTrue(mManager.getRemainingCallCount() < 3);
+        });
+        runWithCaller(CALLING_PACKAGE_1, USER_10, () -> {
+            assertTrue(mManager.getRemainingCallCount() < 3);
+        });
+
+        mRunningUsers.put(USER_10, true);
+        mUnlockedUsers.put(USER_10, true);
+
+        mInjectedCallingUid = Process.SHELL_UID;
+        assertSuccess(callShellCommand("reset-throttling", "--user", "10"));
+
+        runWithCaller(CALLING_PACKAGE_1, USER_0, () -> {
+            assertTrue(mManager.getRemainingCallCount() < 3);
+        });
+        runWithCaller(CALLING_PACKAGE_1, USER_10, () -> {
+            assertEquals(3, mManager.getRemainingCallCount());
+        });
+    }
+
+    public void testResetAllThrottling() throws Exception {
+        prepareCrossProfileDataSet();
+
+        runWithCaller(CALLING_PACKAGE_1, USER_0, () -> {
+            assertTrue(mManager.getRemainingCallCount() < 3);
+        });
+        runWithCaller(CALLING_PACKAGE_1, USER_10, () -> {
+            assertTrue(mManager.getRemainingCallCount() < 3);
+        });
+
+        mInjectedCallingUid = Process.SHELL_UID;
+        assertSuccess(callShellCommand("reset-all-throttling"));
+
+        runWithCaller(CALLING_PACKAGE_1, USER_0, () -> {
+            assertEquals(3, mManager.getRemainingCallCount());
+        });
+        runWithCaller(CALLING_PACKAGE_1, USER_10, () -> {
+            assertEquals(3, mManager.getRemainingCallCount());
+        });
+    }
+
+    public void testLauncherCommands() throws Exception {
+        prepareGetHomeActivitiesAsUser(
+                /* preferred */ null,
+                list(getSystemLauncher(), getFallbackLauncher()),
+                USER_0);
+
+        prepareGetHomeActivitiesAsUser(
+                /* preferred */ cn(CALLING_PACKAGE_2, "name"),
+                list(getSystemLauncher(), getFallbackLauncher(),
+                        ri(CALLING_PACKAGE_1, "name", false, 0),
+                        ri(CALLING_PACKAGE_2, "name", false, 0)
+                ),
+                USER_10);
+
+        assertTrue(mService.hasShortcutHostPermissionInner(PACKAGE_SYSTEM_LAUNCHER, USER_0));
+
+        // First, test "get".
+
+        mRunningUsers.put(USER_10, true);
+        mUnlockedUsers.put(USER_10, true);
+        mInjectedCallingUid = Process.SHELL_UID;
+        assertContains(
+                assertSuccess(callShellCommand("get-default-launcher")),
+                "Launcher: ComponentInfo{com.android.systemlauncher/systemlauncher_name}");
+
+        assertContains(
+                assertSuccess(callShellCommand("get-default-launcher", "--user", "10")),
+                "Launcher: ComponentInfo{com.android.test.2/name}");
+
+        // Next, test "clear".
+        assertSuccess(callShellCommand("clear-default-launcher", "--user", "10"));
+
+        // User-10's launcher should be cleared.
+        assertEquals(null, mService.getUserShortcutsLocked(USER_10).getLastKnownLauncher());
+        assertEquals(null, mService.getUserShortcutsLocked(USER_10).getCachedLauncher());
+
+        // but user'0's shouldn't.
+        assertEquals(cn(PACKAGE_SYSTEM_LAUNCHER, PACKAGE_SYSTEM_LAUNCHER_NAME),
+                mService.getUserShortcutsLocked(USER_0).getCachedLauncher());
+
+        // Change user-0's launcher.
+        prepareGetHomeActivitiesAsUser(
+                /* preferred */ cn(CALLING_PACKAGE_1, "name"),
+                list(
+                        ri(CALLING_PACKAGE_1, "name", false, 0)
+                ),
+                USER_0);
+        assertContains(
+                assertSuccess(callShellCommand("get-default-launcher")),
+                "Launcher: ComponentInfo{com.android.test.1/name}");
+    }
+
+    public void testUnloadUser() throws Exception {
+        prepareCrossProfileDataSet();
+
+        assertNotNull(mService.getShortcutsForTest().get(USER_10));
+
+        mRunningUsers.put(USER_10, true);
+        mUnlockedUsers.put(USER_10, true);
+
+        mInjectedCallingUid = Process.SHELL_UID;
+        assertSuccess(callShellCommand("unload-user", "--user", "10"));
+
+        assertNull(mService.getShortcutsForTest().get(USER_10));
+    }
+
+    public void testClearShortcuts() throws Exception {
+
+        mRunningUsers.put(USER_10, true);
+
+        // Add two manifests and two dynamics.
+        addManifestShortcutResource(
+                new ComponentName(CALLING_PACKAGE_1, ShortcutActivity.class.getName()),
+                R.xml.shortcut_2);
+        updatePackageVersion(CALLING_PACKAGE_1, 1);
+        mService.mPackageMonitor.onReceive(getTestContext(),
+                genPackageAddIntent(CALLING_PACKAGE_1, USER_10));
+
+        runWithCaller(CALLING_PACKAGE_1, USER_10, () -> {
+            assertTrue(mManager.addDynamicShortcuts(list(
+                    makeShortcut("s1"), makeShortcut("s2"))));
+        });
+        runWithCaller(LAUNCHER_1, USER_10, () -> {
+            mLauncherApps.pinShortcuts(CALLING_PACKAGE_1, list("ms2", "s2"), HANDLE_USER_10);
+        });
+
+        runWithCaller(CALLING_PACKAGE_1, USER_10, () -> {
+            assertWith(getCallerShortcuts())
+                    .haveIds("ms1", "ms2", "s1", "s2")
+                    .areAllEnabled()
+
+                    .selectPinned()
+                    .haveIds("ms2", "s2");
+        });
+
+        // First, call for a different package.
+
+        mRunningUsers.put(USER_10, true);
+        mUnlockedUsers.put(USER_10, true);
+
+        mInjectedCallingUid = Process.SHELL_UID;
+        assertSuccess(callShellCommand("clear-shortcuts", "--user", "10", CALLING_PACKAGE_2));
+
+        // Shouldn't be cleared yet.
+        runWithCaller(CALLING_PACKAGE_1, USER_10, () -> {
+            assertWith(getCallerShortcuts())
+                    .haveIds("ms1", "ms2", "s1", "s2")
+                    .areAllEnabled()
+
+                    .selectPinned()
+                    .haveIds("ms2", "s2");
+        });
+
+        mInjectedCallingUid = Process.SHELL_UID;
+        assertSuccess(callShellCommand("clear-shortcuts", "--user", "10", CALLING_PACKAGE_1));
+
+        // Only manifest shortcuts will remain, and are no longer pinned.
+        runWithCaller(CALLING_PACKAGE_1, USER_10, () -> {
+            assertWith(getCallerShortcuts())
+                    .haveIds("ms1", "ms2")
+                    .areAllEnabled()
+                    .areAllNotPinned();
+        });
+    }
+}
diff --git a/services/tests/servicestests/src/com/android/server/pm/UserRestrictionsUtilsTest.java b/services/tests/servicestests/src/com/android/server/pm/UserRestrictionsUtilsTest.java
index e2dce853..11f9ebb 100644
--- a/services/tests/servicestests/src/com/android/server/pm/UserRestrictionsUtilsTest.java
+++ b/services/tests/servicestests/src/com/android/server/pm/UserRestrictionsUtilsTest.java
@@ -16,15 +16,14 @@
 
 package com.android.server.pm;
 
-import android.os.UserHandle;
-import com.android.server.devicepolicy.DpmTestUtils;
-
 import android.os.Bundle;
+import android.os.UserHandle;
 import android.os.UserManager;
 import android.test.AndroidTestCase;
-import android.test.MoreAsserts;
 import android.test.suitebuilder.annotation.SmallTest;
 
+import com.android.server.devicepolicy.DpmTestUtils;
+
 /**
  * Tests for {@link com.android.server.pm.UserRestrictionsUtils}.
  *
diff --git a/services/tests/shortcutmanagerutils/src/com/android/server/pm/shortcutmanagertest/ShortcutManagerTestUtils.java b/services/tests/shortcutmanagerutils/src/com/android/server/pm/shortcutmanagertest/ShortcutManagerTestUtils.java
index ce7adfa..5d29363 100644
--- a/services/tests/shortcutmanagerutils/src/com/android/server/pm/shortcutmanagertest/ShortcutManagerTestUtils.java
+++ b/services/tests/shortcutmanagerutils/src/com/android/server/pm/shortcutmanagertest/ShortcutManagerTestUtils.java
@@ -59,6 +59,8 @@
 import org.mockito.Mockito;
 
 import java.io.BufferedReader;
+import java.io.File;
+import java.io.FileNotFoundException;
 import java.io.FileReader;
 import java.io.IOException;
 import java.util.ArrayList;
@@ -93,7 +95,12 @@
     private ShortcutManagerTestUtils() {
     }
 
-    private static List<String> readAll(ParcelFileDescriptor pfd) {
+    public static List<String> readAll(File file) throws FileNotFoundException {
+        return readAll(ParcelFileDescriptor.open(
+                file.getAbsoluteFile(), ParcelFileDescriptor.MODE_READ_ONLY));
+    }
+
+    public static List<String> readAll(ParcelFileDescriptor pfd) {
         try {
             try {
                 final ArrayList<String> ret = new ArrayList<>();
@@ -114,7 +121,7 @@
         }
     }
 
-    private static String concatResult(List<String> result) {
+    public static String concatResult(List<String> result) {
         final StringBuilder sb = new StringBuilder();
         for (String s : result) {
             sb.append(s);
@@ -123,6 +130,30 @@
         return sb.toString();
     }
 
+    public static boolean resultContains(List<String> result, String expected) {
+        for (String line : result) {
+            if (line.contains(expected)) {
+                return true;
+            }
+        }
+        return false;
+    }
+
+    public static List<String> assertSuccess(List<String> result) {
+        if (!resultContains(result, "Success")) {
+            fail("Command failed.  Result was:\n" + concatResult(result));
+        }
+        return result;
+    }
+
+    public static List<String> assertContains(List<String> result, String expected) {
+        if (!resultContains(result, expected)) {
+            fail("Didn't contain expected string=" + expected
+                    + "\nActual:\n" + concatResult(result));
+        }
+        return result;
+    }
+
     private static List<String> runCommand(Instrumentation instrumentation, String command) {
         return runCommand(instrumentation, command, null);
     }
@@ -321,24 +352,29 @@
         return filter(list, si -> si.getLastChangedTimestamp() >= time);
     }
 
+    @FunctionalInterface
+    public interface ExceptionRunnable {
+        void run() throws Exception;
+    }
+
     public static void assertExpectException(Class<? extends Throwable> expectedExceptionType,
-            String expectedExceptionMessageRegex, Runnable r) {
+            String expectedExceptionMessageRegex, ExceptionRunnable r) {
         assertExpectException("", expectedExceptionType, expectedExceptionMessageRegex, r);
     }
 
     public static void assertCannotUpdateImmutable(Runnable r) {
         assertExpectException(
-                IllegalArgumentException.class, "may not be manipulated via APIs", r);
+                IllegalArgumentException.class, "may not be manipulated via APIs", r::run);
     }
 
     public static void assertDynamicShortcutCountExceeded(Runnable r) {
         assertExpectException(IllegalArgumentException.class,
-                "Max number of dynamic shortcuts exceeded", r);
+                "Max number of dynamic shortcuts exceeded", r::run);
     }
 
     public static void assertExpectException(String message,
             Class<? extends Throwable> expectedExceptionType,
-            String expectedExceptionMessageRegex, Runnable r) {
+            String expectedExceptionMessageRegex, ExceptionRunnable r) {
         try {
             r.run();
         } catch (Throwable e) {
diff --git a/services/usb/java/com/android/server/usb/UsbDeviceManager.java b/services/usb/java/com/android/server/usb/UsbDeviceManager.java
index df9242d..1d19637 100644
--- a/services/usb/java/com/android/server/usb/UsbDeviceManager.java
+++ b/services/usb/java/com/android/server/usb/UsbDeviceManager.java
@@ -49,6 +49,7 @@
 import android.util.Slog;
 
 import com.android.internal.annotations.GuardedBy;
+import com.android.internal.os.SomeArgs;
 import com.android.internal.util.IndentingPrintWriter;
 import com.android.server.FgThread;
 
@@ -320,6 +321,7 @@
         private boolean mConnected;
         private boolean mHostConnected;
         private boolean mSourcePower;
+        private boolean mSinkPower;
         private boolean mConfigured;
         private boolean mUsbDataUnlocked;
         private String mCurrentFunctions;
@@ -401,7 +403,19 @@
         public void updateHostState(UsbPort port, UsbPortStatus status) {
             boolean hostConnected = status.getCurrentDataRole() == UsbPort.DATA_ROLE_HOST;
             boolean sourcePower = status.getCurrentPowerRole() == UsbPort.POWER_ROLE_SOURCE;
-            obtainMessage(MSG_UPDATE_HOST_STATE, hostConnected ? 1 :0, sourcePower ? 1 :0).sendToTarget();
+            boolean sinkPower = status.getCurrentPowerRole() == UsbPort.POWER_ROLE_SINK;
+
+            if (DEBUG) {
+                Slog.i(TAG, "updateHostState " + port + ": dataRole=" + status.getCurrentDataRole() +
+                        ", powerRole=" + status.getCurrentPowerRole());
+            }
+
+            SomeArgs args = SomeArgs.obtain();
+            args.argi1 = hostConnected ? 1 :0;
+            args.argi2 = sourcePower ? 1 :0;
+            args.argi3 = sinkPower ? 1 :0;
+
+            obtainMessage(MSG_UPDATE_HOST_STATE, args).sendToTarget();
         }
 
         private boolean waitForState(String state) {
@@ -718,8 +732,11 @@
                     }
                     break;
                 case MSG_UPDATE_HOST_STATE:
-                    mHostConnected = (msg.arg1 == 1);
-                    mSourcePower = (msg.arg2 == 1);
+                    SomeArgs args = (SomeArgs) msg.obj;
+                    mHostConnected = (args.argi1 == 1);
+                    mSourcePower = (args.argi2 == 1);
+                    mSinkPower = (args.argi3 == 1);
+                    args.recycle();
                     updateUsbNotification();
                     if (mBootCompleted) {
                         updateUsbStateBroadcastIfNeeded();
@@ -809,6 +826,8 @@
                 }
             } else if (mSourcePower) {
                 id = com.android.internal.R.string.usb_supplying_notification_title;
+            } else if (mSinkPower) {
+                id = com.android.internal.R.string.usb_charging_notification_title;
             }
             if (id != mUsbNotificationId) {
                 // clear notification if title needs changing
diff --git a/telephony/java/android/telephony/CarrierConfigManager.java b/telephony/java/android/telephony/CarrierConfigManager.java
index d399b55..3d85ec5 100644
--- a/telephony/java/android/telephony/CarrierConfigManager.java
+++ b/telephony/java/android/telephony/CarrierConfigManager.java
@@ -852,6 +852,12 @@
             "allow_merge_wifi_calls_when_vowifi_off_bool";
 
     /**
+     * Flag indicating whether the carrier supports the Hold command while in an IMS call.
+     * @hide
+     */
+    public static final String KEY_ALLOW_HOLD_IN_IMS_CALL_BOOL = "allow_hold_in_ims_call";
+
+    /**
      * When true, indicates that adding a call is disabled when there is an ongoing video call
      * or when there is an ongoing call on wifi which was downgraded from video and VoWifi is
      * turned off.
@@ -897,6 +903,7 @@
 
     static {
         sDefaults = new PersistableBundle();
+        sDefaults.putBoolean(KEY_ALLOW_HOLD_IN_IMS_CALL_BOOL, true);
         sDefaults.putBoolean(KEY_ADDITIONAL_CALL_SETTING_BOOL, true);
         sDefaults.putBoolean(KEY_ALLOW_EMERGENCY_NUMBERS_IN_CALL_LOG_BOOL, false);
         sDefaults.putBoolean(KEY_ALLOW_LOCAL_DTMF_TONES_BOOL, true);
diff --git a/telephony/java/android/telephony/Rlog.java b/telephony/java/android/telephony/Rlog.java
index 2a7f7af..b4f400f 100644
--- a/telephony/java/android/telephony/Rlog.java
+++ b/telephony/java/android/telephony/Rlog.java
@@ -85,5 +85,13 @@
         return Log.isLoggable(tag, level);
     }
 
+    /**
+     * Redact personally identifiable information for production users.
+     * If log tag is loggable in verbose mode, return the original string, otherwise return XXX.
+     */
+    public static String pii(String tag, Object pii) {
+        return (isLoggable(tag, Log.VERBOSE) ? String.valueOf(pii) : "XXX");
+    }
+
 }
 
diff --git a/test-runner/src/android/test/mock/MockContext.java b/test-runner/src/android/test/mock/MockContext.java
index 9471326..fdd971b 100644
--- a/test-runner/src/android/test/mock/MockContext.java
+++ b/test-runner/src/android/test/mock/MockContext.java
@@ -404,6 +404,14 @@
     }
 
     /** @hide */
+    @SystemApi
+    @Override
+    public void sendBroadcastAsUser(Intent intent, UserHandle user,
+            String receiverPermission, Bundle options) {
+        throw new UnsupportedOperationException();
+    }
+
+    /** @hide */
     @Override
     public void sendBroadcastAsUser(Intent intent, UserHandle user,
             String receiverPermission, int appOp) {
diff --git a/tools/aapt/Resource.cpp b/tools/aapt/Resource.cpp
index a7878d1..b278831 100644
--- a/tools/aapt/Resource.cpp
+++ b/tools/aapt/Resource.cpp
@@ -2929,6 +2929,19 @@
         if (!keepTag && inApplication && depth == 3) {
             if (tag == "activity" || tag == "service" || tag == "receiver" || tag == "provider") {
                 keepTag = true;
+
+                if (mainDex) {
+                    String8 componentProcess = AaptXml::getAttribute(tree,
+                            "http://schemas.android.com/apk/res/android", "process", &error);
+                    if (error != "") {
+                        fprintf(stderr, "ERROR: %s\n", error.string());
+                        return -1;
+                    }
+
+                    const String8& process =
+                            componentProcess.length() > 0 ? componentProcess : defaultProcess;
+                    keepTag = process.length() > 0 && process.find(":") != 0;
+                }
             }
         }
         if (keepTag) {
@@ -2941,19 +2954,6 @@
 
             keepTag = name.length() > 0;
 
-            if (keepTag && mainDex) {
-                String8 componentProcess = AaptXml::getAttribute(tree,
-                        "http://schemas.android.com/apk/res/android", "process", &error);
-                if (error != "") {
-                    fprintf(stderr, "ERROR: %s\n", error.string());
-                    return -1;
-                }
-
-                const String8& process =
-                        componentProcess.length() > 0 ? componentProcess : defaultProcess;
-                keepTag = process.length() > 0 && process.find(":") != 0;
-            }
-
             if (keepTag) {
                 addProguardKeepRule(keep, name, pkg.string(),
                         assFile->getPrintableSource(), tree.getLineNumber());
diff --git a/tools/aapt2/flatten/TableFlattener.cpp b/tools/aapt2/flatten/TableFlattener.cpp
index 5fbb0fe..6a35e8c 100644
--- a/tools/aapt2/flatten/TableFlattener.cpp
+++ b/tools/aapt2/flatten/TableFlattener.cpp
@@ -244,7 +244,7 @@
         StringPool::flattenUtf16(pkgWriter.getBuffer(), mTypePool);
 
         pkgHeader->keyStrings = util::hostToDevice32(pkgWriter.size());
-        StringPool::flattenUtf16(pkgWriter.getBuffer(), mKeyPool);
+        StringPool::flattenUtf8(pkgWriter.getBuffer(), mKeyPool);
 
         // Append the types.
         buffer->appendBuffer(std::move(typeBuffer));
diff --git a/tools/aapt2/flatten/XmlFlattener.cpp b/tools/aapt2/flatten/XmlFlattener.cpp
index a743177..3c1750c 100644
--- a/tools/aapt2/flatten/XmlFlattener.cpp
+++ b/tools/aapt2/flatten/XmlFlattener.cpp
@@ -289,7 +289,7 @@
     xmlHeaderWriter.startChunk<ResXMLTree_header>(RES_XML_TYPE);
 
     // Flatten the StringPool.
-    StringPool::flattenUtf16(mBuffer, visitor.mPool);
+    StringPool::flattenUtf8(mBuffer, visitor.mPool);
 
     {
         // Write the array of resource IDs, indexed by StringPool order.
diff --git a/tools/aapt2/java/ProguardRules.cpp b/tools/aapt2/java/ProguardRules.cpp
index 9061660..902ec4c 100644
--- a/tools/aapt2/java/ProguardRules.cpp
+++ b/tools/aapt2/java/ProguardRules.cpp
@@ -170,16 +170,10 @@
                     }
                 }
             } else if (node->name == "activity" || node->name == "service" ||
-                    node->name == "receiver" || node->name == "provider" ||
-                    node->name == "instrumentation") {
+                    node->name == "receiver" || node->name == "provider") {
                 getName = true;
-            }
 
-            if (getName) {
-                xml::Attribute* attr = node->findAttribute(xml::kSchemaAndroid, "name");
-                getName = attr != nullptr;
-
-                if (getName && mMainDexOnly) {
+                if (mMainDexOnly) {
                     xml::Attribute* componentProcess = node->findAttribute(xml::kSchemaAndroid,
                                                                            "process");
 
@@ -187,6 +181,13 @@
                             : mDefaultProcess;
                     getName = !process.empty() && process[0] != ':';
                 }
+            } else if (node-> name == "instrumentation") {
+                getName = true;
+            }
+
+            if (getName) {
+                xml::Attribute* attr = node->findAttribute(xml::kSchemaAndroid, "name");
+                getName = attr != nullptr;
 
                 if (getName) {
                     Maybe<std::string> result = util::getFullyQualifiedClassName(mPackage,
diff --git a/tools/fonts/fontchain_lint.py b/tools/fonts/fontchain_lint.py
index 1dd53a9..336fce9 100755
--- a/tools/fonts/fontchain_lint.py
+++ b/tools/fonts/fontchain_lint.py
@@ -256,8 +256,8 @@
 
 
 def check_emoji_coverage(all_emoji, equivalent_emoji):
-  emoji_font = get_emoji_font()
-  check_emoji_font_coverage(emoji_font, all_emoji, equivalent_emoji)
+    emoji_font = get_emoji_font()
+    check_emoji_font_coverage(emoji_font, all_emoji, equivalent_emoji)
 
 
 def get_emoji_font():
@@ -274,15 +274,12 @@
         assert sequence in coverage, (
             '%s is not supported in the emoji font.' % printable(sequence))
 
-    # disable temporarily - we cover more than this
-    """
     for sequence in coverage:
         if sequence in {0x0000, 0x000D, 0x0020}:
             # The font needs to support a few extra characters, which is OK
             continue
         assert sequence in all_emoji, (
             'Emoji font should not support %s.' % printable(sequence))
-    """
 
     for first, second in sorted(equivalent_emoji.items()):
         assert coverage[first] == coverage[second], (
@@ -290,8 +287,6 @@
                 printable(first),
                 printable(second)))
 
-    # disable temporarily - some equivalent sequences we don't even know about
-    """
     for glyph in set(coverage.values()):
         maps_to_glyph = [seq for seq in coverage if coverage[seq] == glyph]
         if len(maps_to_glyph) > 1:
@@ -307,7 +302,7 @@
                 'The sequences %s should not result in the same glyph %s' % (
                     printable(equivalent_seqs),
                     glyph))
-    """
+
 
 def check_emoji_defaults(default_emoji):
     missing_text_chars = _emoji_properties['Emoji'] - default_emoji
@@ -334,15 +329,9 @@
     # Noto does not have monochrome glyphs for Unicode 7.0 wingdings and
     # webdings yet.
     missing_text_chars -= _chars_by_age['7.0']
-    # TODO: Remove these after b/26113320 is fixed
-    missing_text_chars -= {
-        0x263A, # WHITE SMILING FACE
-        0x270C, # VICTORY HAND
-        0x2744, # SNOWFLAKE
-        0x2764, # HEAVY BLACK HEART
-    }
     assert missing_text_chars == set(), (
-        'Text style version of some emoji characters are missing: ' + repr(missing_text_chars))
+        'Text style version of some emoji characters are missing: ' +
+            repr(missing_text_chars))
 
 
 # Setting reverse to true returns a dictionary that maps the values to sets of
@@ -362,7 +351,7 @@
             if not line:
                 continue
 
-            chars, prop = line.split(';')
+            chars, prop = line.split(';')[:2]
             chars = chars.strip()
             prop = prop.strip()
 
@@ -424,16 +413,6 @@
         path.join(ucd_path, 'emoji-zwj-sequences.txt'))
 
 
-    # add in UN flag
-    UN_seq = flag_sequence('UN')
-    _emoji_sequences[UN_seq] = 'Emoji_Flag_Sequence'
-
-
-    # add in UN flag
-    UN_seq = flag_sequence('UN')
-    _emoji_sequences[UN_seq] = 'Emoji_Flag_Sequence'
-
-
 def flag_sequence(territory_code):
     return tuple(0x1F1E6 + ord(ch) - ord('A') for ch in territory_code)
 
@@ -444,7 +423,8 @@
     flag_sequence('GF'), flag_sequence('GP'), flag_sequence('GS'),
     flag_sequence('MF'), flag_sequence('MQ'), flag_sequence('NC'),
     flag_sequence('PM'), flag_sequence('RE'), flag_sequence('TF'),
-    flag_sequence('WF'), flag_sequence('XK'), flag_sequence('YT'),
+    flag_sequence('UN'), flag_sequence('WF'), flag_sequence('XK'),
+    flag_sequence('YT'),
 })
 
 EQUIVALENT_FLAGS = {
@@ -457,6 +437,22 @@
 
 COMBINING_KEYCAP = 0x20E3
 
+# Characters that Android defaults to emoji style, different from the recommendations in UTR #51
+ANDROID_DEFAULT_EMOJI = frozenset({
+    0x2600, # BLACK SUN WITH RAYS
+    0x2601, # CLOUD
+    0x260E, # BLACK TELEPHONE
+    0x261D, # WHITE UP POINTING INDEX
+    0x263A, # WHITE SMILING FACE
+    0x2660, # BLACK SPADE SUIT
+    0x2663, # BLACK CLUB SUIT
+    0x2665, # BLACK HEART SUIT
+    0x2666, # BLACK DIAMOND SUIT
+    0x270C, # VICTORY HAND
+    0x2744, # SNOWFLAKE
+    0x2764, # HEAVY BLACK HEART
+})
+
 LEGACY_ANDROID_EMOJI = {
     0xFE4E5: flag_sequence('JP'),
     0xFE4E6: flag_sequence('US'),
@@ -492,7 +488,17 @@
 
 
 def is_fitzpatrick_modifier(cp):
-  return 0x1f3fb <= cp <= 0x1f3ff
+    return 0x1F3FB <= cp <= 0x1F3FF
+
+
+def reverse_emoji(seq):
+    rev = list(reversed(seq))
+    # if there are fitzpatrick modifiers in the sequence, keep them after
+    # the emoji they modify
+    for i in xrange(1, len(rev)):
+        if is_fitzpatrick_modifier(rev[i-1]):
+            rev[i], rev[i-1] = rev[i-1], rev[i]
+    return tuple(rev)
 
 
 def compute_expected_emoji():
@@ -512,15 +518,7 @@
         sequence_pieces.update(sequence)
         # Add reverse of all emoji ZWJ sequences, which are added to the fonts
         # as a workaround to get the sequences work in RTL text.
-        reversed_seq = list(reversed(sequence))
-        # if there are fitzpatrick modifiers in the sequence, keep them after
-        # the emoji they modify
-        for i in xrange(1, len(reversed_seq)):
-          if is_fitzpatrick_modifier(reversed_seq[i - 1]):
-            tmp = reversed_seq[i]
-            reversed_seq[i] = reversed_seq[i-1]
-            reversed_seq[i-1] = tmp
-        reversed_seq = tuple(reversed_seq)
+        reversed_seq = reverse_emoji(sequence)
         all_sequences.add(reversed_seq)
         equivalent_emoji[reversed_seq] = sequence
 
@@ -539,6 +537,7 @@
         set(LEGACY_ANDROID_EMOJI.keys()))
     default_emoji = (
         _emoji_properties['Emoji_Presentation'] |
+        ANDROID_DEFAULT_EMOJI |
         all_sequences |
         set(LEGACY_ANDROID_EMOJI.keys()))
 
diff --git a/tools/layoutlib/bridge/src/android/view/IWindowManagerImpl.java b/tools/layoutlib/bridge/src/android/view/IWindowManagerImpl.java
index 49ab9f9..5a9860d 100644
--- a/tools/layoutlib/bridge/src/android/view/IWindowManagerImpl.java
+++ b/tools/layoutlib/bridge/src/android/view/IWindowManagerImpl.java
@@ -351,7 +351,12 @@
     }
 
     @Override
-    public void notifyAppStopped(IBinder token, boolean stopped) throws RemoteException {
+    public void notifyAppResumed(IBinder token, boolean wasStopped) throws RemoteException {
+        // TODO Auto-generated method stub
+    }
+
+    @Override
+    public void notifyAppStopped(IBinder token) throws RemoteException {
         // TODO Auto-generated method stub
     }
 
diff --git a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgeContext.java b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgeContext.java
index 72ac4c3..8d93b7f 100644
--- a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgeContext.java
+++ b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgeContext.java
@@ -1657,6 +1657,12 @@
         // pass
     }
 
+    @Override
+    public void sendBroadcastAsUser(Intent intent, UserHandle user,
+            String receiverPermission, Bundle options) {
+        // pass
+    }
+
     public void sendBroadcastAsUser(Intent intent, UserHandle user,
             String receiverPermission, int appOp) {
         // pass
diff --git a/wifi/java/android/net/wifi/nan/IWifiNanManager.aidl b/wifi/java/android/net/wifi/nan/IWifiNanManager.aidl
index efa6211..b8dd1a5 100644
--- a/wifi/java/android/net/wifi/nan/IWifiNanManager.aidl
+++ b/wifi/java/android/net/wifi/nan/IWifiNanManager.aidl
@@ -49,8 +49,8 @@
     // session API
     void updatePublish(int clientId, int sessionId, in PublishConfig publishConfig);
     void updateSubscribe(int clientId, int sessionId, in SubscribeConfig subscribeConfig);
-    void sendMessage(int clientId, int sessionId, int peerId, in byte[] message, int messageLength,
-            int messageId, int retryCount);
+    void sendMessage(int clientId, int sessionId, int peerId, in byte[] message, int messageId,
+        int retryCount);
     void terminateSession(int clientId, int sessionId);
     int startRanging(int clientId, int sessionId, in RttManager.ParcelableRttParams parms);
 }
diff --git a/wifi/java/android/net/wifi/nan/IWifiNanSessionCallback.aidl b/wifi/java/android/net/wifi/nan/IWifiNanSessionCallback.aidl
index 7162be7..ff2c409 100644
--- a/wifi/java/android/net/wifi/nan/IWifiNanSessionCallback.aidl
+++ b/wifi/java/android/net/wifi/nan/IWifiNanSessionCallback.aidl
@@ -28,10 +28,9 @@
     void onSessionConfigFail(int reason);
     void onSessionTerminated(int reason);
 
-    void onMatch(int peerId, in byte[] serviceSpecificInfo,
-            int serviceSpecificInfoLength, in byte[] matchFilter, int matchFilterLength);
+    void onMatch(int peerId, in byte[] serviceSpecificInfo, in byte[] matchFilter);
 
     void onMessageSendSuccess(int messageId);
     void onMessageSendFail(int messageId, int reason);
-    void onMessageReceived(int peerId, in byte[] message, int messageLength);
+    void onMessageReceived(int peerId, in byte[] message);
 }
diff --git a/wifi/java/android/net/wifi/nan/LvBufferUtils.java b/wifi/java/android/net/wifi/nan/LvBufferUtils.java
new file mode 100644
index 0000000..eb56070
--- /dev/null
+++ b/wifi/java/android/net/wifi/nan/LvBufferUtils.java
@@ -0,0 +1,340 @@
+/*
+ * Copyright (C) 2016 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.net.wifi.nan;
+
+import android.annotation.Nullable;
+
+import libcore.io.Memory;
+
+import java.nio.ByteOrder;
+import java.util.Iterator;
+
+/**
+ * Utility class to construct and parse byte arrays using the LV format -
+ * Length/Value format. The utilities accept a configuration of the size of
+ * the Length field.
+ *
+ * @hide PROPOSED_NAN_API
+ */
+public class LvBufferUtils {
+    private LvBufferUtils() {
+        // no reason to ever create this class
+    }
+
+    /**
+     * Utility class to construct byte arrays using the LV format - Length/Value.
+     * <p>
+     * A constructor is created specifying the size of the Length (L) field.
+     * <p>
+     * The byte array is either provided (using
+     * {@link LvBufferUtils.LvConstructor#wrap(byte[])}) or allocated (using
+     * {@link LvBufferUtils.LvConstructor#allocate(int)}).
+     * <p>
+     * Values are added to the structure using the {@code LvConstructor.put*()}
+     * methods.
+     * <p>
+     * The final byte array is obtained using {@link LvBufferUtils.LvConstructor#getArray()}.
+     */
+    public static class LvConstructor {
+        private TlvBufferUtils.TlvConstructor mTlvImpl;
+
+        /**
+         * Define a LV constructor with the specified size of the Length (L) field.
+         *
+         * @param lengthSize Number of bytes used for the Length (L) field.
+         *            Values of 1 or 2 bytes are allowed.
+         */
+        public LvConstructor(int lengthSize) {
+            mTlvImpl = new TlvBufferUtils.TlvConstructor(0, lengthSize);
+        }
+
+        /**
+         * Set the byte array to be used to construct the LV.
+         *
+         * @param array Byte array to be formatted.
+         * @return The constructor to facilitate chaining
+         *         {@code ctr.putXXX(..).putXXX(..)}.
+         */
+        public LvBufferUtils.LvConstructor wrap(@Nullable byte[] array) {
+            mTlvImpl.wrap(array);
+            return this;
+        }
+
+        /**
+         * Allocates a new byte array to be used ot construct a LV.
+         *
+         * @param capacity The size of the byte array to be allocated.
+         * @return The constructor to facilitate chaining
+         *         {@code ctr.putXXX(..).putXXX(..)}.
+         */
+        public LvBufferUtils.LvConstructor allocate(int capacity) {
+            mTlvImpl.allocate(capacity);
+            return this;
+        }
+
+        /**
+         * Copies a byte into the LV array.
+         *
+         * @param b The byte to be inserted into the structure.
+         * @return The constructor to facilitate chaining
+         *         {@code ctr.putXXX(..).putXXX(..)}.
+         */
+        public LvBufferUtils.LvConstructor putByte(byte b) {
+            mTlvImpl.putByte(0, b);
+            return this;
+        }
+
+        /**
+         * Copies a byte array into the LV.
+         *
+         * @param array The array to be copied into the LV structure.
+         * @param offset Start copying from the array at the specified offset.
+         * @param length Copy the specified number (length) of bytes from the
+         *            array.
+         * @return The constructor to facilitate chaining
+         *         {@code ctr.putXXX(..).putXXX(..)}.
+         */
+        public LvBufferUtils.LvConstructor putByteArray(@Nullable byte[] array, int offset,
+                int length) {
+            mTlvImpl.putByteArray(0, array, offset, length);
+            return this;
+        }
+
+        /**
+         * Copies a byte array into the LV.
+         *
+         * @param array The array to be copied (in full) into the LV structure.
+         * @return The constructor to facilitate chaining
+         *         {@code ctr.putXXX(..).putXXX(..)}.
+         */
+        public LvBufferUtils.LvConstructor putByteArray(int type, @Nullable byte[] array) {
+            return putByteArray(array, 0, (array == null) ? 0 : array.length);
+        }
+
+        /**
+         * Places a zero length element (i.e. Length field = 0) into the LV.
+         *
+         * @return The constructor to facilitate chaining
+         *         {@code ctr.putXXX(..).putXXX(..)}.
+         */
+        public LvBufferUtils.LvConstructor putZeroLengthElement() {
+            mTlvImpl.putZeroLengthElement(0);
+            return this;
+        }
+
+        /**
+         * Copies short into the LV.
+         *
+         * @param data The short to be inserted into the structure.
+         * @return The constructor to facilitate chaining
+         *         {@code ctr.putXXX(..).putXXX(..)}.
+         */
+        public LvBufferUtils.LvConstructor putShort(short data) {
+            mTlvImpl.putShort(0, data);
+            return this;
+        }
+
+        /**
+         * Copies integer into the LV.
+         *
+         * @param data The integer to be inserted into the structure.
+         * @return The constructor to facilitate chaining
+         *         {@code ctr.putXXX(..).putXXX(..)}.
+         */
+        public LvBufferUtils.LvConstructor putInt(int data) {
+            mTlvImpl.putInt(0, data);
+            return this;
+        }
+
+        /**
+         * Copies a String's byte representation into the LV.
+         *
+         * @param data The string whose bytes are to be inserted into the
+         *            structure.
+         * @return The constructor to facilitate chaining
+         *         {@code ctr.putXXX(..).putXXX(..)}.
+         */
+        public LvBufferUtils.LvConstructor putString(@Nullable String data) {
+            mTlvImpl.putString(0, data);
+            return this;
+        }
+
+        /**
+         * Returns the constructed LV formatted byte-array. This array is a copy of the wrapped
+         * or allocated array - truncated to just the significant bytes - i.e. those written into
+         * the LV.
+         *
+         * @return The byte array containing the LV formatted structure.
+         */
+        public byte[] getArray() {
+            return mTlvImpl.getArray();
+        }
+    }
+
+    /**
+     * Utility class used when iterating over an LV formatted byte-array. Use
+     * {@link LvBufferUtils.LvIterable} to iterate over array. A {@link LvBufferUtils.LvElement}
+     * represents each entry in a LV formatted byte-array.
+     */
+    public static class LvElement {
+        /**
+         * The Length (L) field of the current LV element.
+         */
+        public int length;
+
+        /**
+         * The Value (V) field - a raw byte array representing the current LV
+         * element where the entry starts at {@link LvBufferUtils.LvElement#offset}.
+         */
+        public byte[] refArray;
+
+        /**
+         * The offset to be used into {@link LvBufferUtils.LvElement#refArray} to access the
+         * raw data representing the current LV element.
+         */
+        public int offset;
+
+        private LvElement(int length, @Nullable byte[] refArray, int offset) {
+            this.length = length;
+            this.refArray = refArray;
+            this.offset = offset;
+        }
+
+        /**
+         * Utility function to return a byte representation of a LV element of
+         * length 1. Note: an attempt to call this function on a LV item whose
+         * {@link LvBufferUtils.LvElement#length} is != 1 will result in an exception.
+         *
+         * @return byte representation of current LV element.
+         */
+        public byte getByte() {
+            if (length != 1) {
+                throw new IllegalArgumentException(
+                        "Accesing a byte from a LV element of length " + length);
+            }
+            return refArray[offset];
+        }
+
+        /**
+         * Utility function to return a short representation of a LV element of
+         * length 2. Note: an attempt to call this function on a LV item whose
+         * {@link LvBufferUtils.LvElement#length} is != 2 will result in an exception.
+         *
+         * @return short representation of current LV element.
+         */
+        public short getShort() {
+            if (length != 2) {
+                throw new IllegalArgumentException(
+                        "Accesing a short from a LV element of length " + length);
+            }
+            return Memory.peekShort(refArray, offset, ByteOrder.BIG_ENDIAN);
+        }
+
+        /**
+         * Utility function to return an integer representation of a LV element
+         * of length 4. Note: an attempt to call this function on a LV item
+         * whose {@link LvBufferUtils.LvElement#length} is != 4 will result in an exception.
+         *
+         * @return integer representation of current LV element.
+         */
+        public int getInt() {
+            if (length != 4) {
+                throw new IllegalArgumentException(
+                        "Accesing an int from a LV element of length " + length);
+            }
+            return Memory.peekInt(refArray, offset, ByteOrder.BIG_ENDIAN);
+        }
+
+        /**
+         * Utility function to return a String representation of a LV element.
+         *
+         * @return String representation of the current LV element.
+         */
+        public String getString() {
+            return new String(refArray, offset, length);
+        }
+    }
+
+    /**
+     * Utility class to iterate over a LV formatted byte-array.
+     */
+    public static class LvIterable implements Iterable<LvBufferUtils.LvElement> {
+        private final TlvBufferUtils.TlvIterable mTlvIterable;
+
+        /**
+         * Constructs an LvIterable object - specifying the format of the LV
+         * (the size of the Length field), and the byte array whose data is to be parsed.
+         *
+         * @param lengthSize Number of bytes sued for the Length (L) field.
+         *            Values values are 1 or 2 bytes.
+         * @param array The LV formatted byte-array to parse.
+         */
+        public LvIterable(int lengthSize, @Nullable byte[] array) {
+            mTlvIterable = new TlvBufferUtils.TlvIterable(0, lengthSize, array);
+        }
+
+        /**
+         * Prints out a parsed representation of the LV-formatted byte array.
+         * Whenever possible bytes, shorts, and integer are printed out (for
+         * fields whose length is 1, 2, or 4 respectively).
+         */
+        @Override
+        public String toString() {
+            return mTlvIterable.toString();
+        }
+
+        /**
+         * Returns an iterator to step through a LV formatted byte-array. The
+         * individual elements returned by the iterator are {@link LvBufferUtils.LvElement}.
+         */
+        @Override
+        public Iterator<LvBufferUtils.LvElement> iterator() {
+            return new Iterator<LvBufferUtils.LvElement>() {
+                private Iterator<TlvBufferUtils.TlvElement> mTlvIterator = mTlvIterable.iterator();
+
+                @Override
+                public boolean hasNext() {
+                    return mTlvIterator.hasNext();
+                }
+
+                @Override
+                public LvBufferUtils.LvElement next() {
+                    TlvBufferUtils.TlvElement tlvE = mTlvIterator.next();
+
+                    return new LvElement(tlvE.length, tlvE.refArray, tlvE.offset);
+                }
+
+                @Override
+                public void remove() {
+                    throw new UnsupportedOperationException();
+                }
+            };
+        }
+    }
+
+    /**
+     * Validates that a LV array is constructed correctly. I.e. that its specified Length
+     * fields correctly fill the specified length (and do not overshoot).
+     *
+     * @param array The LV array to verify.
+     * @param lengthSize The size (in bytes) of the length field. Valid values are 1 or 2.
+     * @return A boolean indicating whether the array is valid (true) or invalid (false).
+     */
+    public static boolean isValid(@Nullable byte[] array, int lengthSize) {
+        return TlvBufferUtils.isValid(array, 0, lengthSize);
+    }
+}
diff --git a/wifi/java/android/net/wifi/nan/PublishConfig.java b/wifi/java/android/net/wifi/nan/PublishConfig.java
index a4969bd..3fd756e 100644
--- a/wifi/java/android/net/wifi/nan/PublishConfig.java
+++ b/wifi/java/android/net/wifi/nan/PublishConfig.java
@@ -18,9 +18,12 @@
 
 import android.annotation.IntDef;
 import android.annotation.NonNull;
+import android.annotation.Nullable;
 import android.os.Parcel;
 import android.os.Parcelable;
 
+import libcore.util.HexEncoding;
+
 import java.lang.annotation.Retention;
 import java.lang.annotation.RetentionPolicy;
 import java.nio.charset.StandardCharsets;
@@ -64,31 +67,16 @@
     /**
      * @hide
      */
-    public final int mServiceSpecificInfoLength;
-
-    /**
-     * @hide
-     */
     public final byte[] mServiceSpecificInfo;
 
     /**
      * @hide
      */
-    public final int mTxFilterLength;
-
-    /**
-     * @hide
-     */
     public final byte[] mTxFilter;
 
     /**
      * @hide
      */
-    public final int mRxFilterLength;
-
-    /**
-     * @hide
-     */
     public final byte[] mRxFilter;
 
     /**
@@ -112,15 +100,11 @@
     public final boolean mEnableTerminateNotification;
 
     private PublishConfig(byte[] serviceName, byte[] serviceSpecificInfo,
-            int serviceSpecificInfoLength, byte[] txFilter, int txFilterLength, byte[] rxFilter,
-            int rxFilterLength, int publishType, int publichCount, int ttlSec,
+            byte[] txFilter, byte[] rxFilter, int publishType, int publichCount, int ttlSec,
             boolean enableTerminateNotification) {
         mServiceName = serviceName;
-        mServiceSpecificInfoLength = serviceSpecificInfoLength;
         mServiceSpecificInfo = serviceSpecificInfo;
-        mTxFilterLength = txFilterLength;
         mTxFilter = txFilter;
-        mRxFilterLength = rxFilterLength;
         mRxFilter = rxFilter;
         mPublishType = publishType;
         mPublishCount = publichCount;
@@ -130,12 +114,10 @@
 
     @Override
     public String toString() {
-        return "PublishConfig [mServiceName='" + mServiceName + "', mServiceSpecificInfo='"
-                + (new String(mServiceSpecificInfo, 0, mServiceSpecificInfoLength))
-                + "', mTxFilter="
-                + (new TlvBufferUtils.TlvIterable(0, 1, mTxFilter, mTxFilterLength)).toString()
-                + ", mRxFilter="
-                + (new TlvBufferUtils.TlvIterable(0, 1, mRxFilter, mRxFilterLength)).toString()
+        return "PublishConfig [mServiceName='" + mServiceName + ", mServiceSpecificInfo='" + (
+                (mServiceSpecificInfo == null) ? "null" : HexEncoding.encode(mServiceSpecificInfo))
+                + ", mTxFilter=" + (new LvBufferUtils.LvIterable(1, mTxFilter)).toString()
+                + ", mRxFilter=" + (new LvBufferUtils.LvIterable(1, mRxFilter)).toString()
                 + ", mPublishType=" + mPublishType + ", mPublishCount=" + mPublishCount
                 + ", mTtlSec=" + mTtlSec + ", mEnableTerminateNotification="
                 + mEnableTerminateNotification + "]";
@@ -148,22 +130,10 @@
 
     @Override
     public void writeToParcel(Parcel dest, int flags) {
-        dest.writeInt(mServiceName.length);
-        if (mServiceName.length != 0) {
-            dest.writeByteArray(mServiceName);
-        }
-        dest.writeInt(mServiceSpecificInfoLength);
-        if (mServiceSpecificInfoLength != 0) {
-            dest.writeByteArray(mServiceSpecificInfo, 0, mServiceSpecificInfoLength);
-        }
-        dest.writeInt(mTxFilterLength);
-        if (mTxFilterLength != 0) {
-            dest.writeByteArray(mTxFilter, 0, mTxFilterLength);
-        }
-        dest.writeInt(mRxFilterLength);
-        if (mRxFilterLength != 0) {
-            dest.writeByteArray(mRxFilter, 0, mRxFilterLength);
-        }
+        dest.writeByteArray(mServiceName);
+        dest.writeByteArray(mServiceSpecificInfo);
+        dest.writeByteArray(mTxFilter);
+        dest.writeByteArray(mRxFilter);
         dest.writeInt(mPublishType);
         dest.writeInt(mPublishCount);
         dest.writeInt(mTtlSec);
@@ -178,34 +148,17 @@
 
         @Override
         public PublishConfig createFromParcel(Parcel in) {
-            int serviceNameLength = in.readInt();
-            byte[] serviceName = new byte[serviceNameLength];
-            if (serviceNameLength != 0) {
-                in.readByteArray(serviceName);
-            }
-            int ssiLength = in.readInt();
-            byte[] ssi = new byte[ssiLength];
-            if (ssiLength != 0) {
-                in.readByteArray(ssi);
-            }
-            int txFilterLength = in.readInt();
-            byte[] txFilter = new byte[txFilterLength];
-            if (txFilterLength != 0) {
-                in.readByteArray(txFilter);
-            }
-            int rxFilterLength = in.readInt();
-            byte[] rxFilter = new byte[rxFilterLength];
-            if (rxFilterLength != 0) {
-                in.readByteArray(rxFilter);
-            }
+            byte[] serviceName = in.createByteArray();
+            byte[] ssi = in.createByteArray();
+            byte[] txFilter = in.createByteArray();
+            byte[] rxFilter = in.createByteArray();
             int publishType = in.readInt();
             int publishCount = in.readInt();
             int ttlSec = in.readInt();
             boolean enableTerminateNotification = in.readInt() != 0;
 
-            return new PublishConfig(serviceName, ssi, ssiLength, txFilter, txFilterLength,
-                    rxFilter, rxFilterLength, publishType, publishCount, ttlSec,
-                    enableTerminateNotification);
+            return new PublishConfig(serviceName, ssi, txFilter, rxFilter, publishType,
+                    publishCount, ttlSec, enableTerminateNotification);
         }
     };
 
@@ -221,45 +174,10 @@
 
         PublishConfig lhs = (PublishConfig) o;
 
-        if (!Arrays.equals(mServiceName, lhs.mServiceName)
-                || mServiceSpecificInfoLength != lhs.mServiceSpecificInfoLength
-                || mTxFilterLength != lhs.mTxFilterLength
-                || mRxFilterLength != lhs.mRxFilterLength) {
-            return false;
-        }
-
-        if (mServiceSpecificInfo != null && lhs.mServiceSpecificInfo != null) {
-            for (int i = 0; i < mServiceSpecificInfoLength; ++i) {
-                if (mServiceSpecificInfo[i] != lhs.mServiceSpecificInfo[i]) {
-                    return false;
-                }
-            }
-        } else if (mServiceSpecificInfoLength != 0) {
-            return false; // invalid != invalid
-        }
-
-        if (mTxFilter != null && lhs.mTxFilter != null) {
-            for (int i = 0; i < mTxFilterLength; ++i) {
-                if (mTxFilter[i] != lhs.mTxFilter[i]) {
-                    return false;
-                }
-            }
-        } else if (mTxFilterLength != 0) {
-            return false; // invalid != invalid
-        }
-
-        if (mRxFilter != null && lhs.mRxFilter != null) {
-            for (int i = 0; i < mRxFilterLength; ++i) {
-                if (mRxFilter[i] != lhs.mRxFilter[i]) {
-                    return false;
-                }
-            }
-        } else if (mRxFilterLength != 0) {
-            return false; // invalid != invalid
-        }
-
-        return mPublishType == lhs.mPublishType && mPublishCount == lhs.mPublishCount
-                && mTtlSec == lhs.mTtlSec
+        return Arrays.equals(mServiceName, lhs.mServiceName) && Arrays.equals(mServiceSpecificInfo,
+                lhs.mServiceSpecificInfo) && Arrays.equals(mTxFilter, lhs.mTxFilter)
+                && Arrays.equals(mRxFilter, lhs.mRxFilter) && mPublishType == lhs.mPublishType
+                && mPublishCount == lhs.mPublishCount && mTtlSec == lhs.mTtlSec
                 && mEnableTerminateNotification == lhs.mEnableTerminateNotification;
     }
 
@@ -268,11 +186,8 @@
         int result = 17;
 
         result = 31 * result + Arrays.hashCode(mServiceName);
-        result = 31 * result + mServiceSpecificInfoLength;
         result = 31 * result + Arrays.hashCode(mServiceSpecificInfo);
-        result = 31 * result + mTxFilterLength;
         result = 31 * result + Arrays.hashCode(mTxFilter);
-        result = 31 * result + mRxFilterLength;
         result = 31 * result + Arrays.hashCode(mRxFilter);
         result = 31 * result + mPublishType;
         result = 31 * result + mPublishCount;
@@ -291,24 +206,11 @@
     public void validate() throws IllegalArgumentException {
         WifiNanUtils.validateServiceName(mServiceName);
 
-        if (mServiceSpecificInfoLength != 0 && (mServiceSpecificInfo == null
-                || mServiceSpecificInfo.length < mServiceSpecificInfoLength)) {
-            throw new IllegalArgumentException("Non-matching combination of "
-                    + "serviceSpecificInfo and serviceSpecificInfoLength");
-        }
-        if (mTxFilterLength != 0 && (mTxFilter == null || mTxFilter.length < mTxFilterLength)) {
-            throw new IllegalArgumentException(
-                    "Non-matching combination of txFilter and txFilterLength");
-        }
-        if (!TlvBufferUtils.isValid(mTxFilter, mTxFilterLength, 0, 1)) {
+        if (!LvBufferUtils.isValid(mTxFilter, 1)) {
             throw new IllegalArgumentException(
                     "Invalid txFilter configuration - LV fields do not match up to length");
         }
-        if (mRxFilterLength != 0 && (mRxFilter == null || mRxFilter.length < mRxFilterLength)) {
-            throw new IllegalArgumentException(
-                    "Non-matching combination of rxFilter and rxFilterLength");
-        }
-        if (!TlvBufferUtils.isValid(mRxFilter, mRxFilterLength, 0, 1)) {
+        if (!LvBufferUtils.isValid(mRxFilter, 1)) {
             throw new IllegalArgumentException(
                     "Invalid rxFilter configuration - LV fields do not match up to length");
         }
@@ -321,11 +223,13 @@
         if (mTtlSec < 0) {
             throw new IllegalArgumentException("Invalid ttlSec - must be non-negative");
         }
-        if (mPublishType == PublishConfig.PUBLISH_TYPE_UNSOLICITED && mRxFilterLength != 0) {
+        if (mPublishType == PublishConfig.PUBLISH_TYPE_UNSOLICITED && mRxFilter != null
+                && mRxFilter.length != 0) {
             throw new IllegalArgumentException("Invalid publish config: UNSOLICITED "
                     + "publishes (active) can't have an Rx filter");
         }
-        if (mPublishType == PublishConfig.PUBLISH_TYPE_SOLICITED && mTxFilterLength != 0) {
+        if (mPublishType == PublishConfig.PUBLISH_TYPE_SOLICITED && mTxFilter != null
+                && mTxFilter.length != 0) {
             throw new IllegalArgumentException("Invalid publish config: SOLICITED "
                     + "publishes (passive) can't have a Tx filter");
         }
@@ -336,12 +240,9 @@
      */
     public static final class Builder {
         private byte[] mServiceName;
-        private int mServiceSpecificInfoLength;
-        private byte[] mServiceSpecificInfo = new byte[0];
-        private int mTxFilterLength;
-        private byte[] mTxFilter = new byte[0];
-        private int mRxFilterLength;
-        private byte[] mRxFilter = new byte[0];
+        private byte[] mServiceSpecificInfo;
+        private byte[] mTxFilter;
+        private byte[] mRxFilter;
         private int mPublishType = PUBLISH_TYPE_UNSOLICITED;
         private int mPublishCount = 0;
         private int mTtlSec = 0;
@@ -377,26 +278,17 @@
          *
          * @param serviceSpecificInfo A byte-array for the service-specific
          *            information field.
-         * @param serviceSpecificInfoLength The length of the byte-array to be
-         *            used.
          * @return The builder to facilitate chaining
          *         {@code builder.setXXX(..).setXXX(..)}.
          */
-        public Builder setServiceSpecificInfo(byte[] serviceSpecificInfo,
-                int serviceSpecificInfoLength) {
-            if (serviceSpecificInfoLength != 0 && (serviceSpecificInfo == null
-                    || serviceSpecificInfo.length < serviceSpecificInfoLength)) {
-                throw new IllegalArgumentException("Non-matching combination of "
-                        + "serviceSpecificInfo and serviceSpecificInfoLength");
-            }
-            mServiceSpecificInfoLength = serviceSpecificInfoLength;
+        public Builder setServiceSpecificInfo(@Nullable byte[] serviceSpecificInfo) {
             mServiceSpecificInfo = serviceSpecificInfo;
             return this;
         }
 
         /**
          * Specify service specific information for the publish session - same
-         * as {@link PublishConfig.Builder#setServiceSpecificInfo(byte[], int)}
+         * as {@link PublishConfig.Builder#setServiceSpecificInfo(byte[])}
          * but obtaining the data from a String.
          *
          * @param serviceSpecificInfoStr The service specific information string
@@ -407,7 +299,6 @@
          */
         public Builder setServiceSpecificInfo(@NonNull String serviceSpecificInfoStr) {
             mServiceSpecificInfo = serviceSpecificInfoStr.getBytes();
-            mServiceSpecificInfoLength = mServiceSpecificInfo.length;
             return this;
         }
 
@@ -419,23 +310,16 @@
          * determine whether they match - in addition to just relying on the
          * service name.
          * <p>
-         * Format is an LV byte array - the {@link TlvBufferUtils} utility class
+         * Format is an LV byte array - the {@link LvBufferUtils} utility class
          * is available to form and parse.
          *
          * @param txFilter The byte-array containing the LV formatted transmit
          *            filter.
-         * @param txFilterLength The number of bytes in the transmit filter
-         *            argument.
          * @return The builder to facilitate chaining
          *         {@code builder.setXXX(..).setXXX(..)}.
          */
-        public Builder setTxFilter(byte[] txFilter, int txFilterLength) {
-            if (txFilterLength != 0 && (txFilter == null || txFilter.length < txFilterLength)) {
-                throw new IllegalArgumentException(
-                        "Non-matching combination of txFilter and txFilterLength");
-            }
+        public Builder setTxFilter(@Nullable byte[] txFilter) {
             mTxFilter = txFilter;
-            mTxFilterLength = txFilterLength;
             return this;
         }
 
@@ -447,23 +331,16 @@
          * (active subscribers) - in addition to just relying on the service
          * name.
          * <p>
-         * Format is an LV byte array - the {@link TlvBufferUtils} utility class
+         * Format is an LV byte array - the {@link LvBufferUtils} utility class
          * is available to form and parse.
          *
          * @param rxFilter The byte-array containing the LV formatted receive
          *            filter.
-         * @param rxFilterLength The number of bytes in the receive filter
-         *            argument.
          * @return The builder to facilitate chaining
          *         {@code builder.setXXX(..).setXXX(..)}.
          */
-        public Builder setRxFilter(byte[] rxFilter, int rxFilterLength) {
-            if (rxFilterLength != 0 && (rxFilter == null || rxFilter.length < rxFilterLength)) {
-                throw new IllegalArgumentException(
-                        "Non-matching combination of rxFilter and rxFilterLength");
-            }
+        public Builder setRxFilter(@Nullable byte[] rxFilter) {
             mRxFilter = rxFilter;
-            mRxFilterLength = rxFilterLength;
             return this;
         }
 
@@ -547,9 +424,8 @@
          * builder.
          */
         public PublishConfig build() {
-            return new PublishConfig(mServiceName, mServiceSpecificInfo, mServiceSpecificInfoLength,
-                    mTxFilter, mTxFilterLength, mRxFilter, mRxFilterLength, mPublishType,
-                    mPublishCount, mTtlSec, mEnableTerminateNotification);
+            return new PublishConfig(mServiceName, mServiceSpecificInfo, mTxFilter, mRxFilter,
+                    mPublishType, mPublishCount, mTtlSec, mEnableTerminateNotification);
         }
     }
 }
diff --git a/wifi/java/android/net/wifi/nan/SubscribeConfig.java b/wifi/java/android/net/wifi/nan/SubscribeConfig.java
index 0d3ea01..fd19ddb 100644
--- a/wifi/java/android/net/wifi/nan/SubscribeConfig.java
+++ b/wifi/java/android/net/wifi/nan/SubscribeConfig.java
@@ -18,9 +18,12 @@
 
 import android.annotation.IntDef;
 import android.annotation.NonNull;
+import android.annotation.Nullable;
 import android.os.Parcel;
 import android.os.Parcelable;
 
+import libcore.util.HexEncoding;
+
 import java.lang.annotation.Retention;
 import java.lang.annotation.RetentionPolicy;
 import java.nio.charset.StandardCharsets;
@@ -82,31 +85,16 @@
     /**
      * @hide
      */
-    public final int mServiceSpecificInfoLength;
-
-    /**
-     * @hide
-     */
     public final byte[] mServiceSpecificInfo;
 
     /**
      * @hide
      */
-    public final int mTxFilterLength;
-
-    /**
-     * @hide
-     */
     public final byte[] mTxFilter;
 
     /**
      * @hide
      */
-    public final int mRxFilterLength;
-
-    /**
-     * @hide
-     */
     public final byte[] mRxFilter;
 
     /**
@@ -134,16 +122,12 @@
      */
     public final boolean mEnableTerminateNotification;
 
-    private SubscribeConfig(byte[] serviceName, byte[] serviceSpecificInfo,
-            int serviceSpecificInfoLength, byte[] txFilter, int txFilterLength, byte[] rxFilter,
-            int rxFilterLength, int subscribeType, int publichCount, int ttlSec, int matchStyle,
+    private SubscribeConfig(byte[] serviceName, byte[] serviceSpecificInfo, byte[] txFilter,
+            byte[] rxFilter, int subscribeType, int publichCount, int ttlSec, int matchStyle,
             boolean enableTerminateNotification) {
         mServiceName = serviceName;
-        mServiceSpecificInfoLength = serviceSpecificInfoLength;
         mServiceSpecificInfo = serviceSpecificInfo;
-        mTxFilterLength = txFilterLength;
         mTxFilter = txFilter;
-        mRxFilterLength = rxFilterLength;
         mRxFilter = rxFilter;
         mSubscribeType = subscribeType;
         mSubscribeCount = publichCount;
@@ -154,12 +138,10 @@
 
     @Override
     public String toString() {
-        return "SubscribeConfig [mServiceName='" + mServiceName + "', mServiceSpecificInfo='"
-                + (new String(mServiceSpecificInfo, 0, mServiceSpecificInfoLength))
-                + "', mTxFilter="
-                + (new TlvBufferUtils.TlvIterable(0, 1, mTxFilter, mTxFilterLength)).toString()
-                + ", mRxFilter="
-                + (new TlvBufferUtils.TlvIterable(0, 1, mRxFilter, mRxFilterLength)).toString()
+        return "SubscribeConfig [mServiceName='" + mServiceName + ", mServiceSpecificInfo='" + (
+                (mServiceSpecificInfo == null) ? "null" : HexEncoding.encode(mServiceSpecificInfo))
+                + ", mTxFilter=" + (new LvBufferUtils.LvIterable(1, mTxFilter)).toString()
+                + ", mRxFilter=" + (new LvBufferUtils.LvIterable(1, mRxFilter)).toString()
                 + ", mSubscribeType=" + mSubscribeType + ", mSubscribeCount=" + mSubscribeCount
                 + ", mTtlSec=" + mTtlSec + ", mMatchType=" + mMatchStyle
                 + ", mEnableTerminateNotification=" + mEnableTerminateNotification + "]";
@@ -172,22 +154,10 @@
 
     @Override
     public void writeToParcel(Parcel dest, int flags) {
-        dest.writeInt(mServiceName.length);
-        if (mServiceName.length != 0) {
-            dest.writeByteArray(mServiceName);
-        }
-        dest.writeInt(mServiceSpecificInfoLength);
-        if (mServiceSpecificInfoLength != 0) {
-            dest.writeByteArray(mServiceSpecificInfo, 0, mServiceSpecificInfoLength);
-        }
-        dest.writeInt(mTxFilterLength);
-        if (mTxFilterLength != 0) {
-            dest.writeByteArray(mTxFilter, 0, mTxFilterLength);
-        }
-        dest.writeInt(mRxFilterLength);
-        if (mRxFilterLength != 0) {
-            dest.writeByteArray(mRxFilter, 0, mRxFilterLength);
-        }
+        dest.writeByteArray(mServiceName);
+        dest.writeByteArray(mServiceSpecificInfo);
+        dest.writeByteArray(mTxFilter);
+        dest.writeByteArray(mRxFilter);
         dest.writeInt(mSubscribeType);
         dest.writeInt(mSubscribeCount);
         dest.writeInt(mTtlSec);
@@ -203,35 +173,18 @@
 
         @Override
         public SubscribeConfig createFromParcel(Parcel in) {
-            int serviceNameLength = in.readInt();
-            byte[] serviceName = new byte[serviceNameLength];
-            if (serviceNameLength != 0) {
-                in.readByteArray(serviceName);
-            }
-            int ssiLength = in.readInt();
-            byte[] ssi = new byte[ssiLength];
-            if (ssiLength != 0) {
-                in.readByteArray(ssi);
-            }
-            int txFilterLength = in.readInt();
-            byte[] txFilter = new byte[txFilterLength];
-            if (txFilterLength != 0) {
-                in.readByteArray(txFilter);
-            }
-            int rxFilterLength = in.readInt();
-            byte[] rxFilter = new byte[rxFilterLength];
-            if (rxFilterLength != 0) {
-                in.readByteArray(rxFilter);
-            }
+            byte[] serviceName = in.createByteArray();
+            byte[] ssi = in.createByteArray();
+            byte[] txFilter = in.createByteArray();
+            byte[] rxFilter = in.createByteArray();
             int subscribeType = in.readInt();
             int subscribeCount = in.readInt();
             int ttlSec = in.readInt();
             int matchStyle = in.readInt();
             boolean enableTerminateNotification = in.readInt() != 0;
 
-            return new SubscribeConfig(serviceName, ssi, ssiLength, txFilter, txFilterLength,
-                    rxFilter, rxFilterLength, subscribeType, subscribeCount, ttlSec, matchStyle,
-                    enableTerminateNotification);
+            return new SubscribeConfig(serviceName, ssi, txFilter, rxFilter, subscribeType,
+                    subscribeCount, ttlSec, matchStyle, enableTerminateNotification);
         }
     };
 
@@ -247,45 +200,11 @@
 
         SubscribeConfig lhs = (SubscribeConfig) o;
 
-        if (!Arrays.equals(mServiceName, lhs.mServiceName)
-                || mServiceSpecificInfoLength != lhs.mServiceSpecificInfoLength
-                || mTxFilterLength != lhs.mTxFilterLength
-                || mRxFilterLength != lhs.mRxFilterLength) {
-            return false;
-        }
-
-        if (mServiceSpecificInfo != null && lhs.mServiceSpecificInfo != null) {
-            for (int i = 0; i < mServiceSpecificInfoLength; ++i) {
-                if (mServiceSpecificInfo[i] != lhs.mServiceSpecificInfo[i]) {
-                    return false;
-                }
-            }
-        } else if (mServiceSpecificInfoLength != 0) {
-            return false; // invalid != invalid
-        }
-
-        if (mTxFilter != null && lhs.mTxFilter != null) {
-            for (int i = 0; i < mTxFilterLength; ++i) {
-                if (mTxFilter[i] != lhs.mTxFilter[i]) {
-                    return false;
-                }
-            }
-        } else if (mTxFilterLength != 0) {
-            return false; // invalid != invalid
-        }
-
-        if (mRxFilter != null && lhs.mRxFilter != null) {
-            for (int i = 0; i < mRxFilterLength; ++i) {
-                if (mRxFilter[i] != lhs.mRxFilter[i]) {
-                    return false;
-                }
-            }
-        } else if (mRxFilterLength != 0) {
-            return false; // invalid != invalid
-        }
-
-        return mSubscribeType == lhs.mSubscribeType && mSubscribeCount == lhs.mSubscribeCount
-                && mTtlSec == lhs.mTtlSec && mMatchStyle == lhs.mMatchStyle
+        return Arrays.equals(mServiceName, lhs.mServiceName) && Arrays.equals(mServiceSpecificInfo,
+                lhs.mServiceSpecificInfo) && Arrays.equals(mTxFilter, lhs.mTxFilter)
+                && Arrays.equals(mRxFilter, lhs.mRxFilter) && mSubscribeType == lhs.mSubscribeType
+                && mSubscribeCount == lhs.mSubscribeCount && mTtlSec == lhs.mTtlSec
+                && mMatchStyle == lhs.mMatchStyle
                 && mEnableTerminateNotification == lhs.mEnableTerminateNotification;
     }
 
@@ -294,11 +213,8 @@
         int result = 17;
 
         result = 31 * result + Arrays.hashCode(mServiceName);
-        result = 31 * result + mServiceSpecificInfoLength;
         result = 31 * result + Arrays.hashCode(mServiceSpecificInfo);
-        result = 31 * result + mTxFilterLength;
         result = 31 * result + Arrays.hashCode(mTxFilter);
-        result = 31 * result + mRxFilterLength;
         result = 31 * result + Arrays.hashCode(mRxFilter);
         result = 31 * result + mSubscribeType;
         result = 31 * result + mSubscribeCount;
@@ -318,24 +234,11 @@
     public void validate() throws IllegalArgumentException {
         WifiNanUtils.validateServiceName(mServiceName);
 
-        if (mServiceSpecificInfoLength != 0 && (mServiceSpecificInfo == null
-                || mServiceSpecificInfo.length < mServiceSpecificInfoLength)) {
-            throw new IllegalArgumentException("Non-matching combination of "
-                    + "serviceSpecificInfo and serviceSpecificInfoLength");
-        }
-        if (mTxFilterLength != 0 && (mTxFilter == null || mTxFilter.length < mTxFilterLength)) {
-            throw new IllegalArgumentException(
-                    "Non-matching combination of txFilter and txFilterLength");
-        }
-        if (!TlvBufferUtils.isValid(mTxFilter, mTxFilterLength, 0, 1)) {
+        if (!LvBufferUtils.isValid(mTxFilter, 1)) {
             throw new IllegalArgumentException(
                     "Invalid txFilter configuration - LV fields do not match up to length");
         }
-        if (mRxFilterLength != 0 && (mRxFilter == null || mRxFilter.length < mRxFilterLength)) {
-            throw new IllegalArgumentException(
-                    "Non-matching combination of rxFilter and rxFilterLength");
-        }
-        if (!TlvBufferUtils.isValid(mRxFilter, mRxFilterLength, 0, 1)) {
+        if (!LvBufferUtils.isValid(mRxFilter, 1)) {
             throw new IllegalArgumentException(
                     "Invalid rxFilter configuration - LV fields do not match up to length");
         }
@@ -352,11 +255,13 @@
             throw new IllegalArgumentException(
                     "Invalid matchType - must be MATCH_FIRST_ONLY or MATCH_ALL");
         }
-        if (mSubscribeType == SubscribeConfig.SUBSCRIBE_TYPE_ACTIVE && mRxFilterLength != 0) {
+        if (mSubscribeType == SubscribeConfig.SUBSCRIBE_TYPE_ACTIVE && mRxFilter != null
+                && mRxFilter.length != 0) {
             throw new IllegalArgumentException(
                     "Invalid subscribe config: ACTIVE subscribes can't have an Rx filter");
         }
-        if (mSubscribeType == SubscribeConfig.SUBSCRIBE_TYPE_PASSIVE && mTxFilterLength != 0) {
+        if (mSubscribeType == SubscribeConfig.SUBSCRIBE_TYPE_PASSIVE && mTxFilter != null
+                && mTxFilter.length != 0) {
             throw new IllegalArgumentException(
                     "Invalid subscribe config: PASSIVE subscribes can't have a Tx filter");
         }
@@ -367,12 +272,9 @@
      */
     public static final class Builder {
         private byte[] mServiceName;
-        private int mServiceSpecificInfoLength;
-        private byte[] mServiceSpecificInfo = new byte[0];
-        private int mTxFilterLength;
-        private byte[] mTxFilter = new byte[0];
-        private int mRxFilterLength;
-        private byte[] mRxFilter = new byte[0];
+        private byte[] mServiceSpecificInfo;
+        private byte[] mTxFilter;
+        private byte[] mRxFilter;
         private int mSubscribeType = SUBSCRIBE_TYPE_PASSIVE;
         private int mSubscribeCount = 0;
         private int mTtlSec = 0;
@@ -409,19 +311,10 @@
          *
          * @param serviceSpecificInfo A byte-array for the service-specific
          *            information field.
-         * @param serviceSpecificInfoLength The length of the byte-array to be
-         *            used.
          * @return The builder to facilitate chaining
          *         {@code builder.setXXX(..).setXXX(..)}.
          */
-        public Builder setServiceSpecificInfo(byte[] serviceSpecificInfo,
-                int serviceSpecificInfoLength) {
-            if (serviceSpecificInfoLength != 0 && (serviceSpecificInfo == null
-                    || serviceSpecificInfo.length < serviceSpecificInfoLength)) {
-                throw new IllegalArgumentException("Non-matching combination of "
-                        + "serviceSpecificInfo and serviceSpecificInfoLength");
-            }
-            mServiceSpecificInfoLength = serviceSpecificInfoLength;
+        public Builder setServiceSpecificInfo(@Nullable byte[] serviceSpecificInfo) {
             mServiceSpecificInfo = serviceSpecificInfo;
             return this;
         }
@@ -429,7 +322,7 @@
         /**
          * Specify service specific information for the subscribe session - same
          * as
-         * {@link SubscribeConfig.Builder#setServiceSpecificInfo(byte[], int)}
+         * {@link SubscribeConfig.Builder#setServiceSpecificInfo(byte[])}
          * but obtaining the data from a String.
          *
          * @param serviceSpecificInfoStr The service specific information string
@@ -440,7 +333,6 @@
          */
         public Builder setServiceSpecificInfo(@NonNull String serviceSpecificInfoStr) {
             mServiceSpecificInfo = serviceSpecificInfoStr.getBytes();
-            mServiceSpecificInfoLength = mServiceSpecificInfo.length;
             return this;
         }
 
@@ -452,23 +344,16 @@
          * publishers) to determine whether they match - in addition to just
          * relying on the service name.
          * <p>
-         * Format is an LV byte array - the {@link TlvBufferUtils} utility class
+         * Format is an LV byte array - the {@link LvBufferUtils} utility class
          * is available to form and parse.
          *
          * @param txFilter The byte-array containing the LV formatted transmit
          *            filter.
-         * @param txFilterLength The number of bytes in the transmit filter
-         *            argument.
          * @return The builder to facilitate chaining
          *         {@code builder.setXXX(..).setXXX(..)}.
          */
-        public Builder setTxFilter(byte[] txFilter, int txFilterLength) {
-            if (txFilterLength != 0 && (txFilter == null || txFilter.length < txFilterLength)) {
-                throw new IllegalArgumentException(
-                        "Non-matching combination of txFilter and txFilterLength");
-            }
+        public Builder setTxFilter(@Nullable byte[] txFilter) {
             mTxFilter = txFilter;
-            mTxFilterLength = txFilterLength;
             return this;
         }
 
@@ -479,23 +364,16 @@
          * subscriber to determine whether they match transmitted publish
          * packets - in addition to just relying on the service name.
          * <p>
-         * Format is an LV byte array - the {@link TlvBufferUtils} utility class
+         * Format is an LV byte array - the {@link LvBufferUtils} utility class
          * is available to form and parse.
          *
          * @param rxFilter The byte-array containing the LV formatted receive
          *            filter.
-         * @param rxFilterLength The number of bytes in the receive filter
-         *            argument.
          * @return The builder to facilitate chaining
          *         {@code builder.setXXX(..).setXXX(..)}.
          */
-        public Builder setRxFilter(byte[] rxFilter, int rxFilterLength) {
-            if (rxFilterLength != 0 && (rxFilter == null || rxFilter.length < rxFilterLength)) {
-                throw new IllegalArgumentException(
-                        "Non-matching combination of rxFilter and rxFilterLength");
-            }
+        public Builder setRxFilter(@Nullable byte[] rxFilter) {
             mRxFilter = rxFilter;
-            mRxFilterLength = rxFilterLength;
             return this;
         }
 
@@ -563,7 +441,7 @@
          * Sets the match style of the subscription - how are matches from a
          * single match session (corresponding to the same publish action on the
          * peer) reported to the host (using the
-         * {@link WifiNanSessionCallback#onMatch(int, byte[], int, byte[], int)}
+         * {@link WifiNanSessionCallback#onMatch(int, byte[], byte[])}
          * ). The options are: only report the first match and ignore the rest
          * {@link SubscribeConfig#MATCH_STYLE_FIRST_ONLY} or report every single
          * match {@link SubscribeConfig#MATCH_STYLE_ALL}.
@@ -601,9 +479,8 @@
          * builder.
          */
         public SubscribeConfig build() {
-            return new SubscribeConfig(mServiceName, mServiceSpecificInfo,
-                    mServiceSpecificInfoLength, mTxFilter, mTxFilterLength, mRxFilter,
-                    mRxFilterLength, mSubscribeType, mSubscribeCount, mTtlSec, mMatchStyle,
+            return new SubscribeConfig(mServiceName, mServiceSpecificInfo, mTxFilter, mRxFilter,
+                    mSubscribeType, mSubscribeCount, mTtlSec, mMatchStyle,
                     mEnableTerminateNotification);
         }
     }
diff --git a/wifi/java/android/net/wifi/nan/TlvBufferUtils.java b/wifi/java/android/net/wifi/nan/TlvBufferUtils.java
index da7ecd8..2c5aab4 100644
--- a/wifi/java/android/net/wifi/nan/TlvBufferUtils.java
+++ b/wifi/java/android/net/wifi/nan/TlvBufferUtils.java
@@ -16,11 +16,15 @@
 
 package android.net.wifi.nan;
 
+import android.annotation.Nullable;
+
 import libcore.io.Memory;
 
 import java.nio.BufferOverflowException;
 import java.nio.ByteOrder;
+import java.util.Arrays;
 import java.util.Iterator;
+import java.util.NoSuchElementException;
 
 /**
  * Utility class to construct and parse byte arrays using the TLV format -
@@ -50,8 +54,7 @@
      * Values are added to the structure using the {@code TlvConstructor.put*()}
      * methods.
      * <p>
-     * The final byte array is obtained using {@link TlvConstructor#getArray()}
-     * and {@link TlvConstructor#getActualLength()} methods.
+     * The final byte array is obtained using {@link TlvConstructor#getArray()}.
      */
     public static class TlvConstructor {
         private int mTypeSize;
@@ -88,9 +91,9 @@
          * @return The constructor to facilitate chaining
          *         {@code ctr.putXXX(..).putXXX(..)}.
          */
-        public TlvConstructor wrap(byte[] array) {
+        public TlvConstructor wrap(@Nullable byte[] array) {
             mArray = array;
-            mArrayLength = array.length;
+            mArrayLength = (array == null) ? 0 : array.length;
             return this;
         }
 
@@ -137,10 +140,13 @@
          * @return The constructor to facilitate chaining
          *         {@code ctr.putXXX(..).putXXX(..)}.
          */
-        public TlvConstructor putByteArray(int type, byte[] array, int offset, int length) {
+        public TlvConstructor putByteArray(int type, @Nullable byte[] array, int offset,
+                int length) {
             checkLength(length);
             addHeader(type, length);
-            System.arraycopy(array, offset, mArray, mPosition, length);
+            if (length != 0) {
+                System.arraycopy(array, offset, mArray, mPosition, length);
+            }
             mPosition += length;
             return this;
         }
@@ -155,8 +161,8 @@
          * @return The constructor to facilitate chaining
          *         {@code ctr.putXXX(..).putXXX(..)}.
          */
-        public TlvConstructor putByteArray(int type, byte[] array) {
-            return putByteArray(type, array, 0, array.length);
+        public TlvConstructor putByteArray(int type, @Nullable byte[] array) {
+            return putByteArray(type, array, 0, (array == null) ? 0 : array.length);
         }
 
         /**
@@ -223,24 +229,25 @@
          * @return The constructor to facilitate chaining
          *         {@code ctr.putXXX(..).putXXX(..)}.
          */
-        public TlvConstructor putString(int type, String data) {
-            byte[] bytes = data.getBytes();
-            return putByteArray(type, bytes, 0, bytes.length);
+        public TlvConstructor putString(int type, @Nullable String data) {
+            byte[] bytes = null;
+            int length = 0;
+            if (data != null) {
+                bytes = data.getBytes();
+                length = bytes.length;
+            }
+            return putByteArray(type, bytes, 0, length);
         }
 
         /**
-         * Returns the constructed TLV formatted byte-array. Note that the
-         * returned array is the fully wrapped (
-         * {@link TlvConstructor#wrap(byte[])}) or allocated (
-         * {@link TlvConstructor#allocate(int)}) array - which isn't necessarily
-         * the actual size of the formatted data. Use
-         * {@link TlvConstructor#getActualLength()} to obtain the size of the
-         * formatted data.
+         * Returns the constructed TLV formatted byte-array. This array is a copy of the wrapped
+         * or allocated array - truncated to just the significant bytes - i.e. those written into
+         * the (T)LV.
          *
          * @return The byte array containing the TLV formatted structure.
          */
         public byte[] getArray() {
-            return mArray;
+            return Arrays.copyOf(mArray, getActualLength());
         }
 
         /**
@@ -250,7 +257,7 @@
          *
          * @return The size of the TLV formatted portion of the byte array.
          */
-        public int getActualLength() {
+        private int getActualLength() {
             return mPosition;
         }
 
@@ -288,75 +295,75 @@
          * formatted byte-arrays (i.e. TLV whose Type/T size is 0) the value of
          * this field is undefined.
          */
-        public int mType;
+        public int type;
 
         /**
          * The Length (L) field of the current TLV element.
          */
-        public int mLength;
+        public int length;
 
         /**
          * The Value (V) field - a raw byte array representing the current TLV
-         * element where the entry starts at {@link TlvElement#mOffset}.
+         * element where the entry starts at {@link TlvElement#offset}.
          */
-        public byte[] mRefArray;
+        public byte[] refArray;
 
         /**
-         * The offset to be used into {@link TlvElement#mRefArray} to access the
+         * The offset to be used into {@link TlvElement#refArray} to access the
          * raw data representing the current TLV element.
          */
-        public int mOffset;
+        public int offset;
 
-        private TlvElement(int type, int length, byte[] refArray, int offset) {
-            mType = type;
-            mLength = length;
-            mRefArray = refArray;
-            mOffset = offset;
+        private TlvElement(int type, int length, @Nullable byte[] refArray, int offset) {
+            this.type = type;
+            this.length = length;
+            this.refArray = refArray;
+            this.offset = offset;
         }
 
         /**
          * Utility function to return a byte representation of a TLV element of
          * length 1. Note: an attempt to call this function on a TLV item whose
-         * {@link TlvElement#mLength} is != 1 will result in an exception.
+         * {@link TlvElement#length} is != 1 will result in an exception.
          *
          * @return byte representation of current TLV element.
          */
         public byte getByte() {
-            if (mLength != 1) {
+            if (length != 1) {
                 throw new IllegalArgumentException(
-                        "Accesing a byte from a TLV element of length " + mLength);
+                        "Accesing a byte from a TLV element of length " + length);
             }
-            return mRefArray[mOffset];
+            return refArray[offset];
         }
 
         /**
          * Utility function to return a short representation of a TLV element of
          * length 2. Note: an attempt to call this function on a TLV item whose
-         * {@link TlvElement#mLength} is != 2 will result in an exception.
+         * {@link TlvElement#length} is != 2 will result in an exception.
          *
          * @return short representation of current TLV element.
          */
         public short getShort() {
-            if (mLength != 2) {
+            if (length != 2) {
                 throw new IllegalArgumentException(
-                        "Accesing a short from a TLV element of length " + mLength);
+                        "Accesing a short from a TLV element of length " + length);
             }
-            return Memory.peekShort(mRefArray, mOffset, ByteOrder.BIG_ENDIAN);
+            return Memory.peekShort(refArray, offset, ByteOrder.BIG_ENDIAN);
         }
 
         /**
          * Utility function to return an integer representation of a TLV element
          * of length 4. Note: an attempt to call this function on a TLV item
-         * whose {@link TlvElement#mLength} is != 4 will result in an exception.
+         * whose {@link TlvElement#length} is != 4 will result in an exception.
          *
          * @return integer representation of current TLV element.
          */
         public int getInt() {
-            if (mLength != 4) {
+            if (length != 4) {
                 throw new IllegalArgumentException(
-                        "Accesing an int from a TLV element of length " + mLength);
+                        "Accesing an int from a TLV element of length " + length);
             }
-            return Memory.peekInt(mRefArray, mOffset, ByteOrder.BIG_ENDIAN);
+            return Memory.peekInt(refArray, offset, ByteOrder.BIG_ENDIAN);
         }
 
         /**
@@ -365,7 +372,7 @@
          * @return String repersentation of the current TLV element.
          */
         public String getString() {
-            return new String(mRefArray, mOffset, mLength);
+            return new String(refArray, offset, length);
         }
     }
 
@@ -389,10 +396,8 @@
          * @param lengthSize Number of bytes sued for the Length (L) field.
          *            Values values are 1 or 2 bytes.
          * @param array The TLV formatted byte-array to parse.
-         * @param length The number of bytes of the array to be used in the
-         *            parsing.
          */
-        public TlvIterable(int typeSize, int lengthSize, byte[] array, int length) {
+        public TlvIterable(int typeSize, int lengthSize, @Nullable byte[] array) {
             if (typeSize < 0 || typeSize > 2 || lengthSize <= 0 || lengthSize > 2) {
                 throw new IllegalArgumentException(
                         "Invalid sizes - typeSize=" + typeSize + ", lengthSize=" + lengthSize);
@@ -400,7 +405,7 @@
             mTypeSize = typeSize;
             mLengthSize = lengthSize;
             mArray = array;
-            mArrayLength = length;
+            mArrayLength = (array == null) ? 0 : array.length;
         }
 
         /**
@@ -421,21 +426,21 @@
                 first = false;
                 builder.append(" (");
                 if (mTypeSize != 0) {
-                    builder.append("T=" + tlv.mType + ",");
+                    builder.append("T=" + tlv.type + ",");
                 }
-                builder.append("L=" + tlv.mLength + ") ");
-                if (tlv.mLength == 0) {
+                builder.append("L=" + tlv.length + ") ");
+                if (tlv.length == 0) {
                     builder.append("<null>");
-                } else if (tlv.mLength == 1) {
+                } else if (tlv.length == 1) {
                     builder.append(tlv.getByte());
-                } else if (tlv.mLength == 2) {
+                } else if (tlv.length == 2) {
                     builder.append(tlv.getShort());
-                } else if (tlv.mLength == 4) {
+                } else if (tlv.length == 4) {
                     builder.append(tlv.getInt());
                 } else {
                     builder.append("<bytes>");
                 }
-                if (tlv.mLength != 0) {
+                if (tlv.length != 0) {
                     builder.append(" (S='" + tlv.getString() + "')");
                 }
             }
@@ -460,6 +465,10 @@
 
                 @Override
                 public TlvElement next() {
+                    if (!hasNext()) {
+                        throw new NoSuchElementException();
+                    }
+
                     int type = 0;
                     if (mTypeSize == 1) {
                         type = mArray[mOffset];
@@ -494,12 +503,11 @@
      * fields correctly fill the specified length (and do not overshoot).
      *
      * @param array The (T)LV array to verify.
-     * @param length The number of bytes in the array to consider (starting at offset 0).
      * @param typeSize The size (in bytes) of the type field. Valid values are 0, 1, or 2.
      * @param lengthSize The size (in bytes) of the length field. Valid values are 1 or 2.
      * @return A boolean indicating whether the array is valid (true) or invalid (false).
      */
-    public static boolean isValid(byte[] array, int length, int typeSize, int lengthSize) {
+    public static boolean isValid(@Nullable byte[] array, int typeSize, int lengthSize) {
         if (typeSize < 0 || typeSize > 2) {
             throw new IllegalArgumentException(
                     "Invalid arguments - typeSize must be 0, 1, or 2: typeSize=" + typeSize);
@@ -508,14 +516,12 @@
             throw new IllegalArgumentException(
                     "Invalid arguments - lengthSize must be 1 or 2: lengthSize=" + lengthSize);
         }
-        if (length < 0 || length > array.length) {
-            throw new IllegalArgumentException(
-                    "Invalid arguments - length must be non-negative and <= array.length: length="
-                            + length + ", array.length=" + array.length);
+        if (array == null) {
+            return true;
         }
 
         int nextTlvIndex = 0;
-        while (nextTlvIndex + typeSize + lengthSize <= length) {
+        while (nextTlvIndex + typeSize + lengthSize <= array.length) {
             nextTlvIndex += typeSize;
             if (lengthSize == 1) {
                 nextTlvIndex += lengthSize + array[nextTlvIndex];
@@ -525,6 +531,6 @@
             }
         }
 
-        return nextTlvIndex == length;
+        return nextTlvIndex == array.length;
     }
 }
diff --git a/wifi/java/android/net/wifi/nan/WifiNanManager.java b/wifi/java/android/net/wifi/nan/WifiNanManager.java
index a58cdb7..ff612fe7 100644
--- a/wifi/java/android/net/wifi/nan/WifiNanManager.java
+++ b/wifi/java/android/net/wifi/nan/WifiNanManager.java
@@ -22,6 +22,8 @@
 import android.annotation.SdkConstant;
 import android.annotation.SdkConstant.SdkConstantType;
 import android.annotation.SystemApi;
+import android.net.ConnectivityManager;
+import android.net.NetworkRequest;
 import android.net.wifi.RttManager;
 import android.os.Binder;
 import android.os.Bundle;
@@ -205,15 +207,15 @@
 
     /**
      * Data-path creation role is that of INITIATOR. Used in
-     * {@link #createNetworkSpecifier(int, byte[], byte[], int)} and
-     * {@link WifiNanSession#createNetworkSpecifier(int, int, byte[], int)}.
+     * {@link #createNetworkSpecifier(int, byte[], byte[])} and
+     * {@link WifiNanSession#createNetworkSpecifier(int, int, byte[])}.
      */
     public static final int WIFI_NAN_DATA_PATH_ROLE_INITIATOR = 0;
 
     /**
      * Data-path creation role is that of RESPONDER. Used in
-     * {@link #createNetworkSpecifier(int, byte[], byte[], int)} and
-     * {@link WifiNanSession#createNetworkSpecifier(int, int, byte[], int)}.
+     * {@link #createNetworkSpecifier(int, byte[], byte[])} and
+     * {@link WifiNanSession#createNetworkSpecifier(int, int, byte[])}.
      */
 
     public static final int WIFI_NAN_DATA_PATH_ROLE_RESPONDER = 1;
@@ -524,12 +526,11 @@
     /**
      * {@hide}
      */
-    public void sendMessage(int sessionId, int peerId, byte[] message, int messageLength,
-            int messageId, int retryCount) {
+    public void sendMessage(int sessionId, int peerId, byte[] message, int messageId,
+            int retryCount) {
         if (VDBG) {
             Log.v(TAG, "sendMessage(): sessionId=" + sessionId + ", peerId=" + peerId
-                    + ", messageLength=" + messageLength + ", messageId=" + messageId
-                    + ", retryCount=" + retryCount);
+                    + ", messageId=" + messageId + ", retryCount=" + retryCount);
         }
 
         int clientId;
@@ -543,8 +544,7 @@
         }
 
         try {
-            mService.sendMessage(clientId, sessionId, peerId, message, messageLength, messageId,
-                    retryCount);
+            mService.sendMessage(clientId, sessionId, peerId, message, messageId, retryCount);
         } catch (RemoteException e) {
             e.rethrowFromSystemServer();
         }
@@ -587,10 +587,10 @@
      * {@hide}
      */
     public String createNetworkSpecifier(@DataPathRole int role, int sessionId, int peerId,
-            byte[] token, int tokenLength) {
+            byte[] token) {
         if (VDBG) {
             Log.v(TAG, "createNetworkSpecifier: role=" + role + ", sessionId=" + sessionId
-                    + ", peerId=" + peerId + ", token=" + token + ", tokenLength=" + tokenLength);
+                    + ", peerId=" + peerId + ", token=" + token);
         }
 
         int type;
@@ -621,10 +621,6 @@
                                 + "INITIATOR");
             }
         }
-        if (tokenLength != 0 && (token == null || token.length < tokenLength)) {
-            throw new IllegalArgumentException(
-                    "Non-matching combination of token and tokenLength");
-        }
 
         int clientId;
         synchronized (mLock) {
@@ -650,7 +646,7 @@
             }
             if (token != null) {
                 json.put(NETWORK_SPECIFIER_KEY_TOKEN,
-                        Base64.encodeToString(token, 0, tokenLength, Base64.DEFAULT));
+                        Base64.encodeToString(token, 0, token.length, Base64.DEFAULT));
             }
         } catch (JSONException e) {
             return "";
@@ -674,19 +670,15 @@
      *              data-path setup process. On the RESPONDER a null token is permitted and
      *              matches any peer token - an empty token requires the peer token to be empty
      *              as well.
-     * @param tokenLength The number of significant (usable) bytes from the {@code token} parameter.
      * @return A string to be used to construct
      * {@link android.net.NetworkRequest.Builder#setNetworkSpecifier(String)} to pass to {@link
-     * android.net.ConnectivityManager#requestNetwork(NetworkRequest,
-     * ConnectivityManager.NetworkCallback)}
-     * [or other varierties of that API].
+     * android.net.ConnectivityManager#requestNetwork(NetworkRequest, ConnectivityManager.NetworkCallback)}
+     * [or other varieties of that API].
      */
     public String createNetworkSpecifier(@DataPathRole int role, @Nullable byte[] peer,
-            @Nullable byte[] token, int tokenLength) {
+            @Nullable byte[] token) {
         if (VDBG) {
-            Log.v(TAG,
-                    "createNetworkSpecifier: role=" + role + ", token=" + token + ", tokenLength="
-                            + tokenLength);
+            Log.v(TAG, "createNetworkSpecifier: role=" + role + ", token=" + token);
         }
 
         int type;
@@ -721,10 +713,6 @@
                         "createNetworkSpecifier: Invalid peer MAC address");
             }
         }
-        if (tokenLength != 0 && (token == null || token.length < tokenLength)) {
-            throw new IllegalArgumentException(
-                    "Non-matching combination of token and tokenLength");
-        }
 
         int clientId;
         synchronized (mLock) {
@@ -749,7 +737,7 @@
             }
             if (token != null) {
                 json.put(NETWORK_SPECIFIER_KEY_TOKEN,
-                        Base64.encodeToString(token, 0, tokenLength, Base64.DEFAULT));
+                        Base64.encodeToString(token, 0, token.length, Base64.DEFAULT));
             }
         } catch (JSONException e) {
             return "";
@@ -932,7 +920,6 @@
         private static final int CALLBACK_MESSAGE_SEND_FAIL = 6;
         private static final int CALLBACK_MESSAGE_RECEIVED = 7;
 
-        private static final String MESSAGE_BUNDLE_KEY_PEER_ID = "peer_id";
         private static final String MESSAGE_BUNDLE_KEY_MESSAGE = "message";
         private static final String MESSAGE_BUNDLE_KEY_MESSAGE2 = "message2";
 
@@ -983,11 +970,9 @@
                             break;
                         case CALLBACK_MATCH:
                             mOriginalCallback.onMatch(
-                                    msg.getData().getInt(MESSAGE_BUNDLE_KEY_PEER_ID),
-                                    msg.getData().getByteArray(MESSAGE_BUNDLE_KEY_MESSAGE),
                                     msg.arg1,
-                                    msg.getData().getByteArray(MESSAGE_BUNDLE_KEY_MESSAGE2),
-                                    msg.arg2);
+                                    msg.getData().getByteArray(MESSAGE_BUNDLE_KEY_MESSAGE),
+                                    msg.getData().getByteArray(MESSAGE_BUNDLE_KEY_MESSAGE2));
                             break;
                         case CALLBACK_MESSAGE_SEND_SUCCESS:
                             mOriginalCallback.onMessageSendSuccess(msg.arg1);
@@ -996,9 +981,7 @@
                             mOriginalCallback.onMessageSendFail(msg.arg1, msg.arg2);
                             break;
                         case CALLBACK_MESSAGE_RECEIVED:
-                            mOriginalCallback.onMessageReceived(msg.arg2,
-                                    msg.getData().getByteArray(MESSAGE_BUNDLE_KEY_MESSAGE),
-                                    msg.arg1);
+                            mOriginalCallback.onMessageReceived(msg.arg1, (byte[]) msg.obj);
                             break;
                     }
                 }
@@ -1041,18 +1024,15 @@
         }
 
         @Override
-        public void onMatch(int peerId, byte[] serviceSpecificInfo,
-                int serviceSpecificInfoLength, byte[] matchFilter, int matchFilterLength) {
+        public void onMatch(int peerId, byte[] serviceSpecificInfo, byte[] matchFilter) {
             if (VDBG) Log.v(TAG, "onMatch: peerId=" + peerId);
 
             Bundle data = new Bundle();
-            data.putInt(MESSAGE_BUNDLE_KEY_PEER_ID, peerId);
             data.putByteArray(MESSAGE_BUNDLE_KEY_MESSAGE, serviceSpecificInfo);
             data.putByteArray(MESSAGE_BUNDLE_KEY_MESSAGE2, matchFilter);
 
             Message msg = mHandler.obtainMessage(CALLBACK_MATCH);
-            msg.arg1 = serviceSpecificInfoLength;
-            msg.arg2 = matchFilterLength;
+            msg.arg1 = peerId;
             msg.setData(data);
             mHandler.sendMessage(msg);
         }
@@ -1077,19 +1057,14 @@
         }
 
         @Override
-        public void onMessageReceived(int peerId, byte[] message, int messageLength) {
+        public void onMessageReceived(int peerId, byte[] message) {
             if (VDBG) {
-                Log.v(TAG, "onMessageReceived: peerId='" + peerId + "', messageLength="
-                        + messageLength);
+                Log.v(TAG, "onMessageReceived: peerId='" + peerId);
             }
 
-            Bundle data = new Bundle();
-            data.putByteArray(MESSAGE_BUNDLE_KEY_MESSAGE, message);
-
             Message msg = mHandler.obtainMessage(CALLBACK_MESSAGE_RECEIVED);
-            msg.arg1 = messageLength;
-            msg.arg2 = peerId;
-            msg.setData(data);
+            msg.arg1 = peerId;
+            msg.obj = message;
             mHandler.sendMessage(msg);
         }
 
diff --git a/wifi/java/android/net/wifi/nan/WifiNanSession.java b/wifi/java/android/net/wifi/nan/WifiNanSession.java
index 8eb2f89..c10cd52 100644
--- a/wifi/java/android/net/wifi/nan/WifiNanSession.java
+++ b/wifi/java/android/net/wifi/nan/WifiNanSession.java
@@ -108,12 +108,11 @@
     /**
      * Sends a message to the specified destination. Message transmission is part of the current
      * discovery session - i.e. executed subsequent to a publish/subscribe
-     * {@link WifiNanSessionCallback#onMatch(int, byte[], int, byte[], int)} event.
+     * {@link WifiNanSessionCallback#onMatch(int, byte[], byte[])} event.
      *
      * @param peerId The peer's ID for the message. Must be a result of an
-     *            {@link WifiNanSessionCallback#onMatch(int, byte[], int, byte[], int)} event.
+     *            {@link WifiNanSessionCallback#onMatch(int, byte[], byte[])} event.
      * @param message The message to be transmitted.
-     * @param messageLength The number of bytes from the {@code message} to be transmitted.
      * @param messageId An arbitrary integer used by the caller to identify the message. The same
      *            integer ID will be returned in the callbacks indicated message send success or
      *            failure.
@@ -122,8 +121,7 @@
      *            (note: no retransmissions are attempted in other failure cases). A value of 0
      *            indicates no retries. Max possible value is {@link #MAX_SEND_RETRY_COUNT}.
      */
-    public void sendMessage(int peerId, byte[] message, int messageLength, int messageId,
-            int retryCount) {
+    public void sendMessage(int peerId, @Nullable byte[] message, int messageId, int retryCount) {
         if (mTerminated) {
             Log.w(TAG, "sendMessage: called on terminated session");
             return;
@@ -134,33 +132,32 @@
                 return;
             }
 
-            mgr.sendMessage(mSessionId, peerId, message, messageLength, messageId, retryCount);
+            mgr.sendMessage(mSessionId, peerId, message, messageId, retryCount);
         }
     }
 
     /**
      * Sends a message to the specified destination. Message transmission is part of the current
      * discovery session - i.e. executed subsequent to a publish/subscribe
-     * {@link WifiNanSessionCallback#onMatch(int, byte[], int, byte[], int)} event. This is
-     * equivalent to {@link #sendMessage(int, byte[], int, int, int)} with a {@code retryCount} of
+     * {@link WifiNanSessionCallback#onMatch(int, byte[], byte[])} event. This is
+     * equivalent to {@link #sendMessage(int, byte[], int, int)} with a {@code retryCount} of
      * 0.
      *
      * @param peerId The peer's ID for the message. Must be a result of an
-     *            {@link WifiNanSessionCallback#onMatch(int, byte[], int, byte[], int)} event.
+     *            {@link WifiNanSessionCallback#onMatch(int, byte[], byte[])} event.
      * @param message The message to be transmitted.
-     * @param messageLength The number of bytes from the {@code message} to be transmitted.
      * @param messageId An arbitrary integer used by the caller to identify the message. The same
      *            integer ID will be returned in the callbacks indicated message send success or
      *            failure.
      */
-    public void sendMessage(int peerId, byte[] message, int messageLength, int messageId) {
-        sendMessage(peerId, message, messageLength, messageId, 0);
+    public void sendMessage(int peerId, @Nullable byte[] message, int messageId) {
+        sendMessage(peerId, message, messageId, 0);
     }
 
     /**
      * Start a ranging operation with the specified peers. The peer IDs are obtained from an
-     * {@link WifiNanSessionCallback#onMatch(int, byte[], int, byte[], int)} or
-     * {@link WifiNanSessionCallback#onMessageReceived(int, byte[], int)} operation - i.e. can only
+     * {@link WifiNanSessionCallback#onMatch(int, byte[], byte[])} or
+     * {@link WifiNanSessionCallback#onMessageReceived(int, byte[])} operation - i.e. can only
      * range devices which are part of an ongoing discovery session.
      *
      * @param params   RTT parameters - each corresponding to a specific peer ID (the array sizes
@@ -194,22 +191,20 @@
      * {@link WifiNanManager#WIFI_NAN_DATA_PATH_ROLE_INITIATOR} or
      * {@link WifiNanManager#WIFI_NAN_DATA_PATH_ROLE_RESPONDER}
      * @param peerId The peer ID obtained through
-     * {@link WifiNanSessionCallback#onMatch(int, byte[], int, byte[], int)} or
-     * {@link WifiNanSessionCallback#onMessageReceived(int, byte[], int)}. On the RESPONDER a
+     * {@link WifiNanSessionCallback#onMatch(int, byte[], byte[])} or
+     * {@link WifiNanSessionCallback#onMessageReceived(int, byte[])}. On the RESPONDER a
      *               value of 0 is permitted which matches any peer.
      * @param token An arbitrary token (message) to be passed to the peer as part of the
      *              data-path setup process. On the RESPONDER a null token is permitted and
      *              matches any peer token - an empty token requires the peer token to be empty
      *              as well.
-     * @param tokenLength The number of significant (usable) bytes from the {@code token} parameter.
      * @return A string to be used to construct
      * {@link android.net.NetworkRequest.Builder#setNetworkSpecifier(String)} to pass to {@link
      * android.net.ConnectivityManager#requestNetwork(NetworkRequest,
-     * ConnectivityManager.NetworkCallback)}
-     * [or other varierties of that API].
+     * ConnectivityManager.NetworkCallback)} [or other varieties of that API].
      */
     public String createNetworkSpecifier(@WifiNanManager.DataPathRole int role, int peerId,
-            @Nullable byte[] token, int tokenLength) {
+            @Nullable byte[] token) {
         if (mTerminated) {
             Log.w(TAG, "createNetworkSpecifier: called on terminated session");
             return null;
@@ -220,7 +215,7 @@
                 return null;
             }
 
-            return mgr.createNetworkSpecifier(role, mSessionId, peerId, token, tokenLength);
+            return mgr.createNetworkSpecifier(role, mSessionId, peerId, token);
         }
     }
 }
diff --git a/wifi/java/android/net/wifi/nan/WifiNanSessionCallback.java b/wifi/java/android/net/wifi/nan/WifiNanSessionCallback.java
index b1f4100..f2337dd 100644
--- a/wifi/java/android/net/wifi/nan/WifiNanSessionCallback.java
+++ b/wifi/java/android/net/wifi/nan/WifiNanSessionCallback.java
@@ -156,14 +156,10 @@
      * @param serviceSpecificInfo The service specific information (arbitrary
      *            byte array) provided by the peer as part of its discovery
      *            packet.
-     * @param serviceSpecificInfoLength The length of the service specific
-     *            information array.
      * @param matchFilter The filter (Tx on advertiser and Rx on listener) which
      *            resulted in this match.
-     * @param matchFilterLength The length of the match filter array.
      */
-    public void onMatch(int peerId, byte[] serviceSpecificInfo,
-            int serviceSpecificInfoLength, byte[] matchFilter, int matchFilterLength) {
+    public void onMatch(int peerId, byte[] serviceSpecificInfo, byte[] matchFilter) {
         /* empty */
     }
 
@@ -204,10 +200,8 @@
      *
      * @param peerId The ID of the peer sending the message.
      * @param message A byte array containing the message.
-     * @param messageLength The length of the byte array containing the relevant
-     *            message bytes.
      */
-    public void onMessageReceived(int peerId, byte[] message, int messageLength) {
+    public void onMessageReceived(int peerId, byte[] message) {
         /* empty */
     }
 }