am d1d07432: Merge "More debug logs for RSSI updates." into ics-factoryrom

* commit 'd1d074326d81b6a92cff5a5fc279b8c9177cc7aa':
  More debug logs for RSSI updates.
diff --git a/build/phone-xhdpi-1024-dalvik-heap.mk b/build/phone-xhdpi-1024-dalvik-heap.mk
new file mode 100644
index 0000000..f76535a
--- /dev/null
+++ b/build/phone-xhdpi-1024-dalvik-heap.mk
@@ -0,0 +1,22 @@
+#
+# Copyright (C) 2011 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.
+#
+
+# Provides overrides to configure the Dalvik heap for a standard tablet device.
+
+PRODUCT_PROPERTY_OVERRIDES += \
+    dalvik.vm.heapstartsize=8m \
+    dalvik.vm.heapgrowthlimit=64m \
+    dalvik.vm.heapsize=256m
diff --git a/core/java/android/app/ActivityThread.java b/core/java/android/app/ActivityThread.java
index 2c2a493..0776e10 100644
--- a/core/java/android/app/ActivityThread.java
+++ b/core/java/android/app/ActivityThread.java
@@ -153,6 +153,7 @@
     final HashMap<IBinder, Service> mServices
             = new HashMap<IBinder, Service>();
     AppBindData mBoundApplication;
+    Profiler mProfiler;
     Configuration mConfiguration;
     Configuration mCompatConfiguration;
     Configuration mResConfiguration;
@@ -364,10 +365,6 @@
         ApplicationInfo appInfo;
         List<ProviderInfo> providers;
         ComponentName instrumentationName;
-        String profileFile;
-        ParcelFileDescriptor profileFd;
-        boolean autoStopProfiler;
-        boolean profiling;
         Bundle instrumentationArgs;
         IInstrumentationWatcher instrumentationWatcher;
         int debugMode;
@@ -375,10 +372,23 @@
         boolean persistent;
         Configuration config;
         CompatibilityInfo compatInfo;
-        boolean handlingProfiling;
+
+        /** Initial values for {@link Profiler}. */
+        String initProfileFile;
+        ParcelFileDescriptor initProfileFd;
+        boolean initAutoStopProfiler;
+
         public String toString() {
             return "AppBindData{appInfo=" + appInfo + "}";
         }
+    }
+
+    static final class Profiler {
+        String profileFile;
+        ParcelFileDescriptor profileFd;
+        boolean autoStopProfiler;
+        boolean profiling;
+        boolean handlingProfiling;
         public void setProfiler(String file, ParcelFileDescriptor fd) {
             if (profiling) {
                 if (fd != null) {
@@ -661,8 +671,6 @@
             data.appInfo = appInfo;
             data.providers = providers;
             data.instrumentationName = instrumentationName;
-            data.setProfiler(profileFile, profileFd);
-            data.autoStopProfiler = false;
             data.instrumentationArgs = instrumentationArgs;
             data.instrumentationWatcher = instrumentationWatcher;
             data.debugMode = debugMode;
@@ -670,6 +678,9 @@
             data.persistent = persistent;
             data.config = config;
             data.compatInfo = compatInfo;
+            data.initProfileFile = profileFile;
+            data.initProfileFd = profileFd;
+            data.initAutoStopProfiler = false;
             queueOrSendMessage(H.BIND_APPLICATION, data);
         }
 
@@ -1293,8 +1304,8 @@
         public final boolean queueIdle() {
             ActivityClientRecord a = mNewActivities;
             boolean stopProfiling = false;
-            if (mBoundApplication != null && mBoundApplication.profileFd != null
-                    && mBoundApplication.autoStopProfiler) {
+            if (mBoundApplication != null && mProfiler.profileFd != null
+                    && mProfiler.autoStopProfiler) {
                 stopProfiling = true;
             }
             if (a != null) {
@@ -1320,7 +1331,7 @@
                 } while (a != null);
             }
             if (stopProfiling) {
-                mBoundApplication.stopProfiling();
+                mProfiler.stopProfiling();
             }
             ensureJitEnabled();
             return false;
@@ -1635,12 +1646,12 @@
     }
 
     public boolean isProfiling() {
-        return mBoundApplication != null && mBoundApplication.profileFile != null
-                && mBoundApplication.profileFd == null;
+        return mProfiler != null && mProfiler.profileFile != null
+                && mProfiler.profileFd == null;
     }
 
     public String getProfileFilePath() {
-        return mBoundApplication.profileFile;
+        return mProfiler.profileFile;
     }
 
     public Looper getLooper() {
@@ -1679,6 +1690,9 @@
             ContextImpl context = getSystemContext();
             context.init(new LoadedApk(this, "android", context, info,
                     CompatibilityInfo.DEFAULT_COMPATIBILITY_INFO), null, this);
+
+            // give ourselves a default profiler
+            mProfiler = new Profiler();
         }
     }
 
@@ -1947,9 +1961,9 @@
         unscheduleGcIdler();
 
         if (r.profileFd != null) {
-            mBoundApplication.setProfiler(r.profileFile, r.profileFd);
-            mBoundApplication.startProfiling();
-            mBoundApplication.autoStopProfiler = r.autoStopProfiler;
+            mProfiler.setProfiler(r.profileFile, r.profileFd);
+            mProfiler.startProfiling();
+            mProfiler.autoStopProfiler = r.autoStopProfiler;
         }
 
         if (localLOGV) Slog.v(
@@ -3570,10 +3584,10 @@
                     case 1:
                         ViewDebug.startLooperProfiling(pcd.path, pcd.fd.getFileDescriptor());
                         break;
-                    default:
-                        mBoundApplication.setProfiler(pcd.path, pcd.fd);
-                        mBoundApplication.autoStopProfiler = false;
-                        mBoundApplication.startProfiling();
+                    default:                        
+                        mProfiler.setProfiler(pcd.path, pcd.fd);
+                        mProfiler.autoStopProfiler = false;
+                        mProfiler.startProfiling();
                         break;
                 }
             } catch (RuntimeException e) {
@@ -3592,7 +3606,7 @@
                     ViewDebug.stopLooperProfiling();
                     break;
                 default:
-                    mBoundApplication.stopProfiling();
+                    mProfiler.stopProfiling();
                     break;
             }
         }
@@ -3685,6 +3699,11 @@
         mConfiguration = new Configuration(data.config);
         mCompatConfiguration = new Configuration(data.config);
 
+        mProfiler = new Profiler();
+        mProfiler.profileFile = data.initProfileFile;
+        mProfiler.profileFd = data.initProfileFd;
+        mProfiler.autoStopProfiler = data.initAutoStopProfiler;
+
         // send up app name; do this *before* waiting for debugger
         Process.setArgV0(data.processName);
         android.ddm.DdmHandleAppName.setAppName(data.processName);
@@ -3699,8 +3718,8 @@
             }
         }
 
-        if (data.profileFd != null) {
-            data.startProfiling();
+        if (mProfiler.profileFd != null) {
+            mProfiler.startProfiling();
         }
 
         // If the app is Honeycomb MR1 or earlier, switch its AsyncTask
@@ -3841,10 +3860,10 @@
             mInstrumentation.init(this, instrContext, appContext,
                     new ComponentName(ii.packageName, ii.name), data.instrumentationWatcher);
 
-            if (data.profileFile != null && !ii.handleProfiling
-                    && data.profileFd == null) {
-                data.handlingProfiling = true;
-                File file = new File(data.profileFile);
+            if (mProfiler.profileFile != null && !ii.handleProfiling
+                    && mProfiler.profileFd == null) {
+                mProfiler.handlingProfiling = true;
+                File file = new File(mProfiler.profileFile);
                 file.getParentFile().mkdirs();
                 Debug.startMethodTracing(file.toString(), 8 * 1024 * 1024);
             }
@@ -3896,8 +3915,8 @@
 
     /*package*/ final void finishInstrumentation(int resultCode, Bundle results) {
         IActivityManager am = ActivityManagerNative.getDefault();
-        if (mBoundApplication.profileFile != null && mBoundApplication.handlingProfiling
-                && mBoundApplication.profileFd == null) {
+        if (mProfiler.profileFile != null && mProfiler.handlingProfiling
+                && mProfiler.profileFd == null) {
             Debug.stopMethodTracing();
         }
         //Slog.i(TAG, "am: " + ActivityManagerNative.getDefault()
diff --git a/core/java/android/app/SearchManager.java b/core/java/android/app/SearchManager.java
index 5c4cc87..3290b9d 100644
--- a/core/java/android/app/SearchManager.java
+++ b/core/java/android/app/SearchManager.java
@@ -338,7 +338,7 @@
 
     /**
      * Column name for suggestions cursor. <i>Optional.</i> This column may be
-     * used to specify the time in (@link System#currentTimeMillis
+     * used to specify the time in {@link System#currentTimeMillis
      * System.currentTImeMillis()} (wall time in UTC) when an item was last
      * accessed within the results-providing application. If set, this may be
      * used to show more-recently-used items first.
diff --git a/core/java/android/net/DhcpInfoInternal.java b/core/java/android/net/DhcpInfoInternal.java
index 9b0a2d7..fa77bc5 100644
--- a/core/java/android/net/DhcpInfoInternal.java
+++ b/core/java/android/net/DhcpInfoInternal.java
@@ -24,6 +24,7 @@
 import java.net.UnknownHostException;
 import java.util.ArrayList;
 import java.util.Collection;
+import java.util.Collections;
 
 /**
  * A simple object for retrieving the results of a DHCP request.
@@ -41,14 +42,18 @@
     public String serverAddress;
     public int leaseDuration;
 
-    private Collection<RouteInfo> routes;
+    private Collection<RouteInfo> mRoutes;
 
     public DhcpInfoInternal() {
-        routes = new ArrayList<RouteInfo>();
+        mRoutes = new ArrayList<RouteInfo>();
     }
 
     public void addRoute(RouteInfo routeInfo) {
-        routes.add(routeInfo);
+        mRoutes.add(routeInfo);
+    }
+
+    public Collection<RouteInfo> getRoutes() {
+        return Collections.unmodifiableCollection(mRoutes);
     }
 
     private int convertToInt(String addr) {
@@ -66,7 +71,7 @@
     public DhcpInfo makeDhcpInfo() {
         DhcpInfo info = new DhcpInfo();
         info.ipAddress = convertToInt(ipAddress);
-        for (RouteInfo route : routes) {
+        for (RouteInfo route : mRoutes) {
             if (route.isDefaultRoute()) {
                 info.gateway = convertToInt(route.getGateway().getHostAddress());
                 break;
@@ -94,14 +99,14 @@
     public LinkProperties makeLinkProperties() {
         LinkProperties p = new LinkProperties();
         p.addLinkAddress(makeLinkAddress());
-        for (RouteInfo route : routes) {
+        for (RouteInfo route : mRoutes) {
             p.addRoute(route);
         }
+        //if empty, connectivity configures default DNS
         if (TextUtils.isEmpty(dns1) == false) {
             p.addDns(NetworkUtils.numericToInetAddress(dns1));
         } else {
-            p.addDns(NetworkUtils.numericToInetAddress(serverAddress));
-            Log.d(TAG, "empty dns1, use dhcp server as dns1!");
+            Log.d(TAG, "makeLinkProperties with empty dns1!");
         }
         if (TextUtils.isEmpty(dns2) == false) {
             p.addDns(NetworkUtils.numericToInetAddress(dns2));
@@ -111,11 +116,33 @@
         return p;
     }
 
+    /* Updates the DHCP fields that need to be retained from
+     * original DHCP request if the DHCP renewal shows them as
+     * being empty
+     */
+    public void updateFromDhcpRequest(DhcpInfoInternal orig) {
+        if (orig == null) return;
+
+        if (TextUtils.isEmpty(dns1)) {
+            dns1 = orig.dns1;
+        }
+
+        if (TextUtils.isEmpty(dns2)) {
+            dns2 = orig.dns2;
+        }
+
+        if (mRoutes.size() == 0) {
+            for (RouteInfo route : orig.getRoutes()) {
+                addRoute(route);
+            }
+        }
+    }
+
     public String toString() {
         String routeString = "";
-        for (RouteInfo route : routes) routeString += route.toString() + " | ";
+        for (RouteInfo route : mRoutes) routeString += route.toString() + " | ";
         return "addr: " + ipAddress + "/" + prefixLength +
-                " routes: " + routeString +
+                " mRoutes: " + routeString +
                 " dns: " + dns1 + "," + dns2 +
                 " dhcpServer: " + serverAddress +
                 " leaseDuration: " + leaseDuration;
diff --git a/core/java/android/net/DhcpStateMachine.java b/core/java/android/net/DhcpStateMachine.java
index 445b2f7..79c9395 100644
--- a/core/java/android/net/DhcpStateMachine.java
+++ b/core/java/android/net/DhcpStateMachine.java
@@ -63,6 +63,9 @@
     private PowerManager.WakeLock mDhcpRenewWakeLock;
     private static final String WAKELOCK_TAG = "DHCP";
 
+    //Remember DHCP configuration from first request
+    private DhcpInfoInternal mDhcpInfo;
+
     private static final int DHCP_RENEW = 0;
     private static final String ACTION_DHCP_RENEW = "android.net.wifi.DHCP_RENEW";
 
@@ -335,9 +338,11 @@
         if (dhcpAction == DhcpAction.START) {
             Log.d(TAG, "DHCP request on " + mInterfaceName);
             success = NetworkUtils.runDhcp(mInterfaceName, dhcpInfoInternal);
+            mDhcpInfo = dhcpInfoInternal;
         } else if (dhcpAction == DhcpAction.RENEW) {
             Log.d(TAG, "DHCP renewal on " + mInterfaceName);
             success = NetworkUtils.runDhcpRenew(mInterfaceName, dhcpInfoInternal);
+            dhcpInfoInternal.updateFromDhcpRequest(mDhcpInfo);
         }
 
         if (success) {
diff --git a/core/java/android/provider/MediaStore.java b/core/java/android/provider/MediaStore.java
index 5da3114..5f111eb 100644
--- a/core/java/android/provider/MediaStore.java
+++ b/core/java/android/provider/MediaStore.java
@@ -283,6 +283,17 @@
          */
         public static final String IS_DRM = "is_drm";
 
+        /**
+         * The width of the image/video in pixels.
+         * @hide
+         */
+        public static final String WIDTH = "width";
+
+        /**
+         * The height of the image/video in pixels.
+         * @hide
+         */
+        public static final String HEIGHT = "height";
      }
 
     /**
diff --git a/core/java/android/view/IWindowManager.aidl b/core/java/android/view/IWindowManager.aidl
index 0dc781f..335c66b 100644
--- a/core/java/android/view/IWindowManager.aidl
+++ b/core/java/android/view/IWindowManager.aidl
@@ -23,6 +23,7 @@
 import android.content.res.Configuration;
 import android.graphics.Bitmap;
 import android.graphics.Point;
+import android.os.IRemoteCallback;
 import android.view.IApplicationToken;
 import android.view.IOnKeyguardExitResult;
 import android.view.IRotationWatcher;
@@ -220,7 +221,7 @@
     void setPointerSpeed(int speed);
 
     /**
-     * Block until all windows the window manager knows about have been drawn.
+     * Block until the given window has been drawn to the screen.
      */
-    void waitForAllDrawn();
+    void waitForWindowDrawn(IBinder token, in IRemoteCallback callback);
 }
diff --git a/core/java/android/view/ViewGroup.java b/core/java/android/view/ViewGroup.java
index c7b59b8..b678c7d 100644
--- a/core/java/android/view/ViewGroup.java
+++ b/core/java/android/view/ViewGroup.java
@@ -290,6 +290,13 @@
     private static final int FLAG_SPLIT_MOTION_EVENTS = 0x200000;
 
     /**
+     * When set, this ViewGroup will not dispatch onAttachedToWindow calls
+     * to children when adding new views. This is used to prevent multiple
+     * onAttached calls when a ViewGroup adds children in its own onAttached method.
+     */
+    private static final int FLAG_PREVENT_DISPATCH_ATTACHED_TO_WINDOW = 0x400000;
+
+    /**
      * Indicates which types of drawing caches are to be kept in memory.
      * This field should be made private, so it is hidden from the SDK.
      * {@hide}
@@ -2154,8 +2161,12 @@
      */
     @Override
     void dispatchAttachedToWindow(AttachInfo info, int visibility) {
+        mGroupFlags |= FLAG_PREVENT_DISPATCH_ATTACHED_TO_WINDOW;
         super.dispatchAttachedToWindow(info, visibility);
+        mGroupFlags &= ~FLAG_PREVENT_DISPATCH_ATTACHED_TO_WINDOW;
+
         visibility |= mViewFlags & VISIBILITY_MASK;
+
         final int count = mChildrenCount;
         final View[] children = mChildren;
         for (int i = 0; i < count; i++) {
@@ -3321,7 +3332,7 @@
         }
 
         AttachInfo ai = mAttachInfo;
-        if (ai != null) {
+        if (ai != null && (mGroupFlags & FLAG_PREVENT_DISPATCH_ATTACHED_TO_WINDOW) == 0) {
             boolean lastKeepOn = ai.mKeepScreenOn;
             ai.mKeepScreenOn = false;
             child.dispatchAttachedToWindow(mAttachInfo, (mViewFlags&VISIBILITY_MASK));
diff --git a/core/java/android/view/ViewRootImpl.java b/core/java/android/view/ViewRootImpl.java
index 4611984..9cb4e5e 100644
--- a/core/java/android/view/ViewRootImpl.java
+++ b/core/java/android/view/ViewRootImpl.java
@@ -1054,7 +1054,6 @@
                     || attachInfo.mSystemUiVisibility != oldVis
                     || attachInfo.mHasSystemUiListeners) {
                 params = lp;
-                windowAttributesChanges |= WindowManager.LayoutParams.BUFFER_CHANGED;
             }
         }
 
diff --git a/core/java/android/view/VolumePanel.java b/core/java/android/view/VolumePanel.java
index fb87e23..122865e 100644
--- a/core/java/android/view/VolumePanel.java
+++ b/core/java/android/view/VolumePanel.java
@@ -34,10 +34,12 @@
 import android.net.Uri;
 import android.os.Handler;
 import android.os.Message;
+import android.os.RemoteException;
 import android.os.Vibrator;
 import android.provider.Settings;
 import android.provider.Settings.System;
 import android.util.Log;
+import android.view.WindowManager.LayoutParams;
 import android.widget.ImageView;
 import android.widget.SeekBar;
 import android.widget.SeekBar.OnSeekBarChangeListener;
@@ -175,20 +177,8 @@
         View view = mView = inflater.inflate(R.layout.volume_adjust, null);
         mView.setOnTouchListener(new View.OnTouchListener() {
             public boolean onTouch(View v, MotionEvent event) {
-                // Dismiss the dialog if the user touches outside the visible area. This is not
-                // handled by the usual dialog dismissing code because there is a region above
-                // the panel (marginTop) that is still within the dialog.
-                if (event.getAction() == MotionEvent.ACTION_DOWN) {
-                    int x = (int) event.getX();
-                    int y = (int) event.getY();
-                    if (x < mPanel.getLeft() || x > mPanel.getRight() || y < mPanel.getTop()
-                            || y > mPanel.getBottom()) {
-                        forceTimeout();
-                        return true;
-                    }
-                }
                 resetTimeout();
-                return true;
+                return false;
             }
         });
         mPanel = (ViewGroup) mView.findViewById(R.id.visible_panel);
@@ -196,7 +186,15 @@
         mMoreButton = (ImageView) mView.findViewById(R.id.expand_button);
         mDivider = (ImageView) mView.findViewById(R.id.expand_button_divider);
 
-        mDialog = new Dialog(context, R.style.Theme_Panel_Volume);
+        mDialog = new Dialog(context, R.style.Theme_Panel_Volume) {
+            public boolean onTouchEvent(MotionEvent event) {
+                if (isShowing() && event.getAction() == MotionEvent.ACTION_OUTSIDE) {
+                    forceTimeout();
+                    return true;
+                }
+                return false;
+            }
+        };
         mDialog.setTitle("Volume control"); // No need to localize
         mDialog.setContentView(mView);
         mDialog.setOnDismissListener(new OnDismissListener() {
@@ -208,11 +206,17 @@
         // Change some window properties
         Window window = mDialog.getWindow();
         window.setGravity(Gravity.TOP);
-        WindowManager.LayoutParams lp = window.getAttributes();
+        LayoutParams lp = window.getAttributes();
         lp.token = null;
-        lp.type = WindowManager.LayoutParams.TYPE_VOLUME_OVERLAY;
+        // Offset from the top
+        lp.y = mContext.getResources().getDimensionPixelOffset(
+                com.android.internal.R.dimen.volume_panel_top);
+        lp.type = LayoutParams.TYPE_VOLUME_OVERLAY;
+        lp.width = LayoutParams.WRAP_CONTENT;
+        lp.height = LayoutParams.WRAP_CONTENT;
         window.setAttributes(lp);
-        window.addFlags(WindowManager.LayoutParams.FLAG_ALT_FOCUSABLE_IM);
+        window.addFlags(LayoutParams.FLAG_NOT_FOCUSABLE | LayoutParams.FLAG_NOT_TOUCH_MODAL
+                | LayoutParams.FLAG_WATCH_OUTSIDE_TOUCH);
 
         mToneGenerators = new ToneGenerator[AudioSystem.getNumStreamTypes()];
         mVibrator = new Vibrator();
diff --git a/core/java/android/view/WindowManagerPolicy.java b/core/java/android/view/WindowManagerPolicy.java
index 980e454..c07faf6 100644
--- a/core/java/android/view/WindowManagerPolicy.java
+++ b/core/java/android/view/WindowManagerPolicy.java
@@ -772,15 +772,26 @@
      */
     public void screenTurnedOff(int why);
 
-    /**
-     * Called after the screen turns on.
-     */
-    public void screenTurnedOn();
+    public interface ScreenOnListener {
+        void onScreenOn();
+    };
 
     /**
-     * Return whether the screen is currently on.
+     * Called when the power manager would like to turn the screen on.
+     * Must call back on the listener to tell it when the higher-level system
+     * is ready for the screen to go on (i.e. the lock screen is shown).
      */
-    public boolean isScreenOn();
+    public void screenTurningOn(ScreenOnListener screenOnListener);
+
+    /**
+     * Return whether the screen is about to turn on or is currently on.
+     */
+    public boolean isScreenOnEarly();
+
+    /**
+     * Return whether the screen is fully turned on.
+     */
+    public boolean isScreenOnFully();
 
     /**
      * Tell the policy that the lid switch has changed state.
diff --git a/core/java/android/webkit/CookieSyncManager.java b/core/java/android/webkit/CookieSyncManager.java
index 313f755..a699800 100644
--- a/core/java/android/webkit/CookieSyncManager.java
+++ b/core/java/android/webkit/CookieSyncManager.java
@@ -88,6 +88,10 @@
      */
     public static synchronized CookieSyncManager createInstance(
             Context context) {
+        if (context == null) {
+            throw new IllegalArgumentException("Invalid context argument");
+        }
+
         JniUtil.setContext(context);
         Context appContext = context.getApplicationContext();
         if (sRef == null) {
diff --git a/core/java/android/webkit/JniUtil.java b/core/java/android/webkit/JniUtil.java
index ef1641d..7759ff3 100644
--- a/core/java/android/webkit/JniUtil.java
+++ b/core/java/android/webkit/JniUtil.java
@@ -39,25 +39,21 @@
     private static Boolean sUseChromiumHttpStack;
     private static Context sContext;
 
-    private static boolean initialized = false;
-
     private static void checkInitialized() {
-        if (!initialized) {
+        if (sContext == null) {
             throw new IllegalStateException("Call CookieSyncManager::createInstance() or create a webview before using this class");
         }
     }
 
     protected static synchronized void setContext(Context context) {
-        if (initialized)
+        if (sContext != null) {
             return;
+        }
 
         sContext = context.getApplicationContext();
-        initialized = true;
     }
 
     protected static synchronized Context getContext() {
-        if (!initialized)
-            return null;
         return sContext;
     }
 
@@ -68,8 +64,9 @@
     private static synchronized String getDatabaseDirectory() {
         checkInitialized();
 
-        if (sDatabaseDirectory == null)
+        if (sDatabaseDirectory == null) {
             sDatabaseDirectory = sContext.getDatabasePath("dummy").getParent();
+        }
 
         return sDatabaseDirectory;
     }
@@ -81,8 +78,9 @@
     private static synchronized String getCacheDirectory() {
         checkInitialized();
 
-        if (sCacheDirectory == null)
+        if (sCacheDirectory == null) {
             sCacheDirectory = sContext.getCacheDir().getAbsolutePath();
+        }
 
         return sCacheDirectory;
     }
diff --git a/core/java/android/webkit/WebView.java b/core/java/android/webkit/WebView.java
index 600c899..122a717 100644
--- a/core/java/android/webkit/WebView.java
+++ b/core/java/android/webkit/WebView.java
@@ -644,7 +644,7 @@
     private Drawable mSelectHandleLeft;
     private Drawable mSelectHandleRight;
 
-    static final boolean USE_WEBKIT_RINGS = true;
+    static final boolean USE_WEBKIT_RINGS = false;
     // the color used to highlight the touch rectangles
     private static final int HIGHLIGHT_COLOR = 0x6633b5e5;
     // the round corner for the highlight path
@@ -730,6 +730,7 @@
     static final int SELECT_AT                          = 135;
     static final int SCREEN_ON                          = 136;
     static final int ENTER_FULLSCREEN_VIDEO             = 137;
+    static final int UPDATE_SELECTION                   = 138;
 
     private static final int FIRST_PACKAGE_MSG_ID = SCROLL_TO_MSG_ID;
     private static final int LAST_PACKAGE_MSG_ID = SET_TOUCH_HIGHLIGHT_RECTS;
@@ -1054,6 +1055,10 @@
         super(context, attrs, defStyle);
         checkThread();
 
+        if (context == null) {
+            throw new IllegalArgumentException("Invalid context argument");
+        }
+
         // Used by the chrome stack to find application paths
         JniUtil.setContext(context);
 
@@ -4062,8 +4067,11 @@
         // state.
         // If mNativeClass is 0, we should not reach here, so we do not
         // need to check it again.
+        boolean pressed = (mTouchMode == TOUCH_SHORTPRESS_START_MODE
+                || mTouchMode == TOUCH_INIT_MODE
+                || mTouchMode == TOUCH_SHORTPRESS_MODE);
         nativeRecordButtons(hasFocus() && hasWindowFocus(),
-                (mTouchMode == TOUCH_SHORTPRESS_START_MODE && !USE_WEBKIT_RINGS)
+                (pressed && !USE_WEBKIT_RINGS)
                 || mTrackballDown || mGotCenterDown, false);
         drawCoreAndCursorRing(canvas, mBackgroundColor,
                 mDrawCursorRing && drawRings);
@@ -4280,7 +4288,6 @@
         }
         nativeSetExtendSelection();
         mDrawSelectionPointer = false;
-        mSelectionStarted = true;
         mTouchMode = TOUCH_DRAG_MODE;
         return true;
     }
@@ -6532,6 +6539,8 @@
         mLastTouchTime = eventTime;
         mVelocityTracker = VelocityTracker.obtain();
         mSnapScrollMode = SNAP_NONE;
+        mPrivateHandler.sendEmptyMessageDelayed(UPDATE_SELECTION,
+                ViewConfiguration.getTapTimeout());
     }
 
     private void startDrag() {
@@ -7194,10 +7203,15 @@
         return mZoomManager.zoomOut();
     }
 
+    /**
+     * This selects the best clickable target at mLastTouchX and mLastTouchY
+     * and calls showCursorTimed on the native side
+     */
     private void updateSelection() {
         if (mNativeClass == 0) {
             return;
         }
+        mPrivateHandler.removeMessages(UPDATE_SELECTION);
         // mLastTouchX and mLastTouchY are the point in the current viewport
         int contentX = viewToContentX(mLastTouchX + mScrollX);
         int contentY = viewToContentY(mLastTouchY + mScrollY);
@@ -7297,6 +7311,7 @@
             return;
         }
         mTouchMode = TOUCH_DONE_MODE;
+        updateSelection();
         switchOutDrawHistory();
         // mLastTouchX and mLastTouchY are the point in the current viewport
         int contentX = viewToContentX(mLastTouchX + mScrollX);
@@ -8187,6 +8202,14 @@
                             SCROLL_SELECT_TEXT, SELECT_SCROLL_INTERVAL);
                     break;
                 }
+                case UPDATE_SELECTION: {
+                    if (mTouchMode == TOUCH_INIT_MODE
+                            || mTouchMode == TOUCH_SHORTPRESS_MODE
+                            || mTouchMode == TOUCH_SHORTPRESS_START_MODE) {
+                        updateSelection();
+                    }
+                    break;
+                }
                 case SWITCH_TO_SHORTPRESS: {
                     mInitialHitTestResult = null; // set by updateSelection()
                     if (mTouchMode == TOUCH_INIT_MODE) {
diff --git a/core/java/android/widget/AdapterView.java b/core/java/android/widget/AdapterView.java
index 72db8e8..5392c2e 100644
--- a/core/java/android/widget/AdapterView.java
+++ b/core/java/android/widget/AdapterView.java
@@ -277,10 +277,11 @@
      *         called, false otherwise is returned.
      */
     public boolean performItemClick(View view, int position, long id) {
-        view.sendAccessibilityEvent(AccessibilityEvent.TYPE_VIEW_CLICKED);
-
         if (mOnItemClickListener != null) {
             playSoundEffect(SoundEffectConstants.CLICK);
+            if (view != null) {
+                view.sendAccessibilityEvent(AccessibilityEvent.TYPE_VIEW_CLICKED);
+            }
             mOnItemClickListener.onItemClick(this, view, position, id);
             return true;
         }
@@ -338,8 +339,10 @@
      */
     public interface OnItemSelectedListener {
         /**
-         * Callback method to be invoked when an item in this view has been
-         * selected.
+         * <p>Callback method to be invoked when an item in this view has been
+         * selected. This callback is invoked only when the newly selected
+         * position is different from the previously selected position or if
+         * there was no selected item.</p>
          *
          * Impelmenters can call getItemAtPosition(position) if they need to access the
          * data associated with the selected item.
diff --git a/core/java/android/widget/AutoCompleteTextView.java b/core/java/android/widget/AutoCompleteTextView.java
index 27610b9f..07523e3 100644
--- a/core/java/android/widget/AutoCompleteTextView.java
+++ b/core/java/android/widget/AutoCompleteTextView.java
@@ -16,8 +16,6 @@
 
 package android.widget;
 
-import com.android.internal.R;
-
 import android.content.Context;
 import android.content.res.TypedArray;
 import android.database.DataSetObserver;
@@ -38,6 +36,8 @@
 import android.view.inputmethod.EditorInfo;
 import android.view.inputmethod.InputMethodManager;
 
+import com.android.internal.R;
+
 
 /**
  * <p>An editable text view that shows completion suggestions automatically
@@ -744,7 +744,6 @@
             if (mFilter != null) {
                 mPopupCanBeUpdated = true;
                 performFiltering(getText(), mLastKeyCode);
-                buildImeCompletions();
             }
         } else {
             // drop down is automatically dismissed when enough characters
@@ -837,10 +836,6 @@
     @Override
     public void onCommitCompletion(CompletionInfo completion) {
         if (isPopupShowing()) {
-            mBlockCompletion = true;
-            replaceText(completion.getText());
-            mBlockCompletion = false;
-
             mPopup.performItemClick(completion.getPosition());
         }
     }
@@ -938,7 +933,8 @@
          */
 
         final boolean dropDownAlwaysVisible = mPopup.isDropDownAlwaysVisible();
-        if ((count > 0 || dropDownAlwaysVisible) && enoughToFilter()) {
+        final boolean enoughToFilter = enoughToFilter();
+        if ((count > 0 || dropDownAlwaysVisible) && enoughToFilter) {
             if (hasFocus() && hasWindowFocus() && mPopupCanBeUpdated) {
                 showDropDown();
             }
@@ -1049,6 +1045,8 @@
      * <p>Displays the drop down on screen.</p>
      */
     public void showDropDown() {
+        buildImeCompletions();
+
         if (mPopup.getAnchorView() == null) {
             if (mDropDownAnchorId != View.NO_ID) {
                 mPopup.setAnchorView(getRootView().findViewById(mDropDownAnchorId));
@@ -1064,7 +1062,7 @@
         mPopup.show();
         mPopup.getListView().setOverScrollMode(View.OVER_SCROLL_ALWAYS);
     }
-    
+
     /**
      * Forces outside touches to be ignored. Normally if {@link #isDropDownAlwaysVisible()} is
      * false, we allow outside touch to dismiss the dropdown. If this is set to true, then we
@@ -1075,7 +1073,7 @@
     public void setForceIgnoreOutsideTouch(boolean forceIgnoreOutsideTouch) {
         mPopup.setForceIgnoreOutsideTouch(forceIgnoreOutsideTouch);
     }
-    
+
     private void buildImeCompletions() {
         final ListAdapter adapter = mAdapter;
         if (adapter != null) {
@@ -1090,8 +1088,7 @@
                         realCount++;
                         Object item = adapter.getItem(i);
                         long id = adapter.getItemId(i);
-                        completions[i] = new CompletionInfo(id, i,
-                                convertSelectionToString(item));
+                        completions[i] = new CompletionInfo(id, i, convertSelectionToString(item));
                     }
                 }
                 
diff --git a/core/java/android/widget/CalendarView.java b/core/java/android/widget/CalendarView.java
index 1b713c3..9cbe8db 100644
--- a/core/java/android/widget/CalendarView.java
+++ b/core/java/android/widget/CalendarView.java
@@ -339,10 +339,8 @@
         // initialization based on locale
         setCurrentLocale(Locale.getDefault());
 
-        TypedValue calendarViewStyle = new TypedValue();
-        context.getTheme().resolveAttribute(R.attr.calendarViewStyle, calendarViewStyle, true);
-        TypedArray attributesArray = context.obtainStyledAttributes(calendarViewStyle.resourceId,
-                R.styleable.CalendarView);
+        TypedArray attributesArray = context.obtainStyledAttributes(attrs, R.styleable.CalendarView,
+                R.attr.calendarViewStyle, 0);
         mShowWeekNumber = attributesArray.getBoolean(R.styleable.CalendarView_showWeekNumber,
                 DEFAULT_SHOW_WEEK_NUMBER);
         mFirstDayOfWeek = attributesArray.getInt(R.styleable.CalendarView_firstDayOfWeek,
@@ -355,6 +353,9 @@
         if (TextUtils.isEmpty(maxDate) || !parseDate(maxDate, mMaxDate)) {
             parseDate(DEFAULT_MAX_DATE, mMaxDate);
         }
+        if (mMaxDate.before(mMinDate)) {
+            throw new IllegalArgumentException("Max date cannot be before min date.");
+        }
         mShownWeekCount = attributesArray.getInt(R.styleable.CalendarView_shownWeekCount,
                 DEFAULT_SHOWN_WEEK_COUNT);
         mSelectedWeekBackgroundColor = attributesArray.getColor(
@@ -407,9 +408,16 @@
         setUpListView();
         setUpAdapter();
 
-        // go to today now
+        // go to today or whichever is close to today min or max date
         mTempDate.setTimeInMillis(System.currentTimeMillis());
-        goTo(mTempDate, false, true, true);
+        if (mTempDate.before(mMinDate)) {
+            goTo(mMinDate, false, true, true);
+        } else if (mMaxDate.before(mTempDate)) {
+            goTo(mMaxDate, false, true, true);
+        } else {
+            goTo(mTempDate, false, true, true);
+        }
+
         invalidate();
     }
 
diff --git a/core/java/android/widget/GridLayout.java b/core/java/android/widget/GridLayout.java
index 390002b..ba69288 100644
--- a/core/java/android/widget/GridLayout.java
+++ b/core/java/android/widget/GridLayout.java
@@ -87,19 +87,26 @@
  * layout parameters. When the
  * {@link GridLayout#setUseDefaultMargins(boolean) useDefaultMargins}
  * property is set, default margins around children are automatically
- * allocated based on the child's visual characteristics. Each of the
- * margins so defined may be independently overridden by an assignment
+ * allocated based on the prevailing UI style guide for the platform.
+ * Each of the margins so defined may be independently overridden by an assignment
  * to the appropriate layout parameter.
+ * Default values will generally produce a reasonable spacing between components
+ * but values may change between different releases of the platform.
  *
  * <h4>Excess Space Distribution</h4>
  *
+ * GridLayout's distribution of excess space is based on <em>priority</em>
+ * rather than <em>weight</em>.
+ * <p>
  * A child's ability to stretch is inferred from the alignment properties of
  * its row and column groups (which are typically set by setting the
  * {@link LayoutParams#setGravity(int) gravity} property of the child's layout parameters).
  * If alignment was defined along a given axis then the component
- * is taken as flexible in along that axis. If no alignment was set,
- * the component is instead assumed to be inflexible. Multiple components in
- * the same row or column group are considered to act in <em>parallel</em>. Such a
+ * is taken as <em>flexible</em> in that direction. If no alignment was set,
+ * the component is instead assumed to be <em>inflexible</em>.
+ * <p>
+ * Multiple components in the same row or column group are
+ * considered to act in <em>parallel</em>. Such a
  * group is flexible only if <em>all</em> of the components
  * within it are flexible. Row and column groups that sit either side of a common boundary
  * are instead considered to act in <em>series</em>. The composite group made of these two
@@ -109,6 +116,23 @@
  * gravity. To prevent a column from stretching, ensure that one of the components
  * in the column does not define a gravity.
  * <p>
+ * When the principle of flexibility does not provide complete disambiguation,
+ * GridLayout's algorithms favour rows and columns that are closer to its <em>right</em>
+ * and <em>bottom</em> edges.
+ *
+ * <h5>Limitations</h5>
+ *
+ * GridLayout does not provide support for the principle of <em>weight</em>, as defined in
+ * {@link LinearLayout.LayoutParams#weight}. In general, it is not therefore possible
+ * to configure a GridLayout to distribute excess space in non-trivial proportions between
+ * multiple rows or columns.
+ * <p>
+ * Some common use-cases may nevertheless be accommodated as follows.
+ * To place equal amounts of space around a component in a cell group;
+ * use {@link #CENTER} alignment (or {@link LayoutParams#setGravity(int) gravity}).
+ * For complete control over excess space distribution in a row or column;
+ * use a {@link LinearLayout} subview to hold the components in the associated cell group.
+ * When using either of these techniques, bear in mind that cell groups may be defined to overlap.
  * <p>
  * See {@link GridLayout.LayoutParams} for a full description of the
  * layout parameters used by GridLayout.
@@ -180,9 +204,11 @@
 
     // Misc constants
 
-    private static final String TAG = GridLayout.class.getName();
-    private static boolean DEBUG = false;
-    private static final int PRF = 1;
+    static final String TAG = GridLayout.class.getName();
+    static final boolean DEBUG = false;
+    static final int PRF = 1;
+    static final int MAX_SIZE = 100000;
+    static final int DEFAULT_CONTAINER_MARGIN = 0;
 
     // Defaults
 
@@ -191,8 +217,6 @@
     private static final boolean DEFAULT_USE_DEFAULT_MARGINS = false;
     private static final boolean DEFAULT_ORDER_PRESERVED = true;
     private static final int DEFAULT_ALIGNMENT_MODE = ALIGN_MARGINS;
-    private static final int DEFAULT_CONTAINER_MARGIN = 0;
-    private static final int MAX_SIZE = 100000;
 
     // TypedArray indices
 
@@ -206,13 +230,13 @@
 
     // Instance variables
 
-    private final Axis mHorizontalAxis = new Axis(true);
-    private final Axis mVerticalAxis = new Axis(false);
-    private boolean mLayoutParamsValid = false;
-    private int mOrientation = DEFAULT_ORIENTATION;
-    private boolean mUseDefaultMargins = DEFAULT_USE_DEFAULT_MARGINS;
-    private int mAlignmentMode = DEFAULT_ALIGNMENT_MODE;
-    private int mDefaultGap;
+    final Axis horizontalAxis = new Axis(true);
+    final Axis verticalAxis = new Axis(false);
+    boolean layoutParamsValid = false;
+    int orientation = DEFAULT_ORIENTATION;
+    boolean useDefaultMargins = DEFAULT_USE_DEFAULT_MARGINS;
+    int alignmentMode = DEFAULT_ALIGNMENT_MODE;
+    int defaultGap;
 
     // Constructors
 
@@ -224,7 +248,7 @@
         if (DEBUG) {
             setWillNotDraw(false);
         }
-        mDefaultGap = context.getResources().getDimensionPixelOffset(R.dimen.default_gap);
+        defaultGap = context.getResources().getDimensionPixelOffset(R.dimen.default_gap);
         TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.GridLayout);
         try {
             setRowCount(a.getInt(ROW_COUNT, DEFAULT_COUNT));
@@ -266,13 +290,12 @@
      * @attr ref android.R.styleable#GridLayout_orientation
      */
     public int getOrientation() {
-        return mOrientation;
+        return orientation;
     }
 
     /**
-     * The orientation property does not affect layout. Orientation is used
-     * only to generate default row/column indices when they are not specified
-     * by a component's layout parameters.
+     * Orientation is used only to generate default row/column indices when
+     * they are not specified by a component's layout parameters.
      * <p>
      * The default value of this property is {@link #HORIZONTAL}.
      *
@@ -283,8 +306,9 @@
      * @attr ref android.R.styleable#GridLayout_orientation
      */
     public void setOrientation(int orientation) {
-        if (mOrientation != orientation) {
-            mOrientation = orientation;
+        if (this.orientation != orientation) {
+            this.orientation = orientation;
+            invalidateStructure();
             requestLayout();
         }
     }
@@ -302,13 +326,12 @@
      * @attr ref android.R.styleable#GridLayout_rowCount
      */
     public int getRowCount() {
-        return mVerticalAxis.getCount();
+        return verticalAxis.getCount();
     }
 
     /**
-     * The rowCount property does not affect layout. RowCount is used
-     * only to generate default row/column indices when they are not specified
-     * by a component's layout parameters.
+     * RowCount is used only to generate default row/column indices when
+     * they are not specified by a component's layout parameters.
      *
      * @param rowCount the number of rows
      *
@@ -318,7 +341,9 @@
      * @attr ref android.R.styleable#GridLayout_rowCount
      */
     public void setRowCount(int rowCount) {
-        mVerticalAxis.setCount(rowCount);
+        verticalAxis.setCount(rowCount);
+        invalidateStructure();
+        requestLayout();
     }
 
     /**
@@ -334,13 +359,12 @@
      * @attr ref android.R.styleable#GridLayout_columnCount
      */
     public int getColumnCount() {
-        return mHorizontalAxis.getCount();
+        return horizontalAxis.getCount();
     }
 
     /**
-     * The columnCount property does not affect layout. ColumnCount is used
-     * only to generate default column/column indices when they are not specified
-     * by a component's layout parameters.
+     * ColumnCount is used only to generate default column/column indices when
+     * they are not specified by a component's layout parameters.
      *
      * @param columnCount the number of columns.
      *
@@ -350,7 +374,9 @@
      * @attr ref android.R.styleable#GridLayout_columnCount
      */
     public void setColumnCount(int columnCount) {
-        mHorizontalAxis.setCount(columnCount);
+        horizontalAxis.setCount(columnCount);
+        invalidateStructure();
+        requestLayout();
     }
 
     /**
@@ -364,7 +390,7 @@
      * @attr ref android.R.styleable#GridLayout_useDefaultMargins
      */
     public boolean getUseDefaultMargins() {
-        return mUseDefaultMargins;
+        return useDefaultMargins;
     }
 
     /**
@@ -394,7 +420,7 @@
      * @attr ref android.R.styleable#GridLayout_useDefaultMargins
      */
     public void setUseDefaultMargins(boolean useDefaultMargins) {
-        mUseDefaultMargins = useDefaultMargins;
+        this.useDefaultMargins = useDefaultMargins;
         requestLayout();
     }
 
@@ -411,7 +437,7 @@
      * @attr ref android.R.styleable#GridLayout_alignmentMode
      */
     public int getAlignmentMode() {
-        return mAlignmentMode;
+        return alignmentMode;
     }
 
     /**
@@ -430,7 +456,7 @@
      * @attr ref android.R.styleable#GridLayout_alignmentMode
      */
     public void setAlignmentMode(int alignmentMode) {
-        mAlignmentMode = alignmentMode;
+        this.alignmentMode = alignmentMode;
         requestLayout();
     }
 
@@ -445,7 +471,7 @@
      * @attr ref android.R.styleable#GridLayout_rowOrderPreserved
      */
     public boolean isRowOrderPreserved() {
-        return mVerticalAxis.isOrderPreserved();
+        return verticalAxis.isOrderPreserved();
     }
 
     /**
@@ -465,7 +491,7 @@
      * @attr ref android.R.styleable#GridLayout_rowOrderPreserved
      */
     public void setRowOrderPreserved(boolean rowOrderPreserved) {
-        mVerticalAxis.setOrderPreserved(rowOrderPreserved);
+        verticalAxis.setOrderPreserved(rowOrderPreserved);
         invalidateStructure();
         requestLayout();
     }
@@ -481,7 +507,7 @@
      * @attr ref android.R.styleable#GridLayout_columnOrderPreserved
      */
     public boolean isColumnOrderPreserved() {
-        return mHorizontalAxis.isOrderPreserved();
+        return horizontalAxis.isOrderPreserved();
     }
 
     /**
@@ -501,14 +527,14 @@
      * @attr ref android.R.styleable#GridLayout_columnOrderPreserved
      */
     public void setColumnOrderPreserved(boolean columnOrderPreserved) {
-        mHorizontalAxis.setOrderPreserved(columnOrderPreserved);
+        horizontalAxis.setOrderPreserved(columnOrderPreserved);
         invalidateStructure();
         requestLayout();
     }
 
     // Static utility methods
 
-    private static int max2(int[] a, int valueIfEmpty) {
+    static int max2(int[] a, int valueIfEmpty) {
         int result = valueIfEmpty;
         for (int i = 0, N = a.length; i < N; i++) {
             result = Math.max(result, a[i]);
@@ -517,14 +543,14 @@
     }
 
     @SuppressWarnings("unchecked")
-    private static <T> T[] append(T[] a, T[] b) {
+    static <T> T[] append(T[] a, T[] b) {
         T[] result = (T[]) Array.newInstance(a.getClass().getComponentType(), a.length + b.length);
         System.arraycopy(a, 0, result, 0, a.length);
         System.arraycopy(b, 0, result, a.length, b.length);
         return result;
     }
 
-    private static Alignment getAlignment(int gravity, boolean horizontal) {
+    static Alignment getAlignment(int gravity, boolean horizontal) {
         int mask = horizontal ? HORIZONTAL_GRAVITY_MASK : VERTICAL_GRAVITY_MASK;
         int shift = horizontal ? AXIS_X_SHIFT : AXIS_Y_SHIFT;
         int flags = (gravity & mask) >> shift;
@@ -547,7 +573,7 @@
         if (c.getClass() == Space.class) {
             return 0;
         }
-        return mDefaultGap / 2;
+        return defaultGap / 2;
     }
 
     private int getDefaultMargin(View c, boolean isAtEdge, boolean horizontal, boolean leading) {
@@ -555,18 +581,18 @@
     }
 
     private int getDefaultMarginValue(View c, LayoutParams p, boolean horizontal, boolean leading) {
-        if (!mUseDefaultMargins) {
+        if (!useDefaultMargins) {
             return 0;
         }
         Spec spec = horizontal ? p.columnSpec : p.rowSpec;
-        Axis axis = horizontal ? mHorizontalAxis : mVerticalAxis;
+        Axis axis = horizontal ? horizontalAxis : verticalAxis;
         Interval span = spec.span;
         boolean isAtEdge = leading ? (span.min == 0) : (span.max == axis.getCount());
 
         return getDefaultMargin(c, isAtEdge, horizontal, leading);
     }
 
-    private int getMargin1(View view, boolean horizontal, boolean leading) {
+    int getMargin1(View view, boolean horizontal, boolean leading) {
         LayoutParams lp = getLayoutParams(view);
         int margin = horizontal ?
                 (leading ? lp.leftMargin : lp.rightMargin) :
@@ -575,10 +601,10 @@
     }
 
     private int getMargin(View view, boolean horizontal, boolean leading) {
-        if (mAlignmentMode == ALIGN_MARGINS) {
+        if (alignmentMode == ALIGN_MARGINS) {
             return getMargin1(view, horizontal, leading);
         } else {
-            Axis axis = horizontal ? mHorizontalAxis : mVerticalAxis;
+            Axis axis = horizontal ? horizontalAxis : verticalAxis;
             int[] margins = leading ? axis.getLeadingMargins() : axis.getTrailingMargins();
             LayoutParams lp = getLayoutParams(view);
             Spec spec = horizontal ? lp.columnSpec : lp.rowSpec;
@@ -591,10 +617,6 @@
         return getMargin(child, horizontal, true) + getMargin(child, horizontal, false);
     }
 
-    private static int valueIfDefined(int value, int defaultValue) {
-        return (value != UNDEFINED) ? value : defaultValue;
-    }
-
     private static boolean fits(int[] a, int value, int start, int end) {
         if (end > a.length) {
             return false;
@@ -629,9 +651,9 @@
 
     // install default indices for cells that don't define them
     private void validateLayoutParams() {
-        final boolean horizontal = (mOrientation == HORIZONTAL);
-        final int axisCount = horizontal ? mHorizontalAxis.count : mVerticalAxis.count;
-        final int count = valueIfDefined(axisCount, 0);
+        final boolean horizontal = (orientation == HORIZONTAL);
+        final Axis axis = horizontal ? horizontalAxis : verticalAxis;
+        final int count = (axis.definedCount != UNDEFINED) ? axis.definedCount : 0;
 
         int major = 0;
         int minor = 0;
@@ -640,15 +662,17 @@
         for (int i = 0, N = getChildCount(); i < N; i++) {
             LayoutParams lp = getLayoutParams1(getChildAt(i));
 
-            final Interval majorRange = (horizontal ? lp.rowSpec : lp.columnSpec).span;
-            final boolean majorWasDefined = (majorRange.min != UNDEFINED);
+            final Spec majorSpec = horizontal ? lp.rowSpec : lp.columnSpec;
+            final Interval majorRange = majorSpec.span;
+            final boolean majorWasDefined = majorSpec.startDefined;
             final int majorSpan = majorRange.size();
             if (majorWasDefined) {
                 major = majorRange.min;
             }
 
-            final Interval minorRange = (horizontal ? lp.columnSpec : lp.rowSpec).span;
-            final boolean minorWasDefined = (minorRange.min != UNDEFINED);
+            final Spec minorSpec = horizontal ? lp.columnSpec : lp.rowSpec;
+            final Interval minorRange = minorSpec.span;
+            final boolean minorWasDefined = minorSpec.startDefined;
             final int minorSpan = clip(minorRange, minorWasDefined, count);
             if (minorWasDefined) {
                 minor = minorRange.min;
@@ -685,9 +709,9 @@
     }
 
     private void invalidateStructure() {
-        mLayoutParamsValid = false;
-        mHorizontalAxis.invalidateStructure();
-        mVerticalAxis.invalidateStructure();
+        layoutParamsValid = false;
+        horizontalAxis.invalidateStructure();
+        verticalAxis.invalidateStructure();
         // This can end up being done twice. Better twice than not at all.
         invalidateValues();
     }
@@ -695,9 +719,9 @@
     private void invalidateValues() {
         // Need null check because requestLayout() is called in View's initializer,
         // before we are set up.
-        if (mHorizontalAxis != null && mVerticalAxis != null) {
-            mHorizontalAxis.invalidateValues();
-            mVerticalAxis.invalidateValues();
+        if (horizontalAxis != null && verticalAxis != null) {
+            horizontalAxis.invalidateValues();
+            verticalAxis.invalidateValues();
         }
     }
 
@@ -705,10 +729,10 @@
         return (LayoutParams) c.getLayoutParams();
     }
 
-    private LayoutParams getLayoutParams(View c) {
-        if (!mLayoutParamsValid) {
+    final LayoutParams getLayoutParams(View c) {
+        if (!layoutParamsValid) {
             validateLayoutParams();
-            mLayoutParamsValid = true;
+            layoutParamsValid = true;
         }
         return getLayoutParams1(c);
     }
@@ -752,7 +776,7 @@
             paint.setStyle(Paint.Style.STROKE);
             paint.setColor(Color.argb(50, 255, 255, 255));
 
-            int[] xs = mHorizontalAxis.locations;
+            int[] xs = horizontalAxis.locations;
             if (xs != null) {
                 for (int i = 0, length = xs.length; i < length; i++) {
                     int x = xs[i];
@@ -760,7 +784,7 @@
                 }
             }
 
-            int[] ys = mVerticalAxis.locations;
+            int[] ys = verticalAxis.locations;
             if (ys != null) {
                 for (int i = 0, length = ys.length; i < length; i++) {
                     int y = ys[i];
@@ -822,7 +846,7 @@
 
     // Measurement
 
-    private boolean isGone(View c) {
+    final boolean isGone(View c) {
         return c.getVisibility() == View.GONE;
     }
 
@@ -847,8 +871,8 @@
     protected void onMeasure(int widthSpec, int heightSpec) {
         measureChildrenWithMargins(widthSpec, heightSpec);
 
-        int width = getPaddingLeft() + mHorizontalAxis.getMeasure(widthSpec) + getPaddingRight();
-        int height = getPaddingTop() + mVerticalAxis.getMeasure(heightSpec) + getPaddingBottom();
+        int width = getPaddingLeft() + horizontalAxis.getMeasure(widthSpec) + getPaddingRight();
+        int height = getPaddingTop() + verticalAxis.getMeasure(heightSpec) + getPaddingBottom();
 
         int measuredWidth = Math.max(width, getSuggestedMinimumWidth());
         int measuredHeight = Math.max(height, getSuggestedMinimumHeight());
@@ -866,7 +890,7 @@
         return horizontal ? c.getMeasuredWidth() : c.getMeasuredHeight();
     }
 
-    private int getMeasurementIncludingMargin(View c, boolean horizontal) {
+    final int getMeasurementIncludingMargin(View c, boolean horizontal) {
         if (isGone(c)) {
             return 0;
         }
@@ -879,7 +903,7 @@
         invalidateValues();
     }
 
-    private Alignment getAlignment(Alignment alignment, boolean horizontal) {
+    final Alignment getAlignment(Alignment alignment, boolean horizontal) {
         return (alignment != UNDEFINED_ALIGNMENT) ? alignment :
                 (horizontal ? LEFT : BASELINE);
     }
@@ -908,11 +932,11 @@
         int paddingRight = getPaddingRight();
         int paddingBottom = getPaddingBottom();
 
-        mHorizontalAxis.layout(targetWidth - paddingLeft - paddingRight);
-        mVerticalAxis.layout(targetHeight - paddingTop - paddingBottom);
+        horizontalAxis.layout(targetWidth - paddingLeft - paddingRight);
+        verticalAxis.layout(targetHeight - paddingTop - paddingBottom);
 
-        int[] hLocations = mHorizontalAxis.getLocations();
-        int[] vLocations = mVerticalAxis.getLocations();
+        int[] hLocations = horizontalAxis.getLocations();
+        int[] vLocations = verticalAxis.getLocations();
 
         for (int i = 0, N = getChildCount(); i < N; i++) {
             View c = getChildAt(i);
@@ -941,8 +965,8 @@
 
             int dx, dy;
 
-            Bounds colBounds = mHorizontalAxis.getGroupBounds().getValue(i);
-            Bounds rowBounds = mVerticalAxis.getGroupBounds().getValue(i);
+            Bounds colBounds = horizontalAxis.getGroupBounds().getValue(i);
+            Bounds rowBounds = verticalAxis.getGroupBounds().getValue(i);
 
             // Gravity offsets: the location of the alignment group relative to its cell group.
             //noinspection NullableProblems
@@ -990,7 +1014,7 @@
      distinguished by the "horizontal" flag which is true for the horizontal axis and false
      for the vertical one.
      */
-    private class Axis {
+    final class Axis {
         private static final int MIN_VALUE = -1000000;
 
         private static final int NEW = 0;
@@ -999,9 +1023,8 @@
 
         public final boolean horizontal;
 
-        public int count = UNDEFINED;
-        public boolean countValid = false;
-        public boolean countWasExplicitySet = false;
+        public int definedCount = UNDEFINED;
+        private int inferredCount = UNDEFINED;
 
         PackedMap<Spec, Bounds> groupBounds;
         public boolean groupBoundsValid = false;
@@ -1024,7 +1047,7 @@
         public int[] locations;
         public boolean locationsValid = false;
 
-        private boolean mOrderPreserved = DEFAULT_ORDER_PRESERVED;
+        boolean orderPreserved = DEFAULT_ORDER_PRESERVED;
 
         private MutableInt parentMin = new MutableInt(0);
         private MutableInt parentMax = new MutableInt(-MAX_SIZE);
@@ -1046,25 +1069,27 @@
             return count == -1 ? UNDEFINED : count;
         }
 
-        public int getCount() {
-            if (!countValid) {
-                count = max(0, maxIndex()); // if there are no cells, the count is zero
-                countValid = true;
+        private int getInferredCount() {
+            if (inferredCount == UNDEFINED) {
+                inferredCount = max(0, maxIndex()); // if there are no cells, actual count is zero
             }
-            return count;
+            return inferredCount;
+        }
+
+        public int getCount() {
+            return max(definedCount, getInferredCount());
         }
 
         public void setCount(int count) {
-            this.count = count;
-            this.countWasExplicitySet = count != UNDEFINED;
+            this.definedCount = count;
         }
 
         public boolean isOrderPreserved() {
-            return mOrderPreserved;
+            return orderPreserved;
         }
 
         public void setOrderPreserved(boolean orderPreserved) {
-            mOrderPreserved = orderPreserved;
+            this.orderPreserved = orderPreserved;
             invalidateStructure();
         }
 
@@ -1093,7 +1118,7 @@
             }
         }
 
-        private PackedMap<Spec, Bounds> getGroupBounds() {
+        public PackedMap<Spec, Bounds> getGroupBounds() {
             if (groupBounds == null) {
                 groupBounds = createGroupBounds();
             }
@@ -1183,7 +1208,7 @@
 
         // Group arcs by their first vertex, returning an array of arrays.
         // This is linear in the number of arcs.
-        private Arc[][] groupArcsByFirstVertex(Arc[] arcs) {
+        Arc[][] groupArcsByFirstVertex(Arc[] arcs) {
             int N = getCount() + 1; // the number of vertices
             Arc[][] result = new Arc[N][];
             int[] sizes = new int[N];
@@ -1262,7 +1287,7 @@
             addComponentSizes(maxs, getBackwardLinks());
 
             // Add ordering constraints to prevent row/col sizes from going negative
-            if (mOrderPreserved) {
+            if (orderPreserved) {
                 // Add a constraint for every row/col
                 for (int i = 0; i < getCount(); i++) {
                     include(mins, new Interval(i, i + 1), new MutableInt(0));
@@ -1315,6 +1340,48 @@
             return false;
         }
 
+        private void init(int[] locations) {
+            Arrays.fill(locations, MIN_VALUE);
+            locations[0] = 0;
+        }
+
+        private String arcsToString(List<Arc> arcs) {
+            String var = horizontal ? "c" : "r";
+            StringBuilder result = new StringBuilder();
+            boolean first = false;
+            for(Arc arc : arcs) {
+                if (!first) {
+                    first = true;
+                } else {
+                    result =result.append(", ");
+                }
+                int src = arc.span.min;
+                int dst = arc.span.max;
+                int value = arc.value.value;
+                result.append((src < dst) ?
+                        var + dst + " - " + var + src + " > " + value :
+                        var + src + " - " + var + dst + " < " + -value);
+
+            }
+            return result.toString();
+        }
+
+        private void logError(String axisName, Arc[] arcs, boolean[] culprits0) {
+            List<Arc> culprits = new ArrayList<Arc>();
+            List<Arc> removed = new ArrayList<Arc>();
+            for (int c = 0; c < arcs.length; c++) {
+                Arc arc = arcs[c];
+                if (culprits0[c]) {
+                    culprits.add(arc);
+                }
+                if (!arc.valid) {
+                    removed.add(arc);
+                }
+            }
+            Log.d(TAG, axisName + " constraints: " + arcsToString(culprits) + " are inconsistent; "
+                    + "permanently removing: " + arcsToString(removed) + ". ");
+        }
+
         /*
         Bellman-Ford variant - modified to reduce typical running time from O(N^2) to O(N)
 
@@ -1350,51 +1417,54 @@
         completes in O(N) steps with very low constants.
         */
         private void solve(Arc[] arcs, int[] locations) {
-            String axis = horizontal ? "horizontal" : "vertical";
+            String axisName = horizontal ? "horizontal" : "vertical";
             int N = getCount() + 1; // The number of vertices is the number of columns/rows + 1.
+            boolean[] originalCulprits = null;
 
-            // We take one extra pass over traditional Bellman-Ford (and omit their final step)
-            for (int i = 0; i < N; i++) {
-                boolean changed = false;
-                for (int j = 0, length = arcs.length; j < length; j++) {
-                    changed |= relax(locations, arcs[j]);
-                }
-                if (!changed) {
-                    if (DEBUG) {
-                        Log.v(TAG, axis + " iteration completed in " + (1 + i) + " steps of " + N);
+            for (int p = 0; p < arcs.length; p++) {
+                init(locations);
+
+                // We take one extra pass over traditional Bellman-Ford (and omit their final step)
+                for (int i = 0; i < N; i++) {
+                    boolean changed = false;
+                    for (int j = 0, length = arcs.length; j < length; j++) {
+                        changed |= relax(locations, arcs[j]);
                     }
-                    return;
-                }
-            }
-
-            Log.d(TAG, "The " + axis + " constraints contained a contradiction. Resolving... ");
-            Log.d(TAG, Arrays.toString(arcs));
-
-            boolean[] culprits = new boolean[arcs.length];
-            for (int i = 0; i < N; i++) {
-                for (int j = 0, length = arcs.length; j < length; j++) {
-                    culprits[j] |= relax(locations, arcs[j]);
-                }
-            }
-            for (int i = 0; i < culprits.length; i++) {
-                if (culprits[i]) {
-                    Arc arc = arcs[i];
-                    // Only remove max values, min values alone cannot be inconsistent
-                    if (arc.span.min < arc.span.max) {
-                        continue;
+                    if (!changed) {
+                        if (originalCulprits != null) {
+                            logError(axisName, arcs, originalCulprits);
+                        }
+                        if (DEBUG) {
+                            Log.v(TAG, axisName + " iteration completed in " +
+                                    (1 + i) + " steps of " + N);
+                        }
+                        return;
                     }
-                    Log.d(TAG, "Removing: " + arc);
-                    arc.valid = false;
-                    break;
+                }
+
+                boolean[] culprits = new boolean[arcs.length];
+                for (int i = 0; i < N; i++) {
+                    for (int j = 0, length = arcs.length; j < length; j++) {
+                        culprits[j] |= relax(locations, arcs[j]);
+                    }
+                }
+
+                if (p == 0) {
+                    originalCulprits = culprits;
+                }
+
+                for (int i = 0; i < arcs.length; i++) {
+                    if (culprits[i]) {
+                        Arc arc = arcs[i];
+                        // Only remove max values, min values alone cannot be inconsistent
+                        if (arc.span.min < arc.span.max) {
+                            continue;
+                        }
+                        arc.valid = false;
+                        break;
+                    }
                 }
             }
-            solve1(arcs, locations);
-        }
-
-        private void solve1(Arc[] arcs, int[] a) {
-            Arrays.fill(a, MIN_VALUE);
-            a[0] = 0;
-            solve(arcs, a);
         }
 
         private void computeMargins(boolean leading) {
@@ -1410,7 +1480,9 @@
             }
         }
 
-        private int[] getLeadingMargins() {
+        // External entry points
+
+        public int[] getLeadingMargins() {
             if (leadingMargins == null) {
                 leadingMargins = new int[getCount() + 1];
             }
@@ -1421,7 +1493,7 @@
             return leadingMargins;
         }
 
-        private int[] getTrailingMargins() {
+        public int[] getTrailingMargins() {
             if (trailingMargins == null) {
                 trailingMargins = new int[getCount() + 1];
             }
@@ -1433,10 +1505,10 @@
         }
 
         private void computeLocations(int[] a) {
-            solve1(getArcs(), a);
+            solve(getArcs(), a);
         }
 
-        private int[] getLocations() {
+        public int[] getLocations() {
             if (locations == null) {
                 int N = getCount() + 1;
                 locations = new int[N];
@@ -1448,8 +1520,6 @@
             return locations;
         }
 
-        // External entry points
-
         private int size(int[] locations) {
             return max2(locations, 0) - locations[0];
         }
@@ -1465,7 +1535,7 @@
             return size(getLocations());
         }
 
-        private int getMeasure(int measureSpec) {
+        public int getMeasure(int measureSpec) {
             int mode = MeasureSpec.getMode(measureSpec);
             int size = MeasureSpec.getSize(measureSpec);
             switch (mode) {
@@ -1485,13 +1555,13 @@
             }
         }
 
-        private void layout(int size) {
+        public void layout(int size) {
             setParentConstraints(size, size);
             getLocations();
         }
 
-        private void invalidateStructure() {
-            countValid = false;
+        public void invalidateStructure() {
+            inferredCount = UNDEFINED;
 
             groupBounds = null;
             forwardLinks = null;
@@ -1506,7 +1576,7 @@
             invalidateValues();
         }
 
-        private void invalidateValues() {
+        public void invalidateValues() {
             groupBoundsValid = false;
             forwardLinksValid = false;
             backwardLinksValid = false;
@@ -1536,9 +1606,22 @@
      * both aspects of alignment within the cell group. It is also possible to specify a child's
      * alignment within its cell group by using the {@link GridLayout.LayoutParams#setGravity(int)}
      * method.
-     * <p>
-     * See {@link GridLayout} for a description of the conventions used by GridLayout
-     * in reference to grid indices.
+     *
+     * <h4>WRAP_CONTENT and MATCH_PARENT</h4>
+     *
+     * Because the default values of the {@link #width} and {@link #height}
+     * properties are both {@link #WRAP_CONTENT}, this value never needs to be explicitly
+     * declared in the layout parameters of GridLayout's children. In addition,
+     * GridLayout does not distinguish the special size value {@link #MATCH_PARENT} from
+     * {@link #WRAP_CONTENT}. A component's ability to expand to the size of the parent is
+     * instead controlled by the principle of <em>flexibility</em>,
+     * as discussed in {@link GridLayout}.
+     *
+     * <h4>Summary</h4>
+     *
+     * You should not need to use either of the special size values:
+     * {@code WRAP_CONTENT} or {@code MATCH_PARENT} when configuring the children of
+     * a GridLayout.
      *
      * <h4>Default values</h4>
      *
@@ -1561,12 +1644,17 @@
      *          {@link GridLayout#setUseDefaultMargins(boolean) useDefaultMargins} is
      *          {@code false}; otherwise {@link #UNDEFINED}, to
      *          indicate that a default value should be computed on demand. </li>
-     *     <li>{@link #rowSpec}{@code .span} = {@code [0, 1]} </li>
-     *     <li>{@link #rowSpec}{@code .alignment} = {@link #BASELINE} </li>
-     *     <li>{@link #columnSpec}{@code .span} = {@code [0, 1]} </li>
-     *     <li>{@link #columnSpec}{@code .alignment} = {@link #LEFT} </li>
+     *     <li>{@link #rowSpec}<code>.row</code> = {@link #UNDEFINED} </li>
+     *     <li>{@link #rowSpec}<code>.rowSpan</code> = 1 </li>
+     *     <li>{@link #rowSpec}<code>.alignment</code> = {@link #BASELINE} </li>
+     *     <li>{@link #columnSpec}<code>.column</code> = {@link #UNDEFINED} </li>
+     *     <li>{@link #columnSpec}<code>.columnSpan</code> = 1 </li>
+     *     <li>{@link #columnSpec}<code>.alignment</code> = {@link #LEFT} </li>
      * </ul>
      *
+     * See {@link GridLayout} for a more complete description of the conventions
+     * used by GridLayout in the interpretation of the properties of this class.
+     *
      * @attr ref android.R.styleable#GridLayout_Layout_layout_row
      * @attr ref android.R.styleable#GridLayout_Layout_layout_rowSpan
      * @attr ref android.R.styleable#GridLayout_Layout_layout_column
@@ -1606,15 +1694,16 @@
         // Instance variables
 
         /**
-         * The spec that specifies the vertical characteristics of the cell group
+         * The spec that defines the vertical characteristics of the cell group
          * described by these layout parameters.
          */
-        public Spec rowSpec;
+        public Spec rowSpec = Spec.UNDEFINED;
+
         /**
-         * The spec that specifies the horizontal characteristics of the cell group
+         * The spec that defines the horizontal characteristics of the cell group
          * described by these layout parameters.
          */
-        public Spec columnSpec;
+        public Spec columnSpec = Spec.UNDEFINED;
 
         // Constructors
 
@@ -1646,7 +1735,7 @@
          * Constructs a new LayoutParams with default values as defined in {@link LayoutParams}.
          */
         public LayoutParams() {
-            this(spec(UNDEFINED), spec(UNDEFINED));
+            this(Spec.UNDEFINED, Spec.UNDEFINED);
         }
 
         // Copying constructors
@@ -1670,8 +1759,8 @@
          */
         public LayoutParams(LayoutParams that) {
             super(that);
-            this.rowSpec = new Spec(that.rowSpec);
-            this.columnSpec = new Spec(that.columnSpec);
+            this.rowSpec = that.rowSpec;
+            this.columnSpec = that.columnSpec;
         }
 
         // AttributeSet constructors
@@ -1750,11 +1839,11 @@
             this.height = attributes.getLayoutDimension(heightAttr, DEFAULT_HEIGHT);
         }
 
-        private void setRowSpecSpan(Interval span) {
+        final void setRowSpecSpan(Interval span) {
             rowSpec = rowSpec.copyWriteSpan(span);
         }
 
-        private void setColumnSpecSpan(Interval span) {
+        final void setColumnSpecSpan(Interval span) {
             columnSpec = columnSpec.copyWriteSpan(span);
         }
     }
@@ -1763,7 +1852,7 @@
     In place of a HashMap from span to Int, use an array of key/value pairs - stored in Arcs.
     Add the mutables completesCycle flag to avoid creating another hash table for detecting cycles.
      */
-    private static class Arc {
+    final static class Arc {
         public final Interval span;
         public final MutableInt value;
         public boolean valid = true;
@@ -1781,18 +1870,18 @@
 
     // A mutable Integer - used to avoid heap allocation during the layout operation
 
-    private static class MutableInt {
+    final static class MutableInt {
         public int value;
 
-        private MutableInt() {
+        public MutableInt() {
             reset();
         }
 
-        private MutableInt(int value) {
+        public MutableInt(int value) {
             this.value = value;
         }
 
-        private void reset() {
+        public void reset() {
             value = Integer.MIN_VALUE;
         }
 
@@ -1802,7 +1891,7 @@
         }
     }
 
-    private static class Assoc<K, V> extends ArrayList<Pair<K, V>> {
+    final static class Assoc<K, V> extends ArrayList<Pair<K, V>> {
         private final Class<K> keyType;
         private final Class<V> valueType;
 
@@ -1811,7 +1900,7 @@
             this.valueType = valueType;
         }
 
-        private static <K, V> Assoc<K, V> of(Class<K> keyType, Class<V> valueType) {
+        public static <K, V> Assoc<K, V> of(Class<K> keyType, Class<V> valueType) {
             return new Assoc<K, V>(keyType, valueType);
         }
 
@@ -1847,7 +1936,7 @@
     rather than using (and storing) an implementation of Map<Key, ?>.
      */
     @SuppressWarnings(value = "unchecked")
-    private static class PackedMap<K, V> {
+    final static class PackedMap<K, V> {
         public final int[] index;
         public final K[] keys;
         public final V[] values;
@@ -1859,7 +1948,7 @@
             this.values = compact(values, index);
         }
 
-        private V getValue(int i) {
+        public V getValue(int i) {
             return values[index[i]];
         }
 
@@ -1907,7 +1996,7 @@
     group to Bounds and to loop through all Views in the group taking the maximum
     of the values for each View.
     */
-    private static class Bounds {
+    static class Bounds {
         public int before;
         public int after;
         public int flexibility; // we're flexible iff all included specs are flexible
@@ -1969,7 +2058,7 @@
      * Intervals are often written as {@code [min, max]} and represent the set of values
      * {@code x} such that {@code min <= x < max}.
      */
-    static class Interval {
+    final static class Interval {
         /**
          * The minimum value.
          */
@@ -1995,11 +2084,11 @@
             this.max = max;
         }
 
-        private int size() {
+        int size() {
             return max - min;
         }
 
-        private Interval inverse() {
+        Interval inverse() {
             return new Interval(max, min);
         }
 
@@ -2062,32 +2151,31 @@
      * For column groups, this specifies the horizontal alignment.
      */
     public static class Spec {
+        static final Spec UNDEFINED = spec(GridLayout.UNDEFINED);
+
+        final boolean startDefined;
         final Interval span;
         final Alignment alignment;
 
-        private Spec(Interval span, Alignment alignment) {
+        private Spec(boolean startDefined, Interval span, Alignment alignment) {
+            this.startDefined = startDefined;
             this.span = span;
             this.alignment = alignment;
         }
 
-        /* Copying constructor */
-        private Spec(Spec that) {
-            this(that.span, that.alignment);
+        private Spec(boolean startDefined, int start, int size, Alignment alignment) {
+            this(startDefined, new Interval(start, start + size), alignment);
         }
 
-        private Spec(int start, int size, Alignment alignment) {
-            this(new Interval(start, start + size), alignment);
+        final Spec copyWriteSpan(Interval span) {
+            return new Spec(startDefined, span, alignment);
         }
 
-        private Spec copyWriteSpan(Interval span) {
-            return new Spec(span, alignment);
+        final Spec copyWriteAlignment(Alignment alignment) {
+            return new Spec(startDefined, span, alignment);
         }
 
-        private Spec copyWriteAlignment(Alignment alignment) {
-            return new Spec(span, alignment);
-        }
-
-        int getFlexibility() {
+        final int getFlexibility() {
             return (alignment == UNDEFINED_ALIGNMENT) ? INFLEXIBLE : CAN_STRETCH;
         }
 
@@ -2143,7 +2231,7 @@
      * @param alignment the alignment
      */
     public static Spec spec(int start, int size, Alignment alignment) {
-        return new Spec(start, size, alignment);
+        return new Spec(start != UNDEFINED, start, size, alignment);
     }
 
     /**
@@ -2246,7 +2334,7 @@
         }
     }
 
-    private static final Alignment UNDEFINED_ALIGNMENT = new Alignment() {
+    static final Alignment UNDEFINED_ALIGNMENT = new Alignment() {
         public int getAlignmentValue(View view, int viewSize) {
             return UNDEFINED;
         }
@@ -2367,7 +2455,7 @@
         }
     };
 
-    private static boolean canStretch(int flexibility) {
+    static boolean canStretch(int flexibility) {
         return (flexibility & CAN_STRETCH) != 0;
     }
 
diff --git a/core/java/android/widget/OverScroller.java b/core/java/android/widget/OverScroller.java
index e571998..6aee5a0 100644
--- a/core/java/android/widget/OverScroller.java
+++ b/core/java/android/widget/OverScroller.java
@@ -584,10 +584,10 @@
         // A device specific coefficient adjusted to physical values.
         private static float PHYSICAL_COEF;
 
-        private static float DECELERATION_RATE = (float) (Math.log(0.75) / Math.log(0.9));
-        private static final float INFLEXION = 0.4f; // Tension lines cross at (INFLEXION, 1)
-        private static final float START_TENSION = 1.0f;
-        private static final float END_TENSION = 0.6666f;
+        private static float DECELERATION_RATE = (float) (Math.log(0.78) / Math.log(0.9));
+        private static final float INFLEXION = 0.35f; // Tension lines cross at (INFLEXION, 1)
+        private static final float START_TENSION = 0.5f;
+        private static final float END_TENSION = 1.0f;
         private static final float P1 = START_TENSION * INFLEXION;
         private static final float P2 = 1.0f - END_TENSION * (1.0f - INFLEXION);
 
diff --git a/core/java/android/widget/PopupWindow.java b/core/java/android/widget/PopupWindow.java
index 4d45c2f..aac20c4 100644
--- a/core/java/android/widget/PopupWindow.java
+++ b/core/java/android/widget/PopupWindow.java
@@ -796,6 +796,21 @@
      * @param y the popup's y location offset
      */
     public void showAtLocation(View parent, int gravity, int x, int y) {
+        showAtLocation(parent.getWindowToken(), gravity, x, y);
+    }
+
+    /**
+     * Display the content view in a popup window at the specified location.
+     *
+     * @param token Window token to use for creating the new window
+     * @param gravity the gravity which controls the placement of the popup window
+     * @param x the popup's x location offset
+     * @param y the popup's y location offset
+     *
+     * @hide Internal use only. Applications should use
+     *       {@link #showAtLocation(View, int, int, int)} instead.
+     */
+    public void showAtLocation(IBinder token, int gravity, int x, int y) {
         if (isShowing() || mContentView == null) {
             return;
         }
@@ -805,7 +820,7 @@
         mIsShowing = true;
         mIsDropdown = false;
 
-        WindowManager.LayoutParams p = createPopupLayout(parent.getWindowToken());
+        WindowManager.LayoutParams p = createPopupLayout(token);
         p.windowAnimations = computeAnimationResource();
        
         preparePopup(p);
diff --git a/core/java/android/widget/RelativeLayout.java b/core/java/android/widget/RelativeLayout.java
index 6edfd59..12a93ac 100644
--- a/core/java/android/widget/RelativeLayout.java
+++ b/core/java/android/widget/RelativeLayout.java
@@ -212,6 +212,11 @@
      * Describes how the child views are positioned. Defaults to
      * <code>Gravity.LEFT | Gravity.TOP</code>.
      *
+     * <p>Note that since RelativeLayout considers the positioning of each child
+     * relative to one another to be significant, setting gravity will affect
+     * the positioning of all children as a single unit within the parent.
+     * This happens after children have been relatively positioned.</p>
+     *
      * @param gravity See {@link android.view.Gravity}
      *
      * @see #setHorizontalGravity(int)
diff --git a/core/java/android/widget/TextView.java b/core/java/android/widget/TextView.java
index d680f36..af820ac 100644
--- a/core/java/android/widget/TextView.java
+++ b/core/java/android/widget/TextView.java
@@ -8944,14 +8944,8 @@
 
         final boolean isPassword = hasPasswordTransformationMethod();
         if (!isPassword) {
-            CharSequence text = getText();
+            CharSequence text = getTextForAccessibility();
             if (TextUtils.isEmpty(text)) {
-                text = getHint();
-            }
-            if (TextUtils.isEmpty(text)) {
-                text = getContentDescription();
-            }
-            if (!TextUtils.isEmpty(text)) {
                 event.getText().add(text);
             }
         }
@@ -8977,7 +8971,7 @@
 
         final boolean isPassword = hasPasswordTransformationMethod();
         if (!isPassword) {
-            info.setText(getText());
+            info.setText(getTextForAccessibility());
         }
         info.setPassword(isPassword);
     }
@@ -8993,6 +8987,20 @@
         super.sendAccessibilityEvent(eventType);
     }
 
+    /**
+     * Gets the text reported for accessibility purposes. It is the
+     * text if not empty or the hint.
+     *
+     * @return The accessibility text.
+     */
+    private CharSequence getTextForAccessibility() {
+        CharSequence text = getText();
+        if (TextUtils.isEmpty(text)) {
+            text = getHint();
+        }
+        return text;
+    }
+
     void sendAccessibilityEventTypeViewTextChanged(CharSequence beforeText,
             int fromIndex, int removedCount, int addedCount) {
         AccessibilityEvent event =
diff --git a/core/java/com/android/internal/widget/LockPatternUtils.java b/core/java/com/android/internal/widget/LockPatternUtils.java
index 4d828c4..76550cf 100644
--- a/core/java/com/android/internal/widget/LockPatternUtils.java
+++ b/core/java/com/android/internal/widget/LockPatternUtils.java
@@ -756,24 +756,36 @@
     }
 
     /**
-     * @return Whether the lock password is enabled.
+     * @return Whether the lock password is enabled, or if it is set as a backup for biometric weak
      */
     public boolean isLockPasswordEnabled() {
         long mode = getLong(PASSWORD_TYPE_KEY, 0);
-        return savedPasswordExists() &&
-                (mode == DevicePolicyManager.PASSWORD_QUALITY_ALPHABETIC
-                        || mode == DevicePolicyManager.PASSWORD_QUALITY_NUMERIC
-                        || mode == DevicePolicyManager.PASSWORD_QUALITY_ALPHANUMERIC
-                        || mode == DevicePolicyManager.PASSWORD_QUALITY_COMPLEX);
+        long backupMode = getLong(PASSWORD_TYPE_ALTERNATE_KEY, 0);
+        final boolean passwordEnabled = mode == DevicePolicyManager.PASSWORD_QUALITY_ALPHABETIC
+                || mode == DevicePolicyManager.PASSWORD_QUALITY_NUMERIC
+                || mode == DevicePolicyManager.PASSWORD_QUALITY_ALPHANUMERIC
+                || mode == DevicePolicyManager.PASSWORD_QUALITY_COMPLEX;
+        final boolean backupEnabled = backupMode == DevicePolicyManager.PASSWORD_QUALITY_ALPHABETIC
+                || backupMode == DevicePolicyManager.PASSWORD_QUALITY_NUMERIC
+                || backupMode == DevicePolicyManager.PASSWORD_QUALITY_ALPHANUMERIC
+                || backupMode == DevicePolicyManager.PASSWORD_QUALITY_COMPLEX;
+
+        return savedPasswordExists() && (passwordEnabled ||
+                (isBiometricEnabled() && backupEnabled));
     }
 
     /**
-     * @return Whether the lock pattern is enabled.
+     * @return Whether the lock pattern is enabled, or if it is set as a backup for biometric weak
      */
     public boolean isLockPatternEnabled() {
+        final boolean backupEnabled =
+                getLong(PASSWORD_TYPE_ALTERNATE_KEY, DevicePolicyManager.PASSWORD_QUALITY_SOMETHING)
+                == DevicePolicyManager.PASSWORD_QUALITY_SOMETHING;
+
         return getBoolean(Settings.Secure.LOCK_PATTERN_ENABLED)
-                && getLong(PASSWORD_TYPE_KEY, DevicePolicyManager.PASSWORD_QUALITY_SOMETHING)
-                        == DevicePolicyManager.PASSWORD_QUALITY_SOMETHING;
+                && (getLong(PASSWORD_TYPE_KEY, DevicePolicyManager.PASSWORD_QUALITY_SOMETHING)
+                        == DevicePolicyManager.PASSWORD_QUALITY_SOMETHING ||
+                        (isBiometricEnabled() && backupEnabled));
     }
 
     /**
@@ -923,8 +935,7 @@
                 || mode == DevicePolicyManager.PASSWORD_QUALITY_ALPHANUMERIC
                 || mode == DevicePolicyManager.PASSWORD_QUALITY_COMPLEX;
         final boolean secure = isPattern && isLockPatternEnabled() && savedPatternExists()
-                || isPassword && savedPasswordExists()
-                || usingBiometricWeak() && isBiometricEnabled();
+                || isPassword && savedPasswordExists();
         return secure;
     }
 
diff --git a/core/java/com/android/server/NetworkManagementSocketTagger.java b/core/java/com/android/server/NetworkManagementSocketTagger.java
index 9f6ab31..8445ad1 100644
--- a/core/java/com/android/server/NetworkManagementSocketTagger.java
+++ b/core/java/com/android/server/NetworkManagementSocketTagger.java
@@ -75,30 +75,20 @@
             Log.d(TAG, "tagSocket(" + fd.getInt$() + ") with statsTag=0x"
                     + Integer.toHexString(options.statsTag) + ", statsUid=" + options.statsUid);
         }
-        try {
-            // TODO: skip tagging when options would be no-op
-            tagSocketFd(fd, options.statsTag, options.statsUid);
-        } catch (IOException e) {
-            throw new SocketException("Problem tagging socket", e);
-        }
+        // TODO: skip tagging when options would be no-op
+        tagSocketFd(fd, options.statsTag, options.statsUid);
     }
 
-    private void tagSocketFd(FileDescriptor fd, int tag, int uid) throws IOException {
-        final int fdNum = fd.getInt$();
-        if (fdNum == -1 || (tag == -1 && uid == -1)) return;
+    private void tagSocketFd(FileDescriptor fd, int tag, int uid) {
+        int errno;
+        if (tag == -1 && uid == -1) return;
 
-        String cmd = "t " + fdNum;
-        if (tag == -1) {
-            // Case where just the uid needs adjusting. But probably the caller
-            // will want to track his own name here, just in case.
-            cmd += " 0";
-        } else {
-            cmd += " " + tagToKernel(tag);
+        errno = native_tagSocketFd(fd, tag, uid);
+        if (errno < 0) {
+            Log.i(TAG, "tagSocketFd(" + fd.getInt$() + ", "
+                  + tag + ", " +
+                  + uid + ") failed with errno" + errno);
         }
-        if (uid != -1) {
-            cmd += " " + uid;
-        }
-        internalModuleCtrl(cmd);
     }
 
     @Override
@@ -106,19 +96,18 @@
         if (LOGD) {
             Log.i(TAG, "untagSocket(" + fd.getInt$() + ")");
         }
-        try {
-            unTagSocketFd(fd);
-        } catch (IOException e) {
-            throw new SocketException("Problem untagging socket", e);
-        }
+        unTagSocketFd(fd);
     }
 
-    private void unTagSocketFd(FileDescriptor fd) throws IOException {
-        int fdNum = fd.getInt$();
+    private void unTagSocketFd(FileDescriptor fd) {
         final SocketTags options = threadSocketTags.get();
-        if (fdNum == -1 || (options.statsTag == -1 && options.statsUid == -1)) return;
-        String cmd = "u " + fdNum;
-        internalModuleCtrl(cmd);
+        int errno;
+        if (options.statsTag == -1 && options.statsUid == -1) return;
+
+        errno = native_untagSocketFd(fd);
+        if (errno < 0) {
+            Log.w(TAG, "untagSocket(" + fd.getInt$() + ") failed with errno " + errno);
+        }
     }
 
     public static class SocketTags {
@@ -127,69 +116,20 @@
     }
 
     public static void setKernelCounterSet(int uid, int counterSet) {
-        final StringBuilder command = new StringBuilder();
-        command.append("s ").append(counterSet).append(" ").append(uid);
-        try {
-            internalModuleCtrl(command.toString());
-        } catch (IOException e) {
-            Slog.w(TAG, "problem changing counter set for uid " + uid + " : " + e);
+        int errno = native_setCounterSet(counterSet, uid);
+        if (errno < 0) {
+            Log.w(TAG, "setKernelCountSet(" + uid + ", " + counterSet + ") failed with errno " + errno);
         }
     }
 
     public static void resetKernelUidStats(int uid) {
-        final StringBuilder command = new StringBuilder();
-        command.append("d 0 ").append(uid);
-        try {
-            internalModuleCtrl(command.toString());
-        } catch (IOException e) {
-            Slog.w(TAG, "problem clearing counters for uid " + uid + " : " + e);
+        int errno = native_deleteTagData(0, uid);
+        if (errno < 0) {
+            Slog.w(TAG, "problem clearing counters for uid " + uid + " : errno " + errno);
         }
     }
 
     /**
-     * Sends commands to the kernel netfilter module.
-     *
-     * @param cmd command string for the qtaguid netfilter module. May not be null.
-     *   <p>Supports:
-     *     <ul><li>tag a socket:<br>
-     *        <code>t <i>sock_fd</i> <i>acct_tag</i> [<i>uid_in_case_caller_is_acting_on_behalf_of</i>]</code><br>
-     *     <code>*_tag</code> defaults to default_policy_tag_from_uid(uid_of_caller)<br>
-     *     <code>acct_tag</code> is either 0 or greater that 2^32.<br>
-     *     <code>uid_*</code> is only settable by privileged UIDs (DownloadManager,...)
-     *     </li>
-     *     <li>untag a socket, preserving counters:<br>
-     *       <code>u <i>sock_fd</i></code>
-     *     </li></ul>
-     *   <p>Notes:<br>
-     *   <ul><li><i>sock_fd</i> is withing the callers process space.</li>
-     *   <li><i>*_tag</i> are 64bit values</li></ul>
-     *
-     */
-    private static void internalModuleCtrl(String cmd) throws IOException {
-        if (!SystemProperties.getBoolean(PROP_QTAGUID_ENABLED, false)) return;
-
-        // TODO: migrate to native library for tagging commands
-        FileOutputStream procOut = null;
-        try {
-            procOut = new FileOutputStream("/proc/net/xt_qtaguid/ctrl");
-            procOut.write(cmd.getBytes(Charsets.US_ASCII));
-        } finally {
-            IoUtils.closeQuietly(procOut);
-        }
-    }
-
-    /**
-     * Convert {@link Integer} tag to {@code /proc/} format. Assumes unsigned
-     * base-10 format like {@code 2147483647}. Currently strips signed bit to
-     * avoid using {@link BigInteger}.
-     */
-    public static String tagToKernel(int tag) {
-        // TODO: eventually write in hex, since that's what proc exports
-        // TODO: migrate to direct integer instead of odd shifting
-        return Long.toString((((long) tag) << 32) & 0x7FFFFFFF00000000L);
-    }
-
-    /**
      * Convert {@code /proc/} tag format to {@link Integer}. Assumes incoming
      * format like {@code 0x7fffffff00000000}.
      */
@@ -197,4 +137,9 @@
         // TODO: migrate to direct integer instead of odd shifting
         return (int) (Long.decode(string) >> 32);
     }
+
+    private static native int native_tagSocketFd(FileDescriptor fd, int tag, int uid);
+    private static native int native_untagSocketFd(FileDescriptor fd);
+    private static native int native_setCounterSet(int uid, int counterSetNum);
+    private static native int native_deleteTagData(int tag, int uid);
 }
diff --git a/core/jni/Android.mk b/core/jni/Android.mk
index aece5f0..59a03e7 100644
--- a/core/jni/Android.mk
+++ b/core/jni/Android.mk
@@ -143,6 +143,7 @@
 	android_server_BluetoothService.cpp \
 	android_server_BluetoothEventLoop.cpp \
 	android_server_BluetoothA2dpService.cpp \
+	android_server_NetworkManagementSocketTagger.cpp \
 	android_server_Watchdog.cpp \
 	android_ddm_DdmHandleNativeHeap.cpp \
 	com_android_internal_os_ZygoteInit.cpp \
diff --git a/core/jni/AndroidRuntime.cpp b/core/jni/AndroidRuntime.cpp
index dd7dd86..12ec1b6 100644
--- a/core/jni/AndroidRuntime.cpp
+++ b/core/jni/AndroidRuntime.cpp
@@ -155,6 +155,7 @@
 extern int register_android_server_BluetoothService(JNIEnv* env);
 extern int register_android_server_BluetoothEventLoop(JNIEnv *env);
 extern int register_android_server_BluetoothA2dpService(JNIEnv* env);
+extern int register_android_server_NetworkManagementSocketTagger(JNIEnv* env);
 extern int register_android_server_Watchdog(JNIEnv* env);
 extern int register_android_ddm_DdmHandleNativeHeap(JNIEnv *env);
 extern int register_com_android_internal_os_ZygoteInit(JNIEnv* env);
@@ -1178,6 +1179,7 @@
     REG_JNI(register_android_server_BluetoothService),
     REG_JNI(register_android_server_BluetoothEventLoop),
     REG_JNI(register_android_server_BluetoothA2dpService),
+    REG_JNI(register_android_server_NetworkManagementSocketTagger),
     REG_JNI(register_android_server_Watchdog),
     REG_JNI(register_android_ddm_DdmHandleNativeHeap),
     REG_JNI(register_android_backup_BackupDataInput),
diff --git a/core/jni/android/graphics/TextLayout.cpp b/core/jni/android/graphics/TextLayout.cpp
index fa9a7b7..a2d6efb 100644
--- a/core/jni/android/graphics/TextLayout.cpp
+++ b/core/jni/android/graphics/TextLayout.cpp
@@ -271,19 +271,11 @@
     }
 }
 
-void TextLayout::getTextRunAdvancesHB(SkPaint* paint, const jchar* chars, jint start,
-                                    jint count, jint contextCount, jint dirFlags,
-                                    jfloat* resultAdvances, jfloat& resultTotalAdvance) {
-    // Compute advances and return them
-    TextLayoutCacheValue::computeValuesWithHarfbuzz(paint, chars, start, count, contextCount,
-            dirFlags, resultAdvances, &resultTotalAdvance, NULL, NULL);
-}
-
 void TextLayout::getTextRunAdvancesICU(SkPaint* paint, const jchar* chars, jint start,
                                     jint count, jint contextCount, jint dirFlags,
                                     jfloat* resultAdvances, jfloat& resultTotalAdvance) {
     // Compute advances and return them
-    TextLayoutCacheValue::computeAdvancesWithICU(paint, chars, start, count, contextCount, dirFlags,
+    computeAdvancesWithICU(paint, chars, start, count, contextCount, dirFlags,
             resultAdvances, &resultTotalAdvance);
 }
 
@@ -321,4 +313,73 @@
     }
 }
 
+void TextLayout::computeAdvancesWithICU(SkPaint* paint, const UChar* chars,
+        size_t start, size_t count, size_t contextCount, int dirFlags,
+        jfloat* outAdvances, jfloat* outTotalAdvance) {
+    SkAutoSTMalloc<CHAR_BUFFER_SIZE, jchar> tempBuffer(contextCount);
+    jchar* buffer = tempBuffer.get();
+    SkScalar* scalarArray = (SkScalar*)outAdvances;
+
+    // this is where we'd call harfbuzz
+    // for now we just use ushape.c
+    size_t widths;
+    const jchar* text;
+    if (dirFlags & 0x1) { // rtl, call arabic shaping in case
+        UErrorCode status = U_ZERO_ERROR;
+        // Use fixed length since we need to keep start and count valid
+        u_shapeArabic(chars, contextCount, buffer, contextCount,
+                U_SHAPE_LENGTH_FIXED_SPACES_NEAR |
+                U_SHAPE_TEXT_DIRECTION_LOGICAL | U_SHAPE_LETTERS_SHAPE |
+                U_SHAPE_X_LAMALEF_SUB_ALTERNATE, &status);
+        // we shouldn't fail unless there's an out of memory condition,
+        // in which case we're hosed anyway
+        for (int i = start, e = i + count; i < e; ++i) {
+            if (buffer[i] == UNICODE_NOT_A_CHAR) {
+                buffer[i] = UNICODE_ZWSP; // zero-width-space for skia
+            }
+        }
+        text = buffer + start;
+        widths = paint->getTextWidths(text, count << 1, scalarArray);
+    } else {
+        text = chars + start;
+        widths = paint->getTextWidths(text, count << 1, scalarArray);
+    }
+
+    jfloat totalAdvance = 0;
+    if (widths < count) {
+#if DEBUG_ADVANCES
+    LOGD("ICU -- count=%d", widths);
+#endif
+        // Skia operates on code points, not code units, so surrogate pairs return only
+        // one value. Expand the result so we have one value per UTF-16 code unit.
+
+        // Note, skia's getTextWidth gets confused if it encounters a surrogate pair,
+        // leaving the remaining widths zero.  Not nice.
+        for (size_t i = 0, p = 0; i < widths; ++i) {
+            totalAdvance += outAdvances[p++] = SkScalarToFloat(scalarArray[i]);
+            if (p < count &&
+                    text[p] >= UNICODE_FIRST_LOW_SURROGATE &&
+                    text[p] < UNICODE_FIRST_PRIVATE_USE &&
+                    text[p-1] >= UNICODE_FIRST_HIGH_SURROGATE &&
+                    text[p-1] < UNICODE_FIRST_LOW_SURROGATE) {
+                outAdvances[p++] = 0;
+            }
+#if DEBUG_ADVANCES
+            LOGD("icu-adv = %f - total = %f", outAdvances[i], totalAdvance);
+#endif
+        }
+    } else {
+#if DEBUG_ADVANCES
+    LOGD("ICU -- count=%d", count);
+#endif
+        for (size_t i = 0; i < count; i++) {
+            totalAdvance += outAdvances[i] = SkScalarToFloat(scalarArray[i]);
+#if DEBUG_ADVANCES
+            LOGD("icu-adv = %f - total = %f", outAdvances[i], totalAdvance);
+#endif
+        }
+    }
+    *outTotalAdvance = totalAdvance;
+}
+
 }
diff --git a/core/jni/android/graphics/TextLayout.h b/core/jni/android/graphics/TextLayout.h
index 0a29d78..9d8913c 100644
--- a/core/jni/android/graphics/TextLayout.h
+++ b/core/jni/android/graphics/TextLayout.h
@@ -77,10 +77,6 @@
                                    jint count, jint contextCount, jint dirFlags,
                                    jfloat* resultAdvances, jfloat& resultTotalAdvance);
 
-    static void getTextRunAdvancesHB(SkPaint* paint, const jchar* chars, jint start,
-                                   jint count, jint contextCount, jint dirFlags,
-                                   jfloat* resultAdvances, jfloat& resultTotalAdvance);
-
     static void drawText(SkPaint* paint, const jchar* text, jsize len,
                          jint bidiFlags, jfloat x, jfloat y, SkCanvas* canvas);
 
@@ -106,5 +102,9 @@
                            UErrorCode &status);
     static void handleText(SkPaint* paint, const jchar* text, jsize len,
                            int bidiFlags, jfloat x, jfloat y, SkCanvas* canvas, SkPath* path);
+
+    static void computeAdvancesWithICU(SkPaint* paint, const UChar* chars,
+            size_t start, size_t count, size_t contextCount, int dirFlags,
+            jfloat* outAdvances, jfloat* outTotalAdvance);
 };
 } // namespace android
diff --git a/core/jni/android/graphics/TextLayoutCache.cpp b/core/jni/android/graphics/TextLayoutCache.cpp
index d04e059..e4eeec8 100644
--- a/core/jni/android/graphics/TextLayoutCache.cpp
+++ b/core/jni/android/graphics/TextLayoutCache.cpp
@@ -52,13 +52,7 @@
     mCacheStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
 
     if (mDebugEnabled) {
-        LOGD("Start time: %lld", mCacheStartTime);
-#if RTL_USE_HARFBUZZ
-        LOGD("Using HARFBUZZ");
-#else
-        LOGD("Using ICU");
-#endif
-        LOGD("Initialization is done");
+        LOGD("Initialization is done - Start time: %lld", mCacheStartTime);
     }
 
     mInitialized = true;
@@ -242,6 +236,24 @@
     hinting = paint->getHinting();
 }
 
+TextLayoutCacheKey::TextLayoutCacheKey(const TextLayoutCacheKey& other) :
+        text(NULL),
+        textCopy(other.textCopy),
+        start(other.start),
+        count(other.count),
+        contextCount(other.contextCount),
+        dirFlags(other.dirFlags),
+        typeface(other.typeface),
+        textSize(other.textSize),
+        textSkewX(other.textSkewX),
+        textScaleX(other.textScaleX),
+        flags(other.flags),
+        hinting(other.hinting) {
+    if (other.text) {
+        textCopy.setTo(other.text);
+    }
+}
+
 bool TextLayoutCacheKey::operator<(const TextLayoutCacheKey& rhs) const {
     LTE_INT(count) {
         LTE_INT(contextCount) {
@@ -253,7 +265,7 @@
                                 LTE_INT(flags) {
                                     LTE_INT(hinting) {
                                         LTE_INT(dirFlags) {
-                                            return strncmp16(text, rhs.text, contextCount) < 0;
+                                            return strncmp16(getText(), rhs.getText(), contextCount) < 0;
                                         }
                                     }
                                 }
@@ -269,7 +281,7 @@
 
 void TextLayoutCacheKey::internalTextCopy() {
     textCopy.setTo(text, contextCount);
-    text = textCopy.string();
+    text = NULL;
 }
 
 size_t TextLayoutCacheKey::getSize() {
@@ -280,13 +292,7 @@
  * TextLayoutCacheValue
  */
 TextLayoutCacheValue::TextLayoutCacheValue() :
-        mAdvances(NULL), mTotalAdvance(0), mAdvancesCount(0),
-        mGlyphs(NULL), mGlyphsCount(0), mElapsedTime(0) {
-}
-
-TextLayoutCacheValue::~TextLayoutCacheValue() {
-    delete[] mAdvances;
-    delete[] mGlyphs;
+        mTotalAdvance(0), mElapsedTime(0) {
 }
 
 void TextLayoutCacheValue::setElapsedTime(uint32_t time) {
@@ -299,16 +305,11 @@
 
 void TextLayoutCacheValue::computeValues(SkPaint* paint, const UChar* chars, size_t start,
         size_t count, size_t contextCount, int dirFlags) {
-    mAdvancesCount = count;
-    mAdvances = new float[count];
-
-#if RTL_USE_HARFBUZZ
+    // Give a hint for advances and glyphs vectors size
+    mAdvances.setCapacity(count);
+    mGlyphs.setCapacity(count);
     computeValuesWithHarfbuzz(paint, chars, start, count, contextCount, dirFlags,
-            mAdvances, &mTotalAdvance, &mGlyphs, &mGlyphsCount);
-#else
-    computeAdvancesWithICU(paint, chars, start, count, contextCount, dirFlags,
-            mAdvances, &mTotalAdvance);
-#endif
+            &mAdvances, &mTotalAdvance, &mGlyphs);
 #if DEBUG_ADVANCES
     LOGD("Advances - count=%d - countextCount=%d - totalAdvance=%f - "
             "adv[0]=%f adv[1]=%f adv[2]=%f adv[3]=%f", count, contextCount, mTotalAdvance,
@@ -317,8 +318,8 @@
 }
 
 size_t TextLayoutCacheValue::getSize() {
-    return sizeof(TextLayoutCacheValue) + sizeof(jfloat) * mAdvancesCount +
-            sizeof(jchar) * mGlyphsCount;
+    return sizeof(TextLayoutCacheValue) + sizeof(jfloat) * mAdvances.capacity() +
+            sizeof(jchar) * mGlyphs.capacity();
 }
 
 void TextLayoutCacheValue::setupShaperItem(HB_ShaperItem* shaperItem, HB_FontRec* font,
@@ -389,27 +390,10 @@
     }
 }
 
-struct GlyphRun {
-    inline GlyphRun() {}
-    inline GlyphRun(jchar* glyphs, size_t glyphsCount, bool isRTL) :
-            glyphs(glyphs), glyphsCount(glyphsCount), isRTL(isRTL) { }
-    jchar* glyphs;
-    size_t glyphsCount;
-    int isRTL;
-};
-
-void static reverseGlyphArray(jchar* glyphs, size_t count) {
-    for (size_t i = 0; i < count / 2; i++) {
-        jchar temp = glyphs[i];
-        glyphs[i] = glyphs[count - 1 - i];
-        glyphs[count - 1 - i] = temp;
-    }
-}
-
 void TextLayoutCacheValue::computeValuesWithHarfbuzz(SkPaint* paint, const UChar* chars,
         size_t start, size_t count, size_t contextCount, int dirFlags,
-        jfloat* outAdvances, jfloat* outTotalAdvance,
-        jchar** outGlyphs, size_t* outGlyphsCount) {
+        Vector<jfloat>* const outAdvances, jfloat* outTotalAdvance,
+        Vector<jchar>* const outGlyphs) {
 
         UBiDiLevel bidiReq = 0;
         bool forceLTR = false;
@@ -430,11 +414,7 @@
                             forceLTR, forceRTL);
 #endif
             computeRunValuesWithHarfbuzz(paint, chars, start, count, contextCount, forceRTL,
-                    outAdvances, outTotalAdvance, outGlyphs, outGlyphsCount);
-
-            if (forceRTL && *outGlyphsCount > 1) {
-                reverseGlyphArray(*outGlyphs, *outGlyphsCount);
-            }
+                    outAdvances, outTotalAdvance, outGlyphs);
         } else {
             UBiDi* bidi = ubidi_open();
             if (bidi) {
@@ -456,15 +436,8 @@
                                 "-- run-start=%d run-len=%d isRTL=%d", start, count, isRTL);
 #endif
                         computeRunValuesWithHarfbuzz(paint, chars, start, count, contextCount,
-                                isRTL, outAdvances, outTotalAdvance, outGlyphs, outGlyphsCount);
-
-                        if (isRTL && *outGlyphsCount > 1) {
-                            reverseGlyphArray(*outGlyphs, *outGlyphsCount);
-                        }
+                                isRTL, outAdvances, outTotalAdvance, outGlyphs);
                     } else {
-                        Vector<GlyphRun> glyphRuns;
-                        jchar* runGlyphs;
-                        size_t runGlyphsCount = 0;
                         int32_t end = start + count;
                         for (size_t i = 0; i < rc; ++i) {
                             int32_t startRun;
@@ -498,34 +471,9 @@
                             computeRunValuesWithHarfbuzz(paint, chars, startRun,
                                     lengthRun, contextCount, isRTL,
                                     outAdvances, &runTotalAdvance,
-                                    &runGlyphs, &runGlyphsCount);
+                                    outGlyphs);
 
-                            outAdvances += lengthRun;
                             *outTotalAdvance += runTotalAdvance;
-                            *outGlyphsCount += runGlyphsCount;
-#if DEBUG_GLYPHS
-                            LOGD("computeValuesWithHarfbuzz -- run=%d run-glyphs-count=%d",
-                                    i, runGlyphsCount);
-                            for (size_t j = 0; j < runGlyphsCount; j++) {
-                                LOGD("                          -- glyphs[%d]=%d", j, runGlyphs[j]);
-                            }
-#endif
-                            glyphRuns.push(GlyphRun(runGlyphs, runGlyphsCount, isRTL));
-                        }
-                        *outGlyphs = new jchar[*outGlyphsCount];
-
-                        jchar* glyphs = *outGlyphs;
-                        for (size_t i = 0; i < glyphRuns.size(); i++) {
-                            const GlyphRun& glyphRun = glyphRuns.itemAt(i);
-                            if (glyphRun.isRTL) {
-                                for (size_t n = 0; n < glyphRun.glyphsCount; n++) {
-                                    glyphs[glyphRun.glyphsCount - n - 1] = glyphRun.glyphs[n];
-                                }
-                            } else {
-                                memcpy(glyphs, glyphRun.glyphs, glyphRun.glyphsCount * sizeof(jchar));
-                            }
-                            glyphs += glyphRun.glyphsCount;
-                            delete[] glyphRun.glyphs;
                         }
                     }
                 }
@@ -538,22 +486,18 @@
                         "-- run-start=%d run-len=%d isRTL=%d", start, count, isRTL);
 #endif
                 computeRunValuesWithHarfbuzz(paint, chars, start, count, contextCount, isRTL,
-                        outAdvances, outTotalAdvance, outGlyphs, outGlyphsCount);
-
-                if (isRTL && *outGlyphsCount > 1) {
-                    reverseGlyphArray(*outGlyphs, *outGlyphsCount);
-                }
+                        outAdvances, outTotalAdvance, outGlyphs);
             }
         }
 #if DEBUG_GLYPHS
-        LOGD("computeValuesWithHarfbuzz -- total-glyphs-count=%d", *outGlyphsCount);
+        LOGD("computeValuesWithHarfbuzz -- total-glyphs-count=%d", outGlyphs->size());
 #endif
 }
 
 static void logGlyphs(HB_ShaperItem shaperItem) {
     LOGD("Got glyphs - count=%d", shaperItem.num_glyphs);
     for (size_t i = 0; i < shaperItem.num_glyphs; i++) {
-        LOGD("      glyphs[%d]=%d - offset.x=%f offset.y=%f", i, shaperItem.glyphs[i],
+        LOGD("      glyph[%d]=%d - offset.x=%f offset.y=%f", i, shaperItem.glyphs[i],
                 HBFixedToFloat(shaperItem.offsets[i].x),
                 HBFixedToFloat(shaperItem.offsets[i].y));
     }
@@ -561,12 +505,13 @@
 
 void TextLayoutCacheValue::computeRunValuesWithHarfbuzz(SkPaint* paint, const UChar* chars,
         size_t start, size_t count, size_t contextCount, bool isRTL,
-        jfloat* outAdvances, jfloat* outTotalAdvance,
-        jchar** outGlyphs, size_t* outGlyphsCount) {
+        Vector<jfloat>* const outAdvances, jfloat* outTotalAdvance,
+        Vector<jchar>* const outGlyphs) {
 
     HB_ShaperItem shaperItem;
     HB_FontRec font;
     FontData fontData;
+
     shapeWithHarfbuzz(&shaperItem, &font, &fontData, paint, chars, start, count,
             contextCount, isRTL);
 
@@ -583,30 +528,28 @@
 #if DEBUG_GLYPHS
     LOGD("HARFBUZZ -- advances array is empty or num_glypth = 0");
 #endif
-        for (size_t i = 0; i < count; i++) {
-            outAdvances[i] = 0;
-        }
+        outAdvances->insertAt(0, outAdvances->size(), count);
         *outTotalAdvance = 0;
 
-        if (outGlyphs) {
-            *outGlyphsCount = 0;
-            *outGlyphs = new jchar[0];
-        }
-
         // Cleaning
         deleteGlyphArrays(&shaperItem);
         HB_FreeFace(shaperItem.face);
         return;
     }
+
     // Get Advances and their total
-    jfloat totalAdvance = outAdvances[0] = HBFixedToFloat(shaperItem.advances[shaperItem.log_clusters[0]]);
+    jfloat currentAdvance = HBFixedToFloat(shaperItem.advances[shaperItem.log_clusters[0]]);
+    jfloat totalAdvance = currentAdvance;
+    outAdvances->add(currentAdvance);
     for (size_t i = 1; i < count; i++) {
         size_t clusterPrevious = shaperItem.log_clusters[i - 1];
         size_t cluster = shaperItem.log_clusters[i];
         if (cluster == clusterPrevious) {
-            outAdvances[i] = 0;
+            outAdvances->add(0);
         } else {
-            totalAdvance += outAdvances[i] = HBFixedToFloat(shaperItem.advances[shaperItem.log_clusters[i]]);
+            currentAdvance = HBFixedToFloat(shaperItem.advances[shaperItem.log_clusters[i]]);
+            totalAdvance += currentAdvance;
+            outAdvances->add(currentAdvance);
         }
     }
     *outTotalAdvance = totalAdvance;
@@ -618,12 +561,15 @@
     }
 #endif
 
-    // Get Glyphs
+    // Get Glyphs and reverse them in place if RTL
     if (outGlyphs) {
-        *outGlyphsCount = shaperItem.num_glyphs;
-        *outGlyphs = new jchar[shaperItem.num_glyphs];
-        for (size_t i = 0; i < shaperItem.num_glyphs; i++) {
-            (*outGlyphs)[i] = (jchar) shaperItem.glyphs[i];
+        size_t count = shaperItem.num_glyphs;
+        for (size_t i = 0; i < count; i++) {
+            jchar glyph = (jchar) shaperItem.glyphs[(!isRTL) ? i : count - 1 - i];
+#if DEBUG_GLYPHS
+            LOGD("HARFBUZZ  -- glyph[%d]=%d", i, glyph);
+#endif
+            outGlyphs->add(glyph);
         }
     }
 
@@ -632,75 +578,6 @@
     HB_FreeFace(shaperItem.face);
 }
 
-void TextLayoutCacheValue::computeAdvancesWithICU(SkPaint* paint, const UChar* chars,
-        size_t start, size_t count, size_t contextCount, int dirFlags,
-        jfloat* outAdvances, jfloat* outTotalAdvance) {
-    SkAutoSTMalloc<CHAR_BUFFER_SIZE, jchar> tempBuffer(contextCount);
-    jchar* buffer = tempBuffer.get();
-    SkScalar* scalarArray = (SkScalar*)outAdvances;
-
-    // this is where we'd call harfbuzz
-    // for now we just use ushape.c
-    size_t widths;
-    const jchar* text;
-    if (dirFlags & 0x1) { // rtl, call arabic shaping in case
-        UErrorCode status = U_ZERO_ERROR;
-        // Use fixed length since we need to keep start and count valid
-        u_shapeArabic(chars, contextCount, buffer, contextCount,
-                U_SHAPE_LENGTH_FIXED_SPACES_NEAR |
-                U_SHAPE_TEXT_DIRECTION_LOGICAL | U_SHAPE_LETTERS_SHAPE |
-                U_SHAPE_X_LAMALEF_SUB_ALTERNATE, &status);
-        // we shouldn't fail unless there's an out of memory condition,
-        // in which case we're hosed anyway
-        for (int i = start, e = i + count; i < e; ++i) {
-            if (buffer[i] == UNICODE_NOT_A_CHAR) {
-                buffer[i] = UNICODE_ZWSP; // zero-width-space for skia
-            }
-        }
-        text = buffer + start;
-        widths = paint->getTextWidths(text, count << 1, scalarArray);
-    } else {
-        text = chars + start;
-        widths = paint->getTextWidths(text, count << 1, scalarArray);
-    }
-
-    jfloat totalAdvance = 0;
-    if (widths < count) {
-#if DEBUG_ADVANCES
-    LOGD("ICU -- count=%d", widths);
-#endif
-        // Skia operates on code points, not code units, so surrogate pairs return only
-        // one value. Expand the result so we have one value per UTF-16 code unit.
-
-        // Note, skia's getTextWidth gets confused if it encounters a surrogate pair,
-        // leaving the remaining widths zero.  Not nice.
-        for (size_t i = 0, p = 0; i < widths; ++i) {
-            totalAdvance += outAdvances[p++] = SkScalarToFloat(scalarArray[i]);
-            if (p < count &&
-                    text[p] >= UNICODE_FIRST_LOW_SURROGATE &&
-                    text[p] < UNICODE_FIRST_PRIVATE_USE &&
-                    text[p-1] >= UNICODE_FIRST_HIGH_SURROGATE &&
-                    text[p-1] < UNICODE_FIRST_LOW_SURROGATE) {
-                outAdvances[p++] = 0;
-            }
-#if DEBUG_ADVANCES
-            LOGD("icu-adv = %f - total = %f", outAdvances[i], totalAdvance);
-#endif
-        }
-    } else {
-#if DEBUG_ADVANCES
-    LOGD("ICU -- count=%d", count);
-#endif
-        for (size_t i = 0; i < count; i++) {
-            totalAdvance += outAdvances[i] = SkScalarToFloat(scalarArray[i]);
-#if DEBUG_ADVANCES
-            LOGD("icu-adv = %f - total = %f", outAdvances[i], totalAdvance);
-#endif
-        }
-    }
-    *outTotalAdvance = totalAdvance;
-}
-
 void TextLayoutCacheValue::deleteGlyphArrays(HB_ShaperItem* shaperItem) {
     delete[] shaperItem->glyphs;
     delete[] shaperItem->attributes;
diff --git a/core/jni/android/graphics/TextLayoutCache.h b/core/jni/android/graphics/TextLayoutCache.h
index 0d8d71f..1f08bda 100644
--- a/core/jni/android/graphics/TextLayoutCache.h
+++ b/core/jni/android/graphics/TextLayoutCache.h
@@ -72,6 +72,8 @@
             const UChar* text, size_t start, size_t count,
             size_t contextCount, int dirFlags);
 
+    TextLayoutCacheKey(const TextLayoutCacheKey& other);
+
     bool operator<(const TextLayoutCacheKey& rhs) const;
 
     /**
@@ -86,7 +88,7 @@
     size_t getSize();
 
 private:
-    const UChar* text;
+    const UChar* text; // if text is NULL, use textCopy
     String16 textCopy;
     size_t start;
     size_t count;
@@ -98,15 +100,16 @@
     SkScalar textScaleX;
     uint32_t flags;
     SkPaint::Hinting hinting;
+
+    inline const UChar* getText() const {
+        return text ? text : textCopy.string();
+    }
 }; // TextLayoutCacheKey
 
 /*
  * TextLayoutCacheValue is the Cache value
  */
 class TextLayoutCacheValue : public RefBase {
-protected:
-    ~TextLayoutCacheValue();
-
 public:
     TextLayoutCacheValue();
 
@@ -116,11 +119,11 @@
     void computeValues(SkPaint* paint, const UChar* chars, size_t start, size_t count,
             size_t contextCount, int dirFlags);
 
-    inline const jfloat* getAdvances() const { return mAdvances; }
-    inline size_t getAdvancesCount() const { return mAdvancesCount; }
+    inline const jfloat* getAdvances() const { return mAdvances.array(); }
+    inline size_t getAdvancesCount() const { return mAdvances.size(); }
     inline jfloat getTotalAdvance() const { return mTotalAdvance; }
-    inline const jchar* getGlyphs() const { return mGlyphs; }
-    inline size_t getGlyphsCount() const { return mGlyphsCount; }
+    inline const jchar* getGlyphs() const { return mGlyphs.array(); }
+    inline size_t getGlyphsCount() const { return mGlyphs.size(); }
 
     /**
      * Get the size of the Cache entry
@@ -137,8 +140,8 @@
 
     static void computeValuesWithHarfbuzz(SkPaint* paint, const UChar* chars, size_t start,
             size_t count, size_t contextCount, int dirFlags,
-            jfloat* outAdvances, jfloat* outTotalAdvance,
-            jchar** outGlyphs, size_t* outGlyphsCount);
+            Vector<jfloat>* const outAdvances, jfloat* outTotalAdvance,
+            Vector<jchar>* const outGlyphs);
 
     static void computeAdvancesWithICU(SkPaint* paint, const UChar* chars, size_t start,
             size_t count, size_t contextCount, int dirFlags,
@@ -146,9 +149,9 @@
 
 private:
     /**
-     * Advances array
+     * Advances vector
      */
-    jfloat* mAdvances;
+    Vector<jfloat> mAdvances;
 
     /**
      * Total number of advances
@@ -156,19 +159,9 @@
     jfloat mTotalAdvance;
 
     /**
-     * Allocated size for advances array
+     * Glyphs vector
      */
-    size_t mAdvancesCount;
-
-    /**
-     * Glyphs array
-     */
-    jchar* mGlyphs;
-
-    /**
-     * Total number of glyphs
-     */
-    size_t mGlyphsCount;
+    Vector<jchar> mGlyphs;
 
     /**
      * Time for computing the values (in milliseconds)
@@ -181,8 +174,8 @@
 
     static void computeRunValuesWithHarfbuzz(SkPaint* paint, const UChar* chars, size_t start,
             size_t count, size_t contextCount, bool isRTL,
-            jfloat* outAdvances, jfloat* outTotalAdvance,
-            jchar** outGlyphs, size_t* outGlyphsCount);
+            Vector<jfloat>* const outAdvances, jfloat* outTotalAdvance,
+            Vector<jchar>* const outGlyphs);
 }; // TextLayoutCacheValue
 
 /**
diff --git a/core/jni/android_server_NetworkManagementSocketTagger.cpp b/core/jni/android_server_NetworkManagementSocketTagger.cpp
new file mode 100644
index 0000000..c279ced
--- /dev/null
+++ b/core/jni/android_server_NetworkManagementSocketTagger.cpp
@@ -0,0 +1,97 @@
+/*
+ * Copyright 2011, 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.
+ */
+
+#define LOG_TAG "NMST_QTagUidNative"
+#include <utils/Log.h>
+
+#include "JNIHelp.h"
+
+#include "jni.h"
+#include <utils/misc.h>
+#include <cutils/qtaguid.h>
+
+#include <errno.h>
+#include <fcntl.h>
+#include <sys/types.h>
+#include <sys/socket.h>
+
+namespace android {
+
+static jint QTagUid_tagSocketFd(JNIEnv* env, jclass,
+                                jobject fileDescriptor,
+                                jint tagNum, jint uid) {
+  int userFd = jniGetFDFromFileDescriptor(env, fileDescriptor);
+
+  if (env->ExceptionOccurred() != NULL) {
+    LOGE("Can't get FileDescriptor num");
+    return (jint)-1;
+  }
+
+  int res = qtaguid_tagSocket(userFd, tagNum, uid);
+  if (res < 0) {
+    return (jint)-errno;
+  }
+  return (jint)res;
+}
+
+static int QTagUid_untagSocketFd(JNIEnv* env, jclass,
+                                 jobject fileDescriptor) {
+  int userFd = jniGetFDFromFileDescriptor(env, fileDescriptor);
+
+  if (env->ExceptionOccurred() != NULL) {
+    LOGE("Can't get FileDescriptor num");
+    return (jint)-1;
+  }
+
+  int res = qtaguid_untagSocket(userFd);
+  if (res < 0) {
+    return (jint)-errno;
+  }
+  return (jint)res;
+}
+
+static jint QTagUid_setCounterSet(JNIEnv* env, jclass,
+                                  jint setNum, jint uid) {
+
+  int res = qtaguid_setCounterSet(setNum, uid);
+  if (res < 0) {
+    return (jint)-errno;
+  }
+  return (jint)res;
+}
+
+static jint QTagUid_deleteTagData(JNIEnv* env, jclass,
+                                  jint tagNum, jint uid) {
+
+  int res = qtaguid_deleteTagData(tagNum, uid);
+  if (res < 0) {
+    return (jint)-errno;
+  }
+  return (jint)res;
+}
+
+static JNINativeMethod gQTagUidMethods[] = {
+  { "native_tagSocketFd", "(Ljava/io/FileDescriptor;II)I", (void*)QTagUid_tagSocketFd},
+  { "native_untagSocketFd", "(Ljava/io/FileDescriptor;)I", (void*)QTagUid_untagSocketFd},
+  { "native_setCounterSet", "(II)I", (void*)QTagUid_setCounterSet},
+  { "native_deleteTagData", "(II)I", (void*)QTagUid_deleteTagData},
+};
+
+int register_android_server_NetworkManagementSocketTagger(JNIEnv* env) {
+  return jniRegisterNativeMethods(env, "com/android/server/NetworkManagementSocketTagger", gQTagUidMethods, NELEM(gQTagUidMethods));
+}
+
+};
diff --git a/core/res/res/drawable-hdpi/progressbar_indeterminate_holo1.png b/core/res/res/drawable-hdpi/progressbar_indeterminate_holo1.png
index 1d33e47..bf3cabb 100644
--- a/core/res/res/drawable-hdpi/progressbar_indeterminate_holo1.png
+++ b/core/res/res/drawable-hdpi/progressbar_indeterminate_holo1.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/progressbar_indeterminate_holo2.png b/core/res/res/drawable-hdpi/progressbar_indeterminate_holo2.png
index 81fe085..c4f00be 100644
--- a/core/res/res/drawable-hdpi/progressbar_indeterminate_holo2.png
+++ b/core/res/res/drawable-hdpi/progressbar_indeterminate_holo2.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/progressbar_indeterminate_holo3.png b/core/res/res/drawable-hdpi/progressbar_indeterminate_holo3.png
index cf864d2..935e44f 100644
--- a/core/res/res/drawable-hdpi/progressbar_indeterminate_holo3.png
+++ b/core/res/res/drawable-hdpi/progressbar_indeterminate_holo3.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/progressbar_indeterminate_holo4.png b/core/res/res/drawable-hdpi/progressbar_indeterminate_holo4.png
index 583e0c9..03ae28b 100644
--- a/core/res/res/drawable-hdpi/progressbar_indeterminate_holo4.png
+++ b/core/res/res/drawable-hdpi/progressbar_indeterminate_holo4.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/progressbar_indeterminate_holo5.png b/core/res/res/drawable-hdpi/progressbar_indeterminate_holo5.png
index 357b660..b68981f 100644
--- a/core/res/res/drawable-hdpi/progressbar_indeterminate_holo5.png
+++ b/core/res/res/drawable-hdpi/progressbar_indeterminate_holo5.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/progressbar_indeterminate_holo6.png b/core/res/res/drawable-hdpi/progressbar_indeterminate_holo6.png
index 0add340..678b772 100644
--- a/core/res/res/drawable-hdpi/progressbar_indeterminate_holo6.png
+++ b/core/res/res/drawable-hdpi/progressbar_indeterminate_holo6.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/progressbar_indeterminate_holo7.png b/core/res/res/drawable-hdpi/progressbar_indeterminate_holo7.png
index e1a8a63..0aeb0a6 100644
--- a/core/res/res/drawable-hdpi/progressbar_indeterminate_holo7.png
+++ b/core/res/res/drawable-hdpi/progressbar_indeterminate_holo7.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/progressbar_indeterminate_holo8.png b/core/res/res/drawable-hdpi/progressbar_indeterminate_holo8.png
index 934d6d1..1bd7312 100644
--- a/core/res/res/drawable-hdpi/progressbar_indeterminate_holo8.png
+++ b/core/res/res/drawable-hdpi/progressbar_indeterminate_holo8.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/progressbar_indeterminate_holo1.png b/core/res/res/drawable-mdpi/progressbar_indeterminate_holo1.png
index 4cab1a1..1e5d956 100644
--- a/core/res/res/drawable-mdpi/progressbar_indeterminate_holo1.png
+++ b/core/res/res/drawable-mdpi/progressbar_indeterminate_holo1.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/progressbar_indeterminate_holo2.png b/core/res/res/drawable-mdpi/progressbar_indeterminate_holo2.png
index 2692bd1..d0c0200 100644
--- a/core/res/res/drawable-mdpi/progressbar_indeterminate_holo2.png
+++ b/core/res/res/drawable-mdpi/progressbar_indeterminate_holo2.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/progressbar_indeterminate_holo3.png b/core/res/res/drawable-mdpi/progressbar_indeterminate_holo3.png
index d83cad9..bfdc5ea 100644
--- a/core/res/res/drawable-mdpi/progressbar_indeterminate_holo3.png
+++ b/core/res/res/drawable-mdpi/progressbar_indeterminate_holo3.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/progressbar_indeterminate_holo4.png b/core/res/res/drawable-mdpi/progressbar_indeterminate_holo4.png
index 4ef84a1..1440bc8 100644
--- a/core/res/res/drawable-mdpi/progressbar_indeterminate_holo4.png
+++ b/core/res/res/drawable-mdpi/progressbar_indeterminate_holo4.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/progressbar_indeterminate_holo5.png b/core/res/res/drawable-mdpi/progressbar_indeterminate_holo5.png
index f661b11..4f645fa8 100644
--- a/core/res/res/drawable-mdpi/progressbar_indeterminate_holo5.png
+++ b/core/res/res/drawable-mdpi/progressbar_indeterminate_holo5.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/progressbar_indeterminate_holo6.png b/core/res/res/drawable-mdpi/progressbar_indeterminate_holo6.png
index 69df8e0..21966fd 100644
--- a/core/res/res/drawable-mdpi/progressbar_indeterminate_holo6.png
+++ b/core/res/res/drawable-mdpi/progressbar_indeterminate_holo6.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/progressbar_indeterminate_holo7.png b/core/res/res/drawable-mdpi/progressbar_indeterminate_holo7.png
index c34f0a5..7ca15ed 100644
--- a/core/res/res/drawable-mdpi/progressbar_indeterminate_holo7.png
+++ b/core/res/res/drawable-mdpi/progressbar_indeterminate_holo7.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/progressbar_indeterminate_holo8.png b/core/res/res/drawable-mdpi/progressbar_indeterminate_holo8.png
index 2258b20..369d0ac 100644
--- a/core/res/res/drawable-mdpi/progressbar_indeterminate_holo8.png
+++ b/core/res/res/drawable-mdpi/progressbar_indeterminate_holo8.png
Binary files differ
diff --git a/core/res/res/drawable-xhdpi/progressbar_indeterminate_holo1.png b/core/res/res/drawable-xhdpi/progressbar_indeterminate_holo1.png
index f96a4a6..ca24502 100644
--- a/core/res/res/drawable-xhdpi/progressbar_indeterminate_holo1.png
+++ b/core/res/res/drawable-xhdpi/progressbar_indeterminate_holo1.png
Binary files differ
diff --git a/core/res/res/drawable-xhdpi/progressbar_indeterminate_holo2.png b/core/res/res/drawable-xhdpi/progressbar_indeterminate_holo2.png
index 3a6554f..5653118 100644
--- a/core/res/res/drawable-xhdpi/progressbar_indeterminate_holo2.png
+++ b/core/res/res/drawable-xhdpi/progressbar_indeterminate_holo2.png
Binary files differ
diff --git a/core/res/res/drawable-xhdpi/progressbar_indeterminate_holo3.png b/core/res/res/drawable-xhdpi/progressbar_indeterminate_holo3.png
index 30bd7ad..438b1b5 100644
--- a/core/res/res/drawable-xhdpi/progressbar_indeterminate_holo3.png
+++ b/core/res/res/drawable-xhdpi/progressbar_indeterminate_holo3.png
Binary files differ
diff --git a/core/res/res/drawable-xhdpi/progressbar_indeterminate_holo4.png b/core/res/res/drawable-xhdpi/progressbar_indeterminate_holo4.png
index 209036b..efe3fed 100644
--- a/core/res/res/drawable-xhdpi/progressbar_indeterminate_holo4.png
+++ b/core/res/res/drawable-xhdpi/progressbar_indeterminate_holo4.png
Binary files differ
diff --git a/core/res/res/drawable-xhdpi/progressbar_indeterminate_holo5.png b/core/res/res/drawable-xhdpi/progressbar_indeterminate_holo5.png
index 830820b..cb7931c 100644
--- a/core/res/res/drawable-xhdpi/progressbar_indeterminate_holo5.png
+++ b/core/res/res/drawable-xhdpi/progressbar_indeterminate_holo5.png
Binary files differ
diff --git a/core/res/res/drawable-xhdpi/progressbar_indeterminate_holo6.png b/core/res/res/drawable-xhdpi/progressbar_indeterminate_holo6.png
index 39eb204..8ff7ee9 100644
--- a/core/res/res/drawable-xhdpi/progressbar_indeterminate_holo6.png
+++ b/core/res/res/drawable-xhdpi/progressbar_indeterminate_holo6.png
Binary files differ
diff --git a/core/res/res/drawable-xhdpi/progressbar_indeterminate_holo7.png b/core/res/res/drawable-xhdpi/progressbar_indeterminate_holo7.png
index a2d4dc2..ce07298 100644
--- a/core/res/res/drawable-xhdpi/progressbar_indeterminate_holo7.png
+++ b/core/res/res/drawable-xhdpi/progressbar_indeterminate_holo7.png
Binary files differ
diff --git a/core/res/res/drawable-xhdpi/progressbar_indeterminate_holo8.png b/core/res/res/drawable-xhdpi/progressbar_indeterminate_holo8.png
index 1772aea..87e9d8f 100644
--- a/core/res/res/drawable-xhdpi/progressbar_indeterminate_holo8.png
+++ b/core/res/res/drawable-xhdpi/progressbar_indeterminate_holo8.png
Binary files differ
diff --git a/core/res/res/drawable/btn_cab_done_holo_dark.xml b/core/res/res/drawable/btn_cab_done_holo_dark.xml
index 2cdb605..65d3496 100644
--- a/core/res/res/drawable/btn_cab_done_holo_dark.xml
+++ b/core/res/res/drawable/btn_cab_done_holo_dark.xml
@@ -14,9 +14,8 @@
      limitations under the License.
 -->
 
-<selector xmlns:android="http://schemas.android.com/apk/res/android">
-    <item android:state_window_focused="false" android:state_enabled="true"
-        android:drawable="@drawable/btn_cab_done_default_holo_dark" />
+<selector xmlns:android="http://schemas.android.com/apk/res/android"
+          android:exitFadeDuration="@android:integer/config_mediumAnimTime">
     <item android:state_pressed="true"
         android:drawable="@drawable/btn_cab_done_pressed_holo_dark" />
     <item android:state_focused="true" android:state_enabled="true"
diff --git a/core/res/res/drawable/btn_cab_done_holo_light.xml b/core/res/res/drawable/btn_cab_done_holo_light.xml
index 81add4c..f6a63f4 100644
--- a/core/res/res/drawable/btn_cab_done_holo_light.xml
+++ b/core/res/res/drawable/btn_cab_done_holo_light.xml
@@ -14,9 +14,8 @@
      limitations under the License.
 -->
 
-<selector xmlns:android="http://schemas.android.com/apk/res/android">
-    <item android:state_window_focused="false" android:state_enabled="true"
-        android:drawable="@drawable/btn_cab_done_default_holo_light" />
+<selector xmlns:android="http://schemas.android.com/apk/res/android"
+          android:exitFadeDuration="@android:integer/config_mediumAnimTime">
     <item android:state_pressed="true"
         android:drawable="@drawable/btn_cab_done_pressed_holo_light" />
     <item android:state_focused="true" android:state_enabled="true"
diff --git a/core/res/res/drawable/item_background_holo_dark.xml b/core/res/res/drawable/item_background_holo_dark.xml
index 2d4f20a..f188df7 100644
--- a/core/res/res/drawable/item_background_holo_dark.xml
+++ b/core/res/res/drawable/item_background_holo_dark.xml
@@ -17,8 +17,6 @@
 <selector xmlns:android="http://schemas.android.com/apk/res/android"
           android:exitFadeDuration="@android:integer/config_mediumAnimTime">
 
-    <item android:state_window_focused="false" android:drawable="@color/transparent" />
-
     <!-- Even though these two point to the same resource, have two states so the drawable will invalidate itself when coming out of pressed state. -->
     <item android:state_focused="true"  android:state_enabled="false" android:state_pressed="true" android:drawable="@drawable/list_selector_disabled_holo_dark" />
     <item android:state_focused="true"  android:state_enabled="false"                              android:drawable="@drawable/list_selector_disabled_holo_dark" />
diff --git a/core/res/res/drawable/item_background_holo_light.xml b/core/res/res/drawable/item_background_holo_light.xml
index c616d86..ee3f4d8 100644
--- a/core/res/res/drawable/item_background_holo_light.xml
+++ b/core/res/res/drawable/item_background_holo_light.xml
@@ -17,8 +17,6 @@
 <selector xmlns:android="http://schemas.android.com/apk/res/android"
           android:exitFadeDuration="@android:integer/config_mediumAnimTime">
 
-    <item android:state_window_focused="false" android:drawable="@color/transparent" />
-
     <!-- Even though these two point to the same resource, have two states so the drawable will invalidate itself when coming out of pressed state. -->
     <item android:state_focused="true"  android:state_enabled="false" android:state_pressed="true" android:drawable="@drawable/list_selector_disabled_holo_light" />
     <item android:state_focused="true"  android:state_enabled="false"                              android:drawable="@drawable/list_selector_disabled_holo_light" />
diff --git a/core/res/res/layout/keyguard_screen_glogin_unlock.xml b/core/res/res/layout/keyguard_screen_glogin_unlock.xml
index 0e5fe78..35d113c 100644
--- a/core/res/res/layout/keyguard_screen_glogin_unlock.xml
+++ b/core/res/res/layout/keyguard_screen_glogin_unlock.xml
@@ -119,7 +119,7 @@
         android:layout_height="wrap_content"
         android:layout_gravity="center"
         android:drawableLeft="@drawable/ic_emergency"
-        android:drawablePadding="8dip"
+        android:drawablePadding="4dip"
         android:text="@android:string/lockscreen_emergency_call"
         />
 
diff --git a/core/res/res/layout/keyguard_screen_lock.xml b/core/res/res/layout/keyguard_screen_lock.xml
index 6e4fa7d..43867f4 100644
--- a/core/res/res/layout/keyguard_screen_lock.xml
+++ b/core/res/res/layout/keyguard_screen_lock.xml
@@ -211,7 +211,7 @@
             android:layout_marginTop="5dip"
             android:layout_gravity="center_horizontal"
             android:drawableLeft="@drawable/ic_emergency"
-            android:drawablePadding="8dip"
+            android:drawablePadding="4dip"
             android:text="@android:string/lockscreen_emergency_call"
            />
 
diff --git a/core/res/res/layout/keyguard_screen_password_portrait.xml b/core/res/res/layout/keyguard_screen_password_portrait.xml
index cf3bd42..27a51da 100644
--- a/core/res/res/layout/keyguard_screen_password_portrait.xml
+++ b/core/res/res/layout/keyguard_screen_password_portrait.xml
@@ -178,4 +178,17 @@
         android:layout_height="0dip"
         />
 
+    <!-- Area to overlay FaceLock -->
+    <TextView android:id="@+id/faceLockAreaView"
+        android:visibility="gone"
+        android:layout_row="3"
+        android:layout_column="0"
+        android:layout_rowSpan="2"
+        android:layout_columnSpan="1"
+        android:layout_gravity="fill"
+        android:layout_width="0dip"
+        android:layout_height="0dip"
+        android:background="@color/facelock_color_background"
+    />
+
 </GridLayout>
diff --git a/core/res/res/layout/keyguard_screen_sim_pin_landscape.xml b/core/res/res/layout/keyguard_screen_sim_pin_landscape.xml
index dff2a3f..59065e1 100644
--- a/core/res/res/layout/keyguard_screen_sim_pin_landscape.xml
+++ b/core/res/res/layout/keyguard_screen_sim_pin_landscape.xml
@@ -113,7 +113,7 @@
             android:layout_marginLeft="8dip"
             android:textSize="18sp"
             android:drawableLeft="@drawable/ic_emergency"
-            android:drawablePadding="8dip"
+            android:drawablePadding="4dip"
         />
     </LinearLayout>
 
diff --git a/core/res/res/layout/keyguard_screen_sim_pin_portrait.xml b/core/res/res/layout/keyguard_screen_sim_pin_portrait.xml
index d8bea56..6e8a645 100644
--- a/core/res/res/layout/keyguard_screen_sim_pin_portrait.xml
+++ b/core/res/res/layout/keyguard_screen_sim_pin_portrait.xml
@@ -111,7 +111,7 @@
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
             android:drawableLeft="@android:drawable/ic_emergency"
-            android:drawablePadding="8dip"
+            android:drawablePadding="4dip"
             android:text="@android:string/lockscreen_emergency_call"
         />
     </LinearLayout>
diff --git a/core/res/res/layout/keyguard_screen_sim_puk_landscape.xml b/core/res/res/layout/keyguard_screen_sim_puk_landscape.xml
index 11a6e12..b662e82 100644
--- a/core/res/res/layout/keyguard_screen_sim_puk_landscape.xml
+++ b/core/res/res/layout/keyguard_screen_sim_puk_landscape.xml
@@ -175,7 +175,7 @@
             android:layout_marginLeft="8dip"
             android:textSize="18sp"
             android:drawableLeft="@drawable/ic_emergency"
-            android:drawablePadding="8dip"
+            android:drawablePadding="4dip"
         />
     </LinearLayout>
 
diff --git a/core/res/res/layout/keyguard_screen_sim_puk_portrait.xml b/core/res/res/layout/keyguard_screen_sim_puk_portrait.xml
index e5e0459..0f2ae0c 100644
--- a/core/res/res/layout/keyguard_screen_sim_puk_portrait.xml
+++ b/core/res/res/layout/keyguard_screen_sim_puk_portrait.xml
@@ -177,7 +177,7 @@
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
             android:drawableLeft="@android:drawable/ic_emergency"
-            android:drawablePadding="8dip"
+            android:drawablePadding="4dip"
             android:text="@android:string/lockscreen_emergency_call"
         />
     </LinearLayout>
diff --git a/core/res/res/layout/keyguard_screen_tab_unlock.xml b/core/res/res/layout/keyguard_screen_tab_unlock.xml
index 0368530..4349c5b 100644
--- a/core/res/res/layout/keyguard_screen_tab_unlock.xml
+++ b/core/res/res/layout/keyguard_screen_tab_unlock.xml
@@ -29,7 +29,8 @@
     android:gravity="center_horizontal">
 
     <com.android.internal.widget.DigitalClock android:id="@+id/time"
-        android:layout_marginBottom="18dip"
+        android:layout_marginTop="@dimen/keyguard_lockscreen_status_line_clockfont_top_margin"
+        android:layout_marginBottom="12dip"
         android:layout_marginRight="@dimen/keyguard_lockscreen_status_line_font_right_margin"
         android:layout_gravity="right">
 
@@ -149,7 +150,7 @@
             android:layout_width="fill_parent"
             android:layout_height="wrap_content"
             android:layout_alignParentBottom="true"
-            android:layout_marginBottom="8dip"
+            android:layout_marginBottom="12dip"
             android:gravity="center_horizontal"
             android:singleLine="true"
             android:ellipsize="marquee"
diff --git a/core/res/res/layout/keyguard_screen_tab_unlock_land.xml b/core/res/res/layout/keyguard_screen_tab_unlock_land.xml
index 2849376..294f91e 100644
--- a/core/res/res/layout/keyguard_screen_tab_unlock_land.xml
+++ b/core/res/res/layout/keyguard_screen_tab_unlock_land.xml
@@ -104,6 +104,7 @@
         android:id="@+id/carrier"
         android:layout_width="0dip"
         android:layout_gravity="fill_horizontal"
+        android:layout_marginBottom="12dip"
         android:gravity="right"
         android:singleLine="true"
         android:ellipsize="marquee"
diff --git a/core/res/res/layout/keyguard_screen_unlock_portrait.xml b/core/res/res/layout/keyguard_screen_unlock_portrait.xml
index 64c479f..03fc79e 100644
--- a/core/res/res/layout/keyguard_screen_unlock_portrait.xml
+++ b/core/res/res/layout/keyguard_screen_unlock_portrait.xml
@@ -28,7 +28,8 @@
     android:gravity="center_horizontal">
 
     <com.android.internal.widget.DigitalClock android:id="@+id/time"
-        android:layout_marginBottom="18dip"
+        android:layout_marginTop="@dimen/keyguard_lockscreen_status_line_clockfont_top_margin"
+        android:layout_marginBottom="12dip"
         android:layout_marginRight="@dimen/keyguard_lockscreen_status_line_font_right_margin"
         android:layout_gravity="right">
 
@@ -171,4 +172,19 @@
         android:layout_height="0dip"
         />
 
+    <!-- Area to overlay FaceLock -->
+    <TextView android:id="@+id/faceLockAreaView"
+        android:visibility="gone"
+        android:layout_row="4"
+        android:layout_column="0"
+        android:layout_rowSpan="1"
+        android:layout_columnSpan="1"
+        android:layout_gravity="fill"
+        android:layout_marginTop="8dip"
+        android:layout_marginBottom="8dip"
+        android:layout_width="0dip"
+        android:layout_height="0dip"
+        android:background="@color/facelock_color_background"
+    />
+
 </GridLayout>
diff --git a/core/res/res/layout/volume_adjust.xml b/core/res/res/layout/volume_adjust.xml
index ea4e1f9..c16a12c 100644
--- a/core/res/res/layout/volume_adjust.xml
+++ b/core/res/res/layout/volume_adjust.xml
@@ -21,7 +21,6 @@
         android:id="@+id/visible_panel"
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
-        android:layout_marginTop="80dp"
         android:background="@android:drawable/dialog_full_holo_dark"
         android:orientation="horizontal"
         >
diff --git a/core/res/res/layout/webview_find.xml b/core/res/res/layout/webview_find.xml
index 4cf2df5..a628ac8 100644
--- a/core/res/res/layout/webview_find.xml
+++ b/core/res/res/layout/webview_find.xml
@@ -26,7 +26,7 @@
         android:scrollHorizontally="true"
         android:inputType="text"
         android:hint="@string/find_on_page"
-        android:imeOptions="actionDone"
+        android:imeOptions="actionDone|flagNoExtractUi|flagNoFullscreen"
         android:layout_marginRight="10dip"
         />
     <TextView android:id="@+id/matches"
diff --git a/core/res/res/values-af/strings.xml b/core/res/res/values-af/strings.xml
index d093735..dfd8ff8 100644
--- a/core/res/res/values-af/strings.xml
+++ b/core/res/res/values-af/strings.xml
@@ -1109,6 +1109,12 @@
     <string name="sync_undo_deletes" msgid="8610996708225006328">"Ontdoen die uitvee."</string>
     <string name="sync_do_nothing" msgid="8717589462945226869">"Doen vir eers niks."</string>
     <string name="choose_account_label" msgid="4191313562041125787">"Kies \'n rekening"</string>
+    <!-- no translation found for add_account_label (2935267344849993553) -->
+    <skip />
+    <!-- no translation found for choose_account_text (6891230675141555481) -->
+    <skip />
+    <!-- no translation found for add_account_button_label (3611982894853435874) -->
+    <skip />
     <string name="number_picker_increment_button" msgid="4830170763103463443">"Verhoging"</string>
     <string name="number_picker_decrement_button" msgid="2576606679160067262">"Verminder"</string>
     <string name="number_picker_increment_scroll_mode" msgid="1343063395404990189">"<xliff:g id="VALUE">%s</xliff:g> tik en hou."</string>
@@ -1140,6 +1146,7 @@
     <string name="keyboardview_keycode_mode_change" msgid="4547387741906537519">"Modus verander"</string>
     <string name="keyboardview_keycode_shift" msgid="2270748814315147690">"Shift"</string>
     <string name="keyboardview_keycode_enter" msgid="2985864015076059467">"Invoersleutel"</string>
+    <string name="content_description_sliding_handle" msgid="7311938669217173870">"Glyhandvatsel. Tik en hou."</string>
     <string name="description_direction_up" msgid="1983114130441878529">"Op na <xliff:g id="TARGET_DESCRIPTION">%s</xliff:g>."</string>
     <string name="description_direction_down" msgid="4294993639091088240">"Af vir <xliff:g id="TARGET_DESCRIPTION">%s</xliff:g>."</string>
     <string name="description_direction_left" msgid="6814008463839915747">"Links vir <xliff:g id="TARGET_DESCRIPTION">%s</xliff:g>."</string>
diff --git a/core/res/res/values-am/strings.xml b/core/res/res/values-am/strings.xml
index 386b8d1..ddb1baf 100644
--- a/core/res/res/values-am/strings.xml
+++ b/core/res/res/values-am/strings.xml
@@ -1113,6 +1113,12 @@
     <string name="sync_undo_deletes" msgid="8610996708225006328">"ስርዞቹን ቀልብስ።"</string>
     <string name="sync_do_nothing" msgid="8717589462945226869">"ለአሁን ምንም አታድርግ።"</string>
     <string name="choose_account_label" msgid="4191313562041125787">"መለያ ምረጥ"</string>
+    <!-- no translation found for add_account_label (2935267344849993553) -->
+    <skip />
+    <!-- no translation found for choose_account_text (6891230675141555481) -->
+    <skip />
+    <!-- no translation found for add_account_button_label (3611982894853435874) -->
+    <skip />
     <string name="number_picker_increment_button" msgid="4830170763103463443">"ጨምር"</string>
     <string name="number_picker_decrement_button" msgid="2576606679160067262">"ቀንስ"</string>
     <string name="number_picker_increment_scroll_mode" msgid="1343063395404990189">"<xliff:g id="VALUE">%s</xliff:g> አንዴ ንካ እና ያዝ"</string>
@@ -1144,6 +1150,7 @@
     <string name="keyboardview_keycode_mode_change" msgid="4547387741906537519">"ሞድ ለውጥ"</string>
     <string name="keyboardview_keycode_shift" msgid="2270748814315147690">"ቀይር"</string>
     <string name="keyboardview_keycode_enter" msgid="2985864015076059467">"አስገባ"</string>
+    <string name="content_description_sliding_handle" msgid="7311938669217173870">"Sliding handle. Tap and hold."</string>
     <string name="description_direction_up" msgid="1983114130441878529">"<xliff:g id="TARGET_DESCRIPTION">%s</xliff:g> ወደላይ።"</string>
     <string name="description_direction_down" msgid="4294993639091088240">"<xliff:g id="TARGET_DESCRIPTION">%s</xliff:g> ወደታች።"</string>
     <string name="description_direction_left" msgid="6814008463839915747">"<xliff:g id="TARGET_DESCRIPTION">%s</xliff:g> ወደግራ።"</string>
diff --git a/core/res/res/values-ar/strings.xml b/core/res/res/values-ar/strings.xml
index fe804f6..0386ab4 100644
--- a/core/res/res/values-ar/strings.xml
+++ b/core/res/res/values-ar/strings.xml
@@ -1113,6 +1113,12 @@
     <string name="sync_undo_deletes" msgid="8610996708225006328">"التراجع عن عمليات الحذف"</string>
     <string name="sync_do_nothing" msgid="8717589462945226869">"عدم تنفيذ أي شيء الآن"</string>
     <string name="choose_account_label" msgid="4191313562041125787">"حدد حسابًا."</string>
+    <!-- no translation found for add_account_label (2935267344849993553) -->
+    <skip />
+    <!-- no translation found for choose_account_text (6891230675141555481) -->
+    <skip />
+    <!-- no translation found for add_account_button_label (3611982894853435874) -->
+    <skip />
     <string name="number_picker_increment_button" msgid="4830170763103463443">"زيادة"</string>
     <string name="number_picker_decrement_button" msgid="2576606679160067262">"تناقص"</string>
     <string name="number_picker_increment_scroll_mode" msgid="1343063395404990189">"<xliff:g id="VALUE">%s</xliff:g> انقر مع الاستمرار."</string>
@@ -1144,6 +1150,7 @@
     <string name="keyboardview_keycode_mode_change" msgid="4547387741906537519">"تغيير الوضع"</string>
     <string name="keyboardview_keycode_shift" msgid="2270748814315147690">"العالي"</string>
     <string name="keyboardview_keycode_enter" msgid="2985864015076059467">"Enter"</string>
+    <string name="content_description_sliding_handle" msgid="7311938669217173870">"مقبض التمرير. انقر وامسك."</string>
     <string name="description_direction_up" msgid="1983114130441878529">"أعلى إلى <xliff:g id="TARGET_DESCRIPTION">%s</xliff:g>."</string>
     <string name="description_direction_down" msgid="4294993639091088240">"أسفل إلى <xliff:g id="TARGET_DESCRIPTION">%s</xliff:g>."</string>
     <string name="description_direction_left" msgid="6814008463839915747">"يسارًا إلى <xliff:g id="TARGET_DESCRIPTION">%s</xliff:g>."</string>
diff --git a/core/res/res/values-bg/strings.xml b/core/res/res/values-bg/strings.xml
index 3d13dc5..c55322b 100644
--- a/core/res/res/values-bg/strings.xml
+++ b/core/res/res/values-bg/strings.xml
@@ -1113,6 +1113,12 @@
     <string name="sync_undo_deletes" msgid="8610996708225006328">"Отмяна на изтриванията."</string>
     <string name="sync_do_nothing" msgid="8717589462945226869">"Да не се прави нищо засега."</string>
     <string name="choose_account_label" msgid="4191313562041125787">"Избор на профил"</string>
+    <!-- no translation found for add_account_label (2935267344849993553) -->
+    <skip />
+    <!-- no translation found for choose_account_text (6891230675141555481) -->
+    <skip />
+    <!-- no translation found for add_account_button_label (3611982894853435874) -->
+    <skip />
     <string name="number_picker_increment_button" msgid="4830170763103463443">"Увеличаване"</string>
     <string name="number_picker_decrement_button" msgid="2576606679160067262">"Намаляване"</string>
     <string name="number_picker_increment_scroll_mode" msgid="1343063395404990189">"Докоснете <xliff:g id="VALUE">%s</xliff:g> път/и и задръжте."</string>
@@ -1144,6 +1150,7 @@
     <string name="keyboardview_keycode_mode_change" msgid="4547387741906537519">"Промяна на режима"</string>
     <string name="keyboardview_keycode_shift" msgid="2270748814315147690">"Shift"</string>
     <string name="keyboardview_keycode_enter" msgid="2985864015076059467">"Enter"</string>
+    <string name="content_description_sliding_handle" msgid="7311938669217173870">"Плъзгаща се дръжка. Докоснете и задръжте."</string>
     <string name="description_direction_up" msgid="1983114130441878529">"Нагоре за <xliff:g id="TARGET_DESCRIPTION">%s</xliff:g>."</string>
     <string name="description_direction_down" msgid="4294993639091088240">"Надолу за <xliff:g id="TARGET_DESCRIPTION">%s</xliff:g>."</string>
     <string name="description_direction_left" msgid="6814008463839915747">"Наляво за <xliff:g id="TARGET_DESCRIPTION">%s</xliff:g>."</string>
diff --git a/core/res/res/values-ca/strings.xml b/core/res/res/values-ca/strings.xml
index b97376e..1ee5c74 100644
--- a/core/res/res/values-ca/strings.xml
+++ b/core/res/res/values-ca/strings.xml
@@ -1109,6 +1109,12 @@
     <string name="sync_undo_deletes" msgid="8610996708225006328">"Desfés les supressions."</string>
     <string name="sync_do_nothing" msgid="8717589462945226869">"No facis res de moment."</string>
     <string name="choose_account_label" msgid="4191313562041125787">"Selecciona un compte"</string>
+    <!-- no translation found for add_account_label (2935267344849993553) -->
+    <skip />
+    <!-- no translation found for choose_account_text (6891230675141555481) -->
+    <skip />
+    <!-- no translation found for add_account_button_label (3611982894853435874) -->
+    <skip />
     <string name="number_picker_increment_button" msgid="4830170763103463443">"Incrementa"</string>
     <string name="number_picker_decrement_button" msgid="2576606679160067262">"Disminueix"</string>
     <string name="number_picker_increment_scroll_mode" msgid="1343063395404990189">"<xliff:g id="VALUE">%s</xliff:g> mantén premut."</string>
@@ -1140,6 +1146,7 @@
     <string name="keyboardview_keycode_mode_change" msgid="4547387741906537519">"Canvi de mode"</string>
     <string name="keyboardview_keycode_shift" msgid="2270748814315147690">"Maj"</string>
     <string name="keyboardview_keycode_enter" msgid="2985864015076059467">"Retorn"</string>
+    <string name="content_description_sliding_handle" msgid="7311938669217173870">"Llisca el dit. Mantén premut."</string>
     <string name="description_direction_up" msgid="1983114130441878529">"Cap amunt per <xliff:g id="TARGET_DESCRIPTION">%s</xliff:g>."</string>
     <string name="description_direction_down" msgid="4294993639091088240">"Cap avall per <xliff:g id="TARGET_DESCRIPTION">%s</xliff:g>."</string>
     <string name="description_direction_left" msgid="6814008463839915747">"Cap a l\'esquerra per <xliff:g id="TARGET_DESCRIPTION">%s</xliff:g>."</string>
diff --git a/core/res/res/values-cs/strings.xml b/core/res/res/values-cs/strings.xml
index a8fe56d..2190b7e 100644
--- a/core/res/res/values-cs/strings.xml
+++ b/core/res/res/values-cs/strings.xml
@@ -1113,6 +1113,12 @@
     <string name="sync_undo_deletes" msgid="8610996708225006328">"Vrátit mazání zpět."</string>
     <string name="sync_do_nothing" msgid="8717589462945226869">"Neprovádět akci."</string>
     <string name="choose_account_label" msgid="4191313562041125787">"Vybrat účet"</string>
+    <!-- no translation found for add_account_label (2935267344849993553) -->
+    <skip />
+    <!-- no translation found for choose_account_text (6891230675141555481) -->
+    <skip />
+    <!-- no translation found for add_account_button_label (3611982894853435874) -->
+    <skip />
     <string name="number_picker_increment_button" msgid="4830170763103463443">"Zvýšení"</string>
     <string name="number_picker_decrement_button" msgid="2576606679160067262">"Snížení"</string>
     <string name="number_picker_increment_scroll_mode" msgid="1343063395404990189">"<xliff:g id="VALUE">%s</xliff:g> – Klepněte a podržte."</string>
@@ -1144,6 +1150,7 @@
     <string name="keyboardview_keycode_mode_change" msgid="4547387741906537519">"Změna režimu"</string>
     <string name="keyboardview_keycode_shift" msgid="2270748814315147690">"Shift"</string>
     <string name="keyboardview_keycode_enter" msgid="2985864015076059467">"Enter"</string>
+    <string name="content_description_sliding_handle" msgid="7311938669217173870">"Posuvník. Klepněte a podržte."</string>
     <string name="description_direction_up" msgid="1983114130441878529">"<xliff:g id="TARGET_DESCRIPTION">%s</xliff:g> – nahoru."</string>
     <string name="description_direction_down" msgid="4294993639091088240">"<xliff:g id="TARGET_DESCRIPTION">%s</xliff:g> – dolů."</string>
     <string name="description_direction_left" msgid="6814008463839915747">"<xliff:g id="TARGET_DESCRIPTION">%s</xliff:g> – vlevo."</string>
diff --git a/core/res/res/values-da/strings.xml b/core/res/res/values-da/strings.xml
index fb92beb..f5a9846 100644
--- a/core/res/res/values-da/strings.xml
+++ b/core/res/res/values-da/strings.xml
@@ -1113,6 +1113,12 @@
     <string name="sync_undo_deletes" msgid="8610996708225006328">"Fortryd sletningerne."</string>
     <string name="sync_do_nothing" msgid="8717589462945226869">"Gør ikke noget lige nu."</string>
     <string name="choose_account_label" msgid="4191313562041125787">"Vælg en konto"</string>
+    <!-- no translation found for add_account_label (2935267344849993553) -->
+    <skip />
+    <!-- no translation found for choose_account_text (6891230675141555481) -->
+    <skip />
+    <!-- no translation found for add_account_button_label (3611982894853435874) -->
+    <skip />
     <string name="number_picker_increment_button" msgid="4830170763103463443">"Optælling"</string>
     <string name="number_picker_decrement_button" msgid="2576606679160067262">"Nedtælling"</string>
     <string name="number_picker_increment_scroll_mode" msgid="1343063395404990189">"Tryk og hold <xliff:g id="VALUE">%s</xliff:g> nede."</string>
@@ -1144,6 +1150,7 @@
     <string name="keyboardview_keycode_mode_change" msgid="4547387741906537519">"Ændring af tilstand"</string>
     <string name="keyboardview_keycode_shift" msgid="2270748814315147690">"Shift"</string>
     <string name="keyboardview_keycode_enter" msgid="2985864015076059467">"Angiv"</string>
+    <string name="content_description_sliding_handle" msgid="7311938669217173870">"Glidende håndtag. Tryk og hold nede."</string>
     <string name="description_direction_up" msgid="1983114130441878529">"Op for at <xliff:g id="TARGET_DESCRIPTION">%s</xliff:g>."</string>
     <string name="description_direction_down" msgid="4294993639091088240">"Ned for at <xliff:g id="TARGET_DESCRIPTION">%s</xliff:g>."</string>
     <string name="description_direction_left" msgid="6814008463839915747">"Til venstre for at <xliff:g id="TARGET_DESCRIPTION">%s</xliff:g>."</string>
diff --git a/core/res/res/values-de/strings.xml b/core/res/res/values-de/strings.xml
index ead38fd..d376fd9 100644
--- a/core/res/res/values-de/strings.xml
+++ b/core/res/res/values-de/strings.xml
@@ -1113,6 +1113,12 @@
     <string name="sync_undo_deletes" msgid="8610996708225006328">"Löschen rückgängig machen"</string>
     <string name="sync_do_nothing" msgid="8717589462945226869">"Im Moment nichts unternehmen"</string>
     <string name="choose_account_label" msgid="4191313562041125787">"Konto auswählen"</string>
+    <!-- no translation found for add_account_label (2935267344849993553) -->
+    <skip />
+    <!-- no translation found for choose_account_text (6891230675141555481) -->
+    <skip />
+    <!-- no translation found for add_account_button_label (3611982894853435874) -->
+    <skip />
     <string name="number_picker_increment_button" msgid="4830170763103463443">"Erhöhen"</string>
     <string name="number_picker_decrement_button" msgid="2576606679160067262">"Verringern"</string>
     <string name="number_picker_increment_scroll_mode" msgid="1343063395404990189">"<xliff:g id="VALUE">%s</xliff:g> tippen und halten"</string>
@@ -1144,6 +1150,7 @@
     <string name="keyboardview_keycode_mode_change" msgid="4547387741906537519">"Modusänderung"</string>
     <string name="keyboardview_keycode_shift" msgid="2270748814315147690">"Umschalttaste"</string>
     <string name="keyboardview_keycode_enter" msgid="2985864015076059467">"Eingabetaste"</string>
+    <string name="content_description_sliding_handle" msgid="7311938669217173870">"Schieberegler: Tippen und halten"</string>
     <string name="description_direction_up" msgid="1983114130441878529">"Für <xliff:g id="TARGET_DESCRIPTION">%s</xliff:g> nach oben"</string>
     <string name="description_direction_down" msgid="4294993639091088240">"Für <xliff:g id="TARGET_DESCRIPTION">%s</xliff:g> nach unten"</string>
     <string name="description_direction_left" msgid="6814008463839915747">"Für <xliff:g id="TARGET_DESCRIPTION">%s</xliff:g> nach links"</string>
diff --git a/core/res/res/values-el/strings.xml b/core/res/res/values-el/strings.xml
index 277e20b..601a054 100644
--- a/core/res/res/values-el/strings.xml
+++ b/core/res/res/values-el/strings.xml
@@ -1113,6 +1113,12 @@
     <string name="sync_undo_deletes" msgid="8610996708225006328">"Αναίρεση των διαγραφών."</string>
     <string name="sync_do_nothing" msgid="8717589462945226869">"Να μην γίνει καμία ενέργεια τώρα."</string>
     <string name="choose_account_label" msgid="4191313562041125787">"Επιλογή λογαριασμού"</string>
+    <!-- no translation found for add_account_label (2935267344849993553) -->
+    <skip />
+    <!-- no translation found for choose_account_text (6891230675141555481) -->
+    <skip />
+    <!-- no translation found for add_account_button_label (3611982894853435874) -->
+    <skip />
     <string name="number_picker_increment_button" msgid="4830170763103463443">"Αύξηση"</string>
     <string name="number_picker_decrement_button" msgid="2576606679160067262">"Μείωση"</string>
     <string name="number_picker_increment_scroll_mode" msgid="1343063395404990189">"Πατήστε και κρατήστε πατημένο το <xliff:g id="VALUE">%s</xliff:g>."</string>
@@ -1144,6 +1150,7 @@
     <string name="keyboardview_keycode_mode_change" msgid="4547387741906537519">"Αλλαγή τρόπου"</string>
     <string name="keyboardview_keycode_shift" msgid="2270748814315147690">"Shift"</string>
     <string name="keyboardview_keycode_enter" msgid="2985864015076059467">"Enter"</string>
+    <string name="content_description_sliding_handle" msgid="7311938669217173870">"Στοιχείο χειρισμού με δυνατότητα ολίσθησης. Πατήστε παρατεταμένα."</string>
     <string name="description_direction_up" msgid="1983114130441878529">"Κύλιση πάνω <xliff:g id="TARGET_DESCRIPTION">%s</xliff:g>."</string>
     <string name="description_direction_down" msgid="4294993639091088240">"Κύλιση κάτω για <xliff:g id="TARGET_DESCRIPTION">%s</xliff:g>."</string>
     <string name="description_direction_left" msgid="6814008463839915747">"Κύλιση αριστερά για <xliff:g id="TARGET_DESCRIPTION">%s</xliff:g>."</string>
diff --git a/core/res/res/values-en-rGB/strings.xml b/core/res/res/values-en-rGB/strings.xml
index 5f95933..82e97e0 100644
--- a/core/res/res/values-en-rGB/strings.xml
+++ b/core/res/res/values-en-rGB/strings.xml
@@ -1109,6 +1109,12 @@
     <string name="sync_undo_deletes" msgid="8610996708225006328">"Undo the deletions."</string>
     <string name="sync_do_nothing" msgid="8717589462945226869">"Do nothing for now."</string>
     <string name="choose_account_label" msgid="4191313562041125787">"Select an account"</string>
+    <!-- no translation found for add_account_label (2935267344849993553) -->
+    <skip />
+    <!-- no translation found for choose_account_text (6891230675141555481) -->
+    <skip />
+    <!-- no translation found for add_account_button_label (3611982894853435874) -->
+    <skip />
     <string name="number_picker_increment_button" msgid="4830170763103463443">"Increment"</string>
     <string name="number_picker_decrement_button" msgid="2576606679160067262">"Decrement"</string>
     <string name="number_picker_increment_scroll_mode" msgid="1343063395404990189">"<xliff:g id="VALUE">%s</xliff:g> tap and hold."</string>
@@ -1140,6 +1146,7 @@
     <string name="keyboardview_keycode_mode_change" msgid="4547387741906537519">"Mode change"</string>
     <string name="keyboardview_keycode_shift" msgid="2270748814315147690">"Shift"</string>
     <string name="keyboardview_keycode_enter" msgid="2985864015076059467">"Enter"</string>
+    <string name="content_description_sliding_handle" msgid="7311938669217173870">"Sliding handle. Tap and hold."</string>
     <string name="description_direction_up" msgid="1983114130441878529">"Up for <xliff:g id="TARGET_DESCRIPTION">%s</xliff:g>."</string>
     <string name="description_direction_down" msgid="4294993639091088240">"Down for <xliff:g id="TARGET_DESCRIPTION">%s</xliff:g>."</string>
     <string name="description_direction_left" msgid="6814008463839915747">"Left for <xliff:g id="TARGET_DESCRIPTION">%s</xliff:g>."</string>
diff --git a/core/res/res/values-es-rUS/strings.xml b/core/res/res/values-es-rUS/strings.xml
index c4de2b5..721b0c7 100644
--- a/core/res/res/values-es-rUS/strings.xml
+++ b/core/res/res/values-es-rUS/strings.xml
@@ -1113,6 +1113,12 @@
     <string name="sync_undo_deletes" msgid="8610996708225006328">"Deshacer eliminaciones."</string>
     <string name="sync_do_nothing" msgid="8717589462945226869">"No hagas nada por el momento."</string>
     <string name="choose_account_label" msgid="4191313562041125787">"Seleccionar una cuenta"</string>
+    <!-- no translation found for add_account_label (2935267344849993553) -->
+    <skip />
+    <!-- no translation found for choose_account_text (6891230675141555481) -->
+    <skip />
+    <!-- no translation found for add_account_button_label (3611982894853435874) -->
+    <skip />
     <string name="number_picker_increment_button" msgid="4830170763103463443">"Incremento"</string>
     <string name="number_picker_decrement_button" msgid="2576606679160067262">"Decremento"</string>
     <string name="number_picker_increment_scroll_mode" msgid="1343063395404990189">"Mantenga presionado <xliff:g id="VALUE">%s</xliff:g>."</string>
@@ -1144,6 +1150,7 @@
     <string name="keyboardview_keycode_mode_change" msgid="4547387741906537519">"Cambio de modo"</string>
     <string name="keyboardview_keycode_shift" msgid="2270748814315147690">"Mayúscula"</string>
     <string name="keyboardview_keycode_enter" msgid="2985864015076059467">"Ingresar"</string>
+    <string name="content_description_sliding_handle" msgid="7311938669217173870">"Asidero deslizante (tocar y mantener la presión)"</string>
     <string name="description_direction_up" msgid="1983114130441878529">"Hacia arriba para <xliff:g id="TARGET_DESCRIPTION">%s</xliff:g>"</string>
     <string name="description_direction_down" msgid="4294993639091088240">"Hacia abajo para <xliff:g id="TARGET_DESCRIPTION">%s</xliff:g>"</string>
     <string name="description_direction_left" msgid="6814008463839915747">"Hacia la izquierda para <xliff:g id="TARGET_DESCRIPTION">%s</xliff:g>"</string>
diff --git a/core/res/res/values-es/strings.xml b/core/res/res/values-es/strings.xml
index 91e8d4c..dc3a630 100644
--- a/core/res/res/values-es/strings.xml
+++ b/core/res/res/values-es/strings.xml
@@ -1113,6 +1113,12 @@
     <string name="sync_undo_deletes" msgid="8610996708225006328">"Deshacer las eliminaciones"</string>
     <string name="sync_do_nothing" msgid="8717589462945226869">"No hacer nada por ahora"</string>
     <string name="choose_account_label" msgid="4191313562041125787">"Seleccionar una cuenta"</string>
+    <!-- no translation found for add_account_label (2935267344849993553) -->
+    <skip />
+    <!-- no translation found for choose_account_text (6891230675141555481) -->
+    <skip />
+    <!-- no translation found for add_account_button_label (3611982894853435874) -->
+    <skip />
     <string name="number_picker_increment_button" msgid="4830170763103463443">"Aumentar"</string>
     <string name="number_picker_decrement_button" msgid="2576606679160067262">"Disminuir"</string>
     <string name="number_picker_increment_scroll_mode" msgid="1343063395404990189">"Mantén pulsado <xliff:g id="VALUE">%s</xliff:g>"</string>
@@ -1144,6 +1150,7 @@
     <string name="keyboardview_keycode_mode_change" msgid="4547387741906537519">"Cambio de modo"</string>
     <string name="keyboardview_keycode_shift" msgid="2270748814315147690">"Mayús"</string>
     <string name="keyboardview_keycode_enter" msgid="2985864015076059467">"Intro"</string>
+    <string name="content_description_sliding_handle" msgid="7311938669217173870">"Tirador deslizante (mantener pulsado)"</string>
     <string name="description_direction_up" msgid="1983114130441878529">"Hacia arriba para <xliff:g id="TARGET_DESCRIPTION">%s</xliff:g>"</string>
     <string name="description_direction_down" msgid="4294993639091088240">"Hacia abajo para <xliff:g id="TARGET_DESCRIPTION">%s</xliff:g>"</string>
     <string name="description_direction_left" msgid="6814008463839915747">"Hacia la izquierda para <xliff:g id="TARGET_DESCRIPTION">%s</xliff:g>"</string>
diff --git a/core/res/res/values-fa/strings.xml b/core/res/res/values-fa/strings.xml
index 84fbccd..d40c6d7 100644
--- a/core/res/res/values-fa/strings.xml
+++ b/core/res/res/values-fa/strings.xml
@@ -1113,6 +1113,12 @@
     <string name="sync_undo_deletes" msgid="8610996708225006328">"لغو موارد حذف شده."</string>
     <string name="sync_do_nothing" msgid="8717589462945226869">"اکنون هیچ کاری انجام نشود."</string>
     <string name="choose_account_label" msgid="4191313562041125787">"انتخاب یک حساب"</string>
+    <!-- no translation found for add_account_label (2935267344849993553) -->
+    <skip />
+    <!-- no translation found for choose_account_text (6891230675141555481) -->
+    <skip />
+    <!-- no translation found for add_account_button_label (3611982894853435874) -->
+    <skip />
     <string name="number_picker_increment_button" msgid="4830170763103463443">"افزایش"</string>
     <string name="number_picker_decrement_button" msgid="2576606679160067262">"کاهش"</string>
     <string name="number_picker_increment_scroll_mode" msgid="1343063395404990189">"<xliff:g id="VALUE">%s</xliff:g> ضربه بزنید و نگه دارید."</string>
@@ -1144,6 +1150,7 @@
     <string name="keyboardview_keycode_mode_change" msgid="4547387741906537519">"تغییر حالت"</string>
     <string name="keyboardview_keycode_shift" msgid="2270748814315147690">"Shift"</string>
     <string name="keyboardview_keycode_enter" msgid="2985864015076059467">"Enter"</string>
+    <string name="content_description_sliding_handle" msgid="7311938669217173870">"کنترل کننده کشویی. ضربه زده و نگه دارید."</string>
     <string name="description_direction_up" msgid="1983114130441878529">"بالا برای <xliff:g id="TARGET_DESCRIPTION">%s</xliff:g>."</string>
     <string name="description_direction_down" msgid="4294993639091088240">"پایین برای <xliff:g id="TARGET_DESCRIPTION">%s</xliff:g>."</string>
     <string name="description_direction_left" msgid="6814008463839915747">"چپ برای <xliff:g id="TARGET_DESCRIPTION">%s</xliff:g>."</string>
diff --git a/core/res/res/values-fi/strings.xml b/core/res/res/values-fi/strings.xml
index a72a907..1462df4 100644
--- a/core/res/res/values-fi/strings.xml
+++ b/core/res/res/values-fi/strings.xml
@@ -1113,6 +1113,12 @@
     <string name="sync_undo_deletes" msgid="8610996708225006328">"Kumoa poistot."</string>
     <string name="sync_do_nothing" msgid="8717589462945226869">"Älä tee mitään."</string>
     <string name="choose_account_label" msgid="4191313562041125787">"Valitse tili"</string>
+    <!-- no translation found for add_account_label (2935267344849993553) -->
+    <skip />
+    <!-- no translation found for choose_account_text (6891230675141555481) -->
+    <skip />
+    <!-- no translation found for add_account_button_label (3611982894853435874) -->
+    <skip />
     <string name="number_picker_increment_button" msgid="4830170763103463443">"Lisää"</string>
     <string name="number_picker_decrement_button" msgid="2576606679160067262">"Vähennä"</string>
     <string name="number_picker_increment_scroll_mode" msgid="1343063395404990189">"<xliff:g id="VALUE">%s</xliff:g> kosketa pitkään."</string>
@@ -1144,6 +1150,7 @@
     <string name="keyboardview_keycode_mode_change" msgid="4547387741906537519">"Tilan muutos"</string>
     <string name="keyboardview_keycode_shift" msgid="2270748814315147690">"Shift"</string>
     <string name="keyboardview_keycode_enter" msgid="2985864015076059467">"Enter"</string>
+    <string name="content_description_sliding_handle" msgid="7311938669217173870">"Liukuva valitsin. Kosketa pitkään."</string>
     <string name="description_direction_up" msgid="1983114130441878529">"Ylös: <xliff:g id="TARGET_DESCRIPTION">%s</xliff:g>."</string>
     <string name="description_direction_down" msgid="4294993639091088240">"Alas: <xliff:g id="TARGET_DESCRIPTION">%s</xliff:g>."</string>
     <string name="description_direction_left" msgid="6814008463839915747">"Vasemmalle: <xliff:g id="TARGET_DESCRIPTION">%s</xliff:g>."</string>
diff --git a/core/res/res/values-fr/strings.xml b/core/res/res/values-fr/strings.xml
index 39e2703..c5e692b 100644
--- a/core/res/res/values-fr/strings.xml
+++ b/core/res/res/values-fr/strings.xml
@@ -1113,6 +1113,12 @@
     <string name="sync_undo_deletes" msgid="8610996708225006328">"Annuler les suppressions"</string>
     <string name="sync_do_nothing" msgid="8717589462945226869">"Ne rien faire pour l\'instant"</string>
     <string name="choose_account_label" msgid="4191313562041125787">"Sélectionner un compte"</string>
+    <!-- no translation found for add_account_label (2935267344849993553) -->
+    <skip />
+    <!-- no translation found for choose_account_text (6891230675141555481) -->
+    <skip />
+    <!-- no translation found for add_account_button_label (3611982894853435874) -->
+    <skip />
     <string name="number_picker_increment_button" msgid="4830170763103463443">"Augmenter"</string>
     <string name="number_picker_decrement_button" msgid="2576606679160067262">"Diminuer"</string>
     <string name="number_picker_increment_scroll_mode" msgid="1343063395404990189">"<xliff:g id="VALUE">%s</xliff:g> appuyez de manière prolongée."</string>
@@ -1144,6 +1150,7 @@
     <string name="keyboardview_keycode_mode_change" msgid="4547387741906537519">"Changement de mode"</string>
     <string name="keyboardview_keycode_shift" msgid="2270748814315147690">"Maj"</string>
     <string name="keyboardview_keycode_enter" msgid="2985864015076059467">"Entrée"</string>
+    <string name="content_description_sliding_handle" msgid="7311938669217173870">"Poignée coulissante. Appuyez de manière prolongée."</string>
     <string name="description_direction_up" msgid="1983114130441878529">"Vers le haut pour <xliff:g id="TARGET_DESCRIPTION">%s</xliff:g>"</string>
     <string name="description_direction_down" msgid="4294993639091088240">"Vers le bas pour <xliff:g id="TARGET_DESCRIPTION">%s</xliff:g>"</string>
     <string name="description_direction_left" msgid="6814008463839915747">"Vers la gauche pour <xliff:g id="TARGET_DESCRIPTION">%s</xliff:g>"</string>
diff --git a/core/res/res/values-hr/strings.xml b/core/res/res/values-hr/strings.xml
index 0b2e8cc..ab6eb93 100644
--- a/core/res/res/values-hr/strings.xml
+++ b/core/res/res/values-hr/strings.xml
@@ -1113,6 +1113,12 @@
     <string name="sync_undo_deletes" msgid="8610996708225006328">"Poništi brisanja."</string>
     <string name="sync_do_nothing" msgid="8717589462945226869">"Za sad nemoj ništa učiniti."</string>
     <string name="choose_account_label" msgid="4191313562041125787">"Odaberite račun"</string>
+    <!-- no translation found for add_account_label (2935267344849993553) -->
+    <skip />
+    <!-- no translation found for choose_account_text (6891230675141555481) -->
+    <skip />
+    <!-- no translation found for add_account_button_label (3611982894853435874) -->
+    <skip />
     <string name="number_picker_increment_button" msgid="4830170763103463443">"Povećaj"</string>
     <string name="number_picker_decrement_button" msgid="2576606679160067262">"Smanji"</string>
     <string name="number_picker_increment_scroll_mode" msgid="1343063395404990189">"<xliff:g id="VALUE">%s</xliff:g> dotaknite i držite."</string>
@@ -1144,6 +1150,7 @@
     <string name="keyboardview_keycode_mode_change" msgid="4547387741906537519">"Promjena načina"</string>
     <string name="keyboardview_keycode_shift" msgid="2270748814315147690">"Shift"</string>
     <string name="keyboardview_keycode_enter" msgid="2985864015076059467">"Enter"</string>
+    <string name="content_description_sliding_handle" msgid="7311938669217173870">"Klizna ručka. Dotaknite i držite."</string>
     <string name="description_direction_up" msgid="1983114130441878529">"Gore za <xliff:g id="TARGET_DESCRIPTION">%s</xliff:g>."</string>
     <string name="description_direction_down" msgid="4294993639091088240">"Dolje za <xliff:g id="TARGET_DESCRIPTION">%s</xliff:g>."</string>
     <string name="description_direction_left" msgid="6814008463839915747">"Lijevo za <xliff:g id="TARGET_DESCRIPTION">%s</xliff:g>."</string>
diff --git a/core/res/res/values-hu/strings.xml b/core/res/res/values-hu/strings.xml
index d62abdc..3e2ae7f 100644
--- a/core/res/res/values-hu/strings.xml
+++ b/core/res/res/values-hu/strings.xml
@@ -1113,6 +1113,12 @@
     <string name="sync_undo_deletes" msgid="8610996708225006328">"Törlés visszavonása."</string>
     <string name="sync_do_nothing" msgid="8717589462945226869">"Most nem."</string>
     <string name="choose_account_label" msgid="4191313562041125787">"Fiók kiválasztása"</string>
+    <!-- no translation found for add_account_label (2935267344849993553) -->
+    <skip />
+    <!-- no translation found for choose_account_text (6891230675141555481) -->
+    <skip />
+    <!-- no translation found for add_account_button_label (3611982894853435874) -->
+    <skip />
     <string name="number_picker_increment_button" msgid="4830170763103463443">"Növelés"</string>
     <string name="number_picker_decrement_button" msgid="2576606679160067262">"Csökkentés"</string>
     <string name="number_picker_increment_scroll_mode" msgid="1343063395404990189">"<xliff:g id="VALUE">%s</xliff:g> érintse meg és tartsa"</string>
@@ -1144,6 +1150,7 @@
     <string name="keyboardview_keycode_mode_change" msgid="4547387741906537519">"Mód váltása"</string>
     <string name="keyboardview_keycode_shift" msgid="2270748814315147690">"Shift"</string>
     <string name="keyboardview_keycode_enter" msgid="2985864015076059467">"Enter"</string>
+    <string name="content_description_sliding_handle" msgid="7311938669217173870">"Csúsztatható fogantyú. Érintse meg és tartsa."</string>
     <string name="description_direction_up" msgid="1983114130441878529">"Fel: <xliff:g id="TARGET_DESCRIPTION">%s</xliff:g>"</string>
     <string name="description_direction_down" msgid="4294993639091088240">"Le: <xliff:g id="TARGET_DESCRIPTION">%s</xliff:g>"</string>
     <string name="description_direction_left" msgid="6814008463839915747">"Balra: <xliff:g id="TARGET_DESCRIPTION">%s</xliff:g>"</string>
diff --git a/core/res/res/values-in/strings.xml b/core/res/res/values-in/strings.xml
index 76f87f5..aea1a4c 100644
--- a/core/res/res/values-in/strings.xml
+++ b/core/res/res/values-in/strings.xml
@@ -1113,6 +1113,12 @@
     <string name="sync_undo_deletes" msgid="8610996708225006328">"Urungkan penghapusan."</string>
     <string name="sync_do_nothing" msgid="8717589462945226869">"Jangan lakukan apa pun untuk saat ini."</string>
     <string name="choose_account_label" msgid="4191313562041125787">"Pilih akun"</string>
+    <!-- no translation found for add_account_label (2935267344849993553) -->
+    <skip />
+    <!-- no translation found for choose_account_text (6891230675141555481) -->
+    <skip />
+    <!-- no translation found for add_account_button_label (3611982894853435874) -->
+    <skip />
     <string name="number_picker_increment_button" msgid="4830170763103463443">"Penambahan"</string>
     <string name="number_picker_decrement_button" msgid="2576606679160067262">"Pengurangan"</string>
     <string name="number_picker_increment_scroll_mode" msgid="1343063395404990189">"<xliff:g id="VALUE">%s</xliff:g> ketuk dan tahan."</string>
@@ -1144,6 +1150,7 @@
     <string name="keyboardview_keycode_mode_change" msgid="4547387741906537519">"Pengubahan mode"</string>
     <string name="keyboardview_keycode_shift" msgid="2270748814315147690">"Shift"</string>
     <string name="keyboardview_keycode_enter" msgid="2985864015076059467">"Enter"</string>
+    <string name="content_description_sliding_handle" msgid="7311938669217173870">"Gagang geser. Ketuk dan tahan."</string>
     <string name="description_direction_up" msgid="1983114130441878529">"Ke atas untuk <xliff:g id="TARGET_DESCRIPTION">%s</xliff:g>."</string>
     <string name="description_direction_down" msgid="4294993639091088240">"Ke bawah untuk <xliff:g id="TARGET_DESCRIPTION">%s</xliff:g>."</string>
     <string name="description_direction_left" msgid="6814008463839915747">"Ke kiri untuk <xliff:g id="TARGET_DESCRIPTION">%s</xliff:g>."</string>
diff --git a/core/res/res/values-it/strings.xml b/core/res/res/values-it/strings.xml
index 8791648..419caf4 100644
--- a/core/res/res/values-it/strings.xml
+++ b/core/res/res/values-it/strings.xml
@@ -1109,6 +1109,12 @@
     <string name="sync_undo_deletes" msgid="8610996708225006328">"Annulla le eliminazioni."</string>
     <string name="sync_do_nothing" msgid="8717589462945226869">"Non fare nulla per ora."</string>
     <string name="choose_account_label" msgid="4191313562041125787">"Seleziona un account"</string>
+    <!-- no translation found for add_account_label (2935267344849993553) -->
+    <skip />
+    <!-- no translation found for choose_account_text (6891230675141555481) -->
+    <skip />
+    <!-- no translation found for add_account_button_label (3611982894853435874) -->
+    <skip />
     <string name="number_picker_increment_button" msgid="4830170763103463443">"Aumenta"</string>
     <string name="number_picker_decrement_button" msgid="2576606679160067262">"Diminuisci"</string>
     <string name="number_picker_increment_scroll_mode" msgid="1343063395404990189">"Tocca e tieni premuto il numero <xliff:g id="VALUE">%s</xliff:g>."</string>
@@ -1140,6 +1146,7 @@
     <string name="keyboardview_keycode_mode_change" msgid="4547387741906537519">"Cambio modalità"</string>
     <string name="keyboardview_keycode_shift" msgid="2270748814315147690">"Maiuscolo"</string>
     <string name="keyboardview_keycode_enter" msgid="2985864015076059467">"Invio"</string>
+    <string name="content_description_sliding_handle" msgid="7311938669217173870">"Maniglia scorrevole. Tocca e tieni premuto."</string>
     <string name="description_direction_up" msgid="1983114130441878529">"Su per <xliff:g id="TARGET_DESCRIPTION">%s</xliff:g>."</string>
     <string name="description_direction_down" msgid="4294993639091088240">"Giù per <xliff:g id="TARGET_DESCRIPTION">%s</xliff:g>."</string>
     <string name="description_direction_left" msgid="6814008463839915747">"A sinistra per <xliff:g id="TARGET_DESCRIPTION">%s</xliff:g>."</string>
diff --git a/core/res/res/values-iw/strings.xml b/core/res/res/values-iw/strings.xml
index fa3e19c..c0c1695 100644
--- a/core/res/res/values-iw/strings.xml
+++ b/core/res/res/values-iw/strings.xml
@@ -1113,6 +1113,12 @@
     <string name="sync_undo_deletes" msgid="8610996708225006328">"בטל את המחיקות."</string>
     <string name="sync_do_nothing" msgid="8717589462945226869">"אל תעשה דבר בינתיים."</string>
     <string name="choose_account_label" msgid="4191313562041125787">"בחר חשבון"</string>
+    <!-- no translation found for add_account_label (2935267344849993553) -->
+    <skip />
+    <!-- no translation found for choose_account_text (6891230675141555481) -->
+    <skip />
+    <!-- no translation found for add_account_button_label (3611982894853435874) -->
+    <skip />
     <string name="number_picker_increment_button" msgid="4830170763103463443">"הגדל"</string>
     <string name="number_picker_decrement_button" msgid="2576606679160067262">"הפחת"</string>
     <string name="number_picker_increment_scroll_mode" msgid="1343063395404990189">"<xliff:g id="VALUE">%s</xliff:g> הקש והחזק."</string>
@@ -1144,6 +1150,7 @@
     <string name="keyboardview_keycode_mode_change" msgid="4547387741906537519">"שינוי מצב"</string>
     <string name="keyboardview_keycode_shift" msgid="2270748814315147690">"Shift"</string>
     <string name="keyboardview_keycode_enter" msgid="2985864015076059467">"Enter"</string>
+    <string name="content_description_sliding_handle" msgid="7311938669217173870">"ידית להחלקה. הקש והחזק."</string>
     <string name="description_direction_up" msgid="1983114130441878529">"\'למעלה\' עבור <xliff:g id="TARGET_DESCRIPTION">%s</xliff:g>."</string>
     <string name="description_direction_down" msgid="4294993639091088240">"\'למטה\' עבור <xliff:g id="TARGET_DESCRIPTION">%s</xliff:g>."</string>
     <string name="description_direction_left" msgid="6814008463839915747">"\'שמאל\' עבור <xliff:g id="TARGET_DESCRIPTION">%s</xliff:g>."</string>
diff --git a/core/res/res/values-ja/strings.xml b/core/res/res/values-ja/strings.xml
index 13ef2e74..793e947 100644
--- a/core/res/res/values-ja/strings.xml
+++ b/core/res/res/values-ja/strings.xml
@@ -1113,6 +1113,12 @@
     <string name="sync_undo_deletes" msgid="8610996708225006328">"削除を元に戻す"</string>
     <string name="sync_do_nothing" msgid="8717589462945226869">"今は何もしない"</string>
     <string name="choose_account_label" msgid="4191313562041125787">"アカウントを選択"</string>
+    <!-- no translation found for add_account_label (2935267344849993553) -->
+    <skip />
+    <!-- no translation found for choose_account_text (6891230675141555481) -->
+    <skip />
+    <!-- no translation found for add_account_button_label (3611982894853435874) -->
+    <skip />
     <string name="number_picker_increment_button" msgid="4830170763103463443">"増やす"</string>
     <string name="number_picker_decrement_button" msgid="2576606679160067262">"減らす"</string>
     <string name="number_picker_increment_scroll_mode" msgid="1343063395404990189">"<xliff:g id="VALUE">%s</xliff:g>回タップして押し続けます。"</string>
@@ -1144,6 +1150,7 @@
     <string name="keyboardview_keycode_mode_change" msgid="4547387741906537519">"モードを変更"</string>
     <string name="keyboardview_keycode_shift" msgid="2270748814315147690">"Shift"</string>
     <string name="keyboardview_keycode_enter" msgid="2985864015076059467">"Enter"</string>
+    <string name="content_description_sliding_handle" msgid="7311938669217173870">"スライダーハンドルです。タップして押し続けます。"</string>
     <string name="description_direction_up" msgid="1983114130441878529">"上は<xliff:g id="TARGET_DESCRIPTION">%s</xliff:g>です。"</string>
     <string name="description_direction_down" msgid="4294993639091088240">"下は<xliff:g id="TARGET_DESCRIPTION">%s</xliff:g>です。"</string>
     <string name="description_direction_left" msgid="6814008463839915747">"左は<xliff:g id="TARGET_DESCRIPTION">%s</xliff:g>です。"</string>
diff --git a/core/res/res/values-ko/strings.xml b/core/res/res/values-ko/strings.xml
index 73430e9..42a6e37 100644
--- a/core/res/res/values-ko/strings.xml
+++ b/core/res/res/values-ko/strings.xml
@@ -1113,6 +1113,12 @@
     <string name="sync_undo_deletes" msgid="8610996708225006328">"삭제 실행취소"</string>
     <string name="sync_do_nothing" msgid="8717589462945226869">"나중에 작업"</string>
     <string name="choose_account_label" msgid="4191313562041125787">"계정 선택"</string>
+    <!-- no translation found for add_account_label (2935267344849993553) -->
+    <skip />
+    <!-- no translation found for choose_account_text (6891230675141555481) -->
+    <skip />
+    <!-- no translation found for add_account_button_label (3611982894853435874) -->
+    <skip />
     <string name="number_picker_increment_button" msgid="4830170763103463443">"올리기"</string>
     <string name="number_picker_decrement_button" msgid="2576606679160067262">"줄이기"</string>
     <string name="number_picker_increment_scroll_mode" msgid="1343063395404990189">"<xliff:g id="VALUE">%s</xliff:g> 길게 탭하세요."</string>
@@ -1144,6 +1150,7 @@
     <string name="keyboardview_keycode_mode_change" msgid="4547387741906537519">"모드 변경"</string>
     <string name="keyboardview_keycode_shift" msgid="2270748814315147690">"Shift 키"</string>
     <string name="keyboardview_keycode_enter" msgid="2985864015076059467">"Enter 키"</string>
+    <string name="content_description_sliding_handle" msgid="7311938669217173870">"슬라이딩 핸들을 길게 탭하세요."</string>
     <string name="description_direction_up" msgid="1983114130441878529">"<xliff:g id="TARGET_DESCRIPTION">%s</xliff:g>하려면 위로 슬라이드"</string>
     <string name="description_direction_down" msgid="4294993639091088240">"<xliff:g id="TARGET_DESCRIPTION">%s</xliff:g>하려면 아래로 슬라이드"</string>
     <string name="description_direction_left" msgid="6814008463839915747">"<xliff:g id="TARGET_DESCRIPTION">%s</xliff:g>하려면 왼쪽으로 슬라이드"</string>
diff --git a/core/res/res/values-lt/strings.xml b/core/res/res/values-lt/strings.xml
index f448cef..3a30114 100644
--- a/core/res/res/values-lt/strings.xml
+++ b/core/res/res/values-lt/strings.xml
@@ -1113,6 +1113,12 @@
     <string name="sync_undo_deletes" msgid="8610996708225006328">"Anuliuoti ištrynimus."</string>
     <string name="sync_do_nothing" msgid="8717589462945226869">"Kol kas nieko nedaryti."</string>
     <string name="choose_account_label" msgid="4191313562041125787">"Pasirinkti paskyrą"</string>
+    <!-- no translation found for add_account_label (2935267344849993553) -->
+    <skip />
+    <!-- no translation found for choose_account_text (6891230675141555481) -->
+    <skip />
+    <!-- no translation found for add_account_button_label (3611982894853435874) -->
+    <skip />
     <string name="number_picker_increment_button" msgid="4830170763103463443">"Padidinti"</string>
     <string name="number_picker_decrement_button" msgid="2576606679160067262">"Sumažinti"</string>
     <string name="number_picker_increment_scroll_mode" msgid="1343063395404990189">"Palieskite <xliff:g id="VALUE">%s</xliff:g> ir laikykite palietę."</string>
@@ -1144,6 +1150,7 @@
     <string name="keyboardview_keycode_mode_change" msgid="4547387741906537519">"Režimo keitimas"</string>
     <string name="keyboardview_keycode_shift" msgid="2270748814315147690">"Shift"</string>
     <string name="keyboardview_keycode_enter" msgid="2985864015076059467">"Įvesti"</string>
+    <string name="content_description_sliding_handle" msgid="7311938669217173870">"Slydimo valdymas. Palieskite ir laikykite."</string>
     <string name="description_direction_up" msgid="1983114130441878529">"Aukštyn į <xliff:g id="TARGET_DESCRIPTION">%s</xliff:g>."</string>
     <string name="description_direction_down" msgid="4294993639091088240">"Žemyn į <xliff:g id="TARGET_DESCRIPTION">%s</xliff:g>."</string>
     <string name="description_direction_left" msgid="6814008463839915747">"Kairėn į <xliff:g id="TARGET_DESCRIPTION">%s</xliff:g>."</string>
diff --git a/core/res/res/values-lv/strings.xml b/core/res/res/values-lv/strings.xml
index 9f0f286..e9a01e9 100644
--- a/core/res/res/values-lv/strings.xml
+++ b/core/res/res/values-lv/strings.xml
@@ -1113,6 +1113,12 @@
     <string name="sync_undo_deletes" msgid="8610996708225006328">"Atsauciet dzēšanu."</string>
     <string name="sync_do_nothing" msgid="8717589462945226869">"Pagaidām neveiciet nekādas darbības."</string>
     <string name="choose_account_label" msgid="4191313562041125787">"Atlasīt kontu"</string>
+    <!-- no translation found for add_account_label (2935267344849993553) -->
+    <skip />
+    <!-- no translation found for choose_account_text (6891230675141555481) -->
+    <skip />
+    <!-- no translation found for add_account_button_label (3611982894853435874) -->
+    <skip />
     <string name="number_picker_increment_button" msgid="4830170763103463443">"Palielināt"</string>
     <string name="number_picker_decrement_button" msgid="2576606679160067262">"Samazināt"</string>
     <string name="number_picker_increment_scroll_mode" msgid="1343063395404990189">"<xliff:g id="VALUE">%s</xliff:g>: pieskarieties un turiet nospiestu."</string>
@@ -1144,6 +1150,7 @@
     <string name="keyboardview_keycode_mode_change" msgid="4547387741906537519">"Režīma maiņa"</string>
     <string name="keyboardview_keycode_shift" msgid="2270748814315147690">"Pārslēgšanas taustiņš"</string>
     <string name="keyboardview_keycode_enter" msgid="2985864015076059467">"Ievadīšanas taustiņš"</string>
+    <string name="content_description_sliding_handle" msgid="7311938669217173870">"Bīdāms rokturis. Pieskarieties tam un turiet to nospiestu."</string>
     <string name="description_direction_up" msgid="1983114130441878529">"Bīdiet uz augšu, lai veiktu šādu darbību: <xliff:g id="TARGET_DESCRIPTION">%s</xliff:g>."</string>
     <string name="description_direction_down" msgid="4294993639091088240">"Bīdiet uz leju, lai veiktu šādu darbību: <xliff:g id="TARGET_DESCRIPTION">%s</xliff:g>."</string>
     <string name="description_direction_left" msgid="6814008463839915747">"Bīdiet pa kreisi, lai veiktu šādu darbību: <xliff:g id="TARGET_DESCRIPTION">%s</xliff:g>."</string>
diff --git a/core/res/res/values-ms/strings.xml b/core/res/res/values-ms/strings.xml
index 62ac7c2..bdb43ee 100644
--- a/core/res/res/values-ms/strings.xml
+++ b/core/res/res/values-ms/strings.xml
@@ -1113,6 +1113,12 @@
     <string name="sync_undo_deletes" msgid="8610996708225006328">"Buat asal pemadaman."</string>
     <string name="sync_do_nothing" msgid="8717589462945226869">"Jangan lakukan apa-apa sekarang."</string>
     <string name="choose_account_label" msgid="4191313562041125787">"Pilih akaun"</string>
+    <!-- no translation found for add_account_label (2935267344849993553) -->
+    <skip />
+    <!-- no translation found for choose_account_text (6891230675141555481) -->
+    <skip />
+    <!-- no translation found for add_account_button_label (3611982894853435874) -->
+    <skip />
     <string name="number_picker_increment_button" msgid="4830170763103463443">"Kenaikan"</string>
     <string name="number_picker_decrement_button" msgid="2576606679160067262">"Penyusutan"</string>
     <string name="number_picker_increment_scroll_mode" msgid="1343063395404990189">"<xliff:g id="VALUE">%s</xliff:g> ketik dan tahan."</string>
@@ -1144,6 +1150,7 @@
     <string name="keyboardview_keycode_mode_change" msgid="4547387741906537519">"Perubahan mod"</string>
     <string name="keyboardview_keycode_shift" msgid="2270748814315147690">"Shift"</string>
     <string name="keyboardview_keycode_enter" msgid="2985864015076059467">"Masuk"</string>
+    <string name="content_description_sliding_handle" msgid="7311938669217173870">"Pemegang gelongsor. Ketik dan tahan."</string>
     <string name="description_direction_up" msgid="1983114130441878529">"Atas untuk <xliff:g id="TARGET_DESCRIPTION">%s</xliff:g>."</string>
     <string name="description_direction_down" msgid="4294993639091088240">"Bawah untuk <xliff:g id="TARGET_DESCRIPTION">%s</xliff:g>."</string>
     <string name="description_direction_left" msgid="6814008463839915747">"Kiri untuk <xliff:g id="TARGET_DESCRIPTION">%s</xliff:g>."</string>
diff --git a/core/res/res/values-nb/strings.xml b/core/res/res/values-nb/strings.xml
index 522baab..e879f9b 100644
--- a/core/res/res/values-nb/strings.xml
+++ b/core/res/res/values-nb/strings.xml
@@ -1113,6 +1113,12 @@
     <string name="sync_undo_deletes" msgid="8610996708225006328">"Opphev slettinger."</string>
     <string name="sync_do_nothing" msgid="8717589462945226869">"Ikke gjør noe nå."</string>
     <string name="choose_account_label" msgid="4191313562041125787">"Velg en konto"</string>
+    <!-- no translation found for add_account_label (2935267344849993553) -->
+    <skip />
+    <!-- no translation found for choose_account_text (6891230675141555481) -->
+    <skip />
+    <!-- no translation found for add_account_button_label (3611982894853435874) -->
+    <skip />
     <string name="number_picker_increment_button" msgid="4830170763103463443">"Øke"</string>
     <string name="number_picker_decrement_button" msgid="2576606679160067262">"Senke"</string>
     <string name="number_picker_increment_scroll_mode" msgid="1343063395404990189">"<xliff:g id="VALUE">%s</xliff:g> trykk og hold inne."</string>
@@ -1144,6 +1150,7 @@
     <string name="keyboardview_keycode_mode_change" msgid="4547387741906537519">"Modusendring"</string>
     <string name="keyboardview_keycode_shift" msgid="2270748814315147690">"Shift"</string>
     <string name="keyboardview_keycode_enter" msgid="2985864015076059467">"Enter"</string>
+    <string name="content_description_sliding_handle" msgid="7311938669217173870">"Glidebryter. Trykk og hold inne."</string>
     <string name="description_direction_up" msgid="1983114130441878529">"Opp for <xliff:g id="TARGET_DESCRIPTION">%s</xliff:g>."</string>
     <string name="description_direction_down" msgid="4294993639091088240">"Ned for <xliff:g id="TARGET_DESCRIPTION">%s</xliff:g>."</string>
     <string name="description_direction_left" msgid="6814008463839915747">"Venstre for <xliff:g id="TARGET_DESCRIPTION">%s</xliff:g>."</string>
diff --git a/core/res/res/values-nl/strings.xml b/core/res/res/values-nl/strings.xml
index 16df00c..5d22f64 100644
--- a/core/res/res/values-nl/strings.xml
+++ b/core/res/res/values-nl/strings.xml
@@ -1113,6 +1113,12 @@
     <string name="sync_undo_deletes" msgid="8610996708225006328">"Verwijderingen ongedaan maken."</string>
     <string name="sync_do_nothing" msgid="8717589462945226869">"Nu niets doen."</string>
     <string name="choose_account_label" msgid="4191313562041125787">"Selecteer een account"</string>
+    <!-- no translation found for add_account_label (2935267344849993553) -->
+    <skip />
+    <!-- no translation found for choose_account_text (6891230675141555481) -->
+    <skip />
+    <!-- no translation found for add_account_button_label (3611982894853435874) -->
+    <skip />
     <string name="number_picker_increment_button" msgid="4830170763103463443">"Hoger"</string>
     <string name="number_picker_decrement_button" msgid="2576606679160067262">"Lager"</string>
     <string name="number_picker_increment_scroll_mode" msgid="1343063395404990189">"Tik <xliff:g id="VALUE">%s</xliff:g> keer en blijf aanraken."</string>
@@ -1144,6 +1150,7 @@
     <string name="keyboardview_keycode_mode_change" msgid="4547387741906537519">"Modus wijzigen"</string>
     <string name="keyboardview_keycode_shift" msgid="2270748814315147690">"Shift"</string>
     <string name="keyboardview_keycode_enter" msgid="2985864015076059467">"Enter"</string>
+    <string name="content_description_sliding_handle" msgid="7311938669217173870">"Schuifgreep. Tikken en blijven aanraken."</string>
     <string name="description_direction_up" msgid="1983114130441878529">"Omhoog voor <xliff:g id="TARGET_DESCRIPTION">%s</xliff:g>."</string>
     <string name="description_direction_down" msgid="4294993639091088240">"Omlaag voor <xliff:g id="TARGET_DESCRIPTION">%s</xliff:g>."</string>
     <string name="description_direction_left" msgid="6814008463839915747">"Links voor <xliff:g id="TARGET_DESCRIPTION">%s</xliff:g>."</string>
diff --git a/core/res/res/values-pl/strings.xml b/core/res/res/values-pl/strings.xml
index f081ba2..56553cd 100644
--- a/core/res/res/values-pl/strings.xml
+++ b/core/res/res/values-pl/strings.xml
@@ -1113,6 +1113,12 @@
     <string name="sync_undo_deletes" msgid="8610996708225006328">"Cofnij usunięcie."</string>
     <string name="sync_do_nothing" msgid="8717589462945226869">"Nie wykonuj teraz żadnych czynności."</string>
     <string name="choose_account_label" msgid="4191313562041125787">"Wybierz konto"</string>
+    <!-- no translation found for add_account_label (2935267344849993553) -->
+    <skip />
+    <!-- no translation found for choose_account_text (6891230675141555481) -->
+    <skip />
+    <!-- no translation found for add_account_button_label (3611982894853435874) -->
+    <skip />
     <string name="number_picker_increment_button" msgid="4830170763103463443">"Zwiększ"</string>
     <string name="number_picker_decrement_button" msgid="2576606679160067262">"Zmniejsz"</string>
     <string name="number_picker_increment_scroll_mode" msgid="1343063395404990189">"<xliff:g id="VALUE">%s</xliff:g> dotknij i przytrzymaj."</string>
@@ -1144,6 +1150,7 @@
     <string name="keyboardview_keycode_mode_change" msgid="4547387741906537519">"Zmiana trybu"</string>
     <string name="keyboardview_keycode_shift" msgid="2270748814315147690">"Shift"</string>
     <string name="keyboardview_keycode_enter" msgid="2985864015076059467">"Enter"</string>
+    <string name="content_description_sliding_handle" msgid="7311938669217173870">"Uchwyt przesuwny. Dotknij i przytrzymaj."</string>
     <string name="description_direction_up" msgid="1983114130441878529">"<xliff:g id="TARGET_DESCRIPTION">%s</xliff:g>: w górę"</string>
     <string name="description_direction_down" msgid="4294993639091088240">"<xliff:g id="TARGET_DESCRIPTION">%s</xliff:g>: w dół"</string>
     <string name="description_direction_left" msgid="6814008463839915747">"<xliff:g id="TARGET_DESCRIPTION">%s</xliff:g>: w lewo"</string>
diff --git a/core/res/res/values-pt-rPT/strings.xml b/core/res/res/values-pt-rPT/strings.xml
index be0657e..e60a3c87 100644
--- a/core/res/res/values-pt-rPT/strings.xml
+++ b/core/res/res/values-pt-rPT/strings.xml
@@ -1113,6 +1113,12 @@
     <string name="sync_undo_deletes" msgid="8610996708225006328">"Anular as eliminações."</string>
     <string name="sync_do_nothing" msgid="8717589462945226869">"Não fazer nada por agora."</string>
     <string name="choose_account_label" msgid="4191313562041125787">"Seleccionar conta"</string>
+    <!-- no translation found for add_account_label (2935267344849993553) -->
+    <skip />
+    <!-- no translation found for choose_account_text (6891230675141555481) -->
+    <skip />
+    <!-- no translation found for add_account_button_label (3611982894853435874) -->
+    <skip />
     <string name="number_picker_increment_button" msgid="4830170763103463443">"Aumentar"</string>
     <string name="number_picker_decrement_button" msgid="2576606679160067262">"Diminuir"</string>
     <string name="number_picker_increment_scroll_mode" msgid="1343063395404990189">"Toque sem soltar em <xliff:g id="VALUE">%s</xliff:g>."</string>
@@ -1144,6 +1150,7 @@
     <string name="keyboardview_keycode_mode_change" msgid="4547387741906537519">"Alteração do modo"</string>
     <string name="keyboardview_keycode_shift" msgid="2270748814315147690">"Shift"</string>
     <string name="keyboardview_keycode_enter" msgid="2985864015076059467">"Enter"</string>
+    <string name="content_description_sliding_handle" msgid="7311938669217173870">"Faixa deslizante. Mantenha premida."</string>
     <string name="description_direction_up" msgid="1983114130441878529">"Para cima para <xliff:g id="TARGET_DESCRIPTION">%s</xliff:g>."</string>
     <string name="description_direction_down" msgid="4294993639091088240">"Para baixo para <xliff:g id="TARGET_DESCRIPTION">%s</xliff:g>."</string>
     <string name="description_direction_left" msgid="6814008463839915747">"Para a esquerda para <xliff:g id="TARGET_DESCRIPTION">%s</xliff:g>."</string>
diff --git a/core/res/res/values-pt/strings.xml b/core/res/res/values-pt/strings.xml
index 300ec3f6..de8266b 100644
--- a/core/res/res/values-pt/strings.xml
+++ b/core/res/res/values-pt/strings.xml
@@ -1113,6 +1113,12 @@
     <string name="sync_undo_deletes" msgid="8610996708225006328">"Desfazer as exclusões."</string>
     <string name="sync_do_nothing" msgid="8717589462945226869">"Não fazer nada por enquanto."</string>
     <string name="choose_account_label" msgid="4191313562041125787">"Selecione uma conta"</string>
+    <!-- no translation found for add_account_label (2935267344849993553) -->
+    <skip />
+    <!-- no translation found for choose_account_text (6891230675141555481) -->
+    <skip />
+    <!-- no translation found for add_account_button_label (3611982894853435874) -->
+    <skip />
     <string name="number_picker_increment_button" msgid="4830170763103463443">"Incremento"</string>
     <string name="number_picker_decrement_button" msgid="2576606679160067262">"Redução"</string>
     <string name="number_picker_increment_scroll_mode" msgid="1343063395404990189">"<xliff:g id="VALUE">%s</xliff:g> toque e mantenha pressionado."</string>
@@ -1144,6 +1150,7 @@
     <string name="keyboardview_keycode_mode_change" msgid="4547387741906537519">"Alteração do modo"</string>
     <string name="keyboardview_keycode_shift" msgid="2270748814315147690">"Shift"</string>
     <string name="keyboardview_keycode_enter" msgid="2985864015076059467">"Enter"</string>
+    <string name="content_description_sliding_handle" msgid="7311938669217173870">"Alça deslizante. Toque e segure."</string>
     <string name="description_direction_up" msgid="1983114130441878529">"Deslize para cima para <xliff:g id="TARGET_DESCRIPTION">%s</xliff:g>."</string>
     <string name="description_direction_down" msgid="4294993639091088240">"Deslize para baixo para <xliff:g id="TARGET_DESCRIPTION">%s</xliff:g>."</string>
     <string name="description_direction_left" msgid="6814008463839915747">"Deslize para a esquerda para <xliff:g id="TARGET_DESCRIPTION">%s</xliff:g>."</string>
diff --git a/core/res/res/values-rm/strings.xml b/core/res/res/values-rm/strings.xml
index 7f8beaa..b8c5254 100644
--- a/core/res/res/values-rm/strings.xml
+++ b/core/res/res/values-rm/strings.xml
@@ -1308,6 +1308,12 @@
     <skip />
     <!-- no translation found for choose_account_label (4191313562041125787) -->
     <skip />
+    <!-- no translation found for add_account_label (2935267344849993553) -->
+    <skip />
+    <!-- no translation found for choose_account_text (6891230675141555481) -->
+    <skip />
+    <!-- no translation found for add_account_button_label (3611982894853435874) -->
+    <skip />
     <!-- no translation found for number_picker_increment_button (4830170763103463443) -->
     <skip />
     <!-- no translation found for number_picker_decrement_button (2576606679160067262) -->
@@ -1370,6 +1376,8 @@
     <skip />
     <!-- no translation found for keyboardview_keycode_enter (2985864015076059467) -->
     <skip />
+    <!-- no translation found for content_description_sliding_handle (7311938669217173870) -->
+    <skip />
     <!-- no translation found for description_direction_up (1983114130441878529) -->
     <skip />
     <!-- no translation found for description_direction_down (4294993639091088240) -->
diff --git a/core/res/res/values-ro/strings.xml b/core/res/res/values-ro/strings.xml
index ffbf041..c538450 100644
--- a/core/res/res/values-ro/strings.xml
+++ b/core/res/res/values-ro/strings.xml
@@ -1113,6 +1113,12 @@
     <string name="sync_undo_deletes" msgid="8610996708225006328">"Anulaţi aceste ştergeri."</string>
     <string name="sync_do_nothing" msgid="8717589462945226869">"Pentru moment, nu efectuaţi nicio acţiune."</string>
     <string name="choose_account_label" msgid="4191313562041125787">"Selectaţi un cont"</string>
+    <!-- no translation found for add_account_label (2935267344849993553) -->
+    <skip />
+    <!-- no translation found for choose_account_text (6891230675141555481) -->
+    <skip />
+    <!-- no translation found for add_account_button_label (3611982894853435874) -->
+    <skip />
     <string name="number_picker_increment_button" msgid="4830170763103463443">"Incrementaţi"</string>
     <string name="number_picker_decrement_button" msgid="2576606679160067262">"Decrementaţi"</string>
     <string name="number_picker_increment_scroll_mode" msgid="1343063395404990189">"Apăsaţi şi ţineţi apăsat <xliff:g id="VALUE">%s</xliff:g>."</string>
@@ -1144,6 +1150,7 @@
     <string name="keyboardview_keycode_mode_change" msgid="4547387741906537519">"Schimbarea modului"</string>
     <string name="keyboardview_keycode_shift" msgid="2270748814315147690">"Shift"</string>
     <string name="keyboardview_keycode_enter" msgid="2985864015076059467">"Enter"</string>
+    <string name="content_description_sliding_handle" msgid="7311938669217173870">"Mâner glisant. Apăsaţi şi ţineţi apăsat."</string>
     <string name="description_direction_up" msgid="1983114130441878529">"În sus pentru <xliff:g id="TARGET_DESCRIPTION">%s</xliff:g>."</string>
     <string name="description_direction_down" msgid="4294993639091088240">"În jos pentru <xliff:g id="TARGET_DESCRIPTION">%s</xliff:g>."</string>
     <string name="description_direction_left" msgid="6814008463839915747">"La stânga pentru <xliff:g id="TARGET_DESCRIPTION">%s</xliff:g>."</string>
diff --git a/core/res/res/values-ru/strings.xml b/core/res/res/values-ru/strings.xml
index 4334a9d..2ca256f 100644
--- a/core/res/res/values-ru/strings.xml
+++ b/core/res/res/values-ru/strings.xml
@@ -1113,6 +1113,12 @@
     <string name="sync_undo_deletes" msgid="8610996708225006328">"Отменить удаления."</string>
     <string name="sync_do_nothing" msgid="8717589462945226869">"Ничего не делать сейчас."</string>
     <string name="choose_account_label" msgid="4191313562041125787">"Выберите аккаунт"</string>
+    <!-- no translation found for add_account_label (2935267344849993553) -->
+    <skip />
+    <!-- no translation found for choose_account_text (6891230675141555481) -->
+    <skip />
+    <!-- no translation found for add_account_button_label (3611982894853435874) -->
+    <skip />
     <string name="number_picker_increment_button" msgid="4830170763103463443">"Увеличить"</string>
     <string name="number_picker_decrement_button" msgid="2576606679160067262">"Уменьшить"</string>
     <string name="number_picker_increment_scroll_mode" msgid="1343063395404990189">"Нажмите и удерживайте <xliff:g id="VALUE">%s</xliff:g>."</string>
@@ -1144,6 +1150,7 @@
     <string name="keyboardview_keycode_mode_change" msgid="4547387741906537519">"Клавиша смены режима"</string>
     <string name="keyboardview_keycode_shift" msgid="2270748814315147690">"Клавиша смены регистра"</string>
     <string name="keyboardview_keycode_enter" msgid="2985864015076059467">"Клавиша ввода"</string>
+    <string name="content_description_sliding_handle" msgid="7311938669217173870">"Сенсорное управление. Нажмите и удерживайте."</string>
     <string name="description_direction_up" msgid="1983114130441878529">"Проведите вверх, чтобы <xliff:g id="TARGET_DESCRIPTION">%s</xliff:g>."</string>
     <string name="description_direction_down" msgid="4294993639091088240">"Проведите вниз, чтобы <xliff:g id="TARGET_DESCRIPTION">%s</xliff:g>."</string>
     <string name="description_direction_left" msgid="6814008463839915747">"Проведите влево, чтобы <xliff:g id="TARGET_DESCRIPTION">%s</xliff:g>."</string>
diff --git a/core/res/res/values-sk/strings.xml b/core/res/res/values-sk/strings.xml
index 762a1f6..9cf846f 100644
--- a/core/res/res/values-sk/strings.xml
+++ b/core/res/res/values-sk/strings.xml
@@ -1113,6 +1113,12 @@
     <string name="sync_undo_deletes" msgid="8610996708225006328">"Vrátiť späť odstránenia."</string>
     <string name="sync_do_nothing" msgid="8717589462945226869">"Nevykonať akciu."</string>
     <string name="choose_account_label" msgid="4191313562041125787">"Vybrať účet"</string>
+    <!-- no translation found for add_account_label (2935267344849993553) -->
+    <skip />
+    <!-- no translation found for choose_account_text (6891230675141555481) -->
+    <skip />
+    <!-- no translation found for add_account_button_label (3611982894853435874) -->
+    <skip />
     <string name="number_picker_increment_button" msgid="4830170763103463443">"Zvýšenie"</string>
     <string name="number_picker_decrement_button" msgid="2576606679160067262">"Zníženie"</string>
     <string name="number_picker_increment_scroll_mode" msgid="1343063395404990189">"Klepnite a podržte <xliff:g id="VALUE">%s</xliff:g>."</string>
@@ -1144,6 +1150,7 @@
     <string name="keyboardview_keycode_mode_change" msgid="4547387741906537519">"Zmena režimu"</string>
     <string name="keyboardview_keycode_shift" msgid="2270748814315147690">"Shift"</string>
     <string name="keyboardview_keycode_enter" msgid="2985864015076059467">"Enter"</string>
+    <string name="content_description_sliding_handle" msgid="7311938669217173870">"Posuvné tlačidlo. Klepnite a podržte."</string>
     <string name="description_direction_up" msgid="1983114130441878529">"Nahor na <xliff:g id="TARGET_DESCRIPTION">%s</xliff:g>."</string>
     <string name="description_direction_down" msgid="4294993639091088240">"Nadol na <xliff:g id="TARGET_DESCRIPTION">%s</xliff:g>."</string>
     <string name="description_direction_left" msgid="6814008463839915747">"Doľava na <xliff:g id="TARGET_DESCRIPTION">%s</xliff:g>."</string>
diff --git a/core/res/res/values-sl/strings.xml b/core/res/res/values-sl/strings.xml
index ed80939..5aa1448 100644
--- a/core/res/res/values-sl/strings.xml
+++ b/core/res/res/values-sl/strings.xml
@@ -1113,6 +1113,12 @@
     <string name="sync_undo_deletes" msgid="8610996708225006328">"Razveljavi brisanje."</string>
     <string name="sync_do_nothing" msgid="8717589462945226869">"Zaenkrat ne naredi ničesar."</string>
     <string name="choose_account_label" msgid="4191313562041125787">"Izberite račun"</string>
+    <!-- no translation found for add_account_label (2935267344849993553) -->
+    <skip />
+    <!-- no translation found for choose_account_text (6891230675141555481) -->
+    <skip />
+    <!-- no translation found for add_account_button_label (3611982894853435874) -->
+    <skip />
     <string name="number_picker_increment_button" msgid="4830170763103463443">"Povečaj"</string>
     <string name="number_picker_decrement_button" msgid="2576606679160067262">"Zmanjšaj"</string>
     <string name="number_picker_increment_scroll_mode" msgid="1343063395404990189">"Tapnite in pridržite <xliff:g id="VALUE">%s</xliff:g>."</string>
@@ -1144,6 +1150,7 @@
     <string name="keyboardview_keycode_mode_change" msgid="4547387741906537519">"Sprememba načina"</string>
     <string name="keyboardview_keycode_shift" msgid="2270748814315147690">"Tipka Shift"</string>
     <string name="keyboardview_keycode_enter" msgid="2985864015076059467">"Tipka Enter"</string>
+    <string name="content_description_sliding_handle" msgid="7311938669217173870">"Drsna ročica. Tapnite in pridržite."</string>
     <string name="description_direction_up" msgid="1983114130441878529">"Gor za <xliff:g id="TARGET_DESCRIPTION">%s</xliff:g>."</string>
     <string name="description_direction_down" msgid="4294993639091088240">"Dol za <xliff:g id="TARGET_DESCRIPTION">%s</xliff:g>."</string>
     <string name="description_direction_left" msgid="6814008463839915747">"Levo za <xliff:g id="TARGET_DESCRIPTION">%s</xliff:g>."</string>
diff --git a/core/res/res/values-sr/strings.xml b/core/res/res/values-sr/strings.xml
index 4198fcb..f60e212 100644
--- a/core/res/res/values-sr/strings.xml
+++ b/core/res/res/values-sr/strings.xml
@@ -1113,6 +1113,12 @@
     <string name="sync_undo_deletes" msgid="8610996708225006328">"Опозови брисања."</string>
     <string name="sync_do_nothing" msgid="8717589462945226869">"Не ради ништа за сада."</string>
     <string name="choose_account_label" msgid="4191313562041125787">"Избор налога"</string>
+    <!-- no translation found for add_account_label (2935267344849993553) -->
+    <skip />
+    <!-- no translation found for choose_account_text (6891230675141555481) -->
+    <skip />
+    <!-- no translation found for add_account_button_label (3611982894853435874) -->
+    <skip />
     <string name="number_picker_increment_button" msgid="4830170763103463443">"Повећање"</string>
     <string name="number_picker_decrement_button" msgid="2576606679160067262">"Смањење"</string>
     <string name="number_picker_increment_scroll_mode" msgid="1343063395404990189">"<xliff:g id="VALUE">%s</xliff:g> додирните и задржите."</string>
@@ -1144,6 +1150,7 @@
     <string name="keyboardview_keycode_mode_change" msgid="4547387741906537519">"Промена режима"</string>
     <string name="keyboardview_keycode_shift" msgid="2270748814315147690">"Shift"</string>
     <string name="keyboardview_keycode_enter" msgid="2985864015076059467">"Enter"</string>
+    <string name="content_description_sliding_handle" msgid="7311938669217173870">"Клизна ручица. Додирните и задржите."</string>
     <string name="description_direction_up" msgid="1983114130441878529">"Нагоре за <xliff:g id="TARGET_DESCRIPTION">%s</xliff:g>."</string>
     <string name="description_direction_down" msgid="4294993639091088240">"Надоле за <xliff:g id="TARGET_DESCRIPTION">%s</xliff:g>."</string>
     <string name="description_direction_left" msgid="6814008463839915747">"Улево за <xliff:g id="TARGET_DESCRIPTION">%s</xliff:g>."</string>
diff --git a/core/res/res/values-sv/strings.xml b/core/res/res/values-sv/strings.xml
index 0cd0daa..9a42ff3 100644
--- a/core/res/res/values-sv/strings.xml
+++ b/core/res/res/values-sv/strings.xml
@@ -1113,6 +1113,12 @@
     <string name="sync_undo_deletes" msgid="8610996708225006328">"Ångra borttagningarna."</string>
     <string name="sync_do_nothing" msgid="8717589462945226869">"Gör ingenting just nu."</string>
     <string name="choose_account_label" msgid="4191313562041125787">"Välj ett konto"</string>
+    <!-- no translation found for add_account_label (2935267344849993553) -->
+    <skip />
+    <!-- no translation found for choose_account_text (6891230675141555481) -->
+    <skip />
+    <!-- no translation found for add_account_button_label (3611982894853435874) -->
+    <skip />
     <string name="number_picker_increment_button" msgid="4830170763103463443">"Öka"</string>
     <string name="number_picker_decrement_button" msgid="2576606679160067262">"Minska"</string>
     <string name="number_picker_increment_scroll_mode" msgid="1343063395404990189">"<xliff:g id="VALUE">%s</xliff:g> knacka lätt och håll kvar."</string>
@@ -1144,6 +1150,7 @@
     <string name="keyboardview_keycode_mode_change" msgid="4547387741906537519">"Funktionsändring"</string>
     <string name="keyboardview_keycode_shift" msgid="2270748814315147690">"Skift"</string>
     <string name="keyboardview_keycode_enter" msgid="2985864015076059467">"Retur"</string>
+    <string name="content_description_sliding_handle" msgid="7311938669217173870">"Skärmlåsfunktion. Tryck och dra."</string>
     <string name="description_direction_up" msgid="1983114130441878529">"Upp för <xliff:g id="TARGET_DESCRIPTION">%s</xliff:g>."</string>
     <string name="description_direction_down" msgid="4294993639091088240">"Ned för <xliff:g id="TARGET_DESCRIPTION">%s</xliff:g>."</string>
     <string name="description_direction_left" msgid="6814008463839915747">"Vänster för <xliff:g id="TARGET_DESCRIPTION">%s</xliff:g>."</string>
diff --git a/core/res/res/values-sw/strings.xml b/core/res/res/values-sw/strings.xml
index 742da65..f0f90c63 100644
--- a/core/res/res/values-sw/strings.xml
+++ b/core/res/res/values-sw/strings.xml
@@ -1113,6 +1113,12 @@
     <string name="sync_undo_deletes" msgid="8610996708225006328">"Tendua ufutaji."</string>
     <string name="sync_do_nothing" msgid="8717589462945226869">"Usifanye chochote kwa sasa."</string>
     <string name="choose_account_label" msgid="4191313562041125787">"Chagua akaunti"</string>
+    <!-- no translation found for add_account_label (2935267344849993553) -->
+    <skip />
+    <!-- no translation found for choose_account_text (6891230675141555481) -->
+    <skip />
+    <!-- no translation found for add_account_button_label (3611982894853435874) -->
+    <skip />
     <string name="number_picker_increment_button" msgid="4830170763103463443">"Ongezeko"</string>
     <string name="number_picker_decrement_button" msgid="2576606679160067262">"Punguza"</string>
     <string name="number_picker_increment_scroll_mode" msgid="1343063395404990189">"<xliff:g id="VALUE">%s</xliff:g> gonga na shikilia"</string>
@@ -1144,6 +1150,7 @@
     <string name="keyboardview_keycode_mode_change" msgid="4547387741906537519">"Modi ya mabadiliko"</string>
     <string name="keyboardview_keycode_shift" msgid="2270748814315147690">"Songa"</string>
     <string name="keyboardview_keycode_enter" msgid="2985864015076059467">"Ingiza"</string>
+    <string name="content_description_sliding_handle" msgid="7311938669217173870">"Kishikilio cha Kuslaidi. Wahi na shikilia."</string>
     <string name="description_direction_up" msgid="1983114130441878529">"Juu ajili ya<xliff:g id="TARGET_DESCRIPTION">%s</xliff:g> ."</string>
     <string name="description_direction_down" msgid="4294993639091088240">"Chini kwa ajili ya<xliff:g id="TARGET_DESCRIPTION">%s</xliff:g> ."</string>
     <string name="description_direction_left" msgid="6814008463839915747">"Kushoto kwa <xliff:g id="TARGET_DESCRIPTION">%s</xliff:g> ."</string>
diff --git a/core/res/res/values-th/strings.xml b/core/res/res/values-th/strings.xml
index 1e3bde5..f535cae 100644
--- a/core/res/res/values-th/strings.xml
+++ b/core/res/res/values-th/strings.xml
@@ -1113,6 +1113,12 @@
     <string name="sync_undo_deletes" msgid="8610996708225006328">"เลิกทำการลบ"</string>
     <string name="sync_do_nothing" msgid="8717589462945226869">"ไม่ต้องทำอะไรในขณะนี้"</string>
     <string name="choose_account_label" msgid="4191313562041125787">"เลือกบัญชี"</string>
+    <!-- no translation found for add_account_label (2935267344849993553) -->
+    <skip />
+    <!-- no translation found for choose_account_text (6891230675141555481) -->
+    <skip />
+    <!-- no translation found for add_account_button_label (3611982894853435874) -->
+    <skip />
     <string name="number_picker_increment_button" msgid="4830170763103463443">"การเพิ่ม"</string>
     <string name="number_picker_decrement_button" msgid="2576606679160067262">"การลด"</string>
     <string name="number_picker_increment_scroll_mode" msgid="1343063395404990189">"แตะ <xliff:g id="VALUE">%s</xliff:g> ค้างไว้"</string>
@@ -1144,6 +1150,7 @@
     <string name="keyboardview_keycode_mode_change" msgid="4547387741906537519">"เปลี่ยนโหมด"</string>
     <string name="keyboardview_keycode_shift" msgid="2270748814315147690">"Shift"</string>
     <string name="keyboardview_keycode_enter" msgid="2985864015076059467">"ป้อน"</string>
+    <string name="content_description_sliding_handle" msgid="7311938669217173870">"ที่จับสำหรับเลื่อน แตะค้างไว้"</string>
     <string name="description_direction_up" msgid="1983114130441878529">"เลื่อนขึ้นเพื่อ <xliff:g id="TARGET_DESCRIPTION">%s</xliff:g>"</string>
     <string name="description_direction_down" msgid="4294993639091088240">"เลื่อนลงเพื่อ <xliff:g id="TARGET_DESCRIPTION">%s</xliff:g>"</string>
     <string name="description_direction_left" msgid="6814008463839915747">"เลื่อนไปทางซ้ายเพื่อ <xliff:g id="TARGET_DESCRIPTION">%s</xliff:g>"</string>
diff --git a/core/res/res/values-tl/strings.xml b/core/res/res/values-tl/strings.xml
index 93374f4..3803181 100644
--- a/core/res/res/values-tl/strings.xml
+++ b/core/res/res/values-tl/strings.xml
@@ -1113,6 +1113,12 @@
     <string name="sync_undo_deletes" msgid="8610996708225006328">"I-undo ang mga pagtanggal."</string>
     <string name="sync_do_nothing" msgid="8717589462945226869">"Walang gawin sa ngayon."</string>
     <string name="choose_account_label" msgid="4191313562041125787">"Pumili ng account"</string>
+    <!-- no translation found for add_account_label (2935267344849993553) -->
+    <skip />
+    <!-- no translation found for choose_account_text (6891230675141555481) -->
+    <skip />
+    <!-- no translation found for add_account_button_label (3611982894853435874) -->
+    <skip />
     <string name="number_picker_increment_button" msgid="4830170763103463443">"Taasan"</string>
     <string name="number_picker_decrement_button" msgid="2576606679160067262">"Babaan"</string>
     <string name="number_picker_increment_scroll_mode" msgid="1343063395404990189">"<xliff:g id="VALUE">%s</xliff:g> tapikin at pindutin nang matagal."</string>
@@ -1144,6 +1150,7 @@
     <string name="keyboardview_keycode_mode_change" msgid="4547387741906537519">"Pagbabago ng Mode"</string>
     <string name="keyboardview_keycode_shift" msgid="2270748814315147690">"Shift"</string>
     <string name="keyboardview_keycode_enter" msgid="2985864015076059467">"Enter"</string>
+    <string name="content_description_sliding_handle" msgid="7311938669217173870">"Hawakan sa pag-slide. Tapikin at i-hold."</string>
     <string name="description_direction_up" msgid="1983114130441878529">"Nakataas para sa <xliff:g id="TARGET_DESCRIPTION">%s</xliff:g>."</string>
     <string name="description_direction_down" msgid="4294993639091088240">"Nakababa para sa <xliff:g id="TARGET_DESCRIPTION">%s</xliff:g>."</string>
     <string name="description_direction_left" msgid="6814008463839915747">"Pakaliwa para sa <xliff:g id="TARGET_DESCRIPTION">%s</xliff:g>."</string>
diff --git a/core/res/res/values-tr/strings.xml b/core/res/res/values-tr/strings.xml
index 8e587ac..637cbd6 100644
--- a/core/res/res/values-tr/strings.xml
+++ b/core/res/res/values-tr/strings.xml
@@ -1113,6 +1113,12 @@
     <string name="sync_undo_deletes" msgid="8610996708225006328">"Silme işlemlerini geri alın."</string>
     <string name="sync_do_nothing" msgid="8717589462945226869">"Şimdilik bir şey yapma."</string>
     <string name="choose_account_label" msgid="4191313562041125787">"Bir hesap seçin"</string>
+    <!-- no translation found for add_account_label (2935267344849993553) -->
+    <skip />
+    <!-- no translation found for choose_account_text (6891230675141555481) -->
+    <skip />
+    <!-- no translation found for add_account_button_label (3611982894853435874) -->
+    <skip />
     <string name="number_picker_increment_button" msgid="4830170763103463443">"Artır"</string>
     <string name="number_picker_decrement_button" msgid="2576606679160067262">"Azalt"</string>
     <string name="number_picker_increment_scroll_mode" msgid="1343063395404990189">"<xliff:g id="VALUE">%s</xliff:g> hafifçe vurun ve basılı tutun."</string>
@@ -1144,6 +1150,7 @@
     <string name="keyboardview_keycode_mode_change" msgid="4547387741906537519">"Mod değiştirme"</string>
     <string name="keyboardview_keycode_shift" msgid="2270748814315147690">"ÜstKrkt"</string>
     <string name="keyboardview_keycode_enter" msgid="2985864015076059467">"Giriş"</string>
+    <string name="content_description_sliding_handle" msgid="7311938669217173870">"Kayar tutma yeri. Hafifçe vurun ve basılı tutun."</string>
     <string name="description_direction_up" msgid="1983114130441878529">"<xliff:g id="TARGET_DESCRIPTION">%s</xliff:g> için yukarı."</string>
     <string name="description_direction_down" msgid="4294993639091088240">"<xliff:g id="TARGET_DESCRIPTION">%s</xliff:g> için aşağı."</string>
     <string name="description_direction_left" msgid="6814008463839915747">"<xliff:g id="TARGET_DESCRIPTION">%s</xliff:g> için sola."</string>
diff --git a/core/res/res/values-uk/strings.xml b/core/res/res/values-uk/strings.xml
index 68801ee..1eb5ed0 100644
--- a/core/res/res/values-uk/strings.xml
+++ b/core/res/res/values-uk/strings.xml
@@ -1113,6 +1113,12 @@
     <string name="sync_undo_deletes" msgid="8610996708225006328">"Скасувати видалення."</string>
     <string name="sync_do_nothing" msgid="8717589462945226869">"Наразі нічого не робіть."</string>
     <string name="choose_account_label" msgid="4191313562041125787">"Вибрати обліковий запис"</string>
+    <!-- no translation found for add_account_label (2935267344849993553) -->
+    <skip />
+    <!-- no translation found for choose_account_text (6891230675141555481) -->
+    <skip />
+    <!-- no translation found for add_account_button_label (3611982894853435874) -->
+    <skip />
     <string name="number_picker_increment_button" msgid="4830170763103463443">"Додати"</string>
     <string name="number_picker_decrement_button" msgid="2576606679160067262">"Відняти"</string>
     <string name="number_picker_increment_scroll_mode" msgid="1343063395404990189">"<xliff:g id="VALUE">%s</xliff:g> – торкніться й утримуйте."</string>
@@ -1144,6 +1150,7 @@
     <string name="keyboardview_keycode_mode_change" msgid="4547387741906537519">"Зміна режиму"</string>
     <string name="keyboardview_keycode_shift" msgid="2270748814315147690">"Shift"</string>
     <string name="keyboardview_keycode_enter" msgid="2985864015076059467">"Enter"</string>
+    <string name="content_description_sliding_handle" msgid="7311938669217173870">"Ручка-повзунок. Торкніться й утримуйте її."</string>
     <string name="description_direction_up" msgid="1983114130441878529">"Угору, щоб <xliff:g id="TARGET_DESCRIPTION">%s</xliff:g>."</string>
     <string name="description_direction_down" msgid="4294993639091088240">"Униз, щоб <xliff:g id="TARGET_DESCRIPTION">%s</xliff:g>."</string>
     <string name="description_direction_left" msgid="6814008463839915747">"Ліворуч, щоб <xliff:g id="TARGET_DESCRIPTION">%s</xliff:g>."</string>
diff --git a/core/res/res/values-vi/strings.xml b/core/res/res/values-vi/strings.xml
index c24efc8..e4d3423 100644
--- a/core/res/res/values-vi/strings.xml
+++ b/core/res/res/values-vi/strings.xml
@@ -1113,6 +1113,12 @@
     <string name="sync_undo_deletes" msgid="8610996708225006328">"Hoàn tác các tác vụ xóa."</string>
     <string name="sync_do_nothing" msgid="8717589462945226869">"Ngay bây giờ bạn không cần làm gì cả."</string>
     <string name="choose_account_label" msgid="4191313562041125787">"Chọn tài khoản"</string>
+    <!-- no translation found for add_account_label (2935267344849993553) -->
+    <skip />
+    <!-- no translation found for choose_account_text (6891230675141555481) -->
+    <skip />
+    <!-- no translation found for add_account_button_label (3611982894853435874) -->
+    <skip />
     <string name="number_picker_increment_button" msgid="4830170763103463443">"Tăng dần"</string>
     <string name="number_picker_decrement_button" msgid="2576606679160067262">"Giảm dần"</string>
     <string name="number_picker_increment_scroll_mode" msgid="1343063395404990189">"Bấm và giữ <xliff:g id="VALUE">%s</xliff:g>."</string>
@@ -1144,6 +1150,7 @@
     <string name="keyboardview_keycode_mode_change" msgid="4547387741906537519">"Thay đổi chế độ"</string>
     <string name="keyboardview_keycode_shift" msgid="2270748814315147690">"Shift"</string>
     <string name="keyboardview_keycode_enter" msgid="2985864015076059467">"Enter"</string>
+    <string name="content_description_sliding_handle" msgid="7311938669217173870">"Tay trượt. Bấm và giữ."</string>
     <string name="description_direction_up" msgid="1983114130441878529">"Lên để <xliff:g id="TARGET_DESCRIPTION">%s</xliff:g>."</string>
     <string name="description_direction_down" msgid="4294993639091088240">"Xuống để <xliff:g id="TARGET_DESCRIPTION">%s</xliff:g>."</string>
     <string name="description_direction_left" msgid="6814008463839915747">"Sang trái để <xliff:g id="TARGET_DESCRIPTION">%s</xliff:g>."</string>
diff --git a/core/res/res/values-zh-rCN/strings.xml b/core/res/res/values-zh-rCN/strings.xml
index dd45eb6..a306d67 100644
--- a/core/res/res/values-zh-rCN/strings.xml
+++ b/core/res/res/values-zh-rCN/strings.xml
@@ -1113,6 +1113,12 @@
     <string name="sync_undo_deletes" msgid="8610996708225006328">"撤消删除。"</string>
     <string name="sync_do_nothing" msgid="8717589462945226869">"目前不进行任何操作。"</string>
     <string name="choose_account_label" msgid="4191313562041125787">"选择帐户"</string>
+    <!-- no translation found for add_account_label (2935267344849993553) -->
+    <skip />
+    <!-- no translation found for choose_account_text (6891230675141555481) -->
+    <skip />
+    <!-- no translation found for add_account_button_label (3611982894853435874) -->
+    <skip />
     <string name="number_picker_increment_button" msgid="4830170763103463443">"增加"</string>
     <string name="number_picker_decrement_button" msgid="2576606679160067262">"减少"</string>
     <string name="number_picker_increment_scroll_mode" msgid="1343063395404990189">"点按 <xliff:g id="VALUE">%s</xliff:g> 次并按住。"</string>
@@ -1144,6 +1150,7 @@
     <string name="keyboardview_keycode_mode_change" msgid="4547387741906537519">"模式更改"</string>
     <string name="keyboardview_keycode_shift" msgid="2270748814315147690">"Shift"</string>
     <string name="keyboardview_keycode_enter" msgid="2985864015076059467">"Enter"</string>
+    <string name="content_description_sliding_handle" msgid="7311938669217173870">"滑动手柄。点按并按住。"</string>
     <string name="description_direction_up" msgid="1983114130441878529">"向上滑动<xliff:g id="TARGET_DESCRIPTION">%s</xliff:g>。"</string>
     <string name="description_direction_down" msgid="4294993639091088240">"向下滑动<xliff:g id="TARGET_DESCRIPTION">%s</xliff:g>。"</string>
     <string name="description_direction_left" msgid="6814008463839915747">"向左滑动<xliff:g id="TARGET_DESCRIPTION">%s</xliff:g>。"</string>
diff --git a/core/res/res/values-zh-rTW/strings.xml b/core/res/res/values-zh-rTW/strings.xml
index f3ca98c..6b13a95 100644
--- a/core/res/res/values-zh-rTW/strings.xml
+++ b/core/res/res/values-zh-rTW/strings.xml
@@ -1113,6 +1113,12 @@
     <string name="sync_undo_deletes" msgid="8610996708225006328">"復原刪除。"</string>
     <string name="sync_do_nothing" msgid="8717589462945226869">"暫不執行。"</string>
     <string name="choose_account_label" msgid="4191313562041125787">"選取帳戶"</string>
+    <!-- no translation found for add_account_label (2935267344849993553) -->
+    <skip />
+    <!-- no translation found for choose_account_text (6891230675141555481) -->
+    <skip />
+    <!-- no translation found for add_account_button_label (3611982894853435874) -->
+    <skip />
     <string name="number_picker_increment_button" msgid="4830170763103463443">"增加"</string>
     <string name="number_picker_decrement_button" msgid="2576606679160067262">"減少"</string>
     <string name="number_picker_increment_scroll_mode" msgid="1343063395404990189">"<xliff:g id="VALUE">%s</xliff:g> 持續輕按。"</string>
@@ -1144,6 +1150,7 @@
     <string name="keyboardview_keycode_mode_change" msgid="4547387741906537519">"模式變更"</string>
     <string name="keyboardview_keycode_shift" msgid="2270748814315147690">"Shift 鍵"</string>
     <string name="keyboardview_keycode_enter" msgid="2985864015076059467">"Enter 鍵"</string>
+    <string name="content_description_sliding_handle" msgid="7311938669217173870">"滑動控制。持續輕按。"</string>
     <string name="description_direction_up" msgid="1983114130441878529">"向上滑動即可<xliff:g id="TARGET_DESCRIPTION">%s</xliff:g>。"</string>
     <string name="description_direction_down" msgid="4294993639091088240">"向下滑動即可<xliff:g id="TARGET_DESCRIPTION">%s</xliff:g>。"</string>
     <string name="description_direction_left" msgid="6814008463839915747">"向左滑動即可<xliff:g id="TARGET_DESCRIPTION">%s</xliff:g>。"</string>
diff --git a/core/res/res/values-zu/strings.xml b/core/res/res/values-zu/strings.xml
index 126e15e..f7dde4f 100644
--- a/core/res/res/values-zu/strings.xml
+++ b/core/res/res/values-zu/strings.xml
@@ -1113,6 +1113,12 @@
     <string name="sync_undo_deletes" msgid="8610996708225006328">"Guqula okususiwe."</string>
     <string name="sync_do_nothing" msgid="8717589462945226869">"Ungenzi lutho okwamanje."</string>
     <string name="choose_account_label" msgid="4191313562041125787">"Khetha i-akhawunti"</string>
+    <!-- no translation found for add_account_label (2935267344849993553) -->
+    <skip />
+    <!-- no translation found for choose_account_text (6891230675141555481) -->
+    <skip />
+    <!-- no translation found for add_account_button_label (3611982894853435874) -->
+    <skip />
     <string name="number_picker_increment_button" msgid="4830170763103463443">"Nciphisa"</string>
     <string name="number_picker_decrement_button" msgid="2576606679160067262">"i-Descrement"</string>
     <string name="number_picker_increment_scroll_mode" msgid="1343063395404990189">"<xliff:g id="VALUE">%s</xliff:g> chofoza bese ucindezela."</string>
@@ -1144,6 +1150,7 @@
     <string name="keyboardview_keycode_mode_change" msgid="4547387741906537519">"Ukushintsha kwendlela esetshenziswayo"</string>
     <string name="keyboardview_keycode_shift" msgid="2270748814315147690">"Beka kwenye indawo"</string>
     <string name="keyboardview_keycode_enter" msgid="2985864015076059467">"Faka"</string>
+    <string name="content_description_sliding_handle" msgid="7311938669217173870">"Isibambo esishelelayo. Thepha bese uyabamba."</string>
     <string name="description_direction_up" msgid="1983114130441878529">"Phezulu kwe <xliff:g id="TARGET_DESCRIPTION">%s</xliff:g>."</string>
     <string name="description_direction_down" msgid="4294993639091088240">"Ngaphansi kwe <xliff:g id="TARGET_DESCRIPTION">%s</xliff:g>."</string>
     <string name="description_direction_left" msgid="6814008463839915747">"Kwesokunxeleee kwe <xliff:g id="TARGET_DESCRIPTION">%s</xliff:g>."</string>
diff --git a/core/res/res/values/colors.xml b/core/res/res/values/colors.xml
index ddb9942..f0c6d09 100644
--- a/core/res/res/values/colors.xml
+++ b/core/res/res/values/colors.xml
@@ -112,6 +112,9 @@
     <color name="lockscreen_clock_am_pm">#ff9a9a9a</color>
     <color name="lockscreen_owner_info">#ff9a9a9a</color>
 
+    <!-- FaceLock -->
+    <color name="facelock_color_background">#000000</color>
+
     <!-- For holo theme -->
       <drawable name="screen_background_holo_light">#fff3f3f3</drawable>
       <drawable name="screen_background_holo_dark">#ff000000</drawable>
diff --git a/core/res/res/values/dimens.xml b/core/res/res/values/dimens.xml
index f1fc42c..1cd3911 100644
--- a/core/res/res/values/dimens.xml
+++ b/core/res/res/values/dimens.xml
@@ -158,7 +158,10 @@
     <dimen name="keyguard_lockscreen_status_line_font_size">14sp</dimen>
 
     <!-- Size of right margin on Unsecure unlock LockScreen -->
-    <dimen name="keyguard_lockscreen_status_line_font_right_margin">45dip</dimen>
+    <dimen name="keyguard_lockscreen_status_line_font_right_margin">42dip</dimen>
+
+    <!-- Size of top margin on Clock font to edge on unlock LockScreen -->
+    <dimen name="keyguard_lockscreen_status_line_clockfont_top_margin">24dip</dimen>
 
     <!-- Minimum popup width for selecting an activity in ActivityChooserDialog/ActivityChooserView. -->
     <dimen name="activity_chooser_popup_min_width">200dip</dimen>
@@ -178,4 +181,6 @@
     <!-- Default width for a textview error popup -->
     <dimen name="textview_error_popup_default_width">240dip</dimen>
 
+    <!-- Volume panel y offset -->
+    <dimen name="volume_panel_top">80dp</dimen>
 </resources>
diff --git a/core/res/res/values/styles.xml b/core/res/res/values/styles.xml
index 346a3d29..88b45fd 100644
--- a/core/res/res/values/styles.xml
+++ b/core/res/res/values/styles.xml
@@ -250,7 +250,7 @@
     </style>
 
     <style name="TextAppearance.EasyCorrectSuggestion" parent="TextAppearance.Suggestion">
-        <item name="android:textUnderlineColor">@color/holo_blue_dark</item>
+        <item name="android:textUnderlineColor">#ff888888</item>
     </style>
 
     <style name="TextAppearance.MisspelledSuggestion" parent="TextAppearance.Suggestion">
diff --git a/core/res/res/values/themes.xml b/core/res/res/values/themes.xml
index 3378dc8..1987d99 100644
--- a/core/res/res/values/themes.xml
+++ b/core/res/res/values/themes.xml
@@ -94,7 +94,7 @@
 
         <item name="textAppearanceButton">@android:style/TextAppearance.Widget.Button</item>
         
-        <item name="editTextColor">?android:attr/textColorPrimaryInverse</item>
+        <item name="editTextColor">@android:color/primary_text_light</item>
         <item name="editTextBackground">@android:drawable/edit_text</item>
         
         <item name="candidatesTextStyleSpans">@android:string/candidates_style</item>
@@ -410,7 +410,7 @@
         <item name="textColorLink">@android:color/link_text_light</item>
         <item name="textColorLinkInverse">@android:color/link_text_dark</item>
         
-        <item name="editTextColor">?android:attr/textColorPrimary</item>
+        <item name="editTextColor">@android:color/primary_text_light</item>
         <item name="listChoiceBackgroundIndicator">@android:drawable/list_selector_background</item>
 
         <item name="activatedBackgroundIndicator">@android:drawable/activated_background_light</item>
diff --git a/core/tests/bandwidthtests/Android.mk b/core/tests/bandwidthtests/Android.mk
index 3d56141..6871efd 100644
--- a/core/tests/bandwidthtests/Android.mk
+++ b/core/tests/bandwidthtests/Android.mk
@@ -27,4 +27,4 @@
 
 include $(BUILD_PACKAGE)
 
-include $(call all-makefiles-under,$(LOCAL_PATH))
+include $(call all-makefiles-under,$(LOCAL_PATH))
\ No newline at end of file
diff --git a/core/tests/bandwidthtests/src/com/android/bandwidthtest/BandwidthTest.java b/core/tests/bandwidthtests/src/com/android/bandwidthtest/BandwidthTest.java
index be740d3..9eee2f0 100644
--- a/core/tests/bandwidthtests/src/com/android/bandwidthtest/BandwidthTest.java
+++ b/core/tests/bandwidthtests/src/com/android/bandwidthtest/BandwidthTest.java
@@ -120,6 +120,42 @@
     }
 
     /**
+     * Ensure that downloading on wifi reports reasonable stats.
+     */
+    @LargeTest
+    public void testWifiUpload() {
+        assertTrue(setDeviceWifiAndAirplaneMode(mSsid));
+        // Download a file from the server.
+        String ts = Long.toString(System.currentTimeMillis());
+        String targetUrl = BandwidthTestUtil.buildDownloadUrl(
+                mTestServer, FILE_SIZE, mDeviceId, ts);
+        File tmpSaveFile = new File(BASE_DIR + File.separator + TMP_FILENAME);
+        assertTrue(BandwidthTestUtil.DownloadFromUrl(targetUrl, tmpSaveFile));
+
+        ts = Long.toString(System.currentTimeMillis());
+        NetworkStats pre_test_stats = fetchDataFromProc(mUid);
+        TrafficStats.startDataProfiling(mContext);
+        assertTrue(BandwidthTestUtil.postFileToServer(mTestServer, mDeviceId, ts, tmpSaveFile));
+        NetworkStats prof_stats = TrafficStats.stopDataProfiling(mContext);
+        Log.d(LOG_TAG, prof_stats.toString());
+        NetworkStats post_test_stats = fetchDataFromProc(mUid);
+        NetworkStats proc_stats = post_test_stats.subtract(pre_test_stats);
+
+        // Output measurements to instrumentation out, so that it can be compared to that of
+        // the server.
+        Bundle results = new Bundle();
+        results.putString("device_id", mDeviceId);
+        results.putString("timestamp", ts);
+        results.putInt("size", FILE_SIZE);
+        AddStatsToResults(PROF_LABEL, prof_stats, results);
+        AddStatsToResults(PROC_LABEL, proc_stats, results);
+        getInstrumentation().sendStatus(INSTRUMENTATION_IN_PROGRESS, results);
+
+        // Clean up.
+        assertTrue(cleanUpFile(tmpSaveFile));
+    }
+
+    /**
      * We want to make sure that if we use the Download Manager to download stuff,
      * accounting still goes to the app making the call and that the numbers still make sense.
      */
diff --git a/core/tests/bandwidthtests/src/com/android/bandwidthtest/util/BandwidthTestUtil.java b/core/tests/bandwidthtests/src/com/android/bandwidthtest/util/BandwidthTestUtil.java
index d850169..7dea9e3 100644
--- a/core/tests/bandwidthtests/src/com/android/bandwidthtest/util/BandwidthTestUtil.java
+++ b/core/tests/bandwidthtests/src/com/android/bandwidthtest/util/BandwidthTestUtil.java
@@ -18,6 +18,15 @@
 
 import android.util.Log;
 
+import com.android.internal.http.multipart.FilePart;
+import com.android.internal.http.multipart.MultipartEntity;
+import com.android.internal.http.multipart.Part;
+import com.android.internal.http.multipart.StringPart;
+
+import org.apache.http.HttpResponse;
+import org.apache.http.client.HttpClient;
+import org.apache.http.client.methods.HttpPost;
+import org.apache.http.impl.client.DefaultHttpClient;
 import org.apache.http.util.ByteArrayBuffer;
 
 import java.io.BufferedInputStream;
@@ -80,7 +89,7 @@
      * Download a given file from a target url to a given destination file.
      * @param targetUrl the url to download
      * @param file the {@link File} location where to save to
-     * @return true if it succeeded.
+     * @return true if it succeeded
      */
     public static boolean DownloadFromUrl(String targetUrl, File file) {
         try {
@@ -106,4 +115,32 @@
         return true;
     }
 
+    /**
+     * Post a given file for a given device and timestamp to the server.
+     * @param postUrl {@link String} url used to upload files
+     * @param deviceId {@link String} device id that is uploading
+     * @param timestamp {@link String} timestamp
+     * @param file {@link File} to upload
+     * @return true if it succeeded
+     */
+    public static boolean postFileToServer(String postUrl, String deviceId, String timestamp,
+            File file) {
+        try {
+            HttpClient httpClient = new DefaultHttpClient();
+            HttpPost postRequest = new HttpPost(postUrl);
+            Part[] parts = {
+                    new StringPart("device_id", deviceId),
+                    new StringPart("timestamp", timestamp),
+                    new FilePart("file", file)
+            };
+            MultipartEntity reqEntity = new MultipartEntity(parts, postRequest.getParams());
+            postRequest.setEntity(reqEntity);
+            HttpResponse res = httpClient.execute(postRequest);
+            res.getEntity().getContent().close();
+        } catch (IOException e) {
+            Log.e(LOG_TAG, "Could not upload file with error: " + e);
+            return false;
+        }
+        return true;
+    }
 }
diff --git a/docs/html/sdk/android-3.2.jd b/docs/html/sdk/android-3.2.jd
index 5618eae..ea2b4ed 100644
--- a/docs/html/sdk/android-3.2.jd
+++ b/docs/html/sdk/android-3.2.jd
@@ -166,7 +166,7 @@
 reserved by the system.
 </li>
 
-<li>In constrast, a screen's <em>width</em> and <em>height</em> represent the
+<li>In contrast, a screen's <em>width</em> and <em>height</em> represent the
 current horizontal or vertical space available for application layout, measured
 in "dp" units, not including screen areas reserved by the system. The width and
 height of a screen change when the user switches orientation between landscape
@@ -313,7 +313,7 @@
 the system forces the application into screen compatibility mode, to ensure best
 display on the current screen.</li>
 
-<li><code>android:smallestWidthLimitDp="<em>numDp"</em></code> &mdash; This
+<li><code>android:requiresSmallestWidthDp="<em>numDp"</em></code> &mdash; This
 attribute lets you specify the minimum smallestWidth on which the application
 can run. If the current screen is smaller than the value specified, the system
 considers the application incompatible with the device, but does not prevent it
diff --git a/include/ui/Rect.h b/include/ui/Rect.h
index 4e65a2d..9e98bc5 100644
--- a/include/ui/Rect.h
+++ b/include/ui/Rect.h
@@ -27,7 +27,7 @@
 class Rect : public ARect
 {
 public:
-    typedef int32_t value_type;
+    typedef ARect::value_type value_type;
 
     // we don't provide copy-ctor and operator= on purpose
     // because we want the compiler generated versions
diff --git a/include/utils/threads.h b/include/utils/threads.h
index c685625..ab3e8cd 100644
--- a/include/utils/threads.h
+++ b/include/utils/threads.h
@@ -143,6 +143,10 @@
 // in either case errno is set.  Thread ID zero means current thread.
 extern int androidSetThreadPriority(pid_t tid, int prio);
 
+// Get the current priority of a particular thread. Returns one of the
+// ANDROID_PRIORITY constants or a negative result in case of error.
+extern int androidGetThreadPriority(pid_t tid);
+
 // Get the current scheduling group of a particular thread. Normally returns
 // one of the ANDROID_TGROUP constants other than ANDROID_TGROUP_DEFAULT.
 // Returns ANDROID_TGROUP_DEFAULT if no pthread support (e.g. on host) or if
diff --git a/libs/gui/SurfaceTexture.cpp b/libs/gui/SurfaceTexture.cpp
index 79a01a3..f2bc81e 100644
--- a/libs/gui/SurfaceTexture.cpp
+++ b/libs/gui/SurfaceTexture.cpp
@@ -595,7 +595,7 @@
     Mutex::Autolock lock(mMutex);
 
     if (mAbandoned) {
-        LOGE("connect: SurfaceTexture has been abandoned!");
+        LOGE("disconnect: SurfaceTexture has been abandoned!");
         return NO_INIT;
     }
 
diff --git a/libs/hwui/LayerRenderer.cpp b/libs/hwui/LayerRenderer.cpp
index a398673..349b9e3 100644
--- a/libs/hwui/LayerRenderer.cpp
+++ b/libs/hwui/LayerRenderer.cpp
@@ -31,20 +31,16 @@
 // Rendering
 ///////////////////////////////////////////////////////////////////////////////
 
-Rect* gHackDontCorruptRegisters;
-
 void LayerRenderer::prepareDirty(float left, float top, float right, float bottom, bool opaque) {
     LAYER_RENDERER_LOGD("Rendering into layer, fbo = %d", mLayer->getFbo());
 
-    Rect dirty(left, top, right, bottom);
-    gHackDontCorruptRegisters = &dirty;
-
     glBindFramebuffer(GL_FRAMEBUFFER, mLayer->getFbo());
 
     const float width = mLayer->layer.getWidth();
     const float height = mLayer->layer.getHeight();
 
 #if RENDER_LAYERS_AS_REGIONS
+    Rect dirty(left, top, right, bottom);
     if (dirty.isEmpty() || (dirty.left <= 0 && dirty.top <= 0 &&
             dirty.right >= width && dirty.bottom >= height)) {
         mLayer->region.clear();
diff --git a/libs/hwui/Rect.h b/libs/hwui/Rect.h
index 71951b7..edc90e1 100644
--- a/libs/hwui/Rect.h
+++ b/libs/hwui/Rect.h
@@ -28,7 +28,19 @@
 // Structs
 ///////////////////////////////////////////////////////////////////////////////
 
-struct Rect {
+class Rect {
+    static inline float min(float a, float b) { return (a<b) ? a : b; }
+    static inline float max(float a, float b) { return (a>b) ? a : b; }
+    Rect intersectWith(float l, float t, float r, float b) const {
+        Rect tmp;
+        tmp.left    = max(left, l);
+        tmp.top     = max(top, t);
+        tmp.right   = min(right, r);
+        tmp.bottom  = min(bottom, b);
+        return tmp;
+    }
+
+public:
     float left;
     float top;
     float right;
@@ -37,6 +49,9 @@
     // Used by Region
     typedef float value_type;
 
+    // we don't provide copy-ctor and operator= on purpose
+    // because we want the compiler generated versions
+
     inline Rect():
             left(0),
             top(0),
@@ -58,24 +73,6 @@
             bottom(height) {
     }
 
-    inline Rect(const Rect& r) {
-        set(r);
-    }
-
-    inline Rect(Rect& r) {
-        set(r);
-    }
-
-    Rect& operator=(const Rect& r) {
-        set(r);
-        return *this;
-    }
-
-    Rect& operator=(Rect& r) {
-        set(r);
-        return *this;
-    }
-
     friend int operator==(const Rect& a, const Rect& b) {
         return !memcmp(&a, &b, sizeof(a));
     }
@@ -89,7 +86,9 @@
     }
 
     inline bool isEmpty() const {
-        return left >= right || top >= bottom;
+        // this is written in such way this it'll handle NANs to return
+        // true (empty)
+        return !((left < right) && (top < bottom));
     }
 
     inline void setEmpty() {
@@ -115,27 +114,18 @@
         return bottom - top;
     }
 
-    bool intersects(float left, float top, float right, float bottom) const {
-        return left < right && top < bottom &&
-                this->left < this->right && this->top < this->bottom &&
-                this->left < right && left < this->right &&
-                this->top < bottom && top < this->bottom;
+    bool intersects(float l, float t, float r, float b) const {
+        return !intersectWith(l,t,r,b).isEmpty();
     }
 
     bool intersects(const Rect& r) const {
         return intersects(r.left, r.top, r.right, r.bottom);
     }
 
-    bool intersect(float left, float top, float right, float bottom) {
-        if (left < right && top < bottom && !this->isEmpty() &&
-                this->left < right && left < this->right &&
-                this->top < bottom && top < this->bottom) {
-
-            if (this->left < left) this->left = left;
-            if (this->top < top) this->top = top;
-            if (this->right > right) this->right = right;
-            if (this->bottom > bottom) this->bottom = bottom;
-
+    bool intersect(float l, float t, float r, float b) {
+        Rect tmp(intersectWith(l,t,r,b));
+        if (!tmp.isEmpty()) {
+            set(tmp);
             return true;
         }
         return false;
@@ -182,7 +172,7 @@
         LOGD("Rect[l=%f t=%f r=%f b=%f]", left, top, right, bottom);
     }
 
-}; // struct Rect
+}; // class Rect
 
 }; // namespace uirenderer
 }; // namespace android
diff --git a/libs/ui/Region.cpp b/libs/ui/Region.cpp
index a060a5f..8dab291 100644
--- a/libs/ui/Region.cpp
+++ b/libs/ui/Region.cpp
@@ -479,6 +479,11 @@
         const Region& lhs,
         const Rect& rhs, int dx, int dy)
 {
+    if (!rhs.isValid()) {
+        LOGE("Region::boolean_operation(op=%d) invalid Rect={%d,%d,%d,%d}",
+                op, rhs.left, rhs.top, rhs.right, rhs.bottom);
+    }
+
 #if VALIDATE_WITH_CORECG || VALIDATE_REGIONS
     boolean_operation(op, dst, lhs, Region(rhs), dx, dy);
 #else
diff --git a/libs/utils/Threads.cpp b/libs/utils/Threads.cpp
index 02c380b..5dbcb75 100644
--- a/libs/utils/Threads.cpp
+++ b/libs/utils/Threads.cpp
@@ -368,6 +368,14 @@
     return rc;
 }
 
+int androidGetThreadPriority(pid_t tid) {
+#if defined(HAVE_PTHREADS)
+    return getpriority(PRIO_PROCESS, tid);
+#else
+    return ANDROID_PRIORITY_NORMAL;
+#endif
+}
+
 int androidGetThreadSchedulingGroup(pid_t tid)
 {
     int ret = ANDROID_TGROUP_DEFAULT;
diff --git a/media/java/android/media/MediaScanner.java b/media/java/android/media/MediaScanner.java
index 65818a1..336d874 100644
--- a/media/java/android/media/MediaScanner.java
+++ b/media/java/android/media/MediaScanner.java
@@ -470,6 +470,8 @@
         private int mCompilation;
         private boolean mIsDrm;
         private boolean mNoMedia;   // flag to suppress file from appearing in media tables
+        private int mWidth;
+        private int mHeight;
 
         public FileCacheEntry beginFile(String path, String mimeType, long lastModified,
                 long fileSize, boolean isDirectory, boolean noMedia) {
@@ -545,6 +547,8 @@
             mWriter = null;
             mCompilation = 0;
             mIsDrm = false;
+            mWidth = 0;
+            mHeight = 0;
 
             return entry;
         }
@@ -583,6 +587,10 @@
                             processFile(path, mimeType, this);
                         }
 
+                        if (MediaFile.isImageFileType(mFileType)) {
+                            processImageFile(path);
+                        }
+
                         result = endFile(entry, ringtones, notifications, alarms, music, podcasts);
                     }
                 }
@@ -697,6 +705,18 @@
             return genreTagValue;
         }
 
+        private void processImageFile(String path) {
+            try {
+                mBitmapOptions.outWidth = 0;
+                mBitmapOptions.outHeight = 0;
+                BitmapFactory.decodeFile(path, mBitmapOptions);
+                mWidth = mBitmapOptions.outWidth;
+                mHeight = mBitmapOptions.outHeight;
+            } catch (Throwable th) {
+                // ignore;
+            }
+        }
+
         public void setMimeType(String mimeType) {
             if ("audio/mp4".equals(mMimeType) &&
                     mimeType.startsWith("video")) {
@@ -725,6 +745,11 @@
             map.put(MediaStore.MediaColumns.MIME_TYPE, mMimeType);
             map.put(MediaStore.MediaColumns.IS_DRM, mIsDrm);
 
+            if (mWidth > 0 && mHeight > 0) {
+                map.put(MediaStore.MediaColumns.WIDTH, mWidth);
+                map.put(MediaStore.MediaColumns.HEIGHT, mHeight);
+            }
+
             if (!mNoMedia) {
                 if (MediaFile.isVideoFileType(mFileType)) {
                     map.put(Video.Media.ARTIST, (mArtist != null && mArtist.length() > 0
diff --git a/media/libmediaplayerservice/nuplayer/NuPlayer.cpp b/media/libmediaplayerservice/nuplayer/NuPlayer.cpp
index ee77f47..7218faf 100644
--- a/media/libmediaplayerservice/nuplayer/NuPlayer.cpp
+++ b/media/libmediaplayerservice/nuplayer/NuPlayer.cpp
@@ -34,17 +34,21 @@
 #include <media/stagefright/foundation/ADebug.h>
 #include <media/stagefright/foundation/AMessage.h>
 #include <media/stagefright/ACodec.h>
+#include <media/stagefright/MediaDefs.h>
 #include <media/stagefright/MediaErrors.h>
 #include <media/stagefright/MetaData.h>
 #include <surfaceflinger/Surface.h>
 #include <gui/ISurfaceTexture.h>
 
+#include "avc_utils.h"
+
 namespace android {
 
 ////////////////////////////////////////////////////////////////////////////////
 
 NuPlayer::NuPlayer()
     : mUIDValid(false),
+      mVideoIsAVC(false),
       mAudioEOS(false),
       mVideoEOS(false),
       mScanSourcesPending(false),
@@ -52,7 +56,12 @@
       mFlushingAudio(NONE),
       mFlushingVideo(NONE),
       mResetInProgress(false),
-      mResetPostponed(false) {
+      mResetPostponed(false),
+      mSkipRenderingAudioUntilMediaTimeUs(-1ll),
+      mSkipRenderingVideoUntilMediaTimeUs(-1ll),
+      mVideoLateByUs(0ll),
+      mNumFramesTotal(0ll),
+      mNumFramesDropped(0ll) {
 }
 
 NuPlayer::~NuPlayer() {
@@ -185,10 +194,14 @@
         {
             LOGV("kWhatStart");
 
+            mVideoIsAVC = false;
             mAudioEOS = false;
             mVideoEOS = false;
             mSkipRenderingAudioUntilMediaTimeUs = -1;
             mSkipRenderingVideoUntilMediaTimeUs = -1;
+            mVideoLateByUs = 0;
+            mNumFramesTotal = 0;
+            mNumFramesDropped = 0;
 
             mSource->start();
 
@@ -269,6 +282,8 @@
                 } else {
                     CHECK(IsFlushingState(mFlushingVideo, &needShutdown));
                     mFlushingVideo = FLUSHED;
+
+                    mVideoLateByUs = 0;
                 }
 
                 LOGV("decoder %s flush completed", audio ? "audio" : "video");
@@ -299,7 +314,12 @@
                          sampleRate, numChannels);
 
                     mAudioSink->close();
-                    CHECK_EQ(mAudioSink->open(sampleRate, numChannels), (status_t)OK);
+                    CHECK_EQ(mAudioSink->open(
+                                sampleRate,
+                                numChannels,
+                                AUDIO_FORMAT_PCM_16_BIT,
+                                8 /* bufferCount */),
+                             (status_t)OK);
                     mAudioSink->start();
 
                     mRenderer->signalAudioSinkChanged();
@@ -392,13 +412,18 @@
                 int64_t positionUs;
                 CHECK(msg->findInt64("positionUs", &positionUs));
 
+                CHECK(msg->findInt64("videoLateByUs", &mVideoLateByUs));
+
                 if (mDriver != NULL) {
                     sp<NuPlayerDriver> driver = mDriver.promote();
                     if (driver != NULL) {
                         driver->notifyPosition(positionUs);
+
+                        driver->notifyFrameStats(
+                                mNumFramesTotal, mNumFramesDropped);
                     }
                 }
-            } else {
+            } else if (what == Renderer::kWhatFlushComplete) {
                 CHECK_EQ(what, (int32_t)Renderer::kWhatFlushComplete);
 
                 int32_t audio;
@@ -560,6 +585,12 @@
         return -EWOULDBLOCK;
     }
 
+    if (!audio) {
+        const char *mime;
+        CHECK(meta->findCString(kKeyMIMEType, &mime));
+        mVideoIsAVC = !strcasecmp(MEDIA_MIMETYPE_VIDEO_AVC, mime);
+    }
+
     sp<AMessage> notify =
         new AMessage(audio ? kWhatAudioNotify : kWhatVideoNotify,
                      id());
@@ -593,53 +624,70 @@
     }
 
     sp<ABuffer> accessUnit;
-    status_t err = mSource->dequeueAccessUnit(audio, &accessUnit);
 
-    if (err == -EWOULDBLOCK) {
-        return err;
-    } else if (err != OK) {
-        if (err == INFO_DISCONTINUITY) {
-            int32_t type;
-            CHECK(accessUnit->meta()->findInt32("discontinuity", &type));
+    bool dropAccessUnit;
+    do {
+        status_t err = mSource->dequeueAccessUnit(audio, &accessUnit);
 
-            bool formatChange =
-                type == ATSParser::DISCONTINUITY_FORMATCHANGE;
+        if (err == -EWOULDBLOCK) {
+            return err;
+        } else if (err != OK) {
+            if (err == INFO_DISCONTINUITY) {
+                int32_t type;
+                CHECK(accessUnit->meta()->findInt32("discontinuity", &type));
 
-            LOGV("%s discontinuity (formatChange=%d)",
-                 audio ? "audio" : "video", formatChange);
+                bool formatChange =
+                    type == ATSParser::DISCONTINUITY_FORMATCHANGE;
 
-            if (audio) {
-                mSkipRenderingAudioUntilMediaTimeUs = -1;
-            } else {
-                mSkipRenderingVideoUntilMediaTimeUs = -1;
-            }
+                LOGV("%s discontinuity (formatChange=%d)",
+                     audio ? "audio" : "video", formatChange);
 
-            sp<AMessage> extra;
-            if (accessUnit->meta()->findMessage("extra", &extra)
-                    && extra != NULL) {
-                int64_t resumeAtMediaTimeUs;
-                if (extra->findInt64(
-                            "resume-at-mediatimeUs", &resumeAtMediaTimeUs)) {
-                    LOGI("suppressing rendering of %s until %lld us",
-                            audio ? "audio" : "video", resumeAtMediaTimeUs);
+                if (audio) {
+                    mSkipRenderingAudioUntilMediaTimeUs = -1;
+                } else {
+                    mSkipRenderingVideoUntilMediaTimeUs = -1;
+                }
 
-                    if (audio) {
-                        mSkipRenderingAudioUntilMediaTimeUs =
-                            resumeAtMediaTimeUs;
-                    } else {
-                        mSkipRenderingVideoUntilMediaTimeUs =
-                            resumeAtMediaTimeUs;
+                sp<AMessage> extra;
+                if (accessUnit->meta()->findMessage("extra", &extra)
+                        && extra != NULL) {
+                    int64_t resumeAtMediaTimeUs;
+                    if (extra->findInt64(
+                                "resume-at-mediatimeUs", &resumeAtMediaTimeUs)) {
+                        LOGI("suppressing rendering of %s until %lld us",
+                                audio ? "audio" : "video", resumeAtMediaTimeUs);
+
+                        if (audio) {
+                            mSkipRenderingAudioUntilMediaTimeUs =
+                                resumeAtMediaTimeUs;
+                        } else {
+                            mSkipRenderingVideoUntilMediaTimeUs =
+                                resumeAtMediaTimeUs;
+                        }
                     }
                 }
+
+                flushDecoder(audio, formatChange);
             }
 
-            flushDecoder(audio, formatChange);
+            reply->setInt32("err", err);
+            reply->post();
+            return OK;
         }
 
-        reply->setInt32("err", err);
-        reply->post();
-        return OK;
-    }
+        if (!audio) {
+            ++mNumFramesTotal;
+        }
+
+        dropAccessUnit = false;
+        if (!audio
+                && mVideoLateByUs > 100000ll
+                && mVideoIsAVC
+                && !IsAVCReferenceFrame(accessUnit)) {
+            dropAccessUnit = true;
+            ++mNumFramesDropped;
+        }
+    } while (dropAccessUnit);
 
     // LOGV("returned a valid buffer of %s data", audio ? "audio" : "video");
 
diff --git a/media/libmediaplayerservice/nuplayer/NuPlayer.h b/media/libmediaplayerservice/nuplayer/NuPlayer.h
index cf9185b..a5382b4 100644
--- a/media/libmediaplayerservice/nuplayer/NuPlayer.h
+++ b/media/libmediaplayerservice/nuplayer/NuPlayer.h
@@ -70,19 +70,19 @@
     struct StreamingSource;
 
     enum {
-        kWhatSetDataSource,
-        kWhatSetVideoNativeWindow,
-        kWhatSetAudioSink,
-        kWhatMoreDataQueued,
-        kWhatStart,
-        kWhatScanSources,
-        kWhatVideoNotify,
-        kWhatAudioNotify,
-        kWhatRendererNotify,
-        kWhatReset,
-        kWhatSeek,
-        kWhatPause,
-        kWhatResume,
+        kWhatSetDataSource              = '=DaS',
+        kWhatSetVideoNativeWindow       = '=NaW',
+        kWhatSetAudioSink               = '=AuS',
+        kWhatMoreDataQueued             = 'more',
+        kWhatStart                      = 'strt',
+        kWhatScanSources                = 'scan',
+        kWhatVideoNotify                = 'vidN',
+        kWhatAudioNotify                = 'audN',
+        kWhatRendererNotify             = 'renN',
+        kWhatReset                      = 'rset',
+        kWhatSeek                       = 'seek',
+        kWhatPause                      = 'paus',
+        kWhatResume                     = 'rsme',
     };
 
     wp<NuPlayerDriver> mDriver;
@@ -92,6 +92,7 @@
     sp<NativeWindowWrapper> mNativeWindow;
     sp<MediaPlayerBase::AudioSink> mAudioSink;
     sp<Decoder> mVideoDecoder;
+    bool mVideoIsAVC;
     sp<Decoder> mAudioDecoder;
     sp<Renderer> mRenderer;
 
@@ -119,6 +120,9 @@
     int64_t mSkipRenderingAudioUntilMediaTimeUs;
     int64_t mSkipRenderingVideoUntilMediaTimeUs;
 
+    int64_t mVideoLateByUs;
+    int64_t mNumFramesTotal, mNumFramesDropped;
+
     status_t instantiateDecoder(bool audio, sp<Decoder> *decoder);
 
     status_t feedDecoderInputData(bool audio, const sp<AMessage> &msg);
diff --git a/media/libmediaplayerservice/nuplayer/NuPlayerDecoder.cpp b/media/libmediaplayerservice/nuplayer/NuPlayerDecoder.cpp
index 81b41ef..56c2773 100644
--- a/media/libmediaplayerservice/nuplayer/NuPlayerDecoder.cpp
+++ b/media/libmediaplayerservice/nuplayer/NuPlayerDecoder.cpp
@@ -59,8 +59,21 @@
         format->setObject("native-window", mNativeWindow);
     }
 
+    // Current video decoders do not return from OMX_FillThisBuffer
+    // quickly, violating the OpenMAX specs, until that is remedied
+    // we need to invest in an extra looper to free the main event
+    // queue.
+    bool needDedicatedLooper = !strncasecmp(mime, "video/", 6);
+
     mCodec = new ACodec;
-    looper()->registerHandler(mCodec);
+
+    if (needDedicatedLooper && mCodecLooper == NULL) {
+        mCodecLooper = new ALooper;
+        mCodecLooper->setName("NuPlayerDecoder");
+        mCodecLooper->start(false, false, ANDROID_PRIORITY_AUDIO);
+    }
+
+    (needDedicatedLooper ? mCodecLooper : looper())->registerHandler(mCodec);
 
     mCodec->setNotificationMessage(notifyMsg);
     mCodec->initiateSetup(format);
diff --git a/media/libmediaplayerservice/nuplayer/NuPlayerDecoder.h b/media/libmediaplayerservice/nuplayer/NuPlayerDecoder.h
index fabc606..3ab1fcf 100644
--- a/media/libmediaplayerservice/nuplayer/NuPlayerDecoder.h
+++ b/media/libmediaplayerservice/nuplayer/NuPlayerDecoder.h
@@ -43,13 +43,14 @@
 
 private:
     enum {
-        kWhatCodecNotify,
+        kWhatCodecNotify        = 'cdcN',
     };
 
     sp<AMessage> mNotify;
     sp<NativeWindowWrapper> mNativeWindow;
 
     sp<ACodec> mCodec;
+    sp<ALooper> mCodecLooper;
 
     Vector<sp<ABuffer> > mCSD;
     size_t mCSDIndex;
diff --git a/media/libmediaplayerservice/nuplayer/NuPlayerDriver.cpp b/media/libmediaplayerservice/nuplayer/NuPlayerDriver.cpp
index c6fca2c..b1e917d 100644
--- a/media/libmediaplayerservice/nuplayer/NuPlayerDriver.cpp
+++ b/media/libmediaplayerservice/nuplayer/NuPlayerDriver.cpp
@@ -31,6 +31,8 @@
     : mResetInProgress(false),
       mDurationUs(-1),
       mPositionUs(-1),
+      mNumFramesTotal(0),
+      mNumFramesDropped(0),
       mLooper(new ALooper),
       mState(UNINITIALIZED),
       mStartupSeekTimeUs(-1) {
@@ -292,4 +294,30 @@
     sendEvent(MEDIA_SEEK_COMPLETE);
 }
 
+void NuPlayerDriver::notifyFrameStats(
+        int64_t numFramesTotal, int64_t numFramesDropped) {
+    Mutex::Autolock autoLock(mLock);
+    mNumFramesTotal = numFramesTotal;
+    mNumFramesDropped = numFramesDropped;
+}
+
+status_t NuPlayerDriver::dump(int fd, const Vector<String16> &args) const {
+    Mutex::Autolock autoLock(mLock);
+
+    FILE *out = fdopen(dup(fd), "w");
+
+    fprintf(out, " NuPlayer\n");
+    fprintf(out, "  numFramesTotal(%lld), numFramesDropped(%lld), "
+                 "percentageDropped(%.2f)\n",
+                 mNumFramesTotal,
+                 mNumFramesDropped,
+                 mNumFramesTotal == 0
+                    ? 0.0 : (double)mNumFramesDropped / mNumFramesTotal);
+
+    fclose(out);
+    out = NULL;
+
+    return OK;
+}
+
 }  // namespace android
diff --git a/media/libmediaplayerservice/nuplayer/NuPlayerDriver.h b/media/libmediaplayerservice/nuplayer/NuPlayerDriver.h
index 1bb7ca2..181c37d 100644
--- a/media/libmediaplayerservice/nuplayer/NuPlayerDriver.h
+++ b/media/libmediaplayerservice/nuplayer/NuPlayerDriver.h
@@ -60,16 +60,19 @@
     virtual status_t getMetadata(
             const media::Metadata::Filter& ids, Parcel *records);
 
+    virtual status_t dump(int fd, const Vector<String16> &args) const;
+
     void notifyResetComplete();
     void notifyDuration(int64_t durationUs);
     void notifyPosition(int64_t positionUs);
     void notifySeekComplete();
+    void notifyFrameStats(int64_t numFramesTotal, int64_t numFramesDropped);
 
 protected:
     virtual ~NuPlayerDriver();
 
 private:
-    Mutex mLock;
+    mutable Mutex mLock;
     Condition mCondition;
 
     // The following are protected through "mLock"
@@ -77,6 +80,8 @@
     bool mResetInProgress;
     int64_t mDurationUs;
     int64_t mPositionUs;
+    int64_t mNumFramesTotal;
+    int64_t mNumFramesDropped;
     // <<<
 
     sp<ALooper> mLooper;
diff --git a/media/libmediaplayerservice/nuplayer/NuPlayerRenderer.cpp b/media/libmediaplayerservice/nuplayer/NuPlayerRenderer.cpp
index bf83849..07e347e 100644
--- a/media/libmediaplayerservice/nuplayer/NuPlayerRenderer.cpp
+++ b/media/libmediaplayerservice/nuplayer/NuPlayerRenderer.cpp
@@ -47,7 +47,8 @@
       mHasVideo(false),
       mSyncQueues(false),
       mPaused(false),
-      mLastPositionUpdateUs(-1ll) {
+      mLastPositionUpdateUs(-1ll),
+      mVideoLateByUs(0ll) {
 }
 
 NuPlayer::Renderer::~Renderer() {
@@ -118,9 +119,24 @@
 
             mDrainAudioQueuePending = false;
 
-            onDrainAudioQueue();
+            if (onDrainAudioQueue()) {
+                uint32_t numFramesPlayed;
+                CHECK_EQ(mAudioSink->getPosition(&numFramesPlayed),
+                         (status_t)OK);
 
-            postDrainAudioQueue();
+                uint32_t numFramesPendingPlayout =
+                    mNumFramesWritten - numFramesPlayed;
+
+                // This is how long the audio sink will have data to
+                // play back.
+                int64_t delayUs =
+                    mAudioSink->msecsPerFrame()
+                        * numFramesPendingPlayout * 1000ll;
+
+                // Let's give it more data after about half that time
+                // has elapsed.
+                postDrainAudioQueue(delayUs / 2);
+            }
             break;
         }
 
@@ -182,7 +198,7 @@
     }
 }
 
-void NuPlayer::Renderer::postDrainAudioQueue() {
+void NuPlayer::Renderer::postDrainAudioQueue(int64_t delayUs) {
     if (mDrainAudioQueuePending || mSyncQueues || mPaused) {
         return;
     }
@@ -194,19 +210,33 @@
     mDrainAudioQueuePending = true;
     sp<AMessage> msg = new AMessage(kWhatDrainAudioQueue, id());
     msg->setInt32("generation", mAudioQueueGeneration);
-    msg->post();
+    msg->post(delayUs);
 }
 
 void NuPlayer::Renderer::signalAudioSinkChanged() {
     (new AMessage(kWhatAudioSinkChanged, id()))->post();
 }
 
-void NuPlayer::Renderer::onDrainAudioQueue() {
-    for (;;) {
-        if (mAudioQueue.empty()) {
-            break;
-        }
+bool NuPlayer::Renderer::onDrainAudioQueue() {
+    uint32_t numFramesPlayed;
+    CHECK_EQ(mAudioSink->getPosition(&numFramesPlayed), (status_t)OK);
 
+    ssize_t numFramesAvailableToWrite =
+        mAudioSink->frameCount() - (mNumFramesWritten - numFramesPlayed);
+
+#if 0
+    if (numFramesAvailableToWrite == mAudioSink->frameCount()) {
+        LOGI("audio sink underrun");
+    } else {
+        LOGV("audio queue has %d frames left to play",
+             mAudioSink->frameCount() - numFramesAvailableToWrite);
+    }
+#endif
+
+    size_t numBytesAvailableToWrite =
+        numFramesAvailableToWrite * mAudioSink->frameSize();
+
+    while (numBytesAvailableToWrite > 0 && !mAudioQueue.empty()) {
         QueueEntry *entry = &*mAudioQueue.begin();
 
         if (entry->mBuffer == NULL) {
@@ -216,20 +246,7 @@
 
             mAudioQueue.erase(mAudioQueue.begin());
             entry = NULL;
-            return;
-        }
-
-        uint32_t numFramesPlayed;
-        CHECK_EQ(mAudioSink->getPosition(&numFramesPlayed), (status_t)OK);
-
-        ssize_t numFramesAvailableToWrite =
-            mAudioSink->frameCount() - (mNumFramesWritten - numFramesPlayed);
-
-        size_t numBytesAvailableToWrite =
-            numFramesAvailableToWrite * mAudioSink->frameSize();
-
-        if (numBytesAvailableToWrite == 0) {
-            break;
+            return false;
         }
 
         if (entry->mOffset == 0) {
@@ -274,10 +291,14 @@
             entry = NULL;
         }
 
-        mNumFramesWritten += copy / mAudioSink->frameSize();
+        numBytesAvailableToWrite -= copy;
+        size_t copiedFrames = copy / mAudioSink->frameSize();
+        mNumFramesWritten += copiedFrames;
     }
 
     notifyPosition();
+
+    return !mAudioQueue.empty();
 }
 
 void NuPlayer::Renderer::postDrainVideoQueue() {
@@ -337,15 +358,26 @@
 
         mVideoQueue.erase(mVideoQueue.begin());
         entry = NULL;
+
+        mVideoLateByUs = 0ll;
+
+        notifyPosition();
         return;
     }
 
-#if 0
     int64_t mediaTimeUs;
     CHECK(entry->mBuffer->meta()->findInt64("timeUs", &mediaTimeUs));
 
-    LOGI("rendering video at media time %.2f secs", mediaTimeUs / 1E6);
-#endif
+    int64_t realTimeUs = mediaTimeUs - mAnchorTimeMediaUs + mAnchorTimeRealUs;
+    mVideoLateByUs = ALooper::GetNowUs() - realTimeUs;
+
+    bool tooLate = (mVideoLateByUs > 40000);
+
+    if (tooLate) {
+        LOGV("video late by %lld us (%.2f secs)", lateByUs, lateByUs / 1E6);
+    } else {
+        LOGV("rendering video at media time %.2f secs", mediaTimeUs / 1E6);
+    }
 
     entry->mNotifyConsumed->setInt32("render", true);
     entry->mNotifyConsumed->post();
@@ -577,6 +609,7 @@
     sp<AMessage> notify = mNotify->dup();
     notify->setInt32("what", kWhatPosition);
     notify->setInt64("positionUs", positionUs);
+    notify->setInt64("videoLateByUs", mVideoLateByUs);
     notify->post();
 }
 
diff --git a/media/libmediaplayerservice/nuplayer/NuPlayerRenderer.h b/media/libmediaplayerservice/nuplayer/NuPlayerRenderer.h
index 3a641a2..268628b 100644
--- a/media/libmediaplayerservice/nuplayer/NuPlayerRenderer.h
+++ b/media/libmediaplayerservice/nuplayer/NuPlayerRenderer.h
@@ -45,9 +45,9 @@
     void resume();
 
     enum {
-        kWhatEOS,
-        kWhatFlushComplete,
-        kWhatPosition,
+        kWhatEOS                = 'eos ',
+        kWhatFlushComplete      = 'fluC',
+        kWhatPosition           = 'posi',
     };
 
 protected:
@@ -57,14 +57,14 @@
 
 private:
     enum {
-        kWhatDrainAudioQueue,
-        kWhatDrainVideoQueue,
-        kWhatQueueBuffer,
-        kWhatQueueEOS,
-        kWhatFlush,
-        kWhatAudioSinkChanged,
-        kWhatPause,
-        kWhatResume,
+        kWhatDrainAudioQueue    = 'draA',
+        kWhatDrainVideoQueue    = 'draV',
+        kWhatQueueBuffer        = 'queB',
+        kWhatQueueEOS           = 'qEOS',
+        kWhatFlush              = 'flus',
+        kWhatAudioSinkChanged   = 'auSC',
+        kWhatPause              = 'paus',
+        kWhatResume             = 'resm',
     };
 
     struct QueueEntry {
@@ -101,9 +101,10 @@
     bool mPaused;
 
     int64_t mLastPositionUpdateUs;
+    int64_t mVideoLateByUs;
 
-    void onDrainAudioQueue();
-    void postDrainAudioQueue();
+    bool onDrainAudioQueue();
+    void postDrainAudioQueue(int64_t delayUs = 0);
 
     void onDrainVideoQueue();
     void postDrainVideoQueue();
@@ -118,6 +119,7 @@
     void notifyEOS(bool audio, status_t finalResult);
     void notifyFlushComplete(bool audio);
     void notifyPosition();
+    void notifyVideoLateBy(int64_t lateByUs);
 
     void flushQueue(List<QueueEntry> *queue);
     bool dropBufferWhileFlushing(bool audio, const sp<AMessage> &msg);
diff --git a/media/libmediaplayerservice/nuplayer/StreamingSource.cpp b/media/libmediaplayerservice/nuplayer/StreamingSource.cpp
index a741987..7319e4c 100644
--- a/media/libmediaplayerservice/nuplayer/StreamingSource.cpp
+++ b/media/libmediaplayerservice/nuplayer/StreamingSource.cpp
@@ -52,7 +52,7 @@
         return false;
     }
 
-    for (int32_t i = 0; i < 10; ++i) {
+    for (int32_t i = 0; i < 50; ++i) {
         char buffer[188];
         sp<AMessage> extra;
         ssize_t n = mStreamListener->read(buffer, sizeof(buffer), &extra);
diff --git a/media/libstagefright/ACodec.cpp b/media/libstagefright/ACodec.cpp
index 2ba2273..a2d9e59 100644
--- a/media/libstagefright/ACodec.cpp
+++ b/media/libstagefright/ACodec.cpp
@@ -1377,8 +1377,13 @@
                     memcpy(info->mData->data(), buffer->data(), buffer->size());
                 }
 
-                LOGV("[%s] calling emptyBuffer %p",
-                     mCodec->mComponentName.c_str(), bufferID);
+                if (flags & OMX_BUFFERFLAG_CODECCONFIG) {
+                    LOGV("[%s] calling emptyBuffer %p w/ codec specific data",
+                         mCodec->mComponentName.c_str(), bufferID);
+                } else {
+                    LOGV("[%s] calling emptyBuffer %p w/ time %lld us",
+                         mCodec->mComponentName.c_str(), bufferID, timeUs);
+                }
 
                 CHECK_EQ(mCodec->mOMX->emptyBuffer(
                             mCodec->mNode,
@@ -1396,7 +1401,7 @@
                 LOGV("[%s] Signalling EOS on the input port",
                      mCodec->mComponentName.c_str());
 
-                LOGV("[%s] calling emptyBuffer %p",
+                LOGV("[%s] calling emptyBuffer %p signalling EOS",
                      mCodec->mComponentName.c_str(), bufferID);
 
                 CHECK_EQ(mCodec->mOMX->emptyBuffer(
@@ -1457,8 +1462,8 @@
         int64_t timeUs,
         void *platformPrivate,
         void *dataPtr) {
-    LOGV("[%s] onOMXFillBufferDone %p",
-         mCodec->mComponentName.c_str(), bufferID);
+    LOGV("[%s] onOMXFillBufferDone %p time %lld us",
+         mCodec->mComponentName.c_str(), bufferID, timeUs);
 
     ssize_t index;
     BufferInfo *info =
@@ -1686,7 +1691,11 @@
             ++matchIndex) {
         componentName = matchingCodecs.itemAt(matchIndex).string();
 
+        pid_t tid = androidGetTid();
+        int prevPriority = androidGetThreadPriority(tid);
+        androidSetThreadPriority(tid, ANDROID_PRIORITY_FOREGROUND);
         status_t err = omx->allocateNode(componentName.c_str(), observer, &node);
+        androidSetThreadPriority(tid, prevPriority);
 
         if (err == OK) {
             break;
diff --git a/media/libstagefright/SampleTable.cpp b/media/libstagefright/SampleTable.cpp
index 2b9d99b..ebad321 100644
--- a/media/libstagefright/SampleTable.cpp
+++ b/media/libstagefright/SampleTable.cpp
@@ -23,8 +23,8 @@
 
 #include <arpa/inet.h>
 
+#include <media/stagefright/foundation/ADebug.h>
 #include <media/stagefright/DataSource.h>
-#include <media/stagefright/MediaDebug.h>
 #include <media/stagefright/Utils.h>
 
 namespace android {
@@ -40,6 +40,71 @@
 
 ////////////////////////////////////////////////////////////////////////////////
 
+struct SampleTable::CompositionDeltaLookup {
+    CompositionDeltaLookup();
+
+    void setEntries(
+            const uint32_t *deltaEntries, size_t numDeltaEntries);
+
+    uint32_t getCompositionTimeOffset(uint32_t sampleIndex);
+
+private:
+    Mutex mLock;
+
+    const uint32_t *mDeltaEntries;
+    size_t mNumDeltaEntries;
+
+    size_t mCurrentDeltaEntry;
+    size_t mCurrentEntrySampleIndex;
+
+    DISALLOW_EVIL_CONSTRUCTORS(CompositionDeltaLookup);
+};
+
+SampleTable::CompositionDeltaLookup::CompositionDeltaLookup()
+    : mDeltaEntries(NULL),
+      mNumDeltaEntries(0),
+      mCurrentDeltaEntry(0),
+      mCurrentEntrySampleIndex(0) {
+}
+
+void SampleTable::CompositionDeltaLookup::setEntries(
+        const uint32_t *deltaEntries, size_t numDeltaEntries) {
+    Mutex::Autolock autolock(mLock);
+
+    mDeltaEntries = deltaEntries;
+    mNumDeltaEntries = numDeltaEntries;
+    mCurrentDeltaEntry = 0;
+    mCurrentEntrySampleIndex = 0;
+}
+
+uint32_t SampleTable::CompositionDeltaLookup::getCompositionTimeOffset(
+        uint32_t sampleIndex) {
+    Mutex::Autolock autolock(mLock);
+
+    if (mDeltaEntries == NULL) {
+        return 0;
+    }
+
+    if (sampleIndex < mCurrentEntrySampleIndex) {
+        mCurrentDeltaEntry = 0;
+        mCurrentEntrySampleIndex = 0;
+    }
+
+    while (mCurrentDeltaEntry < mNumDeltaEntries) {
+        uint32_t sampleCount = mDeltaEntries[2 * mCurrentDeltaEntry];
+        if (sampleIndex < mCurrentEntrySampleIndex + sampleCount) {
+            return mDeltaEntries[2 * mCurrentDeltaEntry + 1];
+        }
+
+        mCurrentEntrySampleIndex += sampleCount;
+        ++mCurrentDeltaEntry;
+    }
+
+    return 0;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+
 SampleTable::SampleTable(const sp<DataSource> &source)
     : mDataSource(source),
       mChunkOffsetOffset(-1),
@@ -56,6 +121,7 @@
       mSampleTimeEntries(NULL),
       mCompositionTimeDeltaEntries(NULL),
       mNumCompositionTimeDeltaEntries(0),
+      mCompositionDeltaLookup(new CompositionDeltaLookup),
       mSyncSampleOffset(-1),
       mNumSyncSamples(0),
       mSyncSamples(NULL),
@@ -71,6 +137,9 @@
     delete[] mSyncSamples;
     mSyncSamples = NULL;
 
+    delete mCompositionDeltaLookup;
+    mCompositionDeltaLookup = NULL;
+
     delete[] mCompositionTimeDeltaEntries;
     mCompositionTimeDeltaEntries = NULL;
 
@@ -318,6 +387,9 @@
         mCompositionTimeDeltaEntries[i] = ntohl(mCompositionTimeDeltaEntries[i]);
     }
 
+    mCompositionDeltaLookup->setEntries(
+            mCompositionTimeDeltaEntries, mNumCompositionTimeDeltaEntries);
+
     return OK;
 }
 
@@ -430,8 +502,12 @@
 
                 mSampleTimeEntries[sampleIndex].mSampleIndex = sampleIndex;
 
+                uint32_t compTimeDelta =
+                    mCompositionDeltaLookup->getCompositionTimeOffset(
+                            sampleIndex);
+
                 mSampleTimeEntries[sampleIndex].mCompositionTime =
-                    sampleTime + getCompositionTimeOffset(sampleIndex);
+                    sampleTime + compTimeDelta;
             }
 
             ++sampleIndex;
@@ -739,25 +815,8 @@
     return OK;
 }
 
-uint32_t SampleTable::getCompositionTimeOffset(uint32_t sampleIndex) const {
-    if (mCompositionTimeDeltaEntries == NULL) {
-        return 0;
-    }
-
-    uint32_t curSample = 0;
-    for (size_t i = 0; i < mNumCompositionTimeDeltaEntries; ++i) {
-        uint32_t sampleCount = mCompositionTimeDeltaEntries[2 * i];
-
-        if (sampleIndex < curSample + sampleCount) {
-            uint32_t sampleDelta = mCompositionTimeDeltaEntries[2 * i + 1];
-
-            return sampleDelta;
-        }
-
-        curSample += sampleCount;
-    }
-
-    return 0;
+uint32_t SampleTable::getCompositionTimeOffset(uint32_t sampleIndex) {
+    return mCompositionDeltaLookup->getCompositionTimeOffset(sampleIndex);
 }
 
 }  // namespace android
diff --git a/media/libstagefright/avc_utils.cpp b/media/libstagefright/avc_utils.cpp
index 8a42e8b..07aa140 100644
--- a/media/libstagefright/avc_utils.cpp
+++ b/media/libstagefright/avc_utils.cpp
@@ -329,6 +329,28 @@
     return foundIDR;
 }
 
+bool IsAVCReferenceFrame(const sp<ABuffer> &accessUnit) {
+    const uint8_t *data = accessUnit->data();
+    size_t size = accessUnit->size();
+
+    const uint8_t *nalStart;
+    size_t nalSize;
+    while (getNextNALUnit(&data, &size, &nalStart, &nalSize, true) == OK) {
+        CHECK_GT(nalSize, 0u);
+
+        unsigned nalType = nalStart[0] & 0x1f;
+
+        if (nalType == 5) {
+            return true;
+        } else if (nalType == 1) {
+            unsigned nal_ref_idc = (nalStart[0] >> 5) & 3;
+            return nal_ref_idc != 0;
+        }
+    }
+
+    return true;
+}
+
 sp<MetaData> MakeAACCodecSpecificData(
         unsigned profile, unsigned sampling_freq_index,
         unsigned channel_configuration) {
diff --git a/media/libstagefright/chromium_http/support.cpp b/media/libstagefright/chromium_http/support.cpp
index de936c4..f15014e 100644
--- a/media/libstagefright/chromium_http/support.cpp
+++ b/media/libstagefright/chromium_http/support.cpp
@@ -74,10 +74,32 @@
     return false;
 }
 
+struct AutoPrioritySaver {
+    AutoPrioritySaver()
+        : mTID(androidGetTid()),
+          mPrevPriority(androidGetThreadPriority(mTID)) {
+        androidSetThreadPriority(mTID, ANDROID_PRIORITY_NORMAL);
+    }
+
+    ~AutoPrioritySaver() {
+        androidSetThreadPriority(mTID, mPrevPriority);
+    }
+
+private:
+    pid_t mTID;
+    int mPrevPriority;
+
+    DISALLOW_EVIL_CONSTRUCTORS(AutoPrioritySaver);
+};
 
 static void InitializeNetworkThreadIfNecessary() {
     Mutex::Autolock autoLock(gNetworkThreadLock);
+
     if (gNetworkThread == NULL) {
+        // Make sure any threads spawned by the chromium framework are
+        // running at normal priority instead of inheriting this thread's.
+        AutoPrioritySaver saver;
+
         gNetworkThread = new base::Thread("network");
         base::Thread::Options options;
         options.message_loop_type = MessageLoop::TYPE_IO;
diff --git a/media/libstagefright/foundation/AMessage.cpp b/media/libstagefright/foundation/AMessage.cpp
index 582bdba..f039bc1 100644
--- a/media/libstagefright/foundation/AMessage.cpp
+++ b/media/libstagefright/foundation/AMessage.cpp
@@ -385,6 +385,15 @@
                             item.u.refValue)->debugString(
                                 indent + strlen(item.mName) + 14).c_str());
                 break;
+            case kTypeRect:
+                tmp = StringPrintf(
+                        "Rect %s(%d, %d, %d, %d)",
+                        item.mName,
+                        item.u.rectValue.mLeft,
+                        item.u.rectValue.mTop,
+                        item.u.rectValue.mRight,
+                        item.u.rectValue.mBottom);
+                break;
             default:
                 TRESPASS();
         }
diff --git a/media/libstagefright/include/SampleTable.h b/media/libstagefright/include/SampleTable.h
index a6a6524..847dff7 100644
--- a/media/libstagefright/include/SampleTable.h
+++ b/media/libstagefright/include/SampleTable.h
@@ -86,6 +86,8 @@
     ~SampleTable();
 
 private:
+    struct CompositionDeltaLookup;
+
     static const uint32_t kChunkOffsetType32;
     static const uint32_t kChunkOffsetType64;
     static const uint32_t kSampleSizeType32;
@@ -117,6 +119,7 @@
 
     uint32_t *mCompositionTimeDeltaEntries;
     size_t mNumCompositionTimeDeltaEntries;
+    CompositionDeltaLookup *mCompositionDeltaLookup;
 
     off64_t mSyncSampleOffset;
     uint32_t mNumSyncSamples;
@@ -135,8 +138,7 @@
     friend struct SampleIterator;
 
     status_t getSampleSize_l(uint32_t sample_index, size_t *sample_size);
-
-    uint32_t getCompositionTimeOffset(uint32_t sampleIndex) const;
+    uint32_t getCompositionTimeOffset(uint32_t sampleIndex);
 
     static int CompareIncreasingTime(const void *, const void *);
 
diff --git a/media/libstagefright/include/avc_utils.h b/media/libstagefright/include/avc_utils.h
index 15cd4d4..e418822 100644
--- a/media/libstagefright/include/avc_utils.h
+++ b/media/libstagefright/include/avc_utils.h
@@ -50,6 +50,7 @@
 sp<MetaData> MakeAVCCodecSpecificData(const sp<ABuffer> &accessUnit);
 
 bool IsIDR(const sp<ABuffer> &accessUnit);
+bool IsAVCReferenceFrame(const sp<ABuffer> &accessUnit);
 
 const char *AVCProfileToString(uint8_t profile);
 
diff --git a/media/libstagefright/omx/OMX.cpp b/media/libstagefright/omx/OMX.cpp
index bc24dbb..33d3f30 100644
--- a/media/libstagefright/omx/OMX.cpp
+++ b/media/libstagefright/omx/OMX.cpp
@@ -85,7 +85,7 @@
     : mOwner(owner),
       mDone(false) {
     mThread = new CallbackDispatcherThread(this);
-    mThread->run("OMXCallbackDisp", ANDROID_PRIORITY_AUDIO);
+    mThread->run("OMXCallbackDisp", ANDROID_PRIORITY_FOREGROUND);
 }
 
 OMX::CallbackDispatcher::~CallbackDispatcher() {
diff --git a/media/libstagefright/omx/SimpleSoftOMXComponent.cpp b/media/libstagefright/omx/SimpleSoftOMXComponent.cpp
index f7330f3..b705d00 100644
--- a/media/libstagefright/omx/SimpleSoftOMXComponent.cpp
+++ b/media/libstagefright/omx/SimpleSoftOMXComponent.cpp
@@ -42,7 +42,7 @@
     mLooper->start(
             false, // runOnCallingThread
             false, // canCallJava
-            PRIORITY_AUDIO);
+            ANDROID_PRIORITY_FOREGROUND);
 }
 
 void SimpleSoftOMXComponent::prepareForDestruction() {
diff --git a/native/include/android/rect.h b/native/include/android/rect.h
index 3e81f53..64d487d 100644
--- a/native/include/android/rect.h
+++ b/native/include/android/rect.h
@@ -23,6 +23,9 @@
 #endif
 
 typedef struct ARect {
+#ifdef __cplusplus
+    typedef int32_t value_type;
+#endif
     int32_t left;
     int32_t top;
     int32_t right;
diff --git a/opengl/libs/EGL/egl_object.h b/opengl/libs/EGL/egl_object.h
index d2b7378..46f7139 100644
--- a/opengl/libs/EGL/egl_object.h
+++ b/opengl/libs/EGL/egl_object.h
@@ -130,7 +130,7 @@
         if (window != NULL) {
             native_window_set_buffers_format(window, 0);
             if (native_window_api_disconnect(window, NATIVE_WINDOW_API_EGL)) {
-                LOGE("EGLNativeWindowType %p disconnected failed", window);
+                LOGW("EGLNativeWindowType %p disconnect failed", window);
             }
         }
     }
diff --git a/opengl/libs/GLES2_dbg/Android.mk b/opengl/libs/GLES2_dbg/Android.mk
index c2b1142..70853d8 100644
--- a/opengl/libs/GLES2_dbg/Android.mk
+++ b/opengl/libs/GLES2_dbg/Android.mk
@@ -31,6 +31,9 @@
     LOCAL_CFLAGS += -DHAVE_ARM_TLS_REGISTER
 endif
 
+LOCAL_CFLAGS += -DLOG_TAG=\"libGLES2_dbg\"
+
+
 # we need to access the private Bionic header <bionic_tls.h>
 # on ARM platforms, we need to mirror the ARCH_ARM_HAVE_TLS_REGISTER
 # behavior from the bionic Android.mk file
diff --git a/opengl/libs/GLES2_dbg/src/dbgcontext.cpp b/opengl/libs/GLES2_dbg/src/dbgcontext.cpp
index 9e77665..41061e1 100644
--- a/opengl/libs/GLES2_dbg/src/dbgcontext.cpp
+++ b/opengl/libs/GLES2_dbg/src/dbgcontext.cpp
@@ -30,13 +30,11 @@
 }
 
 DbgContext::DbgContext(const unsigned version, const gl_hooks_t * const hooks,
-                       const unsigned MAX_VERTEX_ATTRIBS, const GLenum readFormat,
-                       const GLenum readType)
+                       const unsigned MAX_VERTEX_ATTRIBS)
         : lzf_buf(NULL), lzf_readIndex(0), lzf_refSize(0), lzf_refBufSize(0)
         , version(version), hooks(hooks)
         , MAX_VERTEX_ATTRIBS(MAX_VERTEX_ATTRIBS)
-        , readFormat(readFormat), readType(readType)
-        , readBytesPerPixel(GetBytesPerPixel(readFormat, readType))
+        , readBytesPerPixel(4)
         , captureSwap(0), captureDraw(0)
         , vertexAttribs(new VertexAttrib[MAX_VERTEX_ATTRIBS])
         , hasNonVBOAttribs(false), indexBuffers(NULL), indexBuffer(NULL)
@@ -67,11 +65,7 @@
     assert(GL_NO_ERROR == hooks->gl.glGetError());
     GLint MAX_VERTEX_ATTRIBS = 0;
     hooks->gl.glGetIntegerv(GL_MAX_VERTEX_ATTRIBS, &MAX_VERTEX_ATTRIBS);
-    GLint readFormat, readType;
-    hooks->gl.glGetIntegerv(GL_IMPLEMENTATION_COLOR_READ_FORMAT, &readFormat);
-    hooks->gl.glGetIntegerv(GL_IMPLEMENTATION_COLOR_READ_TYPE, &readType);
-    DbgContext* dbg = new DbgContext(version, hooks, MAX_VERTEX_ATTRIBS, readFormat, readType);
-
+    DbgContext* dbg = new DbgContext(version, hooks, MAX_VERTEX_ATTRIBS);
     glesv2debugger::Message msg, cmd;
     msg.set_context_id(reinterpret_cast<int>(dbg));
     msg.set_expect_response(false);
@@ -100,33 +94,31 @@
 {
     switch (type) {
     case GL_UNSIGNED_SHORT_5_6_5:
-        return 2;
     case GL_UNSIGNED_SHORT_4_4_4_4:
-        return 2;
     case GL_UNSIGNED_SHORT_5_5_5_1:
         return 2;
     case GL_UNSIGNED_BYTE:
         break;
     default:
-        assert(0);
+        LOGE("GetBytesPerPixel: unknown type %x", type);
     }
 
     switch (format) {
     case GL_ALPHA:
-        return 1;
     case GL_LUMINANCE:
         return 1;
-        break;
     case GL_LUMINANCE_ALPHA:
         return 2;
     case GL_RGB:
         return 3;
     case GL_RGBA:
+    case 0x80E1:   // GL_BGRA_EXT
         return 4;
     default:
-        assert(0);
-        return 0;
+        LOGE("GetBytesPerPixel: unknown format %x", format);
     }
+
+    return 1; // in doubt...
 }
 
 void DbgContext::Fetch(const unsigned index, std::string * const data) const
diff --git a/opengl/libs/GLES2_dbg/src/egl.cpp b/opengl/libs/GLES2_dbg/src/egl.cpp
index eb28d06..bbea3bd 100644
--- a/opengl/libs/GLES2_dbg/src/egl.cpp
+++ b/opengl/libs/GLES2_dbg/src/egl.cpp
@@ -41,11 +41,11 @@
         void * pixels = dbg->GetReadPixelsBuffer(viewport[2] * viewport[3] *
                         dbg->readBytesPerPixel);
         dbg->hooks->gl.glReadPixels(viewport[0], viewport[1], viewport[2],
-                                    viewport[3], dbg->readFormat, dbg->readType, pixels);
+                                    viewport[3], GL_RGBA, GL_UNSIGNED_BYTE, pixels);
         dbg->CompressReadPixelBuffer(msg.mutable_data());
         msg.set_data_type(msg.ReferencedImage);
-        msg.set_pixel_format(dbg->readFormat);
-        msg.set_pixel_type(dbg->readType);
+        msg.set_pixel_format(GL_RGBA);
+        msg.set_pixel_type(GL_UNSIGNED_BYTE);
         msg.set_image_width(viewport[2]);
         msg.set_image_height(viewport[3]);
     }
diff --git a/opengl/libs/GLES2_dbg/src/header.h b/opengl/libs/GLES2_dbg/src/header.h
index f2b1fa6..49f3847 100644
--- a/opengl/libs/GLES2_dbg/src/header.h
+++ b/opengl/libs/GLES2_dbg/src/header.h
@@ -87,7 +87,6 @@
     const unsigned int version; // 0 is GLES1, 1 is GLES2
     const gl_hooks_t * const hooks;
     const unsigned int MAX_VERTEX_ATTRIBS;
-    const GLenum readFormat, readType; // implementation supported glReadPixels
     const unsigned int readBytesPerPixel;
 
     unsigned int captureSwap; // number of eglSwapBuffers to glReadPixels
@@ -124,8 +123,7 @@
     unsigned maxAttrib; // number of slots used by program
 
     DbgContext(const unsigned version, const gl_hooks_t * const hooks,
-               const unsigned MAX_VERTEX_ATTRIBS, const GLenum readFormat,
-               const GLenum readType);
+               const unsigned MAX_VERTEX_ATTRIBS);
     ~DbgContext();
 
     void Fetch(const unsigned index, std::string * const data) const;
diff --git a/opengl/libs/GLES2_dbg/src/vertex.cpp b/opengl/libs/GLES2_dbg/src/vertex.cpp
index 029ee3b..28a24206 100644
--- a/opengl/libs/GLES2_dbg/src/vertex.cpp
+++ b/opengl/libs/GLES2_dbg/src/vertex.cpp
@@ -77,7 +77,7 @@
                 pixels = dbg->GetReadPixelsBuffer(viewport[2] * viewport[3] *
                                                   dbg->readBytesPerPixel);
                 Debug_glReadPixels(viewport[0], viewport[1], viewport[2], viewport[3],
-                                   dbg->readFormat, dbg->readType, pixels);
+                        GL_RGBA, GL_UNSIGNED_BYTE, pixels);
             }
             break;
         case glesv2debugger::Message_Function_SKIP:
@@ -134,19 +134,22 @@
     msg.set_arg7(dbg->maxAttrib); // indicate capturing vertex data
     std::string * const data = msg.mutable_data();
     if (GL_UNSIGNED_BYTE == type) {
-        if (dbg->indexBuffer)
+        if (dbg->indexBuffer) {
             FetchIndexed(count, (unsigned char *)dbg->indexBuffer->data +
                          (unsigned long)indices, data, dbg);
-        else
+        } else {
             FetchIndexed(count, (unsigned char *)indices, data, dbg);
+        }
     } else if (GL_UNSIGNED_SHORT == type) {
-        if (dbg->indexBuffer)
+        if (dbg->indexBuffer) {
             FetchIndexed(count, (unsigned short *)((char *)dbg->indexBuffer->data +
                                                    (unsigned long)indices), data, dbg);
-        else
+        } else {
             FetchIndexed(count, (unsigned short *)indices, data, dbg);
-    } else
+        }
+    } else {
         assert(0);
+    }
 
     void * pixels = NULL;
     int viewport[4] = {};
@@ -174,7 +177,7 @@
             Send(msg, cmd);
             expectResponse = cmd.expect_response();
             // TODO: pack glReadPixels data with vertex data instead of
-            //  relying on sperate call for transport, this would allow
+            //  relying on separate call for transport, this would allow
             //  auto generated message loop using EXTEND_Debug macro
             if (dbg->captureDraw > 0) {
                 dbg->captureDraw--;
@@ -182,7 +185,7 @@
                 pixels = dbg->GetReadPixelsBuffer(viewport[2] * viewport[3] *
                                                   dbg->readBytesPerPixel);
                 Debug_glReadPixels(viewport[0], viewport[1], viewport[2], viewport[3],
-                                   dbg->readFormat, dbg->readType, pixels);
+                        GL_RGBA, GL_UNSIGNED_BYTE, pixels);
             }
             break;
         case glesv2debugger::Message_Function_SKIP:
diff --git a/opengl/libs/GLES2_dbg/test/test_main.cpp b/opengl/libs/GLES2_dbg/test/test_main.cpp
index 058bea4..183bf8e 100644
--- a/opengl/libs/GLES2_dbg/test/test_main.cpp
+++ b/opengl/libs/GLES2_dbg/test/test_main.cpp
@@ -29,7 +29,7 @@
     gl_hooks_t hooks;
 
     DbgContextTest()
-            : dbg(1, &hooks, 32, GL_RGBA, GL_UNSIGNED_BYTE) {
+            : dbg(1, &hooks, 32) {
         // You can do set-up work for each test here.
         hooks.gl.glGetError = GetError;
     }
diff --git a/opengl/libs/GLES2_dbg/test/test_server.cpp b/opengl/libs/GLES2_dbg/test/test_server.cpp
index bbbe913..0ab87b0 100644
--- a/opengl/libs/GLES2_dbg/test/test_server.cpp
+++ b/opengl/libs/GLES2_dbg/test/test_server.cpp
@@ -151,7 +151,7 @@
     virtual void SetUp() {
         ServerFileTest::SetUp();
 
-        dbg = new DbgContext(1, &hooks, 32, GL_RGBA, GL_UNSIGNED_BYTE);
+        dbg = new DbgContext(1, &hooks, 32);
         ASSERT_NE((void *)NULL, dbg);
         for (unsigned int i = 0; i < sizeof(hooks) / sizeof(void *); i++)
             ((void **)&hooks)[i] = reinterpret_cast<void *>(glNoop);
diff --git a/opengl/libs/GLES2_dbg/test/test_socket.cpp b/opengl/libs/GLES2_dbg/test/test_socket.cpp
index b2148ac..9f815e2 100644
--- a/opengl/libs/GLES2_dbg/test/test_socket.cpp
+++ b/opengl/libs/GLES2_dbg/test/test_socket.cpp
@@ -44,7 +44,7 @@
     }
 
     virtual void SetUp() {
-        dbg = new DbgContext(1, &hooks, 32, GL_RGBA, GL_UNSIGNED_BYTE);
+        dbg = new DbgContext(1, &hooks, 32);
         ASSERT_TRUE(dbg != NULL);
         for (unsigned int i = 0; i < sizeof(hooks) / sizeof(void *); i++)
             ((void **)&hooks)[i] = (void *)glNoop;
diff --git a/packages/SystemUI/res/layout-land/status_bar_recent_item.xml b/packages/SystemUI/res/layout-land/status_bar_recent_item.xml
index 167d362..c6966f9 100644
--- a/packages/SystemUI/res/layout-land/status_bar_recent_item.xml
+++ b/packages/SystemUI/res/layout-land/status_bar_recent_item.xml
@@ -40,8 +40,8 @@
             android:background="@drawable/recents_thumbnail_bg"
             android:foreground="@drawable/recents_thumbnail_fg">
             <ImageView android:id="@+id/app_thumbnail_image"
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
+                android:layout_width="@dimen/status_bar_recents_thumbnail_width"
+                android:layout_height="@dimen/status_bar_recents_thumbnail_height"
                 android:visibility="invisible"
             />
         </FrameLayout>
diff --git a/packages/SystemUI/res/layout-port/status_bar_recent_item.xml b/packages/SystemUI/res/layout-port/status_bar_recent_item.xml
index de80a51..586712f 100644
--- a/packages/SystemUI/res/layout-port/status_bar_recent_item.xml
+++ b/packages/SystemUI/res/layout-port/status_bar_recent_item.xml
@@ -38,8 +38,8 @@
             android:background="@drawable/recents_thumbnail_bg"
             android:foreground="@drawable/recents_thumbnail_fg">
             <ImageView android:id="@+id/app_thumbnail_image"
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
+                android:layout_width="@dimen/status_bar_recents_thumbnail_width"
+                android:layout_height="@dimen/status_bar_recents_thumbnail_height"
                 android:visibility="invisible"
             />
         </FrameLayout>
diff --git a/packages/SystemUI/res/layout-sw600dp/status_bar_recent_item.xml b/packages/SystemUI/res/layout-sw600dp/status_bar_recent_item.xml
index 07088d5..cd8ccd5 100644
--- a/packages/SystemUI/res/layout-sw600dp/status_bar_recent_item.xml
+++ b/packages/SystemUI/res/layout-sw600dp/status_bar_recent_item.xml
@@ -33,8 +33,8 @@
         android:background="@drawable/recents_thumbnail_bg"
         android:foreground="@drawable/recents_thumbnail_fg">
         <ImageView android:id="@+id/app_thumbnail_image"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
+            android:layout_width="@dimen/status_bar_recents_thumbnail_width"
+            android:layout_height="@dimen/status_bar_recents_thumbnail_height"
             android:visibility="invisible"
         />
     </FrameLayout>
diff --git a/packages/SystemUI/res/layout/signal_cluster_view.xml b/packages/SystemUI/res/layout/signal_cluster_view.xml
index 41a30c7..eb644b3 100644
--- a/packages/SystemUI/res/layout/signal_cluster_view.xml
+++ b/packages/SystemUI/res/layout/signal_cluster_view.xml
@@ -45,6 +45,12 @@
             android:layout_gravity="center|bottom"
             />
     </FrameLayout>
+    <View
+        android:layout_height="6dp"
+        android:layout_width="6dp"
+        android:visibility="gone"
+        android:id="@+id/spacer"
+        />
     <FrameLayout
         android:layout_height="wrap_content"
         android:layout_width="wrap_content"
diff --git a/packages/SystemUI/res/values-af/strings.xml b/packages/SystemUI/res/values-af/strings.xml
index 29babc8..fb0c355 100644
--- a/packages/SystemUI/res/values-af/strings.xml
+++ b/packages/SystemUI/res/values-af/strings.xml
@@ -25,6 +25,8 @@
     <string name="status_bar_please_disturb_button" msgid="3345398298841572813">"Wys kennisgewings"</string>
     <string name="status_bar_recent_remove_item_title" msgid="6026395868129852968">"Verwyder uit lys"</string>
     <string name="status_bar_recent_inspect_item_title" msgid="7793624864528818569">"Program Info"</string>
+    <!-- no translation found for status_bar_no_recent_apps (6576392951053994640) -->
+    <skip />
     <string name="status_bar_no_notifications_title" msgid="4755261167193833213">"Geen kennisgewings"</string>
     <string name="status_bar_ongoing_events_title" msgid="1682504513316879202">"Voortdurend"</string>
     <string name="status_bar_latest_events_title" msgid="6594767438577593172">"Kennisgewings"</string>
diff --git a/packages/SystemUI/res/values-am/strings.xml b/packages/SystemUI/res/values-am/strings.xml
index 2b52891..ed4cb9c 100644
--- a/packages/SystemUI/res/values-am/strings.xml
+++ b/packages/SystemUI/res/values-am/strings.xml
@@ -25,6 +25,8 @@
     <string name="status_bar_please_disturb_button" msgid="3345398298841572813">"ማሳወቂያዎች አሳይ"</string>
     <string name="status_bar_recent_remove_item_title" msgid="6026395868129852968">"ከዝርዝር አስወግድ"</string>
     <string name="status_bar_recent_inspect_item_title" msgid="7793624864528818569">"የትግበራ መረጃ"</string>
+    <!-- no translation found for status_bar_no_recent_apps (6576392951053994640) -->
+    <skip />
     <string name="status_bar_no_notifications_title" msgid="4755261167193833213">"ምንም ማሳወቂያዎች የሉም"</string>
     <string name="status_bar_ongoing_events_title" msgid="1682504513316879202">"በመካሄድ ላይ ያለ"</string>
     <string name="status_bar_latest_events_title" msgid="6594767438577593172">"ማሳወቂያዎች"</string>
diff --git a/packages/SystemUI/res/values-ar/strings.xml b/packages/SystemUI/res/values-ar/strings.xml
index 9b80519..e0e4643 100644
--- a/packages/SystemUI/res/values-ar/strings.xml
+++ b/packages/SystemUI/res/values-ar/strings.xml
@@ -25,6 +25,8 @@
     <string name="status_bar_please_disturb_button" msgid="3345398298841572813">"إظهار التنبيهات"</string>
     <string name="status_bar_recent_remove_item_title" msgid="6026395868129852968">"إزالة من القائمة"</string>
     <string name="status_bar_recent_inspect_item_title" msgid="7793624864528818569">"معلومات التطبيق"</string>
+    <!-- no translation found for status_bar_no_recent_apps (6576392951053994640) -->
+    <skip />
     <string name="status_bar_no_notifications_title" msgid="4755261167193833213">"ليس هناك أي تنبيهات"</string>
     <string name="status_bar_ongoing_events_title" msgid="1682504513316879202">"مستمر"</string>
     <string name="status_bar_latest_events_title" msgid="6594767438577593172">"التنبيهات"</string>
diff --git a/packages/SystemUI/res/values-bg/strings.xml b/packages/SystemUI/res/values-bg/strings.xml
index f31f22c..b017205 100644
--- a/packages/SystemUI/res/values-bg/strings.xml
+++ b/packages/SystemUI/res/values-bg/strings.xml
@@ -25,6 +25,8 @@
     <string name="status_bar_please_disturb_button" msgid="3345398298841572813">"Показване на известията"</string>
     <string name="status_bar_recent_remove_item_title" msgid="6026395868129852968">"Премахване от списъка"</string>
     <string name="status_bar_recent_inspect_item_title" msgid="7793624864528818569">"Информация за приложението"</string>
+    <!-- no translation found for status_bar_no_recent_apps (6576392951053994640) -->
+    <skip />
     <string name="status_bar_no_notifications_title" msgid="4755261167193833213">"Няма известия"</string>
     <string name="status_bar_ongoing_events_title" msgid="1682504513316879202">"В момента"</string>
     <string name="status_bar_latest_events_title" msgid="6594767438577593172">"Известия"</string>
diff --git a/packages/SystemUI/res/values-ca/strings.xml b/packages/SystemUI/res/values-ca/strings.xml
index fe2e3e6..c0f9f17 100644
--- a/packages/SystemUI/res/values-ca/strings.xml
+++ b/packages/SystemUI/res/values-ca/strings.xml
@@ -25,6 +25,8 @@
     <string name="status_bar_please_disturb_button" msgid="3345398298841572813">"Mostra notificacions"</string>
     <string name="status_bar_recent_remove_item_title" msgid="6026395868129852968">"Elimina de la llista"</string>
     <string name="status_bar_recent_inspect_item_title" msgid="7793624864528818569">"Informació de l\'aplicació"</string>
+    <!-- no translation found for status_bar_no_recent_apps (6576392951053994640) -->
+    <skip />
     <string name="status_bar_no_notifications_title" msgid="4755261167193833213">"Cap notificació"</string>
     <string name="status_bar_ongoing_events_title" msgid="1682504513316879202">"Continu"</string>
     <string name="status_bar_latest_events_title" msgid="6594767438577593172">"Notificacions"</string>
diff --git a/packages/SystemUI/res/values-cs/strings.xml b/packages/SystemUI/res/values-cs/strings.xml
index a2902a5..9021409 100644
--- a/packages/SystemUI/res/values-cs/strings.xml
+++ b/packages/SystemUI/res/values-cs/strings.xml
@@ -25,6 +25,8 @@
     <string name="status_bar_please_disturb_button" msgid="3345398298841572813">"Zobrazit upozornění"</string>
     <string name="status_bar_recent_remove_item_title" msgid="6026395868129852968">"Odebrat ze seznamu"</string>
     <string name="status_bar_recent_inspect_item_title" msgid="7793624864528818569">"Informace o aplikaci"</string>
+    <!-- no translation found for status_bar_no_recent_apps (6576392951053994640) -->
+    <skip />
     <string name="status_bar_no_notifications_title" msgid="4755261167193833213">"Žádná oznámení"</string>
     <string name="status_bar_ongoing_events_title" msgid="1682504513316879202">"Probíhající"</string>
     <string name="status_bar_latest_events_title" msgid="6594767438577593172">"Oznámení"</string>
diff --git a/packages/SystemUI/res/values-da/strings.xml b/packages/SystemUI/res/values-da/strings.xml
index 3cb0471..ea434e1 100644
--- a/packages/SystemUI/res/values-da/strings.xml
+++ b/packages/SystemUI/res/values-da/strings.xml
@@ -25,6 +25,8 @@
     <string name="status_bar_please_disturb_button" msgid="3345398298841572813">"Vis meddelelser"</string>
     <string name="status_bar_recent_remove_item_title" msgid="6026395868129852968">"Fjern fra listen"</string>
     <string name="status_bar_recent_inspect_item_title" msgid="7793624864528818569">"Oplysninger om appen"</string>
+    <!-- no translation found for status_bar_no_recent_apps (6576392951053994640) -->
+    <skip />
     <string name="status_bar_no_notifications_title" msgid="4755261167193833213">"Ingen meddelelser"</string>
     <string name="status_bar_ongoing_events_title" msgid="1682504513316879202">"I gang"</string>
     <string name="status_bar_latest_events_title" msgid="6594767438577593172">"Meddelelser"</string>
diff --git a/packages/SystemUI/res/values-de/strings.xml b/packages/SystemUI/res/values-de/strings.xml
index 66535f7..372b903 100644
--- a/packages/SystemUI/res/values-de/strings.xml
+++ b/packages/SystemUI/res/values-de/strings.xml
@@ -25,6 +25,8 @@
     <string name="status_bar_please_disturb_button" msgid="3345398298841572813">"Benachrichtigungen zeigen"</string>
     <string name="status_bar_recent_remove_item_title" msgid="6026395868129852968">"Aus Liste entfernen"</string>
     <string name="status_bar_recent_inspect_item_title" msgid="7793624864528818569">"App-Info"</string>
+    <!-- no translation found for status_bar_no_recent_apps (6576392951053994640) -->
+    <skip />
     <string name="status_bar_no_notifications_title" msgid="4755261167193833213">"Keine Benachrichtigungen"</string>
     <string name="status_bar_ongoing_events_title" msgid="1682504513316879202">"Aktuell"</string>
     <string name="status_bar_latest_events_title" msgid="6594767438577593172">"Benachrichtigungen"</string>
diff --git a/packages/SystemUI/res/values-el/strings.xml b/packages/SystemUI/res/values-el/strings.xml
index b01866b..803f7d9 100644
--- a/packages/SystemUI/res/values-el/strings.xml
+++ b/packages/SystemUI/res/values-el/strings.xml
@@ -25,6 +25,8 @@
     <string name="status_bar_please_disturb_button" msgid="3345398298841572813">"Εμφάνιση ειδοποιήσεων"</string>
     <string name="status_bar_recent_remove_item_title" msgid="6026395868129852968">"Κατάργηση από τη λίστα"</string>
     <string name="status_bar_recent_inspect_item_title" msgid="7793624864528818569">"Πληροφορίες εφαρμογής"</string>
+    <!-- no translation found for status_bar_no_recent_apps (6576392951053994640) -->
+    <skip />
     <string name="status_bar_no_notifications_title" msgid="4755261167193833213">"Δεν υπάρχουν ειδοποιήσεις"</string>
     <string name="status_bar_ongoing_events_title" msgid="1682504513316879202">"Εν εξελίξει"</string>
     <string name="status_bar_latest_events_title" msgid="6594767438577593172">"Ειδοποιήσεις"</string>
diff --git a/packages/SystemUI/res/values-en-rGB/strings.xml b/packages/SystemUI/res/values-en-rGB/strings.xml
index 86520a7..a66ed40 100644
--- a/packages/SystemUI/res/values-en-rGB/strings.xml
+++ b/packages/SystemUI/res/values-en-rGB/strings.xml
@@ -25,6 +25,8 @@
     <string name="status_bar_please_disturb_button" msgid="3345398298841572813">"Show notifications"</string>
     <string name="status_bar_recent_remove_item_title" msgid="6026395868129852968">"Remove from list"</string>
     <string name="status_bar_recent_inspect_item_title" msgid="7793624864528818569">"App info"</string>
+    <!-- no translation found for status_bar_no_recent_apps (6576392951053994640) -->
+    <skip />
     <string name="status_bar_no_notifications_title" msgid="4755261167193833213">"No notifications"</string>
     <string name="status_bar_ongoing_events_title" msgid="1682504513316879202">"Ongoing"</string>
     <string name="status_bar_latest_events_title" msgid="6594767438577593172">"Notifications"</string>
diff --git a/packages/SystemUI/res/values-es-rUS/strings.xml b/packages/SystemUI/res/values-es-rUS/strings.xml
index 70dab5d..bf0686d 100644
--- a/packages/SystemUI/res/values-es-rUS/strings.xml
+++ b/packages/SystemUI/res/values-es-rUS/strings.xml
@@ -25,6 +25,8 @@
     <string name="status_bar_please_disturb_button" msgid="3345398298841572813">"Mostrar notificaciones"</string>
     <string name="status_bar_recent_remove_item_title" msgid="6026395868129852968">"Eliminar de la lista"</string>
     <string name="status_bar_recent_inspect_item_title" msgid="7793624864528818569">"Información de la aplicación"</string>
+    <!-- no translation found for status_bar_no_recent_apps (6576392951053994640) -->
+    <skip />
     <string name="status_bar_no_notifications_title" msgid="4755261167193833213">"No hay notificaciones"</string>
     <string name="status_bar_ongoing_events_title" msgid="1682504513316879202">"Continuo"</string>
     <string name="status_bar_latest_events_title" msgid="6594767438577593172">"Notificaciones"</string>
diff --git a/packages/SystemUI/res/values-es/strings.xml b/packages/SystemUI/res/values-es/strings.xml
index 4d2b16b..870a166 100644
--- a/packages/SystemUI/res/values-es/strings.xml
+++ b/packages/SystemUI/res/values-es/strings.xml
@@ -25,6 +25,8 @@
     <string name="status_bar_please_disturb_button" msgid="3345398298841572813">"Mostrar notificaciones"</string>
     <string name="status_bar_recent_remove_item_title" msgid="6026395868129852968">"Eliminar de la lista"</string>
     <string name="status_bar_recent_inspect_item_title" msgid="7793624864528818569">"Información de la aplicación"</string>
+    <!-- no translation found for status_bar_no_recent_apps (6576392951053994640) -->
+    <skip />
     <string name="status_bar_no_notifications_title" msgid="4755261167193833213">"No tienes notificaciones"</string>
     <string name="status_bar_ongoing_events_title" msgid="1682504513316879202">"Entrante"</string>
     <string name="status_bar_latest_events_title" msgid="6594767438577593172">"Notificaciones"</string>
diff --git a/packages/SystemUI/res/values-fa/strings.xml b/packages/SystemUI/res/values-fa/strings.xml
index 00c2bf6..0224983 100644
--- a/packages/SystemUI/res/values-fa/strings.xml
+++ b/packages/SystemUI/res/values-fa/strings.xml
@@ -25,6 +25,8 @@
     <string name="status_bar_please_disturb_button" msgid="3345398298841572813">"نمایش اعلان ها"</string>
     <string name="status_bar_recent_remove_item_title" msgid="6026395868129852968">"حذف از لیست"</string>
     <string name="status_bar_recent_inspect_item_title" msgid="7793624864528818569">"اطلاعات برنامه"</string>
+    <!-- no translation found for status_bar_no_recent_apps (6576392951053994640) -->
+    <skip />
     <string name="status_bar_no_notifications_title" msgid="4755261167193833213">"اعلانی موجود نیست"</string>
     <string name="status_bar_ongoing_events_title" msgid="1682504513316879202">"در حال انجام"</string>
     <string name="status_bar_latest_events_title" msgid="6594767438577593172">"اعلان ها"</string>
diff --git a/packages/SystemUI/res/values-fi/strings.xml b/packages/SystemUI/res/values-fi/strings.xml
index d3684df..73c36ce 100644
--- a/packages/SystemUI/res/values-fi/strings.xml
+++ b/packages/SystemUI/res/values-fi/strings.xml
@@ -25,6 +25,8 @@
     <string name="status_bar_please_disturb_button" msgid="3345398298841572813">"Näytä ilmoitukset"</string>
     <string name="status_bar_recent_remove_item_title" msgid="6026395868129852968">"Poista luettelosta"</string>
     <string name="status_bar_recent_inspect_item_title" msgid="7793624864528818569">"Sovelluksen tiedot"</string>
+    <!-- no translation found for status_bar_no_recent_apps (6576392951053994640) -->
+    <skip />
     <string name="status_bar_no_notifications_title" msgid="4755261167193833213">"Ei ilmoituksia"</string>
     <string name="status_bar_ongoing_events_title" msgid="1682504513316879202">"Käynnissä olevat"</string>
     <string name="status_bar_latest_events_title" msgid="6594767438577593172">"Ilmoitukset"</string>
diff --git a/packages/SystemUI/res/values-fr/strings.xml b/packages/SystemUI/res/values-fr/strings.xml
index a27959f..b20c4be 100644
--- a/packages/SystemUI/res/values-fr/strings.xml
+++ b/packages/SystemUI/res/values-fr/strings.xml
@@ -25,6 +25,8 @@
     <string name="status_bar_please_disturb_button" msgid="3345398298841572813">"Afficher les notifications"</string>
     <string name="status_bar_recent_remove_item_title" msgid="6026395868129852968">"Supprimer de la liste"</string>
     <string name="status_bar_recent_inspect_item_title" msgid="7793624864528818569">"Informations sur l\'application"</string>
+    <!-- no translation found for status_bar_no_recent_apps (6576392951053994640) -->
+    <skip />
     <string name="status_bar_no_notifications_title" msgid="4755261167193833213">"Aucune notification"</string>
     <string name="status_bar_ongoing_events_title" msgid="1682504513316879202">"En cours"</string>
     <string name="status_bar_latest_events_title" msgid="6594767438577593172">"Notifications"</string>
diff --git a/packages/SystemUI/res/values-hr/strings.xml b/packages/SystemUI/res/values-hr/strings.xml
index e0ba8f2..9c99d28 100644
--- a/packages/SystemUI/res/values-hr/strings.xml
+++ b/packages/SystemUI/res/values-hr/strings.xml
@@ -25,6 +25,8 @@
     <string name="status_bar_please_disturb_button" msgid="3345398298841572813">"Prikaži obavijesti"</string>
     <string name="status_bar_recent_remove_item_title" msgid="6026395868129852968">"Ukloni s popisa"</string>
     <string name="status_bar_recent_inspect_item_title" msgid="7793624864528818569">"Informacije o aplikaciji"</string>
+    <!-- no translation found for status_bar_no_recent_apps (6576392951053994640) -->
+    <skip />
     <string name="status_bar_no_notifications_title" msgid="4755261167193833213">"Bez obavijesti"</string>
     <string name="status_bar_ongoing_events_title" msgid="1682504513316879202">"U tijeku"</string>
     <string name="status_bar_latest_events_title" msgid="6594767438577593172">"Obavijesti"</string>
diff --git a/packages/SystemUI/res/values-hu/strings.xml b/packages/SystemUI/res/values-hu/strings.xml
index 3ec833e..7bc1789 100644
--- a/packages/SystemUI/res/values-hu/strings.xml
+++ b/packages/SystemUI/res/values-hu/strings.xml
@@ -25,6 +25,8 @@
     <string name="status_bar_please_disturb_button" msgid="3345398298841572813">"Értesítések megjelenítése"</string>
     <string name="status_bar_recent_remove_item_title" msgid="6026395868129852968">"Eltávolítás a listából"</string>
     <string name="status_bar_recent_inspect_item_title" msgid="7793624864528818569">"Alkalmazásinformáció"</string>
+    <!-- no translation found for status_bar_no_recent_apps (6576392951053994640) -->
+    <skip />
     <string name="status_bar_no_notifications_title" msgid="4755261167193833213">"Nincs értesítés"</string>
     <string name="status_bar_ongoing_events_title" msgid="1682504513316879202">"Folyamatban van"</string>
     <string name="status_bar_latest_events_title" msgid="6594767438577593172">"Értesítések"</string>
diff --git a/packages/SystemUI/res/values-in/strings.xml b/packages/SystemUI/res/values-in/strings.xml
index 1f4094e..999ea1d 100644
--- a/packages/SystemUI/res/values-in/strings.xml
+++ b/packages/SystemUI/res/values-in/strings.xml
@@ -25,6 +25,8 @@
     <string name="status_bar_please_disturb_button" msgid="3345398298841572813">"Tampilkan pemberitahuan"</string>
     <string name="status_bar_recent_remove_item_title" msgid="6026395868129852968">"Hapus dari daftar"</string>
     <string name="status_bar_recent_inspect_item_title" msgid="7793624864528818569">"Info apl"</string>
+    <!-- no translation found for status_bar_no_recent_apps (6576392951053994640) -->
+    <skip />
     <string name="status_bar_no_notifications_title" msgid="4755261167193833213">"Tidak ada pemberitahuan"</string>
     <string name="status_bar_ongoing_events_title" msgid="1682504513316879202">"Berkelanjutan"</string>
     <string name="status_bar_latest_events_title" msgid="6594767438577593172">"Pemberitahuan"</string>
diff --git a/packages/SystemUI/res/values-it/strings.xml b/packages/SystemUI/res/values-it/strings.xml
index 5ad309f..becfe01 100644
--- a/packages/SystemUI/res/values-it/strings.xml
+++ b/packages/SystemUI/res/values-it/strings.xml
@@ -25,6 +25,8 @@
     <string name="status_bar_please_disturb_button" msgid="3345398298841572813">"Mostra notifiche"</string>
     <string name="status_bar_recent_remove_item_title" msgid="6026395868129852968">"Rimuovi dall\'elenco"</string>
     <string name="status_bar_recent_inspect_item_title" msgid="7793624864528818569">"Informazioni applicazione"</string>
+    <!-- no translation found for status_bar_no_recent_apps (6576392951053994640) -->
+    <skip />
     <string name="status_bar_no_notifications_title" msgid="4755261167193833213">"Nessuna notifica"</string>
     <string name="status_bar_ongoing_events_title" msgid="1682504513316879202">"In corso"</string>
     <string name="status_bar_latest_events_title" msgid="6594767438577593172">"Notifiche"</string>
diff --git a/packages/SystemUI/res/values-iw/strings.xml b/packages/SystemUI/res/values-iw/strings.xml
index f9d01a1..567f2b9 100644
--- a/packages/SystemUI/res/values-iw/strings.xml
+++ b/packages/SystemUI/res/values-iw/strings.xml
@@ -25,6 +25,8 @@
     <string name="status_bar_please_disturb_button" msgid="3345398298841572813">"הצג התראות"</string>
     <string name="status_bar_recent_remove_item_title" msgid="6026395868129852968">"הסר מהרשימה"</string>
     <string name="status_bar_recent_inspect_item_title" msgid="7793624864528818569">"פרטי יישום"</string>
+    <!-- no translation found for status_bar_no_recent_apps (6576392951053994640) -->
+    <skip />
     <string name="status_bar_no_notifications_title" msgid="4755261167193833213">"אין התראות"</string>
     <string name="status_bar_ongoing_events_title" msgid="1682504513316879202">"מתמשך"</string>
     <string name="status_bar_latest_events_title" msgid="6594767438577593172">"התראות"</string>
diff --git a/packages/SystemUI/res/values-ja/strings.xml b/packages/SystemUI/res/values-ja/strings.xml
index 128691a..ffb0227 100644
--- a/packages/SystemUI/res/values-ja/strings.xml
+++ b/packages/SystemUI/res/values-ja/strings.xml
@@ -25,6 +25,8 @@
     <string name="status_bar_please_disturb_button" msgid="3345398298841572813">"通知を表示"</string>
     <string name="status_bar_recent_remove_item_title" msgid="6026395868129852968">"リストから削除"</string>
     <string name="status_bar_recent_inspect_item_title" msgid="7793624864528818569">"アプリ情報"</string>
+    <!-- no translation found for status_bar_no_recent_apps (6576392951053994640) -->
+    <skip />
     <string name="status_bar_no_notifications_title" msgid="4755261167193833213">"通知なし"</string>
     <string name="status_bar_ongoing_events_title" msgid="1682504513316879202">"実行中"</string>
     <string name="status_bar_latest_events_title" msgid="6594767438577593172">"通知"</string>
diff --git a/packages/SystemUI/res/values-ko/strings.xml b/packages/SystemUI/res/values-ko/strings.xml
index 305b4b2..417664d 100644
--- a/packages/SystemUI/res/values-ko/strings.xml
+++ b/packages/SystemUI/res/values-ko/strings.xml
@@ -25,6 +25,8 @@
     <string name="status_bar_please_disturb_button" msgid="3345398298841572813">"알림 표시"</string>
     <string name="status_bar_recent_remove_item_title" msgid="6026395868129852968">"목록에서 삭제"</string>
     <string name="status_bar_recent_inspect_item_title" msgid="7793624864528818569">"앱 정보"</string>
+    <!-- no translation found for status_bar_no_recent_apps (6576392951053994640) -->
+    <skip />
     <string name="status_bar_no_notifications_title" msgid="4755261167193833213">"알림 없음"</string>
     <string name="status_bar_ongoing_events_title" msgid="1682504513316879202">"진행 중"</string>
     <string name="status_bar_latest_events_title" msgid="6594767438577593172">"알림"</string>
diff --git a/packages/SystemUI/res/values-lt/strings.xml b/packages/SystemUI/res/values-lt/strings.xml
index 1d60ada..aff4f08 100644
--- a/packages/SystemUI/res/values-lt/strings.xml
+++ b/packages/SystemUI/res/values-lt/strings.xml
@@ -25,6 +25,8 @@
     <string name="status_bar_please_disturb_button" msgid="3345398298841572813">"Rodyti pranešimus"</string>
     <string name="status_bar_recent_remove_item_title" msgid="6026395868129852968">"Pašalinti iš sąrašo"</string>
     <string name="status_bar_recent_inspect_item_title" msgid="7793624864528818569">"Programos informacija"</string>
+    <!-- no translation found for status_bar_no_recent_apps (6576392951053994640) -->
+    <skip />
     <string name="status_bar_no_notifications_title" msgid="4755261167193833213">"Nėra įspėjimų"</string>
     <string name="status_bar_ongoing_events_title" msgid="1682504513316879202">"Vykstantys"</string>
     <string name="status_bar_latest_events_title" msgid="6594767438577593172">"Įspėjimai"</string>
diff --git a/packages/SystemUI/res/values-lv/strings.xml b/packages/SystemUI/res/values-lv/strings.xml
index add82b1..822639c 100644
--- a/packages/SystemUI/res/values-lv/strings.xml
+++ b/packages/SystemUI/res/values-lv/strings.xml
@@ -25,6 +25,8 @@
     <string name="status_bar_please_disturb_button" msgid="3345398298841572813">"Rādīt paziņojumus"</string>
     <string name="status_bar_recent_remove_item_title" msgid="6026395868129852968">"Noņemšana no saraksta"</string>
     <string name="status_bar_recent_inspect_item_title" msgid="7793624864528818569">"Lietotnes informācija"</string>
+    <!-- no translation found for status_bar_no_recent_apps (6576392951053994640) -->
+    <skip />
     <string name="status_bar_no_notifications_title" msgid="4755261167193833213">"Nav paziņojumu"</string>
     <string name="status_bar_ongoing_events_title" msgid="1682504513316879202">"Notiekošs"</string>
     <string name="status_bar_latest_events_title" msgid="6594767438577593172">"Paziņojumi"</string>
diff --git a/packages/SystemUI/res/values-ms/strings.xml b/packages/SystemUI/res/values-ms/strings.xml
index c885881..4bbae01 100644
--- a/packages/SystemUI/res/values-ms/strings.xml
+++ b/packages/SystemUI/res/values-ms/strings.xml
@@ -25,6 +25,8 @@
     <string name="status_bar_please_disturb_button" msgid="3345398298841572813">"Tunjukkan pemberitahuan"</string>
     <string name="status_bar_recent_remove_item_title" msgid="6026395868129852968">"Alih keluar dari senarai"</string>
     <string name="status_bar_recent_inspect_item_title" msgid="7793624864528818569">"Maklumat aplikasi"</string>
+    <!-- no translation found for status_bar_no_recent_apps (6576392951053994640) -->
+    <skip />
     <string name="status_bar_no_notifications_title" msgid="4755261167193833213">"Tiada pemberitahuan"</string>
     <string name="status_bar_ongoing_events_title" msgid="1682504513316879202">"Sedang berlangsung"</string>
     <string name="status_bar_latest_events_title" msgid="6594767438577593172">"Pemberitahuan"</string>
diff --git a/packages/SystemUI/res/values-nb/strings.xml b/packages/SystemUI/res/values-nb/strings.xml
index 4db29ea..e3c53b8 100644
--- a/packages/SystemUI/res/values-nb/strings.xml
+++ b/packages/SystemUI/res/values-nb/strings.xml
@@ -25,6 +25,8 @@
     <string name="status_bar_please_disturb_button" msgid="3345398298841572813">"Vis varslinger"</string>
     <string name="status_bar_recent_remove_item_title" msgid="6026395868129852968">"Fjern fra listen"</string>
     <string name="status_bar_recent_inspect_item_title" msgid="7793624864528818569">"Info om app"</string>
+    <!-- no translation found for status_bar_no_recent_apps (6576392951053994640) -->
+    <skip />
     <string name="status_bar_no_notifications_title" msgid="4755261167193833213">"Ingen varslinger"</string>
     <string name="status_bar_ongoing_events_title" msgid="1682504513316879202">"Aktiviteter"</string>
     <string name="status_bar_latest_events_title" msgid="6594767438577593172">"Varslinger"</string>
diff --git a/packages/SystemUI/res/values-nl/strings.xml b/packages/SystemUI/res/values-nl/strings.xml
index 6cf24a1..d598e61 100644
--- a/packages/SystemUI/res/values-nl/strings.xml
+++ b/packages/SystemUI/res/values-nl/strings.xml
@@ -25,6 +25,8 @@
     <string name="status_bar_please_disturb_button" msgid="3345398298841572813">"Meldingen weergeven"</string>
     <string name="status_bar_recent_remove_item_title" msgid="6026395868129852968">"Verwijderen uit lijst"</string>
     <string name="status_bar_recent_inspect_item_title" msgid="7793624864528818569">"App-info"</string>
+    <!-- no translation found for status_bar_no_recent_apps (6576392951053994640) -->
+    <skip />
     <string name="status_bar_no_notifications_title" msgid="4755261167193833213">"Geen meldingen"</string>
     <string name="status_bar_ongoing_events_title" msgid="1682504513316879202">"Actief"</string>
     <string name="status_bar_latest_events_title" msgid="6594767438577593172">"Meldingen"</string>
diff --git a/packages/SystemUI/res/values-pl/strings.xml b/packages/SystemUI/res/values-pl/strings.xml
index b7e11ad..a9bf53b 100644
--- a/packages/SystemUI/res/values-pl/strings.xml
+++ b/packages/SystemUI/res/values-pl/strings.xml
@@ -25,6 +25,8 @@
     <string name="status_bar_please_disturb_button" msgid="3345398298841572813">"Pokaż powiadomienia"</string>
     <string name="status_bar_recent_remove_item_title" msgid="6026395868129852968">"Usuń z listy"</string>
     <string name="status_bar_recent_inspect_item_title" msgid="7793624864528818569">"Informacje o aplikacji"</string>
+    <!-- no translation found for status_bar_no_recent_apps (6576392951053994640) -->
+    <skip />
     <string name="status_bar_no_notifications_title" msgid="4755261167193833213">"Brak powiadomień"</string>
     <string name="status_bar_ongoing_events_title" msgid="1682504513316879202">"Bieżące"</string>
     <string name="status_bar_latest_events_title" msgid="6594767438577593172">"Powiadomienia"</string>
diff --git a/packages/SystemUI/res/values-pt-rPT/strings.xml b/packages/SystemUI/res/values-pt-rPT/strings.xml
index c8ab40c..f2d0c2a 100644
--- a/packages/SystemUI/res/values-pt-rPT/strings.xml
+++ b/packages/SystemUI/res/values-pt-rPT/strings.xml
@@ -25,6 +25,8 @@
     <string name="status_bar_please_disturb_button" msgid="3345398298841572813">"Mostrar notificações"</string>
     <string name="status_bar_recent_remove_item_title" msgid="6026395868129852968">"Remover da lista"</string>
     <string name="status_bar_recent_inspect_item_title" msgid="7793624864528818569">"Informações da aplicação"</string>
+    <!-- no translation found for status_bar_no_recent_apps (6576392951053994640) -->
+    <skip />
     <string name="status_bar_no_notifications_title" msgid="4755261167193833213">"Sem notificações"</string>
     <string name="status_bar_ongoing_events_title" msgid="1682504513316879202">"Em curso"</string>
     <string name="status_bar_latest_events_title" msgid="6594767438577593172">"Notificações"</string>
diff --git a/packages/SystemUI/res/values-pt/strings.xml b/packages/SystemUI/res/values-pt/strings.xml
index 2edfca1..c9ed8f2 100644
--- a/packages/SystemUI/res/values-pt/strings.xml
+++ b/packages/SystemUI/res/values-pt/strings.xml
@@ -25,6 +25,8 @@
     <string name="status_bar_please_disturb_button" msgid="3345398298841572813">"Mostrar notificações"</string>
     <string name="status_bar_recent_remove_item_title" msgid="6026395868129852968">"Remover da lista"</string>
     <string name="status_bar_recent_inspect_item_title" msgid="7793624864528818569">"Informações do aplicativo"</string>
+    <!-- no translation found for status_bar_no_recent_apps (6576392951053994640) -->
+    <skip />
     <string name="status_bar_no_notifications_title" msgid="4755261167193833213">"Sem notificações"</string>
     <string name="status_bar_ongoing_events_title" msgid="1682504513316879202">"Em andamento"</string>
     <string name="status_bar_latest_events_title" msgid="6594767438577593172">"Notificações"</string>
diff --git a/packages/SystemUI/res/values-rm/strings.xml b/packages/SystemUI/res/values-rm/strings.xml
index c3a49ea..bef7f2c 100644
--- a/packages/SystemUI/res/values-rm/strings.xml
+++ b/packages/SystemUI/res/values-rm/strings.xml
@@ -30,6 +30,8 @@
     <skip />
     <!-- no translation found for status_bar_recent_inspect_item_title (7793624864528818569) -->
     <skip />
+    <!-- no translation found for status_bar_no_recent_apps (6576392951053994640) -->
+    <skip />
     <string name="status_bar_no_notifications_title" msgid="4755261167193833213">"Nagins avis"</string>
     <string name="status_bar_ongoing_events_title" msgid="1682504513316879202">"Actual"</string>
     <string name="status_bar_latest_events_title" msgid="6594767438577593172">"Avis"</string>
diff --git a/packages/SystemUI/res/values-ro/strings.xml b/packages/SystemUI/res/values-ro/strings.xml
index 7c904ba..33dc26c 100644
--- a/packages/SystemUI/res/values-ro/strings.xml
+++ b/packages/SystemUI/res/values-ro/strings.xml
@@ -25,6 +25,8 @@
     <string name="status_bar_please_disturb_button" msgid="3345398298841572813">"Afişaţi notificări"</string>
     <string name="status_bar_recent_remove_item_title" msgid="6026395868129852968">"Eliminaţi din listă"</string>
     <string name="status_bar_recent_inspect_item_title" msgid="7793624864528818569">"Informaţii despre aplicaţie"</string>
+    <!-- no translation found for status_bar_no_recent_apps (6576392951053994640) -->
+    <skip />
     <string name="status_bar_no_notifications_title" msgid="4755261167193833213">"Nicio notificare"</string>
     <string name="status_bar_ongoing_events_title" msgid="1682504513316879202">"În desfăşurare"</string>
     <string name="status_bar_latest_events_title" msgid="6594767438577593172">"Notificări"</string>
diff --git a/packages/SystemUI/res/values-ru/strings.xml b/packages/SystemUI/res/values-ru/strings.xml
index a3f5fb3..f1ede40 100644
--- a/packages/SystemUI/res/values-ru/strings.xml
+++ b/packages/SystemUI/res/values-ru/strings.xml
@@ -25,6 +25,8 @@
     <string name="status_bar_please_disturb_button" msgid="3345398298841572813">"Показать уведомления"</string>
     <string name="status_bar_recent_remove_item_title" msgid="6026395868129852968">"Удаление приложения из списка"</string>
     <string name="status_bar_recent_inspect_item_title" msgid="7793624864528818569">"Сведения о приложении"</string>
+    <!-- no translation found for status_bar_no_recent_apps (6576392951053994640) -->
+    <skip />
     <string name="status_bar_no_notifications_title" msgid="4755261167193833213">"Нет уведомлений"</string>
     <string name="status_bar_ongoing_events_title" msgid="1682504513316879202">"Текущие"</string>
     <string name="status_bar_latest_events_title" msgid="6594767438577593172">"Уведомления"</string>
diff --git a/packages/SystemUI/res/values-sk/strings.xml b/packages/SystemUI/res/values-sk/strings.xml
index 7716e9f..ac0bcda 100644
--- a/packages/SystemUI/res/values-sk/strings.xml
+++ b/packages/SystemUI/res/values-sk/strings.xml
@@ -25,6 +25,8 @@
     <string name="status_bar_please_disturb_button" msgid="3345398298841572813">"Zobraziť upozornenia"</string>
     <string name="status_bar_recent_remove_item_title" msgid="6026395868129852968">"Odstrániť zo zoznamu"</string>
     <string name="status_bar_recent_inspect_item_title" msgid="7793624864528818569">"Informácie o aplikácii"</string>
+    <!-- no translation found for status_bar_no_recent_apps (6576392951053994640) -->
+    <skip />
     <string name="status_bar_no_notifications_title" msgid="4755261167193833213">"Žiadne upozornenia"</string>
     <string name="status_bar_ongoing_events_title" msgid="1682504513316879202">"Prebiehajúce"</string>
     <string name="status_bar_latest_events_title" msgid="6594767438577593172">"Upozornenia"</string>
diff --git a/packages/SystemUI/res/values-sl/strings.xml b/packages/SystemUI/res/values-sl/strings.xml
index c414730..1f8d0d2 100644
--- a/packages/SystemUI/res/values-sl/strings.xml
+++ b/packages/SystemUI/res/values-sl/strings.xml
@@ -25,6 +25,8 @@
     <string name="status_bar_please_disturb_button" msgid="3345398298841572813">"Pokaži obvestila"</string>
     <string name="status_bar_recent_remove_item_title" msgid="6026395868129852968">"Odstrani s seznama"</string>
     <string name="status_bar_recent_inspect_item_title" msgid="7793624864528818569">"Podatki o programu"</string>
+    <!-- no translation found for status_bar_no_recent_apps (6576392951053994640) -->
+    <skip />
     <string name="status_bar_no_notifications_title" msgid="4755261167193833213">"Ni obvestil"</string>
     <string name="status_bar_ongoing_events_title" msgid="1682504513316879202">"Trenutno"</string>
     <string name="status_bar_latest_events_title" msgid="6594767438577593172">"Obvestila"</string>
diff --git a/packages/SystemUI/res/values-sr/strings.xml b/packages/SystemUI/res/values-sr/strings.xml
index 310aa78..47f6884 100644
--- a/packages/SystemUI/res/values-sr/strings.xml
+++ b/packages/SystemUI/res/values-sr/strings.xml
@@ -25,6 +25,8 @@
     <string name="status_bar_please_disturb_button" msgid="3345398298841572813">"Приказуј упозорења"</string>
     <string name="status_bar_recent_remove_item_title" msgid="6026395868129852968">"Уклањање са листе"</string>
     <string name="status_bar_recent_inspect_item_title" msgid="7793624864528818569">"Информације о апликацији"</string>
+    <!-- no translation found for status_bar_no_recent_apps (6576392951053994640) -->
+    <skip />
     <string name="status_bar_no_notifications_title" msgid="4755261167193833213">"Нема обавештења"</string>
     <string name="status_bar_ongoing_events_title" msgid="1682504513316879202">"Текуће"</string>
     <string name="status_bar_latest_events_title" msgid="6594767438577593172">"Обавештења"</string>
diff --git a/packages/SystemUI/res/values-sv/strings.xml b/packages/SystemUI/res/values-sv/strings.xml
index 573a62f..dc1f56b 100644
--- a/packages/SystemUI/res/values-sv/strings.xml
+++ b/packages/SystemUI/res/values-sv/strings.xml
@@ -25,6 +25,8 @@
     <string name="status_bar_please_disturb_button" msgid="3345398298841572813">"Visa aviseringar"</string>
     <string name="status_bar_recent_remove_item_title" msgid="6026395868129852968">"Ta bort från listan"</string>
     <string name="status_bar_recent_inspect_item_title" msgid="7793624864528818569">"Info om appen"</string>
+    <!-- no translation found for status_bar_no_recent_apps (6576392951053994640) -->
+    <skip />
     <string name="status_bar_no_notifications_title" msgid="4755261167193833213">"Inga aviseringar"</string>
     <string name="status_bar_ongoing_events_title" msgid="1682504513316879202">"Pågående"</string>
     <string name="status_bar_latest_events_title" msgid="6594767438577593172">"Meddelanden"</string>
diff --git a/packages/SystemUI/res/values-sw/strings.xml b/packages/SystemUI/res/values-sw/strings.xml
index 6a28a3f..bb8e740 100644
--- a/packages/SystemUI/res/values-sw/strings.xml
+++ b/packages/SystemUI/res/values-sw/strings.xml
@@ -25,6 +25,8 @@
     <string name="status_bar_please_disturb_button" msgid="3345398298841572813">"Onyesha arifa"</string>
     <string name="status_bar_recent_remove_item_title" msgid="6026395868129852968">"Ondoa kwenye orodha"</string>
     <string name="status_bar_recent_inspect_item_title" msgid="7793624864528818569">"Taarifa za programu-matumizi"</string>
+    <!-- no translation found for status_bar_no_recent_apps (6576392951053994640) -->
+    <skip />
     <string name="status_bar_no_notifications_title" msgid="4755261167193833213">"Hakuna arifa"</string>
     <string name="status_bar_ongoing_events_title" msgid="1682504513316879202">"Inaendelea"</string>
     <string name="status_bar_latest_events_title" msgid="6594767438577593172">"Arifa"</string>
diff --git a/packages/SystemUI/res/values-th/strings.xml b/packages/SystemUI/res/values-th/strings.xml
index 810e2b4..490760f 100644
--- a/packages/SystemUI/res/values-th/strings.xml
+++ b/packages/SystemUI/res/values-th/strings.xml
@@ -25,6 +25,8 @@
     <string name="status_bar_please_disturb_button" msgid="3345398298841572813">"แสดงการแจ้งเตือน"</string>
     <string name="status_bar_recent_remove_item_title" msgid="6026395868129852968">"ลบจากรายการ"</string>
     <string name="status_bar_recent_inspect_item_title" msgid="7793624864528818569">"ข้อมูลแอปพลิเคชัน"</string>
+    <!-- no translation found for status_bar_no_recent_apps (6576392951053994640) -->
+    <skip />
     <string name="status_bar_no_notifications_title" msgid="4755261167193833213">"ไม่มีการแจ้งเตือน"</string>
     <string name="status_bar_ongoing_events_title" msgid="1682504513316879202">"ดำเนินอยู่"</string>
     <string name="status_bar_latest_events_title" msgid="6594767438577593172">"การแจ้งเตือน"</string>
diff --git a/packages/SystemUI/res/values-tl/strings.xml b/packages/SystemUI/res/values-tl/strings.xml
index 0c09d10..f1de297d 100644
--- a/packages/SystemUI/res/values-tl/strings.xml
+++ b/packages/SystemUI/res/values-tl/strings.xml
@@ -25,6 +25,8 @@
     <string name="status_bar_please_disturb_button" msgid="3345398298841572813">"Magpakita ng notification"</string>
     <string name="status_bar_recent_remove_item_title" msgid="6026395868129852968">"Alisin mula sa listahan"</string>
     <string name="status_bar_recent_inspect_item_title" msgid="7793624864528818569">"Impormasyon ng app"</string>
+    <!-- no translation found for status_bar_no_recent_apps (6576392951053994640) -->
+    <skip />
     <string name="status_bar_no_notifications_title" msgid="4755261167193833213">"Walang mga notification"</string>
     <string name="status_bar_ongoing_events_title" msgid="1682504513316879202">"Nagpapatuloy"</string>
     <string name="status_bar_latest_events_title" msgid="6594767438577593172">"Mga Notification"</string>
diff --git a/packages/SystemUI/res/values-tr/strings.xml b/packages/SystemUI/res/values-tr/strings.xml
index d3898ea..4dae911 100644
--- a/packages/SystemUI/res/values-tr/strings.xml
+++ b/packages/SystemUI/res/values-tr/strings.xml
@@ -25,6 +25,8 @@
     <string name="status_bar_please_disturb_button" msgid="3345398298841572813">"Bildirimleri göster"</string>
     <string name="status_bar_recent_remove_item_title" msgid="6026395868129852968">"Listeden kaldır"</string>
     <string name="status_bar_recent_inspect_item_title" msgid="7793624864528818569">"Uygulama bilgileri"</string>
+    <!-- no translation found for status_bar_no_recent_apps (6576392951053994640) -->
+    <skip />
     <string name="status_bar_no_notifications_title" msgid="4755261167193833213">"Bildirim yok"</string>
     <string name="status_bar_ongoing_events_title" msgid="1682504513316879202">"Sürüyor"</string>
     <string name="status_bar_latest_events_title" msgid="6594767438577593172">"Bildirimler"</string>
diff --git a/packages/SystemUI/res/values-uk/strings.xml b/packages/SystemUI/res/values-uk/strings.xml
index fbb51e2..fc90f13 100644
--- a/packages/SystemUI/res/values-uk/strings.xml
+++ b/packages/SystemUI/res/values-uk/strings.xml
@@ -25,6 +25,8 @@
     <string name="status_bar_please_disturb_button" msgid="3345398298841572813">"Показувати сповіщення"</string>
     <string name="status_bar_recent_remove_item_title" msgid="6026395868129852968">"Видалити зі списку"</string>
     <string name="status_bar_recent_inspect_item_title" msgid="7793624864528818569">"Інформація про програму"</string>
+    <!-- no translation found for status_bar_no_recent_apps (6576392951053994640) -->
+    <skip />
     <string name="status_bar_no_notifications_title" msgid="4755261167193833213">"Немає сповіщень"</string>
     <string name="status_bar_ongoing_events_title" msgid="1682504513316879202">"Поточні"</string>
     <string name="status_bar_latest_events_title" msgid="6594767438577593172">"Сповіщення"</string>
diff --git a/packages/SystemUI/res/values-vi/strings.xml b/packages/SystemUI/res/values-vi/strings.xml
index 84a9c3c..a4108ac 100644
--- a/packages/SystemUI/res/values-vi/strings.xml
+++ b/packages/SystemUI/res/values-vi/strings.xml
@@ -25,6 +25,8 @@
     <string name="status_bar_please_disturb_button" msgid="3345398298841572813">"Hiển thị thông báo"</string>
     <string name="status_bar_recent_remove_item_title" msgid="6026395868129852968">"Xóa khỏi danh sách"</string>
     <string name="status_bar_recent_inspect_item_title" msgid="7793624864528818569">"Thông tin về ứng dụng"</string>
+    <!-- no translation found for status_bar_no_recent_apps (6576392951053994640) -->
+    <skip />
     <string name="status_bar_no_notifications_title" msgid="4755261167193833213">"Không có thông báo nào"</string>
     <string name="status_bar_ongoing_events_title" msgid="1682504513316879202">"Đang diễn ra"</string>
     <string name="status_bar_latest_events_title" msgid="6594767438577593172">"Thông báo"</string>
diff --git a/packages/SystemUI/res/values-zh-rCN/strings.xml b/packages/SystemUI/res/values-zh-rCN/strings.xml
index 11b07ca..b073ac2 100644
--- a/packages/SystemUI/res/values-zh-rCN/strings.xml
+++ b/packages/SystemUI/res/values-zh-rCN/strings.xml
@@ -25,6 +25,8 @@
     <string name="status_bar_please_disturb_button" msgid="3345398298841572813">"显示通知"</string>
     <string name="status_bar_recent_remove_item_title" msgid="6026395868129852968">"从列表中删除"</string>
     <string name="status_bar_recent_inspect_item_title" msgid="7793624864528818569">"应用程序信息"</string>
+    <!-- no translation found for status_bar_no_recent_apps (6576392951053994640) -->
+    <skip />
     <string name="status_bar_no_notifications_title" msgid="4755261167193833213">"无通知"</string>
     <string name="status_bar_ongoing_events_title" msgid="1682504513316879202">"正在进行的"</string>
     <string name="status_bar_latest_events_title" msgid="6594767438577593172">"通知"</string>
diff --git a/packages/SystemUI/res/values-zh-rTW/strings.xml b/packages/SystemUI/res/values-zh-rTW/strings.xml
index b62b00f..1b69790 100644
--- a/packages/SystemUI/res/values-zh-rTW/strings.xml
+++ b/packages/SystemUI/res/values-zh-rTW/strings.xml
@@ -25,6 +25,8 @@
     <string name="status_bar_please_disturb_button" msgid="3345398298841572813">"顯示通知"</string>
     <string name="status_bar_recent_remove_item_title" msgid="6026395868129852968">"從清單中移除"</string>
     <string name="status_bar_recent_inspect_item_title" msgid="7793624864528818569">"應用程式資訊"</string>
+    <!-- no translation found for status_bar_no_recent_apps (6576392951053994640) -->
+    <skip />
     <string name="status_bar_no_notifications_title" msgid="4755261167193833213">"沒有通知"</string>
     <string name="status_bar_ongoing_events_title" msgid="1682504513316879202">"進行中"</string>
     <string name="status_bar_latest_events_title" msgid="6594767438577593172">"通知"</string>
diff --git a/packages/SystemUI/res/values-zu/strings.xml b/packages/SystemUI/res/values-zu/strings.xml
index 37e05ab..24c0145 100644
--- a/packages/SystemUI/res/values-zu/strings.xml
+++ b/packages/SystemUI/res/values-zu/strings.xml
@@ -25,6 +25,8 @@
     <string name="status_bar_please_disturb_button" msgid="3345398298841572813">"Bonisa izaziso"</string>
     <string name="status_bar_recent_remove_item_title" msgid="6026395868129852968">"Susa ohlwini"</string>
     <string name="status_bar_recent_inspect_item_title" msgid="7793624864528818569">"Ulwazi lwensiza"</string>
+    <!-- no translation found for status_bar_no_recent_apps (6576392951053994640) -->
+    <skip />
     <string name="status_bar_no_notifications_title" msgid="4755261167193833213">"Azikho izaziso"</string>
     <string name="status_bar_ongoing_events_title" msgid="1682504513316879202">"Okuqhubekayo"</string>
     <string name="status_bar_latest_events_title" msgid="6594767438577593172">"Izaziso"</string>
diff --git a/packages/SystemUI/src/com/android/systemui/recent/RecentsPanelView.java b/packages/SystemUI/src/com/android/systemui/recent/RecentsPanelView.java
index ee97af2..54bc4e3 100644
--- a/packages/SystemUI/src/com/android/systemui/recent/RecentsPanelView.java
+++ b/packages/SystemUI/src/com/android/systemui/recent/RecentsPanelView.java
@@ -129,7 +129,7 @@
         }
 
         public void setThumbnail(Bitmap thumbnail) {
-            mThumbnail = compositeBitmap(mDefaultThumbnailBackground, thumbnail);
+            mThumbnail = thumbnail;
         }
 
         public Bitmap getThumbnail() {
@@ -480,13 +480,10 @@
             if (resolveInfo != null) {
                 final ActivityInfo info = resolveInfo.activityInfo;
                 final String title = info.loadLabel(pm).toString();
-                // Drawable icon = info.loadIcon(pm);
                 Drawable icon = getFullResIcon(resolveInfo, pm);
                 if (title != null && title.length() > 0 && icon != null) {
                     if (DEBUG) Log.v(TAG, "creating activity desc for id="
                             + recentInfo.id + ", label=" + title);
-                    ActivityManager.TaskThumbnails thumbs = am.getTaskThumbnails(
-                            recentInfo.persistentId);
                     ActivityDescription item = new ActivityDescription(recentInfo,
                             resolveInfo, intent, index, info.packageName);
                     activityDescriptions.add(item);
@@ -525,7 +522,9 @@
         synchronized (ad) {
             ad.mLabel = label;
             ad.mIcon = icon;
-            ad.setThumbnail(thumbs != null ? thumbs.mainThumbnail : mDefaultThumbnailBackground);
+            if (thumbs != null && thumbs.mainThumbnail != null) {
+                ad.setThumbnail(thumbs.mainThumbnail);
+            }
         }
     }
 
@@ -661,21 +660,6 @@
         }
     }
 
-    private Bitmap compositeBitmap(Bitmap background, Bitmap thumbnail) {
-        Bitmap outBitmap = background.copy(background.getConfig(), true);
-        if (thumbnail != null) {
-            Canvas canvas = new Canvas(outBitmap);
-            Paint paint = new Paint();
-            paint.setAntiAlias(true);
-            paint.setFilterBitmap(true);
-            paint.setAlpha(255);
-            canvas.drawBitmap(thumbnail, null,
-                    new RectF(0, 0, outBitmap.getWidth(), outBitmap.getHeight()), paint);
-            canvas.setBitmap(null);
-        }
-        return outBitmap;
-    }
-
     private void updateUiElements(Configuration config) {
         final int items = mActivityDescriptions.size();
 
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/SignalClusterView.java b/packages/SystemUI/src/com/android/systemui/statusbar/SignalClusterView.java
index 65b022a..59b09d49 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/SignalClusterView.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/SignalClusterView.java
@@ -29,6 +29,7 @@
 
 import com.android.systemui.R;
 
+// Intimately tied to the design of res/layout/signal_cluster_view.xml
 public class SignalClusterView
         extends LinearLayout 
         implements NetworkController.SignalCluster {
@@ -42,9 +43,11 @@
     private int mWifiStrengthId = 0, mWifiActivityId = 0;
     private boolean mMobileVisible = false;
     private int mMobileStrengthId = 0, mMobileActivityId = 0, mMobileTypeId = 0;
+    private boolean mIsAirplaneMode = false;
 
     ViewGroup mWifiGroup, mMobileGroup;
     ImageView mWifi, mMobile, mWifiActivity, mMobileActivity, mMobileType;
+    View mSpacer;
 
     public SignalClusterView(Context context) {
         this(context, null);
@@ -74,6 +77,7 @@
         mMobile         = (ImageView) findViewById(R.id.mobile_signal);
         mMobileActivity = (ImageView) findViewById(R.id.mobile_inout);
         mMobileType     = (ImageView) findViewById(R.id.mobile_type);
+        mSpacer         =             findViewById(R.id.spacer);
 
         apply();
     }
@@ -109,6 +113,10 @@
         apply();
     }
 
+    public void setIsAirplaneMode(boolean is) {
+        mIsAirplaneMode = is;
+    }
+
     // Run after each indicator change.
     private void apply() {
         if (mWifiGroup == null) return;
@@ -135,6 +143,12 @@
             mMobileGroup.setVisibility(View.GONE);
         }
 
+        if (mMobileVisible && mWifiVisible && mIsAirplaneMode) {
+            mSpacer.setVisibility(View.INVISIBLE);
+        } else {
+            mSpacer.setVisibility(View.GONE);
+        }
+
         if (DEBUG) Slog.d(TAG,
                 String.format("mobile: %s sig=%d act=%d typ=%d",
                     (mMobileVisible ? "VISIBLE" : "GONE"),
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkController.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkController.java
index ed66823..c23bfc7d 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkController.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkController.java
@@ -142,6 +142,7 @@
         void setWifiIndicators(boolean visible, int strengthIcon, int activityIcon);
         void setMobileDataIndicators(boolean visible, int strengthIcon, int activityIcon,
                 int typeIcon);
+        void setIsAirplaneMode(boolean is);
     }
 
     /**
@@ -886,6 +887,7 @@
                         mPhoneSignalIconId,
                         mMobileActivityIconId,
                         mDataTypeIconId);
+                cluster.setIsAirplaneMode(mAirplaneMode);
             }
         }
 
diff --git a/policy/src/com/android/internal/policy/impl/KeyguardViewManager.java b/policy/src/com/android/internal/policy/impl/KeyguardViewManager.java
index cbf1c90..91f1527 100644
--- a/policy/src/com/android/internal/policy/impl/KeyguardViewManager.java
+++ b/policy/src/com/android/internal/policy/impl/KeyguardViewManager.java
@@ -24,6 +24,7 @@
 import android.content.res.Resources;
 import android.graphics.PixelFormat;
 import android.graphics.Canvas;
+import android.os.IBinder;
 import android.os.SystemProperties;
 import android.util.Log;
 import android.view.View;
@@ -59,6 +60,10 @@
 
     private boolean mScreenOn = false;
 
+    public interface ShowListener {
+        void onShown(IBinder windowToken);
+    };
+
     /**
      * @param context Used to create views.
      * @param viewManager Keyguard will be attached to this.
@@ -206,7 +211,8 @@
         }
     }
 
-    public synchronized void onScreenTurnedOn() {
+    public synchronized void onScreenTurnedOn(
+            final KeyguardViewManager.ShowListener showListener) {
         if (DEBUG) Log.d(TAG, "onScreenTurnedOn()");
         mScreenOn = true;
         if (mKeyguardView != null) {
@@ -214,6 +220,26 @@
 
             // When screen is turned on, need to bind to FaceLock service if we are using FaceLock
             mKeyguardView.bindToFaceLock();
+
+            // Caller should wait for this window to be shown before turning
+            // on the screen.
+            if (mKeyguardHost.getVisibility() == View.VISIBLE) {
+                // Keyguard may be in the process of being shown, but not yet
+                // updated with the window manager...  give it a chance to do so.
+                mKeyguardHost.post(new Runnable() {
+                    @Override public void run() {
+                        if (mKeyguardHost.getVisibility() == View.VISIBLE) {
+                            showListener.onShown(mKeyguardHost.getWindowToken());
+                        } else {
+                            showListener.onShown(null);
+                        }
+                    }
+                });
+            } else {
+                showListener.onShown(null);
+            }
+        } else {
+            showListener.onShown(null);
         }
     }
 
diff --git a/policy/src/com/android/internal/policy/impl/KeyguardViewMediator.java b/policy/src/com/android/internal/policy/impl/KeyguardViewMediator.java
index 64a9677..5d3dee9 100644
--- a/policy/src/com/android/internal/policy/impl/KeyguardViewMediator.java
+++ b/policy/src/com/android/internal/policy/impl/KeyguardViewMediator.java
@@ -116,7 +116,6 @@
     private static final int KEYGUARD_DONE_AUTHENTICATING = 11;
     private static final int SET_HIDDEN = 12;
     private static final int KEYGUARD_TIMEOUT = 13;
-    private static final int REPORT_SHOW_DONE = 14;
 
     /**
      * The default amount of time we stay awake (used for all key input)
@@ -239,8 +238,6 @@
 
     private boolean mScreenOn = false;
 
-    private boolean mShowPending = false;
-
     // last known state of the cellular connection
     private String mPhoneState = TelephonyManager.EXTRA_STATE_IDLE;
 
@@ -383,19 +380,7 @@
             } else if (why == WindowManagerPolicy.OFF_BECAUSE_OF_PROX_SENSOR) {
                 // Do not enable the keyguard if the prox sensor forced the screen off.
             } else {
-                if (!doKeyguardLocked() && why == WindowManagerPolicy.OFF_BECAUSE_OF_USER) {
-                    // The user has explicitly turned off the screen, causing it
-                    // to lock.  We want to block here until the keyguard window
-                    // has shown, so the power manager won't complete the screen
-                    // off flow until that point, so we know it won't turn *on*
-                    // the screen until this is done.
-                    while (mShowPending) {
-                        try {
-                            wait();
-                        } catch (InterruptedException e) {
-                        }
-                    }
-                }
+                doKeyguardLocked();
             }
         }
     }
@@ -403,12 +388,12 @@
     /**
      * Let's us know the screen was turned on.
      */
-    public void onScreenTurnedOn() {
+    public void onScreenTurnedOn(KeyguardViewManager.ShowListener showListener) {
         synchronized (this) {
             mScreenOn = true;
             mDelayedShowingSequence++;
             if (DEBUG) Log.d(TAG, "onScreenTurnedOn, seq = " + mDelayedShowingSequence);
-            notifyScreenOnLocked();
+            notifyScreenOnLocked(showListener);
         }
     }
 
@@ -573,7 +558,7 @@
      * work that will happen is done; returns false if the caller can wait for
      * the keyguard to be shown.
      */
-    private boolean doKeyguardLocked() {
+    private void doKeyguardLocked() {
         // if another app is disabling us, don't show
         if (!mExternallyEnabled) {
             if (DEBUG) Log.d(TAG, "doKeyguard: not showing because externally disabled");
@@ -587,13 +572,13 @@
             // ends (see the broadcast receiver below)
             // TODO: clean this up when we have better support at the window manager level
             // for apps that wish to be on top of the keyguard
-            return true;
+            return;
         }
 
         // if the keyguard is already showing, don't bother
         if (mKeyguardViewManager.isShowing()) {
             if (DEBUG) Log.d(TAG, "doKeyguard: not showing because it is already showing");
-            return true;
+            return;
         }
 
         // if the setup wizard hasn't run yet, don't show
@@ -609,18 +594,16 @@
         if (!lockedOrMissing && !provisioned) {
             if (DEBUG) Log.d(TAG, "doKeyguard: not showing because device isn't provisioned"
                     + " and the sim is not locked or missing");
-            return true;
+            return;
         }
 
         if (mLockPatternUtils.isLockScreenDisabled()) {
             if (DEBUG) Log.d(TAG, "doKeyguard: not showing because lockscreen is off");
-            return true;
+            return;
         }
 
         if (DEBUG) Log.d(TAG, "doKeyguard: showing the lock screen");
-        mShowPending = true;
         showLocked();
-        return false;
     }
 
     /**
@@ -658,9 +641,10 @@
      * @see #onScreenTurnedOn()
      * @see #handleNotifyScreenOn
      */
-    private void notifyScreenOnLocked() {
+    private void notifyScreenOnLocked(KeyguardViewManager.ShowListener showListener) {
         if (DEBUG) Log.d(TAG, "notifyScreenOnLocked");
-        mHandler.sendEmptyMessage(NOTIFY_SCREEN_ON);
+        Message msg = mHandler.obtainMessage(NOTIFY_SCREEN_ON, showListener);
+        mHandler.sendMessage(msg);
     }
 
     /**
@@ -974,7 +958,7 @@
                     handleNotifyScreenOff();
                     return;
                 case NOTIFY_SCREEN_ON:
-                    handleNotifyScreenOn();
+                    handleNotifyScreenOn((KeyguardViewManager.ShowListener)msg.obj);
                     return;
                 case WAKE_WHEN_READY:
                     handleWakeWhenReady(msg.arg1);
@@ -996,12 +980,6 @@
                         doKeyguardLocked();
                     }
                     break;
-                case REPORT_SHOW_DONE:
-                    synchronized (KeyguardViewMediator.this) {
-                        mShowPending = false;
-                        KeyguardViewMediator.this.notifyAll();
-                    }
-                    break;
             }
         }
     };
@@ -1113,12 +1091,6 @@
             playSounds(true);
 
             mShowKeyguardWakeLock.release();
-
-            // We won't say the show is done yet because the view hierarchy
-            // still needs to do the traversal.  Posting this message allows
-            // us to hold off until that is done.
-            Message msg = mHandler.obtainMessage(REPORT_SHOW_DONE);
-            mHandler.sendMessage(msg);
         }
     }
 
@@ -1284,10 +1256,10 @@
      * Handle message sent by {@link #notifyScreenOnLocked()}
      * @see #NOTIFY_SCREEN_ON
      */
-    private void handleNotifyScreenOn() {
+    private void handleNotifyScreenOn(KeyguardViewManager.ShowListener showListener) {
         synchronized (KeyguardViewMediator.this) {
             if (DEBUG) Log.d(TAG, "handleNotifyScreenOn");
-            mKeyguardViewManager.onScreenTurnedOn();
+            mKeyguardViewManager.onScreenTurnedOn(showListener);
         }
     }
 
diff --git a/policy/src/com/android/internal/policy/impl/LockPatternKeyguardView.java b/policy/src/com/android/internal/policy/impl/LockPatternKeyguardView.java
index 1d311d6..465fc2c 100644
--- a/policy/src/com/android/internal/policy/impl/LockPatternKeyguardView.java
+++ b/policy/src/com/android/internal/policy/impl/LockPatternKeyguardView.java
@@ -46,6 +46,8 @@
 import android.graphics.PixelFormat;
 import android.graphics.drawable.Drawable;
 import android.os.Bundle;
+import android.os.Handler;
+import android.os.Message;
 import android.os.IBinder;
 import android.os.RemoteException;
 import android.os.SystemClock;
@@ -74,7 +76,7 @@
  * {@link com.android.internal.policy.impl.KeyguardViewManager}
  * via its {@link com.android.internal.policy.impl.KeyguardViewCallback}, as appropriate.
  */
-public class LockPatternKeyguardView extends KeyguardViewBase {
+public class LockPatternKeyguardView extends KeyguardViewBase implements Handler.Callback {
 
     private static final int TRANSPORT_USERACTIVITY_TIMEOUT = 10000;
 
@@ -103,9 +105,15 @@
     // The following were added to support FaceLock
     private IFaceLockInterface mFaceLockService;
     private boolean mBoundToFaceLockService = false;
-    private boolean mFaceLockServiceRunning = false;
     private View mFaceLockAreaView;
 
+    private boolean mFaceLockServiceRunning = false;
+    private final Object mFaceLockServiceRunningLock = new Object();
+
+    private Handler mHandler;
+    private final int MSG_SHOW_FACELOCK_AREA_VIEW = 0;
+    private final int MSG_HIDE_FACELOCK_AREA_VIEW = 1;
+
     /**
      * The current {@link KeyguardScreen} will use this to communicate back to us.
      */
@@ -244,6 +252,7 @@
             KeyguardWindowController controller) {
         super(context);
 
+        mHandler = new Handler(this);
         mConfiguration = context.getResources().getConfiguration();
         mEnableFallback = false;
         mRequiresSim = TextUtils.isEmpty(SystemProperties.get("keyguard.no_require_sim"));
@@ -593,10 +602,6 @@
     }
 
     private boolean isSecure() {
-        // TODO: make this work with SIM and Account cases below.
-        boolean usingBiometric = mLockPatternUtils.usingBiometricWeak();
-        if (usingBiometric && mLockPatternUtils.isBiometricEnabled())
-            return true;
         UnlockMode unlockMode = getUnlockMode();
         boolean secure = false;
         switch (unlockMode) {
@@ -704,12 +709,6 @@
                     mKeyguardScreenCallback,
                     mUpdateMonitor.getFailedAttempts());
             view.setEnableFallback(mEnableFallback);
-
-            // TODO(bcolonna): For pattern unlock, it can give us the view where the pattern is
-            // displayed and FaceLock can draw in that area.
-            // For other views it's not so simple and we should probably change how the FaceLock
-            // area is determined.
-            mFaceLockAreaView = view.getUnlockAreaView();
             unlockView = view;
         } else if (unlockMode == UnlockMode.SimPuk) {
             unlockView = new SimPukUnlockScreen(
@@ -759,6 +758,8 @@
             throw new IllegalArgumentException("unknown unlock mode " + unlockMode);
         }
         initializeTransportControlView(unlockView);
+        initializeFaceLockAreaView(unlockView); // Only shows view if FaceLock is enabled
+
         mUnlockScreenMode = unlockMode;
         return unlockView;
     }
@@ -938,6 +939,41 @@
 
     // Everything below pertains to FaceLock - might want to separate this out
 
+    // Only pattern and pin unlock screens actually have a view for the FaceLock area, so it's not
+    // uncommon for it to not exist.  But if it does exist, we need to make sure it's showing if
+    // FaceLock is enabled, and make sure it's not showing if FaceLock is disabled
+    private void initializeFaceLockAreaView(View view) {
+        mFaceLockAreaView = view.findViewById(R.id.faceLockAreaView);
+        if (mFaceLockAreaView == null) {
+            if (DEBUG) Log.d(TAG, "Layout does not have faceLockAreaView");
+        } else {
+            if (mLockPatternUtils.usingBiometricWeak()) {
+                mHandler.sendEmptyMessage(MSG_SHOW_FACELOCK_AREA_VIEW);
+            } else {
+                mHandler.sendEmptyMessage(MSG_HIDE_FACELOCK_AREA_VIEW);
+            }
+        }
+    }
+
+    // Handles covering or exposing FaceLock area on the client side when FaceLock starts or stops
+    // This needs to be done in a handler because the call could be coming from a callback from the
+    // FaceLock service that is in a thread that can't modify the UI
+    @Override
+    public boolean handleMessage(Message msg) {
+        switch (msg.what) {
+        case MSG_SHOW_FACELOCK_AREA_VIEW:
+            mFaceLockAreaView.setVisibility(View.VISIBLE);
+            break;
+        case MSG_HIDE_FACELOCK_AREA_VIEW:
+            mFaceLockAreaView.setVisibility(View.GONE);
+            break;
+        default:
+            Log.w(TAG, "Unhandled message");
+            return false;
+        }
+        return true;
+    }
+
     // Binds to FaceLock service, but does not tell it to start
     public void bindToFaceLock() {
         if (mLockPatternUtils.usingBiometricWeak()) {
@@ -986,23 +1022,20 @@
                 throw new RuntimeException("Remote exception");
             }
 
-            // TODO(bcolonna): Need to set location properly (only works for pattern view now)
             if (mFaceLockAreaView != null) {
-                int[] unlockLocationOnScreen = new int[2];
-                mFaceLockAreaView.getLocationOnScreen(unlockLocationOnScreen);
-                int x = unlockLocationOnScreen[0];
-                int y = unlockLocationOnScreen[1];
-                int w = mFaceLockAreaView.getWidth();
-                int h = mFaceLockAreaView.getHeight();
-                if (DEBUG) Log.d(TAG, "(x,y) (wxh): (" + x + "," + y + ") (" + w + "x" + h + ")");
-                startFaceLock(mFaceLockAreaView.getWindowToken(), x, y, w, h);
+                startFaceLock(mFaceLockAreaView.getWindowToken(),
+                        mFaceLockAreaView.getLeft(), mFaceLockAreaView.getTop(),
+                        mFaceLockAreaView.getWidth(), mFaceLockAreaView.getHeight());
             }
         }
 
         // Cleans up if FaceLock service unexpectedly disconnects
         @Override
         public void onServiceDisconnected(ComponentName className) {
-            mFaceLockService = null;
+            synchronized(mFaceLockServiceRunningLock) {
+                mFaceLockService = null;
+                mFaceLockServiceRunning = false;
+            }
             if (DEBUG) Log.w(TAG, "Unexpected disconnect from FaceLock service");
         }
     };
@@ -1011,16 +1044,18 @@
     public void startFaceLock(IBinder windowToken, int x, int y, int h, int w)
     {
         if (mLockPatternUtils.usingBiometricWeak()) {
-            if (!mFaceLockServiceRunning) {
-                if (DEBUG) Log.d(TAG, "Starting FaceLock");
-                try {
-                    mFaceLockService.startUi(windowToken, x, y, h, w);
-                } catch (RemoteException e) {
-                    throw new RuntimeException("Remote exception");
+            synchronized (mFaceLockServiceRunningLock) {
+                if (!mFaceLockServiceRunning) {
+                    if (DEBUG) Log.d(TAG, "Starting FaceLock");
+                    try {
+                        mFaceLockService.startUi(windowToken, x, y, h, w);
+                    } catch (RemoteException e) {
+                        throw new RuntimeException("Remote exception");
+                    }
+                    mFaceLockServiceRunning = true;
+                } else {
+                    if (DEBUG) Log.w(TAG, "startFaceLock() attempted while running");
                 }
-                mFaceLockServiceRunning = true;
-            } else {
-                if (DEBUG) Log.w(TAG, "startFaceLock() attempted while running");
             }
         }
     }
@@ -1032,14 +1067,16 @@
             // Note that attempting to stop FaceLock when it's not running is not an issue.
             // FaceLock can return, which stops it and then we try to stop it when the
             // screen is turned off.  That's why we check.
-            if (mFaceLockServiceRunning) {
-                try {
-                    if (DEBUG) Log.d(TAG, "Stopping FaceLock");
-                    mFaceLockService.stopUi();
-                } catch (RemoteException e) {
-                    throw new RuntimeException("Remote exception");
+            synchronized (mFaceLockServiceRunningLock) {
+                if (mFaceLockServiceRunning) {
+                    try {
+                        if (DEBUG) Log.d(TAG, "Stopping FaceLock");
+                        mFaceLockService.stopUi();
+                    } catch (RemoteException e) {
+                        throw new RuntimeException("Remote exception");
+                    }
+                    mFaceLockServiceRunning = false;
                 }
-                mFaceLockServiceRunning = false;
             }
         }
     }
@@ -1051,6 +1088,9 @@
         @Override
         public void unlock() {
             if (DEBUG) Log.d(TAG, "FaceLock unlock");
+            // Note that we don't hide the client FaceLockAreaView because we want to keep the
+            // lock screen covered while the phone is unlocked
+
             stopFaceLock();
             mKeyguardScreenCallback.keyguardDone(true);
             mKeyguardScreenCallback.reportSuccessfulUnlockAttempt();
@@ -1061,6 +1101,8 @@
         public void cancel() {
             // In this case, either the user has cancelled out, or FaceLock failed to recognize them
             if (DEBUG) Log.d(TAG, "FaceLock cancel");
+            // Here we hide the client FaceLockViewArea to expose the underlying backup method
+            mHandler.sendEmptyMessage(MSG_HIDE_FACELOCK_AREA_VIEW);
             stopFaceLock();
         }
 
@@ -1069,8 +1111,12 @@
         public void sleepDevice() {
             // In this case, it appears the phone has been turned on accidentally
             if (DEBUG) Log.d(TAG, "FaceLock accidental turn on");
+            // Here we hide the client FaceLockViewArea to expose the underlying backup method
+            mHandler.sendEmptyMessage(MSG_HIDE_FACELOCK_AREA_VIEW);
             stopFaceLock();
             // TODO(bcolonna): how do we put the phone back to sleep (i.e., turn off the screen)
+            // TODO(bcolonna): this should be removed once the service is no longer calling it
+            // because we are just going to let the lockscreen timeout
         }
     };
 }
diff --git a/policy/src/com/android/internal/policy/impl/PatternUnlockScreen.java b/policy/src/com/android/internal/policy/impl/PatternUnlockScreen.java
index 0cafeb5a..88c42a6 100644
--- a/policy/src/com/android/internal/policy/impl/PatternUnlockScreen.java
+++ b/policy/src/com/android/internal/policy/impl/PatternUnlockScreen.java
@@ -199,12 +199,6 @@
         setFocusableInTouchMode(true);
     }
 
-    // TODO(bcolonna): This is to tell FaceLock where to draw...but this covers up the wireless
-    // service text, so we will want to change the way the area is specified
-    public View getUnlockAreaView() {
-        return mLockPatternView;
-    }
-
     public void setEnableFallback(boolean state) {
         if (DEBUG) Log.d(TAG, "setEnableFallback(" + state + ")");
         mEnableFallback = state;
diff --git a/policy/src/com/android/internal/policy/impl/PhoneWindow.java b/policy/src/com/android/internal/policy/impl/PhoneWindow.java
index 903b405..1b7271d 100644
--- a/policy/src/com/android/internal/policy/impl/PhoneWindow.java
+++ b/policy/src/com/android/internal/policy/impl/PhoneWindow.java
@@ -2135,7 +2135,8 @@
                                 com.android.internal.R.attr.actionModePopupWindowStyle);
                         mActionModePopup.setLayoutInScreenEnabled(true);
                         mActionModePopup.setLayoutInsetDecor(true);
-                        mActionModePopup.setClippingEnabled(false);
+                        mActionModePopup.setWindowLayoutType(
+                                WindowManager.LayoutParams.TYPE_APPLICATION);
                         mActionModePopup.setContentView(mActionModeView);
                         mActionModePopup.setWidth(MATCH_PARENT);
 
@@ -2144,10 +2145,12 @@
                                 com.android.internal.R.attr.actionBarSize, heightValue, true);
                         final int height = TypedValue.complexToDimensionPixelSize(heightValue.data,
                                 mContext.getResources().getDisplayMetrics());
-                        mActionModePopup.setHeight(height);
+                        mActionModeView.setContentHeight(height);
+                        mActionModePopup.setHeight(WRAP_CONTENT);
                         mShowActionModePopup = new Runnable() {
                             public void run() {
-                                mActionModePopup.showAtLocation(PhoneWindow.DecorView.this,
+                                mActionModePopup.showAtLocation(
+                                        mActionModeView.getApplicationWindowToken(),
                                         Gravity.TOP | Gravity.FILL_HORIZONTAL, 0, 0);
                             }
                         };
diff --git a/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java b/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
index 10447ad..c8c0041 100755
--- a/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
+++ b/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
@@ -40,8 +40,10 @@
 import android.graphics.Rect;
 import android.graphics.RectF;
 import android.os.Binder;
+import android.os.Bundle;
 import android.os.Handler;
 import android.os.IBinder;
+import android.os.IRemoteCallback;
 import android.os.LocalPowerManager;
 import android.os.Message;
 import android.os.Messenger;
@@ -284,7 +286,8 @@
     int mLidKeyboardAccessibility;
     int mLidNavigationAccessibility;
     int mLongPressOnPowerBehavior = -1;
-    boolean mScreenOn = false;
+    boolean mScreenOnEarly = false;
+    boolean mScreenOnFully = false;
     boolean mOrientationSensorEnabled = false;
     int mCurrentAppOrientation = ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED;
     static final int DEFAULT_ACCELEROMETER_ROTATION = 0;
@@ -544,11 +547,11 @@
         }
         //Could have been invoked due to screen turning on or off or
         //change of the currently visible window's orientation
-        if (localLOGV) Log.v(TAG, "Screen status="+mScreenOn+
+        if (localLOGV) Log.v(TAG, "Screen status="+mScreenOnEarly+
                 ", current orientation="+mCurrentAppOrientation+
                 ", SensorEnabled="+mOrientationSensorEnabled);
         boolean disable = true;
-        if (mScreenOn) {
+        if (mScreenOnEarly) {
             if (needSensorRunningLp()) {
                 disable = false;
                 //enable listener if not already enabled
@@ -2091,11 +2094,13 @@
     /** {@inheritDoc} */
     public void animatingWindowLw(WindowState win,
                                 WindowManager.LayoutParams attrs) {
+        if (DEBUG_LAYOUT) Slog.i(TAG, "Win " + win + ": isVisibleOrBehindKeyguardLw="
+                + win.isVisibleOrBehindKeyguardLw());
         if (mTopFullscreenOpaqueWindowState == null &&
                 win.isVisibleOrBehindKeyguardLw()) {
             if ((attrs.flags & FLAG_FORCE_NOT_FULLSCREEN) != 0) {
                 mForceStatusBar = true;
-            } 
+            }
             if (attrs.type >= FIRST_APPLICATION_WINDOW
                     && attrs.type <= LAST_APPLICATION_WINDOW
                     && attrs.x == 0 && attrs.y == 0
@@ -2134,10 +2139,10 @@
                 : null;
 
         if (mStatusBar != null) {
-            if (localLOGV) Log.i(TAG, "force=" + mForceStatusBar
+            if (DEBUG_LAYOUT) Log.i(TAG, "force=" + mForceStatusBar
                     + " top=" + mTopFullscreenOpaqueWindowState);
             if (mForceStatusBar) {
-                if (DEBUG_LAYOUT) Log.v(TAG, "Showing status bar");
+                if (DEBUG_LAYOUT) Log.v(TAG, "Showing status bar: forced");
                 if (mStatusBar.showLw(true)) changes |= FINISH_LAYOUT_REDO_LAYOUT;
             } else if (mTopFullscreenOpaqueWindowState != null) {
                 if (localLOGV) {
@@ -2165,11 +2170,11 @@
                                 }
                             }});
                         }
-                    } else if (localLOGV) {
+                    } else if (DEBUG_LAYOUT) {
                         Log.v(TAG, "Preventing status bar from hiding by policy");
                     }
                 } else {
-                    if (DEBUG_LAYOUT) Log.v(TAG, "Showing status bar");
+                    if (DEBUG_LAYOUT) Log.v(TAG, "Showing status bar: top is not fullscreen");
                     if (mStatusBar.showLw(true)) changes |= FINISH_LAYOUT_REDO_LAYOUT;
                 }
             }
@@ -2806,7 +2811,8 @@
     public void screenTurnedOff(int why) {
         EventLog.writeEvent(70000, 0);
         synchronized (mLock) {
-            mScreenOn = false;
+            mScreenOnEarly = false;
+            mScreenOnFully = false;
         }
         mKeyguardMediator.onScreenTurnedOff(why);
         synchronized (mLock) {
@@ -2814,25 +2820,38 @@
             updateLockScreenTimeout();
             updateScreenSaverTimeoutLocked();
         }
-        try {
-            mWindowManager.waitForAllDrawn();
-        } catch (RemoteException e) {
-        }
-        // Wait for one frame to give surface flinger time to do its
-        // compositing.  Yes this is a hack, but I am really not up right now for
-        // implementing some mechanism to block until SF is done. :p
-        try {
-            Thread.sleep(20);
-        } catch (InterruptedException e) {
-        }
     }
 
     /** {@inheritDoc} */
-    public void screenTurnedOn() {
+    public void screenTurningOn(final ScreenOnListener screenOnListener) {
         EventLog.writeEvent(70000, 1);
-        mKeyguardMediator.onScreenTurnedOn();
+        //Slog.i(TAG, "Screen turning on...");
+        mKeyguardMediator.onScreenTurnedOn(new KeyguardViewManager.ShowListener() {
+            @Override public void onShown(IBinder windowToken) {
+                if (windowToken != null) {
+                    try {
+                        mWindowManager.waitForWindowDrawn(windowToken, new IRemoteCallback.Stub() {
+                            @Override public void sendResult(Bundle data) {
+                                Slog.i(TAG, "Lock screen displayed!");
+                                screenOnListener.onScreenOn();
+                                synchronized (mLock) {
+                                    mScreenOnFully = true;
+                                }
+                            }
+                        });
+                    } catch (RemoteException e) {
+                    }
+                } else {
+                    Slog.i(TAG, "No lock screen!");
+                    screenOnListener.onScreenOn();
+                    synchronized (mLock) {
+                        mScreenOnFully = true;
+                    }
+                }
+            }
+        });
         synchronized (mLock) {
-            mScreenOn = true;
+            mScreenOnEarly = true;
             updateOrientationListenerLp();
             updateLockScreenTimeout();
             updateScreenSaverTimeoutLocked();
@@ -2840,8 +2859,13 @@
     }
 
     /** {@inheritDoc} */
-    public boolean isScreenOn() {
-        return mScreenOn;
+    public boolean isScreenOnEarly() {
+        return mScreenOnEarly;
+    }
+    
+    /** {@inheritDoc} */
+    public boolean isScreenOnFully() {
+        return mScreenOnFully;
     }
     
     /** {@inheritDoc} */
@@ -3228,7 +3252,7 @@
 
         synchronized (mScreenSaverActivator) {
             mHandler.removeCallbacks(mScreenSaverActivator);
-            if (mScreenSaverEnabled && mScreenOn && mScreenSaverTimeout > 0) {
+            if (mScreenSaverEnabled && mScreenOnEarly && mScreenSaverTimeout > 0) {
                 if (localLOGV)
                     Log.v(TAG, "scheduling screensaver for " + mScreenSaverTimeout + "ms from now");
                 mHandler.postDelayed(mScreenSaverActivator, mScreenSaverTimeout);
@@ -3236,7 +3260,7 @@
                 if (localLOGV) {
                     if (mScreenSaverTimeout == 0)
                         Log.v(TAG, "screen saver disabled by user");
-                    else if (!mScreenOn)
+                    else if (!mScreenOnEarly)
                         Log.v(TAG, "screen saver disabled while screen off");
                     else
                         Log.v(TAG, "screen saver disabled by wakelock");
@@ -3257,7 +3281,7 @@
 
     private void updateLockScreenTimeout() {
         synchronized (mScreenLockTimeout) {
-            boolean enable = (mAllowLockscreenWhenOn && mScreenOn && mKeyguardMediator.isSecure());
+            boolean enable = (mAllowLockscreenWhenOn && mScreenOnEarly && mKeyguardMediator.isSecure());
             if (mLockScreenTimerActive != enable) {
                 if (enable) {
                     if (localLOGV) Log.v(TAG, "setting lockscreen timer");
@@ -3466,7 +3490,7 @@
 
     public boolean allowKeyRepeat() {
         // disable key repeat when screen is off
-        return mScreenOn;
+        return mScreenOnEarly;
     }
 
     private void updateSystemUiVisibility() {
@@ -3522,7 +3546,8 @@
                 pw.print(mLidKeyboardAccessibility);
                 pw.print(" mLidNavigationAccessibility="); pw.print(mLidNavigationAccessibility);
                 pw.print(" mLongPressOnPowerBehavior="); pw.println(mLongPressOnPowerBehavior);
-        pw.print(prefix); pw.print("mScreenOn="); pw.print(mScreenOn);
+        pw.print(prefix); pw.print("mScreenOnEarly="); pw.print(mScreenOnEarly);
+                pw.print(" mScreenOnFully="); pw.print(mScreenOnFully);
                 pw.print(" mOrientationSensorEnabled="); pw.print(mOrientationSensorEnabled);
                 pw.print(" mHasSoftInput="); pw.println(mHasSoftInput);
         pw.print(prefix); pw.print("mUnrestrictedScreen=("); pw.print(mUnrestrictedScreenLeft);
diff --git a/services/audioflinger/AudioResampler.cpp b/services/audioflinger/AudioResampler.cpp
index dca795c..9ee5a30 100644
--- a/services/audioflinger/AudioResampler.cpp
+++ b/services/audioflinger/AudioResampler.cpp
@@ -434,9 +434,9 @@
 
         // the following loop works on 2 frames
 
-        ".Y4L01:\n"
+        "1:\n"
         "   cmp r8, r2\n"                   // curOut - maxCurOut
-        "   bcs .Y4L02\n"
+        "   bcs 2f\n"
 
 #define MO_ONE_FRAME \
     "   add r0, r1, r7, asl #1\n"       /* in + inputIndex */\
@@ -460,8 +460,8 @@
         MO_ONE_FRAME    // frame 2
 
         "   cmp r7, r3\n"                   // inputIndex - maxInIdx
-        "   bcc .Y4L01\n"
-        ".Y4L02:\n"
+        "   bcc 1b\n"
+        "2:\n"
 
         "   bic r6, r6, #0xC0000000\n"             // phaseFraction & ...
         // save modified values
@@ -541,9 +541,9 @@
         // r13 sp
         // r14
 
-        ".Y5L01:\n"
+        "3:\n"
         "   cmp r8, r2\n"                   // curOut - maxCurOut
-        "   bcs .Y5L02\n"
+        "   bcs 4f\n"
 
 #define ST_ONE_FRAME \
     "   bic r6, r6, #0xC0000000\n"      /* phaseFraction & ... */\
@@ -577,8 +577,8 @@
     ST_ONE_FRAME    // frame 1
 
         "   cmp r7, r3\n"                       // inputIndex - maxInIdx
-        "   bcc .Y5L01\n"
-        ".Y5L02:\n"
+        "   bcc 3b\n"
+        "4:\n"
 
         "   bic r6, r6, #0xC0000000\n"              // phaseFraction & ...
         // save modified values
diff --git a/services/java/com/android/server/BackupManagerService.java b/services/java/com/android/server/BackupManagerService.java
index 2938c45..6ac6c98 100644
--- a/services/java/com/android/server/BackupManagerService.java
+++ b/services/java/com/android/server/BackupManagerService.java
@@ -34,6 +34,7 @@
 import android.content.ActivityNotFoundException;
 import android.content.BroadcastReceiver;
 import android.content.ComponentName;
+import android.content.ContentResolver;
 import android.content.Context;
 import android.content.Intent;
 import android.content.IntentFilter;
@@ -4765,6 +4766,11 @@
         }
     }
 
+    boolean deviceIsProvisioned() {
+        final ContentResolver resolver = mContext.getContentResolver();
+        return (Settings.Secure.getInt(resolver, Settings.Secure.DEVICE_PROVISIONED, 0) != 0);
+    }
+
     // Run a *full* backup pass for the given package, writing the resulting data stream
     // to the supplied file descriptor.  This method is synchronous and does not return
     // to the caller until the backup has been completed.
@@ -4785,12 +4791,19 @@
             }
         }
 
-        if (DEBUG) Slog.v(TAG, "Requesting full backup: apks=" + includeApks
-                + " shared=" + includeShared + " all=" + doAllApps
-                + " pkgs=" + pkgList);
-
         long oldId = Binder.clearCallingIdentity();
         try {
+            // Doesn't make sense to do a full backup prior to setup
+            if (!deviceIsProvisioned()) {
+                Slog.i(TAG, "Full backup not supported before setup");
+                return;
+            }
+
+            if (DEBUG) Slog.v(TAG, "Requesting full backup: apks=" + includeApks
+                    + " shared=" + includeShared + " all=" + doAllApps
+                    + " pkgs=" + pkgList);
+            Slog.i(TAG, "Beginning full backup...");
+
             FullBackupParams params = new FullBackupParams(fd, includeApks, includeShared,
                     doAllApps, pkgList);
             final int token = generateToken();
@@ -4822,17 +4835,25 @@
                 // just eat it
             }
             Binder.restoreCallingIdentity(oldId);
+            Slog.d(TAG, "Full backup processing complete.");
         }
-        if (MORE_DEBUG) Slog.d(TAG, "Full backup done; returning to caller");
     }
 
     public void fullRestore(ParcelFileDescriptor fd) {
         mContext.enforceCallingPermission(android.Manifest.permission.BACKUP, "fullRestore");
-        Slog.i(TAG, "Beginning full restore...");
 
         long oldId = Binder.clearCallingIdentity();
 
         try {
+            // Check whether the device has been provisioned -- we don't handle
+            // full restores prior to completing the setup process.
+            if (!deviceIsProvisioned()) {
+                Slog.i(TAG, "Full restore not permitted before setup");
+                return;
+            }
+
+            Slog.i(TAG, "Beginning full restore...");
+
             FullRestoreParams params = new FullRestoreParams(fd);
             final int token = generateToken();
             synchronized (mFullConfirmations) {
@@ -4863,7 +4884,7 @@
                 Slog.w(TAG, "Error trying to close fd after full restore: " + e);
             }
             Binder.restoreCallingIdentity(oldId);
-            Slog.i(TAG, "Full restore completed");
+            Slog.i(TAG, "Full restore processing complete.");
         }
     }
 
diff --git a/services/java/com/android/server/PowerManagerService.java b/services/java/com/android/server/PowerManagerService.java
index bb21d81..0934cd0 100644
--- a/services/java/com/android/server/PowerManagerService.java
+++ b/services/java/com/android/server/PowerManagerService.java
@@ -161,7 +161,7 @@
     private int mStayOnConditions = 0;
     private final int[] mBroadcastQueue = new int[] { -1, -1, -1 };
     private final int[] mBroadcastWhy = new int[3];
-    private boolean mBroadcastingScreenOff = false;
+    private boolean mPreparingForScreenOn = false;
     private int mPartialCount = 0;
     private int mPowerState;
     // mScreenOffReason can be WindowManagerPolicy.OFF_BECAUSE_OF_USER,
@@ -1122,7 +1122,8 @@
             pw.println("  mNextTimeout=" + mNextTimeout + " now=" + now
                     + " " + ((mNextTimeout-now)/1000) + "s from now");
             pw.println("  mDimScreen=" + mDimScreen
-                    + " mStayOnConditions=" + mStayOnConditions);
+                    + " mStayOnConditions=" + mStayOnConditions
+                    + " mPreparingForScreenOn=" + mPreparingForScreenOn);
             pw.println("  mScreenOffReason=" + mScreenOffReason
                     + " mUserState=" + mUserState);
             pw.println("  mBroadcastQueue={" + mBroadcastQueue[0] + ',' + mBroadcastQueue[1]
@@ -1341,7 +1342,9 @@
             mBroadcastQueue[0] = on ? 1 : 0;
             mBroadcastQueue[1] = -1;
             mBroadcastQueue[2] = -1;
+            EventLog.writeEvent(EventLogTags.POWER_SCREEN_BROADCAST_STOP, 1, mBroadcastWakeLock.mCount);
             mBroadcastWakeLock.release();
+            EventLog.writeEvent(EventLogTags.POWER_SCREEN_BROADCAST_STOP, 1, mBroadcastWakeLock.mCount);
             mBroadcastWakeLock.release();
             index = 0;
         }
@@ -1371,6 +1374,21 @@
         }
     }
 
+    private WindowManagerPolicy.ScreenOnListener mScreenOnListener =
+            new WindowManagerPolicy.ScreenOnListener() {
+                @Override public void onScreenOn() {
+                    synchronized (mLocks) {
+                        if (mPreparingForScreenOn) {
+                            mPreparingForScreenOn = false;
+                            updateNativePowerStateLocked();
+                            EventLog.writeEvent(EventLogTags.POWER_SCREEN_BROADCAST_STOP,
+                                    4, mBroadcastWakeLock.mCount);
+                            mBroadcastWakeLock.release();
+                        }
+                    }
+                }
+    };
+
     private Runnable mNotificationTask = new Runnable()
     {
         public void run()
@@ -1387,14 +1405,17 @@
                         mBroadcastWhy[i] = mBroadcastWhy[i+1];
                     }
                     policy = getPolicyLocked();
-                    if (value == 0) {
-                        mBroadcastingScreenOff = true;
+                    if (value == 1 && !mPreparingForScreenOn) {
+                        mPreparingForScreenOn = true;
+                        mBroadcastWakeLock.acquire();
+                        EventLog.writeEvent(EventLogTags.POWER_SCREEN_BROADCAST_SEND,
+                                mBroadcastWakeLock.mCount);
                     }
                 }
                 if (value == 1) {
                     mScreenOnStart = SystemClock.uptimeMillis();
 
-                    policy.screenTurnedOn();
+                    policy.screenTurningOn(mScreenOnListener);
                     try {
                         ActivityManagerNative.getDefault().wakingUp();
                     } catch (RemoteException e) {
@@ -1432,7 +1453,6 @@
                         synchronized (mLocks) {
                             EventLog.writeEvent(EventLogTags.POWER_SCREEN_BROADCAST_STOP, 3,
                                     mBroadcastWakeLock.mCount);
-                            mBroadcastingScreenOff = false;
                             updateNativePowerStateLocked();
                             mBroadcastWakeLock.release();
                         }
@@ -1464,10 +1484,6 @@
             synchronized (mLocks) {
                 EventLog.writeEvent(EventLogTags.POWER_SCREEN_BROADCAST_DONE, 0,
                         SystemClock.uptimeMillis() - mScreenOffStart, mBroadcastWakeLock.mCount);
-                synchronized (mLocks) {
-                    mBroadcastingScreenOff = false;
-                    updateNativePowerStateLocked();
-                }
                 mBroadcastWakeLock.release();
             }
         }
@@ -1795,17 +1811,18 @@
     
     private void updateNativePowerStateLocked() {
         if ((mPowerState & SCREEN_ON_BIT) != 0) {
-            // Don't turn screen on if we are currently reporting a screen off.
+            // Don't turn screen on until we know we are really ready to.
             // This is to avoid letting the screen go on before things like the
-            // lock screen have been displayed due to it going off.
-            if (mBroadcastingScreenOff) {
-                // Currently broadcasting that the screen is off.  Don't
-                // allow screen to go on until that is done.
+            // lock screen have been displayed.
+            if (mPreparingForScreenOn) {
+                // Currently waiting for confirmation from the policy that it
+                // is okay to turn on the screen.  Don't allow the screen to go
+                // on until that is done.
                 return;
             }
             for (int i=0; i<mBroadcastQueue.length; i++) {
-                if (mBroadcastQueue[i] == 0) {
-                    // A screen off is currently enqueued.
+                if (mBroadcastQueue[i] == 1) {
+                    // A screen on is currently enqueued.
                     return;
                 }
             }
diff --git a/services/java/com/android/server/WallpaperManagerService.java b/services/java/com/android/server/WallpaperManagerService.java
index 6ceccaf..253e741 100644
--- a/services/java/com/android/server/WallpaperManagerService.java
+++ b/services/java/com/android/server/WallpaperManagerService.java
@@ -120,7 +120,8 @@
                             notifyCallbacksLocked();
                             if (mWallpaperComponent == null || mImageWallpaperPending) {
                                 mImageWallpaperPending = false;
-                                bindWallpaperComponentLocked(mImageWallpaperComponent, true);
+                                bindWallpaperComponentLocked(mImageWallpaperComponent,
+                                        true, false);
                                 saveSettingsLocked();
                             }
                         }
@@ -201,7 +202,7 @@
                     if (!mWallpaperUpdating && (mLastDiedTime+MIN_WALLPAPER_CRASH_TIME)
                                 > SystemClock.uptimeMillis()) {
                         Slog.w(TAG, "Reverting to built-in wallpaper!");
-                        bindWallpaperComponentLocked(null, true);
+                        clearWallpaperLocked(true);
                     }
                 }
             }
@@ -230,12 +231,26 @@
                     mWallpaperUpdating = false;
                     ComponentName comp = mWallpaperComponent;
                     clearWallpaperComponentLocked();
-                    bindWallpaperComponentLocked(comp, false);
+                    if (!bindWallpaperComponentLocked(comp, false, false)) {
+                        Slog.w(TAG, "Wallpaper no longer available; reverting to default");
+                        clearWallpaperLocked(false);
+                    }
                 }
             }
         }
 
         @Override
+        public void onPackageModified(String packageName) {
+            synchronized (mLock) {
+                if (mWallpaperComponent == null ||
+                        !mWallpaperComponent.getPackageName().equals(packageName)) {
+                    return;
+                }
+            }
+            doPackagesChanged(true);
+        }
+
+        @Override
         public void onPackageUpdateStarted(String packageName, int uid) {
             synchronized (mLock) {
                 if (mWallpaperComponent != null &&
@@ -265,7 +280,7 @@
                         changed = true;
                         if (doit) {
                             Slog.w(TAG, "Wallpaper uninstalled, removing: " + mWallpaperComponent);
-                            clearWallpaperLocked();
+                            clearWallpaperLocked(false);
                         }
                     }
                 }
@@ -283,7 +298,7 @@
                                 mWallpaperComponent, 0);
                     } catch (NameNotFoundException e) {
                         Slog.w(TAG, "Wallpaper component gone, removing: " + mWallpaperComponent);
-                        clearWallpaperLocked();
+                        clearWallpaperLocked(false);
                     }
                 }
                 if (mNextWallpaperComponent != null
@@ -321,45 +336,51 @@
     public void systemReady() {
         if (DEBUG) Slog.v(TAG, "systemReady");
         synchronized (mLock) {
+            RuntimeException e = null;
             try {
-                bindWallpaperComponentLocked(mNextWallpaperComponent, false);
-            } catch (RuntimeException e) {
-                Slog.w(TAG, "Failure starting previous wallpaper", e);
-                try {
-                    bindWallpaperComponentLocked(null, false);
-                } catch (RuntimeException e2) {
-                    Slog.w(TAG, "Failure starting default wallpaper", e2);
-                    clearWallpaperComponentLocked();
+                if (bindWallpaperComponentLocked(mNextWallpaperComponent, false, false)) {
+                    return;
                 }
+            } catch (RuntimeException e1) {
+                e = e1;
             }
+            Slog.w(TAG, "Failure starting previous wallpaper", e);
+            clearWallpaperLocked(false);
         }
     }
     
     public void clearWallpaper() {
         if (DEBUG) Slog.v(TAG, "clearWallpaper");
         synchronized (mLock) {
-            clearWallpaperLocked();
+            clearWallpaperLocked(false);
         }
     }
 
-    public void clearWallpaperLocked() {
+    public void clearWallpaperLocked(boolean defaultFailed) {
         File f = WALLPAPER_FILE;
         if (f.exists()) {
             f.delete();
         }
         final long ident = Binder.clearCallingIdentity();
+        RuntimeException e = null;
         try {
             mImageWallpaperPending = false;
-            bindWallpaperComponentLocked(null, false);
-        } catch (IllegalArgumentException e) {
-            // This can happen if the default wallpaper component doesn't
-            // exist.  This should be a system configuration problem, but
-            // let's not let it crash the system and just live with no
-            // wallpaper.
-            Slog.e(TAG, "Default wallpaper component not found!", e);
+            if (bindWallpaperComponentLocked(defaultFailed
+                    ? mImageWallpaperComponent : null, true, false)) {
+                return;
+            }
+        } catch (IllegalArgumentException e1) {
+            e = e1;
         } finally {
             Binder.restoreCallingIdentity(ident);
         }
+        
+        // This can happen if the default wallpaper component doesn't
+        // exist.  This should be a system configuration problem, but
+        // let's not let it crash the system and just live with no
+        // wallpaper.
+        Slog.e(TAG, "Default wallpaper component not found!", e);
+        clearWallpaperComponentLocked();
     }
 
     public void setDimensionHints(int width, int height) throws RemoteException {
@@ -469,14 +490,14 @@
             final long ident = Binder.clearCallingIdentity();
             try {
                 mImageWallpaperPending = false;
-                bindWallpaperComponentLocked(name, false);
+                bindWallpaperComponentLocked(name, false, true);
             } finally {
                 Binder.restoreCallingIdentity(ident);
             }
         }
     }
     
-    void bindWallpaperComponentLocked(ComponentName componentName, boolean force) {
+    boolean bindWallpaperComponentLocked(ComponentName componentName, boolean force, boolean fromUser) {
         if (DEBUG) Slog.v(TAG, "bindWallpaperComponentLocked: componentName=" + componentName);
         
         // Has the component changed?
@@ -486,12 +507,12 @@
                     if (componentName == null) {
                         if (DEBUG) Slog.v(TAG, "bindWallpaperComponentLocked: still using default");
                         // Still using default wallpaper.
-                        return;
+                        return true;
                     }
                 } else if (mWallpaperComponent.equals(componentName)) {
                     // Changing to same wallpaper.
                     if (DEBUG) Slog.v(TAG, "same wallpaper");
-                    return;
+                    return true;
                 }
             }
         }
@@ -516,9 +537,14 @@
             ServiceInfo si = mContext.getPackageManager().getServiceInfo(componentName,
                     PackageManager.GET_META_DATA | PackageManager.GET_PERMISSIONS);
             if (!android.Manifest.permission.BIND_WALLPAPER.equals(si.permission)) {
-                throw new SecurityException("Selected service does not require "
+                String msg = "Selected service does not require "
                         + android.Manifest.permission.BIND_WALLPAPER
-                        + ": " + componentName);
+                        + ": " + componentName;
+                if (fromUser) {
+                    throw new SecurityException(msg);
+                }
+                Slog.w(TAG, msg);
+                return false;
             }
             
             WallpaperInfo wi = null;
@@ -535,16 +561,29 @@
                         try {
                             wi = new WallpaperInfo(mContext, ris.get(i));
                         } catch (XmlPullParserException e) {
-                            throw new IllegalArgumentException(e);
+                            if (fromUser) {
+                                throw new IllegalArgumentException(e);
+                            }
+                            Slog.w(TAG, e);
+                            return false;
                         } catch (IOException e) {
-                            throw new IllegalArgumentException(e);
+                            if (fromUser) {
+                                throw new IllegalArgumentException(e);
+                            }
+                            Slog.w(TAG, e);
+                            return false;
                         }
                         break;
                     }
                 }
                 if (wi == null) {
-                    throw new SecurityException("Selected service is not a wallpaper: "
-                            + componentName);
+                    String msg = "Selected service is not a wallpaper: "
+                            + componentName;
+                    if (fromUser) {
+                        throw new SecurityException(msg);
+                    }
+                    Slog.w(TAG, msg);
+                    return false;
                 }
             }
             
@@ -561,8 +600,13 @@
                             0));
             if (!mContext.bindService(intent, newConn,
                     Context.BIND_AUTO_CREATE)) {
-                throw new IllegalArgumentException("Unable to bind service: "
-                        + componentName);
+                String msg = "Unable to bind service: "
+                        + componentName;
+                if (fromUser) {
+                    throw new IllegalArgumentException(msg);
+                }
+                Slog.w(TAG, msg);
+                return false;
             }
             
             clearWallpaperComponentLocked();
@@ -577,8 +621,14 @@
             }
             
         } catch (PackageManager.NameNotFoundException e) {
-            throw new IllegalArgumentException("Unknown component " + componentName);
+            String msg = "Unknown component " + componentName;
+            if (fromUser) {
+                throw new IllegalArgumentException(msg);
+            }
+            Slog.w(TAG, msg);
+            return false;
         }
+        return true;
     }
     
     void clearWallpaperComponentLocked() {
@@ -611,7 +661,7 @@
         } catch (RemoteException e) {
             Slog.w(TAG, "Failed attaching wallpaper; clearing", e);
             if (!mWallpaperUpdating) {
-                bindWallpaperComponentLocked(null, false);
+                bindWallpaperComponentLocked(null, false, false);
             }
         }
     }
@@ -765,13 +815,11 @@
             loadSettingsLocked();
             if (mNextWallpaperComponent != null && 
                     !mNextWallpaperComponent.equals(mImageWallpaperComponent)) {
-                try {
-                    bindWallpaperComponentLocked(mNextWallpaperComponent, false);
-                } catch (IllegalArgumentException e) {
+                if (!bindWallpaperComponentLocked(mNextWallpaperComponent, false, false)) {
                     // No such live wallpaper or other failure; fall back to the default
                     // live wallpaper (since the profile being restored indicated that the
                     // user had selected a live rather than static one).
-                    bindWallpaperComponentLocked(null, false);
+                    bindWallpaperComponentLocked(null, false, false);
                 }
                 success = true;
             } else {
@@ -786,7 +834,7 @@
                 }
                 if (DEBUG) Slog.v(TAG, "settingsRestored: success=" + success);
                 if (success) {
-                    bindWallpaperComponentLocked(null, false);
+                    bindWallpaperComponentLocked(null, false, false);
                 }
             }
         }
diff --git a/services/java/com/android/server/wm/AppWindowToken.java b/services/java/com/android/server/wm/AppWindowToken.java
index bfa2b39..61c96bb 100644
--- a/services/java/com/android/server/wm/AppWindowToken.java
+++ b/services/java/com/android/server/wm/AppWindowToken.java
@@ -194,7 +194,7 @@
 
     // This must be called while inside a transaction.
     boolean stepAnimationLocked(long currentTime, int dw, int dh) {
-        if (!service.mDisplayFrozen && service.mPolicy.isScreenOn()) {
+        if (!service.mDisplayFrozen && service.mPolicy.isScreenOnFully()) {
             // We will run animations as long as the display isn't frozen.
 
             if (animation == WindowManagerService.sDummyAnimation) {
diff --git a/services/java/com/android/server/wm/WindowManagerService.java b/services/java/com/android/server/wm/WindowManagerService.java
index 609016b..ff75cfd 100644
--- a/services/java/com/android/server/wm/WindowManagerService.java
+++ b/services/java/com/android/server/wm/WindowManagerService.java
@@ -73,6 +73,7 @@
 import android.os.Debug;
 import android.os.Handler;
 import android.os.IBinder;
+import android.os.IRemoteCallback;
 import android.os.LocalPowerManager;
 import android.os.Looper;
 import android.os.Message;
@@ -91,6 +92,7 @@
 import android.util.DisplayMetrics;
 import android.util.EventLog;
 import android.util.Log;
+import android.util.Pair;
 import android.util.Slog;
 import android.util.SparseIntArray;
 import android.util.TypedValue;
@@ -384,6 +386,12 @@
     ArrayList<WindowState> mForceRemoves;
 
     /**
+     * Windows that clients are waiting to have drawn.
+     */
+    ArrayList<Pair<WindowState, IRemoteCallback>> mWaitingForDrawn
+            = new ArrayList<Pair<WindowState, IRemoteCallback>>();
+
+    /**
      * Used when rebuilding window list to keep track of windows that have
      * been removed.
      */
@@ -2191,7 +2199,8 @@
         // to hold off on removing the window until the animation is done.
         // If the display is frozen, just remove immediately, since the
         // animation wouldn't be seen.
-        if (win.mSurface != null && !mDisplayFrozen && mDisplayEnabled && mPolicy.isScreenOn()) {
+        if (win.mSurface != null && !mDisplayFrozen && mDisplayEnabled
+                && mPolicy.isScreenOnFully()) {
             // If we are not currently running the exit animation, we
             // need to see about starting one.
             if (wasVisible=win.isWinVisibleLw()) {
@@ -2569,7 +2578,7 @@
                 if (displayed) {
                     if (win.mSurface != null && !win.mDrawPending
                             && !win.mCommitDrawPending && !mDisplayFrozen
-                            && mDisplayEnabled && mPolicy.isScreenOn()) {
+                            && mDisplayEnabled && mPolicy.isScreenOnFully()) {
                         applyEnterAnimationLocked(win);
                     }
                     if ((win.mAttrs.flags
@@ -2862,7 +2871,7 @@
         // frozen, there is no reason to animate and it can cause strange
         // artifacts when we unfreeze the display if some different animation
         // is running.
-        if (!mDisplayFrozen && mDisplayEnabled && mPolicy.isScreenOn()) {
+        if (!mDisplayFrozen && mDisplayEnabled && mPolicy.isScreenOnFully()) {
             int anim = mPolicy.selectAnimationLw(win, transit);
             int attr = -1;
             Animation a = null;
@@ -2948,7 +2957,7 @@
         // frozen, there is no reason to animate and it can cause strange
         // artifacts when we unfreeze the display if some different animation
         // is running.
-        if (!mDisplayFrozen && mDisplayEnabled && mPolicy.isScreenOn()) {
+        if (!mDisplayFrozen && mDisplayEnabled && mPolicy.isScreenOnFully()) {
             Animation a;
             if (mNextAppTransitionPackage != null) {
                 a = loadAnimation(mNextAppTransitionPackage, enter ?
@@ -3514,7 +3523,7 @@
             if (DEBUG_APP_TRANSITIONS) Slog.v(
                     TAG, "Prepare app transition: transit=" + transit
                     + " mNextAppTransition=" + mNextAppTransition);
-            if (!mDisplayFrozen && mDisplayEnabled && mPolicy.isScreenOn()) {
+            if (!mDisplayFrozen && mDisplayEnabled && mPolicy.isScreenOnFully()) {
                 if (mNextAppTransition == WindowManagerPolicy.TRANSIT_UNSET
                         || mNextAppTransition == WindowManagerPolicy.TRANSIT_NONE) {
                     mNextAppTransition = transit;
@@ -3598,7 +3607,7 @@
             // If the display is frozen, we won't do anything until the
             // actual window is displayed so there is no reason to put in
             // the starting window.
-            if (mDisplayFrozen || !mDisplayEnabled || !mPolicy.isScreenOn()) {
+            if (mDisplayFrozen || !mDisplayEnabled || !mPolicy.isScreenOnFully()) {
                 return;
             }
 
@@ -3880,7 +3889,7 @@
 
             // If we are preparing an app transition, then delay changing
             // the visibility of this token until we execute that transition.
-            if (!mDisplayFrozen && mDisplayEnabled && mPolicy.isScreenOn()
+            if (!mDisplayFrozen && mDisplayEnabled && mPolicy.isScreenOnFully()
                     && mNextAppTransition != WindowManagerPolicy.TRANSIT_UNSET) {
                 // Already in requested state, don't do anything more.
                 if (wtoken.hiddenRequested != visible) {
@@ -4008,7 +4017,7 @@
         }
 
         synchronized(mWindowMap) {
-            if (configChanges == 0 && !mDisplayFrozen && mPolicy.isScreenOn()) {
+            if (configChanges == 0 && !mDisplayFrozen && mPolicy.isScreenOnFully()) {
                 if (DEBUG_ORIENTATION) Slog.v(TAG, "Skipping set freeze of " + token);
                 return;
             }
@@ -5723,9 +5732,9 @@
             unrotDh = dh;
         }
         int sw = reduceConfigWidthSize(unrotDw, Surface.ROTATION_0, density, unrotDw, unrotDh);
-        sw = reduceConfigWidthSize(sw, Surface.ROTATION_90, density, unrotDw, unrotDh);
+        sw = reduceConfigWidthSize(sw, Surface.ROTATION_90, density, unrotDh, unrotDw);
         sw = reduceConfigWidthSize(sw, Surface.ROTATION_180, density, unrotDw, unrotDh);
-        sw = reduceConfigWidthSize(sw, Surface.ROTATION_270, density, unrotDw, unrotDh);
+        sw = reduceConfigWidthSize(sw, Surface.ROTATION_270, density, unrotDh, unrotDw);
         return sw;
     }
 
@@ -6295,6 +6304,7 @@
         public static final int DRAG_END_TIMEOUT = 21;
         public static final int REPORT_HARD_KEYBOARD_STATUS_CHANGE = 22;
         public static final int BOOT_TIMEOUT = 23;
+        public static final int WAITING_FOR_DRAWN_TIMEOUT = 24;
 
         private Session mLastReportedHold;
 
@@ -6605,11 +6615,6 @@
                     break;
                 }
 
-                case BOOT_TIMEOUT: {
-                    performBootTimeout();
-                    break;
-                }
-
                 case APP_FREEZE_TIMEOUT: {
                     synchronized (mWindowMap) {
                         Slog.w(TAG, "App freeze timeout expired.");
@@ -6678,6 +6683,27 @@
                     notifyHardKeyboardStatusChange();
                     break;
                 }
+
+                case BOOT_TIMEOUT: {
+                    performBootTimeout();
+                    break;
+                }
+
+                case WAITING_FOR_DRAWN_TIMEOUT: {
+                    Pair<WindowState, IRemoteCallback> pair;
+                    synchronized (mWindowMap) {
+                        pair = (Pair<WindowState, IRemoteCallback>)msg.obj;
+                        Slog.w(TAG, "Timeout waiting for drawn: " + pair.first);
+                        if (!mWaitingForDrawn.remove(pair)) {
+                            return;
+                        }
+                    }
+                    try {
+                        pair.second.sendResult(null);
+                    } catch (RemoteException e) {
+                    }
+                    break;
+                }
             }
         }
     }
@@ -8112,10 +8138,10 @@
 
                             w.mLastContentInsets.set(w.mContentInsets);
                             w.mLastVisibleInsets.set(w.mVisibleInsets);
-                            // If the screen is currently frozen, then keep
-                            // it frozen until this window draws at its new
+                            // If the screen is currently frozen or off, then keep
+                            // it frozen/off until this window draws at its new
                             // orientation.
-                            if (mDisplayFrozen) {
+                            if (mDisplayFrozen || !mPolicy.isScreenOnFully()) {
                                 if (DEBUG_ORIENTATION) Slog.v(TAG,
                                         "Resizing while display frozen: " + w);
                                 w.mOrientationChanging = true;
@@ -8383,7 +8409,7 @@
 
             if (mDimAnimator != null && mDimAnimator.mDimShown) {
                 animating |= mDimAnimator.updateSurface(dimming, currentTime,
-                        mDisplayFrozen || !mDisplayEnabled || !mPolicy.isScreenOn());
+                        mDisplayFrozen || !mDisplayEnabled || !mPolicy.isScreenOnFully());
             }
 
             if (!blurring && mBlurShown) {
@@ -8579,42 +8605,61 @@
                     WindowManagerPolicy.USE_LAST_ROTATION, 0, false);
             if (changed) {
                 mH.sendEmptyMessage(H.SEND_NEW_CONFIGURATION);
+            } else {
+                updateRotation = false;
             }
         }
 
-        mWindowMap.notifyAll();
+        if (orientationChangeComplete && !needRelayout && !updateRotation) {
+            checkDrawnWindowsLocked();
+        }
 
         // Check to see if we are now in a state where the screen should
         // be enabled, because the window obscured flags have changed.
         enableScreenIfNeededLocked();
     }
 
-    public void waitForAllDrawn() {
+    void checkDrawnWindowsLocked() {
+        if (mWaitingForDrawn.size() > 0) {
+            for (int j=mWaitingForDrawn.size()-1; j>=0; j--) {
+                Pair<WindowState, IRemoteCallback> pair = mWaitingForDrawn.get(j);
+                WindowState win = pair.first;
+                //Slog.i(TAG, "Waiting for drawn " + win + ": removed="
+                //        + win.mRemoved + " visible=" + win.isVisibleLw()
+                //        + " shown=" + win.mSurfaceShown);
+                if (win.mRemoved || !win.isVisibleLw()) {
+                    // Window has been removed or made invisible; no draw
+                    // will now happen, so stop waiting.
+                    Slog.w(TAG, "Aborted waiting for drawn: " + pair.first);
+                    try {
+                        pair.second.sendResult(null);
+                    } catch (RemoteException e) {
+                    }
+                    mWaitingForDrawn.remove(pair);
+                    mH.removeMessages(H.WAITING_FOR_DRAWN_TIMEOUT, pair);
+                } else if (win.mSurfaceShown) {
+                    // Window is now drawn (and shown).
+                    try {
+                        pair.second.sendResult(null);
+                    } catch (RemoteException e) {
+                    }
+                    mWaitingForDrawn.remove(pair);
+                    mH.removeMessages(H.WAITING_FOR_DRAWN_TIMEOUT, pair);
+                }
+            }
+        }
+    }
+
+    public void waitForWindowDrawn(IBinder token, IRemoteCallback callback) {
         synchronized (mWindowMap) {
-            while (true) {
-                final int N = mWindows.size();
-                boolean okay = true;
-                for (int i=0; i<N && okay; i++) {
-                    WindowState w = mWindows.get(i);
-                    if (DEBUG_SCREEN_ON) {
-                        Slog.i(TAG, "Window " + w + " vis=" + w.isVisibleLw()
-                                + " obscured=" + w.mObscured + " drawn=" + w.isDrawnLw());
-                    }
-                    if (w.isVisibleLw() && !w.mObscured && !w.isDrawnLw()) {
-                        if (DEBUG_SCREEN_ON) {
-                            Slog.i(TAG, "Window not yet drawn: " + w);
-                        }
-                        okay = false;
-                        break;
-                    }
-                }
-                if (okay) {
-                    return;
-                }
-                try {
-                    mWindowMap.wait();
-                } catch (InterruptedException e) {
-                }
+            WindowState win = windowForClientLocked(null, token, true);
+            if (win != null) {
+                Pair<WindowState, IRemoteCallback> pair =
+                        new Pair<WindowState, IRemoteCallback>(win, callback);
+                Message m = mH.obtainMessage(H.WAITING_FOR_DRAWN_TIMEOUT, pair);
+                mH.sendMessageDelayed(m, 2000);
+                mWaitingForDrawn.add(pair);
+                checkDrawnWindowsLocked();
             }
         }
     }
@@ -8885,7 +8930,7 @@
             return;
         }
 
-        if (mDisplay == null || !mPolicy.isScreenOn()) {
+        if (mDisplay == null || !mPolicy.isScreenOnFully()) {
             // No need to freeze the screen before the system is ready or if
             // the screen is off.
             return;
@@ -9284,6 +9329,15 @@
                 }
             }
         }
+        if (mWaitingForDrawn.size() > 0) {
+            pw.println();
+            pw.println("  Clients waiting for these windows to be drawn:");
+            for (int i=mWaitingForDrawn.size()-1; i>=0; i--) {
+                Pair<WindowState, IRemoteCallback> pair = mWaitingForDrawn.get(i);
+                pw.print("  Waiting #"); pw.print(i); pw.print(' '); pw.print(pair.first);
+                        pw.print(": "); pw.println(pair.second);
+            }
+        }
         pw.println();
         if (mDisplay != null) {
             pw.print("  Display: init="); pw.print(mInitialDisplayWidth); pw.print("x");
diff --git a/services/java/com/android/server/wm/WindowState.java b/services/java/com/android/server/wm/WindowState.java
index 0ee3f17..455d6649 100644
--- a/services/java/com/android/server/wm/WindowState.java
+++ b/services/java/com/android/server/wm/WindowState.java
@@ -870,7 +870,7 @@
     // This must be called while inside a transaction.  Returns true if
     // there is more animation to run.
     boolean stepAnimationLocked(long currentTime, int dw, int dh) {
-        if (!mService.mDisplayFrozen && mService.mPolicy.isScreenOn()) {
+        if (!mService.mDisplayFrozen && mService.mPolicy.isScreenOnFully()) {
             // We will run animations as long as the display isn't frozen.
 
             if (!mDrawPending && !mCommitDrawPending && mAnimation != null) {
@@ -1101,7 +1101,20 @@
             final Matrix tmpMatrix = mTmpMatrix;
 
             // Compute the desired transformation.
-            tmpMatrix.setTranslate(0, 0);
+            if (screenAnimation) {
+                // If we are doing a screen animation, the global rotation
+                // applied to windows can result in windows that are carefully
+                // aligned with each other to slightly separate, allowing you
+                // to see what is behind them.  An unsightly mess.  This...
+                // thing...  magically makes it call good: scale each window
+                // slightly (two pixels larger in each dimension, from the
+                // window's center).
+                final float w = frame.width();
+                final float h = frame.height();
+                tmpMatrix.setScale(1 + 2/w, 1 + 2/h, w/2, h/2);
+            } else {
+                tmpMatrix.reset();
+            }
             tmpMatrix.postScale(mGlobalScale, mGlobalScale);
             if (selfTransformation) {
                 tmpMatrix.postConcat(mTransformation.getMatrix());
@@ -1204,11 +1217,18 @@
      * mPolicyVisibility.  Ungh.
      */
     public boolean isVisibleOrBehindKeyguardLw() {
+        if (mRootToken.waitingToShow &&
+                mService.mNextAppTransition != WindowManagerPolicy.TRANSIT_UNSET) {
+            return false;
+        }
         final AppWindowToken atoken = mAppToken;
-        return mSurface != null && !mAttachedHidden
+        final boolean animating = atoken != null
+                ? (atoken.animation != null) : false;
+        return mSurface != null && !mDestroying && !mExiting
                 && (atoken == null ? mPolicyVisibility : !atoken.hiddenRequested)
-                && !mDrawPending && !mCommitDrawPending
-                && !mExiting && !mDestroying;
+                && ((!mAttachedHidden && mViewVisibility == View.VISIBLE
+                                && !mRootToken.hidden)
+                        || mAnimation != null || animating);
     }
 
     /**
@@ -1351,7 +1371,7 @@
                 && (mFrame.top != mLastFrame.top
                         || mFrame.left != mLastFrame.left)
                 && (mAttachedWindow == null || !mAttachedWindow.shouldAnimateMove())
-                && mService.mPolicy.isScreenOn();
+                && mService.mPolicy.isScreenOnFully();
     }
 
     boolean isFullscreen(int screenWidth, int screenHeight) {
@@ -1436,7 +1456,7 @@
         if (doAnimation) {
             if (DEBUG_VISIBILITY) Slog.v(WindowManagerService.TAG, "doAnimation: mPolicyVisibility="
                     + mPolicyVisibility + " mAnimation=" + mAnimation);
-            if (mService.mDisplayFrozen || !mService.mPolicy.isScreenOn()) {
+            if (mService.mDisplayFrozen || !mService.mPolicy.isScreenOnFully()) {
                 doAnimation = false;
             } else if (mPolicyVisibility && mAnimation == null) {
                 // Check for the case where we are currently visible and
@@ -1462,7 +1482,7 @@
 
     boolean hideLw(boolean doAnimation, boolean requestAnim) {
         if (doAnimation) {
-            if (mService.mDisplayFrozen || !mService.mPolicy.isScreenOn()) {
+            if (mService.mDisplayFrozen || !mService.mPolicy.isScreenOnFully()) {
                 doAnimation = false;
             }
         }
diff --git a/services/surfaceflinger/Layer.cpp b/services/surfaceflinger/Layer.cpp
index edbc7b0..f85ce7f 100644
--- a/services/surfaceflinger/Layer.cpp
+++ b/services/surfaceflinger/Layer.cpp
@@ -404,7 +404,9 @@
 void Layer::lockPageFlip(bool& recomputeVisibleRegions)
 {
     if (mQueuedFrames > 0) {
+        // Capture the old state of the layer for comparisons later
         const bool oldOpacity = isOpaque();
+        sp<GraphicBuffer> oldActiveBuffer = mActiveBuffer;
 
         // signal another event if we have more frames pending
         if (android_atomic_dec(&mQueuedFrames) > 1) {
@@ -417,7 +419,8 @@
             return;
         }
 
-        sp<GraphicBuffer> newFrontBuffer(mSurfaceTexture->getCurrentBuffer());
+        // update the active buffer
+        mActiveBuffer = mSurfaceTexture->getCurrentBuffer();
 
         const Rect crop(mSurfaceTexture->getCurrentCrop());
         const uint32_t transform(mSurfaceTexture->getCurrentTransform());
@@ -439,16 +442,16 @@
             mFlinger->invalidateHwcGeometry();
         }
 
-        uint32_t bufWidth  = newFrontBuffer->getWidth();
-        uint32_t bufHeight = newFrontBuffer->getHeight();
-        if (mActiveBuffer != NULL) {
-            if (bufWidth != uint32_t(mActiveBuffer->width) ||
-                bufHeight != uint32_t(mActiveBuffer->height)) {
+        uint32_t bufWidth  = mActiveBuffer->getWidth();
+        uint32_t bufHeight = mActiveBuffer->getHeight();
+        if (oldActiveBuffer != NULL) {
+            if (bufWidth != uint32_t(oldActiveBuffer->width) ||
+                bufHeight != uint32_t(oldActiveBuffer->height)) {
                 mFlinger->invalidateHwcGeometry();
             }
         }
 
-        mCurrentOpacity = getOpacityForFormat(newFrontBuffer->format);
+        mCurrentOpacity = getOpacityForFormat(mActiveBuffer->format);
         if (oldOpacity != isOpaque()) {
             recomputeVisibleRegions = true;
         }
@@ -462,9 +465,6 @@
         // FIXME: mPostedDirtyRegion = dirty & bounds
         mPostedDirtyRegion.set(front.w, front.h);
 
-        // update active buffer
-        mActiveBuffer = newFrontBuffer;
-
         if ((front.w != front.requested_w) ||
             (front.h != front.requested_h))
         {
diff --git a/services/tests/servicestests/src/com/android/server/NetworkManagementServiceTest.java b/services/tests/servicestests/src/com/android/server/NetworkManagementServiceTest.java
index 2a25866..ab1597c 100644
--- a/services/tests/servicestests/src/com/android/server/NetworkManagementServiceTest.java
+++ b/services/tests/servicestests/src/com/android/server/NetworkManagementServiceTest.java
@@ -21,7 +21,6 @@
 import static android.net.NetworkStats.TAG_NONE;
 import static android.net.NetworkStats.UID_ALL;
 import static com.android.server.NetworkManagementSocketTagger.kernelToTag;
-import static com.android.server.NetworkManagementSocketTagger.tagToKernel;
 
 import android.content.res.Resources;
 import android.net.NetworkStats;
@@ -144,12 +143,6 @@
     }
 
     public void testKernelTags() throws Exception {
-        assertEquals("0", tagToKernel(0x0));
-        assertEquals("214748364800", tagToKernel(0x32));
-        assertEquals("9223372032559808512", tagToKernel(Integer.MAX_VALUE));
-        assertEquals("0", tagToKernel(Integer.MIN_VALUE));
-        assertEquals("9223369837831520256", tagToKernel(Integer.MIN_VALUE - 512));
-
         assertEquals(0, kernelToTag("0x0000000000000000"));
         assertEquals(0x32, kernelToTag("0x0000003200000000"));
         assertEquals(2147483647, kernelToTag("0x7fffffff00000000"));
diff --git a/telephony/java/android/telephony/PhoneNumberUtils.java b/telephony/java/android/telephony/PhoneNumberUtils.java
index e898aac..3e8d255 100644
--- a/telephony/java/android/telephony/PhoneNumberUtils.java
+++ b/telephony/java/android/telephony/PhoneNumberUtils.java
@@ -24,6 +24,7 @@
 import android.content.Context;
 import android.content.Intent;
 import android.database.Cursor;
+import android.location.CountryDetector;
 import android.net.Uri;
 import android.os.SystemProperties;
 import android.provider.Contacts;
@@ -1573,6 +1574,32 @@
     }
 
     /**
+     * Checks if a given number is an emergency number for the country that the user is in. The
+     * current country is determined using the CountryDetector.
+     *
+     * @param number the number to look up.
+     * @param context the specific context which the number should be checked against
+     * @return if a phone number is an emergency number for a local country, based on the
+     * CountryDetector.
+     * @see android.location.CountryDetector
+     * @hide
+     */
+    public static boolean isLocalEmergencyNumber(String number, Context context) {
+        String countryIso;
+        CountryDetector detector = (CountryDetector) context.getSystemService(
+                Context.COUNTRY_DETECTOR);
+        if (detector != null) {
+            countryIso = detector.detectCountry().getCountryIso();
+        } else {
+            Locale locale = context.getResources().getConfiguration().locale;
+            countryIso = locale.getCountry();
+            Log.w(LOG_TAG, "No CountryDetector; falling back to countryIso based on locale: "
+                    + countryIso);
+        }
+        return isEmergencyNumber(number, countryIso);
+    }
+
+    /**
      * isVoiceMailNumber: checks a given number against the voicemail
      *   number provided by the RIL and SIM card. The caller must have
      *   the READ_PHONE_STATE credential.
diff --git a/telephony/java/com/android/internal/telephony/CallerInfo.java b/telephony/java/com/android/internal/telephony/CallerInfo.java
index 7c37a65..6324550 100644
--- a/telephony/java/com/android/internal/telephony/CallerInfo.java
+++ b/telephony/java/com/android/internal/telephony/CallerInfo.java
@@ -254,9 +254,7 @@
         // Change the callerInfo number ONLY if it is an emergency number
         // or if it is the voicemail number.  If it is either, take a
         // shortcut and skip the query.
-        Locale locale = context.getResources().getConfiguration().locale;
-        String countryIso = getCurrentCountryIso(context, locale);
-        if (PhoneNumberUtils.isEmergencyNumber(number, countryIso)) {
+        if (PhoneNumberUtils.isLocalEmergencyNumber(number, context)) {
             return new CallerInfo().markAsEmergency(context);
         } else if (PhoneNumberUtils.isVoiceMailNumber(number)) {
             return new CallerInfo().markAsVoiceMail();
diff --git a/telephony/java/com/android/internal/telephony/CallerInfoAsyncQuery.java b/telephony/java/com/android/internal/telephony/CallerInfoAsyncQuery.java
index 17734ca..4912749 100644
--- a/telephony/java/com/android/internal/telephony/CallerInfoAsyncQuery.java
+++ b/telephony/java/com/android/internal/telephony/CallerInfoAsyncQuery.java
@@ -403,9 +403,7 @@
         cw.number = number;
 
         // check to see if these are recognized numbers, and use shortcuts if we can.
-        CountryDetector detector = (CountryDetector) context.getSystemService(
-            Context.COUNTRY_DETECTOR);
-        if (PhoneNumberUtils.isEmergencyNumber(number, detector.detectCountry().getCountryIso())) {
+        if (PhoneNumberUtils.isLocalEmergencyNumber(number, context)) {
             cw.event = EVENT_EMERGENCY_NUMBER;
         } else if (PhoneNumberUtils.isVoiceMailNumber(number)) {
             cw.event = EVENT_VOICEMAIL_NUMBER;
diff --git a/telephony/java/com/android/internal/telephony/cdma/CdmaCallTracker.java b/telephony/java/com/android/internal/telephony/cdma/CdmaCallTracker.java
index db19321..83efc51 100644
--- a/telephony/java/com/android/internal/telephony/cdma/CdmaCallTracker.java
+++ b/telephony/java/com/android/internal/telephony/cdma/CdmaCallTracker.java
@@ -190,7 +190,8 @@
 
         String inEcm=SystemProperties.get(TelephonyProperties.PROPERTY_INECM_MODE, "false");
         boolean isPhoneInEcmMode = inEcm.equals("true");
-        boolean isEmergencyCall = PhoneNumberUtils.isEmergencyNumber(dialString);
+        boolean isEmergencyCall =
+                PhoneNumberUtils.isLocalEmergencyNumber(dialString, phone.getContext());
 
         // Cancel Ecm timer if a second emergency call is originating in Ecm mode
         if (isPhoneInEcmMode && isEmergencyCall) {
@@ -1059,7 +1060,7 @@
      * Disable data call when emergency call is connected
      */
     private void disableDataCallInEmergencyCall(String dialString) {
-        if (PhoneNumberUtils.isEmergencyNumber(dialString)) {
+        if (PhoneNumberUtils.isLocalEmergencyNumber(dialString, phone.getContext())) {
             if (Phone.DEBUG_PHONE) log("disableDataCallInEmergencyCall");
             mIsInEmergencyCall = true;
             phone.mDataConnectionTracker.setInternalDataEnabled(false);
diff --git a/telephony/java/com/android/internal/telephony/gsm/GsmMmiCode.java b/telephony/java/com/android/internal/telephony/gsm/GsmMmiCode.java
index 680b3cd..3799894 100644
--- a/telephony/java/com/android/internal/telephony/gsm/GsmMmiCode.java
+++ b/telephony/java/com/android/internal/telephony/gsm/GsmMmiCode.java
@@ -496,7 +496,7 @@
             return false;
         }
 
-        if (PhoneNumberUtils.isEmergencyNumber(dialString)) {
+        if (PhoneNumberUtils.isLocalEmergencyNumber(dialString, phone.getContext())) {
             return false;
         } else {
             return isShortCodeUSSD(dialString, phone);
diff --git a/test-runner/src/android/test/InstrumentationTestRunner.java b/test-runner/src/android/test/InstrumentationTestRunner.java
index c3d09ff..70cf89e 100644
--- a/test-runner/src/android/test/InstrumentationTestRunner.java
+++ b/test-runner/src/android/test/InstrumentationTestRunner.java
@@ -279,6 +279,7 @@
     private static final String LOG_TAG = "InstrumentationTestRunner";
 
     private final Bundle mResults = new Bundle();
+    private Bundle mArguments;
     private AndroidTestRunner mTestRunner;
     private boolean mDebug;
     private boolean mJustCount;
@@ -292,6 +293,7 @@
     @Override
     public void onCreate(Bundle arguments) {
         super.onCreate(arguments);
+        mArguments = arguments;
 
         // Apk paths used to search for test classes when using TestSuiteBuilders.
         String[] apkPaths =
@@ -379,6 +381,16 @@
         start();
     }
 
+    /**
+     * Get the Bundle object that contains the arguments
+     *
+     * @return the Bundle object
+     * @hide
+     */
+    public Bundle getBundle(){
+        return mArguments;
+    }
+
     List<Predicate<TestMethod>> getBuilderRequirements() {
         return new ArrayList<Predicate<TestMethod>>();
     }
diff --git a/tests/DataIdleTest/src/com/android/tests/dataidle/DataIdleTest.java b/tests/DataIdleTest/src/com/android/tests/dataidle/DataIdleTest.java
index 54adc249..b803b98 100644
--- a/tests/DataIdleTest/src/com/android/tests/dataidle/DataIdleTest.java
+++ b/tests/DataIdleTest/src/com/android/tests/dataidle/DataIdleTest.java
@@ -72,6 +72,7 @@
      */
     private void fetchStats(NetworkTemplate template) {
         try {
+            mStatsService.forceUpdate();
             NetworkStats stats = mStatsService.getSummaryForAllUid(template, Long.MIN_VALUE,
                     Long.MAX_VALUE, false);
             reportStats(stats);
diff --git a/tests/DumpRenderTree/src/com/android/dumprendertree/TestShellActivity.java b/tests/DumpRenderTree/src/com/android/dumprendertree/TestShellActivity.java
index f8c32dd..4ba2e18 100644
--- a/tests/DumpRenderTree/src/com/android/dumprendertree/TestShellActivity.java
+++ b/tests/DumpRenderTree/src/com/android/dumprendertree/TestShellActivity.java
@@ -286,11 +286,23 @@
         mWebView.stopLoading();
     }
 
+
+    //TODO: remove. this is temporary for bug investigation
+    @Override
+    public void finish() {
+      Exception e = new Exception("finish() call stack");
+      Log.d(LOGTAG, "finish stack trace", e);
+      super.finish();
+    }
+
     @Override
     protected void onDestroy() {
-        super.onDestroy();
+        //TODO: remove exception log. this is temporary for bug investigation
+        Exception e = new Exception("onDestroy stack trace");
+        Log.d(LOGTAG, "onDestroy stack trace", e);
         mWebView.destroy();
         mWebView = null;
+        super.onDestroy();
     }
 
     @Override
diff --git a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgeWindowManager.java b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgeWindowManager.java
index ed29a78..3d1fa7a 100644
--- a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgeWindowManager.java
+++ b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgeWindowManager.java
@@ -24,6 +24,7 @@
 import android.graphics.Bitmap;
 import android.graphics.Point;
 import android.os.IBinder;
+import android.os.IRemoteCallback;
 import android.os.RemoteException;
 import android.util.DisplayMetrics;
 import android.view.Display;
@@ -451,7 +452,7 @@
         return 0;
     }
 
-    public void waitForAllDrawn() {
+    public void waitForWindowDrawn(IBinder token, IRemoteCallback callback) {
         // TODO Auto-generated method stub
     }