Merge "Clarify docs for PopupWindow width/height parameters" into nyc-dev
diff --git a/Android.mk b/Android.mk
index 795878b..c2d3987 100644
--- a/Android.mk
+++ b/Android.mk
@@ -1119,6 +1119,9 @@
 		-showAnnotation android.annotation.SystemApi \
 		-title "Android SDK - Including system APIs." \
 		-toroot / \
+		-hide 101 \
+		-hide 104 \
+		-hide 108 \
 		-hdf android.whichdoc online \
 		$(sample_groups) \
 		-hdf android.hasSamples true \
diff --git a/api/current.txt b/api/current.txt
index 3bd607b..4f12ad4 100644
--- a/api/current.txt
+++ b/api/current.txt
@@ -40820,8 +40820,11 @@
     field public static final android.os.Parcelable.Creator<android.view.Display.Mode> CREATOR;
   }
 
-  public final class DragAndDropPermissions {
+  public final class DragAndDropPermissions implements android.os.Parcelable {
+    method public int describeContents();
     method public void release();
+    method public void writeToParcel(android.os.Parcel, int);
+    field public static final android.os.Parcelable.Creator<android.view.DragAndDropPermissions> CREATOR;
   }
 
   public class DragEvent implements android.os.Parcelable {
diff --git a/api/system-current.txt b/api/system-current.txt
index 8240407..ea2707e 100644
--- a/api/system-current.txt
+++ b/api/system-current.txt
@@ -43819,8 +43819,11 @@
     field public static final android.os.Parcelable.Creator<android.view.Display.Mode> CREATOR;
   }
 
-  public final class DragAndDropPermissions {
+  public final class DragAndDropPermissions implements android.os.Parcelable {
+    method public int describeContents();
     method public void release();
+    method public void writeToParcel(android.os.Parcel, int);
+    field public static final android.os.Parcelable.Creator<android.view.DragAndDropPermissions> CREATOR;
   }
 
   public class DragEvent implements android.os.Parcelable {
diff --git a/api/test-current.txt b/api/test-current.txt
index 8425e90..a70e9e3 100644
--- a/api/test-current.txt
+++ b/api/test-current.txt
@@ -40899,8 +40899,11 @@
     field public static final android.os.Parcelable.Creator<android.view.Display.Mode> CREATOR;
   }
 
-  public final class DragAndDropPermissions {
+  public final class DragAndDropPermissions implements android.os.Parcelable {
+    method public int describeContents();
     method public void release();
+    method public void writeToParcel(android.os.Parcel, int);
+    field public static final android.os.Parcelable.Creator<android.view.DragAndDropPermissions> CREATOR;
   }
 
   public class DragEvent implements android.os.Parcelable {
diff --git a/cmds/bmgr/src/com/android/commands/bmgr/Bmgr.java b/cmds/bmgr/src/com/android/commands/bmgr/Bmgr.java
index 69b5a17..5bf8076 100644
--- a/cmds/bmgr/src/com/android/commands/bmgr/Bmgr.java
+++ b/cmds/bmgr/src/com/android/commands/bmgr/Bmgr.java
@@ -122,6 +122,11 @@
             return;
         }
 
+        if ("whitelist".equals(op)) {
+            doPrintWhitelist();
+            return;
+        }
+
         System.err.println("Unknown command");
         showUsage();
     }
@@ -604,6 +609,20 @@
         }
     }
 
+    private void doPrintWhitelist() {
+        try {
+            final String[] whitelist = mBmgr.getTransportWhitelist();
+            if (whitelist != null) {
+                for (String transport : whitelist) {
+                    System.out.println(transport);
+                }
+            }
+        } catch (RemoteException e) {
+            System.err.println(e.toString());
+            System.err.println(BMGR_NOT_RUNNING_ERR);
+        }
+    }
+
     private String nextArg() {
         if (mNextArg >= mArgs.length) {
             return null;
diff --git a/cmds/pm/src/com/android/commands/pm/Pm.java b/cmds/pm/src/com/android/commands/pm/Pm.java
index 4470eda..c6834f9 100644
--- a/cmds/pm/src/com/android/commands/pm/Pm.java
+++ b/cmds/pm/src/com/android/commands/pm/Pm.java
@@ -254,6 +254,10 @@
             return runMovePrimaryStorage();
         }
 
+        if ("set-user-restriction".equals(op)) {
+            return runSetUserRestriction();
+        }
+
         try {
             if (args.length == 1) {
                 if (args[0].equalsIgnoreCase("-l")) {
@@ -1054,6 +1058,38 @@
         }
     }
 
+    public int runSetUserRestriction() {
+        int userId = UserHandle.USER_SYSTEM;
+        String opt = nextOption();
+        if (opt != null && "--user".equals(opt)) {
+            String arg = nextArg();
+            if (arg == null || !isNumber(arg)) {
+                System.err.println("Error: valid userId not specified");
+                return 1;
+            }
+            userId = Integer.parseInt(arg);
+        }
+
+        String restriction = nextArg();
+        String arg = nextArg();
+        boolean value;
+        if ("1".equals(arg)) {
+            value = true;
+        } else if ("0".equals(arg)) {
+            value = false;
+        } else {
+            System.err.println("Error: valid value not specified");
+            return 1;
+        }
+        try {
+            mUm.setUserRestriction(restriction, value, userId);
+            return 0;
+        } catch (RemoteException e) {
+            System.err.println(e.toString());
+            return 1;
+        }
+    }
+
     static class ClearDataObserver extends IPackageDataObserver.Stub {
         boolean finished;
         boolean result;
diff --git a/core/java/android/app/ActivityManagerNative.java b/core/java/android/app/ActivityManagerNative.java
index f12c284..3c7eef5 100644
--- a/core/java/android/app/ActivityManagerNative.java
+++ b/core/java/android/app/ActivityManagerNative.java
@@ -1779,9 +1779,10 @@
 
         case START_BACKUP_AGENT_TRANSACTION: {
             data.enforceInterface(IActivityManager.descriptor);
-            ApplicationInfo info = ApplicationInfo.CREATOR.createFromParcel(data);
+            String packageName = data.readString();
             int backupRestoreMode = data.readInt();
-            boolean success = bindBackupAgent(info, backupRestoreMode);
+            int userId = data.readInt();
+            boolean success = bindBackupAgent(packageName, backupRestoreMode, userId);
             reply.writeNoException();
             reply.writeInt(success ? 1 : 0);
             return true;
@@ -4448,13 +4449,14 @@
         return binder;
     }
 
-    public boolean bindBackupAgent(ApplicationInfo app, int backupRestoreMode)
+    public boolean bindBackupAgent(String packageName, int backupRestoreMode, int userId)
             throws RemoteException {
         Parcel data = Parcel.obtain();
         Parcel reply = Parcel.obtain();
         data.writeInterfaceToken(IActivityManager.descriptor);
-        app.writeToParcel(data, 0);
+        data.writeString(packageName);
         data.writeInt(backupRestoreMode);
+        data.writeInt(userId);
         mRemote.transact(START_BACKUP_AGENT_TRANSACTION, data, reply, 0);
         reply.readException();
         boolean success = reply.readInt() != 0;
diff --git a/core/java/android/app/ContextImpl.java b/core/java/android/app/ContextImpl.java
index cf663a3..e6ca520 100644
--- a/core/java/android/app/ContextImpl.java
+++ b/core/java/android/app/ContextImpl.java
@@ -16,6 +16,8 @@
 
 package android.app;
 
+import android.annotation.NonNull;
+import android.annotation.Nullable;
 import android.content.BroadcastReceiver;
 import android.content.ComponentName;
 import android.content.ContentProvider;
@@ -30,6 +32,7 @@
 import android.content.ReceiverCallNotAllowedException;
 import android.content.ServiceConnection;
 import android.content.SharedPreferences;
+import android.content.pm.ActivityInfo;
 import android.content.pm.ApplicationInfo;
 import android.content.pm.IPackageManager;
 import android.content.pm.PackageManager;
@@ -155,10 +158,9 @@
     private final String mBasePackageName;
     private final String mOpPackageName;
 
-    private final ResourcesManager mResourcesManager;
-    private final Resources mResources;
-    private final Display mDisplay; // may be null if default display
-    private final DisplayAdjustments mDisplayAdjustments = new DisplayAdjustments();
+    private final @NonNull ResourcesManager mResourcesManager;
+    private final @NonNull Resources mResources;
+    private @Nullable Display mDisplay; // may be null if default display
 
     private final int mFlags;
 
@@ -1897,18 +1899,6 @@
                 mUser, mFlags, display, null, Display.INVALID_DISPLAY);
     }
 
-    Display getDisplay() {
-        if (mDisplay != null) {
-            return mDisplay;
-        }
-        return ResourcesManager.getInstance().getAdjustedDisplay(
-                Display.DEFAULT_DISPLAY, mDisplayAdjustments);
-    }
-
-    private int getDisplayId() {
-        return mDisplay != null ? mDisplay.getDisplayId() : Display.DEFAULT_DISPLAY;
-    }
-
     @Override
     public Context createDeviceProtectedStorageContext() {
         final int flags = (mFlags & ~Context.CONTEXT_CREDENTIAL_PROTECTED_STORAGE)
@@ -1941,8 +1931,23 @@
     }
 
     @Override
+    public Display getDisplay() {
+        final DisplayAdjustments displayAdjustments = mResources.getDisplayAdjustments();
+        if (mDisplay == null) {
+            return mResourcesManager.getAdjustedDisplay(Display.DEFAULT_DISPLAY,
+                    displayAdjustments);
+        }
+
+        if (!mDisplay.getDisplayAdjustments().equals(displayAdjustments)) {
+            mDisplay = mResourcesManager.getAdjustedDisplay(mDisplay.getDisplayId(),
+                    displayAdjustments);
+        }
+        return mDisplay;
+    }
+
+    @Override
     public DisplayAdjustments getDisplayAdjustments(int displayId) {
-        return mDisplayAdjustments;
+        return mResources.getDisplayAdjustments();
     }
 
     @Override
@@ -2057,11 +2062,6 @@
                     ? packageInfo.getCompatibilityInfo()
                     : CompatibilityInfo.DEFAULT_COMPATIBILITY_INFO;
         }
-        mDisplayAdjustments.setCompatibilityInfo(compatInfo);
-        mDisplayAdjustments.setConfiguration(overrideConfiguration);
-
-        mDisplay = (createDisplayWithId == Display.INVALID_DISPLAY) ? display
-                : ResourcesManager.getInstance().getAdjustedDisplay(displayId, mDisplayAdjustments);
 
         Resources resources = packageInfo.getResources(mainThread);
         if (resources != null) {
@@ -2101,6 +2101,9 @@
         }
         mResources = resources;
 
+        mDisplay = (createDisplayWithId == Display.INVALID_DISPLAY) ? display
+                : mResourcesManager.getAdjustedDisplay(displayId, mResources.getDisplayAdjustments());
+
         if (container != null) {
             mBasePackageName = container.mBasePackageName;
             mOpPackageName = container.mOpPackageName;
diff --git a/core/java/android/app/IActivityManager.java b/core/java/android/app/IActivityManager.java
index 81788da..ac21346 100644
--- a/core/java/android/app/IActivityManager.java
+++ b/core/java/android/app/IActivityManager.java
@@ -250,7 +250,7 @@
     public IBinder peekService(Intent service, String resolvedType, String callingPackage)
             throws RemoteException;
 
-    public boolean bindBackupAgent(ApplicationInfo appInfo, int backupRestoreMode)
+    public boolean bindBackupAgent(String packageName, int backupRestoreMode, int userId)
             throws RemoteException;
     public void clearPendingBackup() throws RemoteException;
     public void backupAgentCreated(String packageName, IBinder agent) throws RemoteException;
diff --git a/core/java/android/app/Presentation.java b/core/java/android/app/Presentation.java
index e110dcb..70007f5 100644
--- a/core/java/android/app/Presentation.java
+++ b/core/java/android/app/Presentation.java
@@ -310,7 +310,7 @@
         final WindowManagerImpl outerWindowManager =
                 (WindowManagerImpl)outerContext.getSystemService(Context.WINDOW_SERVICE);
         final WindowManagerImpl displayWindowManager =
-                outerWindowManager.createPresentationWindowManager(display);
+                outerWindowManager.createPresentationWindowManager(displayContext);
         return new ContextThemeWrapper(displayContext, theme) {
             @Override
             public Object getSystemService(String name) {
diff --git a/core/java/android/app/ResourcesManager.java b/core/java/android/app/ResourcesManager.java
index f56a6ad..cc2f621 100644
--- a/core/java/android/app/ResourcesManager.java
+++ b/core/java/android/app/ResourcesManager.java
@@ -304,10 +304,11 @@
     }
 
     private @NonNull ResourcesImpl createResourcesImpl(@NonNull ResourcesKey key) {
-        AssetManager assets = createAssetManager(key);
-        DisplayMetrics dm = getDisplayMetrics(key.mDisplayId);
-        Configuration config = generateConfig(key, dm);
-        ResourcesImpl impl = new ResourcesImpl(assets, dm, config, key.mCompatInfo);
+        final AssetManager assets = createAssetManager(key);
+        final DisplayMetrics dm = getDisplayMetrics(key.mDisplayId);
+        final Configuration config = generateConfig(key, dm);
+        final ResourcesImpl impl = new ResourcesImpl(assets, dm, config, key.mCompatInfo,
+                key.mOverrideConfiguration);
         if (DEBUG) {
             Slog.d(TAG, "- creating impl=" + impl + " with key: " + key);
         }
diff --git a/core/java/android/app/SystemServiceRegistry.java b/core/java/android/app/SystemServiceRegistry.java
index 7cd13ea..55744b9 100644
--- a/core/java/android/app/SystemServiceRegistry.java
+++ b/core/java/android/app/SystemServiceRegistry.java
@@ -559,7 +559,7 @@
                 new CachedServiceFetcher<WindowManager>() {
             @Override
             public WindowManager createService(ContextImpl ctx) {
-                return new WindowManagerImpl(ctx.getDisplay());
+                return new WindowManagerImpl(ctx);
             }});
 
         registerService(Context.USER_SERVICE, UserManager.class,
diff --git a/core/java/android/app/admin/DevicePolicyManager.java b/core/java/android/app/admin/DevicePolicyManager.java
index 63afdd8..325a15f 100644
--- a/core/java/android/app/admin/DevicePolicyManager.java
+++ b/core/java/android/app/admin/DevicePolicyManager.java
@@ -3030,8 +3030,6 @@
      * @param lockdownEnabled {@code true} to disallow networking when the VPN is not connected or
      *        {@code false} otherwise. This carries the risk that any failure of the VPN provider
      *        could break networking for all apps. This has no effect when clearing.
-     * @return {@code true} if the package is set as always-on VPN controller; {@code false}
-     *         otherwise.
      * @throws SecurityException if {@code admin} is not a device or a profile owner.
      * @throws NameNotFoundException if {@code vpnPackage} is not installed.
      * @throws UnsupportedOperationException if {@code vpnPackage} exists but does not support being
diff --git a/core/java/android/app/backup/IBackupManager.aidl b/core/java/android/app/backup/IBackupManager.aidl
index 5d4cc6f..a320bbf 100644
--- a/core/java/android/app/backup/IBackupManager.aidl
+++ b/core/java/android/app/backup/IBackupManager.aidl
@@ -218,6 +218,14 @@
     String[] listAllTransports();
 
     /**
+     * Retrieve the list of whitelisted transport components.  Callers do </i>not</i> need
+     * any special permission.
+     *
+     * @return The names of all whitelisted transport components defined by the system.
+     */
+    String[] getTransportWhitelist();
+
+    /**
      * Specify the current backup transport.  Callers must hold the
      * android.permission.BACKUP permission to use this method.
      *
diff --git a/core/java/android/app/job/JobInfo.java b/core/java/android/app/job/JobInfo.java
index c4ca82e..5823abf 100644
--- a/core/java/android/app/job/JobInfo.java
+++ b/core/java/android/app/job/JobInfo.java
@@ -28,6 +28,7 @@
 import android.util.Log;
 
 import java.util.ArrayList;
+import java.util.Objects;
 
 /**
  * Container of data passed to the {@link android.app.job.JobScheduler} fully encapsulating the
@@ -494,6 +495,20 @@
             return mFlags;
         }
 
+        @Override
+        public boolean equals(Object o) {
+            if (!(o instanceof TriggerContentUri)) {
+                return false;
+            }
+            TriggerContentUri t = (TriggerContentUri) o;
+            return Objects.equals(t.mUri, mUri) && t.mFlags == mFlags;
+        }
+
+        @Override
+        public int hashCode() {
+            return (mUri == null ? 0 : mUri.hashCode()) ^ mFlags;
+        }
+
         private TriggerContentUri(Parcel in) {
             mUri = Uri.CREATOR.createFromParcel(in);
             mFlags = in.readInt();
diff --git a/core/java/android/app/usage/NetworkStatsManager.java b/core/java/android/app/usage/NetworkStatsManager.java
index 720c84a..7961a72 100644
--- a/core/java/android/app/usage/NetworkStatsManager.java
+++ b/core/java/android/app/usage/NetworkStatsManager.java
@@ -305,7 +305,8 @@
      */
     public void registerUsageCallback(int networkType, String subscriberId, long thresholdBytes,
             UsageCallback callback) {
-        registerUsageCallback(networkType, subscriberId, thresholdBytes, null /* handler */);
+        registerUsageCallback(networkType, subscriberId, thresholdBytes, callback,
+                null /* handler */);
     }
 
     /**
diff --git a/core/java/android/bluetooth/BluetoothAdapter.java b/core/java/android/bluetooth/BluetoothAdapter.java
index 9390bcd..47ae687 100644
--- a/core/java/android/bluetooth/BluetoothAdapter.java
+++ b/core/java/android/bluetooth/BluetoothAdapter.java
@@ -897,28 +897,10 @@
      */
     @RequiresPermission(Manifest.permission.BLUETOOTH_ADMIN)
     public boolean enable() {
-        int state = BluetoothAdapter.STATE_OFF;
         if (isEnabled() == true) {
             if (DBG) Log.d(TAG, "enable(): BT is already enabled..!");
             return true;
         }
-        // Use service interface to get the exact state
-        try {
-            mServiceLock.readLock().lock();
-            if (mService != null) {
-                state = mService.getState();
-            }
-        } catch (RemoteException e) {
-            Log.e(TAG, "", e);
-        } finally {
-            mServiceLock.readLock().unlock();
-        }
-
-        if (state == BluetoothAdapter.STATE_BLE_ON) {
-                Log.e(TAG, "BT is in BLE_ON State");
-                notifyUserAction(true);
-                return true;
-        }
         try {
             return mManagerService.enable();
         } catch (RemoteException e) {Log.e(TAG, "", e);}
diff --git a/core/java/android/content/ContentResolver.java b/core/java/android/content/ContentResolver.java
index aeda7a2..c8d8920 100644
--- a/core/java/android/content/ContentResolver.java
+++ b/core/java/android/content/ContentResolver.java
@@ -1819,6 +1819,7 @@
      * calling app. That is, the returned permissions have been granted
      * <em>to</em> the calling app. Only persistable grants taken with
      * {@link #takePersistableUriPermission(Uri, int)} are returned.
+     * <p>Note: Some of the returned URIs may not be usable until after the user is unlocked.
      *
      * @see #takePersistableUriPermission(Uri, int)
      * @see #releasePersistableUriPermission(Uri, int)
@@ -1837,6 +1838,7 @@
      * calling app. That is, the returned permissions have been granted
      * <em>from</em> the calling app. Only grants taken with
      * {@link #takePersistableUriPermission(Uri, int)} are returned.
+     * <p>Note: Some of the returned URIs may not be usable until after the user is unlocked.
      */
     public @NonNull List<UriPermission> getOutgoingPersistedUriPermissions() {
         try {
diff --git a/core/java/android/content/Context.java b/core/java/android/content/Context.java
index 0881c9c..bdf888f 100644
--- a/core/java/android/content/Context.java
+++ b/core/java/android/content/Context.java
@@ -4279,6 +4279,11 @@
     public abstract DisplayAdjustments getDisplayAdjustments(int displayId);
 
     /**
+     * @hide
+     */
+    public abstract Display getDisplay();
+
+    /**
      * Indicates whether this Context is restricted.
      *
      * @return {@code true} if this Context is restricted, {@code false} otherwise.
diff --git a/core/java/android/content/ContextWrapper.java b/core/java/android/content/ContextWrapper.java
index 087ac47..60da63e 100644
--- a/core/java/android/content/ContextWrapper.java
+++ b/core/java/android/content/ContextWrapper.java
@@ -819,6 +819,14 @@
         return mBase.getDisplayAdjustments(displayId);
     }
 
+    /**
+     * @hide
+     */
+    @Override
+    public Display getDisplay() {
+        return mBase.getDisplay();
+    }
+
     @Override
     public Context createDeviceProtectedStorageContext() {
         return mBase.createDeviceProtectedStorageContext();
diff --git a/core/java/android/content/Intent.java b/core/java/android/content/Intent.java
index 9118f01..ace54ba 100644
--- a/core/java/android/content/Intent.java
+++ b/core/java/android/content/Intent.java
@@ -1556,7 +1556,7 @@
 
     /**
      * Used as an int extra field with {@link #ACTION_INSTALL_PACKAGE} and
-     * {@link} #ACTION_VIEW} to indicate the uid of the package that initiated the install
+     * {@link #ACTION_VIEW} to indicate the uid of the package that initiated the install
      * @hide
      */
     @SystemApi
diff --git a/core/java/android/content/res/Resources.java b/core/java/android/content/res/Resources.java
index 54a5968..7820cbe 100644
--- a/core/java/android/content/res/Resources.java
+++ b/core/java/android/content/res/Resources.java
@@ -51,6 +51,7 @@
 import android.util.LongSparseArray;
 import android.util.Pools.SynchronizedPool;
 import android.util.TypedValue;
+import android.view.DisplayAdjustments;
 import android.view.ViewDebug;
 import android.view.ViewHierarchyEncoder;
 
@@ -1800,6 +1801,11 @@
         return mResourcesImpl.getDisplayMetrics();
     }
 
+    /** @hide */
+    public DisplayAdjustments getDisplayAdjustments() {
+        return mResourcesImpl.getDisplayAdjustments();
+    }
+
     /**
      * Return the current configuration that is in effect for this resource 
      * object.  The returned object should be treated as read-only.
diff --git a/core/java/android/content/res/ResourcesImpl.java b/core/java/android/content/res/ResourcesImpl.java
index 000751e..0f140e9 100644
--- a/core/java/android/content/res/ResourcesImpl.java
+++ b/core/java/android/content/res/ResourcesImpl.java
@@ -44,6 +44,8 @@
 import android.util.Slog;
 import android.util.TypedValue;
 import android.util.Xml;
+import android.view.Display;
+import android.view.DisplayAdjustments;
 
 import java.io.InputStream;
 import java.util.Arrays;
@@ -111,7 +113,8 @@
 
 
     final AssetManager mAssets;
-    final DisplayMetrics mMetrics = new DisplayMetrics();
+    private final DisplayMetrics mMetrics = new DisplayMetrics();
+    private final DisplayAdjustments mDisplayAdjustments = new DisplayAdjustments();
 
     private PluralRules mPluralRule;
 
@@ -134,14 +137,42 @@
      *               selecting/computing resource values (optional).
      * @param compatInfo this resource's compatibility info. Must not be null.
      */
-    public ResourcesImpl(AssetManager assets, DisplayMetrics metrics, Configuration config,
-            CompatibilityInfo compatInfo) {
+    public ResourcesImpl(@NonNull AssetManager assets, @Nullable DisplayMetrics metrics,
+            @Nullable Configuration config, @NonNull CompatibilityInfo compatInfo) {
+        this(assets, metrics, config, compatInfo, null);
+    }
+
+    /**
+     * Creates a new ResourcesImpl object with CompatibilityInfo and assigns a static overrideConfig
+     * that is reported with getDisplayAdjustments(). This is used for updating the Display
+     * when a new ResourcesImpl is created due to multi-window configuration changes.
+     *
+     * @param assets Previously created AssetManager.
+     * @param metrics Current display metrics to consider when selecting/computing resource values.
+     * @param fullConfig Desired device configuration to consider when selecting/computing
+     * resource values.
+     * @param compatInfo this resource's compatibility info. Must not be null.
+     * @param overrideConfig the overrides specific to this ResourcesImpl object. They must already
+     * be applied to the fullConfig and are mainly maintained in order to return a valid
+     * DisplayAdjustments object during configuration changes.
+     */
+    public ResourcesImpl(@NonNull AssetManager assets, @Nullable DisplayMetrics metrics,
+            @Nullable Configuration fullConfig, @NonNull CompatibilityInfo compatInfo,
+            @Nullable Configuration overrideConfig) {
         mAssets = assets;
         mMetrics.setToDefaults();
-        updateConfiguration(config, metrics, compatInfo);
+        mDisplayAdjustments.setCompatibilityInfo(compatInfo);
+        if (overrideConfig != null) {
+            mDisplayAdjustments.setConfiguration(overrideConfig);
+        }
+        updateConfiguration(fullConfig, metrics, compatInfo);
         mAssets.ensureStringBlocks();
     }
 
+    public DisplayAdjustments getDisplayAdjustments() {
+        return mDisplayAdjustments;
+    }
+
     public AssetManager getAssets() {
         return mAssets;
     }
diff --git a/core/java/android/os/BatteryStats.java b/core/java/android/os/BatteryStats.java
index f4bf3ea..4acb729 100644
--- a/core/java/android/os/BatteryStats.java
+++ b/core/java/android/os/BatteryStats.java
@@ -2385,6 +2385,13 @@
     public abstract LongCounter getDischargeCoulombCounter();
 
     /**
+     * Returns the estimated real battery capacity, which may be less than the capacity
+     * declared by the PowerProfile.
+     * @return The estimated battery capacity in mAh.
+     */
+    public abstract int getEstimatedBatteryCapacity();
+
+    /**
      * Return the array of discharge step durations.
      */
     public abstract LevelStepTracker getDischargeLevelStepTracker();
@@ -2836,7 +2843,8 @@
                 whichBatteryRealtime / 1000, whichBatteryUptime / 1000,
                 totalRealtime / 1000, totalUptime / 1000,
                 getStartClockTime(),
-                whichBatteryScreenOffRealtime / 1000, whichBatteryScreenOffUptime / 1000);
+                whichBatteryScreenOffRealtime / 1000, whichBatteryScreenOffUptime / 1000,
+                getEstimatedBatteryCapacity());
 
         
         // Calculate wakelock times across all uids.
@@ -3348,6 +3356,16 @@
         final SparseArray<? extends Uid> uidStats = getUidStats();
         final int NU = uidStats.size();
 
+        final int estimatedBatteryCapacity = getEstimatedBatteryCapacity();
+        if (estimatedBatteryCapacity > 0) {
+            sb.setLength(0);
+            sb.append(prefix);
+                sb.append("  Estimated battery capacity: ");
+                sb.append(BatteryStatsHelper.makemAh(estimatedBatteryCapacity));
+                sb.append(" mAh");
+            pw.println(sb.toString());
+        }
+
         sb.setLength(0);
         sb.append(prefix);
                 sb.append("  Time on battery: ");
diff --git a/core/java/android/os/IDeviceIdleController.aidl b/core/java/android/os/IDeviceIdleController.aidl
index 082194b..cc2af21 100644
--- a/core/java/android/os/IDeviceIdleController.aidl
+++ b/core/java/android/os/IDeviceIdleController.aidl
@@ -38,8 +38,6 @@
     long addPowerSaveTempWhitelistAppForMms(String name, int userId, String reason);
     long addPowerSaveTempWhitelistAppForSms(String name, int userId, String reason);
     void exitIdle(String reason);
-    void downloadServiceActive(IBinder token);
-    void downloadServiceInactive();
     boolean registerMaintenanceActivityListener(IMaintenanceActivityListener listener);
     void unregisterMaintenanceActivityListener(IMaintenanceActivityListener listener);
 }
diff --git a/core/java/android/os/Process.java b/core/java/android/os/Process.java
index 4506f51..f664e70 100644
--- a/core/java/android/os/Process.java
+++ b/core/java/android/os/Process.java
@@ -1184,6 +1184,8 @@
     /** @hide */
     public static final int PROC_QUOTES = 0x400;
     /** @hide */
+    public static final int PROC_CHAR = 0x800;
+    /** @hide */
     public static final int PROC_OUT_STRING = 0x1000;
     /** @hide */
     public static final int PROC_OUT_LONG = 0x2000;
diff --git a/core/java/android/provider/Settings.java b/core/java/android/provider/Settings.java
index ab2506e..293eb9b 100755
--- a/core/java/android/provider/Settings.java
+++ b/core/java/android/provider/Settings.java
@@ -1311,13 +1311,20 @@
 
     /**
      * @hide Key with the location in the {@link android.util.MemoryIntArray} where
-     * to look up the generation id of the backing table.
+     * to look up the generation id of the backing table. The value is an integer.
      *
      * @see #CALL_METHOD_TRACK_GENERATION_KEY
      */
     public static final String CALL_METHOD_GENERATION_INDEX_KEY = "_generation_index";
 
     /**
+     * @hide Key with the settings table generation. The value is an integer.
+     *
+     * @see #CALL_METHOD_TRACK_GENERATION_KEY
+     */
+    public static final String CALL_METHOD_GENERATION_KEY = "_generation";
+
+    /**
      * @hide - User handle argument extra to the fast-path call()-based requests
      */
     public static final String CALL_METHOD_USER_KEY = "_user";
@@ -1467,11 +1474,11 @@
         private int mCurrentGeneration;
 
         public GenerationTracker(@NonNull MemoryIntArray array, int index,
-                Runnable errorHandler) {
+                int generation, Runnable errorHandler) {
             mArray = array;
             mIndex = index;
             mErrorHandler = errorHandler;
-            mCurrentGeneration = readCurrentGeneration();
+            mCurrentGeneration = generation;
         }
 
         public boolean isGenerationChanged() {
@@ -1627,6 +1634,8 @@
                                     final int index = b.getInt(
                                             CALL_METHOD_GENERATION_INDEX_KEY, -1);
                                     if (array != null && index >= 0) {
+                                        final int generation = b.getInt(
+                                                CALL_METHOD_GENERATION_KEY, 0);
                                         if (DEBUG) {
                                             Log.i(TAG, "Received generation tracker for type:"
                                                     + mUri.getPath() + " in package:"
@@ -1634,7 +1643,7 @@
                                                     + userHandle + " with index:" + index);
                                         }
                                         mGenerationTracker = new GenerationTracker(array, index,
-                                                () -> {
+                                                generation, () -> {
                                             synchronized (this) {
                                                 Log.e(TAG, "Error accessing generation"
                                                         + " tracker - removing");
diff --git a/core/java/android/security/NetworkSecurityPolicy.java b/core/java/android/security/NetworkSecurityPolicy.java
index 331063e..1b1c300 100644
--- a/core/java/android/security/NetworkSecurityPolicy.java
+++ b/core/java/android/security/NetworkSecurityPolicy.java
@@ -17,7 +17,10 @@
 package android.security;
 
 import android.annotation.TestApi;
+import android.content.Context;
+import android.content.pm.PackageManager;
 import android.security.net.config.ApplicationConfig;
+import android.security.net.config.ManifestConfigSource;
 
 /**
  * Network security policy.
@@ -98,4 +101,16 @@
     public void handleTrustStorageUpdate() {
         ApplicationConfig.getDefaultInstance().handleTrustStorageUpdate();
     }
+
+    /**
+     * Returns an {@link ApplicationConfig} based on the configuration for {@code packageName}.
+     *
+     * @hide
+     */
+    public static ApplicationConfig getApplicationConfigForPackage(Context context,
+            String packageName) throws PackageManager.NameNotFoundException {
+        Context appContext = context.createPackageContext(packageName, 0);
+        ManifestConfigSource source = new ManifestConfigSource(appContext);
+        return new ApplicationConfig(source);
+    }
 }
diff --git a/core/java/android/service/quicksettings/IQSService.aidl b/core/java/android/service/quicksettings/IQSService.aidl
index 747f185..bf96357 100644
--- a/core/java/android/service/quicksettings/IQSService.aidl
+++ b/core/java/android/service/quicksettings/IQSService.aidl
@@ -23,6 +23,7 @@
  * @hide
  */
 interface IQSService {
+    Tile getTile(in ComponentName component);
     void updateQsTile(in Tile tile);
     void updateStatusIcon(in Tile tile, in Icon icon,
             String contentDescription);
diff --git a/core/java/android/service/quicksettings/IQSTileService.aidl b/core/java/android/service/quicksettings/IQSTileService.aidl
index bfde870..b6c830c 100644
--- a/core/java/android/service/quicksettings/IQSTileService.aidl
+++ b/core/java/android/service/quicksettings/IQSTileService.aidl
@@ -15,15 +15,10 @@
  */
 package android.service.quicksettings;
 
-import android.service.quicksettings.Tile;
-import android.service.quicksettings.IQSService;
-
 /**
  * @hide
  */
 oneway interface IQSTileService {
-    void setQSService(in IQSService service);
-    void setQSTile(in Tile tile);
     void onTileAdded();
     void onTileRemoved();
     void onStartListening();
diff --git a/core/java/android/service/quicksettings/TileService.java b/core/java/android/service/quicksettings/TileService.java
index 4e9a075..55cfb49 100644
--- a/core/java/android/service/quicksettings/TileService.java
+++ b/core/java/android/service/quicksettings/TileService.java
@@ -118,6 +118,11 @@
     /**
      * @hide
      */
+    public static final String EXTRA_SERVICE = "service";
+
+    /**
+     * @hide
+     */
     public static final String EXTRA_COMPONENT = "android.service.quicksettings.extra.COMPONENT";
 
     private final H mHandler = new H(Looper.getMainLooper());
@@ -305,18 +310,18 @@
 
     @Override
     public IBinder onBind(Intent intent) {
+        mService = IQSService.Stub.asInterface(intent.getIBinderExtra(EXTRA_SERVICE));
+        try {
+            mTile = mService.getTile(new ComponentName(getPackageName(), getClass().getName()));
+        } catch (RemoteException e) {
+            throw new RuntimeException("Unable to reach IQSService", e);
+        }
+        if (mTile != null) {
+            mTile.setService(mService);
+            mHandler.sendEmptyMessage(H.MSG_START_SUCCESS);
+        }
         return new IQSTileService.Stub() {
             @Override
-            public void setQSService(IQSService service) throws RemoteException {
-                mHandler.obtainMessage(H.MSG_SET_SERVICE, service).sendToTarget();
-            }
-
-            @Override
-            public void setQSTile(Tile tile) throws RemoteException {
-                mHandler.obtainMessage(H.MSG_SET_TILE, tile).sendToTarget();
-            }
-
-            @Override
             public void onTileRemoved() throws RemoteException {
                 mHandler.sendEmptyMessage(H.MSG_TILE_REMOVED);
             }
@@ -349,14 +354,13 @@
     }
 
     private class H extends Handler {
-        private static final int MSG_SET_TILE = 1;
-        private static final int MSG_START_LISTENING = 2;
-        private static final int MSG_STOP_LISTENING = 3;
-        private static final int MSG_TILE_ADDED = 4;
-        private static final int MSG_TILE_REMOVED = 5;
-        private static final int MSG_TILE_CLICKED = 6;
-        private static final int MSG_SET_SERVICE = 7;
-        private static final int MSG_UNLOCK_COMPLETE = 8;
+        private static final int MSG_START_LISTENING = 1;
+        private static final int MSG_STOP_LISTENING = 2;
+        private static final int MSG_TILE_ADDED = 3;
+        private static final int MSG_TILE_REMOVED = 4;
+        private static final int MSG_TILE_CLICKED = 5;
+        private static final int MSG_UNLOCK_COMPLETE = 6;
+        private static final int MSG_START_SUCCESS = 7;
 
         public H(Looper looper) {
             super(looper);
@@ -365,18 +369,6 @@
         @Override
         public void handleMessage(Message msg) {
             switch (msg.what) {
-                case MSG_SET_SERVICE:
-                    mService = (IQSService) msg.obj;
-                    if (mTile != null) {
-                        mTile.setService(mService);
-                    }
-                    break;
-                case MSG_SET_TILE:
-                    mTile = (Tile) msg.obj;
-                    if (mService != null && mTile != null) {
-                        mTile.setService(mService);
-                    }
-                    break;
                 case MSG_TILE_ADDED:
                     TileService.this.onTileAdded();
                     break;
@@ -408,6 +400,12 @@
                         mUnlockRunnable.run();
                     }
                     break;
+                case MSG_START_SUCCESS:
+                    try {
+                        mService.onStartSuccessful(mTile);
+                    } catch (RemoteException e) {
+                    }
+                    break;
             }
         }
     }
diff --git a/core/java/android/view/DisplayAdjustments.java b/core/java/android/view/DisplayAdjustments.java
index 272740f..6cc0508 100644
--- a/core/java/android/view/DisplayAdjustments.java
+++ b/core/java/android/view/DisplayAdjustments.java
@@ -23,8 +23,6 @@
 
 /** @hide */
 public class DisplayAdjustments {
-    public static final boolean DEVELOPMENT_RESOURCES_DEPEND_ON_ACTIVITY_TOKEN = false;
-
     public static final DisplayAdjustments DEFAULT_DISPLAY_ADJUSTMENTS = new DisplayAdjustments();
 
     private volatile CompatibilityInfo mCompatInfo = CompatibilityInfo.DEFAULT_COMPATIBILITY_INFO;
@@ -74,10 +72,8 @@
     @Override
     public int hashCode() {
         int hash = 17;
-        hash = hash * 31 + mCompatInfo.hashCode();
-        if (DEVELOPMENT_RESOURCES_DEPEND_ON_ACTIVITY_TOKEN) {
-            hash = hash * 31 + (mConfiguration == null ? 0 : mConfiguration.hashCode());
-        }
+        hash = hash * 31 + Objects.hashCode(mCompatInfo);
+        hash = hash * 31 + Objects.hashCode(mConfiguration);
         return hash;
     }
 
diff --git a/core/java/android/view/DragAndDropPermissions.java b/core/java/android/view/DragAndDropPermissions.java
index a3dbdb1..71afaaa 100644
--- a/core/java/android/view/DragAndDropPermissions.java
+++ b/core/java/android/view/DragAndDropPermissions.java
@@ -16,12 +16,14 @@
 
 package android.view;
 
+import android.app.Activity;
 import android.app.ActivityManagerNative;
 import android.os.IBinder;
+import android.os.Parcel;
+import android.os.Parcelable;
 import android.os.RemoteException;
-import com.android.internal.view.IDragAndDropPermissions;
-import dalvik.system.CloseGuard;
 
+import com.android.internal.view.IDragAndDropPermissions;
 
 /**
  * {@link DragAndDropPermissions} controls the access permissions for the content URIs associated
@@ -33,20 +35,27 @@
  * Which permissions are granted is defined by the set of flags passed to {@link
  * View#startDragAndDrop(android.content.ClipData, View.DragShadowBuilder, Object, int)
  * View.startDragAndDrop} by the app that started the drag operation.
+ * </p>
  * <p>
  * The life cycle of the permissions is bound to the activity used to call {@link
  * android.app.Activity#requestDragAndDropPermissions(DragEvent) requestDragAndDropPermissions}. The
  * permissions are revoked when this activity is destroyed, or when {@link #release()} is called,
  * whichever occurs first.
+ * </p>
+ * <p>
+ * If you anticipate that your application will receive a large number of drops (e.g. document
+ * editor), you should try to call {@link #release()} on the obtained permissions as soon as they
+ * are no longer required. Permissions can be added to your activity's
+ * {@link Activity#onSaveInstanceState} bundle and later retrieved in order to manually release
+ * the permissions once they are no longer needed.
+ * </p>
  */
-public final class DragAndDropPermissions {
+public final class DragAndDropPermissions implements Parcelable {
 
     private final IDragAndDropPermissions mDragAndDropPermissions;
 
     private IBinder mPermissionOwnerToken;
 
-    private final CloseGuard mCloseGuard = CloseGuard.get();
-
     /**
      * Create a new {@link DragAndDropPermissions} object to control the access permissions for
      * content URIs associated with {@link DragEvent}.
@@ -79,7 +88,6 @@
         } catch (RemoteException e) {
             return false;
         }
-        mCloseGuard.open("release");
         return true;
     }
 
@@ -96,7 +104,6 @@
         } catch (RemoteException e) {
             return false;
         }
-        mCloseGuard.open("release");
         return true;
     }
 
@@ -109,18 +116,34 @@
             mPermissionOwnerToken = null;
         } catch (RemoteException e) {
         }
-        mCloseGuard.close();
+    }
+
+    public static final Parcelable.Creator<DragAndDropPermissions> CREATOR =
+            new Parcelable.Creator<DragAndDropPermissions> () {
+        @Override
+        public DragAndDropPermissions createFromParcel(Parcel source) {
+            return new DragAndDropPermissions(source);
+        }
+
+        @Override
+        public DragAndDropPermissions[] newArray(int size) {
+            return new DragAndDropPermissions[size];
+        }
+    };
+
+    @Override
+    public int describeContents() {
+        return 0;
     }
 
     @Override
-    protected void finalize() throws Throwable {
-        try {
-            if (mCloseGuard != null) {
-                mCloseGuard.warnIfOpen();
-            }
-            release();
-        } finally {
-            super.finalize();
-        }
+    public void writeToParcel(Parcel destination, int flags) {
+        destination.writeStrongInterface(mDragAndDropPermissions);
+        destination.writeStrongBinder(mPermissionOwnerToken);
+    }
+
+    private DragAndDropPermissions(Parcel in) {
+        mDragAndDropPermissions = IDragAndDropPermissions.Stub.asInterface(in.readStrongBinder());
+        mPermissionOwnerToken = in.readStrongBinder();
     }
 }
diff --git a/core/java/android/view/IWindowManager.aidl b/core/java/android/view/IWindowManager.aidl
index f8a6a17..72126d0 100644
--- a/core/java/android/view/IWindowManager.aidl
+++ b/core/java/android/view/IWindowManager.aidl
@@ -106,12 +106,13 @@
      * @param alwaysFocusable True if the app windows are always focusable regardless of the stack
      *                        they are in.
      * @param homeTask True if this is the task.
+     * @param targetSdkVersion The application's target SDK version
      */
     void addAppToken(int addPos, IApplicationToken token, int taskId, int stackId,
             int requestedOrientation, boolean fullscreen, boolean showWhenLocked, int userId,
             int configChanges, boolean voiceInteraction, boolean launchTaskBehind,
             in Rect taskBounds, in Configuration configuration, int taskResizeMode,
-            boolean alwaysFocusable, boolean homeTask);
+            boolean alwaysFocusable, boolean homeTask, int targetSdkVersion);
     /**
      *
      * @param token The token we are adding to the input task Id.
diff --git a/core/java/android/view/SurfaceView.java b/core/java/android/view/SurfaceView.java
index d59c8ac..ac43bb7 100644
--- a/core/java/android/view/SurfaceView.java
+++ b/core/java/android/view/SurfaceView.java
@@ -124,6 +124,7 @@
     int mWindowType = WindowManager.LayoutParams.TYPE_APPLICATION_MEDIA;
 
     boolean mIsCreating = false;
+    private volatile boolean mRtHandlingPositionUpdates = false;
 
     final Handler mHandler = new Handler() {
         @Override
@@ -464,7 +465,8 @@
             || mUpdateWindowNeeded || mReportDrawNeeded || redrawNeeded) {
             getLocationInWindow(mLocation);
 
-            if (DEBUG) Log.i(TAG, "Changes: creating=" + creating
+            if (DEBUG) Log.i(TAG, System.identityHashCode(this) + " "
+                    + "Changes: creating=" + creating
                     + " format=" + formatChanged + " size=" + sizeChanged
                     + " visible=" + visibleChanged
                     + " left=" + (mWindowSpaceLeft != mLocation[0])
@@ -534,7 +536,8 @@
                     mReportDrawNeeded = false;
                     mDrawingStopped = !visible;
 
-                    if (DEBUG) Log.i(TAG, "Cur surface: " + mSurface);
+                    if (DEBUG) Log.i(TAG, System.identityHashCode(this) + " "
+                            + "Cur surface: " + mSurface);
 
                     relayoutResult = mSession.relayout(
                         mWindow, mWindow.mSeq, mLayout, mWindowSpaceWidth, mWindowSpaceHeight,
@@ -547,7 +550,8 @@
                         reportDrawNeeded = true;
                     }
 
-                    if (DEBUG) Log.i(TAG, "New surface: " + mNewSurface
+                    if (DEBUG) Log.i(TAG, System.identityHashCode(this) + " "
+                            + "New surface: " + mNewSurface
                             + ", vis=" + visible + ", frame=" + mWinFrame);
 
                     mSurfaceFrame.left = 0;
@@ -581,7 +585,8 @@
                     if (mSurfaceCreated && (surfaceChanged || (!visible && visibleChanged))) {
                         mSurfaceCreated = false;
                         if (mSurface.isValid()) {
-                            if (DEBUG) Log.i(TAG, "visibleChanged -- surfaceDestroyed");
+                            if (DEBUG) Log.i(TAG, System.identityHashCode(this) + " "
+                                    + "visibleChanged -- surfaceDestroyed");
                             callbacks = getSurfaceCallbacks();
                             for (SurfaceHolder.Callback c : callbacks) {
                                 c.surfaceDestroyed(mSurfaceHolder);
@@ -594,7 +599,8 @@
                         if (!mSurfaceCreated && (surfaceChanged || visibleChanged)) {
                             mSurfaceCreated = true;
                             mIsCreating = true;
-                            if (DEBUG) Log.i(TAG, "visibleChanged -- surfaceCreated");
+                            if (DEBUG) Log.i(TAG, System.identityHashCode(this) + " "
+                                    + "visibleChanged -- surfaceCreated");
                             if (callbacks == null) {
                                 callbacks = getSurfaceCallbacks();
                             }
@@ -604,7 +610,8 @@
                         }
                         if (creating || formatChanged || sizeChanged
                                 || visibleChanged || realSizeChanged) {
-                            if (DEBUG) Log.i(TAG, "surfaceChanged -- format=" + mFormat
+                            if (DEBUG) Log.i(TAG, System.identityHashCode(this) + " "
+                                    + "surfaceChanged -- format=" + mFormat
                                     + " w=" + myWidth + " h=" + myHeight);
                             if (callbacks == null) {
                                 callbacks = getSurfaceCallbacks();
@@ -614,7 +621,8 @@
                             }
                         }
                         if (redrawNeeded) {
-                            if (DEBUG) Log.i(TAG, "surfaceRedrawNeeded");
+                            if (DEBUG) Log.i(TAG, System.identityHashCode(this) + " "
+                                    + "surfaceRedrawNeeded");
                             if (callbacks == null) {
                                 callbacks = getSurfaceCallbacks();
                             }
@@ -629,7 +637,8 @@
                 } finally {
                     mIsCreating = false;
                     if (redrawNeeded) {
-                        if (DEBUG) Log.i(TAG, "finishedDrawing");
+                        if (DEBUG) Log.i(TAG, System.identityHashCode(this) + " "
+                                + "finishedDrawing");
                         mSession.finishDrawing(mWindow);
                     }
                     mSession.performDeferredDestroy(mWindow);
@@ -641,7 +650,9 @@
                 TAG, "Layout: x=" + mLayout.x + " y=" + mLayout.y +
                 " w=" + mLayout.width + " h=" + mLayout.height +
                 ", frame=" + mSurfaceFrame);
-        } else if (!isHardwareAccelerated()) {
+        } else {
+            // Calculate the window position in case RT loses the window
+            // and we need to fallback to a UI-thread driven position update
             getLocationInWindow(mLocation);
             final boolean positionChanged = mWindowSpaceLeft != mLocation[0]
                     || mWindowSpaceTop != mLocation[1];
@@ -662,14 +673,17 @@
                     mTranslator.translateRectInAppWindowToScreen(mWinFrame);
                 }
 
-                try {
-                    Log.d(TAG, String.format("updateWindowPosition UI, " +
-                            "postion = [%d, %d, %d, %d]", mWinFrame.left, mWinFrame.top,
-                            mWinFrame.right, mWinFrame.bottom));
-                    mSession.repositionChild(mWindow, mWinFrame.left, mWinFrame.top,
-                            mWinFrame.right, mWinFrame.bottom, -1, mWinFrame);
-                } catch (RemoteException ex) {
-                    Log.e(TAG, "Exception from relayout", ex);
+                if (!isHardwareAccelerated() || !mRtHandlingPositionUpdates) {
+                    try {
+                        if (DEBUG) Log.d(TAG, String.format("%d updateWindowPosition UI, " +
+                                "postion = [%d, %d, %d, %d]", System.identityHashCode(this),
+                                mWinFrame.left, mWinFrame.top,
+                                mWinFrame.right, mWinFrame.bottom));
+                        mSession.repositionChild(mWindow, mWinFrame.left, mWinFrame.top,
+                                mWinFrame.right, mWinFrame.bottom, -1, mWinFrame);
+                    } catch (RemoteException ex) {
+                        Log.e(TAG, "Exception from relayout", ex);
+                    }
                 }
             }
         }
@@ -689,6 +703,15 @@
             // Guess we got detached, that sucks
             return;
         }
+        // TODO: This is teensy bit racey in that a brand new SurfaceView moving on
+        // its 2nd frame if RenderThread is running slowly could potentially see
+        // this as false, enter the branch, get pre-empted, then this comes along
+        // and reports a new position, then the UI thread resumes and reports
+        // its position. This could therefore be de-sync'd in that interval, but
+        // the synchronization would violate the rule that RT must never block
+        // on the UI thread which would open up potential deadlocks. The risk of
+        // a single-frame desync is therefore preferable for now.
+        mRtHandlingPositionUpdates = true;
         if (mRTLastReportedPosition.left == left
                 && mRTLastReportedPosition.top == top
                 && mRTLastReportedPosition.right == right
@@ -697,9 +720,9 @@
         }
         try {
             if (DEBUG) {
-                Log.d(TAG, String.format("updateWindowPosition RT, frameNr = %d, " +
-                        "postion = [%d, %d, %d, %d]", frameNumber, left, top,
-                        right, bottom));
+                Log.d(TAG, String.format("%d updateWindowPosition RT, frameNr = %d, " +
+                        "postion = [%d, %d, %d, %d]", System.identityHashCode(this),
+                        frameNumber, left, top, right, bottom));
             }
             // Just using mRTLastReportedPosition as a dummy rect here
             session.repositionChild(window, left, top, right, bottom,
@@ -712,6 +735,38 @@
         }
     }
 
+    /**
+     * Called by native on RenderThread to notify that the window is no longer in the
+     * draw tree
+     * @hide
+     */
+    public final void windowPositionLostRT(long frameNumber) {
+        if (DEBUG) {
+            Log.d(TAG, String.format("%d windowPositionLostRT RT, frameNr = %d",
+                    System.identityHashCode(this), frameNumber));
+        }
+        if (mRtHandlingPositionUpdates) {
+            mRtHandlingPositionUpdates = false;
+            // This callback will happen while the UI thread is blocked, so we can
+            // safely access other member variables at this time.
+            // So do what the UI thread would have done if RT wasn't handling position
+            // updates.
+            if (!mWinFrame.isEmpty() && !mWinFrame.equals(mRTLastReportedPosition)) {
+                try {
+                    if (DEBUG) Log.d(TAG, String.format("%d updateWindowPosition, " +
+                            "postion = [%d, %d, %d, %d]", System.identityHashCode(this),
+                            mWinFrame.left, mWinFrame.top,
+                            mWinFrame.right, mWinFrame.bottom));
+                    mSession.repositionChild(mWindow, mWinFrame.left, mWinFrame.top,
+                            mWinFrame.right, mWinFrame.bottom, frameNumber, mWinFrame);
+                } catch (RemoteException ex) {
+                    Log.e(TAG, "Exception from relayout", ex);
+                }
+            }
+            mRTLastReportedPosition.setEmpty();
+        }
+    }
+
     private SurfaceHolder.Callback[] getSurfaceCallbacks() {
         SurfaceHolder.Callback callbacks[];
         synchronized (mCallbacks) {
@@ -750,8 +805,7 @@
                 boolean alwaysConsumeNavBar) {
             SurfaceView surfaceView = mSurfaceView.get();
             if (surfaceView != null) {
-                if (DEBUG) Log.v(
-                        "SurfaceView", surfaceView + " got resized: w=" + frame.width()
+                if (DEBUG) Log.v(TAG, surfaceView + " got resized: w=" + frame.width()
                         + " h=" + frame.height() + ", cur w=" + mCurWidth + " h=" + mCurHeight);
                 surfaceView.mSurfaceLock.lock();
                 try {
@@ -907,7 +961,7 @@
         private final Canvas internalLockCanvas(Rect dirty) {
             mSurfaceLock.lock();
 
-            if (DEBUG) Log.i(TAG, "Locking canvas... stopped="
+            if (DEBUG) Log.i(TAG, System.identityHashCode(this) + " " + "Locking canvas... stopped="
                     + mDrawingStopped + ", win=" + mWindow);
 
             Canvas c = null;
@@ -919,7 +973,7 @@
                 }
             }
 
-            if (DEBUG) Log.i(TAG, "Returned canvas: " + c);
+            if (DEBUG) Log.i(TAG, System.identityHashCode(this) + " " + "Returned canvas: " + c);
             if (c != null) {
                 mLastLockTime = SystemClock.uptimeMillis();
                 return c;
diff --git a/core/java/android/view/ViewRootImpl.java b/core/java/android/view/ViewRootImpl.java
index 19b1cf3..b3daa16 100644
--- a/core/java/android/view/ViewRootImpl.java
+++ b/core/java/android/view/ViewRootImpl.java
@@ -26,7 +26,9 @@
 
 import android.Manifest;
 import android.animation.LayoutTransition;
+import android.annotation.NonNull;
 import android.app.ActivityManagerNative;
+import android.app.ResourcesManager;
 import android.content.ClipDescription;
 import android.content.ComponentCallbacks;
 import android.content.Context;
@@ -163,7 +165,7 @@
     final ArrayList<WindowCallbacks> mWindowCallbacks = new ArrayList<>();
     final Context mContext;
     final IWindowSession mWindowSession;
-    final Display mDisplay;
+    @NonNull Display mDisplay;
     final DisplayManager mDisplayManager;
     final String mBasePackageName;
 
@@ -307,8 +309,6 @@
     boolean mAdded;
     boolean mAddedTouchMode;
 
-    final DisplayAdjustments mDisplayAdjustments;
-
     // These are accessed by multiple threads.
     final Rect mWinFrame; // frame given by window manager.
 
@@ -412,9 +412,6 @@
         mWindowSession = WindowManagerGlobal.getWindowSession();
         mDisplay = display;
         mBasePackageName = context.getBasePackageName();
-
-        mDisplayAdjustments = display.getDisplayAdjustments();
-
         mThread = Thread.currentThread();
         mLocation = new WindowLeaked(null);
         mLocation.fillInStackTrace();
@@ -588,7 +585,8 @@
                     attrs.setSurfaceInsets(view, false /*manual*/, true /*preservePrevious*/);
                 }
 
-                CompatibilityInfo compatibilityInfo = mDisplayAdjustments.getCompatibilityInfo();
+                CompatibilityInfo compatibilityInfo =
+                        mDisplay.getDisplayAdjustments().getCompatibilityInfo();
                 mTranslator = compatibilityInfo.getTranslator();
 
                 // If the application owns the surface, don't enable hardware acceleration
@@ -1468,7 +1466,8 @@
             surfaceChanged = true;
             params = lp;
         }
-        CompatibilityInfo compatibilityInfo = mDisplayAdjustments.getCompatibilityInfo();
+        CompatibilityInfo compatibilityInfo =
+                mDisplay.getDisplayAdjustments().getCompatibilityInfo();
         if (compatibilityInfo.supportsScreen() == mLastInCompatMode) {
             params = lp;
             mFullRedrawNeeded = true;
@@ -1814,6 +1813,19 @@
                             + mAttachInfo.mVisibleInsets);
                 }
 
+                // If any of the insets changed, do a forceLayout on the view so that the
+                // measure cache is cleared. We might have a pending MSG_RESIZED_REPORT
+                // that is supposed to take care of it, but since pending insets are
+                // already modified here, it won't detect the frame change after this.
+                final boolean framesChanged = overscanInsetsChanged
+                        || contentInsetsChanged
+                        || stableInsetsChanged
+                        || visibleInsetsChanged
+                        || outsetsChanged;
+                if (mAdded && mView != null && framesChanged) {
+                    forceLayout(mView);
+                }
+
                 if (!hadSurface) {
                     if (mSurface.isValid()) {
                         // If we are creating a new surface, then we need to
@@ -3293,7 +3305,7 @@
                 + mWindowAttributes.getTitle()
                 + ": " + config);
 
-        CompatibilityInfo ci = mDisplayAdjustments.getCompatibilityInfo();
+        CompatibilityInfo ci = mDisplay.getDisplayAdjustments().getCompatibilityInfo();
         if (!ci.equals(CompatibilityInfo.DEFAULT_COMPATIBILITY_INFO)) {
             config = new Configuration(config);
             ci.applyToConfiguration(mNoncompatDensity, config);
@@ -3308,8 +3320,13 @@
             // At this point the resources have been updated to
             // have the most recent config, whatever that is.  Use
             // the one in them which may be newer.
-            config = mView.getResources().getConfiguration();
+            final Resources localResources = mView.getResources();
+            config = localResources.getConfiguration();
             if (force || mLastConfiguration.diff(config) != 0) {
+                // Update the display with new DisplayAdjustments.
+                mDisplay = ResourcesManager.getInstance().getAdjustedDisplay(
+                        mDisplay.getDisplayId(), localResources.getDisplayAdjustments());
+
                 final int lastLayoutDirection = mLastConfiguration.getLayoutDirection();
                 final int currentLayoutDirection = config.getLayoutDirection();
                 mLastConfiguration.setTo(config);
diff --git a/core/java/android/view/WindowManagerImpl.java b/core/java/android/view/WindowManagerImpl.java
index f8c7d68..dd4e096 100644
--- a/core/java/android/view/WindowManagerImpl.java
+++ b/core/java/android/view/WindowManagerImpl.java
@@ -55,26 +55,26 @@
  */
 public final class WindowManagerImpl implements WindowManager {
     private final WindowManagerGlobal mGlobal = WindowManagerGlobal.getInstance();
-    private final Display mDisplay;
+    private final Context mContext;
     private final Window mParentWindow;
 
     private IBinder mDefaultToken;
 
-    public WindowManagerImpl(Display display) {
-        this(display, null);
+    public WindowManagerImpl(Context context) {
+        this(context, null);
     }
 
-    private WindowManagerImpl(Display display, Window parentWindow) {
-        mDisplay = display;
+    private WindowManagerImpl(Context context, Window parentWindow) {
+        mContext = context;
         mParentWindow = parentWindow;
     }
 
     public WindowManagerImpl createLocalWindowManager(Window parentWindow) {
-        return new WindowManagerImpl(mDisplay, parentWindow);
+        return new WindowManagerImpl(mContext, parentWindow);
     }
 
-    public WindowManagerImpl createPresentationWindowManager(Display display) {
-        return new WindowManagerImpl(display, mParentWindow);
+    public WindowManagerImpl createPresentationWindowManager(Context displayContext) {
+        return new WindowManagerImpl(displayContext, mParentWindow);
     }
 
     /**
@@ -90,7 +90,7 @@
     @Override
     public void addView(@NonNull View view, @NonNull ViewGroup.LayoutParams params) {
         applyDefaultToken(params);
-        mGlobal.addView(view, params, mDisplay, mParentWindow);
+        mGlobal.addView(view, params, mContext.getDisplay(), mParentWindow);
     }
 
     @Override
@@ -144,6 +144,6 @@
 
     @Override
     public Display getDefaultDisplay() {
-        return mDisplay;
+        return mContext.getDisplay();
     }
 }
diff --git a/core/java/android/webkit/WebViewFactory.java b/core/java/android/webkit/WebViewFactory.java
index 2d1e0bd..15eb8de 100644
--- a/core/java/android/webkit/WebViewFactory.java
+++ b/core/java/android/webkit/WebViewFactory.java
@@ -141,17 +141,38 @@
      */
     public static int loadWebViewNativeLibraryFromPackage(String packageName,
                                                           ClassLoader clazzLoader) {
-        int ret = waitForProviderAndSetPackageInfo();
-        if (ret != LIBLOAD_SUCCESS && ret != LIBLOAD_FAILED_WAITING_FOR_RELRO) {
-            return ret;
+        WebViewProviderResponse response = null;
+        try {
+            response = getUpdateService().waitForAndGetProvider();
+        } catch (RemoteException e) {
+            Log.e(LOGTAG, "error waiting for relro creation", e);
+            return LIBLOAD_FAILED_WAITING_FOR_WEBVIEW_REASON_UNKNOWN;
         }
-        if (!sPackageInfo.packageName.equals(packageName))
+
+
+        if (response.status != LIBLOAD_SUCCESS
+                && response.status != LIBLOAD_FAILED_WAITING_FOR_RELRO) {
+            return response.status;
+        }
+        if (!response.packageInfo.packageName.equals(packageName)) {
             return LIBLOAD_WRONG_PACKAGE_NAME;
+        }
+
+        PackageManager packageManager = AppGlobals.getInitialApplication().getPackageManager();
+        PackageInfo packageInfo;
+        try {
+            packageInfo = packageManager.getPackageInfo(packageName,
+                    PackageManager.GET_META_DATA | PackageManager.MATCH_DEBUG_TRIAGED_MISSING);
+        } catch (PackageManager.NameNotFoundException e) {
+            Log.e(LOGTAG, "Couldn't find package " + packageName);
+            return LIBLOAD_WRONG_PACKAGE_NAME;
+        }
+        sPackageInfo = packageInfo;
 
         int loadNativeRet = loadNativeLibrary(clazzLoader);
         // If we failed waiting for relro we want to return that fact even if we successfully load
         // the relro file.
-        if (loadNativeRet == LIBLOAD_SUCCESS) return ret;
+        if (loadNativeRet == LIBLOAD_SUCCESS) return response.status;
         return loadNativeRet;
     }
 
@@ -288,7 +309,7 @@
                 Context webViewContext = initialApplication.createApplicationContext(
                         newPackageInfo.applicationInfo,
                         Context.CONTEXT_INCLUDE_CODE | Context.CONTEXT_IGNORE_SECURITY);
-                sPackageInfo = response.packageInfo;
+                sPackageInfo = newPackageInfo;
                 return webViewContext;
             } finally {
                 Trace.traceEnd(Trace.TRACE_TAG_WEBVIEW);
@@ -599,22 +620,6 @@
         }
     }
 
-    private static int waitForProviderAndSetPackageInfo() {
-        WebViewProviderResponse response = null;
-        try {
-            response =
-                getUpdateService().waitForAndGetProvider();
-            if (response.status == LIBLOAD_SUCCESS
-                    || response.status == LIBLOAD_FAILED_WAITING_FOR_RELRO) {
-                sPackageInfo = response.packageInfo;
-            }
-        } catch (RemoteException e) {
-            Log.e(LOGTAG, "error waiting for relro creation", e);
-            return LIBLOAD_FAILED_WAITING_FOR_WEBVIEW_REASON_UNKNOWN;
-        }
-        return response.status;
-    }
-
     // Assumes that we have waited for relro creation and set sPackageInfo
     private static int loadNativeLibrary(ClassLoader clazzLoader) {
         if (!sAddressSpaceReserved) {
diff --git a/core/java/android/widget/PopupWindow.java b/core/java/android/widget/PopupWindow.java
index a2f4930..4066ef1 100644
--- a/core/java/android/widget/PopupWindow.java
+++ b/core/java/android/widget/PopupWindow.java
@@ -1533,13 +1533,9 @@
         anchor.getWindowVisibleDisplayFrame(displayFrame);
         if (width == MATCH_PARENT) {
             width = displayFrame.right - displayFrame.left;
-        } else if (width == WRAP_CONTENT) {
-            width = mContentView.getMeasuredWidth();
         }
         if (height == MATCH_PARENT) {
             height = displayFrame.bottom - displayFrame.top;
-        } else if (height == WRAP_CONTENT) {
-            height = mContentView.getMeasuredHeight();
         }
 
         // Let the window manager know to align the top to y.
diff --git a/core/java/com/android/internal/app/LocaleStore.java b/core/java/com/android/internal/app/LocaleStore.java
index e3fce51..e782c3c 100644
--- a/core/java/com/android/internal/app/LocaleStore.java
+++ b/core/java/com/android/internal/app/LocaleStore.java
@@ -307,6 +307,9 @@
             localizedLocales.add(li.getLangScriptKey());
         }
 
+        // Serbian in Latin script is only partially localized in N.
+        localizedLocales.remove("sr-Latn");
+
         for (LocaleInfo li : sLocaleCache.values()) {
             li.setTranslated(localizedLocales.contains(li.getLangScriptKey()));
         }
diff --git a/core/java/com/android/internal/os/BatteryStatsImpl.java b/core/java/com/android/internal/os/BatteryStatsImpl.java
index 07d38d7..a1df8c1 100644
--- a/core/java/com/android/internal/os/BatteryStatsImpl.java
+++ b/core/java/com/android/internal/os/BatteryStatsImpl.java
@@ -108,7 +108,7 @@
     private static final int MAGIC = 0xBA757475; // 'BATSTATS'
 
     // Current on-disk Parcel version
-    private static final int VERSION = 146 + (USE_OLD_HISTORY ? 1000 : 0);
+    private static final int VERSION = 147 + (USE_OLD_HISTORY ? 1000 : 0);
 
     // Maximum number of items we will record in the history.
     private static final int MAX_HISTORY_ITEMS = 2000;
@@ -547,6 +547,8 @@
     private int mLoadedNumConnectivityChange;
     private int mUnpluggedNumConnectivityChange;
 
+    private int mEstimatedBatteryCapacity = -1;
+
     private final NetworkStats.Entry mTmpNetworkStatsEntry = new NetworkStats.Entry();
 
     private PowerProfile mPowerProfile;
@@ -578,6 +580,11 @@
         return mDischargeCounter;
     }
 
+    @Override
+    public int getEstimatedBatteryCapacity() {
+        return mEstimatedBatteryCapacity;
+    }
+
     public BatteryStatsImpl() {
         this(new SystemClocks());
     }
@@ -7625,6 +7632,11 @@
                         numSpeedSteps);
                 firstCpuOfCluster += mPowerProfile.getNumCoresInCpuCluster(i);
             }
+
+            if (mEstimatedBatteryCapacity == -1) {
+                // Initialize the estimated battery capacity to a known preset one.
+                mEstimatedBatteryCapacity = (int) mPowerProfile.getBatteryCapacity();
+            }
         }
     }
 
@@ -8174,6 +8186,12 @@
         for (int i=0; i<NUM_SCREEN_BRIGHTNESS_BINS; i++) {
             mScreenBrightnessTimer[i].reset(false);
         }
+
+        if (mPowerProfile != null) {
+            mEstimatedBatteryCapacity = (int) mPowerProfile.getBatteryCapacity();
+        } else {
+            mEstimatedBatteryCapacity = -1;
+        }
         mInteractiveTimer.reset(false);
         mPowerSaveModeEnabledTimer.reset(false);
         mLastIdleTimeStart = elapsedRealtimeMillis;
@@ -9158,7 +9176,7 @@
     }
 
     void setOnBatteryLocked(final long mSecRealtime, final long mSecUptime, final boolean onBattery,
-            final int oldStatus, final int level) {
+            final int oldStatus, final int level, final int chargeUAh) {
         boolean doWrite = false;
         Message m = mHandler.obtainMessage(MSG_REPORT_POWER_CHANGE);
         m.arg1 = onBattery ? 1 : 0;
@@ -9212,6 +9230,10 @@
                 }
                 doWrite = true;
                 resetAllStatsLocked();
+                if (chargeUAh > 0) {
+                    // Only use the reported coulomb charge value if it is supported and reported.
+                    mEstimatedBatteryCapacity = (int) ((level / 100.0) * (chargeUAh / 1000));
+                }
                 mDischargeStartLevel = level;
                 reset = true;
                 mDischargeStepTracker.init();
@@ -9379,7 +9401,7 @@
                 mDischargeScreenOffCounter.addCountLocked(chargeDiff);
             }
             mHistoryCur.batteryChargeUAh = chargeUAh;
-            setOnBatteryLocked(elapsedRealtime, uptime, onBattery, oldStatus, level);
+            setOnBatteryLocked(elapsedRealtime, uptime, onBattery, oldStatus, level, chargeUAh);
         } else {
             boolean changed = false;
             if (mHistoryCur.batteryLevel != level) {
@@ -10093,6 +10115,7 @@
         mDischargePlugLevel = in.readInt();
         mDischargeCurrentLevel = in.readInt();
         mCurrentBatteryLevel = in.readInt();
+        mEstimatedBatteryCapacity = in.readInt();
         mLowDischargeAmountSinceCharge = in.readInt();
         mHighDischargeAmountSinceCharge = in.readInt();
         mDischargeAmountScreenOnSinceCharge = in.readInt();
@@ -10445,6 +10468,7 @@
         out.writeInt(mDischargePlugLevel);
         out.writeInt(mDischargeCurrentLevel);
         out.writeInt(mCurrentBatteryLevel);
+        out.writeInt(mEstimatedBatteryCapacity);
         out.writeInt(getLowDischargeAmountSinceCharge());
         out.writeInt(getHighDischargeAmountSinceCharge());
         out.writeInt(getDischargeAmountScreenOnSinceCharge());
@@ -10809,6 +10833,7 @@
         mRealtime = in.readLong();
         mRealtimeStart = in.readLong();
         mOnBattery = in.readInt() != 0;
+        mEstimatedBatteryCapacity = in.readInt();
         mOnBatteryInternal = false; // we are no longer really running.
         mOnBatteryTimeBase.readFromParcel(in);
         mOnBatteryScreenOffTimeBase.readFromParcel(in);
@@ -10992,6 +11017,7 @@
         out.writeLong(mRealtime);
         out.writeLong(mRealtimeStart);
         out.writeInt(mOnBattery ? 1 : 0);
+        out.writeInt(mEstimatedBatteryCapacity);
         mOnBatteryTimeBase.writeToParcel(out, uSecUptime, uSecRealtime);
         mOnBatteryScreenOffTimeBase.writeToParcel(out, uSecUptime, uSecRealtime);
 
diff --git a/core/jni/android_util_Process.cpp b/core/jni/android_util_Process.cpp
index f7a5e8a..3d952b0 100644
--- a/core/jni/android_util_Process.cpp
+++ b/core/jni/android_util_Process.cpp
@@ -832,6 +832,7 @@
     PROC_COMBINE = 0x100,
     PROC_PARENS = 0x200,
     PROC_QUOTES = 0x400,
+    PROC_CHAR = 0x800,
     PROC_OUT_STRING = 0x1000,
     PROC_OUT_LONG = 0x2000,
     PROC_OUT_FLOAT = 0x4000,
@@ -933,8 +934,13 @@
                 floatsData[di] = strtof(buffer+start, &end);
             }
             if ((mode&PROC_OUT_LONG) != 0 && di < NL) {
-                char* end;
-                longsData[di] = strtoll(buffer+start, &end, 10);
+                if ((mode&PROC_CHAR) != 0) {
+                    // Caller wants single first character returned as one long.
+                    longsData[di] = buffer[start];
+                } else {
+                    char* end;
+                    longsData[di] = strtoll(buffer+start, &end, 10);
+                }
             }
             if ((mode&PROC_OUT_STRING) != 0 && di < NS) {
                 jstring str = env->NewStringUTF(buffer+start);
diff --git a/core/jni/android_view_RenderNode.cpp b/core/jni/android_view_RenderNode.cpp
index a6db0f4..4fc546c 100644
--- a/core/jni/android_view_RenderNode.cpp
+++ b/core/jni/android_view_RenderNode.cpp
@@ -534,6 +534,7 @@
 // ----------------------------------------------------------------------------
 
 jmethodID gSurfaceViewPositionUpdateMethod;
+jmethodID gSurfaceViewPositionLostMethod;
 
 static void android_view_RenderNode_requestPositionUpdates(JNIEnv* env, jobject,
         jlong renderNodePtr, jobject surfaceview) {
@@ -581,6 +582,20 @@
             info.canvasContext.enqueueFrameWork(std::move(functor));
         }
 
+        virtual void onPositionLost(RenderNode& node, const TreeInfo* info) override {
+            if (CC_UNLIKELY(!mWeakRef || (info && !info->updateWindowPositions))) return;
+
+            if (info) {
+                auto functor = std::bind(
+                    std::mem_fn(&SurfaceViewPositionUpdater::doNotifyPositionLost), this,
+                    (jlong) info->canvasContext.getFrameNumber());
+
+                info->canvasContext.enqueueFrameWork(std::move(functor));
+            } else {
+                doNotifyPositionLost(0);
+            }
+        }
+
     private:
         JNIEnv* jnienv() {
             JNIEnv* env;
@@ -607,6 +622,21 @@
             env->DeleteLocalRef(localref);
         }
 
+        void doNotifyPositionLost(jlong frameNumber) {
+            ATRACE_NAME("SurfaceView position lost");
+
+            JNIEnv* env = jnienv();
+            jobject localref = env->NewLocalRef(mWeakRef);
+            if (CC_UNLIKELY(!localref)) {
+                jnienv()->DeleteWeakGlobalRef(mWeakRef);
+                mWeakRef = nullptr;
+                return;
+            }
+
+            env->CallVoidMethod(localref, gSurfaceViewPositionLostMethod, frameNumber);
+            env->DeleteLocalRef(localref);
+        }
+
         JavaVM* mVm;
         jobject mWeakRef;
     };
@@ -701,6 +731,8 @@
     jclass clazz = FindClassOrDie(env, "android/view/SurfaceView");
     gSurfaceViewPositionUpdateMethod = GetMethodIDOrDie(env, clazz,
             "updateWindowPositionRT", "(JIIII)V");
+    gSurfaceViewPositionLostMethod = GetMethodIDOrDie(env, clazz,
+            "windowPositionLostRT", "(J)V");
     clazz = FindClassOrDie(env, "android/view/RenderNode");
     gOnRenderNodeDetached = GetMethodIDOrDie(env, clazz,
             "onRenderNodeDetached", "()V");
diff --git a/core/res/res/layout/unsupported_display_size_dialog_content.xml b/core/res/res/layout/unsupported_display_size_dialog_content.xml
new file mode 100644
index 0000000..5e5cf00
--- /dev/null
+++ b/core/res/res/layout/unsupported_display_size_dialog_content.xml
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ * Copyright (C) 2016 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+-->
+
+<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
+              android:layout_width="match_parent"
+              android:layout_height="wrap_content"
+              android:paddingTop="?attr/dialogPreferredPadding"
+              android:paddingLeft="?attr/dialogPreferredPadding"
+              android:paddingRight="?attr/dialogPreferredPadding">
+
+    <CheckBox
+        android:id="@+id/ask_checkbox"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_gravity="start"
+        android:text="@string/unsupported_display_size_show" />
+</FrameLayout>
diff --git a/core/res/res/values-af/strings.xml b/core/res/res/values-af/strings.xml
index c03fb5b..9c16f7e 100644
--- a/core/res/res/values-af/strings.xml
+++ b/core/res/res/values-af/strings.xml
@@ -1015,6 +1015,8 @@
     <string name="screen_compat_mode_scale" msgid="3202955667675944499">"Skaal"</string>
     <string name="screen_compat_mode_show" msgid="4013878876486655892">"Wys altyd"</string>
     <string name="screen_compat_mode_hint" msgid="1064524084543304459">"Heraktiveer hierdie in Stelselinstellings &gt; Programme &gt; Afgelaai."</string>
+    <string name="unsupported_display_size_message" msgid="6545327290756295232">"<xliff:g id="APP_NAME">%1$s</xliff:g> steun nie die huidige skermgrootte-instelling nie en sal dalk onverwags reageer."</string>
+    <string name="unsupported_display_size_show" msgid="7969129195360353041">"Wys altyd"</string>
     <string name="smv_application" msgid="3307209192155442829">"Die program <xliff:g id="APPLICATION">%1$s</xliff:g> (proses <xliff:g id="PROCESS">%2$s</xliff:g>) het sy selfopgelegde StrictMode-beleid oortree."</string>
     <string name="smv_process" msgid="5120397012047462446">"Die proses <xliff:g id="PROCESS">%1$s</xliff:g> het die selfopgelegde StrictMode-beleid geskend."</string>
     <string name="android_upgrading_title" msgid="1584192285441405746">"Android gradeer tans op..."</string>
diff --git a/core/res/res/values-am/strings.xml b/core/res/res/values-am/strings.xml
index 55f0f2a..a3c18ac 100644
--- a/core/res/res/values-am/strings.xml
+++ b/core/res/res/values-am/strings.xml
@@ -1015,6 +1015,8 @@
     <string name="screen_compat_mode_scale" msgid="3202955667675944499">"የልኬት ለውጥ"</string>
     <string name="screen_compat_mode_show" msgid="4013878876486655892">"ሁልጊዜ አሳይ"</string>
     <string name="screen_compat_mode_hint" msgid="1064524084543304459">"በስርዓት ቅንብሮች  ውስጥ ይሄንን ዳግም አንቃ&gt; Apps &amp;gt፤ወርዷል፡፡"</string>
+    <string name="unsupported_display_size_message" msgid="6545327290756295232">"<xliff:g id="APP_NAME">%1$s</xliff:g> አሁን ያለውን የማሳያ መጠን ቅንብር አይደግፍም እና ያልተጠብቀ ባሕሪ ሊያሳይ ይችላል።"</string>
+    <string name="unsupported_display_size_show" msgid="7969129195360353041">"ሁልጊዜ አሳይ"</string>
     <string name="smv_application" msgid="3307209192155442829">"መተግበሪያው <xliff:g id="APPLICATION">%1$s</xliff:g>( ሂደት<xliff:g id="PROCESS">%2$s</xliff:g>) በራስ ተነሳሺ StrictMode ደንብን ይተላለፋል።"</string>
     <string name="smv_process" msgid="5120397012047462446">"ሂደቱ <xliff:g id="PROCESS">%1$s</xliff:g> በራስ ተነሳሺ StrictMode ፖሊሲን ይተላለፋል።"</string>
     <string name="android_upgrading_title" msgid="1584192285441405746">"Android እያሻሻለ ነው..."</string>
diff --git a/core/res/res/values-ar/strings.xml b/core/res/res/values-ar/strings.xml
index bd6de2e..2db0e15 100644
--- a/core/res/res/values-ar/strings.xml
+++ b/core/res/res/values-ar/strings.xml
@@ -1107,6 +1107,8 @@
     <string name="screen_compat_mode_scale" msgid="3202955667675944499">"تدرج"</string>
     <string name="screen_compat_mode_show" msgid="4013878876486655892">"الإظهار دائمًا"</string>
     <string name="screen_compat_mode_hint" msgid="1064524084543304459">"‏يمكنك إعادة تمكين هذا في إعدادات النظام &gt; التطبيقات &gt; ما تم تنزيله."</string>
+    <string name="unsupported_display_size_message" msgid="6545327290756295232">"<xliff:g id="APP_NAME">%1$s</xliff:g> غير متوافق مع الإعداد الحالي لحجم شاشة العرض وربما يعمل بطريقة غير متوقعة."</string>
+    <string name="unsupported_display_size_show" msgid="7969129195360353041">"العرض دائمًا"</string>
     <string name="smv_application" msgid="3307209192155442829">"‏انتهك التطبيق <xliff:g id="APPLICATION">%1$s</xliff:g> (العملية <xliff:g id="PROCESS">%2$s</xliff:g>) سياسة StrictMode المفروضة ذاتيًا."</string>
     <string name="smv_process" msgid="5120397012047462446">"‏انتهكت العملية <xliff:g id="PROCESS">%1$s</xliff:g> سياسة StrictMode المفروضة ذاتيًا."</string>
     <string name="android_upgrading_title" msgid="1584192285441405746">"‏جارٍ ترقية Android..."</string>
diff --git a/core/res/res/values-az-rAZ/strings.xml b/core/res/res/values-az-rAZ/strings.xml
index 17712b0..7f55ba1 100644
--- a/core/res/res/values-az-rAZ/strings.xml
+++ b/core/res/res/values-az-rAZ/strings.xml
@@ -1015,6 +1015,8 @@
     <string name="screen_compat_mode_scale" msgid="3202955667675944499">"Miqyas"</string>
     <string name="screen_compat_mode_show" msgid="4013878876486655892">"Həmişə göstər"</string>
     <string name="screen_compat_mode_hint" msgid="1064524084543304459">"Bunları Sistem ayarlarında yenidən aktivləşdir Yüklənmiş &gt; Tətbiqlər &gt;."</string>
+    <string name="unsupported_display_size_message" msgid="6545327290756295232">"<xliff:g id="APP_NAME">%1$s</xliff:g> cari Ekran ölçüsü ayarını dəstəkləmir və gözlənilməz şəkildə davrana bilər."</string>
+    <string name="unsupported_display_size_show" msgid="7969129195360353041">"Həmişə göstərin"</string>
     <string name="smv_application" msgid="3307209192155442829">"Tətbiq <xliff:g id="APPLICATION">%1$s</xliff:g> (proses <xliff:g id="PROCESS">%2$s</xliff:g>) StrictMode siyasətini pozdu."</string>
     <string name="smv_process" msgid="5120397012047462446">"<xliff:g id="PROCESS">%1$s</xliff:g> prosesi StrictMode siyasətini pozdu."</string>
     <string name="android_upgrading_title" msgid="1584192285441405746">"Android təkmilləşdirilir..."</string>
diff --git a/core/res/res/values-b+sr+Latn/strings.xml b/core/res/res/values-b+sr+Latn/strings.xml
index 1620f63..ec8f5f3 100644
--- a/core/res/res/values-b+sr+Latn/strings.xml
+++ b/core/res/res/values-b+sr+Latn/strings.xml
@@ -1038,6 +1038,8 @@
     <string name="screen_compat_mode_scale" msgid="3202955667675944499">"Razmera"</string>
     <string name="screen_compat_mode_show" msgid="4013878876486655892">"Uvek prikazuj"</string>
     <string name="screen_compat_mode_hint" msgid="1064524084543304459">"Ponovo omogućite u meniju Sistemska podešavanja &gt; Aplikacije &gt; Preuzeto."</string>
+    <string name="unsupported_display_size_message" msgid="6545327290756295232">"<xliff:g id="APP_NAME">%1$s</xliff:g> ne podržava trenutno podešavanje veličine prikaza i može da se ponaša neočekivano."</string>
+    <string name="unsupported_display_size_show" msgid="7969129195360353041">"Uvek prikazuj"</string>
     <string name="smv_application" msgid="3307209192155442829">"Aplikacija <xliff:g id="APPLICATION">%1$s</xliff:g> (proces <xliff:g id="PROCESS">%2$s</xliff:g>) je prekršila samonametnute StrictMode smernice."</string>
     <string name="smv_process" msgid="5120397012047462446">"Proces <xliff:g id="PROCESS">%1$s</xliff:g> je prekršio samonametnute StrictMode smernice."</string>
     <string name="android_upgrading_title" msgid="1584192285441405746">"Android se nadograđuje…"</string>
diff --git a/core/res/res/values-be-rBY/strings.xml b/core/res/res/values-be-rBY/strings.xml
index 6cdef81..5f95c8b 100644
--- a/core/res/res/values-be-rBY/strings.xml
+++ b/core/res/res/values-be-rBY/strings.xml
@@ -1061,6 +1061,8 @@
     <string name="screen_compat_mode_scale" msgid="3202955667675944499">"Шкала"</string>
     <string name="screen_compat_mode_show" msgid="4013878876486655892">"Заўсёды паказваць"</string>
     <string name="screen_compat_mode_hint" msgid="1064524084543304459">"Зноў уключыце гэта ў раздзеле \"Сістэмныя налады &gt; Прыкладанні &gt; Спампаваныя\"."</string>
+    <string name="unsupported_display_size_message" msgid="6545327290756295232">"<xliff:g id="APP_NAME">%1$s</xliff:g> не падтрымлівае бягучую наладу Памеру дысплэя і можа паводзіць сябе непрадказальна."</string>
+    <string name="unsupported_display_size_show" msgid="7969129195360353041">"Заўсёды паказваць"</string>
     <string name="smv_application" msgid="3307209192155442829">"Прыкладанне <xliff:g id="APPLICATION">%1$s</xliff:g> (працэс <xliff:g id="PROCESS">%2$s</xliff:g>) парушыла ўласную палітыку StrictMode."</string>
     <string name="smv_process" msgid="5120397012047462446">"Працэс <xliff:g id="PROCESS">%1$s</xliff:g> парушыў уласную палітыку StrictMode."</string>
     <string name="android_upgrading_title" msgid="1584192285441405746">"Абнаўленне Android..."</string>
diff --git a/core/res/res/values-bg/strings.xml b/core/res/res/values-bg/strings.xml
index ef9d524..a70d9dc 100644
--- a/core/res/res/values-bg/strings.xml
+++ b/core/res/res/values-bg/strings.xml
@@ -1015,6 +1015,8 @@
     <string name="screen_compat_mode_scale" msgid="3202955667675944499">"Мащаб"</string>
     <string name="screen_compat_mode_show" msgid="4013878876486655892">"Винаги да се показва"</string>
     <string name="screen_compat_mode_hint" msgid="1064524084543304459">"Активирайте отново това в „Системни настройки“ &gt; „Приложения“ &gt; „Изтеглени“."</string>
+    <string name="unsupported_display_size_message" msgid="6545327290756295232">"<xliff:g id="APP_NAME">%1$s</xliff:g> не поддържа текущата настройка за размер на дисплея и може да се държи по неочакван начин."</string>
+    <string name="unsupported_display_size_show" msgid="7969129195360353041">"Винаги да се показва"</string>
     <string name="smv_application" msgid="3307209192155442829">"Приложението „<xliff:g id="APPLICATION">%1$s</xliff:g>“ (процес „<xliff:g id="PROCESS">%2$s</xliff:g>“) наруши правилото за стриктен режим, наложено от самото него."</string>
     <string name="smv_process" msgid="5120397012047462446">"Процесът <xliff:g id="PROCESS">%1$s</xliff:g> наруши правилото за стриктен режим, наложено от самия него."</string>
     <string name="android_upgrading_title" msgid="1584192285441405746">"Android се надстройва..."</string>
diff --git a/core/res/res/values-bn-rBD/strings.xml b/core/res/res/values-bn-rBD/strings.xml
index 97e61c9..8adee9b 100644
--- a/core/res/res/values-bn-rBD/strings.xml
+++ b/core/res/res/values-bn-rBD/strings.xml
@@ -1015,6 +1015,8 @@
     <string name="screen_compat_mode_scale" msgid="3202955667675944499">"স্কেল"</string>
     <string name="screen_compat_mode_show" msgid="4013878876486655892">"সবসময় দেখান"</string>
     <string name="screen_compat_mode_hint" msgid="1064524084543304459">"সিস্টেম সেটিংস&gt; অ্যাপ্স&gt; ডাউনলোড করাগুলি এ এটি পুনঃসক্ষম করুন৷"</string>
+    <string name="unsupported_display_size_message" msgid="6545327290756295232">"<xliff:g id="APP_NAME">%1$s</xliff:g>, বর্তমান প্রদর্শনের আকারের সেটিংস সমর্থন করে না এবং অপ্রত্যাশিত আচরণ করতে পারে৷"</string>
+    <string name="unsupported_display_size_show" msgid="7969129195360353041">"সর্বদা দেখান"</string>
     <string name="smv_application" msgid="3307209192155442829">"অ্যাপ্লিকেশানটি <xliff:g id="APPLICATION">%1$s</xliff:g> (প্রক্রিয়া <xliff:g id="PROCESS">%2$s</xliff:g>) তার স্ব-প্রয়োগ করা কঠোর মোড নীতি লঙ্ঘন করেছে৷"</string>
     <string name="smv_process" msgid="5120397012047462446">"প্রক্রিয়াটি <xliff:g id="PROCESS">%1$s</xliff:g> তার স্ব-প্রয়োগ করা কঠোর মোড নীতি লঙ্ঘন করেছে৷"</string>
     <string name="android_upgrading_title" msgid="1584192285441405746">"Android আপগ্রেড করা হচ্ছে..."</string>
diff --git a/core/res/res/values-bs-rBA/strings.xml b/core/res/res/values-bs-rBA/strings.xml
index bd14448..89a12ee 100644
--- a/core/res/res/values-bs-rBA/strings.xml
+++ b/core/res/res/values-bs-rBA/strings.xml
@@ -1040,6 +1040,8 @@
     <string name="screen_compat_mode_scale" msgid="3202955667675944499">"Razmjer"</string>
     <string name="screen_compat_mode_show" msgid="4013878876486655892">"Uvijek prikaži"</string>
     <string name="screen_compat_mode_hint" msgid="1064524084543304459">"Ponovo omogućite ovu opciju u meniju Postavke sistema &gt; Aplikacije &gt; Preuzete aplikacije."</string>
+    <string name="unsupported_display_size_message" msgid="6545327290756295232">"Aplikacija <xliff:g id="APP_NAME">%1$s</xliff:g> ne podržava trenutnu postavku veličine ekrana i može se ponašati neočekivano."</string>
+    <string name="unsupported_display_size_show" msgid="7969129195360353041">"Uvijek prikaži"</string>
     <string name="smv_application" msgid="3307209192155442829">"Aplikacija <xliff:g id="APPLICATION">%1$s</xliff:g> (proces <xliff:g id="PROCESS">%2$s</xliff:g>) prekršila je vlastita StrictMode pravila."</string>
     <string name="smv_process" msgid="5120397012047462446">"Proces <xliff:g id="PROCESS">%1$s</xliff:g> prekršio je vlastita StrictMode pravila."</string>
     <string name="android_upgrading_title" msgid="1584192285441405746">"Nadogradnja sistema Android u toku..."</string>
diff --git a/core/res/res/values-ca/strings.xml b/core/res/res/values-ca/strings.xml
index 44a8f3b..977a398 100644
--- a/core/res/res/values-ca/strings.xml
+++ b/core/res/res/values-ca/strings.xml
@@ -1015,6 +1015,8 @@
     <string name="screen_compat_mode_scale" msgid="3202955667675944499">"Escala"</string>
     <string name="screen_compat_mode_show" msgid="4013878876486655892">"Mostra sempre"</string>
     <string name="screen_compat_mode_hint" msgid="1064524084543304459">"Torna a activar-ho a Configuració del sistema &gt; Aplicacions &gt; Baixades."</string>
+    <string name="unsupported_display_size_message" msgid="6545327290756295232">"<xliff:g id="APP_NAME">%1$s</xliff:g> no admet la mida de pantalla actual i és possible que funcioni de manera inesperada."</string>
+    <string name="unsupported_display_size_show" msgid="7969129195360353041">"Mostra sempre"</string>
     <string name="smv_application" msgid="3307209192155442829">"L\'aplicació <xliff:g id="APPLICATION">%1$s</xliff:g>(procés <xliff:g id="PROCESS">%2$s</xliff:g>) ha incomplert la seva política autoimposada de mode estricte."</string>
     <string name="smv_process" msgid="5120397012047462446">"El procés <xliff:g id="PROCESS">%1$s</xliff:g> ha incomplert la seva política de mode estricte."</string>
     <string name="android_upgrading_title" msgid="1584192285441405746">"Android s\'està actualitzant..."</string>
diff --git a/core/res/res/values-cs/strings.xml b/core/res/res/values-cs/strings.xml
index ba33ccd..4a142a2 100644
--- a/core/res/res/values-cs/strings.xml
+++ b/core/res/res/values-cs/strings.xml
@@ -1061,6 +1061,8 @@
     <string name="screen_compat_mode_scale" msgid="3202955667675944499">"Měřítko"</string>
     <string name="screen_compat_mode_show" msgid="4013878876486655892">"Vždy zobrazovat"</string>
     <string name="screen_compat_mode_hint" msgid="1064524084543304459">"Tento režim znovu povolíte v sekci Nastavení systému &gt; Aplikace &gt; Stažené."</string>
+    <string name="unsupported_display_size_message" msgid="6545327290756295232">"Aplikace <xliff:g id="APP_NAME">%1$s</xliff:g> aktuální nastavení velikosti zobrazení nepodporuje a může se chovat neočekávaně."</string>
+    <string name="unsupported_display_size_show" msgid="7969129195360353041">"Vždy zobrazovat"</string>
     <string name="smv_application" msgid="3307209192155442829">"Aplikace <xliff:g id="APPLICATION">%1$s</xliff:g> (proces <xliff:g id="PROCESS">%2$s</xliff:g>) porušila své vlastní vynucené zásady StrictMode."</string>
     <string name="smv_process" msgid="5120397012047462446">"Proces <xliff:g id="PROCESS">%1$s</xliff:g> porušil své vlastní vynucené zásady StrictMode."</string>
     <string name="android_upgrading_title" msgid="1584192285441405746">"Android se upgraduje..."</string>
diff --git a/core/res/res/values-da/strings.xml b/core/res/res/values-da/strings.xml
index e737f55..762c173 100644
--- a/core/res/res/values-da/strings.xml
+++ b/core/res/res/values-da/strings.xml
@@ -1015,6 +1015,8 @@
     <string name="screen_compat_mode_scale" msgid="3202955667675944499">"Skaler"</string>
     <string name="screen_compat_mode_show" msgid="4013878876486655892">"Vis altid"</string>
     <string name="screen_compat_mode_hint" msgid="1064524084543304459">"Aktivér dette igen i Systemindstillinger &gt; Apps &gt; Downloadet."</string>
+    <string name="unsupported_display_size_message" msgid="6545327290756295232">"<xliff:g id="APP_NAME">%1$s</xliff:g> understøtter ikke den aktuelle indstilling for visningsstørrelse og vil muligvis ikke fungere som forventet."</string>
+    <string name="unsupported_display_size_show" msgid="7969129195360353041">"Vis altid"</string>
     <string name="smv_application" msgid="3307209192155442829">"Appen <xliff:g id="APPLICATION">%1$s</xliff:g> (proces <xliff:g id="PROCESS">%2$s</xliff:g>) har overtrådt sin egen StrictMode-politik."</string>
     <string name="smv_process" msgid="5120397012047462446">"Processen <xliff:g id="PROCESS">%1$s</xliff:g> har overtrådt sin egen StrictMode-politik."</string>
     <string name="android_upgrading_title" msgid="1584192285441405746">"Android opgraderes..."</string>
diff --git a/core/res/res/values-de/strings.xml b/core/res/res/values-de/strings.xml
index 6bc3e4c..b163d35 100644
--- a/core/res/res/values-de/strings.xml
+++ b/core/res/res/values-de/strings.xml
@@ -1015,6 +1015,8 @@
     <string name="screen_compat_mode_scale" msgid="3202955667675944499">"Skalieren"</string>
     <string name="screen_compat_mode_show" msgid="4013878876486655892">"Immer anzeigen"</string>
     <string name="screen_compat_mode_hint" msgid="1064524084543304459">"Eine erneute Aktivierung ist in den Systemeinstellungen unter \"Apps &gt; Heruntergeladen\" möglich."</string>
+    <string name="unsupported_display_size_message" msgid="6545327290756295232">"<xliff:g id="APP_NAME">%1$s</xliff:g> unterstützt nicht die aktuelle Einstellung für die Anzeigegröße, sodass ein unerwartetes Verhalten auftreten kann."</string>
+    <string name="unsupported_display_size_show" msgid="7969129195360353041">"Immer anzeigen"</string>
     <string name="smv_application" msgid="3307209192155442829">"Die App <xliff:g id="APPLICATION">%1$s</xliff:g> (Prozess <xliff:g id="PROCESS">%2$s</xliff:g>) hat gegen deine selbsterzwungene StrictMode-Richtlinie verstoßen."</string>
     <string name="smv_process" msgid="5120397012047462446">"Der Prozess <xliff:g id="PROCESS">%1$s</xliff:g> hat gegen seine selbsterzwungene StrictMode-Richtlinie verstoßen."</string>
     <string name="android_upgrading_title" msgid="1584192285441405746">"Android wird aktualisiert..."</string>
diff --git a/core/res/res/values-el/strings.xml b/core/res/res/values-el/strings.xml
index 49ba0cf..100ee81 100644
--- a/core/res/res/values-el/strings.xml
+++ b/core/res/res/values-el/strings.xml
@@ -1015,6 +1015,8 @@
     <string name="screen_compat_mode_scale" msgid="3202955667675944499">"Κλίμακα"</string>
     <string name="screen_compat_mode_show" msgid="4013878876486655892">"Να εμφανίζονται πάντα"</string>
     <string name="screen_compat_mode_hint" msgid="1064524084543304459">"Ενεργοποιήστε το ξανά στις Ρυθμίσεις συστημάτων &gt; Εφαρμογές &gt; Ληφθείσες."</string>
+    <string name="unsupported_display_size_message" msgid="6545327290756295232">"Η εφαρμογή <xliff:g id="APP_NAME">%1$s</xliff:g> δεν υποστηρίζει την τρέχουσα ρύθμιση Μεγέθους οθόνης και ενδέχεται να παρουσιάζει μη αναμενόμενη συμπεριφορά."</string>
+    <string name="unsupported_display_size_show" msgid="7969129195360353041">"Να εμφανίζεται πάντα"</string>
     <string name="smv_application" msgid="3307209192155442829">"Η εφαρμογή <xliff:g id="APPLICATION">%1$s</xliff:g> (διεργασία <xliff:g id="PROCESS">%2$s</xliff:g>) παραβίασε την αυτοεπιβαλλόμενη πολιτική StrictMode."</string>
     <string name="smv_process" msgid="5120397012047462446">"Η διεργασία <xliff:g id="PROCESS">%1$s</xliff:g> παραβίασε την αυτοεπιβαλόμενη πολιτική StrictMode."</string>
     <string name="android_upgrading_title" msgid="1584192285441405746">"Το Android αναβαθμίζεται..."</string>
diff --git a/core/res/res/values-en-rAU/strings.xml b/core/res/res/values-en-rAU/strings.xml
index 2f9fb4b..0522882 100644
--- a/core/res/res/values-en-rAU/strings.xml
+++ b/core/res/res/values-en-rAU/strings.xml
@@ -1015,6 +1015,8 @@
     <string name="screen_compat_mode_scale" msgid="3202955667675944499">"Scale"</string>
     <string name="screen_compat_mode_show" msgid="4013878876486655892">"Always show"</string>
     <string name="screen_compat_mode_hint" msgid="1064524084543304459">"Re-enable this in System settings &gt; Apps &gt; Downloaded."</string>
+    <string name="unsupported_display_size_message" msgid="6545327290756295232">"<xliff:g id="APP_NAME">%1$s</xliff:g> does not support the current Display size setting and may behave unexpectedly."</string>
+    <string name="unsupported_display_size_show" msgid="7969129195360353041">"Always show"</string>
     <string name="smv_application" msgid="3307209192155442829">"The app <xliff:g id="APPLICATION">%1$s</xliff:g> (process <xliff:g id="PROCESS">%2$s</xliff:g>) has violated its self-enforced Strict Mode policy."</string>
     <string name="smv_process" msgid="5120397012047462446">"The process <xliff:g id="PROCESS">%1$s</xliff:g> has violated its self-enforced StrictMode policy."</string>
     <string name="android_upgrading_title" msgid="1584192285441405746">"Android is upgrading…"</string>
diff --git a/core/res/res/values-en-rGB/strings.xml b/core/res/res/values-en-rGB/strings.xml
index 2f9fb4b..0522882 100644
--- a/core/res/res/values-en-rGB/strings.xml
+++ b/core/res/res/values-en-rGB/strings.xml
@@ -1015,6 +1015,8 @@
     <string name="screen_compat_mode_scale" msgid="3202955667675944499">"Scale"</string>
     <string name="screen_compat_mode_show" msgid="4013878876486655892">"Always show"</string>
     <string name="screen_compat_mode_hint" msgid="1064524084543304459">"Re-enable this in System settings &gt; Apps &gt; Downloaded."</string>
+    <string name="unsupported_display_size_message" msgid="6545327290756295232">"<xliff:g id="APP_NAME">%1$s</xliff:g> does not support the current Display size setting and may behave unexpectedly."</string>
+    <string name="unsupported_display_size_show" msgid="7969129195360353041">"Always show"</string>
     <string name="smv_application" msgid="3307209192155442829">"The app <xliff:g id="APPLICATION">%1$s</xliff:g> (process <xliff:g id="PROCESS">%2$s</xliff:g>) has violated its self-enforced Strict Mode policy."</string>
     <string name="smv_process" msgid="5120397012047462446">"The process <xliff:g id="PROCESS">%1$s</xliff:g> has violated its self-enforced StrictMode policy."</string>
     <string name="android_upgrading_title" msgid="1584192285441405746">"Android is upgrading…"</string>
diff --git a/core/res/res/values-en-rIN/strings.xml b/core/res/res/values-en-rIN/strings.xml
index 2f9fb4b..0522882 100644
--- a/core/res/res/values-en-rIN/strings.xml
+++ b/core/res/res/values-en-rIN/strings.xml
@@ -1015,6 +1015,8 @@
     <string name="screen_compat_mode_scale" msgid="3202955667675944499">"Scale"</string>
     <string name="screen_compat_mode_show" msgid="4013878876486655892">"Always show"</string>
     <string name="screen_compat_mode_hint" msgid="1064524084543304459">"Re-enable this in System settings &gt; Apps &gt; Downloaded."</string>
+    <string name="unsupported_display_size_message" msgid="6545327290756295232">"<xliff:g id="APP_NAME">%1$s</xliff:g> does not support the current Display size setting and may behave unexpectedly."</string>
+    <string name="unsupported_display_size_show" msgid="7969129195360353041">"Always show"</string>
     <string name="smv_application" msgid="3307209192155442829">"The app <xliff:g id="APPLICATION">%1$s</xliff:g> (process <xliff:g id="PROCESS">%2$s</xliff:g>) has violated its self-enforced Strict Mode policy."</string>
     <string name="smv_process" msgid="5120397012047462446">"The process <xliff:g id="PROCESS">%1$s</xliff:g> has violated its self-enforced StrictMode policy."</string>
     <string name="android_upgrading_title" msgid="1584192285441405746">"Android is upgrading…"</string>
diff --git a/core/res/res/values-es-rUS/strings.xml b/core/res/res/values-es-rUS/strings.xml
index 2f76a33..0786b1a 100644
--- a/core/res/res/values-es-rUS/strings.xml
+++ b/core/res/res/values-es-rUS/strings.xml
@@ -1015,6 +1015,8 @@
     <string name="screen_compat_mode_scale" msgid="3202955667675944499">"Escala"</string>
     <string name="screen_compat_mode_show" msgid="4013878876486655892">"Mostrar siempre"</string>
     <string name="screen_compat_mode_hint" msgid="1064524084543304459">"Volver a activar Configuración del sistema &gt; Aplicaciones &gt; Descargas"</string>
+    <string name="unsupported_display_size_message" msgid="6545327290756295232">"<xliff:g id="APP_NAME">%1$s</xliff:g> no es compatible con la configuración del tamaño de pantalla actual. Es posible que no se comporte de manera correcta."</string>
+    <string name="unsupported_display_size_show" msgid="7969129195360353041">"Mostrar siempre"</string>
     <string name="smv_application" msgid="3307209192155442829">"La aplicación <xliff:g id="APPLICATION">%1$s</xliff:g> (proceso <xliff:g id="PROCESS">%2$s</xliff:g>) ha infringido su política StrictMode de aplicación automática."</string>
     <string name="smv_process" msgid="5120397012047462446">"El proceso <xliff:g id="PROCESS">%1$s</xliff:g> ha violado su política StrictMode autoimpuesta."</string>
     <string name="android_upgrading_title" msgid="1584192285441405746">"Android se está actualizando..."</string>
diff --git a/core/res/res/values-es/strings.xml b/core/res/res/values-es/strings.xml
index 89efca1..1909e54 100644
--- a/core/res/res/values-es/strings.xml
+++ b/core/res/res/values-es/strings.xml
@@ -1015,6 +1015,8 @@
     <string name="screen_compat_mode_scale" msgid="3202955667675944499">"Escala"</string>
     <string name="screen_compat_mode_show" msgid="4013878876486655892">"Mostrar siempre"</string>
     <string name="screen_compat_mode_hint" msgid="1064524084543304459">"Para volver a habilitar esta opción, accede a Ajustes &gt; Aplicaciones &gt; Descargadas."</string>
+    <string name="unsupported_display_size_message" msgid="6545327290756295232">"<xliff:g id="APP_NAME">%1$s</xliff:g> no admite el tamaño de pantalla actual y es posible que funcione de forma inesperada."</string>
+    <string name="unsupported_display_size_show" msgid="7969129195360353041">"Mostrar siempre"</string>
     <string name="smv_application" msgid="3307209192155442829">"La aplicación <xliff:g id="APPLICATION">%1$s</xliff:g> (proceso <xliff:g id="PROCESS">%2$s</xliff:g>) ha infringido su política StrictMode autoaplicable."</string>
     <string name="smv_process" msgid="5120397012047462446">"El proceso <xliff:g id="PROCESS">%1$s</xliff:g> ha infringido su política StrictMode autoaplicable."</string>
     <string name="android_upgrading_title" msgid="1584192285441405746">"Actualizando Android"</string>
diff --git a/core/res/res/values-et-rEE/strings.xml b/core/res/res/values-et-rEE/strings.xml
index d8f6773..14695e3 100644
--- a/core/res/res/values-et-rEE/strings.xml
+++ b/core/res/res/values-et-rEE/strings.xml
@@ -1015,6 +1015,8 @@
     <string name="screen_compat_mode_scale" msgid="3202955667675944499">"Mõõtkava"</string>
     <string name="screen_compat_mode_show" msgid="4013878876486655892">"Kuva alati"</string>
     <string name="screen_compat_mode_hint" msgid="1064524084543304459">"Lubage see uuesti valikutes Süsteemiseaded &gt; Rakendused &gt; Allalaaditud."</string>
+    <string name="unsupported_display_size_message" msgid="6545327290756295232">"Rakendus <xliff:g id="APP_NAME">%1$s</xliff:g> ei toeta praegust ekraani suuruse seadet ja võib ootamatult käituda."</string>
+    <string name="unsupported_display_size_show" msgid="7969129195360353041">"Kuva alati"</string>
     <string name="smv_application" msgid="3307209192155442829">"Rakendus <xliff:g id="APPLICATION">%1$s</xliff:g> (protsess <xliff:g id="PROCESS">%2$s</xliff:g>) on rikkunud isekehtestatud StrictMode\'i eeskirju."</string>
     <string name="smv_process" msgid="5120397012047462446">"Protsess <xliff:g id="PROCESS">%1$s</xliff:g> on rikkunud isejõustatud StrictMode\'i eeskirju."</string>
     <string name="android_upgrading_title" msgid="1584192285441405746">"Android viiakse üle uuemale versioonile ..."</string>
diff --git a/core/res/res/values-eu-rES/strings.xml b/core/res/res/values-eu-rES/strings.xml
index 6e5b178..b5e062e0 100644
--- a/core/res/res/values-eu-rES/strings.xml
+++ b/core/res/res/values-eu-rES/strings.xml
@@ -1015,6 +1015,8 @@
     <string name="screen_compat_mode_scale" msgid="3202955667675944499">"Eskala"</string>
     <string name="screen_compat_mode_show" msgid="4013878876486655892">"Erakutsi beti"</string>
     <string name="screen_compat_mode_hint" msgid="1064524084543304459">"Gaitu hori berriro Sistemaren ezarpenak &gt; Aplikazioak &gt; Deskargatutakoak."</string>
+    <string name="unsupported_display_size_message" msgid="6545327290756295232">"<xliff:g id="APP_NAME">%1$s</xliff:g> aplikazioak ez du onartzen uneko pantailaren tamaina eta espero ez bezala joka lezake."</string>
+    <string name="unsupported_display_size_show" msgid="7969129195360353041">"Erakutsi beti"</string>
     <string name="smv_application" msgid="3307209192155442829">"<xliff:g id="APPLICATION">%1$s</xliff:g> aplikazioak (<xliff:g id="PROCESS">%2$s</xliff:g> prozesua) berak aplikatutako StrictMode gidalerroa urratu du."</string>
     <string name="smv_process" msgid="5120397012047462446">"<xliff:g id="PROCESS">%1$s</xliff:g> prozesuak bere kabuz ezarritako StrictMode gidalerroak urratu ditu."</string>
     <string name="android_upgrading_title" msgid="1584192285441405746">"Android bertsio-berritzen ari da…"</string>
diff --git a/core/res/res/values-fa/strings.xml b/core/res/res/values-fa/strings.xml
index 01b636d..26684ac 100644
--- a/core/res/res/values-fa/strings.xml
+++ b/core/res/res/values-fa/strings.xml
@@ -1015,6 +1015,8 @@
     <string name="screen_compat_mode_scale" msgid="3202955667675944499">"مقیاس"</string>
     <string name="screen_compat_mode_show" msgid="4013878876486655892">"همیشه نشان داده شود"</string>
     <string name="screen_compat_mode_hint" msgid="1064524084543304459">"‏در تنظیمات سیستم &gt;برنامه‎ها &gt; مورد بارگیری شده آن را دوباره فعال کنید."</string>
+    <string name="unsupported_display_size_message" msgid="6545327290756295232">"<xliff:g id="APP_NAME">%1$s</xliff:g> از تنظیم فعلی اندازه نمایشگر پشتیبانی نمی‌کند و ممکن است رفتار غیرمنتظره‌ای داشته باشد."</string>
+    <string name="unsupported_display_size_show" msgid="7969129195360353041">"همیشه نشان داده شود"</string>
     <string name="smv_application" msgid="3307209192155442829">"‏برنامه <xliff:g id="APPLICATION">%1$s</xliff:g> (پردازش <xliff:g id="PROCESS">%2$s</xliff:g>) خط‌مشی StrictMode اجرایی خود را نقض کرده است."</string>
     <string name="smv_process" msgid="5120397012047462446">"‏فرآیند <xliff:g id="PROCESS">%1$s</xliff:g> خط‌مشی StrictMode اجرای خودکار خود را نقض کرده است."</string>
     <string name="android_upgrading_title" msgid="1584192285441405746">"‏Android در حال ارتقا است..."</string>
diff --git a/core/res/res/values-fi/strings.xml b/core/res/res/values-fi/strings.xml
index e59165e..ac827a1 100644
--- a/core/res/res/values-fi/strings.xml
+++ b/core/res/res/values-fi/strings.xml
@@ -1015,6 +1015,8 @@
     <string name="screen_compat_mode_scale" msgid="3202955667675944499">"Asteikko"</string>
     <string name="screen_compat_mode_show" msgid="4013878876486655892">"Näytä aina"</string>
     <string name="screen_compat_mode_hint" msgid="1064524084543304459">"Ota tämä uudelleen käyttöön kohdassa Järjestelmäasetukset &gt; Sovellukset &gt; Ladattu."</string>
+    <string name="unsupported_display_size_message" msgid="6545327290756295232">"<xliff:g id="APP_NAME">%1$s</xliff:g> ei tue nykyistä näytön kokoasetusta ja saattaa toimia odottamattomalla tavalla."</string>
+    <string name="unsupported_display_size_show" msgid="7969129195360353041">"Näytä aina"</string>
     <string name="smv_application" msgid="3307209192155442829">"Sovellus <xliff:g id="APPLICATION">%1$s</xliff:g> (prosessi <xliff:g id="PROCESS">%2$s</xliff:g>) on rikkonut itse käyttöön ottamaansa StrictMode-käytäntöä."</string>
     <string name="smv_process" msgid="5120397012047462446">"Prosessi <xliff:g id="PROCESS">%1$s</xliff:g> on rikkonut itse käyttöön ottamaansa StrictMode-käytäntöä."</string>
     <string name="android_upgrading_title" msgid="1584192285441405746">"Androidia päivitetään…"</string>
diff --git a/core/res/res/values-fr-rCA/strings.xml b/core/res/res/values-fr-rCA/strings.xml
index 20d4e8a..57119da 100644
--- a/core/res/res/values-fr-rCA/strings.xml
+++ b/core/res/res/values-fr-rCA/strings.xml
@@ -1015,6 +1015,8 @@
     <string name="screen_compat_mode_scale" msgid="3202955667675944499">"Redimensionner"</string>
     <string name="screen_compat_mode_show" msgid="4013878876486655892">"Toujours afficher"</string>
     <string name="screen_compat_mode_hint" msgid="1064524084543304459">"Réactivez ce mode en accédant à Paramètres système &gt; Applications &gt; Téléchargements"</string>
+    <string name="unsupported_display_size_message" msgid="6545327290756295232">"<xliff:g id="APP_NAME">%1$s</xliff:g> n\'est pas compatible avec le paramètre de taille d\'affichage actuel et peut se comporter de manière inattendue."</string>
+    <string name="unsupported_display_size_show" msgid="7969129195360353041">"Toujours afficher"</string>
     <string name="smv_application" msgid="3307209192155442829">"L\'application <xliff:g id="APPLICATION">%1$s</xliff:g> (du processus <xliff:g id="PROCESS">%2$s</xliff:g>) a enfreint ses propres règles du mode strict."</string>
     <string name="smv_process" msgid="5120397012047462446">"Le processus <xliff:g id="PROCESS">%1$s</xliff:g> a enfreint ses propres règles du mode strict."</string>
     <string name="android_upgrading_title" msgid="1584192285441405746">"Mise à jour d\'Android…"</string>
diff --git a/core/res/res/values-fr/strings.xml b/core/res/res/values-fr/strings.xml
index b7daaf4..b089991 100644
--- a/core/res/res/values-fr/strings.xml
+++ b/core/res/res/values-fr/strings.xml
@@ -1015,6 +1015,8 @@
     <string name="screen_compat_mode_scale" msgid="3202955667675944499">"Mise à l\'échelle"</string>
     <string name="screen_compat_mode_show" msgid="4013878876486655892">"Toujours afficher"</string>
     <string name="screen_compat_mode_hint" msgid="1064524084543304459">"Réactivez ce mode en accédant à Paramètres système &gt; Applications &gt; Téléchargements"</string>
+    <string name="unsupported_display_size_message" msgid="6545327290756295232">"<xliff:g id="APP_NAME">%1$s</xliff:g> n\'est pas compatible avec le paramètre de taille d\'affichage actuel et peut présenter un comportement inattendu."</string>
+    <string name="unsupported_display_size_show" msgid="7969129195360353041">"Toujours afficher"</string>
     <string name="smv_application" msgid="3307209192155442829">"L\'application <xliff:g id="APPLICATION">%1$s</xliff:g> (du processus <xliff:g id="PROCESS">%2$s</xliff:g>) a enfreint ses propres règles du mode strict."</string>
     <string name="smv_process" msgid="5120397012047462446">"Le processus <xliff:g id="PROCESS">%1$s</xliff:g> a enfreint ses propres règles du mode strict."</string>
     <string name="android_upgrading_title" msgid="1584192285441405746">"Mise à jour d\'Android…"</string>
diff --git a/core/res/res/values-gl-rES/strings.xml b/core/res/res/values-gl-rES/strings.xml
index fcccc55..08d02b8 100644
--- a/core/res/res/values-gl-rES/strings.xml
+++ b/core/res/res/values-gl-rES/strings.xml
@@ -1015,6 +1015,8 @@
     <string name="screen_compat_mode_scale" msgid="3202955667675944499">"Escala"</string>
     <string name="screen_compat_mode_show" msgid="4013878876486655892">"Mostrar sempre"</string>
     <string name="screen_compat_mode_hint" msgid="1064524084543304459">"Volve activar esta función en Configuración do sistema &gt; Aplicacións &gt; Descargadas."</string>
+    <string name="unsupported_display_size_message" msgid="6545327290756295232">"<xliff:g id="APP_NAME">%1$s</xliff:g> non admite a configuración do tamaño de pantalla actual e quizais presente un comportamento inesperado."</string>
+    <string name="unsupported_display_size_show" msgid="7969129195360353041">"Mostrar sempre"</string>
     <string name="smv_application" msgid="3307209192155442829">"A aplicación <xliff:g id="APPLICATION">%1$s</xliff:g> (proceso <xliff:g id="PROCESS">%2$s</xliff:g>) infrinxiu a súa política StrictMode autoaplicada."</string>
     <string name="smv_process" msgid="5120397012047462446">"O proceso <xliff:g id="PROCESS">%1$s</xliff:g> infrinxiu a política StrictMode de aplicación automática."</string>
     <string name="android_upgrading_title" msgid="1584192285441405746">"Estase actualizando Android…"</string>
diff --git a/core/res/res/values-gu-rIN/strings.xml b/core/res/res/values-gu-rIN/strings.xml
index f9dee58ff2..b9a9f11 100644
--- a/core/res/res/values-gu-rIN/strings.xml
+++ b/core/res/res/values-gu-rIN/strings.xml
@@ -1015,6 +1015,8 @@
     <string name="screen_compat_mode_scale" msgid="3202955667675944499">"સ્કેલ"</string>
     <string name="screen_compat_mode_show" msgid="4013878876486655892">"હંમેશા બતાવો"</string>
     <string name="screen_compat_mode_hint" msgid="1064524084543304459">"આને સિસ્ટમ સેટિંગ્સ &gt; ઍપ્લિકેશનો &gt; ડાઉનલોડ કરેલમાં ફરીથી સક્ષમ કરો."</string>
+    <string name="unsupported_display_size_message" msgid="6545327290756295232">"<xliff:g id="APP_NAME">%1$s</xliff:g> વર્તમાન પ્રદર્શન કદની સેટિંગનું સમર્થન કરતું નથી અને અનપેક્ષિત રીતે વર્તી શકે છે."</string>
+    <string name="unsupported_display_size_show" msgid="7969129195360353041">"હંમેશાં બતાવો"</string>
     <string name="smv_application" msgid="3307209192155442829">"<xliff:g id="APPLICATION">%1$s</xliff:g> ઍપ્લિકેશન (<xliff:g id="PROCESS">%2$s</xliff:g> પ્રક્રિયા)એ તેની સ્વ-લાગુ કરેલ StrictMode નીતિનું ઉલ્લંઘન કર્યું છે."</string>
     <string name="smv_process" msgid="5120397012047462446">"<xliff:g id="PROCESS">%1$s</xliff:g> પ્રક્રિયાએ તેની સ્વ-લાગુ કરેલ StrictMode નીતિનું ઉલ્લંઘન કર્યું છે."</string>
     <string name="android_upgrading_title" msgid="1584192285441405746">"Android અપગ્રેડ થઈ રહ્યું છે..."</string>
diff --git a/core/res/res/values-hi/strings.xml b/core/res/res/values-hi/strings.xml
index 4b0664f..b52ff25 100644
--- a/core/res/res/values-hi/strings.xml
+++ b/core/res/res/values-hi/strings.xml
@@ -1015,6 +1015,8 @@
     <string name="screen_compat_mode_scale" msgid="3202955667675944499">"स्केल"</string>
     <string name="screen_compat_mode_show" msgid="4013878876486655892">"हमेशा दिखाएं"</string>
     <string name="screen_compat_mode_hint" msgid="1064524084543304459">"इसे सिस्‍टम सेटिंग &gt; Apps &gt; डाउनलोड किए गए में पुन: सक्षम करें."</string>
+    <string name="unsupported_display_size_message" msgid="6545327290756295232">"<xliff:g id="APP_NAME">%1$s</xliff:g> वर्तमान स्क्रीन के आकार की सेटिंग का समर्थन नहीं करता है और अनपेक्षित रूप से व्यवहार कर सकता है."</string>
+    <string name="unsupported_display_size_show" msgid="7969129195360353041">"हमेशा दिखाएं"</string>
     <string name="smv_application" msgid="3307209192155442829">"ऐप्स <xliff:g id="APPLICATION">%1$s</xliff:g> (प्रक्रिया <xliff:g id="PROCESS">%2$s</xliff:g>) ने उसकी स्‍वयं लागू होने वाली StrictMode नीति का उल्‍लंघन किया है."</string>
     <string name="smv_process" msgid="5120397012047462446">"प्रक्रिया <xliff:g id="PROCESS">%1$s</xliff:g> ने उसकी स्‍व-प्रवर्तित StrictMode नीति का उल्‍लंघन किया है."</string>
     <string name="android_upgrading_title" msgid="1584192285441405746">"Android अपग्रेड हो रहा है..."</string>
diff --git a/core/res/res/values-hr/strings.xml b/core/res/res/values-hr/strings.xml
index 766d10b..b90f9dd 100644
--- a/core/res/res/values-hr/strings.xml
+++ b/core/res/res/values-hr/strings.xml
@@ -1038,6 +1038,8 @@
     <string name="screen_compat_mode_scale" msgid="3202955667675944499">"Mjerilo"</string>
     <string name="screen_compat_mode_show" msgid="4013878876486655892">"Uvijek prikaži"</string>
     <string name="screen_compat_mode_hint" msgid="1064524084543304459">"Omogućiti to ponovo u Postavkama sustava &gt; Aplikacije &gt; Preuzimanja."</string>
+    <string name="unsupported_display_size_message" msgid="6545327290756295232">"<xliff:g id="APP_NAME">%1$s</xliff:g> ne podržava trenutačnu postavku veličine zaslona i može se ponašati neočekivano."</string>
+    <string name="unsupported_display_size_show" msgid="7969129195360353041">"Uvijek prikaži"</string>
     <string name="smv_application" msgid="3307209192155442829">"Aplikacija <xliff:g id="APPLICATION">%1$s</xliff:g> (proces <xliff:g id="PROCESS">%2$s</xliff:g>) prekršila je vlastito pravilo StrictMode."</string>
     <string name="smv_process" msgid="5120397012047462446">"Proces <xliff:g id="PROCESS">%1$s</xliff:g> prekršio je svoje vlastito pravilo StrictMode."</string>
     <string name="android_upgrading_title" msgid="1584192285441405746">"Android se nadograđuje…"</string>
diff --git a/core/res/res/values-hu/strings.xml b/core/res/res/values-hu/strings.xml
index 5609b1f..8187e43 100644
--- a/core/res/res/values-hu/strings.xml
+++ b/core/res/res/values-hu/strings.xml
@@ -1015,6 +1015,8 @@
     <string name="screen_compat_mode_scale" msgid="3202955667675944499">"Skála"</string>
     <string name="screen_compat_mode_show" msgid="4013878876486655892">"Mindig megjelenik"</string>
     <string name="screen_compat_mode_hint" msgid="1064524084543304459">"Újbóli engedélyezés itt: Rendszerbeállítások &gt; Alkalmazások &gt; Letöltve."</string>
+    <string name="unsupported_display_size_message" msgid="6545327290756295232">"A(z) <xliff:g id="APP_NAME">%1$s</xliff:g> alkalmazás nem támogatja a képernyőméret jelenlegi beállításait, ezért nem várt módon viselkedhet."</string>
+    <string name="unsupported_display_size_show" msgid="7969129195360353041">"Mindig megjelenik"</string>
     <string name="smv_application" msgid="3307209192155442829">"A(z) <xliff:g id="APPLICATION">%1$s</xliff:g> alkalmazás (<xliff:g id="PROCESS">%2$s</xliff:g> folyamat) megsértette az általa kényszerített Szigorú üzemmód irányelvet."</string>
     <string name="smv_process" msgid="5120397012047462446">"<xliff:g id="PROCESS">%1$s</xliff:g> folyamat megsértette az általa kényszerített Szigorú üzemmód irányelvet."</string>
     <string name="android_upgrading_title" msgid="1584192285441405746">"Android frissítése folyamatban..."</string>
diff --git a/core/res/res/values-hy-rAM/strings.xml b/core/res/res/values-hy-rAM/strings.xml
index d2ff283..58f3d8e 100644
--- a/core/res/res/values-hy-rAM/strings.xml
+++ b/core/res/res/values-hy-rAM/strings.xml
@@ -1015,6 +1015,8 @@
     <string name="screen_compat_mode_scale" msgid="3202955667675944499">"Աստիճանակարգել"</string>
     <string name="screen_compat_mode_show" msgid="4013878876486655892">"Միշտ ցույց տալ"</string>
     <string name="screen_compat_mode_hint" msgid="1064524084543304459">"Կրկին ակտիվացնել սա Համակարգի կարգավորումներում &amp;gt Ծրագրեր &gt; Ներբեռնումներ:"</string>
+    <string name="unsupported_display_size_message" msgid="6545327290756295232">"<xliff:g id="APP_NAME">%1$s</xliff:g> հավելվածը չի աջակցում Էկրանի չափի ընթացիկ կարգավորումները, ինչի պատճառով կարող են խնդիրներ առաջանալ:"</string>
+    <string name="unsupported_display_size_show" msgid="7969129195360353041">"Միշտ ցուցադրել"</string>
     <string name="smv_application" msgid="3307209192155442829">"<xliff:g id="APPLICATION">%1$s</xliff:g> ծրագիրը (գործընթաց <xliff:g id="PROCESS">%2$s</xliff:g>) խախտել է իր ինքնահարկադրված Խիստ ռեժիմ  քաղաքականությունը:"</string>
     <string name="smv_process" msgid="5120397012047462446">"<xliff:g id="PROCESS">%1$s</xliff:g> գործընթացը խախտել է իր ինքնահարկադրված Խիստ ռեժիմ քաղաքականությունը:"</string>
     <string name="android_upgrading_title" msgid="1584192285441405746">"Android-ը նորացվում է..."</string>
diff --git a/core/res/res/values-in/strings.xml b/core/res/res/values-in/strings.xml
index da0afc8..bd17260 100644
--- a/core/res/res/values-in/strings.xml
+++ b/core/res/res/values-in/strings.xml
@@ -1015,6 +1015,8 @@
     <string name="screen_compat_mode_scale" msgid="3202955667675944499">"Skala"</string>
     <string name="screen_compat_mode_show" msgid="4013878876486655892">"Selalu tampilkan"</string>
     <string name="screen_compat_mode_hint" msgid="1064524084543304459">"Aktifkan kembali dialog ini di Setelan sistem &gt; Apl &gt; Terunduh."</string>
+    <string name="unsupported_display_size_message" msgid="6545327290756295232">"<xliff:g id="APP_NAME">%1$s</xliff:g> tidak mendukung setelan Ukuran layar saat ini dan dapat menunjukkan perilaku yang tak diharapkan."</string>
+    <string name="unsupported_display_size_show" msgid="7969129195360353041">"Selalu tampilkan"</string>
     <string name="smv_application" msgid="3307209192155442829">"Apl <xliff:g id="APPLICATION">%1$s</xliff:g> (proses <xliff:g id="PROCESS">%2$s</xliff:g>) telah melanggar kebijakan StrictMode yang diberlakukannya sendiri."</string>
     <string name="smv_process" msgid="5120397012047462446">"Proses <xliff:g id="PROCESS">%1$s</xliff:g> telah melanggar kebijakan StrictMode yang diberlakukan secara otomatis."</string>
     <string name="android_upgrading_title" msgid="1584192285441405746">"Android sedang meningkatkan versi..."</string>
diff --git a/core/res/res/values-is-rIS/strings.xml b/core/res/res/values-is-rIS/strings.xml
index 661f5b5..58f5d9a 100644
--- a/core/res/res/values-is-rIS/strings.xml
+++ b/core/res/res/values-is-rIS/strings.xml
@@ -1015,6 +1015,8 @@
     <string name="screen_compat_mode_scale" msgid="3202955667675944499">"Breyta stærð"</string>
     <string name="screen_compat_mode_show" msgid="4013878876486655892">"Sýna alltaf"</string>
     <string name="screen_compat_mode_hint" msgid="1064524084543304459">"Þú getur kveikt aftur á þessu undir Kerfisstillingar &gt; Forrit &gt; Sótt."</string>
+    <string name="unsupported_display_size_message" msgid="6545327290756295232">"<xliff:g id="APP_NAME">%1$s</xliff:g> styður ekki núverandi skjástærðarstillingu og gæti því ekki virkað sem skyldi."</string>
+    <string name="unsupported_display_size_show" msgid="7969129195360353041">"Sýna alltaf"</string>
     <string name="smv_application" msgid="3307209192155442829">"Forritið <xliff:g id="APPLICATION">%1$s</xliff:g> (ferli <xliff:g id="PROCESS">%2$s</xliff:g>) hefur brotið gegn eigin StrictMode-stefnu."</string>
     <string name="smv_process" msgid="5120397012047462446">"Forritið <xliff:g id="PROCESS">%1$s</xliff:g> braut gegn eigin StrictMode-stefnu."</string>
     <string name="android_upgrading_title" msgid="1584192285441405746">"Android er að uppfæra…"</string>
diff --git a/core/res/res/values-it/strings.xml b/core/res/res/values-it/strings.xml
index d32e959..bfadb9d 100644
--- a/core/res/res/values-it/strings.xml
+++ b/core/res/res/values-it/strings.xml
@@ -1015,6 +1015,8 @@
     <string name="screen_compat_mode_scale" msgid="3202955667675944499">"Scala"</string>
     <string name="screen_compat_mode_show" msgid="4013878876486655892">"Mostra sempre"</string>
     <string name="screen_compat_mode_hint" msgid="1064524084543304459">"Riattivala in Impostazioni di sistema &gt; Applicazioni &gt; Scaricate."</string>
+    <string name="unsupported_display_size_message" msgid="6545327290756295232">"<xliff:g id="APP_NAME">%1$s</xliff:g> non supporta le dimensioni di visualizzazione attualmente impostate e potrebbe comportarsi in modo imprevisto."</string>
+    <string name="unsupported_display_size_show" msgid="7969129195360353041">"Mostra sempre"</string>
     <string name="smv_application" msgid="3307209192155442829">"L\'applicazione <xliff:g id="APPLICATION">%1$s</xliff:g> (processo <xliff:g id="PROCESS">%2$s</xliff:g>) ha violato la norma StrictMode autoimposta."</string>
     <string name="smv_process" msgid="5120397012047462446">"Il processo <xliff:g id="PROCESS">%1$s</xliff:g> ha violato la norma StrictMode autoimposta."</string>
     <string name="android_upgrading_title" msgid="1584192285441405746">"Aggiornamento di Android..."</string>
diff --git a/core/res/res/values-iw/strings.xml b/core/res/res/values-iw/strings.xml
index 254bba9..c2ba6f3 100644
--- a/core/res/res/values-iw/strings.xml
+++ b/core/res/res/values-iw/strings.xml
@@ -1061,6 +1061,8 @@
     <string name="screen_compat_mode_scale" msgid="3202955667675944499">"שינוי קנה-מידה"</string>
     <string name="screen_compat_mode_show" msgid="4013878876486655892">"הצג תמיד"</string>
     <string name="screen_compat_mode_hint" msgid="1064524084543304459">"‏אפשר תכונה זו מחדש ב\'הגדרות מערכת\' &lt;‏ Google Apps‏ &lt; \'הורדות\'."</string>
+    <string name="unsupported_display_size_message" msgid="6545327290756295232">"<xliff:g id="APP_NAME">%1$s</xliff:g> אינו תומך בהגדרת הגודל הנוכחית של התצוגה, והתנהגותו עשויה להיות בלתי צפויה."</string>
+    <string name="unsupported_display_size_show" msgid="7969129195360353041">"הצג תמיד"</string>
     <string name="smv_application" msgid="3307209192155442829">"‏האפליקציה <xliff:g id="APPLICATION">%1$s</xliff:g> (תהליך <xliff:g id="PROCESS">%2$s</xliff:g>) הפר את מדיניות StrictMode באכיפה עצמית שלו."</string>
     <string name="smv_process" msgid="5120397012047462446">"‏התהליך <xliff:g id="PROCESS">%1$s</xliff:g> הפר את מדיניות StrictMode באכיפה עצמית."</string>
     <string name="android_upgrading_title" msgid="1584192285441405746">"‏Android מבצע שדרוג…"</string>
diff --git a/core/res/res/values-ja/strings.xml b/core/res/res/values-ja/strings.xml
index c7529b7..c7c404e 100644
--- a/core/res/res/values-ja/strings.xml
+++ b/core/res/res/values-ja/strings.xml
@@ -1015,6 +1015,8 @@
     <string name="screen_compat_mode_scale" msgid="3202955667675944499">"スケール"</string>
     <string name="screen_compat_mode_show" msgid="4013878876486655892">"常に表示"</string>
     <string name="screen_compat_mode_hint" msgid="1064524084543304459">"[システム設定]&gt;[アプリ]&gt;[ダウンロード済み]で再度有効にします。"</string>
+    <string name="unsupported_display_size_message" msgid="6545327290756295232">"「<xliff:g id="APP_NAME">%1$s</xliff:g>」は現在の [表示サイズ] 設定に対応していないため、予期しない動作が発生するおそれがあります。"</string>
+    <string name="unsupported_display_size_show" msgid="7969129195360353041">"常に表示"</string>
     <string name="smv_application" msgid="3307209192155442829">"アプリ「<xliff:g id="APPLICATION">%1$s</xliff:g>」(プロセス「<xliff:g id="PROCESS">%2$s</xliff:g>」)でStrictModeポリシー違反がありました。"</string>
     <string name="smv_process" msgid="5120397012047462446">"プロセス<xliff:g id="PROCESS">%1$s</xliff:g>でStrictModeポリシー違反がありました。"</string>
     <string name="android_upgrading_title" msgid="1584192285441405746">"Androidをアップグレードしています..."</string>
diff --git a/core/res/res/values-ka-rGE/strings.xml b/core/res/res/values-ka-rGE/strings.xml
index 5f5ded9..0d27ea5 100644
--- a/core/res/res/values-ka-rGE/strings.xml
+++ b/core/res/res/values-ka-rGE/strings.xml
@@ -1015,6 +1015,8 @@
     <string name="screen_compat_mode_scale" msgid="3202955667675944499">"მასშტაბი"</string>
     <string name="screen_compat_mode_show" msgid="4013878876486655892">"ყოველთვის ჩვენება"</string>
     <string name="screen_compat_mode_hint" msgid="1064524084543304459">"ხელახალი გააქტიურება განყოფილებაში: სისტემის პარამეტრები &gt; აპები &gt; ჩამოტვირთულები."</string>
+    <string name="unsupported_display_size_message" msgid="6545327290756295232">"<xliff:g id="APP_NAME">%1$s</xliff:g>-ის მიერ ეკრანის ამჟამინდელი პარამეტრები მხარდაუჭერელია და შეიძლება არასათანადოდ იმუშაოს."</string>
+    <string name="unsupported_display_size_show" msgid="7969129195360353041">"ყოველთვის ჩვენება"</string>
     <string name="smv_application" msgid="3307209192155442829">"აპმა <xliff:g id="APPLICATION">%1$s</xliff:g> (პროცესი <xliff:g id="PROCESS">%2$s</xliff:g>) დაარღვია საკუთარი StrictMode დებულება."</string>
     <string name="smv_process" msgid="5120397012047462446">"ამ პროცესმა <xliff:g id="PROCESS">%1$s</xliff:g> დააზიანა საკუთარი StrictMode დებულება."</string>
     <string name="android_upgrading_title" msgid="1584192285441405746">"Android ახალ ვერსიაზე გადადის…"</string>
diff --git a/core/res/res/values-kk-rKZ/strings.xml b/core/res/res/values-kk-rKZ/strings.xml
index c5c19c8..5908bfa 100644
--- a/core/res/res/values-kk-rKZ/strings.xml
+++ b/core/res/res/values-kk-rKZ/strings.xml
@@ -1015,6 +1015,8 @@
     <string name="screen_compat_mode_scale" msgid="3202955667675944499">"Меже"</string>
     <string name="screen_compat_mode_show" msgid="4013878876486655892">"Үнемі көрсету"</string>
     <string name="screen_compat_mode_hint" msgid="1064524084543304459">"Мұны «Жүйелік параметрлер» &gt; «Қолданбалар» &gt; «Жүктелгендер» тармағында қосыңыз."</string>
+    <string name="unsupported_display_size_message" msgid="6545327290756295232">"<xliff:g id="APP_NAME">%1$s</xliff:g> қолданбасында \"Дисплей өлшемі\" параметріне қолдау көрсетілмейді және күткендей жұмыс істемеуі мүмкін."</string>
+    <string name="unsupported_display_size_show" msgid="7969129195360353041">"Үнемі көрсету"</string>
     <string name="smv_application" msgid="3307209192155442829">"<xliff:g id="APPLICATION">%1$s</xliff:g> қолданбасы (<xliff:g id="PROCESS">%2$s</xliff:g> процесі) өзі қолданған StrictMode саясатын бұзды."</string>
     <string name="smv_process" msgid="5120397012047462446">"<xliff:g id="PROCESS">%1$s</xliff:g> үрдісі өздігінен күшіне енген ҚатаңРежим ережесін бұзды."</string>
     <string name="android_upgrading_title" msgid="1584192285441405746">"Android жаңартылуда…"</string>
diff --git a/core/res/res/values-km-rKH/strings.xml b/core/res/res/values-km-rKH/strings.xml
index 36ed267..0256ddc 100644
--- a/core/res/res/values-km-rKH/strings.xml
+++ b/core/res/res/values-km-rKH/strings.xml
@@ -1017,6 +1017,8 @@
     <string name="screen_compat_mode_scale" msgid="3202955667675944499">"មាត្រដ្ឋាន"</string>
     <string name="screen_compat_mode_show" msgid="4013878876486655892">"បង្ហាញ​ជា​និច្ច"</string>
     <string name="screen_compat_mode_hint" msgid="1064524084543304459">"បើក​វា​ឡើងវិញ​ក្នុង​ការ​កំណត់​ប្រព័ន្ធ &gt; កម្មវិធី &gt; ទាញ​យក។"</string>
+    <string name="unsupported_display_size_message" msgid="6545327290756295232">"<xliff:g id="APP_NAME">%1$s</xliff:g> មិនគាំទ្រការកំណត់ទំហំនៃការបង្ហាញបច្ចុប្បន្ន និងអាចមានសកម្មភាពខុសពីការរំពឹងទុក។"</string>
+    <string name="unsupported_display_size_show" msgid="7969129195360353041">"បង្ហាញ​ជា​និច្ច"</string>
     <string name="smv_application" msgid="3307209192155442829">"កម្មវិធី <xliff:g id="APPLICATION">%1$s</xliff:g> (ដំណើរការ <xliff:g id="PROCESS">%2$s</xliff:g>) បាន​បំពាន​គោលនយោបាយ​របៀប​តឹងរ៉ឹង​អនុវត្ត​ដោយ​ខ្លួន​​ឯង។"</string>
     <string name="smv_process" msgid="5120397012047462446">"ដំណើរការ <xliff:g id="PROCESS">%1$s</xliff:g> បាន​បំពាន​គោលនយោបាយ​​របៀប​​តឹង​រឹង​​​បង្ខំ​ដោយ​ខ្លួន​ឯង"</string>
     <string name="android_upgrading_title" msgid="1584192285441405746">"Android កំពុង​ធ្វើ​បច្ចុប្បន្នភាព..."</string>
diff --git a/core/res/res/values-kn-rIN/strings.xml b/core/res/res/values-kn-rIN/strings.xml
index b898e14..26bbbc6 100644
--- a/core/res/res/values-kn-rIN/strings.xml
+++ b/core/res/res/values-kn-rIN/strings.xml
@@ -1015,6 +1015,8 @@
     <string name="screen_compat_mode_scale" msgid="3202955667675944499">"ಮಾಪಕ"</string>
     <string name="screen_compat_mode_show" msgid="4013878876486655892">"ಯಾವಾಗಲೂ ತೋರಿಸಿ"</string>
     <string name="screen_compat_mode_hint" msgid="1064524084543304459">"ಸಿಸ್ಟಂ ಸೆಟ್ಟಿಂಗ್‌ಗಳು &gt; ಅಪ್ಲಿಕೇಶನ್‌ಗಳು &gt; ಡೌನ್‌ಲೋಡ್‌ ಆಗಿರುವುದರಲ್ಲಿ ಇದನ್ನು ಮರು ಸಕ್ರಿಯಗೊಳಿಸಿ."</string>
+    <string name="unsupported_display_size_message" msgid="6545327290756295232">"<xliff:g id="APP_NAME">%1$s</xliff:g> ಪ್ರಸ್ತುತ ಪ್ರದರ್ಶನ ಗಾತ್ರದ ಸೆಟ್ಟಿಂಗ್‌ ಅನ್ನು ಬೆಂಬಲಿಸುವುದಿಲ್ಲ ಮತ್ತು ಅನಿರೀಕ್ಷಿತವಾಗಿ ವರ್ತಿಸಬಹುದು."</string>
+    <string name="unsupported_display_size_show" msgid="7969129195360353041">"ಯಾವಾಗಲೂ ತೋರಿಸು"</string>
     <string name="smv_application" msgid="3307209192155442829">"ಅಪ್ಲಿಕೇಶನ್‌‌ <xliff:g id="APPLICATION">%1$s</xliff:g> (ಪ್ರಕ್ರಿಯೆಯು <xliff:g id="PROCESS">%2$s</xliff:g>) ತನ್ನ ಸ್ವಯಂ-ಜಾರಿ ಕಠಿಣ ಮೋಡ್ ನೀತಿಯನ್ನು ಉಲ್ಲಂಘನೆ ಮಾಡಿದೆ."</string>
     <string name="smv_process" msgid="5120397012047462446">"<xliff:g id="PROCESS">%1$s</xliff:g> ಪ್ರಕ್ರಿಯೆಯು ತನ್ನ ಸ್ವಯಂ-ಜಾರಿ ಕಠಿಣ ಮೋಡ್ ನೀತಿಯನ್ನು ಉಲ್ಲಂಘನೆ ಮಾಡಿದೆ."</string>
     <string name="android_upgrading_title" msgid="1584192285441405746">"Android ಅಪ್‌ಗ್ರೇಡ್‌ ಮಾಡಲಾಗುತ್ತಿದೆ…"</string>
diff --git a/core/res/res/values-ko/strings.xml b/core/res/res/values-ko/strings.xml
index 8a4dbc9..254adc82 100644
--- a/core/res/res/values-ko/strings.xml
+++ b/core/res/res/values-ko/strings.xml
@@ -1015,6 +1015,8 @@
     <string name="screen_compat_mode_scale" msgid="3202955667675944499">"배율"</string>
     <string name="screen_compat_mode_show" msgid="4013878876486655892">"항상 표시"</string>
     <string name="screen_compat_mode_hint" msgid="1064524084543304459">"시스템 설정 &gt; 앱 &gt; 다운로드로 이동하여 이 모드를 다시 사용하도록 설정합니다."</string>
+    <string name="unsupported_display_size_message" msgid="6545327290756295232">"<xliff:g id="APP_NAME">%1$s</xliff:g> 앱은 현재 디스플레이 크기 설정을 지원하지 않으며 예기치 않게 동작할 수 있습니다."</string>
+    <string name="unsupported_display_size_show" msgid="7969129195360353041">"항상 표시"</string>
     <string name="smv_application" msgid="3307209192155442829">"앱 <xliff:g id="APPLICATION">%1$s</xliff:g>(프로세스 <xliff:g id="PROCESS">%2$s</xliff:g>)이(가) 자체 시행 StrictMode 정책을 위반했습니다."</string>
     <string name="smv_process" msgid="5120397012047462446">"프로세스(<xliff:g id="PROCESS">%1$s</xliff:g>)가 자체 시행 StrictMode 정책을 위반했습니다."</string>
     <string name="android_upgrading_title" msgid="1584192285441405746">"Android 업그레이드 중.."</string>
diff --git a/core/res/res/values-ky-rKG/strings.xml b/core/res/res/values-ky-rKG/strings.xml
index 3ffc2b7..a18ac62 100644
--- a/core/res/res/values-ky-rKG/strings.xml
+++ b/core/res/res/values-ky-rKG/strings.xml
@@ -1015,6 +1015,8 @@
     <string name="screen_compat_mode_scale" msgid="3202955667675944499">"Шкала"</string>
     <string name="screen_compat_mode_show" msgid="4013878876486655892">"Ар дайым көрсөтүлсүн"</string>
     <string name="screen_compat_mode_hint" msgid="1064524084543304459">"Муну тутум жөндөөлөрүнөн кайра иштетүү &gt; Колдонмолор &gt; Жүктөлүп алынган."</string>
+    <string name="unsupported_display_size_message" msgid="6545327290756295232">"<xliff:g id="APP_NAME">%1$s</xliff:g> колдонмосу учурдагы дисплей өлчөмүнүн жөндөөлөрүн колдоого албагандыктан, күтүүсүз аракеттерди жасашы мүмкүн."</string>
+    <string name="unsupported_display_size_show" msgid="7969129195360353041">"Ар дайым көрсөтүлсүн"</string>
     <string name="smv_application" msgid="3307209192155442829">"<xliff:g id="APPLICATION">%1$s</xliff:g> колдонмосу (<xliff:g id="PROCESS">%2$s</xliff:g> процесси) өз алдынча иштеткен StrictMode саясатын бузду."</string>
     <string name="smv_process" msgid="5120397012047462446">"<xliff:g id="PROCESS">%1$s</xliff:g> процесси өзүнүн мажбурланган StrictMode саясатын бузуп койду."</string>
     <string name="android_upgrading_title" msgid="1584192285441405746">"Android жаңыртылууда…"</string>
diff --git a/core/res/res/values-lo-rLA/strings.xml b/core/res/res/values-lo-rLA/strings.xml
index 6fda52a..1ef7622 100644
--- a/core/res/res/values-lo-rLA/strings.xml
+++ b/core/res/res/values-lo-rLA/strings.xml
@@ -1015,6 +1015,8 @@
     <string name="screen_compat_mode_scale" msgid="3202955667675944499">"ຂະໜາດ"</string>
     <string name="screen_compat_mode_show" msgid="4013878876486655892">"ສະແດງຕະຫຼອດເວລາ"</string>
     <string name="screen_compat_mode_hint" msgid="1064524084543304459">"ເປີດການເຮັດວຽກນີ້ຄືນໄດ້ໃນ ການຕັ້ງຄ່າລະບົບ &gt; ແອັບຯ &gt; ດາວໂຫລດແລ້ວ"</string>
+    <string name="unsupported_display_size_message" msgid="6545327290756295232">"<xliff:g id="APP_NAME">%1$s</xliff:g> ບໍ່ຮອງຮັບການຕັ້ງຄ່າຂະໜາດສະແດງຜົນປັດຈຸບັນ ແລະ ອາດມີຄວາມຜິດພາດໄດ້."</string>
+    <string name="unsupported_display_size_show" msgid="7969129195360353041">"ສະແດງທຸກເທື່ອ"</string>
     <string name="smv_application" msgid="3307209192155442829">"ແອັບຯ <xliff:g id="APPLICATION">%1$s</xliff:g> (ໂປຣເຊສ <xliff:g id="PROCESS">%2$s</xliff:g>) ໄດ້ລະເມີດນະໂຍບາຍ StrictMode ທີ່ບັງຄັບໃຊ້ດ້ວຍໂຕເອງ."</string>
     <string name="smv_process" msgid="5120397012047462446">"ໂປຣເຊສ <xliff:g id="PROCESS">%1$s</xliff:g> ລະເມີດນະໂຍບາຍບັງຄັບໃຊ້ເອງ StrictMode."</string>
     <string name="android_upgrading_title" msgid="1584192285441405746">"ກຳລັງອັບເກຣດ Android..."</string>
diff --git a/core/res/res/values-lt/strings.xml b/core/res/res/values-lt/strings.xml
index adc071d..80ff67e 100644
--- a/core/res/res/values-lt/strings.xml
+++ b/core/res/res/values-lt/strings.xml
@@ -1061,6 +1061,8 @@
     <string name="screen_compat_mode_scale" msgid="3202955667675944499">"Mastelis"</string>
     <string name="screen_compat_mode_show" msgid="4013878876486655892">"Visada rodyti"</string>
     <string name="screen_compat_mode_hint" msgid="1064524084543304459">"Įgalinkite jį iš naujo nuėję į „Sistemos nustatymai“ &gt; „Programos“ &gt; „Atsisiųsta“."</string>
+    <string name="unsupported_display_size_message" msgid="6545327290756295232">"Programoje „<xliff:g id="APP_NAME">%1$s</xliff:g>“ nepalaikomas dabartinis ekrano dydžio nustatymas ir ji gali netinkamai veikti."</string>
+    <string name="unsupported_display_size_show" msgid="7969129195360353041">"Visada rodyti"</string>
     <string name="smv_application" msgid="3307209192155442829">"Programa „<xliff:g id="APPLICATION">%1$s</xliff:g>“ (procesas „<xliff:g id="PROCESS">%2$s</xliff:g>“) pažeidė savo vykdomą „StrictMode“ politiką."</string>
     <string name="smv_process" msgid="5120397012047462446">"„<xliff:g id="PROCESS">%1$s</xliff:g>“ procesas pažeidė savo vykdomą „StrictMode“ politiką."</string>
     <string name="android_upgrading_title" msgid="1584192285441405746">"„Android“ naujovinama..."</string>
diff --git a/core/res/res/values-lv/strings.xml b/core/res/res/values-lv/strings.xml
index 47f1f26..210d05b 100644
--- a/core/res/res/values-lv/strings.xml
+++ b/core/res/res/values-lv/strings.xml
@@ -1038,6 +1038,8 @@
     <string name="screen_compat_mode_scale" msgid="3202955667675944499">"Mērogs"</string>
     <string name="screen_compat_mode_show" msgid="4013878876486655892">"Rādīt vienmēr"</string>
     <string name="screen_compat_mode_hint" msgid="1064524084543304459">"Atkārtoti iespējojiet šeit: Sistēmas iestatījumi &gt; Lietotnes &gt; Lejupielādētās."</string>
+    <string name="unsupported_display_size_message" msgid="6545327290756295232">"Lietotnē <xliff:g id="APP_NAME">%1$s</xliff:g> netiek atbalstīts pašreizējais displeja lieluma iestatījums, tādēļ tā var tikt attēlota neparedzētā veidā."</string>
+    <string name="unsupported_display_size_show" msgid="7969129195360353041">"Rādīt vienmēr"</string>
     <string name="smv_application" msgid="3307209192155442829">"Lietotne <xliff:g id="APPLICATION">%1$s</xliff:g> (process <xliff:g id="PROCESS">%2$s</xliff:g>) ir pārkāpusi savu pašieviesto StrictMode politiku."</string>
     <string name="smv_process" msgid="5120397012047462446">"Process <xliff:g id="PROCESS">%1$s</xliff:g> ir pārkāpis savu pašieviesto StrictMode politiku."</string>
     <string name="android_upgrading_title" msgid="1584192285441405746">"Notiek Android jaunināšana..."</string>
diff --git a/core/res/res/values-mk-rMK/strings.xml b/core/res/res/values-mk-rMK/strings.xml
index 845a42d..2519dd9 100644
--- a/core/res/res/values-mk-rMK/strings.xml
+++ b/core/res/res/values-mk-rMK/strings.xml
@@ -1015,6 +1015,8 @@
     <string name="screen_compat_mode_scale" msgid="3202955667675944499">"Размер"</string>
     <string name="screen_compat_mode_show" msgid="4013878876486655892">"Покажи секогаш"</string>
     <string name="screen_compat_mode_hint" msgid="1064524084543304459">"Повторно овозможете го ова во Системски поставки &gt; Апликации &gt; Преземено."</string>
+    <string name="unsupported_display_size_message" msgid="6545327290756295232">"<xliff:g id="APP_NAME">%1$s</xliff:g> не ја поддржува тековната поставка за големина на екранот и може да се однесува непредвидено."</string>
+    <string name="unsupported_display_size_show" msgid="7969129195360353041">"Секогаш прикажувај"</string>
     <string name="smv_application" msgid="3307209192155442829">"Апликацијата <xliff:g id="APPLICATION">%1$s</xliff:g> (процес <xliff:g id="PROCESS">%2$s</xliff:g>) ја прекрши политиката StrictMode што си ја наметна врз себеси."</string>
     <string name="smv_process" msgid="5120397012047462446">"Процесот <xliff:g id="PROCESS">%1$s</xliff:g> ја прекрши својата самонаметната политика на строг режим."</string>
     <string name="android_upgrading_title" msgid="1584192285441405746">"Android се ажурира…"</string>
diff --git a/core/res/res/values-ml-rIN/strings.xml b/core/res/res/values-ml-rIN/strings.xml
index 7b18d91..9d8c274 100644
--- a/core/res/res/values-ml-rIN/strings.xml
+++ b/core/res/res/values-ml-rIN/strings.xml
@@ -1015,6 +1015,8 @@
     <string name="screen_compat_mode_scale" msgid="3202955667675944499">"സ്കെയിൽ"</string>
     <string name="screen_compat_mode_show" msgid="4013878876486655892">"എപ്പോഴും പ്രദര്‍ശിപ്പിക്കുക"</string>
     <string name="screen_compat_mode_hint" msgid="1064524084543304459">"സിസ്‌റ്റം ക്രമീകരണങ്ങൾ &gt; അപ്ലിക്കേഷനുകൾ &gt; ഡൗൺലോഡുചെയ്‌തവ എന്നതിൽ ഇത് വീണ്ടും പ്രവർത്തനക്ഷമമാക്കുക."</string>
+    <string name="unsupported_display_size_message" msgid="6545327290756295232">"നിലവിലെ ഡിസ്പ്ലേ വലുപ്പ ക്രമീകരണത്തെ <xliff:g id="APP_NAME">%1$s</xliff:g> പിന്തുണയ്ക്കുന്നില്ല, അതിനാൽ പ്രതീക്ഷിക്കാത്ത തരത്തിൽ ആപ്പ് പ്രവർത്തിച്ചേക്കാം."</string>
+    <string name="unsupported_display_size_show" msgid="7969129195360353041">"എല്ലായ്‌പ്പോഴും ദൃശ്യമാക്കുക"</string>
     <string name="smv_application" msgid="3307209192155442829">"<xliff:g id="APPLICATION">%1$s</xliff:g> എന്ന അപ്ലിക്കേഷൻ (<xliff:g id="PROCESS">%2$s</xliff:g> പ്രോസസ്സ്) അതിന്റെ സ്വയം നിർബന്ധിത StrictMode നയം ലംഘിച്ചു."</string>
     <string name="smv_process" msgid="5120397012047462446">"<xliff:g id="PROCESS">%1$s</xliff:g> എന്ന പ്രോസസ്സ് അതിന്റെ സ്വയം നടപ്പിലാക്കിയ StrictMode നയം ലംഘിച്ചു."</string>
     <string name="android_upgrading_title" msgid="1584192285441405746">"Android അപ്ഗ്രേഡുചെയ്യുന്നു…"</string>
diff --git a/core/res/res/values-mn-rMN/strings.xml b/core/res/res/values-mn-rMN/strings.xml
index 4f10c45..f54a485 100644
--- a/core/res/res/values-mn-rMN/strings.xml
+++ b/core/res/res/values-mn-rMN/strings.xml
@@ -1015,6 +1015,8 @@
     <string name="screen_compat_mode_scale" msgid="3202955667675944499">"Цар хэмжээ"</string>
     <string name="screen_compat_mode_show" msgid="4013878876486655892">"Байнга харуулах"</string>
     <string name="screen_compat_mode_hint" msgid="1064524084543304459">"Энийг Системийн тохиргоо &gt; Апп &gt; Татаж авсан дотроос дахин идэвхтэй болгох боломжтой."</string>
+    <string name="unsupported_display_size_message" msgid="6545327290756295232">"<xliff:g id="APP_NAME">%1$s</xliff:g> нь Дэлгэцийн хэмжээний одоогийн тохиргоог дэмждэггүй учир буруу ажиллаж болзошгүй."</string>
+    <string name="unsupported_display_size_show" msgid="7969129195360353041">"Байнга харуулах"</string>
     <string name="smv_application" msgid="3307209192155442829">"<xliff:g id="APPLICATION">%1$s</xliff:g> апп (<xliff:g id="PROCESS">%2$s</xliff:g> процесс) өөрийнхөө StrictMode бодлогыг зөрчив."</string>
     <string name="smv_process" msgid="5120397012047462446">"<xliff:g id="PROCESS">%1$s</xliff:g> процесс өөрийнхөө StrictMode бодлогыг зөрчив."</string>
     <string name="android_upgrading_title" msgid="1584192285441405746">"Андройдыг дэвшүүлж байна…"</string>
diff --git a/core/res/res/values-mr-rIN/strings.xml b/core/res/res/values-mr-rIN/strings.xml
index e2d11c8..728c3a1 100644
--- a/core/res/res/values-mr-rIN/strings.xml
+++ b/core/res/res/values-mr-rIN/strings.xml
@@ -1015,6 +1015,8 @@
     <string name="screen_compat_mode_scale" msgid="3202955667675944499">"स्केल"</string>
     <string name="screen_compat_mode_show" msgid="4013878876486655892">"नेहमी दर्शवा"</string>
     <string name="screen_compat_mode_hint" msgid="1064524084543304459">"सिस्टीम सेटिंग्ज &gt; Apps &gt; डाउनलोड केलेले मध्ये हे पुन्हा-सक्षम करा."</string>
+    <string name="unsupported_display_size_message" msgid="6545327290756295232">"<xliff:g id="APP_NAME">%1$s</xliff:g> वर्तमान प्रदर्शन आकार सेटिंगला समर्थन देत नाही आणि अनपेक्षित वर्तन करू शकते."</string>
+    <string name="unsupported_display_size_show" msgid="7969129195360353041">"नेहमी दर्शवा"</string>
     <string name="smv_application" msgid="3307209192155442829">"अॅप <xliff:g id="APPLICATION">%1$s</xliff:g> (प्रक्रिया <xliff:g id="PROCESS">%2$s</xliff:g>) ने तिच्या स्वयं-लागू केलेल्या StrictMode धोरणाचे उल्लंघन केले आहे."</string>
     <string name="smv_process" msgid="5120397012047462446">"<xliff:g id="PROCESS">%1$s</xliff:g> प्रक्रियेने तिच्या स्वतः-लागू केलेल्या StrictMode धोरणाचे उल्लंघन केले."</string>
     <string name="android_upgrading_title" msgid="1584192285441405746">"Android श्रेणीसुधारित होत आहे..."</string>
diff --git a/core/res/res/values-ms-rMY/strings.xml b/core/res/res/values-ms-rMY/strings.xml
index 8945524..c4123ab 100644
--- a/core/res/res/values-ms-rMY/strings.xml
+++ b/core/res/res/values-ms-rMY/strings.xml
@@ -1015,6 +1015,8 @@
     <string name="screen_compat_mode_scale" msgid="3202955667675944499">"Skala"</string>
     <string name="screen_compat_mode_show" msgid="4013878876486655892">"Sentiasa tunjukkan"</string>
     <string name="screen_compat_mode_hint" msgid="1064524084543304459">"Dayakan semula kod kompak ini tetapan Sistem &gt; Apl &gt; Dimuat turun."</string>
+    <string name="unsupported_display_size_message" msgid="6545327290756295232">"<xliff:g id="APP_NAME">%1$s</xliff:g> tidak menyokong tetapan saiz Paparan semasa dan mungkin menunjukkan gelagat yang tidak dijangka."</string>
+    <string name="unsupported_display_size_show" msgid="7969129195360353041">"Sentiasa tunjukkan"</string>
     <string name="smv_application" msgid="3307209192155442829">"Apl <xliff:g id="APPLICATION">%1$s</xliff:g> (proses <xliff:g id="PROCESS">%2$s</xliff:g>) telah melanggar dasar Mod Tegasnya sendiri."</string>
     <string name="smv_process" msgid="5120397012047462446">"Proses <xliff:g id="PROCESS">%1$s</xliff:g> telah melanggar dasar Mod Tegasnya sendiri."</string>
     <string name="android_upgrading_title" msgid="1584192285441405746">"Android sedang menaik taraf..."</string>
diff --git a/core/res/res/values-my-rMM/strings.xml b/core/res/res/values-my-rMM/strings.xml
index 76ac215..0ac3898 100644
--- a/core/res/res/values-my-rMM/strings.xml
+++ b/core/res/res/values-my-rMM/strings.xml
@@ -1015,6 +1015,8 @@
     <string name="screen_compat_mode_scale" msgid="3202955667675944499">"စကေး"</string>
     <string name="screen_compat_mode_show" msgid="4013878876486655892">"အမြဲပြသရန်"</string>
     <string name="screen_compat_mode_hint" msgid="1064524084543304459">"ဒါကို စနစ် ဆက်တင်များထဲ ပြန်ဖွင့်ပေးရန် &gt; Apps &gt; ဒေါင်းလုဒ် လုပ်ပြီး။"</string>
+    <string name="unsupported_display_size_message" msgid="6545327290756295232">"<xliff:g id="APP_NAME">%1$s</xliff:g> သည် လက်ရှိ မျက်နှာပြင်အရွယ်အစားကို ပံ့ပိုးထားခြင်း မရှိပါ။ မမျှော်လင့်နိုင်သည့် ချွတ်ယွင်းချက်များ ဖြစ်ပေါ်နိုင်ပါသည်။"</string>
+    <string name="unsupported_display_size_show" msgid="7969129195360353041">"အမြဲပြပါ"</string>
     <string name="smv_application" msgid="3307209192155442829">"app <xliff:g id="APPLICATION">%1$s</xliff:g> (လုပ်ငန်းစဉ် <xliff:g id="PROCESS">%2$s</xliff:g>) က ကိုယ်တိုင် ပြဌာန်းခဲ့သည့် StrictMode မူဝါဒကို ချိုးဖောက်ခဲ့သည်။"</string>
     <string name="smv_process" msgid="5120397012047462446">"ဤ<xliff:g id="PROCESS">%1$s</xliff:g>ဖြစ်စဥ်မှာ ကိုယ်တိုင်အကျိုးသက်ရောက်သော StrictModeမူဝါဒအား ချိုးဖောက်သည်"</string>
     <string name="android_upgrading_title" msgid="1584192285441405746">"အန်ဒရွိုက်ကို မွမ်းမံနေ…"</string>
diff --git a/core/res/res/values-nb/strings.xml b/core/res/res/values-nb/strings.xml
index 860ff12..d17d69e 100644
--- a/core/res/res/values-nb/strings.xml
+++ b/core/res/res/values-nb/strings.xml
@@ -1015,6 +1015,8 @@
     <string name="screen_compat_mode_scale" msgid="3202955667675944499">"Skala"</string>
     <string name="screen_compat_mode_show" msgid="4013878876486655892">"Vis alltid"</string>
     <string name="screen_compat_mode_hint" msgid="1064524084543304459">"Reaktiver dette i systeminnstillingene  &gt; Apper &gt; Nedlastet."</string>
+    <string name="unsupported_display_size_message" msgid="6545327290756295232">"<xliff:g id="APP_NAME">%1$s</xliff:g> støtter ikke den nåværende innstillingen for skjermstørrelse og fungerer kanskje ikke som den skal."</string>
+    <string name="unsupported_display_size_show" msgid="7969129195360353041">"Vis alltid"</string>
     <string name="smv_application" msgid="3307209192155442829">"Appen <xliff:g id="APPLICATION">%1$s</xliff:g> (prosessen <xliff:g id="PROCESS">%2$s</xliff:g>) har brutt de selvpålagte StrictMode-retningslinjene."</string>
     <string name="smv_process" msgid="5120397012047462446">"Prosessen<xliff:g id="PROCESS">%1$s</xliff:g> har brutt de selvpålagte StrictMode-retningslinjene."</string>
     <string name="android_upgrading_title" msgid="1584192285441405746">"Android oppgraderes …"</string>
diff --git a/core/res/res/values-ne-rNP/strings.xml b/core/res/res/values-ne-rNP/strings.xml
index 1ea7dbf..138c67f 100644
--- a/core/res/res/values-ne-rNP/strings.xml
+++ b/core/res/res/values-ne-rNP/strings.xml
@@ -1021,6 +1021,8 @@
     <string name="screen_compat_mode_scale" msgid="3202955667675944499">"स्केल"</string>
     <string name="screen_compat_mode_show" msgid="4013878876486655892">"सधैँ देखाउनुहोस्"</string>
     <string name="screen_compat_mode_hint" msgid="1064524084543304459">"प्रणाली सेटिङहरूमा यसलाई पुनःसक्षम गराउनुहोस् &gt; अनुप्रयोगहरू &gt; डाउनलोड गरेको।"</string>
+    <string name="unsupported_display_size_message" msgid="6545327290756295232">"<xliff:g id="APP_NAME">%1$s</xliff:g> ले हालको प्रदर्शनको आकार सम्बन्धी सेटिङलाई समर्थन गर्दैन र अप्रत्याशित तरिकाले व्यवहार गर्न सक्छ।"</string>
+    <string name="unsupported_display_size_show" msgid="7969129195360353041">"सधैँ देखाउनुहोस्"</string>
     <string name="smv_application" msgid="3307209192155442829">"अनुप्रयोग <xliff:g id="APPLICATION">%1$s</xliff:g> (प्रक्रिया <xliff:g id="PROCESS">%2$s</xliff:g>) ले यसको स्वयं-लागु गरिएको स्ट्रिटमोड नीति उलङ्घन गरेको छ।"</string>
     <string name="smv_process" msgid="5120397012047462446">"प्रक्रिया <xliff:g id="PROCESS">%1$s</xliff:g> यसको आफ्नै कडामोड नीतिका कारण उल्लङ्घन गरिएको छ।"</string>
     <string name="android_upgrading_title" msgid="1584192285441405746">"एन्ड्रोइड अपग्रेड हुँदैछ…"</string>
diff --git a/core/res/res/values-nl/strings.xml b/core/res/res/values-nl/strings.xml
index c3eee67..c8a804b 100644
--- a/core/res/res/values-nl/strings.xml
+++ b/core/res/res/values-nl/strings.xml
@@ -1015,6 +1015,8 @@
     <string name="screen_compat_mode_scale" msgid="3202955667675944499">"Schaal"</string>
     <string name="screen_compat_mode_show" msgid="4013878876486655892">"Altijd weergeven"</string>
     <string name="screen_compat_mode_hint" msgid="1064524084543304459">"U kunt dit opnieuw inschakelen via Systeeminstellingen &gt; Apps &gt; Gedownload."</string>
+    <string name="unsupported_display_size_message" msgid="6545327290756295232">"<xliff:g id="APP_NAME">%1$s</xliff:g> biedt geen ondersteuning voor de huidige instelling voor weergavegrootte en kan onverwacht gedrag vertonen."</string>
+    <string name="unsupported_display_size_show" msgid="7969129195360353041">"Altijd weergeven"</string>
     <string name="smv_application" msgid="3307209192155442829">"De app <xliff:g id="APPLICATION">%1$s</xliff:g> (proces <xliff:g id="PROCESS">%2$s</xliff:g>) heeft het zelf afgedwongen StrictMode-beleid geschonden."</string>
     <string name="smv_process" msgid="5120397012047462446">"Het proces <xliff:g id="PROCESS">%1$s</xliff:g> heeft het zelf afgedwongen StrictMode-beleid geschonden."</string>
     <string name="android_upgrading_title" msgid="1584192285441405746">"Android wordt bijgewerkt..."</string>
diff --git a/core/res/res/values-pa-rIN/strings.xml b/core/res/res/values-pa-rIN/strings.xml
index d9156b5..5bb9f44 100644
--- a/core/res/res/values-pa-rIN/strings.xml
+++ b/core/res/res/values-pa-rIN/strings.xml
@@ -1015,6 +1015,8 @@
     <string name="screen_compat_mode_scale" msgid="3202955667675944499">"ਸਕੇਲ"</string>
     <string name="screen_compat_mode_show" msgid="4013878876486655892">"ਹਮੇਸ਼ਾਂ ਦਿਖਾਓ"</string>
     <string name="screen_compat_mode_hint" msgid="1064524084543304459">"ਸਿਸਟਮ ਸੈਟਿੰਗਾਂ &gt; ਐਪਸ &gt; ਡਾਊਨਲੋਡ ਕੀਤਿਆਂ ਵਿੱਚ ਇਸਨੂੰ ਮੁੜ-ਸਮਰੱਥ ਬਣਾਓ।"</string>
+    <string name="unsupported_display_size_message" msgid="6545327290756295232">"<xliff:g id="APP_NAME">%1$s</xliff:g> ਵਰਤਮਾਨ ਡਿਸਪਲੇ ਆਕਾਰ ਸੈਟਿੰਗ ਦਾ ਸਮਰਥਨ ਨਹੀਂ ਕਰਦੀ ਹੈ ਅਤੇ ਅਣਕਿਆਸੇ ਤੌਰ \'ਤੇ ਵਿਹਾਰ ਕਰ ਸਕਦੀ ਹੈ।"</string>
+    <string name="unsupported_display_size_show" msgid="7969129195360353041">"ਹਮੇਸ਼ਾ ਵਿਖਾਓ"</string>
     <string name="smv_application" msgid="3307209192155442829">"ਐਪ <xliff:g id="APPLICATION">%1$s</xliff:g> (ਪ੍ਰਕਿਰਿਆ<xliff:g id="PROCESS">%2$s</xliff:g>) ਨੇ ਆਪਣੀ ਖੁਦ-ਲਾਗੂ ਕੀਤੀ ਸਟ੍ਰਿਕਟਮੋਡ ਨੀਤੀ ਦੀ ਉਲੰਘਣਾ ਕੀਤੀ ਹੈ।"</string>
     <string name="smv_process" msgid="5120397012047462446">"ਪ੍ਰਕਿਰਿਆ <xliff:g id="PROCESS">%1$s</xliff:g> ਨੇ ਆਪਣੀ ਖੁਦ-ਲਾਗੂ ਕੀਤੀ ਸਟ੍ਰਿਕਟਮੋਡ ਨੀਤੀ ਦੀ ਉਲੰਘਣਾ ਕੀਤੀ ਹੈ।"</string>
     <string name="android_upgrading_title" msgid="1584192285441405746">"Android ਅਪਗ੍ਰੇਡ ਕਰ ਰਿਹਾ ਹੈ…"</string>
diff --git a/core/res/res/values-pl/strings.xml b/core/res/res/values-pl/strings.xml
index 2291d037..ade4bdc 100644
--- a/core/res/res/values-pl/strings.xml
+++ b/core/res/res/values-pl/strings.xml
@@ -1061,6 +1061,8 @@
     <string name="screen_compat_mode_scale" msgid="3202955667675944499">"Skala"</string>
     <string name="screen_compat_mode_show" msgid="4013878876486655892">"Zawsze pokazuj"</string>
     <string name="screen_compat_mode_hint" msgid="1064524084543304459">"Włącz ponownie, wybierając Ustawienia systemowe &gt; Aplikacje &gt; Pobrane."</string>
+    <string name="unsupported_display_size_message" msgid="6545327290756295232">"<xliff:g id="APP_NAME">%1$s</xliff:g> nie obsługuje obecnie ustawionego rozmiaru wyświetlacza i może działać niestabilnie."</string>
+    <string name="unsupported_display_size_show" msgid="7969129195360353041">"Zawsze pokazuj"</string>
     <string name="smv_application" msgid="3307209192155442829">"Aplikacja <xliff:g id="APPLICATION">%1$s</xliff:g> (proces <xliff:g id="PROCESS">%2$s</xliff:g>) naruszyła wymuszone przez siebie zasady StrictMode."</string>
     <string name="smv_process" msgid="5120397012047462446">"Proces <xliff:g id="PROCESS">%1$s</xliff:g> naruszył wymuszone przez siebie zasady StrictMode."</string>
     <string name="android_upgrading_title" msgid="1584192285441405746">"Android jest uaktualniany..."</string>
diff --git a/core/res/res/values-pt-rBR/strings.xml b/core/res/res/values-pt-rBR/strings.xml
index 6907a6c..c05931e 100644
--- a/core/res/res/values-pt-rBR/strings.xml
+++ b/core/res/res/values-pt-rBR/strings.xml
@@ -1015,6 +1015,8 @@
     <string name="screen_compat_mode_scale" msgid="3202955667675944499">"Escala"</string>
     <string name="screen_compat_mode_show" msgid="4013878876486655892">"Mostrar sempre"</string>
     <string name="screen_compat_mode_hint" msgid="1064524084543304459">"Reativar isso em Configurações do sistema &gt; Apps &gt; Transferidos."</string>
+    <string name="unsupported_display_size_message" msgid="6545327290756295232">"O app <xliff:g id="APP_NAME">%1$s</xliff:g> não é compatível com a configuração atual de tamanho de exibição e pode se comportar de forma inesperada."</string>
+    <string name="unsupported_display_size_show" msgid="7969129195360353041">"Mostrar sempre"</string>
     <string name="smv_application" msgid="3307209192155442829">"O app <xliff:g id="APPLICATION">%1$s</xliff:g>, processo <xliff:g id="PROCESS">%2$s</xliff:g>, violou a política StrictMode imposta automaticamente."</string>
     <string name="smv_process" msgid="5120397012047462446">"O processo <xliff:g id="PROCESS">%1$s</xliff:g> violou a política StrictMode imposta automaticamente."</string>
     <string name="android_upgrading_title" msgid="1584192285441405746">"O Android está sendo atualizado..."</string>
diff --git a/core/res/res/values-pt-rPT/strings.xml b/core/res/res/values-pt-rPT/strings.xml
index 221d055..558b97a 100644
--- a/core/res/res/values-pt-rPT/strings.xml
+++ b/core/res/res/values-pt-rPT/strings.xml
@@ -1015,6 +1015,8 @@
     <string name="screen_compat_mode_scale" msgid="3202955667675944499">"Escala"</string>
     <string name="screen_compat_mode_show" msgid="4013878876486655892">"Mostrar sempre"</string>
     <string name="screen_compat_mode_hint" msgid="1064524084543304459">"Reative este modo nas Definições do Sistema &gt; Aplicações &gt; Transferidas."</string>
+    <string name="unsupported_display_size_message" msgid="6545327290756295232">"<xliff:g id="APP_NAME">%1$s</xliff:g> não suporta a definição de Tamanho do ecrã atual e pode ter um comportamento inesperado."</string>
+    <string name="unsupported_display_size_show" msgid="7969129195360353041">"Mostrar sempre"</string>
     <string name="smv_application" msgid="3307209192155442829">"A aplicação <xliff:g id="APPLICATION">%1$s</xliff:g> (processo <xliff:g id="PROCESS">%2$s</xliff:g>) violou a política StrictMode auto-imposta."</string>
     <string name="smv_process" msgid="5120397012047462446">"O processo <xliff:g id="PROCESS">%1$s</xliff:g> violou a política StrictMode auto-imposta."</string>
     <string name="android_upgrading_title" msgid="1584192285441405746">"O Android está a ser atualizado..."</string>
diff --git a/core/res/res/values-pt/strings.xml b/core/res/res/values-pt/strings.xml
index 6907a6c..c05931e 100644
--- a/core/res/res/values-pt/strings.xml
+++ b/core/res/res/values-pt/strings.xml
@@ -1015,6 +1015,8 @@
     <string name="screen_compat_mode_scale" msgid="3202955667675944499">"Escala"</string>
     <string name="screen_compat_mode_show" msgid="4013878876486655892">"Mostrar sempre"</string>
     <string name="screen_compat_mode_hint" msgid="1064524084543304459">"Reativar isso em Configurações do sistema &gt; Apps &gt; Transferidos."</string>
+    <string name="unsupported_display_size_message" msgid="6545327290756295232">"O app <xliff:g id="APP_NAME">%1$s</xliff:g> não é compatível com a configuração atual de tamanho de exibição e pode se comportar de forma inesperada."</string>
+    <string name="unsupported_display_size_show" msgid="7969129195360353041">"Mostrar sempre"</string>
     <string name="smv_application" msgid="3307209192155442829">"O app <xliff:g id="APPLICATION">%1$s</xliff:g>, processo <xliff:g id="PROCESS">%2$s</xliff:g>, violou a política StrictMode imposta automaticamente."</string>
     <string name="smv_process" msgid="5120397012047462446">"O processo <xliff:g id="PROCESS">%1$s</xliff:g> violou a política StrictMode imposta automaticamente."</string>
     <string name="android_upgrading_title" msgid="1584192285441405746">"O Android está sendo atualizado..."</string>
diff --git a/core/res/res/values-ro/strings.xml b/core/res/res/values-ro/strings.xml
index fe19d39..c61b41a 100644
--- a/core/res/res/values-ro/strings.xml
+++ b/core/res/res/values-ro/strings.xml
@@ -1038,6 +1038,8 @@
     <string name="screen_compat_mode_scale" msgid="3202955667675944499">"Scară"</string>
     <string name="screen_compat_mode_show" msgid="4013878876486655892">"Afișați întotdeauna"</string>
     <string name="screen_compat_mode_hint" msgid="1064524084543304459">"Reactivați acest mod din Setări de sistem &gt; Aplicații &gt; Descărcate."</string>
+    <string name="unsupported_display_size_message" msgid="6545327290756295232">"<xliff:g id="APP_NAME">%1$s</xliff:g> nu acceptă setarea actuală pentru Dimensiunea afișării și este posibil să aibă un comportament neașteptat."</string>
+    <string name="unsupported_display_size_show" msgid="7969129195360353041">"Afișează întotdeauna"</string>
     <string name="smv_application" msgid="3307209192155442829">"Aplicația <xliff:g id="APPLICATION">%1$s</xliff:g> (procesul <xliff:g id="PROCESS">%2$s</xliff:g>) a încălcat propria politică StrictMode."</string>
     <string name="smv_process" msgid="5120397012047462446">"Procesul <xliff:g id="PROCESS">%1$s</xliff:g> a încălcat propria politică StrictMode."</string>
     <string name="android_upgrading_title" msgid="1584192285441405746">"Android trece la o versiune superioară..."</string>
diff --git a/core/res/res/values-ru/strings.xml b/core/res/res/values-ru/strings.xml
index e885d70..54fb905 100644
--- a/core/res/res/values-ru/strings.xml
+++ b/core/res/res/values-ru/strings.xml
@@ -1061,6 +1061,8 @@
     <string name="screen_compat_mode_scale" msgid="3202955667675944499">"Масштаб"</string>
     <string name="screen_compat_mode_show" msgid="4013878876486655892">"Всегда показывать"</string>
     <string name="screen_compat_mode_hint" msgid="1064524084543304459">"Включить эту функцию можно в меню \"Настройки &gt; Приложения &gt; Загруженные\"."</string>
+    <string name="unsupported_display_size_message" msgid="6545327290756295232">"Приложение \"<xliff:g id="APP_NAME">%1$s</xliff:g>\" не поддерживает выбранный масштаб изображения на экране и может работать некорректно."</string>
+    <string name="unsupported_display_size_show" msgid="7969129195360353041">"Всегда показывать"</string>
     <string name="smv_application" msgid="3307209192155442829">"Приложение \"<xliff:g id="APPLICATION">%1$s</xliff:g>\" (процесс: <xliff:g id="PROCESS">%2$s</xliff:g>) нарушило собственную политику StrictMode."</string>
     <string name="smv_process" msgid="5120397012047462446">"Процесс <xliff:g id="PROCESS">%1$s</xliff:g> нарушил собственную политику StrictMode."</string>
     <string name="android_upgrading_title" msgid="1584192285441405746">"Обновление Android..."</string>
diff --git a/core/res/res/values-si-rLK/strings.xml b/core/res/res/values-si-rLK/strings.xml
index 5626d47d..f5878ce 100644
--- a/core/res/res/values-si-rLK/strings.xml
+++ b/core/res/res/values-si-rLK/strings.xml
@@ -1017,6 +1017,8 @@
     <string name="screen_compat_mode_scale" msgid="3202955667675944499">"පරිමාණය"</string>
     <string name="screen_compat_mode_show" msgid="4013878876486655892">"සැමවිටම පෙන්වන්න"</string>
     <string name="screen_compat_mode_hint" msgid="1064524084543304459">"පද්ධති සැකසීම් තුළ මෙය නැවත ක්‍රියාත්මක කරන්න &gt; යෙදුම් &gt; බාගන්නා ලදි."</string>
+    <string name="unsupported_display_size_message" msgid="6545327290756295232">"<xliff:g id="APP_NAME">%1$s</xliff:g> වත්මන් සංදර්ශක තරම සඳහා සහාය නොදක්වන අතර අනපේක්ෂිත ලෙස හැසිරීමට හැකිය."</string>
+    <string name="unsupported_display_size_show" msgid="7969129195360353041">"සැම විටම පෙන්වන්න"</string>
     <string name="smv_application" msgid="3307209192155442829">"<xliff:g id="APPLICATION">%1$s</xliff:g> යෙදුම (<xliff:g id="PROCESS">%2$s</xliff:g> ක්‍රියාවලිය) එහි StrictMode කොන්දේසිය උල්ලංඝනය කර ඇත."</string>
     <string name="smv_process" msgid="5120397012047462446">"<xliff:g id="PROCESS">%1$s</xliff:g> ක්‍රියාවලිය එහි StrictMode කොන්දේසිය උල්ලංඝනය කර ඇත."</string>
     <string name="android_upgrading_title" msgid="1584192285441405746">"Android උත්ශ්‍රේණි වෙමින් පවතී..."</string>
diff --git a/core/res/res/values-sk/strings.xml b/core/res/res/values-sk/strings.xml
index 54337ba..2cb7ecd 100644
--- a/core/res/res/values-sk/strings.xml
+++ b/core/res/res/values-sk/strings.xml
@@ -1061,6 +1061,8 @@
     <string name="screen_compat_mode_scale" msgid="3202955667675944499">"Prispôsobiť veľkosť"</string>
     <string name="screen_compat_mode_show" msgid="4013878876486655892">"Vždy zobraziť"</string>
     <string name="screen_compat_mode_hint" msgid="1064524084543304459">"Povoľte to znova v sekcii Nastavenia systému &gt; Aplikácie &gt; Stiahnuté súbory."</string>
+    <string name="unsupported_display_size_message" msgid="6545327290756295232">"Aplikácia <xliff:g id="APP_NAME">%1$s</xliff:g> aktuálne nastavenie veľkosti zobrazenia nepodporuje a môže sa správať neočakávane."</string>
+    <string name="unsupported_display_size_show" msgid="7969129195360353041">"Vždy zobrazovať"</string>
     <string name="smv_application" msgid="3307209192155442829">"Aplikácia <xliff:g id="APPLICATION">%1$s</xliff:g> (proces <xliff:g id="PROCESS">%2$s</xliff:g>) porušila svoje vlastné vynútené pravidlá StrictMode."</string>
     <string name="smv_process" msgid="5120397012047462446">"Proces <xliff:g id="PROCESS">%1$s</xliff:g> porušil svoje vlastné vynútené pravidlá StrictMode."</string>
     <string name="android_upgrading_title" msgid="1584192285441405746">"Prebieha inovácia systému Android..."</string>
diff --git a/core/res/res/values-sl/strings.xml b/core/res/res/values-sl/strings.xml
index f13d1aa..9ece9eb 100644
--- a/core/res/res/values-sl/strings.xml
+++ b/core/res/res/values-sl/strings.xml
@@ -1061,6 +1061,8 @@
     <string name="screen_compat_mode_scale" msgid="3202955667675944499">"Lestvica"</string>
     <string name="screen_compat_mode_show" msgid="4013878876486655892">"Vedno pokaži"</string>
     <string name="screen_compat_mode_hint" msgid="1064524084543304459">"Znova omogočite to v sistemskih nastavitvah &gt; Aplikacije &gt; Preneseno."</string>
+    <string name="unsupported_display_size_message" msgid="6545327290756295232">"Aplikacija <xliff:g id="APP_NAME">%1$s</xliff:g> ne podpira trenutne nastavitve velikosti zaslona, kar lahko vodi v nepričakovano delovanje."</string>
+    <string name="unsupported_display_size_show" msgid="7969129195360353041">"Vedno pokaži"</string>
     <string name="smv_application" msgid="3307209192155442829">"Aplikacija <xliff:g id="APPLICATION">%1$s</xliff:g> (proces <xliff:g id="PROCESS">%2$s</xliff:g>) krši svoj samouveljavljiv pravilnik o strogem načinu."</string>
     <string name="smv_process" msgid="5120397012047462446">"Proces <xliff:g id="PROCESS">%1$s</xliff:g> krši svoj samoizvedljivi pravilnik o strogem načinu."</string>
     <string name="android_upgrading_title" msgid="1584192285441405746">"Poteka nadgradnja Androida ..."</string>
diff --git a/core/res/res/values-sq-rAL/strings.xml b/core/res/res/values-sq-rAL/strings.xml
index c3911eb..48bf5b2 100644
--- a/core/res/res/values-sq-rAL/strings.xml
+++ b/core/res/res/values-sq-rAL/strings.xml
@@ -1015,6 +1015,8 @@
     <string name="screen_compat_mode_scale" msgid="3202955667675944499">"Shkalla"</string>
     <string name="screen_compat_mode_show" msgid="4013878876486655892">"Shfaq gjithnjë"</string>
     <string name="screen_compat_mode_hint" msgid="1064524084543304459">"Aktivizoje sërish këtë te \"Cilësimet e sistemit\" &gt; \"Aplikacionet\" &gt; \"Të shkarkuara\"."</string>
+    <string name="unsupported_display_size_message" msgid="6545327290756295232">"<xliff:g id="APP_NAME">%1$s</xliff:g> nuk mbështet cilësimin aktual të madhësisë së ekranit aktual dhe mund të shfaqë sjellje të papritura."</string>
+    <string name="unsupported_display_size_show" msgid="7969129195360353041">"Shfaq gjithmonë"</string>
     <string name="smv_application" msgid="3307209192155442829">"Aplikacioni <xliff:g id="APPLICATION">%1$s</xliff:g> (procesi <xliff:g id="PROCESS">%2$s</xliff:g>) ka shkelur politikën e tij të vetë-imponuar \"Modaliteti i ashpër\" (StrictMode)."</string>
     <string name="smv_process" msgid="5120397012047462446">"Procesi <xliff:g id="PROCESS">%1$s</xliff:g> ka shkelur politikën e tij të vetë-imponuar \"Modaliteti i rreptë\" (StrictMode)"</string>
     <string name="android_upgrading_title" msgid="1584192285441405746">"\"Androidi\" po përditësohet…"</string>
diff --git a/core/res/res/values-sr/strings.xml b/core/res/res/values-sr/strings.xml
index 5b6dcd4..4eb13f5 100644
--- a/core/res/res/values-sr/strings.xml
+++ b/core/res/res/values-sr/strings.xml
@@ -1038,6 +1038,8 @@
     <string name="screen_compat_mode_scale" msgid="3202955667675944499">"Размера"</string>
     <string name="screen_compat_mode_show" msgid="4013878876486655892">"Увек приказуј"</string>
     <string name="screen_compat_mode_hint" msgid="1064524084543304459">"Поново омогућите у менију Системска подешавања &gt; Апликације &gt; Преузето."</string>
+    <string name="unsupported_display_size_message" msgid="6545327290756295232">"<xliff:g id="APP_NAME">%1$s</xliff:g> не подржава тренутно подешавање величине приказа и може да се понаша неочекивано."</string>
+    <string name="unsupported_display_size_show" msgid="7969129195360353041">"Увек приказуј"</string>
     <string name="smv_application" msgid="3307209192155442829">"Апликација <xliff:g id="APPLICATION">%1$s</xliff:g> (процес <xliff:g id="PROCESS">%2$s</xliff:g>) је прекршила самонаметнуте StrictMode смернице."</string>
     <string name="smv_process" msgid="5120397012047462446">"Процес <xliff:g id="PROCESS">%1$s</xliff:g> је прекршио самонаметнуте StrictMode смернице."</string>
     <string name="android_upgrading_title" msgid="1584192285441405746">"Android се надограђује…"</string>
diff --git a/core/res/res/values-sv/strings.xml b/core/res/res/values-sv/strings.xml
index 9f78411..21016d6 100644
--- a/core/res/res/values-sv/strings.xml
+++ b/core/res/res/values-sv/strings.xml
@@ -1015,6 +1015,8 @@
     <string name="screen_compat_mode_scale" msgid="3202955667675944499">"Anpassning"</string>
     <string name="screen_compat_mode_show" msgid="4013878876486655892">"Visa alltid"</string>
     <string name="screen_compat_mode_hint" msgid="1064524084543304459">"Aktivera detta igen i Systeminställningar &gt; Appar &gt; Hämtat."</string>
+    <string name="unsupported_display_size_message" msgid="6545327290756295232">"<xliff:g id="APP_NAME">%1$s</xliff:g> har inte stöd för den nuvarande inställningen för skärmstorlek och kanske inte fungerar som förväntat."</string>
+    <string name="unsupported_display_size_show" msgid="7969129195360353041">"Visa alltid"</string>
     <string name="smv_application" msgid="3307209192155442829">"Appen <xliff:g id="APPLICATION">%1$s</xliff:g> (processen <xliff:g id="PROCESS">%2$s</xliff:g>) har brutit mot sin egen StrictMode-policy."</string>
     <string name="smv_process" msgid="5120397012047462446">"Processen <xliff:g id="PROCESS">%1$s</xliff:g> har brutit mot sin egen StrictMode-policy."</string>
     <string name="android_upgrading_title" msgid="1584192285441405746">"Android uppgraderas ..."</string>
diff --git a/core/res/res/values-sw/strings.xml b/core/res/res/values-sw/strings.xml
index 7ceef61..8d9b151 100644
--- a/core/res/res/values-sw/strings.xml
+++ b/core/res/res/values-sw/strings.xml
@@ -1013,6 +1013,8 @@
     <string name="screen_compat_mode_scale" msgid="3202955667675944499">"Kipimo"</string>
     <string name="screen_compat_mode_show" msgid="4013878876486655892">"Onyesha kila wakati"</string>
     <string name="screen_compat_mode_hint" msgid="1064524084543304459">"Wezesha tena hii katika mipangilio ya Mfumo &gt; Programu &gt;  iliyopakuliwa."</string>
+    <string name="unsupported_display_size_message" msgid="6545327290756295232">"<xliff:g id="APP_NAME">%1$s</xliff:g> haiwezi kutumia mipangilio ya sasa ya ukubwa wa Skrini na huenda isifanye kazi vizuri."</string>
+    <string name="unsupported_display_size_show" msgid="7969129195360353041">"Onyesha kila wakati"</string>
     <string name="smv_application" msgid="3307209192155442829">"Programu <xliff:g id="APPLICATION">%1$s</xliff:g>  (utaratibu  <xliff:g id="PROCESS">%2$s</xliff:g>) imeenda kinyume na sera yake ya StrictMode."</string>
     <string name="smv_process" msgid="5120397012047462446">"Shughuli ya <xliff:g id="PROCESS">%1$s</xliff:g> imeenda kinyume na kulazimisha sera yake ya StrictMode."</string>
     <string name="android_upgrading_title" msgid="1584192285441405746">"Toleo jipya la Android linawekwa..."</string>
diff --git a/core/res/res/values-ta-rIN/strings.xml b/core/res/res/values-ta-rIN/strings.xml
index 35f4254..47e2753 100644
--- a/core/res/res/values-ta-rIN/strings.xml
+++ b/core/res/res/values-ta-rIN/strings.xml
@@ -1015,6 +1015,8 @@
     <string name="screen_compat_mode_scale" msgid="3202955667675944499">"அளவு"</string>
     <string name="screen_compat_mode_show" msgid="4013878876486655892">"எப்போதும் காட்டு"</string>
     <string name="screen_compat_mode_hint" msgid="1064524084543304459">"சிஸ்டம் அமைப்பு &gt; பயன்பாடுகள் &gt; பதிவிறக்கம் என்பதில் இதை மீண்டும் இயக்கவும்."</string>
+    <string name="unsupported_display_size_message" msgid="6545327290756295232">"தற்போதைய திரை அளவு அமைப்பை <xliff:g id="APP_NAME">%1$s</xliff:g> ஆதரிக்காததால், அது வழக்கத்திற்கு மாறாகச் செயல்படக்கூடும்."</string>
+    <string name="unsupported_display_size_show" msgid="7969129195360353041">"எப்போதும் காட்டு"</string>
     <string name="smv_application" msgid="3307209192155442829">"<xliff:g id="APPLICATION">%1$s</xliff:g> பயன்பாடு (செயல்முறை <xliff:g id="PROCESS">%2$s</xliff:g>), தனது சுய-செயலாக்க StrictMode கொள்கையை மீறியது."</string>
     <string name="smv_process" msgid="5120397012047462446">"<xliff:g id="PROCESS">%1$s</xliff:g> செயல்முறை, தனது சுய-செயலாக்க StrictMode கொள்கையை மீறியது."</string>
     <string name="android_upgrading_title" msgid="1584192285441405746">"Android மேம்படுத்தப்படுகிறது…"</string>
diff --git a/core/res/res/values-te-rIN/strings.xml b/core/res/res/values-te-rIN/strings.xml
index bee79de..f91c25a 100644
--- a/core/res/res/values-te-rIN/strings.xml
+++ b/core/res/res/values-te-rIN/strings.xml
@@ -1015,6 +1015,8 @@
     <string name="screen_compat_mode_scale" msgid="3202955667675944499">"ప్రమాణం"</string>
     <string name="screen_compat_mode_show" msgid="4013878876486655892">"ఎల్లప్పుడూ చూపు"</string>
     <string name="screen_compat_mode_hint" msgid="1064524084543304459">"సిస్టమ్ సెట్టింగ్‌లు &gt; అనువర్తనాలు &gt; డౌన్‌లోడ్ చేసినవిలో దీన్ని పునఃప్రారంభించండి."</string>
+    <string name="unsupported_display_size_message" msgid="6545327290756295232">"<xliff:g id="APP_NAME">%1$s</xliff:g> ప్రస్తుత ప్రదర్శన పరిమాణ సెట్టింగ్‌కు మద్దతు ఇవ్వదు, దీని వలన ఊహించని సమస్యలు తలెత్తవచ్చు."</string>
+    <string name="unsupported_display_size_show" msgid="7969129195360353041">"ఎల్లప్పుడూ చూపు"</string>
     <string name="smv_application" msgid="3307209192155442829">"<xliff:g id="APPLICATION">%1$s</xliff:g> అనువర్తనం (<xliff:g id="PROCESS">%2$s</xliff:g> ప్రాసెస్) అది స్వయంగా అమలు చేసే ఖచ్చితమైన మోడ్ విధానాన్ని ఉల్లంఘించింది."</string>
     <string name="smv_process" msgid="5120397012047462446">"ప్రక్రియ <xliff:g id="PROCESS">%1$s</xliff:g> అది స్వయంగా అమలు చేసే ఖచ్చితమైన మోడ్ విధానాన్ని ఉల్లంఘించింది."</string>
     <string name="android_upgrading_title" msgid="1584192285441405746">"Android అప్‌గ్రేడ్ అవుతోంది…"</string>
diff --git a/core/res/res/values-th/strings.xml b/core/res/res/values-th/strings.xml
index ef1f9a1..581bb81 100644
--- a/core/res/res/values-th/strings.xml
+++ b/core/res/res/values-th/strings.xml
@@ -1015,6 +1015,8 @@
     <string name="screen_compat_mode_scale" msgid="3202955667675944499">"สเกล"</string>
     <string name="screen_compat_mode_show" msgid="4013878876486655892">"แสดงเสมอ"</string>
     <string name="screen_compat_mode_hint" msgid="1064524084543304459">"เปิดใช้งานอีกครั้งในการตั้งค่าระบบ &gt; แอปพลิเคชัน &gt; ดาวน์โหลด"</string>
+    <string name="unsupported_display_size_message" msgid="6545327290756295232">"<xliff:g id="APP_NAME">%1$s</xliff:g> ไม่สนับสนุนการตั้งค่าขนาดการแสดงผลปัจจุบันและอาจแสดงผลผิดปกติ"</string>
+    <string name="unsupported_display_size_show" msgid="7969129195360353041">"แสดงเสมอ"</string>
     <string name="smv_application" msgid="3307209192155442829">"แอปพลิเคชัน <xliff:g id="APPLICATION">%1$s</xliff:g> (กระบวนการ <xliff:g id="PROCESS">%2$s</xliff:g>) ละเมิดนโยบาย StrictMode ที่บังคับใช้ด้วยตัวเอง"</string>
     <string name="smv_process" msgid="5120397012047462446">"กระบวนการ <xliff:g id="PROCESS">%1$s</xliff:g> ละเมิดนโยบาย StrictMode ที่บังคับใช้ด้วยตัวเอง"</string>
     <string name="android_upgrading_title" msgid="1584192285441405746">"กำลังอัปเกรด Android ..."</string>
diff --git a/core/res/res/values-tl/strings.xml b/core/res/res/values-tl/strings.xml
index 1bdc63a..df4dd9b 100644
--- a/core/res/res/values-tl/strings.xml
+++ b/core/res/res/values-tl/strings.xml
@@ -1015,6 +1015,8 @@
     <string name="screen_compat_mode_scale" msgid="3202955667675944499">"Sukat"</string>
     <string name="screen_compat_mode_show" msgid="4013878876486655892">"Palaging ipakita"</string>
     <string name="screen_compat_mode_hint" msgid="1064524084543304459">"Muling paganahin ito sa mga setting ng System &gt; Apps &gt; Na-download."</string>
+    <string name="unsupported_display_size_message" msgid="6545327290756295232">"Hindi sinusuportahan ng <xliff:g id="APP_NAME">%1$s</xliff:g> ang kasalukuyang setting ng laki ng Display at maaaring may mangyaring hindi inaasahan."</string>
+    <string name="unsupported_display_size_show" msgid="7969129195360353041">"Palaging ipakita"</string>
     <string name="smv_application" msgid="3307209192155442829">"Ang app na <xliff:g id="APPLICATION">%1$s</xliff:g> (prosesong <xliff:g id="PROCESS">%2$s</xliff:g>) ay lumabag sa sarili nitong ipinapatupad na patakarang StrictMode."</string>
     <string name="smv_process" msgid="5120397012047462446">"Ang prosesong <xliff:g id="PROCESS">%1$s</xliff:g> ay lumabag sa sarili nitong ipinapatupad na patakarang StrictMode."</string>
     <string name="android_upgrading_title" msgid="1584192285441405746">"Nag-a-upgrade ang Android…"</string>
diff --git a/core/res/res/values-tr/strings.xml b/core/res/res/values-tr/strings.xml
index 8f2dc75..a1f6f64 100644
--- a/core/res/res/values-tr/strings.xml
+++ b/core/res/res/values-tr/strings.xml
@@ -1015,6 +1015,8 @@
     <string name="screen_compat_mode_scale" msgid="3202955667675944499">"Ölçek"</string>
     <string name="screen_compat_mode_show" msgid="4013878876486655892">"Her zaman göster"</string>
     <string name="screen_compat_mode_hint" msgid="1064524084543304459">"Bunu Sistem ayarları &gt; Uygulamalar &gt; İndirilenler bölümünden yeniden etkinleştirin."</string>
+    <string name="unsupported_display_size_message" msgid="6545327290756295232">"<xliff:g id="APP_NAME">%1$s</xliff:g> geçerli Ekran boyutu ayarını desteklemiyor ve beklenmedik bir şekilde davranabilir."</string>
+    <string name="unsupported_display_size_show" msgid="7969129195360353041">"Her zaman göster"</string>
     <string name="smv_application" msgid="3307209192155442829">"<xliff:g id="APPLICATION">%1$s</xliff:g> uygulaması (<xliff:g id="PROCESS">%2$s</xliff:g> işlemi) kendiliğinden uyguladığı StrictMode politikasını ihlal etti."</string>
     <string name="smv_process" msgid="5120397012047462446">"<xliff:g id="PROCESS">%1$s</xliff:g> işlemi kendiliğinden uyguladığı StrictMode politikasını ihlal etti."</string>
     <string name="android_upgrading_title" msgid="1584192285441405746">"Android yeni sürüme geçiriliyor..."</string>
diff --git a/core/res/res/values-uk/strings.xml b/core/res/res/values-uk/strings.xml
index 57ff67f..c8b3754 100644
--- a/core/res/res/values-uk/strings.xml
+++ b/core/res/res/values-uk/strings.xml
@@ -1061,6 +1061,8 @@
     <string name="screen_compat_mode_scale" msgid="3202955667675944499">"Масштаб"</string>
     <string name="screen_compat_mode_show" msgid="4013878876486655892">"Завжди показувати"</string>
     <string name="screen_compat_mode_hint" msgid="1064524084543304459">"Знову ввімкнути це в меню Налаштування системи &gt; Програми &gt; Завантажені."</string>
+    <string name="unsupported_display_size_message" msgid="6545327290756295232">"Додаток <xliff:g id="APP_NAME">%1$s</xliff:g> не підтримує поточне налаштування розміру екрана та може працювати неналежним чином."</string>
+    <string name="unsupported_display_size_show" msgid="7969129195360353041">"Завжди показувати"</string>
     <string name="smv_application" msgid="3307209192155442829">"Програма <xliff:g id="APPLICATION">%1$s</xliff:g> (процес <xliff:g id="PROCESS">%2$s</xliff:g>) порушила свою самозастосовну політику StrictMode."</string>
     <string name="smv_process" msgid="5120397012047462446">"Процес <xliff:g id="PROCESS">%1$s</xliff:g> порушив свою самозастосовну політику StrictMode."</string>
     <string name="android_upgrading_title" msgid="1584192285441405746">"Android оновлюється..."</string>
diff --git a/core/res/res/values-ur-rPK/strings.xml b/core/res/res/values-ur-rPK/strings.xml
index a2dd131..f916cf5 100644
--- a/core/res/res/values-ur-rPK/strings.xml
+++ b/core/res/res/values-ur-rPK/strings.xml
@@ -1015,6 +1015,8 @@
     <string name="screen_compat_mode_scale" msgid="3202955667675944499">"پیمانہ"</string>
     <string name="screen_compat_mode_show" msgid="4013878876486655892">"ہمیشہ دکھائیں"</string>
     <string name="screen_compat_mode_hint" msgid="1064524084543304459">"‏سسٹم ترتیبات &gt; ایپس &gt; ڈاؤن لوڈ کردہ میں اسے دوبارہ فعال کریں۔"</string>
+    <string name="unsupported_display_size_message" msgid="6545327290756295232">"<xliff:g id="APP_NAME">%1$s</xliff:g> میں موجودہ ڈسپلے سائز ترتیبات کی معاونت نہیں ہے اور ہو سکتا ہے غیر متوقع طریقے سے کام کرے۔"</string>
+    <string name="unsupported_display_size_show" msgid="7969129195360353041">"ہمیشہ دکھائیں"</string>
     <string name="smv_application" msgid="3307209192155442829">"‏ایپ <xliff:g id="APPLICATION">%1$s</xliff:g> (کارروائی <xliff:g id="PROCESS">%2$s</xliff:g>) نے خود نافذ کی گئی StrictMode پالیسی کی خلاف ورزی کی ہے۔"</string>
     <string name="smv_process" msgid="5120397012047462446">"‏کارروائی <xliff:g id="PROCESS">%1$s</xliff:g> نے اپنی ذاتی طور پر نافذ کردہ StrictMode پلیسی کی خلاف ورزی کی ہے۔"</string>
     <string name="android_upgrading_title" msgid="1584192285441405746">"‏Android اپ گریڈ ہو رہا ہے…"</string>
diff --git a/core/res/res/values-uz-rUZ/strings.xml b/core/res/res/values-uz-rUZ/strings.xml
index fb39be29..2b28e59 100644
--- a/core/res/res/values-uz-rUZ/strings.xml
+++ b/core/res/res/values-uz-rUZ/strings.xml
@@ -325,9 +325,9 @@
     <string name="permdesc_receiveBootCompleted" product="tv" msgid="4525890122209673621">"Ilovaga tizim ishga tushishi bilanoq o‘zi ham ishga tushadigan qilib qo‘yish huquqini beradi. Buning natijasida televizorning ishga tushishi sekinlashishi hamda ilovaning doimiy ravishda ishlab turishi oqibatida butun planshetning ishlashi sekinlashi mumkin."</string>
     <string name="permdesc_receiveBootCompleted" product="default" msgid="513950589102617504">"Ilova tizim qayta yoqilganidan so‘ng o‘zini ishga tushirishi mumkin. Bu telefonning yonish vaqtini uzaytirishi va doimiy ishlab turivchi ilova tufayli uning tezkor ishlashini kamaytirishi mumkin."</string>
     <string name="permlab_broadcastSticky" msgid="7919126372606881614">"xabarlarni keyinchalik saqlash sharti bilan yuborish"</string>
-    <string name="permdesc_broadcastSticky" product="tablet" msgid="7749760494399915651">"Ilovaga uzatish tugagandan keyin ham qoladigan yopishqoq uzatishlarni jo‘natishga ruxsat beradi. Bu uzatishdan juda ko‘p foydalanish ko‘p xotiradan foydalanishga olib keladi va natijada planshet sekin yoki beqaror ishlashi mumkin."</string>
-    <string name="permdesc_broadcastSticky" product="tv" msgid="6839285697565389467">"Ilovaga efir tugagandan so‘ng ham saqlanib qoladigan turg‘un translatsiyalarni uzatish huquqini beradi. Undan ortiqcha foydalanish televizoringizni sekinlatishi yoki ko‘p xotira sarflaydigan qilib qo‘yishi mumkin."</string>
-    <string name="permdesc_broadcastSticky" product="default" msgid="2825803764232445091">"Ilovaga uzatish tugagandan keyin ham qoladigan yopishqoq uzatishlarni jo‘natishga ruxsat beradi. Bu uzatishdan juda ko‘p foydalanish ko‘p xotiradan foydalanishga olib keladi va natijada telefon sekin yoki beqaror ishlashi mumkin."</string>
+    <string name="permdesc_broadcastSticky" product="tablet" msgid="7749760494399915651">"Ilova yuborilganidan keyin o‘chib ketmaydigan muddatsiz tarqatma xabarlarni yuborishi mumkin. Ulardan noto‘g‘ri maqsadda foydalanish qurilmaning ishlashini sekinlatishi yoki xotiraga haddan ziyod yuklanish tushishi oqibatida qurilma ishdan chiqishi mumkin."</string>
+    <string name="permdesc_broadcastSticky" product="tv" msgid="6839285697565389467">"Ilova yuborilganidan keyin o‘chib ketmaydigan muddatsiz tarqatma xabarlarni yuborishi mumkin. Ulardan noto‘g‘ri maqsadda foydalanish qurilmaning ishlashini sekinlatishi yoki xotiraga haddan ziyod yuklanish tushishi oqibatida qurilma ishdan chiqishi mumkin."</string>
+    <string name="permdesc_broadcastSticky" product="default" msgid="2825803764232445091">"Ilova yuborilganidan keyin o‘chib ketmaydigan muddatsiz tarqatma xabarlarni yuborishi mumkin. Ulardan noto‘g‘ri maqsadda foydalanish qurilmaning ishlashini sekinlatishi yoki xotiraga haddan ziyod yuklanish tushishi oqibatida qurilma ishdan chiqishi mumkin."</string>
     <string name="permlab_readContacts" msgid="8348481131899886131">"kontaktlaringizni ko‘rish"</string>
     <string name="permdesc_readContacts" product="tablet" msgid="5294866856941149639">"Ilovaga planshetingizda saqlangan kontaktlar ma’lumotlarini, shuningdek, ba‘zi shaxslarga qilgan qo‘ng‘iroqlar muntazamligi, ularga yozgan e-pochta xabarlari yoki boshqa xabar almashish yo‘llari orqali xabarlashganingiz haqidagi ma’lumotlarni o‘qishga ruxsat beradi. Ushbu ruxsat ilovalarga aloqa ma’lumotlaringizni saqlash uchun ruxsat beradi va zararli ilovalar sizga bildirmasdan kontaktlar ma’lumotlaringizni boshqalarga ulashishi mumkin."</string>
     <string name="permdesc_readContacts" product="tv" msgid="1839238344654834087">"Ilovaga televizoringizda saqlanayotgan kontaktlar haqidagi ma’lumotlarni, jumladan, muayyan shaxslar bilan qo‘ng‘iroqlashish, e-pochta orqali xabarlashish yoki muloqot qilish oralig‘i haqidagi ma’lumotlarni o‘qish huquqini beradi. Ushbu ruxsatnoma ilovalarga kontaktlaringiz haqidagi ma’lumotlarni saqlash huquqini berib, zararli ilovalar uning yordamida kontakt ma’lumotlarini sizdan beruxsat boshqalarga ulashishi mumkin."</string>
@@ -486,7 +486,7 @@
     <string name="permlab_manageNetworkPolicy" msgid="2562053592339859990">"tarmoq siyosatini boshqarish"</string>
     <string name="permdesc_manageNetworkPolicy" msgid="7537586771559370668">"Ilova tarmoq siyosatini boshqarishi va alohida ilovalar uchun qoidalarni o‘rnatishi mumkin."</string>
     <string name="permlab_modifyNetworkAccounting" msgid="5088217309088729650">"tarmoqdan foydalanishni hisoblashni o‘zgartirish"</string>
-    <string name="permdesc_modifyNetworkAccounting" msgid="5443412866746198123">"Ilovaga ilovalarga nisbadan hisoblanadigan tarmoqdan foydalanish ma’lumotlarini o‘zgartirishga ruxsat beradi. Oddiy ilovalar tomonidan foydalanilmaydi."</string>
+    <string name="permdesc_modifyNetworkAccounting" msgid="5443412866746198123">"Ilova turli dasturlar tomonidan ishlatiladigan tarmoq resurslari hisob-kitobini o‘zgartirishi mumkin. Bu ruxsat oddiy ilovalar uchun talab qilinmaydi."</string>
     <string name="permlab_accessNotifications" msgid="7673416487873432268">"ruxsat bildirishnomalari"</string>
     <string name="permdesc_accessNotifications" msgid="458457742683431387">"Dasturga bildirishnomalar va boshqa dasturlar jo‘natgan xabarlarni qabul qilish, ko‘rib chiqish hamda tozalash imkonini beradi."</string>
     <string name="permlab_bindNotificationListenerService" msgid="7057764742211656654">"bildirishnomani tinglash xizmatiga bog‘lash"</string>
@@ -526,7 +526,7 @@
     <string name="policydesc_resetPassword" msgid="1278323891710619128">"Ekran qulfini o‘zgartiradi."</string>
     <string name="policylab_forceLock" msgid="2274085384704248431">"Ekranni qulflash"</string>
     <string name="policydesc_forceLock" msgid="1141797588403827138">"Ekranning qachon va qanday qulflanishini boshqaradi."</string>
-    <string name="policylab_wipeData" msgid="3910545446758639713">"Barcha ma’lumotlarni tozalash"</string>
+    <string name="policylab_wipeData" msgid="3910545446758639713">"Barcha ma’lumotlarni o‘chirib tashlash"</string>
     <string name="policydesc_wipeData" product="tablet" msgid="4306184096067756876">"Planshetdagi barcha ma’lumotlarni ogohlantirishsiz zavod sozlamalarini tiklash orqali o‘chirib tashlaydi."</string>
     <string name="policydesc_wipeData" product="tv" msgid="5816221315214527028">"Zavod sozlamalarini tiklaydi va televizordagi barcha ma’lumotlarni ogohlantirishsiz o‘chirib tashlaydi."</string>
     <string name="policydesc_wipeData" product="default" msgid="5096895604574188391">"Telefondagi barcha ma’lumotlarni ogohlantirishsiz zavod sozlamalarini tiklash orqali o‘chirib tashlaydi."</string>
@@ -537,7 +537,7 @@
     <string name="policylab_setGlobalProxy" msgid="2784828293747791446">"Qurilmaga global proksi o‘rnatish"</string>
     <string name="policydesc_setGlobalProxy" msgid="8459859731153370499">"Qoida faollashtirilgan vaqtda ishlatiladigan qurilmaning global proksi-serverini o‘rnatadi. Faqat qurilma egasi global proksi-serverini o‘rnatishi mumkin."</string>
     <string name="policylab_expirePassword" msgid="5610055012328825874">"Parol muddatini o‘rnatish"</string>
-    <string name="policydesc_expirePassword" msgid="5367525762204416046">"Ekran qulfi paroli, PIN kodi yoki chizmali paroli o‘zgartiriladigan muddatni o‘zgartiradi."</string>
+    <string name="policydesc_expirePassword" msgid="5367525762204416046">"Ekran qulfi paroli, PIN kodi yoki grafik kaliti o‘zgartiriladigan muddatni o‘zgartiradi."</string>
     <string name="policylab_encryptedStorage" msgid="8901326199909132915">"Xotirani kodlashni o‘rnatish"</string>
     <string name="policydesc_encryptedStorage" msgid="2637732115325316992">"Zaxiralangan ilovalar ma‘lumotlarini kodlashni talab qiladi."</string>
     <string name="policylab_disableCamera" msgid="6395301023152297826">"Kameralarni o‘chirish"</string>
@@ -672,7 +672,7 @@
     <string name="lockscreen_screen_locked" msgid="7288443074806832904">"Ekran qulflangan."</string>
     <string name="lockscreen_instructions_when_pattern_enabled" msgid="46154051614126049">"Qulfdan chiqarish yoki favqulodda qo‘ng‘iroqni amalga oshirish uchun \"Menyu\"ni bosing."</string>
     <string name="lockscreen_instructions_when_pattern_disabled" msgid="686260028797158364">"Qulfni ochish uchun \"Menyu\"ga bosing."</string>
-    <string name="lockscreen_pattern_instructions" msgid="7478703254964810302">"Qulfni ochish uchun namuna ustiga chizing"</string>
+    <string name="lockscreen_pattern_instructions" msgid="7478703254964810302">"Qulfni ochish uchun grafik kalitni chizing"</string>
     <string name="lockscreen_emergency_call" msgid="5298642613417801888">"Favqulodda chaqiruv"</string>
     <string name="lockscreen_return_to_call" msgid="5244259785500040021">"Qo‘ng‘iroqni qaytarish"</string>
     <string name="lockscreen_pattern_correct" msgid="9039008650362261237">"To‘g‘ri!"</string>
@@ -700,12 +700,12 @@
     <string name="lockscreen_sim_puk_locked_instructions" msgid="8127916255245181063">"Foydalanuvchi qo‘llanmasiga qarang yoki Abonentlarni qo‘llab-quvvatlash markaziga murojaat qiling."</string>
     <string name="lockscreen_sim_locked_message" msgid="8066660129206001039">"SIM karta qulflangan."</string>
     <string name="lockscreen_sim_unlock_progress_dialog_message" msgid="595323214052881264">"SIM karta qulfdan chiqarilmoqda…"</string>
-    <string name="lockscreen_too_many_failed_attempts_dialog_message" msgid="6481623830344107222">"Siz chizmali kalitni <xliff:g id="NUMBER_0">%1$d</xliff:g> marta noto‘g‘ri kiritdingiz. \n\n<xliff:g id="NUMBER_1">%2$d</xliff:g> soniyadan so‘ng qayta urining."</string>
+    <string name="lockscreen_too_many_failed_attempts_dialog_message" msgid="6481623830344107222">"Siz grafik kalitni <xliff:g id="NUMBER_0">%1$d</xliff:g> marta noto‘g‘ri kiritdingiz. \n\n<xliff:g id="NUMBER_1">%2$d</xliff:g> soniyadan so‘ng qayta urining."</string>
     <string name="lockscreen_too_many_failed_password_attempts_dialog_message" msgid="2725973286239344555">"Siz parolni <xliff:g id="NUMBER_0">%1$d</xliff:g> marta noto‘g‘ri kiritdingiz. \n\n <xliff:g id="NUMBER_1">%2$d</xliff:g> soniyadan so‘ng qayta urining."</string>
     <string name="lockscreen_too_many_failed_pin_attempts_dialog_message" msgid="6216672706545696955">"Siz PIN-kodni <xliff:g id="NUMBER_0">%1$d</xliff:g> marta noto‘g‘ri kiritdingiz. \n\n <xliff:g id="NUMBER_1">%2$d</xliff:g> soniyadan so‘ng qayta urining."</string>
-    <string name="lockscreen_failed_attempts_almost_glogin" product="tablet" msgid="9191611984625460820">"Siz chizmali kalitni <xliff:g id="NUMBER_0">%1$d</xliff:g> marta noto‘g‘ri kiritdingiz. Telefon qulfini ochish uchun yana <xliff:g id="NUMBER_1">%2$d</xliff:g> marta noto‘g‘ri urinish qilsangiz, sizdan Google hisobingizga kirish talab qilinadi. \n\n <xliff:g id="NUMBER_2">%3$d</xliff:g> soniyadan so‘ng qayta urining."</string>
-    <string name="lockscreen_failed_attempts_almost_glogin" product="tv" msgid="5316664559603394684">"Siz chizmali kalitni <xliff:g id="NUMBER_0">%1$d</xliff:g> marta noto‘g‘ri kiritdingiz. Agar uni yana <xliff:g id="NUMBER_1">%2$d</xliff:g> marta noto‘g‘ri kiritsangiz, televizoringizni qulfdan chiqarish uchun Google hisobingizga kirish talab qilinadi.\n\n <xliff:g id="NUMBER_2">%3$d</xliff:g> soniyadan so‘ng qaytadan urining."</string>
-    <string name="lockscreen_failed_attempts_almost_glogin" product="default" msgid="2590227559763762751">"Siz chizmali kalitni <xliff:g id="NUMBER_0">%1$d</xliff:g> marta noto‘g‘ri kiritdingiz. Telefon qulfini ochish uchun yana <xliff:g id="NUMBER_1">%2$d</xliff:g> marta noto‘g‘ri urinish qilsangiz, sizdan Google hisobingizga kirish talab qilinadi.\n\n <xliff:g id="NUMBER_2">%3$d</xliff:g> soniyadan so‘ng qayta urining."</string>
+    <string name="lockscreen_failed_attempts_almost_glogin" product="tablet" msgid="9191611984625460820">"Siz grafik kalitni <xliff:g id="NUMBER_0">%1$d</xliff:g> marta noto‘g‘ri kiritdingiz. Telefon qulfini ochish uchun yana <xliff:g id="NUMBER_1">%2$d</xliff:g> marta noto‘g‘ri urinish qilsangiz, sizdan Google hisobingizga kirish talab qilinadi. \n\n <xliff:g id="NUMBER_2">%3$d</xliff:g> soniyadan so‘ng qayta urining."</string>
+    <string name="lockscreen_failed_attempts_almost_glogin" product="tv" msgid="5316664559603394684">"Siz grafik kalitni <xliff:g id="NUMBER_0">%1$d</xliff:g> marta noto‘g‘ri kiritdingiz. Agar uni yana <xliff:g id="NUMBER_1">%2$d</xliff:g> marta noto‘g‘ri kiritsangiz, televizoringizni qulfdan chiqarish uchun Google hisobingizga kirish talab qilinadi.\n\n <xliff:g id="NUMBER_2">%3$d</xliff:g> soniyadan so‘ng qaytadan urining."</string>
+    <string name="lockscreen_failed_attempts_almost_glogin" product="default" msgid="2590227559763762751">"Siz grafik kalitni <xliff:g id="NUMBER_0">%1$d</xliff:g> marta noto‘g‘ri kiritdingiz. Telefon qulfini ochish uchun yana <xliff:g id="NUMBER_1">%2$d</xliff:g> marta noto‘g‘ri urinish qilsangiz, sizdan Google hisobingizga kirish talab qilinadi.\n\n <xliff:g id="NUMBER_2">%3$d</xliff:g> soniyadan so‘ng qayta urining."</string>
     <string name="lockscreen_failed_attempts_almost_at_wipe" product="tablet" msgid="6128106399745755604">"Planshet qulfini <xliff:g id="NUMBER_0">%1$d</xliff:g> marta ochishga urinib ko‘rdingiz. <xliff:g id="NUMBER_1">%2$d</xliff:g> marta muvaffaqiyatsiz urinishlardan so‘ng, planshet ishlab chiqarilgan holatiga tiklanadi va barcha foydalanuvchi ma’lumotlari yo‘qoladi."</string>
     <string name="lockscreen_failed_attempts_almost_at_wipe" product="tv" msgid="950408382418270260">"Siz televizorni qulfdan chiqarish parolini <xliff:g id="NUMBER_0">%1$d</xliff:g> marta noto‘g‘ri kiritdingiz. Agar uni yana <xliff:g id="NUMBER_1">%2$d</xliff:g> marta noto‘g‘ri kiritsangiz, televizoringizda zavod sozlamalari qayta tiklanadi hamda undagi barcha ma’lumotlaringiz o‘chib ketadi."</string>
     <string name="lockscreen_failed_attempts_almost_at_wipe" product="default" msgid="8603565142156826565">"Telefon qulfini <xliff:g id="NUMBER_0">%1$d</xliff:g> marta ochishga urinib ko‘rdingiz. <xliff:g id="NUMBER_1">%2$d</xliff:g> marta muvaffaqiyatsiz urinishlardan so‘ng, telefon ishlab chiqarilgan holatiga tiklanadi va barcha foydalanuvchi ma’lumotlari yo‘qoladi."</string>
@@ -713,9 +713,9 @@
     <string name="lockscreen_failed_attempts_now_wiping" product="tv" msgid="3195755534096192191">"Siz televizorni qulfdan chiqarish parolini <xliff:g id="NUMBER">%d</xliff:g> marta noto‘g‘ri kiritdingiz. Endi, televizoringizda zavod sozlamalari qayta tiklanadi."</string>
     <string name="lockscreen_failed_attempts_now_wiping" product="default" msgid="3025504721764922246">"Telefon qulfini <xliff:g id="NUMBER">%d</xliff:g> marta ochishga urinib ko‘rdingiz. Telefon hozir ishlab chiqarilgan holatiga tiklanadi."</string>
     <string name="lockscreen_too_many_failed_attempts_countdown" msgid="6251480343394389665">"<xliff:g id="NUMBER">%d</xliff:g> soniyadan so‘ng qayta urinib ko‘ring."</string>
-    <string name="lockscreen_forgot_pattern_button_text" msgid="2626999449610695930">"Chizma namunasi yodingizdan chiqdimi?"</string>
+    <string name="lockscreen_forgot_pattern_button_text" msgid="2626999449610695930">"Grafik kalit esingizdan chiqdimi?"</string>
     <string name="lockscreen_glogin_forgot_pattern" msgid="2588521501166032747">"Qulfni ochish hisobi"</string>
-    <string name="lockscreen_glogin_too_many_attempts" msgid="2751368605287288808">"Chizmali parolni ochishga juda ko‘p urinildi"</string>
+    <string name="lockscreen_glogin_too_many_attempts" msgid="2751368605287288808">"Grafik kalit juda ko‘p marta chizildi"</string>
     <string name="lockscreen_glogin_instructions" msgid="3931816256100707784">"Qulfni ochish uchun Google hisobingiz bilan kiring."</string>
     <string name="lockscreen_glogin_username_hint" msgid="8846881424106484447">"Foydalanuvchi nomi (e-pochta)"</string>
     <string name="lockscreen_glogin_password_hint" msgid="5958028383954738528">"Parol"</string>
@@ -726,12 +726,12 @@
     <string name="lockscreen_unlock_label" msgid="737440483220667054">"Qulfdan chiqarish"</string>
     <string name="lockscreen_sound_on_label" msgid="9068877576513425970">"Ovozni yoqish"</string>
     <string name="lockscreen_sound_off_label" msgid="996822825154319026">"Ovozni o‘chirish"</string>
-    <string name="lockscreen_access_pattern_start" msgid="3941045502933142847">"Chizma namunasi ishga tushirildi"</string>
-    <string name="lockscreen_access_pattern_cleared" msgid="5583479721001639579">"Chizma namunasi tozalandi"</string>
+    <string name="lockscreen_access_pattern_start" msgid="3941045502933142847">"Grafik kalitni chizish boshlandi"</string>
+    <string name="lockscreen_access_pattern_cleared" msgid="5583479721001639579">"Grafik kalit tozalandi"</string>
     <string name="lockscreen_access_pattern_cell_added" msgid="6756031208359292487">"Katak qo‘shildi"</string>
     <string name="lockscreen_access_pattern_cell_added_verbose" msgid="7264580781744026939">"<xliff:g id="CELL_INDEX">%1$s</xliff:g> katak qo‘shildi"</string>
-    <string name="lockscreen_access_pattern_detected" msgid="4988730895554057058">"Chizma namunasi tugatildi"</string>
-    <string name="lockscreen_access_pattern_area" msgid="400813207572953209">"Chizmali kalit hududi."</string>
+    <string name="lockscreen_access_pattern_detected" msgid="4988730895554057058">"Grafik kalitni chizish tugallandi"</string>
+    <string name="lockscreen_access_pattern_area" msgid="400813207572953209">"Grafik kalit chiziladigan hudud."</string>
     <string name="keyguard_accessibility_widget_changed" msgid="5678624624681400191">"%1$s. Vidjet %2$d / %3$d."</string>
     <string name="keyguard_accessibility_add_widget" msgid="8273277058724924654">"Vidjet qo‘shish."</string>
     <string name="keyguard_accessibility_widget_empty_slot" msgid="1281505703307930757">"Bo‘sh"</string>
@@ -747,11 +747,11 @@
     <string name="keyguard_accessibility_widget_deleted" msgid="4426204263929224434">"<xliff:g id="WIDGET_INDEX">%1$s</xliff:g> vidjeti o‘chirildi."</string>
     <string name="keyguard_accessibility_expand_lock_area" msgid="519859720934178024">"Qulfni ochish maydonini kengaytirish."</string>
     <string name="keyguard_accessibility_slide_unlock" msgid="2959928478764697254">"Qulfni silab ochish"</string>
-    <string name="keyguard_accessibility_pattern_unlock" msgid="1490840706075246612">"Chizmali qulfni ochish."</string>
+    <string name="keyguard_accessibility_pattern_unlock" msgid="1490840706075246612">"Grafik kalit bilan ochish."</string>
     <string name="keyguard_accessibility_face_unlock" msgid="4817282543351718535">"Qulfni yuzni tanitib ochish"</string>
     <string name="keyguard_accessibility_pin_unlock" msgid="2469687111784035046">"Pin qulfini ochish."</string>
     <string name="keyguard_accessibility_password_unlock" msgid="7675777623912155089">"Parolli qulfni ochish."</string>
-    <string name="keyguard_accessibility_pattern_area" msgid="7679891324509597904">"Chizmali qulf maydoni."</string>
+    <string name="keyguard_accessibility_pattern_area" msgid="7679891324509597904">"Grafik kalit chiziladigan hudud."</string>
     <string name="keyguard_accessibility_slide_area" msgid="6736064494019979544">"Maydonni silang"</string>
     <string name="password_keyboard_label_symbol_key" msgid="992280756256536042">"?123"</string>
     <string name="password_keyboard_label_alpha_key" msgid="8001096175167485649">"ABC"</string>
@@ -1015,6 +1015,8 @@
     <string name="screen_compat_mode_scale" msgid="3202955667675944499">"Masshtab"</string>
     <string name="screen_compat_mode_show" msgid="4013878876486655892">"Doimo ko‘rsatish"</string>
     <string name="screen_compat_mode_hint" msgid="1064524084543304459">"Uni Tizim sozlamalari &gt; Ilovalar &gt; Yuklab olingan menyusidan qayta yoqing."</string>
+    <string name="unsupported_display_size_message" msgid="6545327290756295232">"“<xliff:g id="APP_NAME">%1$s</xliff:g>” ilovasi joriy ekran o‘lchami sozlamalariga mos kelmasligi va noto‘g‘ri ishlashi mumkin."</string>
+    <string name="unsupported_display_size_show" msgid="7969129195360353041">"Har doim ko‘rsatilsin"</string>
     <string name="smv_application" msgid="3307209192155442829">"“<xliff:g id="APPLICATION">%1$s</xliff:g>” ilovasi (jarayaon: <xliff:g id="PROCESS">%2$s</xliff:g>) o‘zining StrictMode qoidasini buzdi."</string>
     <string name="smv_process" msgid="5120397012047462446">"<xliff:g id="PROCESS">%1$s</xliff:g> jarayoni o‘zining o‘zi-bajaruvchi StrictMode siyosatini buzdi."</string>
     <string name="android_upgrading_title" msgid="1584192285441405746">"Android yangilanmoqda…"</string>
@@ -1151,7 +1153,7 @@
     <string name="fast_scroll_numeric_alphabet" msgid="4030170524595123610">" 0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"</string>
     <string name="candidates_style" msgid="4333913089637062257"><u>"nomzodlar"</u></string>
     <string name="ext_media_checking_notification_title" msgid="5734005953288045806">"<xliff:g id="NAME">%s</xliff:g> tayyorlanmoqda"</string>
-    <string name="ext_media_checking_notification_message" msgid="4747432538578886744">"Xatolar tekshirilmoqda"</string>
+    <string name="ext_media_checking_notification_message" msgid="4747432538578886744">"Xatolar qidirilmoqda"</string>
     <string name="ext_media_new_notification_message" msgid="7589986898808506239">"Yangi <xliff:g id="NAME">%s</xliff:g> kartasi aniqlandi"</string>
     <string name="ext_media_ready_notification_message" msgid="4083398150380114462">"Rasm va boshqa fayllarni o‘tkazish"</string>
     <string name="ext_media_unmountable_notification_title" msgid="8295123366236989588">"“<xliff:g id="NAME">%s</xliff:g>” buzilgan"</string>
@@ -1368,7 +1370,7 @@
     <string name="media_route_chooser_searching" msgid="4776236202610828706">"Qurilmalar izlanmoqda..."</string>
     <string name="media_route_chooser_extended_settings" msgid="87015534236701604">"Sozlamalar"</string>
     <string name="media_route_controller_disconnect" msgid="8966120286374158649">"Uzish"</string>
-    <string name="media_route_status_scanning" msgid="7279908761758293783">"Tekshirilmoqda..."</string>
+    <string name="media_route_status_scanning" msgid="7279908761758293783">"Qidirilmoqda..."</string>
     <string name="media_route_status_connecting" msgid="6422571716007825440">"Ulanmoqda..."</string>
     <string name="media_route_status_available" msgid="6983258067194649391">"Mavjud"</string>
     <string name="media_route_status_not_available" msgid="6739899962681886401">"Mavjud emas"</string>
@@ -1378,8 +1380,8 @@
     <string name="display_manager_overlay_display_name" msgid="5142365982271620716">"Tasvir uzatish #<xliff:g id="ID">%1$d</xliff:g>"</string>
     <string name="display_manager_overlay_display_title" msgid="652124517672257172">"<xliff:g id="NAME">%1$s</xliff:g>: <xliff:g id="WIDTH">%2$d</xliff:g>x<xliff:g id="HEIGHT">%3$d</xliff:g>, <xliff:g id="DPI">%4$d</xliff:g> dpi"</string>
     <string name="display_manager_overlay_display_secure_suffix" msgid="6022119702628572080">", xavfsiz"</string>
-    <string name="kg_forgot_pattern_button_text" msgid="8852021467868220608">"Chizmali parol unutilgan"</string>
-    <string name="kg_wrong_pattern" msgid="1850806070801358830">"Chizmali kalit noto‘g‘ri"</string>
+    <string name="kg_forgot_pattern_button_text" msgid="8852021467868220608">"Grafik kalit esimdan chiqdi"</string>
+    <string name="kg_wrong_pattern" msgid="1850806070801358830">"Grafik kalit noto‘g‘ri"</string>
     <string name="kg_wrong_password" msgid="2333281762128113157">"Parol noto‘g‘ri"</string>
     <string name="kg_wrong_pin" msgid="1131306510833563801">"PIN-kod noto‘g‘ri"</string>
     <string name="kg_too_many_failed_attempts_countdown" msgid="6358110221603297548">"<xliff:g id="NUMBER">%1$d</xliff:g> soniyadan so‘ng qayta urinib ko‘ring."</string>
@@ -1396,7 +1398,7 @@
     <string name="kg_invalid_sim_puk_hint" msgid="6025069204539532000">"PUK kod 8 ta raqam bo‘lishi shart."</string>
     <string name="kg_invalid_puk" msgid="3638289409676051243">"To‘g‘ri PUK kodni qayta kiriting. Qayta-qayta urinishlar SIM kartani butunlay o‘chirib qo‘yadi."</string>
     <string name="kg_invalid_confirm_pin_hint" product="default" msgid="7003469261464593516">"PIN-kod mos kelmadi"</string>
-    <string name="kg_login_too_many_attempts" msgid="6486842094005698475">"Chizmali parolni ochishga juda ko‘p urinildi"</string>
+    <string name="kg_login_too_many_attempts" msgid="6486842094005698475">"Grafik kalit juda ko‘p marta chizildi"</string>
     <string name="kg_login_instructions" msgid="1100551261265506448">"Qulfni ochish uchun Google hisobingiz bilan kiring."</string>
     <string name="kg_login_username_hint" msgid="5718534272070920364">"Foydalanuvchi nomi (e-pochta)"</string>
     <string name="kg_login_password_hint" msgid="9057289103827298549">"Parol"</string>
@@ -1406,16 +1408,16 @@
     <string name="kg_login_checking_password" msgid="1052685197710252395">"Hisob tekshirilmoqda…"</string>
     <string name="kg_too_many_failed_pin_attempts_dialog_message" msgid="8276745642049502550">"Siz PIN-kodni <xliff:g id="NUMBER_0">%1$d</xliff:g> marta noto‘g‘ri kiritdingiz. \n\n<xliff:g id="NUMBER_1">%2$d</xliff:g> soniyadan so‘ng qayta urinib ko‘ring."</string>
     <string name="kg_too_many_failed_password_attempts_dialog_message" msgid="7813713389422226531">"Siz parolni <xliff:g id="NUMBER_0">%1$d</xliff:g> marta noto‘g‘ri kiritdingiz. \n\n<xliff:g id="NUMBER_1">%2$d</xliff:g> soniyadan so‘ng qayta urinib ko‘ring."</string>
-    <string name="kg_too_many_failed_pattern_attempts_dialog_message" msgid="74089475965050805">"Siz chizmali kalitni <xliff:g id="NUMBER_0">%1$d</xliff:g> marta noto‘g‘ri kiritdingiz. \n\n<xliff:g id="NUMBER_1">%2$d</xliff:g> soniyadan so‘ng qayta urinib ko‘ring."</string>
+    <string name="kg_too_many_failed_pattern_attempts_dialog_message" msgid="74089475965050805">"Siz grafik kalitni <xliff:g id="NUMBER_0">%1$d</xliff:g> marta noto‘g‘ri kiritdingiz. \n\n<xliff:g id="NUMBER_1">%2$d</xliff:g> soniyadan so‘ng qayta urinib ko‘ring."</string>
     <string name="kg_failed_attempts_almost_at_wipe" product="tablet" msgid="1575557200627128949">"Siz planshet qulfini ochish uchun <xliff:g id="NUMBER_0">%1$d</xliff:g> marta muvaffaqiyatsiz urindingiz. <xliff:g id="NUMBER_1">%2$d</xliff:g> marta muvaffaqiyatsiz urinishlardan so‘ng planshetning zavod sozlamalari tiklanadi va barcha foydalanuvchi ma’lumotlari o‘chiriladi."</string>
     <string name="kg_failed_attempts_almost_at_wipe" product="tv" msgid="5621231220154419413">"Siz televizorni qulfdan chiqarish parolini <xliff:g id="NUMBER_0">%1$d</xliff:g> marta noto‘g‘ri kiritdingiz. Agar uni yana <xliff:g id="NUMBER_1">%2$d</xliff:g> marta noto‘g‘ri kiritsangiz, televizoringizda zavod sozlamalari qayta tiklanadi hamda undagi barcha ma’lumotlaringiz o‘chib ketadi."</string>
     <string name="kg_failed_attempts_almost_at_wipe" product="default" msgid="4051015943038199910">"Siz telefon qulfini ochish uchun <xliff:g id="NUMBER_0">%1$d</xliff:g> marta muvaffaqiyatsiz urindingiz. <xliff:g id="NUMBER_1">%2$d</xliff:g> marta muvaffaqiyatsiz urinishlardan so‘ng telefonning zavod sozlamalari tiklanadi va barcha foydalanuvchi ma’lumotlari o‘chiriladi."</string>
     <string name="kg_failed_attempts_now_wiping" product="tablet" msgid="2072996269148483637">"Planshet qulfini ochish uchun <xliff:g id="NUMBER">%d</xliff:g> marta muvaffaqiyatsiz urinib ko‘rdingiz. Planshetning hozir zavod sozlamari tiklanadi."</string>
     <string name="kg_failed_attempts_now_wiping" product="tv" msgid="4987878286750741463">"Siz televizorni qulfdan chiqarish parolini <xliff:g id="NUMBER">%d</xliff:g> marta noto‘g‘ri kiritdingiz. Endi, televizoringizda zavod sozlamalari qayta tiklanadi."</string>
     <string name="kg_failed_attempts_now_wiping" product="default" msgid="4817627474419471518">"Telefon qulfini ochish uchun <xliff:g id="NUMBER">%d</xliff:g> marta muvaffaqiyatsiz urinib ko‘rdingiz. Telefonning hozir zavod sozlamari tiklanadi."</string>
-    <string name="kg_failed_attempts_almost_at_login" product="tablet" msgid="3253575572118914370">"Siz chizmali kalitni  <xliff:g id="NUMBER_0">%1$d</xliff:g> marta noto‘g‘ri kiritdingiz. <xliff:g id="NUMBER_1">%2$d</xliff:g> marta muvaffaqiyatsiz urinishdan so‘ng, sizdan e-pochtangizdan foydalanib, planshet qulfini ochishingiz so‘raladi.\n\n <xliff:g id="NUMBER_2">%3$d</xliff:g> soniyadan so‘ng yana urinib ko‘ring."</string>
-    <string name="kg_failed_attempts_almost_at_login" product="tv" msgid="4224651132862313471">"Siz chizmali kalitni <xliff:g id="NUMBER_0">%1$d</xliff:g> marta noto‘g‘ri kiritdingiz. Agar uni yana <xliff:g id="NUMBER_1">%2$d</xliff:g> marta noto‘g‘ri kiritsangiz, televizoringizni qulfdan chiqarish uchun sizda e-pochta hisobingizga kirish talab qilinadi.\n\n <xliff:g id="NUMBER_2">%3$d</xliff:g> soniyadan so‘ng qaytadan urining."</string>
-    <string name="kg_failed_attempts_almost_at_login" product="default" msgid="1437638152015574839">"Siz chizmali kalitni <xliff:g id="NUMBER_0">%1$d</xliff:g> marta noto‘g‘ri chizdingiz. <xliff:g id="NUMBER_1">%2$d</xliff:g> marta muvaffaqiyatsiz urinishdan so‘ng, sizdan e-pochtangizdan foydalanib, telefon qulfini ochishingiz so‘raladi.\n\n <xliff:g id="NUMBER_2">%3$d</xliff:g> soniyadan so‘ng yana urinib ko‘ring."</string>
+    <string name="kg_failed_attempts_almost_at_login" product="tablet" msgid="3253575572118914370">"Siz grafik kalitni  <xliff:g id="NUMBER_0">%1$d</xliff:g> marta noto‘g‘ri kiritdingiz. <xliff:g id="NUMBER_1">%2$d</xliff:g> marta muvaffaqiyatsiz urinishdan so‘ng, sizdan e-pochtangizdan foydalanib, planshet qulfini ochishingiz so‘raladi.\n\n <xliff:g id="NUMBER_2">%3$d</xliff:g> soniyadan so‘ng yana urinib ko‘ring."</string>
+    <string name="kg_failed_attempts_almost_at_login" product="tv" msgid="4224651132862313471">"Siz grafik kalitni <xliff:g id="NUMBER_0">%1$d</xliff:g> marta noto‘g‘ri kiritdingiz. Agar uni yana <xliff:g id="NUMBER_1">%2$d</xliff:g> marta noto‘g‘ri kiritsangiz, televizoringizni qulfdan chiqarish uchun sizda e-pochta hisobingizga kirish talab qilinadi.\n\n <xliff:g id="NUMBER_2">%3$d</xliff:g> soniyadan so‘ng qaytadan urining."</string>
+    <string name="kg_failed_attempts_almost_at_login" product="default" msgid="1437638152015574839">"Siz grafik kalitni <xliff:g id="NUMBER_0">%1$d</xliff:g> marta noto‘g‘ri chizdingiz. <xliff:g id="NUMBER_1">%2$d</xliff:g> marta muvaffaqiyatsiz urinishdan so‘ng, sizdan e-pochtangizdan foydalanib, telefon qulfini ochishingiz so‘raladi.\n\n <xliff:g id="NUMBER_2">%3$d</xliff:g> soniyadan so‘ng yana urinib ko‘ring."</string>
     <string name="kg_text_message_separator" product="default" msgid="4160700433287233771">" — "</string>
     <string name="kg_reordering_delete_drop_target_text" msgid="7899202978204438708">"O‘chirish"</string>
     <string name="safe_media_volume_warning" product="default" msgid="2276318909314492312">"Ovoz balandligi tavsiya etilgan darajadan ham yuqori ko‘tarilsinmi?\n\nUzoq vaqt davomida baland ovozda tinglash eshitish qobiliyatingizga salbiy ta’sir ko‘rsatishi mumkin."</string>
@@ -1550,7 +1552,7 @@
     <string name="lock_to_app_start" msgid="6643342070839862795">"Ekran qadab qo‘yildi"</string>
     <string name="lock_to_app_exit" msgid="8598219838213787430">"Ekran bo‘shatildi"</string>
     <string name="lock_to_app_unlock_pin" msgid="2552556656504331634">"Yechishda PIN-kod so‘ralsin"</string>
-    <string name="lock_to_app_unlock_pattern" msgid="4182192144797225137">"Bo‘shatishdan oldin chizmali parol so‘ralsin"</string>
+    <string name="lock_to_app_unlock_pattern" msgid="4182192144797225137">"Yechishdan oldin grafik kalit so‘ralsin"</string>
     <string name="lock_to_app_unlock_password" msgid="6380979775916974414">"Bo‘shatishdan oldin parol so‘ralsin"</string>
     <string name="package_installed_device_owner" msgid="8420696545959087545">"Administratoringiz tomonidan o‘rnatilgan"</string>
     <string name="package_updated_device_owner" msgid="8856631322440187071">"Administratoringiz tomonidan yangilandi"</string>
diff --git a/core/res/res/values-vi/strings.xml b/core/res/res/values-vi/strings.xml
index 9ad9737..3b86a37 100644
--- a/core/res/res/values-vi/strings.xml
+++ b/core/res/res/values-vi/strings.xml
@@ -1015,6 +1015,8 @@
     <string name="screen_compat_mode_scale" msgid="3202955667675944499">"Tỷ lệ"</string>
     <string name="screen_compat_mode_show" msgid="4013878876486655892">"Luôn hiển thị"</string>
     <string name="screen_compat_mode_hint" msgid="1064524084543304459">"Bật lại chế độ này trong cài đặt Hệ thống &gt; Ứng dụng &gt; Đã tải xuống."</string>
+    <string name="unsupported_display_size_message" msgid="6545327290756295232">"<xliff:g id="APP_NAME">%1$s</xliff:g> không hỗ trợ cài đặt kích thước Màn hình hiện tại và có thể hoạt động không như mong đợi."</string>
+    <string name="unsupported_display_size_show" msgid="7969129195360353041">"Luôn hiển thị"</string>
     <string name="smv_application" msgid="3307209192155442829">"Ứng dụng <xliff:g id="APPLICATION">%1$s</xliff:g> (quá trình <xliff:g id="PROCESS">%2$s</xliff:g>) đã vi phạm chính sách StrictMode tự thi hành của mình."</string>
     <string name="smv_process" msgid="5120397012047462446">"Quá trình <xliff:g id="PROCESS">%1$s</xliff:g> đã vi phạm chính sách StrictMode tự thi hành của mình."</string>
     <string name="android_upgrading_title" msgid="1584192285441405746">"Android đang nâng cấp..."</string>
diff --git a/core/res/res/values-zh-rCN/strings.xml b/core/res/res/values-zh-rCN/strings.xml
index 9336182..d7490c5 100644
--- a/core/res/res/values-zh-rCN/strings.xml
+++ b/core/res/res/values-zh-rCN/strings.xml
@@ -1015,6 +1015,8 @@
     <string name="screen_compat_mode_scale" msgid="3202955667675944499">"缩放"</string>
     <string name="screen_compat_mode_show" msgid="4013878876486655892">"始终显示"</string>
     <string name="screen_compat_mode_hint" msgid="1064524084543304459">"在“系统设置”&gt;“应用”&gt;“已下载”中重新启用此模式。"</string>
+    <string name="unsupported_display_size_message" msgid="6545327290756295232">"<xliff:g id="APP_NAME">%1$s</xliff:g>不支持当前的显示大小设置,因此可能无法正常显示。"</string>
+    <string name="unsupported_display_size_show" msgid="7969129195360353041">"一律显示"</string>
     <string name="smv_application" msgid="3307209192155442829">"“<xliff:g id="APPLICATION">%1$s</xliff:g>”应用(<xliff:g id="PROCESS">%2$s</xliff:g> 进程)违反了自我强制执行的严格模式 (StrictMode) 政策。"</string>
     <string name="smv_process" msgid="5120397012047462446">"进程 <xliff:g id="PROCESS">%1$s</xliff:g> 违反了自我强制执行的严格模式 (StrictMode) 政策。"</string>
     <string name="android_upgrading_title" msgid="1584192285441405746">"Android正在升级..."</string>
diff --git a/core/res/res/values-zh-rHK/strings.xml b/core/res/res/values-zh-rHK/strings.xml
index d7b705b..6c896b2 100644
--- a/core/res/res/values-zh-rHK/strings.xml
+++ b/core/res/res/values-zh-rHK/strings.xml
@@ -1015,6 +1015,8 @@
     <string name="screen_compat_mode_scale" msgid="3202955667675944499">"比例"</string>
     <string name="screen_compat_mode_show" msgid="4013878876486655892">"永遠顯示"</string>
     <string name="screen_compat_mode_hint" msgid="1064524084543304459">"前往 [系統設定] &gt; [應用程式] &gt; [下載] 重新啟用這個模式。"</string>
+    <string name="unsupported_display_size_message" msgid="6545327290756295232">"「<xliff:g id="APP_NAME">%1$s</xliff:g>」不支援目前的「螢幕」尺寸設定,畫面可能無法如預期顯示。"</string>
+    <string name="unsupported_display_size_show" msgid="7969129195360353041">"永遠顯示"</string>
     <string name="smv_application" msgid="3307209192155442829">"應用程式 <xliff:g id="APPLICATION">%1$s</xliff:g> (處理程序 <xliff:g id="PROCESS">%2$s</xliff:g>) 已違反其自行強制實施的嚴格模式 (StrictMode) 政策。"</string>
     <string name="smv_process" msgid="5120397012047462446">"處理程序 <xliff:g id="PROCESS">%1$s</xliff:g> 已違反其自行強制實施的嚴格模式 (StrictMode) 政策。"</string>
     <string name="android_upgrading_title" msgid="1584192285441405746">"正在升級 Android..."</string>
diff --git a/core/res/res/values-zh-rTW/strings.xml b/core/res/res/values-zh-rTW/strings.xml
index cef8b98..f3691cd 100644
--- a/core/res/res/values-zh-rTW/strings.xml
+++ b/core/res/res/values-zh-rTW/strings.xml
@@ -1015,6 +1015,8 @@
     <string name="screen_compat_mode_scale" msgid="3202955667675944499">"比例"</string>
     <string name="screen_compat_mode_show" msgid="4013878876486655892">"一律顯示"</string>
     <string name="screen_compat_mode_hint" msgid="1064524084543304459">"前往 [系統設定] &gt; [應用程式] &gt; [下載] 重新啟用這個模式。"</string>
+    <string name="unsupported_display_size_message" msgid="6545327290756295232">"「<xliff:g id="APP_NAME">%1$s</xliff:g>」不支援目前的顯示大小設定,可能會發生非預期的行為。"</string>
+    <string name="unsupported_display_size_show" msgid="7969129195360353041">"一律顯示"</string>
     <string name="smv_application" msgid="3307209192155442829">"應用程式 <xliff:g id="APPLICATION">%1$s</xliff:g> (處理程序 <xliff:g id="PROCESS">%2$s</xliff:g>) 已違反其自行強制實施的嚴格模式 (StrictMode) 政策。"</string>
     <string name="smv_process" msgid="5120397012047462446">"處理程序 <xliff:g id="PROCESS">%1$s</xliff:g> 已違反其自行強制實施的嚴格模式 (StrictMode) 政策。"</string>
     <string name="android_upgrading_title" msgid="1584192285441405746">"正在升級 Android…"</string>
diff --git a/core/res/res/values-zu/strings.xml b/core/res/res/values-zu/strings.xml
index 7720b5e..a2f5c13 100644
--- a/core/res/res/values-zu/strings.xml
+++ b/core/res/res/values-zu/strings.xml
@@ -1015,6 +1015,8 @@
     <string name="screen_compat_mode_scale" msgid="3202955667675944499">"Isilinganisi"</string>
     <string name="screen_compat_mode_show" msgid="4013878876486655892">"Bonisa njalo"</string>
     <string name="screen_compat_mode_hint" msgid="1064524084543304459">"Yenza kuphinde kusebenze kuzilungiselelo Zesistimue &gt; Izinhlelo zokusebenza &gt; Okulayishiwe."</string>
+    <string name="unsupported_display_size_message" msgid="6545327290756295232">"I-<xliff:g id="APP_NAME">%1$s</xliff:g> ayisekeli isilungiselelo sosayizi sokubonisa samanje futhi ingasebenza ngokungalindelekile."</string>
+    <string name="unsupported_display_size_show" msgid="7969129195360353041">"Bonisa njalo"</string>
     <string name="smv_application" msgid="3307209192155442829">"Inqubo <xliff:g id="APPLICATION">%1$s</xliff:g> (yohlelo <xliff:g id="PROCESS">%2$s</xliff:g>) iphule inqubomgomo oziphoqelela yona Yemodi Ebukhali."</string>
     <string name="smv_process" msgid="5120397012047462446">"Inqubo <xliff:g id="PROCESS">%1$s</xliff:g> yephule inqubomgomo yokuziphoqelela Yemodi Ebukhali."</string>
     <string name="android_upgrading_title" msgid="1584192285441405746">"I-Android ifaka ezakamuva..."</string>
diff --git a/core/res/res/values/strings.xml b/core/res/res/values/strings.xml
index 48744b6..b55a9b22 100644
--- a/core/res/res/values/strings.xml
+++ b/core/res/res/values/strings.xml
@@ -2768,6 +2768,11 @@
     <!-- [CHAR LIMIT=200] Compat mode dialog: hint to re-enable compat mode dialog. -->
     <string name="screen_compat_mode_hint">Re-enable this in System settings &gt; Apps &gt; Downloaded.</string>
 
+    <!-- [CHAR LIMIT=200] Unsupported display size dialog: message. Refers to "Display size" setting. -->
+    <string name="unsupported_display_size_message"><xliff:g id="app_name">%1$s</xliff:g> does not support the current Display size setting and may behave unexpectedly.</string>
+    <!-- [CHAR LIMIT=50] Unsupported display size dialog: check box label. -->
+    <string name="unsupported_display_size_show">Always show</string>
+
     <!-- Text of the alert that is displayed when an application has violated StrictMode. -->
     <string name="smv_application">The app <xliff:g id="application">%1$s</xliff:g>
         (process <xliff:g id="process">%2$s</xliff:g>) has violated its self-enforced StrictMode policy.</string>
diff --git a/core/res/res/values/symbols.xml b/core/res/res/values/symbols.xml
index 7e9b57c..d154b03 100644
--- a/core/res/res/values/symbols.xml
+++ b/core/res/res/values/symbols.xml
@@ -2609,4 +2609,7 @@
   <java-symbol type="array" name="config_defaultPinnerServiceFiles" />
 
   <java-symbol type="string" name="suspended_widget_accessibility" />
+
+  <java-symbol type="layout" name="unsupported_display_size_dialog_content" />
+  <java-symbol type="string" name="unsupported_display_size_message" />
 </resources>
diff --git a/core/tests/notificationtests/src/android/app/NotificationStressTest.java b/core/tests/notificationtests/src/android/app/NotificationStressTest.java
index 6e86c37..f174014 100644
--- a/core/tests/notificationtests/src/android/app/NotificationStressTest.java
+++ b/core/tests/notificationtests/src/android/app/NotificationStressTest.java
@@ -40,9 +40,9 @@
     private static final int NUM_ITERATIONS = 200;
     private static final int NUM_ITERATIONS_2 = 30;
     private static final int LONG_TIMEOUT = 2000;
-    // 50 notifications per app: defined as Variable MAX_PACKAGE_NOTIFICATIONS in
+    // 49 notifications per app: defined as Variable MAX_PACKAGE_NOTIFICATIONS in
     // NotificationManagerService.java
-    private static final int MAX_NOTIFCATIONS = 50;
+    private static final int MAX_NOTIFCATIONS = 49;
     private static final int[] ICONS = new int[] {
             android.R.drawable.stat_notify_call_mute,
             android.R.drawable.stat_notify_chat,
@@ -76,9 +76,10 @@
 
     @Override
     protected void tearDown() throws Exception {
-        super.tearDown();
         mDevice.unfreezeRotation();
         mNotificationManager.cancelAll();
+        mDevice.waitForIdle();
+        super.tearDown();
     }
 
     @RepetitiveTest(numIterations = NUM_ITERATIONS)
@@ -97,7 +98,7 @@
         for (int j = 0; j < MAX_NOTIFCATIONS; j++) {
             sendNotification(mNotifyId++, "testNotificationStressNotify");
         }
-        Thread.sleep(500);
+        Thread.sleep(LONG_TIMEOUT);
         assertTrue(mNotificationManager.getActiveNotifications().length == MAX_NOTIFCATIONS);
         for (int j = 0; j < MAX_NOTIFCATIONS; j++) {
             mNotificationManager.cancel(--mNotifyId);
@@ -124,7 +125,8 @@
                 .setPriority(Notification.PRIORITY_HIGH)
                 .build();
         mNotificationManager.notify(id, notification);
-        SystemClock.sleep(10);
+        //update rate limit is 50 notifications/second.
+        SystemClock.sleep(20);
     }
 
     private boolean isLockScreen() {
diff --git a/docs/html-intl/intl/es/preview/images/bundles.png b/docs/html-intl/intl/es/preview/images/bundles.png
deleted file mode 100644
index 8b022b1..0000000
--- a/docs/html-intl/intl/es/preview/images/bundles.png
+++ /dev/null
Binary files differ
diff --git a/docs/html-intl/intl/es/preview/images/bundles_2x.png b/docs/html-intl/intl/es/preview/images/bundles_2x.png
deleted file mode 100644
index 4669096..0000000
--- a/docs/html-intl/intl/es/preview/images/bundles_2x.png
+++ /dev/null
Binary files differ
diff --git a/docs/html-intl/intl/es/preview/images/datasaver.png b/docs/html-intl/intl/es/preview/images/datasaver.png
deleted file mode 100644
index c5a58fb..0000000
--- a/docs/html-intl/intl/es/preview/images/datasaver.png
+++ /dev/null
Binary files differ
diff --git a/docs/html-intl/intl/es/preview/images/doze-diagram-1.png b/docs/html-intl/intl/es/preview/images/doze-diagram-1.png
deleted file mode 100644
index 0814447..0000000
--- a/docs/html-intl/intl/es/preview/images/doze-diagram-1.png
+++ /dev/null
Binary files differ
diff --git a/docs/html-intl/intl/es/preview/images/doze-diagram-2.png b/docs/html-intl/intl/es/preview/images/doze-diagram-2.png
deleted file mode 100644
index c20c6cb..0000000
--- a/docs/html-intl/intl/es/preview/images/doze-diagram-2.png
+++ /dev/null
Binary files differ
diff --git a/docs/html-intl/intl/es/preview/images/inline-reply.png b/docs/html-intl/intl/es/preview/images/inline-reply.png
deleted file mode 100644
index 79a1a72..0000000
--- a/docs/html-intl/intl/es/preview/images/inline-reply.png
+++ /dev/null
Binary files differ
diff --git a/docs/html-intl/intl/es/preview/images/inline-reply_2x.png b/docs/html-intl/intl/es/preview/images/inline-reply_2x.png
deleted file mode 100644
index 13c6e35..0000000
--- a/docs/html-intl/intl/es/preview/images/inline-reply_2x.png
+++ /dev/null
Binary files differ
diff --git a/docs/html-intl/intl/es/preview/images/inline-type-reply.png b/docs/html-intl/intl/es/preview/images/inline-type-reply.png
deleted file mode 100644
index b22aacd..0000000
--- a/docs/html-intl/intl/es/preview/images/inline-type-reply.png
+++ /dev/null
Binary files differ
diff --git a/docs/html-intl/intl/es/preview/images/inline-type-reply_2x.png b/docs/html-intl/intl/es/preview/images/inline-type-reply_2x.png
deleted file mode 100644
index 6e52a80..0000000
--- a/docs/html-intl/intl/es/preview/images/inline-type-reply_2x.png
+++ /dev/null
Binary files differ
diff --git a/docs/html-intl/intl/es/preview/images/m-preview-timeline-crop.png b/docs/html-intl/intl/es/preview/images/m-preview-timeline-crop.png
deleted file mode 100644
index 724a6af..0000000
--- a/docs/html-intl/intl/es/preview/images/m-preview-timeline-crop.png
+++ /dev/null
Binary files differ
diff --git a/docs/html-intl/intl/es/preview/images/m-preview-timeline.png b/docs/html-intl/intl/es/preview/images/m-preview-timeline.png
deleted file mode 100644
index e9a339e..0000000
--- a/docs/html-intl/intl/es/preview/images/m-preview-timeline.png
+++ /dev/null
Binary files differ
diff --git a/docs/html-intl/intl/es/preview/images/mw-portrait.png b/docs/html-intl/intl/es/preview/images/mw-portrait.png
deleted file mode 100644
index e752387..0000000
--- a/docs/html-intl/intl/es/preview/images/mw-portrait.png
+++ /dev/null
Binary files differ
diff --git a/docs/html-intl/intl/es/preview/images/mw-splitscreen.png b/docs/html-intl/intl/es/preview/images/mw-splitscreen.png
deleted file mode 100644
index bf71999..0000000
--- a/docs/html-intl/intl/es/preview/images/mw-splitscreen.png
+++ /dev/null
Binary files differ
diff --git a/docs/html-intl/intl/es/preview/images/mw-splitscreen_2x.png b/docs/html-intl/intl/es/preview/images/mw-splitscreen_2x.png
deleted file mode 100644
index 38114db..0000000
--- a/docs/html-intl/intl/es/preview/images/mw-splitscreen_2x.png
+++ /dev/null
Binary files differ
diff --git a/docs/html-intl/intl/es/preview/images/n-preview-setup.png b/docs/html-intl/intl/es/preview/images/n-preview-setup.png
deleted file mode 100644
index 612e031..0000000
--- a/docs/html-intl/intl/es/preview/images/n-preview-setup.png
+++ /dev/null
Binary files differ
diff --git a/docs/html-intl/intl/es/preview/images/notifications-1.png b/docs/html-intl/intl/es/preview/images/notifications-1.png
deleted file mode 100644
index 5712002..0000000
--- a/docs/html-intl/intl/es/preview/images/notifications-1.png
+++ /dev/null
Binary files differ
diff --git a/docs/html-intl/intl/es/preview/images/notifications-2.png b/docs/html-intl/intl/es/preview/images/notifications-2.png
deleted file mode 100644
index 0d07948..0000000
--- a/docs/html-intl/intl/es/preview/images/notifications-2.png
+++ /dev/null
Binary files differ
diff --git a/docs/html-intl/intl/es/preview/images/notifications-3.png b/docs/html-intl/intl/es/preview/images/notifications-3.png
deleted file mode 100644
index 261d010..0000000
--- a/docs/html-intl/intl/es/preview/images/notifications-3.png
+++ /dev/null
Binary files differ
diff --git a/docs/html-intl/intl/es/preview/images/notifications-card.png b/docs/html-intl/intl/es/preview/images/notifications-card.png
deleted file mode 100644
index d9d0590..0000000
--- a/docs/html-intl/intl/es/preview/images/notifications-card.png
+++ /dev/null
Binary files differ
diff --git a/docs/html-intl/intl/es/preview/images/pip-active.png b/docs/html-intl/intl/es/preview/images/pip-active.png
deleted file mode 100644
index a24cb03..0000000
--- a/docs/html-intl/intl/es/preview/images/pip-active.png
+++ /dev/null
Binary files differ
diff --git a/docs/html-intl/intl/es/preview/images/pip-button.png b/docs/html-intl/intl/es/preview/images/pip-button.png
deleted file mode 100644
index b876b12..0000000
--- a/docs/html-intl/intl/es/preview/images/pip-button.png
+++ /dev/null
Binary files differ
diff --git a/docs/html-intl/intl/es/preview/images/quicksettings.png b/docs/html-intl/intl/es/preview/images/quicksettings.png
deleted file mode 100644
index 68e1f74..0000000
--- a/docs/html-intl/intl/es/preview/images/quicksettings.png
+++ /dev/null
Binary files differ
diff --git a/docs/html-intl/intl/es/preview/images/sample-activenotifications.png b/docs/html-intl/intl/es/preview/images/sample-activenotifications.png
deleted file mode 100644
index 8817469..0000000
--- a/docs/html-intl/intl/es/preview/images/sample-activenotifications.png
+++ /dev/null
Binary files differ
diff --git a/docs/html-intl/intl/es/preview/images/sample-directboot.png b/docs/html-intl/intl/es/preview/images/sample-directboot.png
deleted file mode 100644
index cc409d3..0000000
--- a/docs/html-intl/intl/es/preview/images/sample-directboot.png
+++ /dev/null
Binary files differ
diff --git a/docs/html-intl/intl/es/preview/images/sample-messagingservice.png b/docs/html-intl/intl/es/preview/images/sample-messagingservice.png
deleted file mode 100644
index 0d8fb3e..0000000
--- a/docs/html-intl/intl/es/preview/images/sample-messagingservice.png
+++ /dev/null
Binary files differ
diff --git a/docs/html-intl/intl/es/preview/images/sample-multiwindow.png b/docs/html-intl/intl/es/preview/images/sample-multiwindow.png
deleted file mode 100644
index 979bf61..0000000
--- a/docs/html-intl/intl/es/preview/images/sample-multiwindow.png
+++ /dev/null
Binary files differ
diff --git a/docs/html-intl/intl/es/preview/images/sample-scopeddirectoryaccess.png b/docs/html-intl/intl/es/preview/images/sample-scopeddirectoryaccess.png
deleted file mode 100644
index 58515dc..0000000
--- a/docs/html-intl/intl/es/preview/images/sample-scopeddirectoryaccess.png
+++ /dev/null
Binary files differ
diff --git a/docs/html-intl/intl/es/preview/images/scoped-folder-access-dont-ask.png b/docs/html-intl/intl/es/preview/images/scoped-folder-access-dont-ask.png
deleted file mode 100644
index 5c505d9..0000000
--- a/docs/html-intl/intl/es/preview/images/scoped-folder-access-dont-ask.png
+++ /dev/null
Binary files differ
diff --git a/docs/html-intl/intl/es/preview/images/scoped-folder-access-dont-ask_2x.png b/docs/html-intl/intl/es/preview/images/scoped-folder-access-dont-ask_2x.png
deleted file mode 100644
index 612b69f..0000000
--- a/docs/html-intl/intl/es/preview/images/scoped-folder-access-dont-ask_2x.png
+++ /dev/null
Binary files differ
diff --git a/docs/html-intl/intl/es/preview/images/scoped-folder-access-framed.png b/docs/html-intl/intl/es/preview/images/scoped-folder-access-framed.png
deleted file mode 100644
index 0169e41..0000000
--- a/docs/html-intl/intl/es/preview/images/scoped-folder-access-framed.png
+++ /dev/null
Binary files differ
diff --git a/docs/html-intl/intl/es/preview/images/scoped-folder-access-framed_2x.png b/docs/html-intl/intl/es/preview/images/scoped-folder-access-framed_2x.png
deleted file mode 100644
index fd59ef1..0000000
--- a/docs/html-intl/intl/es/preview/images/scoped-folder-access-framed_2x.png
+++ /dev/null
Binary files differ
diff --git a/docs/html-intl/intl/es/preview/images/screen-zoom-1.png b/docs/html-intl/intl/es/preview/images/screen-zoom-1.png
deleted file mode 100644
index f62d04e..0000000
--- a/docs/html-intl/intl/es/preview/images/screen-zoom-1.png
+++ /dev/null
Binary files differ
diff --git a/docs/html-intl/intl/es/preview/images/screen-zoom-2.png b/docs/html-intl/intl/es/preview/images/screen-zoom-2.png
deleted file mode 100644
index 172b5b3..0000000
--- a/docs/html-intl/intl/es/preview/images/screen-zoom-2.png
+++ /dev/null
Binary files differ
diff --git a/docs/html-intl/intl/es/preview/images/studio-jdk-location.jpg b/docs/html-intl/intl/es/preview/images/studio-jdk-location.jpg
deleted file mode 100644
index 1b1ba23..0000000
--- a/docs/html-intl/intl/es/preview/images/studio-jdk-location.jpg
+++ /dev/null
Binary files differ
diff --git a/docs/html-intl/intl/in/preview/images/bundles.png b/docs/html-intl/intl/in/preview/images/bundles.png
deleted file mode 100644
index 8b022b1..0000000
--- a/docs/html-intl/intl/in/preview/images/bundles.png
+++ /dev/null
Binary files differ
diff --git a/docs/html-intl/intl/in/preview/images/bundles_2x.png b/docs/html-intl/intl/in/preview/images/bundles_2x.png
deleted file mode 100644
index 4669096..0000000
--- a/docs/html-intl/intl/in/preview/images/bundles_2x.png
+++ /dev/null
Binary files differ
diff --git a/docs/html-intl/intl/in/preview/images/datasaver.png b/docs/html-intl/intl/in/preview/images/datasaver.png
deleted file mode 100644
index c5a58fb..0000000
--- a/docs/html-intl/intl/in/preview/images/datasaver.png
+++ /dev/null
Binary files differ
diff --git a/docs/html-intl/intl/in/preview/images/doze-diagram-1.png b/docs/html-intl/intl/in/preview/images/doze-diagram-1.png
deleted file mode 100644
index 0814447..0000000
--- a/docs/html-intl/intl/in/preview/images/doze-diagram-1.png
+++ /dev/null
Binary files differ
diff --git a/docs/html-intl/intl/in/preview/images/doze-diagram-2.png b/docs/html-intl/intl/in/preview/images/doze-diagram-2.png
deleted file mode 100644
index c20c6cb..0000000
--- a/docs/html-intl/intl/in/preview/images/doze-diagram-2.png
+++ /dev/null
Binary files differ
diff --git a/docs/html-intl/intl/in/preview/images/inline-reply.png b/docs/html-intl/intl/in/preview/images/inline-reply.png
deleted file mode 100644
index 79a1a72..0000000
--- a/docs/html-intl/intl/in/preview/images/inline-reply.png
+++ /dev/null
Binary files differ
diff --git a/docs/html-intl/intl/in/preview/images/inline-reply_2x.png b/docs/html-intl/intl/in/preview/images/inline-reply_2x.png
deleted file mode 100644
index 13c6e35..0000000
--- a/docs/html-intl/intl/in/preview/images/inline-reply_2x.png
+++ /dev/null
Binary files differ
diff --git a/docs/html-intl/intl/in/preview/images/inline-type-reply.png b/docs/html-intl/intl/in/preview/images/inline-type-reply.png
deleted file mode 100644
index b22aacd..0000000
--- a/docs/html-intl/intl/in/preview/images/inline-type-reply.png
+++ /dev/null
Binary files differ
diff --git a/docs/html-intl/intl/in/preview/images/inline-type-reply_2x.png b/docs/html-intl/intl/in/preview/images/inline-type-reply_2x.png
deleted file mode 100644
index 6e52a80..0000000
--- a/docs/html-intl/intl/in/preview/images/inline-type-reply_2x.png
+++ /dev/null
Binary files differ
diff --git a/docs/html-intl/intl/in/preview/images/m-preview-timeline-crop.png b/docs/html-intl/intl/in/preview/images/m-preview-timeline-crop.png
deleted file mode 100644
index 724a6af..0000000
--- a/docs/html-intl/intl/in/preview/images/m-preview-timeline-crop.png
+++ /dev/null
Binary files differ
diff --git a/docs/html-intl/intl/in/preview/images/m-preview-timeline.png b/docs/html-intl/intl/in/preview/images/m-preview-timeline.png
deleted file mode 100644
index e9a339e..0000000
--- a/docs/html-intl/intl/in/preview/images/m-preview-timeline.png
+++ /dev/null
Binary files differ
diff --git a/docs/html-intl/intl/in/preview/images/mw-portrait.png b/docs/html-intl/intl/in/preview/images/mw-portrait.png
deleted file mode 100644
index e752387..0000000
--- a/docs/html-intl/intl/in/preview/images/mw-portrait.png
+++ /dev/null
Binary files differ
diff --git a/docs/html-intl/intl/in/preview/images/mw-splitscreen.png b/docs/html-intl/intl/in/preview/images/mw-splitscreen.png
deleted file mode 100644
index bf71999..0000000
--- a/docs/html-intl/intl/in/preview/images/mw-splitscreen.png
+++ /dev/null
Binary files differ
diff --git a/docs/html-intl/intl/in/preview/images/mw-splitscreen_2x.png b/docs/html-intl/intl/in/preview/images/mw-splitscreen_2x.png
deleted file mode 100644
index 38114db..0000000
--- a/docs/html-intl/intl/in/preview/images/mw-splitscreen_2x.png
+++ /dev/null
Binary files differ
diff --git a/docs/html-intl/intl/in/preview/images/n-preview-setup.png b/docs/html-intl/intl/in/preview/images/n-preview-setup.png
deleted file mode 100644
index 612e031..0000000
--- a/docs/html-intl/intl/in/preview/images/n-preview-setup.png
+++ /dev/null
Binary files differ
diff --git a/docs/html-intl/intl/in/preview/images/notifications-1.png b/docs/html-intl/intl/in/preview/images/notifications-1.png
deleted file mode 100644
index 5712002..0000000
--- a/docs/html-intl/intl/in/preview/images/notifications-1.png
+++ /dev/null
Binary files differ
diff --git a/docs/html-intl/intl/in/preview/images/notifications-2.png b/docs/html-intl/intl/in/preview/images/notifications-2.png
deleted file mode 100644
index 0d07948..0000000
--- a/docs/html-intl/intl/in/preview/images/notifications-2.png
+++ /dev/null
Binary files differ
diff --git a/docs/html-intl/intl/in/preview/images/notifications-3.png b/docs/html-intl/intl/in/preview/images/notifications-3.png
deleted file mode 100644
index 261d010..0000000
--- a/docs/html-intl/intl/in/preview/images/notifications-3.png
+++ /dev/null
Binary files differ
diff --git a/docs/html-intl/intl/in/preview/images/notifications-card.png b/docs/html-intl/intl/in/preview/images/notifications-card.png
deleted file mode 100644
index d9d0590..0000000
--- a/docs/html-intl/intl/in/preview/images/notifications-card.png
+++ /dev/null
Binary files differ
diff --git a/docs/html-intl/intl/in/preview/images/pip-active.png b/docs/html-intl/intl/in/preview/images/pip-active.png
deleted file mode 100644
index a24cb03..0000000
--- a/docs/html-intl/intl/in/preview/images/pip-active.png
+++ /dev/null
Binary files differ
diff --git a/docs/html-intl/intl/in/preview/images/pip-button.png b/docs/html-intl/intl/in/preview/images/pip-button.png
deleted file mode 100644
index b876b12..0000000
--- a/docs/html-intl/intl/in/preview/images/pip-button.png
+++ /dev/null
Binary files differ
diff --git a/docs/html-intl/intl/in/preview/images/quicksettings.png b/docs/html-intl/intl/in/preview/images/quicksettings.png
deleted file mode 100644
index 68e1f74..0000000
--- a/docs/html-intl/intl/in/preview/images/quicksettings.png
+++ /dev/null
Binary files differ
diff --git a/docs/html-intl/intl/in/preview/images/sample-activenotifications.png b/docs/html-intl/intl/in/preview/images/sample-activenotifications.png
deleted file mode 100644
index 8817469..0000000
--- a/docs/html-intl/intl/in/preview/images/sample-activenotifications.png
+++ /dev/null
Binary files differ
diff --git a/docs/html-intl/intl/in/preview/images/sample-directboot.png b/docs/html-intl/intl/in/preview/images/sample-directboot.png
deleted file mode 100644
index cc409d3..0000000
--- a/docs/html-intl/intl/in/preview/images/sample-directboot.png
+++ /dev/null
Binary files differ
diff --git a/docs/html-intl/intl/in/preview/images/sample-messagingservice.png b/docs/html-intl/intl/in/preview/images/sample-messagingservice.png
deleted file mode 100644
index 0d8fb3e..0000000
--- a/docs/html-intl/intl/in/preview/images/sample-messagingservice.png
+++ /dev/null
Binary files differ
diff --git a/docs/html-intl/intl/in/preview/images/sample-multiwindow.png b/docs/html-intl/intl/in/preview/images/sample-multiwindow.png
deleted file mode 100644
index 979bf61..0000000
--- a/docs/html-intl/intl/in/preview/images/sample-multiwindow.png
+++ /dev/null
Binary files differ
diff --git a/docs/html-intl/intl/in/preview/images/sample-scopeddirectoryaccess.png b/docs/html-intl/intl/in/preview/images/sample-scopeddirectoryaccess.png
deleted file mode 100644
index 58515dc..0000000
--- a/docs/html-intl/intl/in/preview/images/sample-scopeddirectoryaccess.png
+++ /dev/null
Binary files differ
diff --git a/docs/html-intl/intl/in/preview/images/scoped-folder-access-dont-ask.png b/docs/html-intl/intl/in/preview/images/scoped-folder-access-dont-ask.png
deleted file mode 100644
index 5c505d9..0000000
--- a/docs/html-intl/intl/in/preview/images/scoped-folder-access-dont-ask.png
+++ /dev/null
Binary files differ
diff --git a/docs/html-intl/intl/in/preview/images/scoped-folder-access-dont-ask_2x.png b/docs/html-intl/intl/in/preview/images/scoped-folder-access-dont-ask_2x.png
deleted file mode 100644
index 612b69f..0000000
--- a/docs/html-intl/intl/in/preview/images/scoped-folder-access-dont-ask_2x.png
+++ /dev/null
Binary files differ
diff --git a/docs/html-intl/intl/in/preview/images/scoped-folder-access-framed.png b/docs/html-intl/intl/in/preview/images/scoped-folder-access-framed.png
deleted file mode 100644
index 0169e41..0000000
--- a/docs/html-intl/intl/in/preview/images/scoped-folder-access-framed.png
+++ /dev/null
Binary files differ
diff --git a/docs/html-intl/intl/in/preview/images/scoped-folder-access-framed_2x.png b/docs/html-intl/intl/in/preview/images/scoped-folder-access-framed_2x.png
deleted file mode 100644
index fd59ef1..0000000
--- a/docs/html-intl/intl/in/preview/images/scoped-folder-access-framed_2x.png
+++ /dev/null
Binary files differ
diff --git a/docs/html-intl/intl/in/preview/images/screen-zoom-1.png b/docs/html-intl/intl/in/preview/images/screen-zoom-1.png
deleted file mode 100644
index f62d04e..0000000
--- a/docs/html-intl/intl/in/preview/images/screen-zoom-1.png
+++ /dev/null
Binary files differ
diff --git a/docs/html-intl/intl/in/preview/images/screen-zoom-2.png b/docs/html-intl/intl/in/preview/images/screen-zoom-2.png
deleted file mode 100644
index 172b5b3..0000000
--- a/docs/html-intl/intl/in/preview/images/screen-zoom-2.png
+++ /dev/null
Binary files differ
diff --git a/docs/html-intl/intl/in/preview/images/studio-jdk-location.jpg b/docs/html-intl/intl/in/preview/images/studio-jdk-location.jpg
deleted file mode 100644
index 1b1ba23..0000000
--- a/docs/html-intl/intl/in/preview/images/studio-jdk-location.jpg
+++ /dev/null
Binary files differ
diff --git a/docs/html-intl/intl/ja/preview/images/bundles.png b/docs/html-intl/intl/ja/preview/images/bundles.png
deleted file mode 100644
index 8b022b1..0000000
--- a/docs/html-intl/intl/ja/preview/images/bundles.png
+++ /dev/null
Binary files differ
diff --git a/docs/html-intl/intl/ja/preview/images/bundles_2x.png b/docs/html-intl/intl/ja/preview/images/bundles_2x.png
deleted file mode 100644
index 4669096..0000000
--- a/docs/html-intl/intl/ja/preview/images/bundles_2x.png
+++ /dev/null
Binary files differ
diff --git a/docs/html-intl/intl/ja/preview/images/datasaver.png b/docs/html-intl/intl/ja/preview/images/datasaver.png
deleted file mode 100644
index c5a58fb..0000000
--- a/docs/html-intl/intl/ja/preview/images/datasaver.png
+++ /dev/null
Binary files differ
diff --git a/docs/html-intl/intl/ja/preview/images/doze-diagram-1.png b/docs/html-intl/intl/ja/preview/images/doze-diagram-1.png
deleted file mode 100644
index 0814447..0000000
--- a/docs/html-intl/intl/ja/preview/images/doze-diagram-1.png
+++ /dev/null
Binary files differ
diff --git a/docs/html-intl/intl/ja/preview/images/doze-diagram-2.png b/docs/html-intl/intl/ja/preview/images/doze-diagram-2.png
deleted file mode 100644
index c20c6cb..0000000
--- a/docs/html-intl/intl/ja/preview/images/doze-diagram-2.png
+++ /dev/null
Binary files differ
diff --git a/docs/html-intl/intl/ja/preview/images/inline-reply.png b/docs/html-intl/intl/ja/preview/images/inline-reply.png
deleted file mode 100644
index 79a1a72..0000000
--- a/docs/html-intl/intl/ja/preview/images/inline-reply.png
+++ /dev/null
Binary files differ
diff --git a/docs/html-intl/intl/ja/preview/images/inline-reply_2x.png b/docs/html-intl/intl/ja/preview/images/inline-reply_2x.png
deleted file mode 100644
index 13c6e35..0000000
--- a/docs/html-intl/intl/ja/preview/images/inline-reply_2x.png
+++ /dev/null
Binary files differ
diff --git a/docs/html-intl/intl/ja/preview/images/inline-type-reply.png b/docs/html-intl/intl/ja/preview/images/inline-type-reply.png
deleted file mode 100644
index b22aacd..0000000
--- a/docs/html-intl/intl/ja/preview/images/inline-type-reply.png
+++ /dev/null
Binary files differ
diff --git a/docs/html-intl/intl/ja/preview/images/inline-type-reply_2x.png b/docs/html-intl/intl/ja/preview/images/inline-type-reply_2x.png
deleted file mode 100644
index 6e52a80..0000000
--- a/docs/html-intl/intl/ja/preview/images/inline-type-reply_2x.png
+++ /dev/null
Binary files differ
diff --git a/docs/html-intl/intl/ja/preview/images/m-preview-timeline-crop.png b/docs/html-intl/intl/ja/preview/images/m-preview-timeline-crop.png
deleted file mode 100644
index 724a6af..0000000
--- a/docs/html-intl/intl/ja/preview/images/m-preview-timeline-crop.png
+++ /dev/null
Binary files differ
diff --git a/docs/html-intl/intl/ja/preview/images/m-preview-timeline.png b/docs/html-intl/intl/ja/preview/images/m-preview-timeline.png
deleted file mode 100644
index e9a339e..0000000
--- a/docs/html-intl/intl/ja/preview/images/m-preview-timeline.png
+++ /dev/null
Binary files differ
diff --git a/docs/html-intl/intl/ja/preview/images/mw-portrait.png b/docs/html-intl/intl/ja/preview/images/mw-portrait.png
deleted file mode 100644
index e752387..0000000
--- a/docs/html-intl/intl/ja/preview/images/mw-portrait.png
+++ /dev/null
Binary files differ
diff --git a/docs/html-intl/intl/ja/preview/images/mw-splitscreen.png b/docs/html-intl/intl/ja/preview/images/mw-splitscreen.png
deleted file mode 100644
index bf71999..0000000
--- a/docs/html-intl/intl/ja/preview/images/mw-splitscreen.png
+++ /dev/null
Binary files differ
diff --git a/docs/html-intl/intl/ja/preview/images/mw-splitscreen_2x.png b/docs/html-intl/intl/ja/preview/images/mw-splitscreen_2x.png
deleted file mode 100644
index 38114db..0000000
--- a/docs/html-intl/intl/ja/preview/images/mw-splitscreen_2x.png
+++ /dev/null
Binary files differ
diff --git a/docs/html-intl/intl/ja/preview/images/n-preview-setup.png b/docs/html-intl/intl/ja/preview/images/n-preview-setup.png
deleted file mode 100644
index 612e031..0000000
--- a/docs/html-intl/intl/ja/preview/images/n-preview-setup.png
+++ /dev/null
Binary files differ
diff --git a/docs/html-intl/intl/ja/preview/images/notifications-1.png b/docs/html-intl/intl/ja/preview/images/notifications-1.png
deleted file mode 100644
index 5712002..0000000
--- a/docs/html-intl/intl/ja/preview/images/notifications-1.png
+++ /dev/null
Binary files differ
diff --git a/docs/html-intl/intl/ja/preview/images/notifications-2.png b/docs/html-intl/intl/ja/preview/images/notifications-2.png
deleted file mode 100644
index 0d07948..0000000
--- a/docs/html-intl/intl/ja/preview/images/notifications-2.png
+++ /dev/null
Binary files differ
diff --git a/docs/html-intl/intl/ja/preview/images/notifications-3.png b/docs/html-intl/intl/ja/preview/images/notifications-3.png
deleted file mode 100644
index 261d010..0000000
--- a/docs/html-intl/intl/ja/preview/images/notifications-3.png
+++ /dev/null
Binary files differ
diff --git a/docs/html-intl/intl/ja/preview/images/notifications-card.png b/docs/html-intl/intl/ja/preview/images/notifications-card.png
deleted file mode 100644
index d9d0590..0000000
--- a/docs/html-intl/intl/ja/preview/images/notifications-card.png
+++ /dev/null
Binary files differ
diff --git a/docs/html-intl/intl/ja/preview/images/pip-active.png b/docs/html-intl/intl/ja/preview/images/pip-active.png
deleted file mode 100644
index a24cb03..0000000
--- a/docs/html-intl/intl/ja/preview/images/pip-active.png
+++ /dev/null
Binary files differ
diff --git a/docs/html-intl/intl/ja/preview/images/pip-button.png b/docs/html-intl/intl/ja/preview/images/pip-button.png
deleted file mode 100644
index b876b12..0000000
--- a/docs/html-intl/intl/ja/preview/images/pip-button.png
+++ /dev/null
Binary files differ
diff --git a/docs/html-intl/intl/ja/preview/images/quicksettings.png b/docs/html-intl/intl/ja/preview/images/quicksettings.png
deleted file mode 100644
index 68e1f74..0000000
--- a/docs/html-intl/intl/ja/preview/images/quicksettings.png
+++ /dev/null
Binary files differ
diff --git a/docs/html-intl/intl/ja/preview/images/sample-activenotifications.png b/docs/html-intl/intl/ja/preview/images/sample-activenotifications.png
deleted file mode 100644
index 8817469..0000000
--- a/docs/html-intl/intl/ja/preview/images/sample-activenotifications.png
+++ /dev/null
Binary files differ
diff --git a/docs/html-intl/intl/ja/preview/images/sample-directboot.png b/docs/html-intl/intl/ja/preview/images/sample-directboot.png
deleted file mode 100644
index cc409d3..0000000
--- a/docs/html-intl/intl/ja/preview/images/sample-directboot.png
+++ /dev/null
Binary files differ
diff --git a/docs/html-intl/intl/ja/preview/images/sample-messagingservice.png b/docs/html-intl/intl/ja/preview/images/sample-messagingservice.png
deleted file mode 100644
index 0d8fb3e..0000000
--- a/docs/html-intl/intl/ja/preview/images/sample-messagingservice.png
+++ /dev/null
Binary files differ
diff --git a/docs/html-intl/intl/ja/preview/images/sample-multiwindow.png b/docs/html-intl/intl/ja/preview/images/sample-multiwindow.png
deleted file mode 100644
index 979bf61..0000000
--- a/docs/html-intl/intl/ja/preview/images/sample-multiwindow.png
+++ /dev/null
Binary files differ
diff --git a/docs/html-intl/intl/ja/preview/images/sample-scopeddirectoryaccess.png b/docs/html-intl/intl/ja/preview/images/sample-scopeddirectoryaccess.png
deleted file mode 100644
index 58515dc..0000000
--- a/docs/html-intl/intl/ja/preview/images/sample-scopeddirectoryaccess.png
+++ /dev/null
Binary files differ
diff --git a/docs/html-intl/intl/ja/preview/images/scoped-folder-access-dont-ask.png b/docs/html-intl/intl/ja/preview/images/scoped-folder-access-dont-ask.png
deleted file mode 100644
index 5c505d9..0000000
--- a/docs/html-intl/intl/ja/preview/images/scoped-folder-access-dont-ask.png
+++ /dev/null
Binary files differ
diff --git a/docs/html-intl/intl/ja/preview/images/scoped-folder-access-dont-ask_2x.png b/docs/html-intl/intl/ja/preview/images/scoped-folder-access-dont-ask_2x.png
deleted file mode 100644
index 612b69f..0000000
--- a/docs/html-intl/intl/ja/preview/images/scoped-folder-access-dont-ask_2x.png
+++ /dev/null
Binary files differ
diff --git a/docs/html-intl/intl/ja/preview/images/scoped-folder-access-framed.png b/docs/html-intl/intl/ja/preview/images/scoped-folder-access-framed.png
deleted file mode 100644
index 0169e41..0000000
--- a/docs/html-intl/intl/ja/preview/images/scoped-folder-access-framed.png
+++ /dev/null
Binary files differ
diff --git a/docs/html-intl/intl/ja/preview/images/scoped-folder-access-framed_2x.png b/docs/html-intl/intl/ja/preview/images/scoped-folder-access-framed_2x.png
deleted file mode 100644
index fd59ef1..0000000
--- a/docs/html-intl/intl/ja/preview/images/scoped-folder-access-framed_2x.png
+++ /dev/null
Binary files differ
diff --git a/docs/html-intl/intl/ja/preview/images/screen-zoom-1.png b/docs/html-intl/intl/ja/preview/images/screen-zoom-1.png
deleted file mode 100644
index f62d04e..0000000
--- a/docs/html-intl/intl/ja/preview/images/screen-zoom-1.png
+++ /dev/null
Binary files differ
diff --git a/docs/html-intl/intl/ja/preview/images/screen-zoom-2.png b/docs/html-intl/intl/ja/preview/images/screen-zoom-2.png
deleted file mode 100644
index 172b5b3..0000000
--- a/docs/html-intl/intl/ja/preview/images/screen-zoom-2.png
+++ /dev/null
Binary files differ
diff --git a/docs/html-intl/intl/ja/preview/images/studio-jdk-location.jpg b/docs/html-intl/intl/ja/preview/images/studio-jdk-location.jpg
deleted file mode 100644
index 1b1ba23..0000000
--- a/docs/html-intl/intl/ja/preview/images/studio-jdk-location.jpg
+++ /dev/null
Binary files differ
diff --git a/docs/html-intl/intl/ko/preview/images/bundles.png b/docs/html-intl/intl/ko/preview/images/bundles.png
deleted file mode 100644
index 8b022b1..0000000
--- a/docs/html-intl/intl/ko/preview/images/bundles.png
+++ /dev/null
Binary files differ
diff --git a/docs/html-intl/intl/ko/preview/images/bundles_2x.png b/docs/html-intl/intl/ko/preview/images/bundles_2x.png
deleted file mode 100644
index 4669096..0000000
--- a/docs/html-intl/intl/ko/preview/images/bundles_2x.png
+++ /dev/null
Binary files differ
diff --git a/docs/html-intl/intl/ko/preview/images/datasaver.png b/docs/html-intl/intl/ko/preview/images/datasaver.png
deleted file mode 100644
index c5a58fb..0000000
--- a/docs/html-intl/intl/ko/preview/images/datasaver.png
+++ /dev/null
Binary files differ
diff --git a/docs/html-intl/intl/ko/preview/images/doze-diagram-1.png b/docs/html-intl/intl/ko/preview/images/doze-diagram-1.png
deleted file mode 100644
index 0814447..0000000
--- a/docs/html-intl/intl/ko/preview/images/doze-diagram-1.png
+++ /dev/null
Binary files differ
diff --git a/docs/html-intl/intl/ko/preview/images/doze-diagram-2.png b/docs/html-intl/intl/ko/preview/images/doze-diagram-2.png
deleted file mode 100644
index c20c6cb..0000000
--- a/docs/html-intl/intl/ko/preview/images/doze-diagram-2.png
+++ /dev/null
Binary files differ
diff --git a/docs/html-intl/intl/ko/preview/images/inline-reply.png b/docs/html-intl/intl/ko/preview/images/inline-reply.png
deleted file mode 100644
index 79a1a72..0000000
--- a/docs/html-intl/intl/ko/preview/images/inline-reply.png
+++ /dev/null
Binary files differ
diff --git a/docs/html-intl/intl/ko/preview/images/inline-reply_2x.png b/docs/html-intl/intl/ko/preview/images/inline-reply_2x.png
deleted file mode 100644
index 13c6e35..0000000
--- a/docs/html-intl/intl/ko/preview/images/inline-reply_2x.png
+++ /dev/null
Binary files differ
diff --git a/docs/html-intl/intl/ko/preview/images/inline-type-reply.png b/docs/html-intl/intl/ko/preview/images/inline-type-reply.png
deleted file mode 100644
index b22aacd..0000000
--- a/docs/html-intl/intl/ko/preview/images/inline-type-reply.png
+++ /dev/null
Binary files differ
diff --git a/docs/html-intl/intl/ko/preview/images/inline-type-reply_2x.png b/docs/html-intl/intl/ko/preview/images/inline-type-reply_2x.png
deleted file mode 100644
index 6e52a80..0000000
--- a/docs/html-intl/intl/ko/preview/images/inline-type-reply_2x.png
+++ /dev/null
Binary files differ
diff --git a/docs/html-intl/intl/ko/preview/images/m-preview-timeline-crop.png b/docs/html-intl/intl/ko/preview/images/m-preview-timeline-crop.png
deleted file mode 100644
index 724a6af..0000000
--- a/docs/html-intl/intl/ko/preview/images/m-preview-timeline-crop.png
+++ /dev/null
Binary files differ
diff --git a/docs/html-intl/intl/ko/preview/images/m-preview-timeline.png b/docs/html-intl/intl/ko/preview/images/m-preview-timeline.png
deleted file mode 100644
index e9a339e..0000000
--- a/docs/html-intl/intl/ko/preview/images/m-preview-timeline.png
+++ /dev/null
Binary files differ
diff --git a/docs/html-intl/intl/ko/preview/images/mw-portrait.png b/docs/html-intl/intl/ko/preview/images/mw-portrait.png
deleted file mode 100644
index e752387..0000000
--- a/docs/html-intl/intl/ko/preview/images/mw-portrait.png
+++ /dev/null
Binary files differ
diff --git a/docs/html-intl/intl/ko/preview/images/mw-splitscreen.png b/docs/html-intl/intl/ko/preview/images/mw-splitscreen.png
deleted file mode 100644
index bf71999..0000000
--- a/docs/html-intl/intl/ko/preview/images/mw-splitscreen.png
+++ /dev/null
Binary files differ
diff --git a/docs/html-intl/intl/ko/preview/images/mw-splitscreen_2x.png b/docs/html-intl/intl/ko/preview/images/mw-splitscreen_2x.png
deleted file mode 100644
index 38114db..0000000
--- a/docs/html-intl/intl/ko/preview/images/mw-splitscreen_2x.png
+++ /dev/null
Binary files differ
diff --git a/docs/html-intl/intl/ko/preview/images/n-preview-setup.png b/docs/html-intl/intl/ko/preview/images/n-preview-setup.png
deleted file mode 100644
index 612e031..0000000
--- a/docs/html-intl/intl/ko/preview/images/n-preview-setup.png
+++ /dev/null
Binary files differ
diff --git a/docs/html-intl/intl/ko/preview/images/notifications-1.png b/docs/html-intl/intl/ko/preview/images/notifications-1.png
deleted file mode 100644
index 5712002..0000000
--- a/docs/html-intl/intl/ko/preview/images/notifications-1.png
+++ /dev/null
Binary files differ
diff --git a/docs/html-intl/intl/ko/preview/images/notifications-2.png b/docs/html-intl/intl/ko/preview/images/notifications-2.png
deleted file mode 100644
index 0d07948..0000000
--- a/docs/html-intl/intl/ko/preview/images/notifications-2.png
+++ /dev/null
Binary files differ
diff --git a/docs/html-intl/intl/ko/preview/images/notifications-3.png b/docs/html-intl/intl/ko/preview/images/notifications-3.png
deleted file mode 100644
index 261d010..0000000
--- a/docs/html-intl/intl/ko/preview/images/notifications-3.png
+++ /dev/null
Binary files differ
diff --git a/docs/html-intl/intl/ko/preview/images/notifications-card.png b/docs/html-intl/intl/ko/preview/images/notifications-card.png
deleted file mode 100644
index d9d0590..0000000
--- a/docs/html-intl/intl/ko/preview/images/notifications-card.png
+++ /dev/null
Binary files differ
diff --git a/docs/html-intl/intl/ko/preview/images/pip-active.png b/docs/html-intl/intl/ko/preview/images/pip-active.png
deleted file mode 100644
index a24cb03..0000000
--- a/docs/html-intl/intl/ko/preview/images/pip-active.png
+++ /dev/null
Binary files differ
diff --git a/docs/html-intl/intl/ko/preview/images/pip-button.png b/docs/html-intl/intl/ko/preview/images/pip-button.png
deleted file mode 100644
index b876b12..0000000
--- a/docs/html-intl/intl/ko/preview/images/pip-button.png
+++ /dev/null
Binary files differ
diff --git a/docs/html-intl/intl/ko/preview/images/quicksettings.png b/docs/html-intl/intl/ko/preview/images/quicksettings.png
deleted file mode 100644
index 68e1f74..0000000
--- a/docs/html-intl/intl/ko/preview/images/quicksettings.png
+++ /dev/null
Binary files differ
diff --git a/docs/html-intl/intl/ko/preview/images/sample-activenotifications.png b/docs/html-intl/intl/ko/preview/images/sample-activenotifications.png
deleted file mode 100644
index 8817469..0000000
--- a/docs/html-intl/intl/ko/preview/images/sample-activenotifications.png
+++ /dev/null
Binary files differ
diff --git a/docs/html-intl/intl/ko/preview/images/sample-directboot.png b/docs/html-intl/intl/ko/preview/images/sample-directboot.png
deleted file mode 100644
index cc409d3..0000000
--- a/docs/html-intl/intl/ko/preview/images/sample-directboot.png
+++ /dev/null
Binary files differ
diff --git a/docs/html-intl/intl/ko/preview/images/sample-messagingservice.png b/docs/html-intl/intl/ko/preview/images/sample-messagingservice.png
deleted file mode 100644
index 0d8fb3e..0000000
--- a/docs/html-intl/intl/ko/preview/images/sample-messagingservice.png
+++ /dev/null
Binary files differ
diff --git a/docs/html-intl/intl/ko/preview/images/sample-multiwindow.png b/docs/html-intl/intl/ko/preview/images/sample-multiwindow.png
deleted file mode 100644
index 979bf61..0000000
--- a/docs/html-intl/intl/ko/preview/images/sample-multiwindow.png
+++ /dev/null
Binary files differ
diff --git a/docs/html-intl/intl/ko/preview/images/sample-scopeddirectoryaccess.png b/docs/html-intl/intl/ko/preview/images/sample-scopeddirectoryaccess.png
deleted file mode 100644
index 58515dc..0000000
--- a/docs/html-intl/intl/ko/preview/images/sample-scopeddirectoryaccess.png
+++ /dev/null
Binary files differ
diff --git a/docs/html-intl/intl/ko/preview/images/scoped-folder-access-dont-ask.png b/docs/html-intl/intl/ko/preview/images/scoped-folder-access-dont-ask.png
deleted file mode 100644
index 5c505d9..0000000
--- a/docs/html-intl/intl/ko/preview/images/scoped-folder-access-dont-ask.png
+++ /dev/null
Binary files differ
diff --git a/docs/html-intl/intl/ko/preview/images/scoped-folder-access-dont-ask_2x.png b/docs/html-intl/intl/ko/preview/images/scoped-folder-access-dont-ask_2x.png
deleted file mode 100644
index 612b69f..0000000
--- a/docs/html-intl/intl/ko/preview/images/scoped-folder-access-dont-ask_2x.png
+++ /dev/null
Binary files differ
diff --git a/docs/html-intl/intl/ko/preview/images/scoped-folder-access-framed.png b/docs/html-intl/intl/ko/preview/images/scoped-folder-access-framed.png
deleted file mode 100644
index 0169e41..0000000
--- a/docs/html-intl/intl/ko/preview/images/scoped-folder-access-framed.png
+++ /dev/null
Binary files differ
diff --git a/docs/html-intl/intl/ko/preview/images/scoped-folder-access-framed_2x.png b/docs/html-intl/intl/ko/preview/images/scoped-folder-access-framed_2x.png
deleted file mode 100644
index fd59ef1..0000000
--- a/docs/html-intl/intl/ko/preview/images/scoped-folder-access-framed_2x.png
+++ /dev/null
Binary files differ
diff --git a/docs/html-intl/intl/ko/preview/images/screen-zoom-1.png b/docs/html-intl/intl/ko/preview/images/screen-zoom-1.png
deleted file mode 100644
index f62d04e..0000000
--- a/docs/html-intl/intl/ko/preview/images/screen-zoom-1.png
+++ /dev/null
Binary files differ
diff --git a/docs/html-intl/intl/ko/preview/images/screen-zoom-2.png b/docs/html-intl/intl/ko/preview/images/screen-zoom-2.png
deleted file mode 100644
index 172b5b3..0000000
--- a/docs/html-intl/intl/ko/preview/images/screen-zoom-2.png
+++ /dev/null
Binary files differ
diff --git a/docs/html-intl/intl/ko/preview/images/studio-jdk-location.jpg b/docs/html-intl/intl/ko/preview/images/studio-jdk-location.jpg
deleted file mode 100644
index 1b1ba23..0000000
--- a/docs/html-intl/intl/ko/preview/images/studio-jdk-location.jpg
+++ /dev/null
Binary files differ
diff --git a/docs/html-intl/intl/pt-br/preview/images/bundles.png b/docs/html-intl/intl/pt-br/preview/images/bundles.png
deleted file mode 100644
index 8b022b1..0000000
--- a/docs/html-intl/intl/pt-br/preview/images/bundles.png
+++ /dev/null
Binary files differ
diff --git a/docs/html-intl/intl/pt-br/preview/images/bundles_2x.png b/docs/html-intl/intl/pt-br/preview/images/bundles_2x.png
deleted file mode 100644
index 4669096..0000000
--- a/docs/html-intl/intl/pt-br/preview/images/bundles_2x.png
+++ /dev/null
Binary files differ
diff --git a/docs/html-intl/intl/pt-br/preview/images/datasaver.png b/docs/html-intl/intl/pt-br/preview/images/datasaver.png
deleted file mode 100644
index c5a58fb..0000000
--- a/docs/html-intl/intl/pt-br/preview/images/datasaver.png
+++ /dev/null
Binary files differ
diff --git a/docs/html-intl/intl/pt-br/preview/images/doze-diagram-1.png b/docs/html-intl/intl/pt-br/preview/images/doze-diagram-1.png
deleted file mode 100644
index 0814447..0000000
--- a/docs/html-intl/intl/pt-br/preview/images/doze-diagram-1.png
+++ /dev/null
Binary files differ
diff --git a/docs/html-intl/intl/pt-br/preview/images/doze-diagram-2.png b/docs/html-intl/intl/pt-br/preview/images/doze-diagram-2.png
deleted file mode 100644
index c20c6cb..0000000
--- a/docs/html-intl/intl/pt-br/preview/images/doze-diagram-2.png
+++ /dev/null
Binary files differ
diff --git a/docs/html-intl/intl/pt-br/preview/images/inline-reply.png b/docs/html-intl/intl/pt-br/preview/images/inline-reply.png
deleted file mode 100644
index 79a1a72..0000000
--- a/docs/html-intl/intl/pt-br/preview/images/inline-reply.png
+++ /dev/null
Binary files differ
diff --git a/docs/html-intl/intl/pt-br/preview/images/inline-reply_2x.png b/docs/html-intl/intl/pt-br/preview/images/inline-reply_2x.png
deleted file mode 100644
index 13c6e35..0000000
--- a/docs/html-intl/intl/pt-br/preview/images/inline-reply_2x.png
+++ /dev/null
Binary files differ
diff --git a/docs/html-intl/intl/pt-br/preview/images/inline-type-reply.png b/docs/html-intl/intl/pt-br/preview/images/inline-type-reply.png
deleted file mode 100644
index b22aacd..0000000
--- a/docs/html-intl/intl/pt-br/preview/images/inline-type-reply.png
+++ /dev/null
Binary files differ
diff --git a/docs/html-intl/intl/pt-br/preview/images/inline-type-reply_2x.png b/docs/html-intl/intl/pt-br/preview/images/inline-type-reply_2x.png
deleted file mode 100644
index 6e52a80..0000000
--- a/docs/html-intl/intl/pt-br/preview/images/inline-type-reply_2x.png
+++ /dev/null
Binary files differ
diff --git a/docs/html-intl/intl/pt-br/preview/images/m-preview-timeline-crop.png b/docs/html-intl/intl/pt-br/preview/images/m-preview-timeline-crop.png
deleted file mode 100644
index 724a6af..0000000
--- a/docs/html-intl/intl/pt-br/preview/images/m-preview-timeline-crop.png
+++ /dev/null
Binary files differ
diff --git a/docs/html-intl/intl/pt-br/preview/images/m-preview-timeline.png b/docs/html-intl/intl/pt-br/preview/images/m-preview-timeline.png
deleted file mode 100644
index e9a339e..0000000
--- a/docs/html-intl/intl/pt-br/preview/images/m-preview-timeline.png
+++ /dev/null
Binary files differ
diff --git a/docs/html-intl/intl/pt-br/preview/images/mw-portrait.png b/docs/html-intl/intl/pt-br/preview/images/mw-portrait.png
deleted file mode 100644
index e752387..0000000
--- a/docs/html-intl/intl/pt-br/preview/images/mw-portrait.png
+++ /dev/null
Binary files differ
diff --git a/docs/html-intl/intl/pt-br/preview/images/mw-splitscreen.png b/docs/html-intl/intl/pt-br/preview/images/mw-splitscreen.png
deleted file mode 100644
index bf71999..0000000
--- a/docs/html-intl/intl/pt-br/preview/images/mw-splitscreen.png
+++ /dev/null
Binary files differ
diff --git a/docs/html-intl/intl/pt-br/preview/images/mw-splitscreen_2x.png b/docs/html-intl/intl/pt-br/preview/images/mw-splitscreen_2x.png
deleted file mode 100644
index 38114db..0000000
--- a/docs/html-intl/intl/pt-br/preview/images/mw-splitscreen_2x.png
+++ /dev/null
Binary files differ
diff --git a/docs/html-intl/intl/pt-br/preview/images/n-preview-setup.png b/docs/html-intl/intl/pt-br/preview/images/n-preview-setup.png
deleted file mode 100644
index 612e031..0000000
--- a/docs/html-intl/intl/pt-br/preview/images/n-preview-setup.png
+++ /dev/null
Binary files differ
diff --git a/docs/html-intl/intl/pt-br/preview/images/notifications-1.png b/docs/html-intl/intl/pt-br/preview/images/notifications-1.png
deleted file mode 100644
index 5712002..0000000
--- a/docs/html-intl/intl/pt-br/preview/images/notifications-1.png
+++ /dev/null
Binary files differ
diff --git a/docs/html-intl/intl/pt-br/preview/images/notifications-2.png b/docs/html-intl/intl/pt-br/preview/images/notifications-2.png
deleted file mode 100644
index 0d07948..0000000
--- a/docs/html-intl/intl/pt-br/preview/images/notifications-2.png
+++ /dev/null
Binary files differ
diff --git a/docs/html-intl/intl/pt-br/preview/images/notifications-3.png b/docs/html-intl/intl/pt-br/preview/images/notifications-3.png
deleted file mode 100644
index 261d010..0000000
--- a/docs/html-intl/intl/pt-br/preview/images/notifications-3.png
+++ /dev/null
Binary files differ
diff --git a/docs/html-intl/intl/pt-br/preview/images/notifications-card.png b/docs/html-intl/intl/pt-br/preview/images/notifications-card.png
deleted file mode 100644
index d9d0590..0000000
--- a/docs/html-intl/intl/pt-br/preview/images/notifications-card.png
+++ /dev/null
Binary files differ
diff --git a/docs/html-intl/intl/pt-br/preview/images/pip-active.png b/docs/html-intl/intl/pt-br/preview/images/pip-active.png
deleted file mode 100644
index a24cb03..0000000
--- a/docs/html-intl/intl/pt-br/preview/images/pip-active.png
+++ /dev/null
Binary files differ
diff --git a/docs/html-intl/intl/pt-br/preview/images/pip-button.png b/docs/html-intl/intl/pt-br/preview/images/pip-button.png
deleted file mode 100644
index b876b12..0000000
--- a/docs/html-intl/intl/pt-br/preview/images/pip-button.png
+++ /dev/null
Binary files differ
diff --git a/docs/html-intl/intl/pt-br/preview/images/quicksettings.png b/docs/html-intl/intl/pt-br/preview/images/quicksettings.png
deleted file mode 100644
index 68e1f74..0000000
--- a/docs/html-intl/intl/pt-br/preview/images/quicksettings.png
+++ /dev/null
Binary files differ
diff --git a/docs/html-intl/intl/pt-br/preview/images/sample-activenotifications.png b/docs/html-intl/intl/pt-br/preview/images/sample-activenotifications.png
deleted file mode 100644
index 8817469..0000000
--- a/docs/html-intl/intl/pt-br/preview/images/sample-activenotifications.png
+++ /dev/null
Binary files differ
diff --git a/docs/html-intl/intl/pt-br/preview/images/sample-directboot.png b/docs/html-intl/intl/pt-br/preview/images/sample-directboot.png
deleted file mode 100644
index cc409d3..0000000
--- a/docs/html-intl/intl/pt-br/preview/images/sample-directboot.png
+++ /dev/null
Binary files differ
diff --git a/docs/html-intl/intl/pt-br/preview/images/sample-messagingservice.png b/docs/html-intl/intl/pt-br/preview/images/sample-messagingservice.png
deleted file mode 100644
index 0d8fb3e..0000000
--- a/docs/html-intl/intl/pt-br/preview/images/sample-messagingservice.png
+++ /dev/null
Binary files differ
diff --git a/docs/html-intl/intl/pt-br/preview/images/sample-multiwindow.png b/docs/html-intl/intl/pt-br/preview/images/sample-multiwindow.png
deleted file mode 100644
index 979bf61..0000000
--- a/docs/html-intl/intl/pt-br/preview/images/sample-multiwindow.png
+++ /dev/null
Binary files differ
diff --git a/docs/html-intl/intl/pt-br/preview/images/sample-scopeddirectoryaccess.png b/docs/html-intl/intl/pt-br/preview/images/sample-scopeddirectoryaccess.png
deleted file mode 100644
index 58515dc..0000000
--- a/docs/html-intl/intl/pt-br/preview/images/sample-scopeddirectoryaccess.png
+++ /dev/null
Binary files differ
diff --git a/docs/html-intl/intl/pt-br/preview/images/scoped-folder-access-dont-ask.png b/docs/html-intl/intl/pt-br/preview/images/scoped-folder-access-dont-ask.png
deleted file mode 100644
index 5c505d9..0000000
--- a/docs/html-intl/intl/pt-br/preview/images/scoped-folder-access-dont-ask.png
+++ /dev/null
Binary files differ
diff --git a/docs/html-intl/intl/pt-br/preview/images/scoped-folder-access-dont-ask_2x.png b/docs/html-intl/intl/pt-br/preview/images/scoped-folder-access-dont-ask_2x.png
deleted file mode 100644
index 612b69f..0000000
--- a/docs/html-intl/intl/pt-br/preview/images/scoped-folder-access-dont-ask_2x.png
+++ /dev/null
Binary files differ
diff --git a/docs/html-intl/intl/pt-br/preview/images/scoped-folder-access-framed.png b/docs/html-intl/intl/pt-br/preview/images/scoped-folder-access-framed.png
deleted file mode 100644
index 0169e41..0000000
--- a/docs/html-intl/intl/pt-br/preview/images/scoped-folder-access-framed.png
+++ /dev/null
Binary files differ
diff --git a/docs/html-intl/intl/pt-br/preview/images/scoped-folder-access-framed_2x.png b/docs/html-intl/intl/pt-br/preview/images/scoped-folder-access-framed_2x.png
deleted file mode 100644
index fd59ef1..0000000
--- a/docs/html-intl/intl/pt-br/preview/images/scoped-folder-access-framed_2x.png
+++ /dev/null
Binary files differ
diff --git a/docs/html-intl/intl/pt-br/preview/images/screen-zoom-1.png b/docs/html-intl/intl/pt-br/preview/images/screen-zoom-1.png
deleted file mode 100644
index f62d04e..0000000
--- a/docs/html-intl/intl/pt-br/preview/images/screen-zoom-1.png
+++ /dev/null
Binary files differ
diff --git a/docs/html-intl/intl/pt-br/preview/images/screen-zoom-2.png b/docs/html-intl/intl/pt-br/preview/images/screen-zoom-2.png
deleted file mode 100644
index 172b5b3..0000000
--- a/docs/html-intl/intl/pt-br/preview/images/screen-zoom-2.png
+++ /dev/null
Binary files differ
diff --git a/docs/html-intl/intl/pt-br/preview/images/studio-jdk-location.jpg b/docs/html-intl/intl/pt-br/preview/images/studio-jdk-location.jpg
deleted file mode 100644
index 1b1ba23..0000000
--- a/docs/html-intl/intl/pt-br/preview/images/studio-jdk-location.jpg
+++ /dev/null
Binary files differ
diff --git a/docs/html-intl/intl/zh-cn/preview/images/bundles.png b/docs/html-intl/intl/zh-cn/preview/images/bundles.png
deleted file mode 100644
index 8b022b1..0000000
--- a/docs/html-intl/intl/zh-cn/preview/images/bundles.png
+++ /dev/null
Binary files differ
diff --git a/docs/html-intl/intl/zh-cn/preview/images/bundles_2x.png b/docs/html-intl/intl/zh-cn/preview/images/bundles_2x.png
deleted file mode 100644
index 4669096..0000000
--- a/docs/html-intl/intl/zh-cn/preview/images/bundles_2x.png
+++ /dev/null
Binary files differ
diff --git a/docs/html-intl/intl/zh-cn/preview/images/datasaver.png b/docs/html-intl/intl/zh-cn/preview/images/datasaver.png
deleted file mode 100644
index c5a58fb..0000000
--- a/docs/html-intl/intl/zh-cn/preview/images/datasaver.png
+++ /dev/null
Binary files differ
diff --git a/docs/html-intl/intl/zh-cn/preview/images/doze-diagram-1.png b/docs/html-intl/intl/zh-cn/preview/images/doze-diagram-1.png
deleted file mode 100644
index 0814447..0000000
--- a/docs/html-intl/intl/zh-cn/preview/images/doze-diagram-1.png
+++ /dev/null
Binary files differ
diff --git a/docs/html-intl/intl/zh-cn/preview/images/doze-diagram-2.png b/docs/html-intl/intl/zh-cn/preview/images/doze-diagram-2.png
deleted file mode 100644
index c20c6cb..0000000
--- a/docs/html-intl/intl/zh-cn/preview/images/doze-diagram-2.png
+++ /dev/null
Binary files differ
diff --git a/docs/html-intl/intl/zh-cn/preview/images/inline-reply.png b/docs/html-intl/intl/zh-cn/preview/images/inline-reply.png
deleted file mode 100644
index 79a1a72..0000000
--- a/docs/html-intl/intl/zh-cn/preview/images/inline-reply.png
+++ /dev/null
Binary files differ
diff --git a/docs/html-intl/intl/zh-cn/preview/images/inline-reply_2x.png b/docs/html-intl/intl/zh-cn/preview/images/inline-reply_2x.png
deleted file mode 100644
index 13c6e35..0000000
--- a/docs/html-intl/intl/zh-cn/preview/images/inline-reply_2x.png
+++ /dev/null
Binary files differ
diff --git a/docs/html-intl/intl/zh-cn/preview/images/inline-type-reply.png b/docs/html-intl/intl/zh-cn/preview/images/inline-type-reply.png
deleted file mode 100644
index b22aacd..0000000
--- a/docs/html-intl/intl/zh-cn/preview/images/inline-type-reply.png
+++ /dev/null
Binary files differ
diff --git a/docs/html-intl/intl/zh-cn/preview/images/inline-type-reply_2x.png b/docs/html-intl/intl/zh-cn/preview/images/inline-type-reply_2x.png
deleted file mode 100644
index 6e52a80..0000000
--- a/docs/html-intl/intl/zh-cn/preview/images/inline-type-reply_2x.png
+++ /dev/null
Binary files differ
diff --git a/docs/html-intl/intl/zh-cn/preview/images/m-preview-timeline-crop.png b/docs/html-intl/intl/zh-cn/preview/images/m-preview-timeline-crop.png
deleted file mode 100644
index 724a6af..0000000
--- a/docs/html-intl/intl/zh-cn/preview/images/m-preview-timeline-crop.png
+++ /dev/null
Binary files differ
diff --git a/docs/html-intl/intl/zh-cn/preview/images/m-preview-timeline.png b/docs/html-intl/intl/zh-cn/preview/images/m-preview-timeline.png
deleted file mode 100644
index e9a339e..0000000
--- a/docs/html-intl/intl/zh-cn/preview/images/m-preview-timeline.png
+++ /dev/null
Binary files differ
diff --git a/docs/html-intl/intl/zh-cn/preview/images/mw-portrait.png b/docs/html-intl/intl/zh-cn/preview/images/mw-portrait.png
deleted file mode 100644
index e752387..0000000
--- a/docs/html-intl/intl/zh-cn/preview/images/mw-portrait.png
+++ /dev/null
Binary files differ
diff --git a/docs/html-intl/intl/zh-cn/preview/images/mw-splitscreen.png b/docs/html-intl/intl/zh-cn/preview/images/mw-splitscreen.png
deleted file mode 100644
index bf71999..0000000
--- a/docs/html-intl/intl/zh-cn/preview/images/mw-splitscreen.png
+++ /dev/null
Binary files differ
diff --git a/docs/html-intl/intl/zh-cn/preview/images/mw-splitscreen_2x.png b/docs/html-intl/intl/zh-cn/preview/images/mw-splitscreen_2x.png
deleted file mode 100644
index 38114db..0000000
--- a/docs/html-intl/intl/zh-cn/preview/images/mw-splitscreen_2x.png
+++ /dev/null
Binary files differ
diff --git a/docs/html-intl/intl/zh-cn/preview/images/n-preview-setup.png b/docs/html-intl/intl/zh-cn/preview/images/n-preview-setup.png
deleted file mode 100644
index 612e031..0000000
--- a/docs/html-intl/intl/zh-cn/preview/images/n-preview-setup.png
+++ /dev/null
Binary files differ
diff --git a/docs/html-intl/intl/zh-cn/preview/images/notifications-1.png b/docs/html-intl/intl/zh-cn/preview/images/notifications-1.png
deleted file mode 100644
index 5712002..0000000
--- a/docs/html-intl/intl/zh-cn/preview/images/notifications-1.png
+++ /dev/null
Binary files differ
diff --git a/docs/html-intl/intl/zh-cn/preview/images/notifications-2.png b/docs/html-intl/intl/zh-cn/preview/images/notifications-2.png
deleted file mode 100644
index 0d07948..0000000
--- a/docs/html-intl/intl/zh-cn/preview/images/notifications-2.png
+++ /dev/null
Binary files differ
diff --git a/docs/html-intl/intl/zh-cn/preview/images/notifications-3.png b/docs/html-intl/intl/zh-cn/preview/images/notifications-3.png
deleted file mode 100644
index 261d010..0000000
--- a/docs/html-intl/intl/zh-cn/preview/images/notifications-3.png
+++ /dev/null
Binary files differ
diff --git a/docs/html-intl/intl/zh-cn/preview/images/notifications-card.png b/docs/html-intl/intl/zh-cn/preview/images/notifications-card.png
deleted file mode 100644
index d9d0590..0000000
--- a/docs/html-intl/intl/zh-cn/preview/images/notifications-card.png
+++ /dev/null
Binary files differ
diff --git a/docs/html-intl/intl/zh-cn/preview/images/pip-active.png b/docs/html-intl/intl/zh-cn/preview/images/pip-active.png
deleted file mode 100644
index a24cb03..0000000
--- a/docs/html-intl/intl/zh-cn/preview/images/pip-active.png
+++ /dev/null
Binary files differ
diff --git a/docs/html-intl/intl/zh-cn/preview/images/pip-button.png b/docs/html-intl/intl/zh-cn/preview/images/pip-button.png
deleted file mode 100644
index b876b12..0000000
--- a/docs/html-intl/intl/zh-cn/preview/images/pip-button.png
+++ /dev/null
Binary files differ
diff --git a/docs/html-intl/intl/zh-cn/preview/images/quicksettings.png b/docs/html-intl/intl/zh-cn/preview/images/quicksettings.png
deleted file mode 100644
index 68e1f74..0000000
--- a/docs/html-intl/intl/zh-cn/preview/images/quicksettings.png
+++ /dev/null
Binary files differ
diff --git a/docs/html-intl/intl/zh-cn/preview/images/sample-activenotifications.png b/docs/html-intl/intl/zh-cn/preview/images/sample-activenotifications.png
deleted file mode 100644
index 8817469..0000000
--- a/docs/html-intl/intl/zh-cn/preview/images/sample-activenotifications.png
+++ /dev/null
Binary files differ
diff --git a/docs/html-intl/intl/zh-cn/preview/images/sample-directboot.png b/docs/html-intl/intl/zh-cn/preview/images/sample-directboot.png
deleted file mode 100644
index cc409d3..0000000
--- a/docs/html-intl/intl/zh-cn/preview/images/sample-directboot.png
+++ /dev/null
Binary files differ
diff --git a/docs/html-intl/intl/zh-cn/preview/images/sample-messagingservice.png b/docs/html-intl/intl/zh-cn/preview/images/sample-messagingservice.png
deleted file mode 100644
index 0d8fb3e..0000000
--- a/docs/html-intl/intl/zh-cn/preview/images/sample-messagingservice.png
+++ /dev/null
Binary files differ
diff --git a/docs/html-intl/intl/zh-cn/preview/images/sample-multiwindow.png b/docs/html-intl/intl/zh-cn/preview/images/sample-multiwindow.png
deleted file mode 100644
index 979bf61..0000000
--- a/docs/html-intl/intl/zh-cn/preview/images/sample-multiwindow.png
+++ /dev/null
Binary files differ
diff --git a/docs/html-intl/intl/zh-cn/preview/images/sample-scopeddirectoryaccess.png b/docs/html-intl/intl/zh-cn/preview/images/sample-scopeddirectoryaccess.png
deleted file mode 100644
index 58515dc..0000000
--- a/docs/html-intl/intl/zh-cn/preview/images/sample-scopeddirectoryaccess.png
+++ /dev/null
Binary files differ
diff --git a/docs/html-intl/intl/zh-cn/preview/images/scoped-folder-access-dont-ask.png b/docs/html-intl/intl/zh-cn/preview/images/scoped-folder-access-dont-ask.png
deleted file mode 100644
index 5c505d9..0000000
--- a/docs/html-intl/intl/zh-cn/preview/images/scoped-folder-access-dont-ask.png
+++ /dev/null
Binary files differ
diff --git a/docs/html-intl/intl/zh-cn/preview/images/scoped-folder-access-dont-ask_2x.png b/docs/html-intl/intl/zh-cn/preview/images/scoped-folder-access-dont-ask_2x.png
deleted file mode 100644
index 612b69f..0000000
--- a/docs/html-intl/intl/zh-cn/preview/images/scoped-folder-access-dont-ask_2x.png
+++ /dev/null
Binary files differ
diff --git a/docs/html-intl/intl/zh-cn/preview/images/scoped-folder-access-framed.png b/docs/html-intl/intl/zh-cn/preview/images/scoped-folder-access-framed.png
deleted file mode 100644
index 0169e41..0000000
--- a/docs/html-intl/intl/zh-cn/preview/images/scoped-folder-access-framed.png
+++ /dev/null
Binary files differ
diff --git a/docs/html-intl/intl/zh-cn/preview/images/scoped-folder-access-framed_2x.png b/docs/html-intl/intl/zh-cn/preview/images/scoped-folder-access-framed_2x.png
deleted file mode 100644
index fd59ef1..0000000
--- a/docs/html-intl/intl/zh-cn/preview/images/scoped-folder-access-framed_2x.png
+++ /dev/null
Binary files differ
diff --git a/docs/html-intl/intl/zh-cn/preview/images/screen-zoom-1.png b/docs/html-intl/intl/zh-cn/preview/images/screen-zoom-1.png
deleted file mode 100644
index f62d04e..0000000
--- a/docs/html-intl/intl/zh-cn/preview/images/screen-zoom-1.png
+++ /dev/null
Binary files differ
diff --git a/docs/html-intl/intl/zh-cn/preview/images/screen-zoom-2.png b/docs/html-intl/intl/zh-cn/preview/images/screen-zoom-2.png
deleted file mode 100644
index 172b5b3..0000000
--- a/docs/html-intl/intl/zh-cn/preview/images/screen-zoom-2.png
+++ /dev/null
Binary files differ
diff --git a/docs/html-intl/intl/zh-cn/preview/images/studio-jdk-location.jpg b/docs/html-intl/intl/zh-cn/preview/images/studio-jdk-location.jpg
deleted file mode 100644
index 1b1ba23..0000000
--- a/docs/html-intl/intl/zh-cn/preview/images/studio-jdk-location.jpg
+++ /dev/null
Binary files differ
diff --git a/docs/html/_redirects.yaml b/docs/html/_redirects.yaml
index ae858fe..6e1cc23 100644
--- a/docs/html/_redirects.yaml
+++ b/docs/html/_redirects.yaml
@@ -797,54 +797,6 @@
   to: https://code.google.com/p/android/issues/list?can=2&q=label%3ADevPreview-N
 - from: /2016/03/first-preview-of-android-n-developer.html
   to: http://android-developers.blogspot.com/2016/03/first-preview-of-android-n-developer.html
-- from: /r/studio-ui/vector-asset-studio.html
-  to: /studio/write/vector-asset-studio.html
-- from: /r/studio-ui/image-asset-studio.html
-  to: /studio/write/image-asset-studio.html
-- from: /r/studio-ui/project-structure.html
-  to: /studio/projects/index.html
-- from: /r/studio-ui/android-monitor.html
-  to: /studio/profile/android-monitor.html
-- from: /r/studio-ui/am-logcat.html
-  to: /studio/debug/am-logcat.html
-- from: /r/studio-ui/am-memory.html
-  to: /studio/profile/am-memory.html
-- from: /r/studio-ui/am-cpu.html
-  to: /studio/profile/am-cpu.html
-- from: /r/studio-ui/am-gpu.html
-  to: /studio/profile/am-gpu.html
-- from: /r/studio-ui/am-network.html
-  to: /studio/profile/am-network.html
-- from: /r/studio-ui/am-hprof.html
-  to: /studio/profile/am-hprof.html
-- from: /r/studio-ui/am-allocation.html
-  to: /studio/profile/am-allocation.html
-- from: /r/studio-ui/am-methodtrace.html
-  to: /studio/profile/am-methodtrace.html
-- from: /r/studio-ui/am-sysinfo.html
-  to: /studio/profile/am-sysinfo.html
-- from: /r/studio-ui/am-screenshot.html
-  to: /studio/debug/am-screenshot.html
-- from: /r/studio-ui/am-video.html
-  to: /studio/debug/am-video.html
-- from: /r/studio-ui/avd-manager.html
-  to: /studio/run/managing-avds.html
-- from: /r/studio-ui/rundebugconfig.html
-  to: /studio/run/index.html
-- from: /r/studio-ui/devicechooser.html
-  to: /studio/run/emulator.html
-- from: /r/studio-ui/virtualdeviceconfig.html
-  to: /studio/run/managing-avds.html
-- from: /r/studio-ui/emulator.html
-  to: /studio/run/emulator.html
-- from: /r/studio-ui/instant-run.html
-  to: /studio/run/index.html#instant-run
-- from: /r/studio-ui/test-recorder.html
-  to: http://tools.android.com/tech-docs/test-recorder
-- from: /r/studio-ui/export-licenses.html
-  to: http://tools.android.com/tech-docs/new-build-system/license
-- from: /r/studio-ui/experimental-to-stable-gradle.html
-  to: http://tools.android.com/tech-docs/new-build-system/gradle-experimental/experimental-to-stable-gradle
 - from: /reference/org/apache/http/...
   to: /about/versions/marshmallow/android-6.0-changes.html#behavior-apache-http-client
 - from: /shareables/...
@@ -1066,6 +1018,8 @@
   to: /studio/projects/templates.html
 - from: /tools/publishing/app-signing.html
   to: /studio/publish/app-signing.html
+- from: /guide/publishing/app-signing.html
+  to: /studio/publish/app-signing.html
 - from: /tools/publishing/preparing.html
   to: /studio/publish/preparing.html
 - from: /tools/publishing/publishing_overview.html
@@ -1169,3 +1123,57 @@
   to: /preview/features/background-optimization.html
 - from: /bgopt/
   to: /preview/features/background-optimization.html
+
+
+
+# Android Studio help button redirects
+- from: /r/studio-ui/vector-asset-studio.html
+  to: /studio/write/vector-asset-studio.html
+- from: /r/studio-ui/image-asset-studio.html
+  to: /studio/write/image-asset-studio.html
+- from: /r/studio-ui/project-structure.html
+  to: /studio/projects/index.html
+- from: /r/studio-ui/android-monitor.html
+  to: /studio/profile/android-monitor.html
+- from: /r/studio-ui/am-logcat.html
+  to: /studio/debug/am-logcat.html
+- from: /r/studio-ui/am-memory.html
+  to: /studio/profile/am-memory.html
+- from: /r/studio-ui/am-cpu.html
+  to: /studio/profile/am-cpu.html
+- from: /r/studio-ui/am-gpu.html
+  to: /studio/profile/am-gpu.html
+- from: /r/studio-ui/am-network.html
+  to: /studio/profile/am-network.html
+- from: /r/studio-ui/am-hprof.html
+  to: /studio/profile/am-hprof.html
+- from: /r/studio-ui/am-allocation.html
+  to: /studio/profile/am-allocation.html
+- from: /r/studio-ui/am-methodtrace.html
+  to: /studio/profile/am-methodtrace.html
+- from: /r/studio-ui/am-sysinfo.html
+  to: /studio/profile/am-sysinfo.html
+- from: /r/studio-ui/am-screenshot.html
+  to: /studio/debug/am-screenshot.html
+- from: /r/studio-ui/am-video.html
+  to: /studio/debug/am-video.html
+- from: /r/studio-ui/avd-manager.html
+  to: /studio/run/managing-avds.html
+- from: /r/studio-ui/rundebugconfig.html
+  to: /studio/run/index.html
+- from: /r/studio-ui/devicechooser.html
+  to: /studio/run/emulator.html
+- from: /r/studio-ui/virtualdeviceconfig.html
+  to: /studio/run/managing-avds.html
+- from: /r/studio-ui/emulator.html
+  to: /studio/run/emulator.html
+- from: /r/studio-ui/instant-run.html
+  to: /studio/run/index.html#instant-run
+- from: /r/studio-ui/test-recorder.html
+  to: http://tools.android.com/tech-docs/test-recorder
+- from: /r/studio-ui/export-licenses.html
+  to: http://tools.android.com/tech-docs/new-build-system/license
+- from: /r/studio-ui/experimental-to-stable-gradle.html
+  to: http://tools.android.com/tech-docs/new-build-system/gradle-experimental/experimental-to-stable-gradle
+- from: /r/studio-ui/sdk-manager.html
+  to: https://developer.android.com/studio/intro/update.html#sdk-manager
\ No newline at end of file
diff --git a/docs/html/distribute/essentials/quality/core.jd b/docs/html/distribute/essentials/quality/core.jd
index 4b0b546..0ff44eb 100644
--- a/docs/html/distribute/essentials/quality/core.jd
+++ b/docs/html/distribute/essentials/quality/core.jd
@@ -1041,7 +1041,7 @@
     CR-11
   </td>
   <td>
-    Trigger and observe in the notications drawer all types of notifications
+    Trigger and observe in the notifications drawer all types of notifications
     that the app can display. Expand notifications where applicable (Android
     4.1 and higher), and tap all actions offered.
   </td>
diff --git a/docs/html/google/play/billing/billing_admin.jd b/docs/html/google/play/billing/billing_admin.jd
index a1135bf..05f3ad5 100644
--- a/docs/html/google/play/billing/billing_admin.jd
+++ b/docs/html/google/play/billing/billing_admin.jd
@@ -747,6 +747,15 @@
 <code>orderId</code> field of the <code>PURCHASE_STATE_CHANGED</code>
 intent.</p>
 
+<p class="note">
+  <strong>Note:</strong> When a user completes a test purchase, the
+  <code>orderId</code> field remains blank. To track test transactions, use
+  the <code>purchaseToken</code> field instead. For more information about
+  working with test purchases, see <a
+  href="{@docRoot}google/play/billing/billing_testing.html">Testing In-app
+  Billing</a>.
+</p>
+
 <p>In your app, you can use the order number as a general-purpose identifier for
 the in-app purchase transaction. After the purchase, you can use the order
 number as a means of tracking the transaction in reconciliation reports and for
diff --git a/docs/html/google/play/billing/billing_testing.jd b/docs/html/google/play/billing/billing_testing.jd
index 018276d..755f3ff 100644
--- a/docs/html/google/play/billing/billing_testing.jd
+++ b/docs/html/google/play/billing/billing_testing.jd
@@ -79,14 +79,11 @@
 through Google Play without incurring any actual charges to the user
 accounts.</p>
 
-<p>Once authorized for testing access, those users can make purchases without
-being charged.
-Test purchases are real orders and Google Play processes them in the same way as
-other orders. However, the <code>orderId</code> field for test purchases is
-blank.
-When purchases are complete, Google Play prevents the orders from
-going to financial processing, ensuring that there are no actual charges to user
-accounts, and automatically canceling the completed orders after 14 days.</p>
+<p>
+  Once authorized for testing access, those users can make purchases without
+  being charged. The <code>orderId</code> field for test purchases remains
+  blank, ensuring that there are no actual charges to user accounts.
+</p>
 
 <p class="note">
   <strong>Note:</strong> Test subscription purchases recur daily, regardless of
@@ -130,8 +127,8 @@
 purchase dialog.</p>
 
 <p class="note">
-  <strong>Note:</strong> For test subscription purchases, leave the {@code orderId}
-  field blank. You can use the {@code purchaseToken} field to identify test purchases.
+  <strong>Note:</strong> For test purchases, leave the {@code orderId} field
+  blank. You can use the {@code purchaseToken} field to identify test purchases.
 </p>
 
 
@@ -150,33 +147,22 @@
 
 <h4 id="cancelling">Canceling completed test purchases</h4>
 <p>Google Play accumulates completed test purchases for each user but does not
-pass them on  to financial processing. Over time, it automatically clears out
-the purchases by canceling them. </p>
+pass them on to financial processing.</p>
 
 <p>In some cases, you might want to manually cancel a test purchase to continue
-testing. For canceling purchases, you have these options:</p>
-
-<ul>
-<li>Wait for the transactions to expire&mdash;Google Play clears completed test
-purchases 14 days after their purchase date. </li>
-<li>Cancel purchases manually&mdash;you can go to the Google payments merchant
-center, look up the transaction, and then cancel it. You can find transactions
-by looking up their order numbers.</li>
+testing. To do so, open the app page in the Play Store. If the test purchase
+that you want to cancel is a subscription, you can also use the
+<a href="https://developers.google.com/android-publisher/api-ref/purchases/subscriptions/cancel">
+{@code cancel()}</a> method of the Purchases.subscriptions API.
 </ul>
 
-<p>
-  You can cancel test subscriptions purchases from the app page in the Play Store,
-  or use the 
-  <a href="https://developers.google.com/android-publisher/api-ref/purchases/subscriptions/cancel">
-  {@code cancel}</a> method.
-</p>
-
 <p class="caution">
   <strong>Important:</strong> The
   <a href="https://developers.google.com/android-publisher/api-ref/purchases/subscriptions/refund">
-  {@code refund}</a> and
+  {@code refund()}</a> and
   <a href="https://developers.google.com/android-publisher/api-ref/purchases/subscriptions/revoke">
-  {@code revoke}</a> methods do not support test purchases.
+  {@code revoke()}</a> methods of the Purchases.subscriptions API don't support
+  test purchases.
 </p>
 
 
diff --git a/docs/html/guide/topics/renderscript/compute.jd b/docs/html/guide/topics/renderscript/compute.jd
index 564215e..fc795ff 100755
--- a/docs/html/guide/topics/renderscript/compute.jd
+++ b/docs/html/guide/topics/renderscript/compute.jd
@@ -21,7 +21,7 @@
     <h2>Related Samples</h2>
 
     <ol>
-      <li><a href="{@docRoot}resources/samples/RenderScript/HelloCompute/index.html">Hello
+      <li><a class="external-link"href="https://github.com/android/platform_development/tree/master/samples/RenderScript/HelloCompute">Hello
       Compute</a></li>
     </ol>
   </div>
diff --git a/docs/html/images/testing/test-types.zip b/docs/html/images/testing/test-types.zip
new file mode 100644
index 0000000..d433b91
--- /dev/null
+++ b/docs/html/images/testing/test-types.zip
Binary files differ
diff --git a/docs/html/images/testing/test-types_2x.png b/docs/html/images/testing/test-types_2x.png
new file mode 100644
index 0000000..0a374aa
--- /dev/null
+++ b/docs/html/images/testing/test-types_2x.png
Binary files differ
diff --git a/docs/html/ndk/downloads/index.jd b/docs/html/ndk/downloads/index.jd
index 47d3113..954b049 100644
--- a/docs/html/ndk/downloads/index.jd
+++ b/docs/html/ndk/downloads/index.jd
@@ -332,35 +332,199 @@
 <h2 id="rel">Release Notes</h2>
 
 <p>
-  Android NDK, Revision 11c <em>(March 2016)</em>
+  Android NDK, Revision 12 <em>(June 2016)</em>
 </p>
 
 <dl>
-  <dt>
-    NDK
-  </dt>
+<dt>
+  Announcements
+</dt>
 
-  <dd>
-    <ul>
-      <li>Changes
-        <ul>
-          <li>Applied additional fixes to the {@code ndk-gdb.py} script.
-          </li>
-          <li>Added an optional package name argument to the {@code ndk-gdb}
-            command {@code --attach} option.
-            (<a href="https://github.com/android-ndk/ndk/issues/13">Issue 13</a>)
-          </li>
-          <li>Fixed invalid toolchain paths for 32-bit Windows platform.
-            (<a href="https://github.com/android-ndk/ndk/issues/45">Issue 45</a>)
-          </li>
-          <li>Fixed the relative path for the {@code ndk-which} command.
-            (<a href="https://github.com/android-ndk/ndk/issues/29">Issue 29</a>)
-          </li>
-          <li>Fixed use of cygpath for the libgcc compiler.
-            (Android <a href="http://b.android.com/195486">Issue 195486</a>)
-          </li>
-        </ul>
-      </li>
-    </ul>
-  </dd>
-</dl>
\ No newline at end of file
+<ul>
+  <li>The <code>ndk-build</code> command will default to using
+  Clang in an upcoming release. GCC will be removed in a later release.
+  </li>
+  <li>The <code>make-standalone-toolchain.sh</code> script will be removed
+  in an upcoming release. If you use this script, please plan to migrate to the
+  <code>make_standalone_toolchain.py</code> as soon as possible.
+  </li>
+</ul>
+
+<dt>
+  NDK
+</dt>
+
+<ul>
+  <li>Removed support for the armeabi-v7a-hard ABI. See the explanation in the
+  <a href=
+  "https://android.googlesource.com/platform/ndk/+/ndk-r12-release/docs/HardFloatAbi.md">
+    documentation</a>.
+  </li>
+
+  <li>Removed all sysroots for platform levels prior to Android 2.3 (API level 10).
+    We dropped support for them in NDK r11, but neglected to actually remove them.
+  </li>
+
+  <li>Updated exception handling when using c++_shared on ARM32 so that it
+    mostly works (see <a href="#known-issues">Known Issues</a>). The unwinder
+    is now linked into each linked object rather than into libc++ itself.
+  </li>
+
+  <li>Pruned the default compiler flags (<a href=
+  "https://github.com/android-ndk/ndk/issues/27">NDK Issue 27</a>). You can see
+  details of this update in <a href=
+  "https://android-review.googlesource.com/#/c/207721/5">Change 207721</a>.
+  </li>
+
+  <li>Added a Python implementation of standalone toolchains in <code>
+  build/tools/make_standalone_toolchain.py</code>. On Windows, you no longer
+  need Cygwin to use this feature. Note that the bash flavor will be removed
+  in an upcoming release, so please test the new one now.
+  </li>
+
+  <li>Configured Clang debug builds to have the <code>-fno-limit-debug-info</code>
+  option is enabled by default. This change enables better debugging with LLDB.
+  </li>
+
+  <li>Enabled the <code>--build-id</code> as a default option. This option
+  causes an identifier to be shown in native crash reports so you can easily
+  identify which version of your code was running.
+  </li>
+
+  <li>Fixed issue with <code>NDK_USE_CYGPATH</code> so that it no longer causes
+  problems with libgcc
+  (<a href="http://b.android.com/195486">Issue 195486</a>).
+  </li>
+
+  <li>Enabled the following options as default:
+  <code>-Wl,--warn-shared-textrel</code> and <code>-Wl,--fatal-warnings</code>.
+  If you have shared text relocations, your app does not load on Android 6.0
+  (API level 23) and higher. Note that this configuration has never been
+  allowed for 64-bit apps.
+  </li>
+
+  <li>Fixed a few issues so that precompiled headers work better
+    (<a href="https://github.com/android-ndk/ndk/issues/14">NDK Issue 14</a>,
+     <a href="https://github.com/android-ndk/ndk/issues/16">NDK Issue 16</a>).
+  </li>
+
+  <li>Removed unreachable ARM (non-thumb) STL libraries.
+  </li>
+
+  <li>Added Vulkan support to android-24.
+  </li>
+
+  <li>Added Choreographer API to android-24.
+  </li>
+
+  <li>Added libcamera2 APIs for devices that support the
+  <code>INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED</code> feature level or higher.
+  For more information, see the
+  <a href="{@docRoot}reference/android/hardware/camera2/CameraCharacteristics.html#INFO_SUPPORTED_HARDWARE_LEVEL">
+    <code>CameraCharacteristics</code></a> reference.
+  </li>
+
+</ul>
+
+<dt>
+  Clang
+</dt>
+
+<ul>
+  <li>Clang has been updated to 3.8svn (r256229, build 2812033). Note that
+    Clang packaged in the Windows 64-bit NDK is actually 32-bit.
+  </li>
+
+  <li>Fixed <code>__thread</code> so that it works for real this time.
+  </li>
+</ul>
+
+<dt>
+  GCC
+</dt>
+
+<ul>
+  <li>Synchronized the compiler with the ChromeOS GCC @ google/gcc-4_9 r227810.
+  </li>
+
+  <li>Backported coverage sanitizer patch from ToT (r231296).
+  </li>
+
+  <li>Fixed <code>libatomic</code> to not use ifuncs (<a href=
+  "https://github.com/android-ndk/ndk/issues/31">NDK Issue 31</a>).
+  </li>
+</ul>
+
+<dt>
+  Binutils
+</dt>
+
+<ul>
+  <li>Silenced the "Erratum 843419 found and fixed" info messages.
+  </li>
+
+  <li>Introduced option <code>--long-plt</code> to fix an internal linker error
+  when linking huge arm32 binaries.
+  </li>
+
+  <li>Fixed wrong run time stubs for <code>AArch64</code>. This problem was
+  causing jump addresses to be calculated incorrectly for very large
+  dynamic shared objects (DSOs).
+  </li>
+
+  <li>Introduced default option <code>--no-apply-dynamic</code> to work around
+  a dynamic linker bug for earlier Android releases.
+  </li>
+
+  <li>Fixed a known issue with NDK r11 where <code>dynamic_cast</code> was not
+  working with Clang, x86, stlport_static and optimization.
+  </li>
+</ul>
+
+<dt>
+  GDB
+</dt>
+
+<ul>
+  <li>Updated to GDB version 7.11. For more information about this release, see
+  <a href="https://www.gnu.org/software/gdb/news/">GDB News</a>.
+  </li>
+
+  <li>Fixed a number of bugs in the <code>ndk-gdb.py</code> script.
+  </li>
+</ul>
+
+<dt id="known-issues">
+  Known Issues
+</dt>
+
+<ul>
+  <li>The x86 <a href="http://source.android.com/devices/tech/debug/asan.html">Address
+  Sanitizer</a> (ASAN) currently does not work. For more information, see
+  <a href="https://android-review.googlesource.com/#/c/186276/">Issue 186276</a>.
+  </li>
+
+  <li>Exception unwinding with <code>c++_shared</code> does not work for ARM on
+  Android 2.3 (API level 9) or Android 4.0 (API level 14).
+  </li>
+
+  <li>Bionic headers and libraries for Android 6.0 (API level 23) and higher
+  are not yet exposed despite the presence of android-24. Those platforms still
+  have the Android 5.0 (API level 21) headers and libraries, which is consistent
+  with NDK r11.
+  </li>
+
+  <li>The RenderScript tools are not present, which is consistent with
+  NDK r11.
+  (<a href="https://github.com/android-ndk/ndk/issues/7">NDK Issue 7</a>)
+  </li>
+
+  <li>In <code>NdkCameraMetadataTags.h</code> header file, the camera metadata
+  tag enum value <code>ACAMERA_STATISTICS_LENS_SHADING_CORRECTION_MAP</code>
+  was listed by accident and will be removed in next release. Use
+  the <code>ACAMERA_STATISTICS_LENS_SHADING_MAP</code> value instead.
+  </li>
+
+</ul>
+
+</dl>
diff --git a/docs/html/ndk/downloads/revision_history.jd b/docs/html/ndk/downloads/revision_history.jd
index c5a0d48..211b64e 100644
--- a/docs/html/ndk/downloads/revision_history.jd
+++ b/docs/html/ndk/downloads/revision_history.jd
@@ -10,6 +10,44 @@
  <p>
    <a href="#" onclick="return toggleContent(this)"> <img
      src="/assets/images/styles/disclosure_down.png" class="toggle-content-img" alt=""
+   >Android NDK, Revision 11c</a> <em>(March 2016)</em>
+ </p>
+ <div class="toggle-content-toggleme">
+
+<dl>
+  <dd>
+    <ul>
+      <li>Changes
+        <ul>
+          <li>Applied additional fixes to the {@code ndk-gdb.py} script.
+          </li>
+          <li>Added an optional package name argument to the {@code ndk-gdb}
+            command {@code --attach} option.
+            (<a href="https://github.com/android-ndk/ndk/issues/13">Issue 13</a>)
+          </li>
+          <li>Fixed invalid toolchain paths for 32-bit Windows platform.
+            (<a href="https://github.com/android-ndk/ndk/issues/45">Issue 45</a>)
+          </li>
+          <li>Fixed the relative path for the {@code ndk-which} command.
+            (<a href="https://github.com/android-ndk/ndk/issues/29">Issue 29</a>)
+          </li>
+          <li>Fixed use of cygpath for the libgcc compiler.
+            (Android <a href="http://b.android.com/195486">Issue 195486</a>)
+          </li>
+        </ul>
+      </li>
+    </ul>
+  </dd>
+</dl>
+
+ </div>
+</div>
+
+<div class="toggle-content closed">
+<a name="11b"></a>
+ <p>
+   <a href="#" onclick="return toggleContent(this)"> <img
+     src="/assets/images/styles/disclosure_down.png" class="toggle-content-img" alt=""
    >Android NDK, Revision 11b</a> <em>(March 2016)</em>
  </p>
  <div class="toggle-content-toggleme">
diff --git a/docs/html/preview/support.jd b/docs/html/preview/support.jd
index 5328fd8..ef8a652 100644
--- a/docs/html/preview/support.jd
+++ b/docs/html/preview/support.jd
@@ -17,6 +17,7 @@
       <li><a href="#general">General advisories</a></li>
       <li><a href="#new">New in DP4</a></li>
       <li><a href="#ki">Known issues</a></li>
+      <li><a href="#upgrade-notes">Notes on publishing apps that target API 24</a></li>
     </ul>
   </li>
   <li><a href="#dp3">Developer Preview 3</a></li>
@@ -279,6 +280,15 @@
   </li>
 </ul>
 
+<h4 id="">Android Auto</h4>
+
+<p>
+  The version of Google Maps included in Developer Preview 4 (9.30) crashes
+  when used with Android Auto. This issue will be fixed in the next update to
+  Google Maps (9.31), expected in the coming weeks.
+</p>
+
+
 <!-- TBA, if any
 <h4>Device-specific issues</h4>
 
@@ -328,13 +338,34 @@
 
   <li>Additional bluetooth connectivity fixes
   </li>
+
 </ul>
 
 <p>For the full list of fixed issues, see <a href="https://goo.gl/6uCKtf">the
 issue tracker</a>.</p>
 
+<h3 id="upgrade-notes">Notes on publishing apps that target API 24</h3>
 
+<p>
+  Before publishing apps that target API 24 in Google Play, keep these points
+  in mind:
+</p>
 
+<ul>
+  <li>If your app’s current <code>targetSdkVersion</code> is 22 or lower and
+  you want to target API 24, you’ll need to support <a href=
+  "{@docRoot}about/versions/marshmallow/android-6.0-changes.html">behaviors
+  introduced with Android 6.0 (Marshmallow)</a>, such as <a href=
+  "{@docRoot}training/permissions/requesting.html">runtime permissions</a>, in
+  addition to Android N behaviors.
+  </li>
+
+  <li>Once you publish an app with <code>targetSdkVersion</code> set to 23 or
+  higher, you can't later publish a version of the app with a higher
+  <code>versionCode</code> that targets 22 or lower. This restriction applies
+  in alpha and beta channels as well as production channel.
+  </li>
+</ul>
 
 <!-- DP3 Release Notes Archive -->
 
diff --git a/docs/html/sdk/sdk_vars.cs b/docs/html/sdk/sdk_vars.cs
index 32fdb0a..80da297 100644
--- a/docs/html/sdk/sdk_vars.cs
+++ b/docs/html/sdk/sdk_vars.cs
@@ -1,18 +1,19 @@
 <?cs
-set:ndk.mac64_download='android-ndk-r11c-darwin-x86_64.zip' ?><?cs
-set:ndk.mac64_bytes='772428792' ?><?cs
-set:ndk.mac64_checksum='4ce8e7ed8dfe08c5fe58aedf7f46be2a97564696' ?><?cs
+set:ndk.mac64_download='android-ndk-r12-darwin-x86_64.zip' ?><?cs
+set:ndk.mac64_bytes='734014148' ?><?cs
+set:ndk.mac64_checksum='708d4025142924f7097a9f44edf0a35965706737' ?><?cs
 
-set:ndk.linux64_download='android-ndk-r11c-linux-x86_64.zip' ?><?cs
-set:ndk.linux64_bytes='794135138' ?><?cs
-set:ndk.linux64_checksum='de5ce9bddeee16fb6af2b9117e9566352aa7e279' ?><?cs
+set:ndk.linux64_download='android-ndk-r12-linux-x86_64.zip' ?><?cs
+set:ndk.linux64_bytes='755431993' ?><?cs
+set:ndk.linux64_checksum='b7e02dc733692447366a2002ad17e87714528b39' ?><?cs
 
-set:ndk.win64_download='android-ndk-r11c-windows-x86_64.zip' ?><?cs
-set:ndk.win64_bytes='771407642' ?><?cs
-set:ndk.win64_checksum='3d89deb97b3191c7e5555f1313ad35059479f071' ?><?cs
-set:ndk.win32_download='android-ndk-r11c-windows-x86.zip' ?><?cs
-set:ndk.win32_bytes='728899082' ?><?cs
-set:ndk.win32_checksum='ff939bde6cd374eecbd2c3b2ad218697f9a5038c'
+set:ndk.win64_download='android-ndk-r12-windows-x86.zip' ?><?cs
+set:ndk.win64_bytes='706332762' ?><?cs
+set:ndk.win64_checksum='37fcd7acf6012d0068a57c1524edf24b0fef69c9' ?><?cs
+
+set:ndk.win32_download='android-ndk-r12-windows-x86_64.zip' ?><?cs
+set:ndk.win32_bytes='749444245' ?><?cs
+set:ndk.win32_checksum='80d64a77aab52df867ac55cec1e976663dd3326f'
 ?>
 <?cs
 def:size_in_mb(bytes)
diff --git a/docs/html/topic/libraries/data-binding/index.jd b/docs/html/topic/libraries/data-binding/index.jd
index ca8784e..293de51 100644
--- a/docs/html/topic/libraries/data-binding/index.jd
+++ b/docs/html/topic/libraries/data-binding/index.jd
@@ -18,7 +18,7 @@
         <a href="#data_binding_layout_files">Data Binding Layout Files</a>
         <ol>
           <li>
-            <a href="#writing_expressions">Writing your first data binding
+            <a href="#writing_expressions">Writing your first set of data binding
             expressions</a>
           </li>
 
@@ -29,9 +29,16 @@
           <li>
             <a href="#binding_data">Binding Data</a>
           </li>
-
           <li>
-            <a href="#binding_events">Binding Events</a>
+            <a href="#event_handling">Event Handling</a>
+            <ol>
+              <li>
+                <a href="#method_references">Method References</a>
+              </li>
+              <li>
+                <a href="#listener_bindings">Listener Bindings</a>
+              </li>
+            </ol>
           </li>
         </ol>
       </li>
@@ -147,27 +154,34 @@
   application logic and layouts.
 </p>
 
-<p>The Data Binding Library offers both flexibility and broad compatibility
-&mdash; it's a support library, so you can use it with all Android platform
-versions back to <strong>Android 2.1</strong> (API level 7+).</p>
+<p>
+  The Data Binding Library offers both flexibility and broad compatibility —
+  it's a support library, so you can use it with all Android platform versions
+  back to <strong>Android 2.1</strong> (API level 7+).
+</p>
 
-<p>To use data binding, Android Plugin for Gradle <strong>1.5.0-alpha1</strong>
-or higher is required.</p>
+<p>
+  To use data binding, Android Plugin for Gradle <strong>1.5.0-alpha1</strong>
+  or higher is required.
+</p>
 
 <h2 id="build_environment">
   Build Environment
 </h2>
 
-<p>To get started with Data Binding, download the library from the Support
-repository in the Android SDK manager. </p>
-
 <p>
-To configure your app to use data binding, add the <code>dataBinding</code> element to your
-<code>build.gradle</code> file in the app module.
+  To get started with Data Binding, download the library from the Support
+  repository in the Android SDK manager.
 </p>
 
- <p>Use the following code snippet to configure data binding: </p>
+<p>
+  To configure your app to use data binding, add the <code>dataBinding</code>
+  element to your <code>build.gradle</code> file in the app module.
+</p>
 
+<p>
+  Use the following code snippet to configure data binding:
+</p>
 <pre>
 android {
     ....
@@ -176,13 +190,17 @@
     }
 }
 </pre>
+<p>
+  If you have an app module that depends on a library which uses data binding,
+  your app module must configure data binding in its <code>build.gradle</code>
+  file as well.
+</p>
 
-<p>If you have an app module that depends on a library which uses data binding, your app module
- must configure data binding in its <code>build.gradle</code> file as well.</p>
-
-<p>Also, make sure you are using a compatible version of Android Studio.
-<strong>Android Studio 1.3</strong> and later provides support for data binding as described in
-<a href="#studio_support">Android Studio Support for Data Binding</a>.
+<p>
+  Also, make sure you are using a compatible version of Android Studio.
+  <strong>Android Studio 1.3</strong> and later provides support for data
+  binding as described in <a href="#studio_support">Android Studio Support for
+  Data Binding</a>.
 </p>
 
 <h2 id="data_binding_layout_files">
@@ -190,7 +208,7 @@
 </h2>
 
 <h3 id="writing_expressions">
-  Writing your first data binding expressions
+  Writing your first set of data binding expressions
 </h3>
 
 <p>
@@ -223,20 +241,19 @@
   The user <strong>variable</strong> within <strong>data</strong> describes a
   property that may be used within this layout.
 </p>
-
 <pre>
 &lt;<strong>variable name="user" type="com.example.User"</strong>/&gt;
 </pre>
 <p>
   Expressions within the layout are written in the attribute properties using
-  the “<code>&commat;{}</code>” syntax. Here, the TextView’s text is set to the
-  firstName property of user:
+  the “<code>&amp;commat;{}</code>” syntax. Here, the TextView’s text is set to
+  the firstName property of user:
 </p>
 
 <pre>
 &lt;TextView android:layout_width="wrap_content"
           android:layout_height="wrap_content"
-          android:text="&commat;{user.firstName}"/&gt;
+          android:text="&amp;commat;{user.firstName}"/&gt;
 </pre>
 <h3 id="data_object">
   Data Object
@@ -261,7 +278,6 @@
   to have data that is read once and never changes thereafter. It is also
   possible to use a JavaBeans objects:
 </p>
-
 <pre>
 public class User {
    private final String firstName;
@@ -280,11 +296,12 @@
 </pre>
 <p>
   From the perspective of data binding, these two classes are equivalent. The
-  expression <strong><code>&commat;{user.firstName}</code></strong> used for
-  the TextView’s <strong><code>android:text</code></strong> attribute will
+  expression <strong><code>&amp;commat;{user.firstName}</code></strong> used
+  for the TextView’s <strong><code>android:text</code></strong> attribute will
   access the <strong><code>firstName</code></strong> field in the former class
-  and the <code>getFirstName()</code> method in the latter class. Alternatively, it
-  will also be resolved to <code>firstName()</code> if that method exists.
+  and the <code>getFirstName()</code> method in the latter class.
+  Alternatively, it will also be resolved to <code>firstName()</code> if that
+  method exists.
 </p>
 
 <h3 id="binding_data">
@@ -328,16 +345,38 @@
 //or
 ListItemBinding binding = DataBindingUtil.<em>inflate</em>(layoutInflater, R.layout.<em><strong>list_item</strong></em>, viewGroup, <strong>false</strong>);
 </pre>
-
-<h3 id="binding_events">
-  Binding Events
-</h3>
+<h3 id="event_handling">Event Handling</h3>
 <p>
-  Events may be bound to handler methods directly, similar to the way
-  <strong><code>android:onClick</code></strong> can be assigned to a method in the Activity.
-  Event attribute names are governed by the name of the listener method with a few exceptions.
-  For example, {@link android.view.View.OnLongClickListener} has a method {@link android.view.View.OnLongClickListener#onLongClick onLongClick()},
-  so the attribute for this event is <code>android:onLongClick</code>.
+Data Binding allows you to write expressions handling events that are dispatched from the views (e.g. onClick).
+Event attribute names are governed by the name of the listener method with a few exceptions.
+For example, {@link android.view.View.OnLongClickListener} has a method {@link android.view.View.OnLongClickListener#onLongClick onLongClick()},
+so the attribute for this event is <code>android:onLongClick</code>.
+There are two ways to handle an event.
+</p>
+<ul>
+  <li>
+    <a href="#method_references">Method References</a>: In your expressions, you can reference methods that conform to the signature of the listener method. When an expression evaluates to a method reference, Data Binding wraps the method reference and owner object in a listener, and sets that listener on the target view. If the expression evaluates to null, Data Binding does not create a listener and sets a null listener instead.
+  </li>
+  <li>
+    <a href="#listener_bindings">Listener Bindings</a>: These are lambda expressions that are evaluated when the event happens.
+Data Binding always creates a listener, which it sets on the view. When the event is dispatched, the listener evaluates the lambda expression.
+  </li>
+</ul>
+<h4 id="method_references">
+  Method References
+</h4>
+<p>
+  Events can be bound to handler methods directly, similar to the way
+  <strong><code>android:onClick</code></strong> can be assigned to a method in an Activity.
+  One major advantage compared to the {@code View#onClick} attribute is that the expression
+  is processed at compile time, so if the method does not exist or its signature is not
+  correct, you receive a compile time error.</p>
+<p>
+  The major difference between Method References and Listener Bindings is that
+  the actual listener implementation is created when the data is bound, not
+  when the event is triggered. If you prefer to evaluate the expression when
+  the event happens, you should use <a href="#listener_bindings">listener
+  binding</a>.
 </p>
 <p>
   To assign an event to its handler, use a normal binding expression, with the value
@@ -345,7 +384,6 @@
 </p>
 <pre>public class MyHandlers {
     public void onClickFriend(View view) { ... }
-    public void onClickEnemy(View view) { ... }
 }
 </pre>
 <p>
@@ -365,14 +403,121 @@
        &lt;TextView android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="&commat;{user.firstName}"
-           android:onClick="&commat;{user.isFriend ? handlers.onClickFriend : handlers.onClickEnemy}"/&gt;
-       &lt;TextView android:layout_width="wrap_content"
-           android:layout_height="wrap_content"
-           android:text="&commat;{user.lastName}"
-           android:onClick="&commat;{user.isFriend ? handlers.onClickFriend : handlers.onClickEnemy}"/&gt;
+           android:onClick="&commat;{handlers::onClickFriend}"/&gt;
    &lt;/LinearLayout&gt;
 &lt;/layout&gt;
 </pre>
+<p>
+Note that the signature of the method in the expression must exactly match the signature of the method in the
+Listener object.
+</p>
+<h4 id="listener_bindings">
+  Listener Bindings
+</h4>
+<p>
+  Listener Bindings are binding expressions that run when an event happens.
+  They are similar to method references, but they let you run arbitrary data
+  binding expressions. This feature is available with Android Gradle Plugin for Gradle
+  version 2.0 and later.
+</p>
+<p>
+  In method references, the parameters of the method must
+  match the parameters of the event listener. In Listener Bindings, only your
+  return value must match the expected return value of the listener (unless it
+  is expecting void).
+  For example, you can have a presenter class that has the following method:
+</p>
+<pre>
+public class Presenter {
+    public void onSaveClick(Task task){}
+}
+</pre>
+  Then you can bind the click event to your class as follows:
+<pre>
+  &lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
+  &lt;layout xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;&gt;
+      &lt;data&gt;
+          &lt;variable name=&quot;task&quot; type=&quot;com.android.example.Task&quot; /&gt;
+          &lt;variable name=&quot;presenter&quot; type=&quot;com.android.example.Presenter&quot; /&gt;
+      &lt;/data&gt;
+      &lt;LinearLayout android:layout_width=&quot;match_parent&quot; android:layout_height=&quot;match_parent&quot;&gt;
+          &lt;Button android:layout_width=&quot;wrap_content&quot; android:layout_height=&quot;wrap_content&quot;
+          android:onClick=&quot;@{() -&gt; presenter.onSaveClick(task)}&quot; /&gt;
+      &lt;/LinearLayout&gt;
+  &lt;/layout&gt;
+</pre>
+<p>
+  Listeners are represented by lambda expressions that are allowed only as root
+  elements of your expressions. When a callback is used in an expression, Data
+  Binding automatically creates the necessary listener and registers for the
+  event. When the view fires the event, Data Binding evaluates the given
+  expression. As in regular binding expressions, you still get the null and
+  thread safety of Data Binding while these listener expressions are being
+  evaluated.
+</p>
+<p>
+  Note that in the example above, we haven't defined the {@code view} parameter
+  that is passed into {@link
+  android.view.View.OnClickListener#onClick(android.view.View view)}. Listener
+  bindings provide two choices for listener parameters: you can either ignore
+  all parameters to the method or name all of them. If you prefer to name the
+  parameters, you can use them in your expression. For example, the expression
+  above could be written as:
+</p>
+<pre>
+  android:onClick=&quot;@{(view) -&gt; presenter.onSaveClick(task)}&quot;
+</pre>
+Or if you wanted to use the parameter in the expression, it could work as follows:
+<pre>
+public class Presenter {
+    public void onSaveClick(View view, Task task){}
+}
+</pre>
+<pre>
+  android:onClick=&quot;@{(theView) -&gt; presenter.onSaveClick(theView, task)}&quot;
+</pre>
+You can use a lambda expression with more than one parameter:
+<pre>
+public class Presenter {
+    public void onCompletedChanged(Task task, boolean completed){}
+}
+</pre>
+<pre>
+  &lt;CheckBox android:layout_width=&quot;wrap_content&quot; android:layout_height=&quot;wrap_content&quot;
+        android:onCheckedChanged=&quot;@{(cb, isChecked) -&gt; presenter.completeChanged(task, isChecked)}&quot; /&gt;
+</pre>
+<p>
+  If the event you are listening to returns a value whose type is not {@code
+  void}, your expressions must return the same type of value as well. For
+  example, if you want to listen for the long click event, your expression
+  should return {@code boolean}.
+</p>
+<pre>
+public class Presenter {
+    public boolean onLongClick(View view, Task task){}
+}
+</pre>
+<pre>
+  android:onLongClick=&quot;@{(theView) -&gt; presenter.onLongClick(theView, task)}&quot;
+</pre>
+<p>
+If the expression cannot be evaluated due to {@code null} objects, Data Binding returns
+the default Java value for that type. For example, {@code null} for reference types, {@code 0} for {@code int},
+{@code false} for {@code boolean}, etc.
+</p>
+<p>
+If you need to use an expression with a predicate (e.g. ternary), you can use
+{@code void} as a symbol.
+</p>
+<pre>
+  android:onClick=&quot;@{(v) -&gt; v.isVisible() ? doSomething() : void}&quot;
+</pre>
+
+<h5>Avoid Complex Listeners</h5>
+Listener expressions are very powerful and can make your code very easy to read.
+On the other hand, listeners containing complex expressions make your layouts hard to read and unmaintainable. 
+These expressions should be as simple as passing available data from your UI to your callback method. You should implement 
+any business logic inside the callback method that you invoked from the listener expression.
 
 <p>
   Some specialized click event handlers exist and they need an attribute other than
diff --git a/docs/html/training/articles/user-data-ids.jd b/docs/html/training/articles/user-data-ids.jd
index 5a4648b..9102166 100644
--- a/docs/html/training/articles/user-data-ids.jd
+++ b/docs/html/training/articles/user-data-ids.jd
@@ -189,15 +189,15 @@
 
 <div style="padding:.5em 2em;">
 <div style="border-left:4px solid #999;padding:0 1em;font-style:italic;">
-<p>...upon reset, a new advertising
+<p>...if reset, a new advertising
   identifier must not be connected to a previous advertising identifier or data
   derived from a previous advertising identifier without the explicit consent
-  of the user</span></p>
+  of the user.</span></p>
 </div>
 </div>
 
 <p>
-  <em><strong>Always respect the associated Interest Based Advertising
+  <em><strong>Always respect the associated Personalized Ads
   flag</strong></em>. Advertising IDs are configurable in that users can limit
   the amount of tracking associated with the ID. Always use the <code><a href=
   "https://developers.google.com/android/reference/com/google/android/gms/ads/identifier/AdvertisingIdClient.Info.html#isLimitAdTrackingEnabled()">
@@ -210,10 +210,10 @@
 
 <div style="padding:.5em 2em;">
 <div style="border-left:4px solid #999;padding:0 1em;font-style:italic;">
-<p>...you must abide by a user’s ‘opt out of
-  interest-based advertising’ setting. If a user has enabled this setting, you
+<p>...you must abide by a user’s ‘Opt out of interest-based advertising’ or 'Opt
+  out of Ads Personalization' setting. If a user has enabled this setting, you
   may not use the advertising identifier for creating user profiles for
-  advertising purposes or for targeting users with interest-based advertising.
+  advertising purposes or for targeting users with personalized advertising.
   Allowed activities include contextual advertising, frequency capping,
   conversion tracking, reporting and security and fraud detection.</span></p>
 </div>
@@ -286,7 +286,8 @@
   <code>account_id</code> column in both tables, which would be a violation of
   the <a href=
   "https://play.google.com/about/developer-content-policy.html">Google Play
-  Developer Content Policy</a>.
+  Developer Content Policy</a>, if you did not get explicit permission from
+  your users.
 </p>
 
 <p>
diff --git a/docs/html/training/auto/audio/index.jd b/docs/html/training/auto/audio/index.jd
index aa20e3a..3a1b1e88 100644
--- a/docs/html/training/auto/audio/index.jd
+++ b/docs/html/training/auto/audio/index.jd
@@ -21,6 +21,7 @@
       <li><a href="#config_manifest">Configure Your Manifest</a></li>
       <li><a href="#isconnected">Determine if Your App is Connected</a></li>
       <li><a href="#alarm">Handle Alarms</a></li>
+      <li><a href="#mediaadv">Handle Media Advertisements</a></li>
       <li><a href="#implement_browser">Build a Browser Service</a></li>
       <li><a href="#implement_callback">Implement Play Controls</a></li>
       <li><a href="#support_voice">Support Voice Actions</a></li>
@@ -261,7 +262,7 @@
 <ul>
 <li>Disable the alarm.</li>
 <li>Play the alarm over
-<a href="{@docRoot}reference/android/media/AudioManager.html">STREAM_ALARM</a>,
+<a href="{@docRoot}reference/android/media/AudioManager.html#STREAM_ALARM">STREAM_ALARM</a>,
  and provide a UI on the phone screen to disable the alarm.</li>
 </ul>
 
@@ -279,6 +280,33 @@
   }
 </pre>
 
+<h2 id="mediaadv">Handle Media Advertisements</h2>
+<p>By default, Android Auto displays a notification when
+the media metadata changes during an audio playback session. When a media
+app switches from playing music to running an advertisement, it is distracting
+(and unnecessary) to display a notification to the user. To prevent Android Auto
+from displaying a notification in this case, you must set the media metadata
+key {@code android.media.metadata.ADVERTISEMENT} to 1, as shown in the code
+snippet below:
+
+<pre>
+
+&#64;Override
+public static final String EXTRA_METADATA_ADVERTISEMENT =
+            "android.media.metadata.ADVERTISEMENT";
+
+public void onPlayFromMediaId(String mediaId, Bundle extras) {
+    MediaMetadata.Builder builder = new MediaMetadata.Builder();
+    // ...
+    if (isAd(mediaId)) {
+        builder.putLong(EXTRA_METADATA_ADVERTISEMENT, 1);
+    }
+    // ...
+    mediaSession.setMetadata(builder.build());
+}
+
+</pre>
+
 <h2 id="implement_browser">Build a Browser Service</h2>
 
 <p>Auto devices interact with your app by contacting its implementation of a
diff --git a/docs/html/training/testing/start/index.jd b/docs/html/training/testing/start/index.jd
index 707ba9d..aa0473f 100644
--- a/docs/html/training/testing/start/index.jd
+++ b/docs/html/training/testing/start/index.jd
@@ -9,51 +9,20 @@
   <div id="tb">
 
     <h2>
-      Dependencies and prerequisites
-    </h2>
-
-    <ul>
-      <li>
-        <a href="{@docRoot}tools/studio/index.html">Android Studio 2.0</a>, or
-        later.
-      </li>
-
-      <li>The Android Support Repository (available from the <a href=
-      "{@docRoot}tools/help/sdk-manager.html">SDK Manager</a>)
-      </li>
-    </ul>
-
-    <h2>
-      This lesson teaches you to
+      In this document
     </h2>
 
       <ol>
-        <li>
-          <a href="#config-local-tests">Configure Your Project for Local Unit
-          Tests</a>
-        </li>
-
-        <li>
-          <a href="#config-instrumented-tests">Configure Your Project for
-          Instrumented Tests</a>
-        </li>
-
-        <li>
-          <a href="#build">Build and Run Your Tests</a>
+        <li><a href="#test-types">Test Types</a></li>
+        <li><a href="#test-apis">Test APIs</a>
           <ol>
-            <li>
-              <a href="#run-local-tests">Run Local Unit Tests</a>
-            </li>
-
-            <li>
-              <a href="#run-instrumented-tests">Run Instrumented Tests</a>
-            </li>
-
-            <li>
-              <a href="#run-ctl">Run Instrumented Tests with Cloud Test Lab</a>
-            </li>
+            <li><a href="#junit">JUnit</a></li>
+            <li><a href="#support-library">Android Testing Support Library</a></li>
+            <li><a href="#assertion">Assertion classes</a></li>
+            <li><a href="#monkeyrunner">Monkey and monkeyrunner</a></li>
           </ol>
         </li>
+        <li><a href="#build">Guides for Building Android Tests</a>
       </ol>
 
     <h2>
@@ -61,10 +30,6 @@
     </h2>
 
     <ul>
-      <li>
-        <a href="{@docRoot}tools/testing/testing_android.html">Testing
-        Concepts</a>
-      </li>
 
       <li>
         <a href="https://github.com/googlesamples/android-testing" class=
@@ -80,484 +45,356 @@
 </div>
 
 <p>
-  Writing and running tests are important parts of the Android app development
-  cycle. Well-written tests can help you catch bugs early in development and
-  give you confidence in your code. Using Android Studio, you can run local
-  unit tests or instrumented tests on a variety of physical or virtual Android
-  devices. You can then analyze the results and make changes to your code
-  without leaving the development environment.
+  Android tests are based on <a href="http://junit.org/" class=
+  "external-link">JUnit</a>, and you can run them either as local
+  unit tests on the JVM or as instrumented tests on an Android device.
+  This page provides an introduction to the concepts and
+  tools for building Android tests.
 </p>
 
-<p>
-  <em>Local unit tests</em> are tests that run on your local machine, without
-  needing access to the Android framework or an Android device. To learn how to
-  develop local units tests, see <a href=
-  "{@docRoot}training/testing/unit-testing/local-unit-tests.html">Building
-  Local Unit Tests</a>.
-</p>
 
-<p>
-  <em>Instrumented tests</em> are tests that run on an Android device or
-  emulator. These tests have access to {@link android.app.Instrumentation}
-  information, such as the {@link android.content.Context} for the app under
-  test. Instrumented tests can be used for unit, user interface (UI), or app
-  component integration testing. To learn how to develop instrumented tests for
-  your specific needs, see these additional topics:
-</p>
+<h2 id="test-types">Test Types</h2>
+
+
+<p>When using Android Studio to write any of your tests, your test code must go
+into one of two different code directories (source sets). For each module in
+your project, Android Studio includes both source sets, corresponding to the
+following test types:</p>
+
+<dl>
+<dt><b>Local unit tests</b></dt>
+<dd>Located at <code><var>module-name</var>/src/test/java/</code>.
+<p>These tests run on the local JVM
+and do not have access to functional Android framework APIs.</p>
+<p>To get started, see <a
+href="/training/testing/unit-testing/local-unit-tests.html">Building Local
+Unit Tests</a>.</p>
+</dd>
+
+<dt><b>Instrumented tests</b></dt>
+<dd>Located at <code><var>module-name</var>/src/androidTest/java/</code>.
+<p>These are all tests that must run on an Android hardware device or
+an Android emulator.</p>
+
+<p>Instrumented tests are built into an APK that runs on the device alongside
+your app under test. The system runs your test APK and your app under tests in
+the same process, so your tests can invoke methods and modify fields in the
+app, and automate user interaction with your app.</p>
+
+<p>For information about how to create instrumented tests, see the
+following topics:</p>
 
 <ul>
   <li>
     <a href=
-    "{@docRoot}training/testing/unit-testing/instrumented-unit-tests.html">Building
-    Instrumented Unit Tests</a> - Build more complex unit tests that have
-    Android dependencies which cannot be easily filled by using mock objects.
+    "{@docRoot}training/testing/unit-testing/instrumented-unit-tests.html"
+    >Building Instrumented Unit Tests</a>: Build complex unit tests with
+    Android dependencies that cannot be satisfied with mock objects.
   </li>
 
   <li>
     <a href="{@docRoot}training/testing/ui-testing/index.html">Automating User
-    Interface Tests</a> - Create tests to verify that the user interface
+    Interface Tests</a>: Create tests to verify that the user interface
     behaves correctly for user interactions within a single app or for
     interactions across multiple apps.
   </li>
 
   <li>
     <a href="{@docRoot}training/testing/integration-testing/index.html">Testing
-    App Component Integrations</a> - Verify the behavior of components that
+    App Component Integrations</a>: Verify the behavior of components that
     users do not directly interact with, such as a <a href=
     "{@docRoot}guide/components/services.html">Service</a> or a <a href=
-    "guide/topics/providers/content-providers.html">Content Provider</a>.
+    "{@docRoot}guide/topics/providers/content-providers.html">Content Provider</a>.
   </li>
 </ul>
 
-<p>
-  This lesson teaches you how to build and run your tests using using Android
-  Studio. If you are not using Android Studio, you can learn how to
-  <a href="{@docRoot}tools/testing/testing_otheride.html">run your tests from
-  the command-line</a>.
-</p>
+</dd>
+</dl>
 
-<h3 id="config-local-tests">
-  Configure Your Project for Local Unit Tests
-</h3>
+<img src="/images/testing/test-types_2x.png" alt="" width="798" />
 
-<p>
-  In your Android Studio project, you must store the source files for local
-  unit tests under a specific source directory ({@code src/test/java}). This
-  improves project organization by grouping your unit tests together into a
-  single source set.
-</p>
-
-<p>
-  As with production code, you can create local unit tests for a <a href=
-  "{@docRoot}tools/building/configuring-gradle.html#workBuildVariants">specific
-  flavor or build type</a>. Keep your unit tests in a test source tree location
-  that corresponds to your production source tree, such as:
-</p>
+<p>However, the <em>local unit tests</em> and <em>instrumented tests</em>
+described above are just terms that help distinguish the tests that run on your
+local JVM from the tests that run on the Android platform (on a hardware device
+or emulator). The real testing types that you should understand when building a
+complete test suite are described in the following table.</p>
 
 <table>
-<tr>
-<th>Path to Production Class</th>
-<th>Path to Local Unit Test Class</th>
-</tr>
-<tr>
-<td>{@code src/main/java/Foo.java}</td>
-<td>{@code src/test/java/FooTest.java}</td>
-</tr>
-<tr>
-<td>{@code src/debug/java/Foo.java}</td>
-<td>{@code src/testDebug/java/FooTest.java}</td>
-</tr>
-<tr>
-<td>{@code src/myFlavor/java/Foo.java}</td>
-<td>{@code src/testMyFlavor/java/FooTest.java}</td>
-</tr>
+  <tr>
+    <th>
+      Type
+    </th>
+    <th>
+      Subtype
+    </th>
+    <th>
+      Description
+    </th>
+  </tr>
+
+  <tr>
+    <td rowspan="3">
+      Unit tests
+    </td>
+  </tr>
+
+  <tr>
+    <td>
+      Local Unit Tests
+    </td>
+    <td>
+      Unit tests that run locally on the Java Virtual Machine (JVM). Use these
+tests to minimize execution time when your tests have no Android framework
+dependencies or when you can mock the Android framework dependencies.
+    </td>
+  </tr>
+
+  <tr>
+    <td>
+      Instrumented unit tests
+    </td>
+    <td>
+      Unit tests that run on an Android device or emulator. These tests have
+access to <code><a href=
+"/reference/android/app/Instrumentation.html">Instrumentation</a></code>
+information, such as the <code><a href=
+"/reference/android/content/Context.html">Context</a></code> of the app you are
+testing. Use these tests when your tests have Android dependencies that mock
+objects cannot satisfy.
+    </td>
+  </tr>
+
+  <tr>
+    <td style="white-space:nowrap" rowspan="3">
+      Integration Tests
+    </td>
+  </tr>
+
+  <tr>
+    <td>
+      Components within your app only
+    </td>
+    <td>
+      This type of test verifies that the target app behaves as expected when
+a user performs a specific action or enters a specific input in its activities.
+For example, it allows you to check that the target app returns the correct UI
+output in response to user interactions in the app’s activities. UI testing
+frameworks like <a href=
+      "/tools/testing-support-library/index.html#Espresso">Espresso</a> allow
+you to programmatically simulate user actions and test complex intra-app user
+interactions.
+    </td>
+  </tr>
+
+  <tr>
+    <td>
+      Cross-app Components
+    </td>
+    <td>
+      This type of test verifies the correct behavior of interactions between
+different user apps or between user apps and system apps. For example, you might
+want to test that your app behaves correctly when the user performs an action
+in the Android Settings menu. UI testing frameworks that support cross-app
+interactions, such as <a
+href="/topic/libraries/testing-support-library/index.html#UIAutomator"
+>UI Automator</a>, allow you to create tests for such scenarios.
+    </td>
+  </tr>
 </table>
 
-<p>
-  You'll need to configure the testing dependencies for your project to use the
-  standard APIs provided by the JUnit 4 framework. If your test needs to
-  interact with Android dependencies, include the <a href=
-  "https://github.com/mockito/mockito" class="external-link">Mockito</a>
-  library to simplify your local unit tests. To learn more about using mock
-  objects in your local unit tests, see <a href=
-  "{@docRoot}training/testing/unit-testing/local-unit-tests.html#mocking-dependencies">
-  Mocking Android dependencies</a>.
-</p>
 
-<p>
-  In your app's top-level {@code build.gradle} file, you need to specify these
-  libraries as dependencies:
-</p>
+
+
+
+
+<h2 id="test-apis">Test APIs</h2>
+
+<p>The following are common APIs used for testing apps on Android.</p>
+
+
+<h3 id="junit">JUnit</h3>
+
+<p>You should write your unit or integration test class as a <a href=
+"http://junit.org/" class="external-link">JUnit 4</a> test class. The framework
+offers a convenient way to perform common setup, teardown, and assertion
+operations in your test.</p>
+
+<p>A basic JUnit 4 test class is a Java class that contains one or more test
+methods. A test method begins with the <code>@Test</code> annotation and
+contains the code to exercise and verify a single functionality (that is, a
+logical unit) in the component that you want to test.</p>
+
+<p>The following snippet shows an example JUnit 4 integration test that uses the
+<a href="/topic/libraries/testing-support-library/index.html#Espresso">Espresso
+APIs</a> to perform a click action on a UI element, then checks to see if
+an expected string is displayed.</p>
 
 <pre>
-dependencies {
-    // Required -- JUnit 4 framework
-    testCompile 'junit:junit:4.12'
-    // Optional -- Mockito framework
-    testCompile 'org.mockito:mockito-core:1.10.19'
-}
-</pre>
+&#64;RunWith(AndroidJUnit4.class)
+&#64;LargeTest
+public class MainActivityInstrumentationTest {
 
-<h3 id="config-instrumented-tests">
-  Configure Your Project for Instrumented Tests
-</h3>
+    &#64;Rule
+    public ActivityTestRule mActivityRule = new ActivityTestRule<>(
+            MainActivity.class);
 
-<p>
-  In your Android Studio project, you must place the source code for your
-  instrumentated tests under a specific directory
-  (<code>src/androidTest/java</code>).
-</p>
+    &#64;Test
+    public void sayHello(){
+        onView(withText("Say hello!")).perform(click());
 
-<p>
-  <a href="{@docRoot}tools/testing-support-library/index.html#setup">Download
-  the Android Testing Support Library Setup</a>, which provides APIs that allow
-  you to quickly build and run instrumented test code for your apps. The
-  Testing Support Library includes a JUnit 4 test runner (<a href=
-  "{@docRoot}tools/testing-support-library/index.html#AndroidJUnitRunner">AndroidJUnitRunner</a>
-  ) and APIs for functional UI tests (<a href=
-  "{@docRoot}tools/testing-support-library/index.html#Espresso">Espresso</a>
-  and <a href=
-  "{@docRoot}tools/testing-support-library/index.html#UIAutomator">UI
-  Automator</a>).
-</p>
-
-<p>
-  You'll need to configure the Android testing dependencies for your project to
-  use the test runner and the rules APIs provided by the Testing Support
-  Library. To simplify your test development, we also recommend that you
-  include the <a href="https://github.com/hamcrest" class=
-  "external-link">Hamcrest</a> library, which lets you create more flexible
-  assertions using the Hamcrest matcher APIs.
-</p>
-
-<p>
-  In your app's top-level {@code build.gradle} file, you need to specify these
-  libraries as dependencies:
-</p>
-
-<pre>
-dependencies {
-    androidTestCompile 'com.android.support:support-annotations:23.0.1'
-    androidTestCompile 'com.android.support.test:runner:0.4.1'
-    androidTestCompile 'com.android.support.test:rules:0.4.1'
-    // Optional -- Hamcrest library
-    androidTestCompile 'org.hamcrest:hamcrest-library:1.3'
-    // Optional -- UI testing with Espresso
-    androidTestCompile 'com.android.support.test.espresso:espresso-core:2.2.1'
-    // Optional -- UI testing with UI Automator
-    androidTestCompile 'com.android.support.test.uiautomator:uiautomator-v18:2.1.1'
-}
-</pre>
-
-
-<p>
-  To use JUnit 4 test classes, make sure to specify <a href=
-  "{@docRoot}reference/android/support/test/runner/AndroidJUnitRunner.html">{@code
-  AndroidJUnitRunner}</a> as the default test instrumentation runner in your
-  project by including the following setting in your app's module-level {@code build.gradle}
-  file:
-</p>
-
-<pre>
-android {
-    defaultConfig {
-        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
+        onView(withId(R.id.textView)).check(matches(withText("Hello, World!")));
     }
 }
 </pre>
 
-<h3 id="testartifacts">Work With Test Artifacts</h3>
-<p>Android Studio has two types of test artifacts: Android Instrumentation Tests
-and Unit Tests. Previously, you could work with just one test artifact at a
-time. Now, both test artifacts are enabled.
-The advantage of enabling both test artifacts is that any changes you make to
-the underlying code affect
-them both. For example, if you rename a class that both test artifacts access,
-both will know about the class name refactoring.</p>
-
-<p>The figure shows what your project looks like with both test
-artifacts enabled. Notice the shading of both test artifacts.</p>
-
-<!-- Commenting out for now, but leaving it in case we need to add it back.
-<img src="{@docRoot}images/training/testartifactseparate.png" style="float:left;width:250px;margin-right:20px" /> -->
-<img src="{@docRoot}images/training/testartifactcombined.png" style="float:left;width:250px" />
-<!-- Commenting out for now, but leaving it in case we need to add it back.
-<p>
-By default, both test artifacts are enabled in Android Studio. To enable just
-one, deselect <strong>Enable all test artifacts</strong> in your preferences:
-</p>
-
-<ol>
-<li>Select
-<strong>Android Studio</strong> > <strong>Preferences</strong> > <strong>Build,
-Execution, Deployment</strong> > <strong>Build Tools</strong> >
-<strong>Gradle</strong> > <strong>Experimental</strong>.</li>
-<li>Deselect the test artifacts option.</li>
-<li>Click <strong>OK</strong>.</li>
-</ol>
--->
-
-<h2 id="build">Build and Run Your Tests</h2>
-
-
-<p>
-  Android Studio provides all the tools you need to build, run, and analyze
-  your tests within the development environment. You can also run instrumented
-  tests on multiple device configurations, simultaneously, using <a href=
-  "https://developers.google.com/cloud-test-lab/">Cloud Test Lab</a>
-  integration.
-</p>
-
-<p class="note">
-  <strong>Note:</strong> While running or debugging instrumented tests,
-  Android Studio does not inject the additional methods required for <a href=
-  "{@docRoot}tools/building/building-studio.html#instant-run">Instant Run</a>
-  and turns the feature off.
-</p>
-
-<h3 id="run-local-tests">
-  Run Local Unit Tests
-</h3>
-
-<p>
-  To run your local unit tests:
-</p>
-
-<ol>
-
-  <li>In the <em>Project</em> window, right click on the project and
-  synchronize your project.
-  </li>
-
-  <!--
-<li>If you enabled one test artifact only, open the
-<strong>Build Variants</strong> window by clicking the left-hand tab, then
-change the test artifact to <em>Unit Tests</em>.
-</li>
--->
-
-  <li>In the <em>Project</em> window, navigate to your unit test class or
-  method, then right-click it and select <strong>Run</strong> <img src=
-  "{@docRoot}images/tools/as-run.png" alt="" style=
-  "vertical-align:bottom;margin:0;">.
-    <ul>
-      <li>To run all tests in the unit test directory, right-click on the
-      directory and select <strong>Run tests</strong> <img src=
-      "{@docRoot}images/tools/as-run.png" alt="" style=
-      "vertical-align:bottom;margin:0;">.
-      </li>
-    </ul>
-  </li>
-
-</ol>
-
-<p>
-  The Android Plugin for Gradle compiles the local unit test code located in
-  the default directory ({@code src/test/java}), builds a test app, and
-  executes it locally using the default test runner class. Android Studio then
-  displays the results in the <em>Run</em> window.
-</p>
-
-<h3 id="run-instrumented-tests">
-  Run Instrumented Tests
-</h3>
-
-<p>
-  To run your instrumented tests:
-</p>
+<p>In your JUnit 4 test class, you can call out sections in your test code for
+special processing by using the following annotations:</p>
 
 <ul>
-  <!--
-<li>If you enabled one test artifact only, open the
-<strong>Build Variants</strong> window by clicking the left-hand tab, then set
-the test artifact to <em>Android Instrumentation Tests</em>.
-</li>
--->
+<li><code>@Before</code>: Use this annotation to specify a block of code that
+contains test setup operations. The test class invokes this code block before
+each test. You can have multiple <code>@Before</code> methods but the order in
+which the test class calls these methods is not guaranteed.</li>
 
-  <li>In the <em>Project</em> window, navigate to your instrumented test class
-  or method, then right-click and run it using the Android Test configuration.
-  To run all tests in the instrumented test directory, right-click the
-  directory and select <strong>Run tests</strong> <img src=
-  "{@docRoot}images/tools/as-run.png" alt="" style=
-  "vertical-align:bottom;margin:0;">.
-  </li>
+<li><code>@After</code>: This annotation specifies a block of code that
+contains test tear-down operations. The test class calls this code block after
+every test method. You can define multiple <code>@After</code> operations in
+your test code. Use this annotation to release any resources from memory.</li>
+
+<li><code>@Test</code>: Use this annotation to mark a test method. A single
+test class can contain multiple test methods, each prefixed with this
+annotation.</li>
+
+<li><code>@Rule</code>: Rules allow you to flexibly add or redefine the
+behavior of each test method in a reusable way. In Android testing, use this
+annotation together with one of the test rule classes that the Android Testing
+Support Library provides, such as <a href=
+"/reference/android/support/test/rule/ActivityTestRule.html"><code>ActivityTestRule</code></a>
+or <a href=
+"/reference/android/support/test/rule/ServiceTestRule.html"><code>ServiceTestRule</code></a>.</li>
+
+<li><code>@BeforeClass</code>: Use this annotation to specify static methods
+for each test class to invoke only once. This testing step is useful for
+expensive operations such as connecting to a database.</li>
+
+<li><code>@AfterClass</code>: Use this annotation to specify static methods for
+the test class to invoke only after all tests in the class have run. This
+testing step is useful for releasing any resources allocated in the
+<code>@BeforeClass</code> block.</li>
+
+<li><code>@Test(timeout=)</code>: Some annotations support the ability to pass
+in elements for which you can set values. For example, you can specify a
+timeout period for the test. If the test starts but does not complete within
+the given timeout period, it automatically fails. You must specify the timeout
+period in milliseconds, for example: <code>@Test(timeout=5000)</code>.</li>
 </ul>
 
-<p>
-  The <a href="{@docRoot}tools/building/plugin-for-gradle.html">Android Plugin
-  for Gradle</a> compiles the instrumented test code located in the default
-  directory ({@code src/androidTest/java}), builds a test APK and production
-  APK, installs both APKs on the connected device or emulator, and runs the
-  tests. Android Studio then displays the results of the instrumented test execution in the
-  <em>Run</em> window.
+<p>For more annotations, see the documentation for <a
+href="http://junit.sourceforge.net/javadoc/org/junit/package-summary.html"
+class="external-link">JUnit annotations</a> and the <a
+href="/reference/android/support/annotation/package-summary.html">Android
+annotations</a>.</p>
+
+<p>Use the JUnit <code><a href=
+"/reference/junit/framework/Assert.html">Assert</a></code> class to verify the
+correctness of an object's state. The assert methods compare values you expect
+from a test to the actual results and throw an exception if the comparison
+fails. <a href="#AssertionClasses">Assertion classes</a> describes these
+methods in more detail.</p>
+
+
+<h3 id="support-library">Android Testing Support Library</h3>
+
+<p>The <a href="/topic/libraries/testing-support-library/index.html">Android
+Testing Support Library</a> provides a set of APIs that allow you
+to quickly build and run test code for your apps, including JUnit 4 and
+functional UI tests. The library includes the following instrumentation-based
+APIs that are useful when you want to automate your tests:</p>
+
+<dt><a href="/topic/libraries/testing-support-library/index.html#AndroidJUnitRunner"
+>AndroidJUnitRunner</a></dt>
+<dd>A JUnit 4-compatible test runner for Android.</dd>
+
+<dt><a href="/topic/libraries/testing-support-library/index.html#Espresso"
+>Espresso</a></dt>
+<dd>A UI testing framework; suitable for functional UI testing within an
+app.</dd>
+
+<dt><a href="/topic/libraries/testing-support-library/index.html#UIAutomator"
+>UI Automator</a></dt>
+<dd>A UI testing framework suitable for cross-app functional UI testing between
+both system and installed apps.</dd>
+
+
+<h3 id="assertion">Assertion classes</h3>
+
+<p>Because Android Testing Support Library APIs extend JUnit, you can use
+assertion methods to display the results of tests. An assertion method compares
+an actual value returned by a test to an expected value, and throws an
+AssertionException if the comparison test fails. Using assertions is more
+convenient than logging, and provides better test performance.</p>
+
+<p>To simplify test development, you should use the <a href=
+"https://github.com/hamcrest" class="external-link">Hamcrest library</a>, which
+lets you create more flexible tests using the Hamcrest matcher APIs.</p>
+
+
+
+<h3 id="monkeyrunner">Monkey and monkeyrunner</h3>
+
+<p>The Android SDK includes two tools for functional-level app testing:</p>
+
+<dl>
+<dt>Monkey</dt>
+<dd>This is a command-line tool that sends pseudo-random streams of keystrokes,
+touches, and gestures to a device. You run it with the <a href=
+"/studio/command-line/adb.html">Android Debug Bridge (adb)</a> tool, and use it
+to stress-test your app, report back errors any that are encountered, or repeat
+a stream of events by running the tool multiple times with the same random
+number seed.</dd>
+
+
+<dt>monkeyrunner</dt>
+<dd>This tool is an API and execution environment for test programs written in
+Python. The API includes functions for connecting to a device, installing and
+uninstalling packages, taking screenshots, comparing two images, and running a
+test package against an app. Using the API, you can write a wide range of
+large, powerful, and complex tests. You run programs that use the API with the
+<code>monkeyrunner</code> command-line tool.</dd>
+</dl>
+
+
+
+
+<h2 id="build">Guides for Building Android Tests</h2>
+
+<p>The following documents provide more detail about how to build and run
+a variety of test types:
 </p>
 
-<h3 id="run-ctl">Run Instrumented Tests with Cloud Test Lab</h3>
-
-<p>
-  Using <a href="https://developers.google.com/cloud-test-lab/">Cloud Test
-  Lab</a>, you can simultaneously test your app on many popular Android
-  devices, across multiple languages, screen orientations, and versions of the
-  Android platform. These tests run on actual physical devices in remote Google
-  data centers. You can also <a href=
-  "https://developers.google.com/cloud-test-lab/test-screenshots">configure
-  your instrumented tests to take screenshots</a> while Cloud Test Lab runs its
-  tests. You can <a href=
-  "https://developers.google.com/cloud-test-lab/command-line">deploy tests to
-  Cloud Test Lab from the command line</a>, or from Android Studio's integrated
-  testing tools.
-</p>
-
-<p>
-  Android Studio allows you to connect to your Google Cloud Platform account,
-  configure your tests, deploy them to Cloud Test Lab, and analyze the results
-  all within the development environment. Cloud Test Lab in Android Studio
-  supports the following Android test frameworks: <a href=
-  "{@docRoot}training/testing/ui-testing/espresso-testing.html">Espresso</a>,
-  <a href="{@docRoot}tools/testing-support-library/index.html#UIAutomator">UI
-  Automator 2.0</a>, or <a class="external-link" href=
-  "https://github.com/robotiumtech/robotium">Robotium</a>. Test results provide
-  test logs and include the details of any app failures.
-</p>
-
-<p>
-  Before you can start using Cloud Test Lab, you need to:
-</p>
-
-<ol>
-  <li>
-    <a href="https://console.developers.google.com/freetrial">Create a
-    Google Cloud Platform account</a> to use with active billing.
-  </li>
-
-  <li>
-    <a href="https://support.google.com/cloud/answer/6251787">Create a Google
-    Cloud project</a> for your app.
-  </li>
-
-  <li>
-    <a href="https://support.google.com/cloud/answer/6288653">Set up an active
-    billing account</a> and associate it with the project you just created.
-  </li>
-</ol>
-
-
-<h4 id="configure-matrix">
-Configure a test matrix and run a test
-</h4>
-
-<p>
-  Android Studio provides integrated tools that allow you to configure how you
-  want to deploy your tests to Cloud Test Lab. After you have created a Google
-  Cloud project with active billing, you can create a test configuration and
-  run your tests:
-</p>
-
-<ol>
-  <li>Click <strong>Run</strong> &gt; <strong>Edit Configurations</strong> from
-  the main menu.
-  </li>
-
-  <li>Click <strong>Add New Configuration (+)</strong> and select
-  <strong>Android Tests</strong>.
-  </li>
-
-  <li>In the Android Test configuration dialog:
-    <ol type="a">
-      <li>Enter or select the details of your test, such as the test name, module
-      type, test type, and test class.
-      </li>
-
-      <li>From the <em>Target</em> drop-down menu under <em>Deployment Target
-      Options</em>, select <strong>Cloud Test Lab Device Matrix</strong>.
-      </li>
-
-      <li>If you are not logged in, click <strong>Connect to Google Cloud
-      Platform</strong> and allow Android Studio access to your account.
-      </li>
-
-      <li>Next to <em>Cloud Project</em>, click the <img src=
-      "{@docRoot}images/tools/as-wrench.png" alt="wrench and nut" style=
-      "vertical-align:bottom;margin:0;"> button and select your Google Cloud
-      Platform project from the list.
-      </li>
-    </ol>
-  </li>
-
-  <li>Create and configure a test matrix:
-    <ol type="a">
-      <li>Next to the <em>Matrix Configuration</em> drop-down list, click <strong>
-        Open Dialog</strong> <img src="{@docRoot}images/tools/as-launchavdm.png"
-        alt="ellipses button" style="vertical-align:bottom;margin:0;">.
-      </li>
-
-      <li>Click <strong>Add New Configuration (+)</strong>.
-      </li>
-
-      <li>In the <strong>Name</strong> field, enter a name for your new
-      configuration.
-      </li>
-
-      <li>Select the device(s), Android version(s), locale(s) and screen
-      orientation(s) that you want to test your app with. Cloud Test Lab will test
-      your app against every combination of your selections when generating test
-      results.
-      </li>
-
-      <li>Click <strong>OK</strong> to save your configuration.
-      </li>
-    </ol>
-  </li>
-
-  <li>Click <strong>OK</strong> in the <em>Run/Debug Configurations</em> dialog
-  to exit.
-  </li>
-
-  <li>Run your tests by clicking <strong>Run</strong> <img src=
-  "{@docRoot}images/tools/as-run.png" alt="" style=
-  "vertical-align:bottom;margin:0;">.
-  </li>
-</ol>
-
-<img src="{@docRoot}images/training/ctl-config.png" alt="">
-<p class="img-caption">
-  <strong>Figure 1.</strong> Creating a test configuration for Cloud Test
-  Lab.
-</p>
-
-<h4 id="ctl-results">
-  Analyzing test results
-</h4>
-
-<p>
-  When Cloud Test Lab completes running your tests, the <em>Run</em> window will
-  open to show the results, as shown in figure 2. You may need to click
-  <strong>Show Passed</strong> <img src="{@docRoot}images/tools/as-ok.png" alt=
-  "" style="vertical-align:bottom;margin:0;"> to see all your executed tests.
-</p>
-
-<img src="{@docRoot}images/training/ctl-test-results.png" alt="">
-
-<p class="img-caption">
-  <strong>Figure 2.</strong> Viewing the results of instrumented tests using
-  Cloud Test Lab.
-</p>
-
-<p>
-  You can also analyze your tests on the web by following the link displayed at
-  the beginning of the test execution log in the <em>Run</em> window, as shown
-  in figure 3.
-</p>
-
-<img src="{@docRoot}images/training/ctl-exec-log.png" alt="">
-
-<p class="img-caption">
-  <strong>Figure 3.</strong> Click the link to view detailed test results on
-  the web.
-</p>
-
-<p>
-  To learn more about interpreting web results, see <a href=
-  "https://developers.google.com/cloud-test-lab/analyzing-results">Analyzing
-  Cloud Test Lab Web Results</a>.
-</p>
\ No newline at end of file
+<dl>
+  <dt><a href="/training/testing/unit-testing/local-unit-tests.html"
+    >Building Local Unit Tests</a></dt>
+  <dd>Build unit tests that have no dependencies or only simple dependencies
+    that you can mock, which run on your local JVM.</dd>
+  <dt><a href=
+    "/training/testing/unit-testing/instrumented-unit-tests.html"
+    >Building Instrumented Unit Tests</a></dt>
+  <dd>Build complex unit tests with
+    Android dependencies that cannot be satisfied with mock objects,
+    which run on a hardware device or emulator.</dd>
+  <dt><a href="/training/testing/ui-testing/index.html">Automating User
+    Interface Tests</a></dt>
+  <dd>Create tests to verify that the user interface
+    behaves correctly for user interactions within a single app or for
+    interactions across multiple apps.</dd>
+  <dt><a href="/training/testing/integration-testing/index.html">Testing App
+    Compontent Integrations</a></dt>
+  <dd>Verify the behavior of components that
+    users do not directly interact with, such as a service or a content
+    provider.</dd>
+  <dt><a href="/training/testing/performance.html">Testing Display
+    Performance</a></dt>
+  <dd>Write tests that measure your app's UI performance to ensure
+    a consistently smooth user experience.</dd>
+</dl>
\ No newline at end of file
diff --git a/docs/html/training/testing/unit-testing/instrumented-unit-tests.jd b/docs/html/training/testing/unit-testing/instrumented-unit-tests.jd
index 38321ee..f65766d 100644
--- a/docs/html/training/testing/unit-testing/instrumented-unit-tests.jd
+++ b/docs/html/training/testing/unit-testing/instrumented-unit-tests.jd
@@ -7,21 +7,20 @@
 <!-- This is the training bar -->
 <div id="tb-wrapper">
 <div id="tb">
-  <h2>Dependencies and Prerequisites</h2>
-
-  <ul>
-    <li>Android 2.2 (API level 8) or higher</li>
-    <li><a href="{@docRoot}tools/testing-support-library/index.html">
-      Android Testing Support Library</a></li>
-    <li><a href="{@docRoot}tools/studio/index.html">Android Studio (latest version)</a>.</li>
-  </ul>
-
   <h2>This lesson teaches you to</h2>
 
   <ol>
     <li><a href="#setup">Set Up Your Testing Environment</a></li>
-    <li><a href="#build">Create a Instrumented Unit Test Class</a></li>
-    <li><a href="#run">Run Instrumented Unit Tests</a></li>
+    <li><a href="#build">Create a Instrumented Unit Test Class</a>
+      <ol>
+        <li><a href="#test-suites">Create a test suite</a></li>
+      </ol>
+    </li>
+    <li><a href="#run">Run Instrumented Unit Tests</a>
+      <ol>
+        <li><a href="#run-ctl">Run your tests with Firebase Test Lab</a></li>
+      </ol>
+    </li>
   </ol>
 
   <h2>Try it out</h2>
@@ -36,25 +35,88 @@
 </div>
 </div>
 
-<p>
-Instrumented unit tests are unit tests that run on physical devices and emulators, instead of
-the Java Virtual Machine (JVM) on your local machine. You should create instrumented unit tests
-if your tests need access to instrumentation information (such as the target app's
-{@link android.content.Context}) or if they require the real implementation of an Android framework
-component (such as a {@link android.os.Parcelable} or {@link android.content.SharedPreferences}
-object). Using instrumented unit tests also helps to reduce the effort required to write and
-maintain mock code. You are still free to use a mocking framework, if you choose, to simulate any
-dependency relationships. Instrumented unit tests can take advantage of the Android framework APIs
-and supporting APIs, such as the Android Testing Support Library.
-</p>
+<p>Instrumented unit tests are tests that run on physical devices and
+emulators, and they can take advantage of the Android framework APIs and
+supporting APIs, such as the Android Testing Support Library. You should create
+instrumented unit tests if your tests need access to instrumentation
+information (such as the target app's {@link android.content.Context}) or if
+they require the real implementation of an Android framework component (such as
+a {@link android.os.Parcelable} or {@link android.content.SharedPreferences}
+object).</p>
+
+<p>Using instrumented unit tests also helps to reduce the effort required to
+write and maintain mock code. You are still free to use a mocking framework, if
+you choose, to simulate any dependency relationships.</p>
+
 
 <h2 id="setup">Set Up Your Testing Environment</h2>
-<p>Before building your instrumented unit test, make sure to configure your test source code
-location and project dependencies, as described in
-<a href="{@docRoot}training/testing/start/index.html#config-instrumented-tests">
-Getting Started with Testing</a>.</p>
+
+<p>In your Android Studio project, you must store the source files for
+instrumented tests at
+<code><var>module-name</var>/src/androidTests/java/</code>. This directory
+already exists when you create a new project.</p>
+
+<p>Before you begin, you should
+  <a href="{@docRoot}tools/testing-support-library/index.html#setup">download
+  the Android Testing Support Library Setup</a>, which provides APIs that allow
+  you to quickly build and run instrumented test code for your apps. The
+  Testing Support Library includes a JUnit 4 test runner (<a href=
+  "{@docRoot}tools/testing-support-library/index.html#AndroidJUnitRunner">AndroidJUnitRunner</a>
+  ) and APIs for functional UI tests (<a href=
+  "{@docRoot}tools/testing-support-library/index.html#Espresso">Espresso</a>
+  and <a href=
+  "{@docRoot}tools/testing-support-library/index.html#UIAutomator">UI
+  Automator</a>).
+</p>
+
+<p>You also need to configure the Android testing dependencies for your project
+to use the test runner and the rules APIs provided by the Testing Support
+Library. To simplify your test development, you should also include the
+<a href="https://github.com/hamcrest" class="external-link">Hamcrest</a>
+library, which lets you create more flexible assertions using the Hamcrest
+matcher APIs.</p>
+
+<p>
+  In your app's top-level {@code build.gradle} file, you need to specify these
+  libraries as dependencies:
+</p>
+
+<pre>
+dependencies {
+    androidTestCompile 'com.android.support:support-annotations:24.0.0'
+    androidTestCompile 'com.android.support.test:runner:0.5'
+    androidTestCompile 'com.android.support.test:rules:0.5'
+    // Optional -- Hamcrest library
+    androidTestCompile 'org.hamcrest:hamcrest-library:1.3'
+    // Optional -- UI testing with Espresso
+    androidTestCompile 'com.android.support.test.espresso:espresso-core:2.2.2'
+    // Optional -- UI testing with UI Automator
+    androidTestCompile 'com.android.support.test.uiautomator:uiautomator-v18:2.1.2'
+}
+</pre>
+
+
+<p>
+  To use JUnit 4 test classes, make sure to specify <a href=
+  "{@docRoot}reference/android/support/test/runner/AndroidJUnitRunner.html">{@code
+  AndroidJUnitRunner}</a> as the default test instrumentation runner in your
+  project by including the following setting in your app's module-level {@code build.gradle}
+  file:
+</p>
+
+<pre>
+android {
+    defaultConfig {
+        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
+    }
+}
+</pre>
+
+
+
 
 <h2 id="build">Create an Instrumented Unit Test Class</h2>
+
 <p>
 Your instrumented unit test class should be written as a JUnit 4 test class. To learn more about
 creating JUnit 4 test classes and using JUnit 4 assertions and annotations, see
@@ -119,7 +181,7 @@
 }
 </pre>
 
-<h3 id="test-suites">Creating a test suite</h3>
+<h3 id="test-suites">Create a test suite</h3>
 <p>
 To organize the execution of your instrumented unit tests, you can group a collection of test
 classes in a <em>test suite</em> class and run these tests together. Test suites can be nested;
@@ -162,9 +224,198 @@
 public class UnitTestSuite {}
 </pre>
 
+
 <h2 id="run">Run Instrumented Unit Tests</h2>
+
+<p>To run your instrumented tests, follow these steps:</p>
+
+<ol>
+  <li>Be sure your project is synchronized with Gradle by clicking
+  <b>Sync Project</b> <img src="/images/tools/sync-project.png" alt=""
+  class="inline-icon"> in the toolbar.</li>
+
+  <li>Run your test in one of the following ways:
+    <ul>
+      <li>To run a single test, open the <b>Project</b> window, and then
+  right-click a test and click <strong>Run</strong> <img src=
+  "{@docRoot}images/tools/as-run.png" alt="" class="inline-icon">.</li>
+      <li>To test all methods in a class, right-click a class or method in the
+test file and click <b>Run</b> <img src=
+  "{@docRoot}images/tools/as-run.png" alt="" class="inline-icon">.
+      <li>To run all tests in a directory, right-click on the
+      directory and select <strong>Run tests</strong> <img src=
+      "{@docRoot}images/tools/as-run.png" alt="" class="inline-icon">.
+      </li>
+    </ul>
+  </li>
+
+</ol>
+
 <p>
-To run your test, follow the steps for running instrumented tests
-described in <a href="{@docRoot}training/testing/start/index.html#run-instrumented-tests">
-Getting Started with Testing</a>.
+  The <a href="{@docRoot}tools/building/plugin-for-gradle.html">Android Plugin
+  for Gradle</a> compiles the instrumented test code located in the default
+  directory ({@code src/androidTest/java/}), builds a test APK and production
+  APK, installs both APKs on the connected device or emulator, and runs the
+  tests. Android Studio then displays the results of the instrumented test execution in the
+  <em>Run</em> window.
+</p>
+
+<p class="note">
+  <strong>Note:</strong> While running or debugging instrumented tests,
+  Android Studio does not inject the additional methods required for <a href=
+  "{@docRoot}tools/building/building-studio.html#instant-run">Instant Run</a>
+  and turns the feature off.
+</p>
+
+
+<h3 id="run-ctl">Run your tests with Firebase Test Lab</h3>
+
+<p>Using <a href="https://firebase.google.com/docs/test-lab/">Firebase Test
+Lab</a>, you can simultaneously test your app on many popular Android devices
+and configurations such as locale, orientation, screen size, and platform
+version. These tests run on actual physical devices in remote Google data
+centers. You can deploy to Firebase Test Lab directly from Android Studio or
+from the command line. Test results provide test logs and include the details
+of any app failures.</p>
+
+<p>
+  Before you can start using Firebase Test Lab, you need to:
+</p>
+
+<ol>
+  <li>
+    <a href="https://console.developers.google.com/freetrial">Create a
+    Google Cloud Platform account</a> to use with active billing.
+  </li>
+
+  <li>
+    <a href="https://support.google.com/cloud/answer/6251787">Create a Google
+    Cloud project</a> for your app.
+  </li>
+
+  <li>
+    <a href="https://support.google.com/cloud/answer/6288653">Set up an active
+    billing account</a> and associate it with the project you just created.
+  </li>
+</ol>
+
+
+<h4 id="configure-matrix">
+Configure a test matrix and run a test
+</h4>
+
+<p>
+  Android Studio provides integrated tools that allow you to configure how you
+ want to deploy your tests to Firebase Test Lab. After you have created a Google
+  Cloud project with active billing, you can create a test configuration and
+  run your tests:
+</p>
+
+<ol>
+  <li>Click <strong>Run</strong> &gt; <strong>Edit Configurations</strong> from
+  the main menu.
+  </li>
+
+  <li>Click <strong>Add New Configuration (+)</strong> and select
+  <strong>Android Tests</strong>.
+  </li>
+
+  <li>In the Android Test configuration dialog:
+    <ol type="a">
+      <li>Enter or select the details of your test, such as the test name, module
+      type, test type, and test class.
+      </li>
+
+      <li>From the <em>Target</em> drop-down menu under <em>Deployment Target
+      Options</em>, select <strong>Cloud Test Lab Device Matrix</strong>.
+      </li>
+
+      <li>If you are not logged in, click <strong>Connect to Google Cloud
+      Platform</strong> and allow Android Studio access to your account.
+      </li>
+
+      <li>Next to <em>Cloud Project</em>, click the <img src=
+      "{@docRoot}images/tools/as-wrench.png" alt="wrench and nut" style=
+      "vertical-align:bottom;margin:0;"> button and select your Google Cloud
+      Platform project from the list.
+      </li>
+    </ol>
+  </li>
+
+  <li>Create and configure a test matrix:
+    <ol type="a">
+      <li>Next to the <em>Matrix Configuration</em> drop-down list, click <strong>
+        Open Dialog</strong> <img src="{@docRoot}images/tools/as-launchavdm.png"
+        alt="ellipses button" style="vertical-align:bottom;margin:0;">.
+      </li>
+
+      <li>Click <strong>Add New Configuration (+)</strong>.
+      </li>
+
+      <li>In the <strong>Name</strong> field, enter a name for your new
+      configuration.
+      </li>
+
+      <li>Select the device(s), Android version(s), locale(s) and screen
+      orientation(s) that you want to test your app with. Firebase Test Lab will
+      test your app against every combination of your selections when generating
+      test results.
+      </li>
+
+      <li>Click <strong>OK</strong> to save your configuration.
+      </li>
+    </ol>
+  </li>
+
+  <li>Click <strong>OK</strong> in the <em>Run/Debug Configurations</em> dialog
+  to exit.
+  </li>
+
+  <li>Run your tests by clicking <strong>Run</strong> <img src=
+  "{@docRoot}images/tools/as-run.png" alt="" style=
+  "vertical-align:bottom;margin:0;">.
+  </li>
+</ol>
+
+<img src="{@docRoot}images/training/ctl-config.png" alt="">
+<p class="img-caption">
+  <strong>Figure 1.</strong> Creating a test configuration for Firebase Test
+  Lab.
+</p>
+
+<h4 id="ctl-results">
+  Analyzing test results
+</h4>
+
+<p>
+  When Firebase Test Lab completes running your tests, the <em>Run</em> window
+  will open to show the results, as shown in figure 2. You may need to click
+  <strong>Show Passed</strong> <img src="{@docRoot}images/tools/as-ok.png" alt=
+  "" style="vertical-align:bottom;margin:0;"> to see all your executed tests.
+</p>
+
+<img src="{@docRoot}images/training/ctl-test-results.png" alt="">
+
+<p class="img-caption">
+  <strong>Figure 2.</strong> Viewing the results of instrumented tests using
+  Firebase Test Lab.
+</p>
+
+<p>
+  You can also analyze your tests on the web by following the link displayed at
+  the beginning of the test execution log in the <em>Run</em> window, as shown
+  in figure 3.
+</p>
+
+<img src="{@docRoot}images/training/ctl-exec-log.png" alt="">
+
+<p class="img-caption">
+  <strong>Figure 3.</strong> Click the link to view detailed test results on
+  the web.
+</p>
+
+<p>
+  To learn more about interpreting web results, see <a href=
+  "https://firebase.google.com/docs/test-lab/analyzing-results">Analyze
+  Firebase Test Lab for Android Results</a>.
 </p>
\ No newline at end of file
diff --git a/docs/html/training/testing/unit-testing/local-unit-tests.jd b/docs/html/training/testing/unit-testing/local-unit-tests.jd
index 893d957..25b62fa 100644
--- a/docs/html/training/testing/unit-testing/local-unit-tests.jd
+++ b/docs/html/training/testing/unit-testing/local-unit-tests.jd
@@ -7,17 +7,16 @@
 <!-- This is the training bar -->
 <div id="tb-wrapper">
 <div id="tb">
-  <h2>Dependencies and Prerequisites</h2>
-
-  <ul>
-    <li><a href="{@docRoot}tools/studio/index.html">Android Studio (latest version)</a>.</li>
-  </ul>
 
   <h2>This lesson teaches you to</h2>
 
   <ol>
     <li><a href="#setup">Set Up Your Testing Environment</a></li>
-    <li><a href="#build">Create a Local Unit Test Class</a></li>
+    <li><a href="#build">Create a Local Unit Test Class</a>
+      <ol>
+        <li><a href="#mocking-dependencies">Mock Android dependencies</a></li>
+      </ol>
+    </li>
     <li><a href="#run">Run Local Unit Tests</a></li>
   </ol>
 
@@ -42,13 +41,35 @@
 dependency relationships.</p>
 
 <h2 id="setup">Set Up Your Testing Environment</h2>
-<p>Before building your local unit test, make sure to configure your test source code location and
-project dependencies, as described in
-<a href="{@docRoot}training/testing/start/index.html#config-local-tests">
-Getting Started with Testing</a>.</p>
+
+<p>In your Android Studio project, you must store the source files for local
+unit tests at <code><var>module-name</var>/src/test/java/</code>. This directory
+already exists when you create a new project.</p>
+
+<p>You also need to configure the testing dependencies for your project to use
+the standard APIs provided by the JUnit 4 framework. If your test needs to
+interact with Android dependencies, include the <a href=
+"https://github.com/mockito/mockito" class="external-link">Mockito</a> library
+to simplify your local unit tests. To learn more about using mock objects in
+your local unit tests, see <a href=
+"{@docRoot}training/testing/unit-testing/local-unit-tests.html#mocking-dependencies">
+Mocking Android dependencies</a>.</p>
+
+<p>In your app's top-level {@code build.gradle} file, you need to specify these
+libraries as dependencies:</p>
+
+<pre>
+dependencies {
+    // Required -- JUnit 4 framework
+    testCompile 'junit:junit:4.12'
+    // Optional -- Mockito framework
+    testCompile 'org.mockito:mockito-core:1.10.19'
+}
+</pre>
 
 
 <h2 id="build">Create a Local Unit Test Class</h2>
+
 <p>Your local unit test class should be written as a JUnit 4 test class.
 <a href="http://junit.org/" class="external-link">JUnit</a> is the most popular
 and widely-used unit testing framework for Java. The latest version of this framework, JUnit 4,
@@ -90,7 +111,7 @@
 Hamcrest matchers</a> (such as the {@code is()} and {@code equalTo()} methods) to match the
 returned result against the expected result.</p>
 
-<h3 id="mocking-dependencies">Mocking Android dependencies</h3>
+<h3 id="mocking-dependencies">Mock Android dependencies</h3>
 <p>
 By default, the <a href="{@docRoot}tools/building/plugin-for-gradle.html">
 Android Plug-in for Gradle</a> executes your local unit tests against a modified
@@ -174,10 +195,37 @@
 class="external-link">sample code</a>.
 </p>
 
-<h2 id="run">Run Local Unit Tests</h2>
-<p>
-To run your tests, follow the steps for running local unit tests
-described in <a href="{@docRoot}training/testing/start/index.html#run-local-tests">
-Getting Started with Testing</a>.
-</p>
 
+<h2 id="run">Run Local Unit Tests</h2>
+
+<p>To run your local unit tests, follow these steps:</p>
+
+<ol>
+
+  <li>Be sure your project is synchronized with Gradle by clicking
+  <b>Sync Project</b> <img src="/images/tools/sync-project.png" alt=""
+  class="inline-icon"> in the toolbar.</li>
+
+  <li>Run your test in one of the following ways:
+    <ul>
+      <li>To run a single test, open the <b>Project</b> window, and then
+  right-click a test and click <strong>Run</strong> <img src=
+  "{@docRoot}images/tools/as-run.png" alt="" class="inline-icon">.</li>
+      <li>To test all methods in a class, right-click a class or method in the
+test file and click <b>Run</b> <img src=
+  "{@docRoot}images/tools/as-run.png" alt="" class="inline-icon">.
+      <li>To run all tests in a directory, right-click on the
+      directory and select <strong>Run tests</strong> <img src=
+      "{@docRoot}images/tools/as-run.png" alt="" class="inline-icon">.
+      </li>
+    </ul>
+  </li>
+
+</ol>
+
+<p>
+  The Android Plugin for Gradle compiles the local unit test code located in
+  the default directory ({@code src/test/java/}), builds a test app, and
+  executes it locally using the default test runner class. Android Studio then
+  displays the results in the <b>Run</b> window.
+</p>
diff --git a/graphics/java/android/graphics/drawable/DrawableContainer.java b/graphics/java/android/graphics/drawable/DrawableContainer.java
index c6977746..d5143da 100644
--- a/graphics/java/android/graphics/drawable/DrawableContainer.java
+++ b/graphics/java/android/graphics/drawable/DrawableContainer.java
@@ -75,6 +75,9 @@
     private long mEnterAnimationEnd;
     private long mExitAnimationEnd;
 
+    /** Callback that blocks invalidation. Used for drawable initialization. */
+    private BlockInvalidateCallback mBlockInvalidateCallback;
+
     // overrides from Drawable
 
     @Override
@@ -500,11 +503,14 @@
      * @param d The drawable to initialize.
      */
     private void initializeDrawableForDisplay(Drawable d) {
+        if (mBlockInvalidateCallback == null) {
+            mBlockInvalidateCallback = new BlockInvalidateCallback();
+        }
+
         // Temporary fix for suspending callbacks during initialization. We
         // don't want any of these setters causing an invalidate() since that
         // may call back into DrawableContainer.
-        final Callback cb = d.getCallback();
-        d.setCallback(null);
+        d.setCallback(mBlockInvalidateCallback.wrap(d.getCallback()));
 
         try {
             if (mDrawableContainerState.mEnterFadeDuration <= 0 && mHasAlpha) {
@@ -537,7 +543,7 @@
                         hotspotBounds.right, hotspotBounds.bottom);
             }
         } finally {
-            d.setCallback(cb);
+            d.setCallback(mBlockInvalidateCallback.unwrap());
         }
     }
 
@@ -1215,4 +1221,41 @@
         mLastIndex = -1;
         mLastDrawable = null;
     }
+
+    /**
+     * Callback that blocks drawable invalidation.
+     */
+    private static class BlockInvalidateCallback implements Drawable.Callback {
+        private Drawable.Callback mCallback;
+
+        public BlockInvalidateCallback wrap(Drawable.Callback callback) {
+            mCallback = callback;
+            return this;
+        }
+
+        public Drawable.Callback unwrap() {
+            final Drawable.Callback callback = mCallback;
+            mCallback = null;
+            return callback;
+        }
+
+        @Override
+        public void invalidateDrawable(@NonNull Drawable who) {
+            // Ignore invalidation.
+        }
+
+        @Override
+        public void scheduleDrawable(@NonNull Drawable who, @NonNull Runnable what, long when) {
+            if (mCallback != null) {
+                mCallback.scheduleDrawable(who, what, when);
+            }
+        }
+
+        @Override
+        public void unscheduleDrawable(@NonNull Drawable who, @NonNull Runnable what) {
+            if (mCallback != null) {
+                mCallback.unscheduleDrawable(who, what);
+            }
+        }
+    }
 }
diff --git a/libs/hwui/AnimationContext.cpp b/libs/hwui/AnimationContext.cpp
index 097be08..5759ccd 100644
--- a/libs/hwui/AnimationContext.cpp
+++ b/libs/hwui/AnimationContext.cpp
@@ -63,7 +63,7 @@
         mCurrentFrameAnimations.mNextHandle = head;
         head->mPreviousHandle = &mCurrentFrameAnimations;
     }
-    mFrameTimeMs = mClock.computeFrameTimeMs();
+    mFrameTimeMs = ns2ms(mClock.latestVsync());
 }
 
 void AnimationContext::runRemainingAnimations(TreeInfo& info) {
diff --git a/libs/hwui/RenderNode.cpp b/libs/hwui/RenderNode.cpp
index be2dab9..d48d544 100644
--- a/libs/hwui/RenderNode.cpp
+++ b/libs/hwui/RenderNode.cpp
@@ -464,7 +464,7 @@
 }
 #endif
 
-void RenderNode::syncDisplayList(TreeObserver* observer) {
+void RenderNode::syncDisplayList(TreeInfo* info) {
     // Make sure we inc first so that we don't fluctuate between 0 and 1,
     // which would thrash the layer cache
     if (mStagingDisplayList) {
@@ -472,7 +472,7 @@
             child->renderNode->incParentRefCount();
         }
     }
-    deleteDisplayList(observer);
+    deleteDisplayList(info ? info->observer : nullptr, info);
     mDisplayList = mStagingDisplayList;
     mStagingDisplayList = nullptr;
     if (mDisplayList) {
@@ -491,15 +491,15 @@
         // Damage with the old display list first then the new one to catch any
         // changes in isRenderable or, in the future, bounds
         damageSelf(info);
-        syncDisplayList(info.observer);
+        syncDisplayList(&info);
         damageSelf(info);
     }
 }
 
-void RenderNode::deleteDisplayList(TreeObserver* observer) {
+void RenderNode::deleteDisplayList(TreeObserver* observer, TreeInfo* info) {
     if (mDisplayList) {
         for (auto&& child : mDisplayList->getChildren()) {
-            child->renderNode->decParentRefCount(observer);
+            child->renderNode->decParentRefCount(observer, info);
         }
     }
     delete mDisplayList;
@@ -531,35 +531,38 @@
     }
 }
 
-void RenderNode::destroyHardwareResources(TreeObserver* observer) {
+void RenderNode::destroyHardwareResources(TreeObserver* observer, TreeInfo* info) {
     if (mLayer) {
         destroyLayer(mLayer);
         mLayer = nullptr;
     }
     if (mDisplayList) {
         for (auto&& child : mDisplayList->getChildren()) {
-            child->renderNode->destroyHardwareResources(observer);
+            child->renderNode->destroyHardwareResources(observer, info);
         }
         if (mNeedsDisplayListSync) {
             // Next prepare tree we are going to push a new display list, so we can
             // drop our current one now
-            deleteDisplayList(observer);
+            deleteDisplayList(observer, info);
         }
     }
 }
 
-void RenderNode::decParentRefCount(TreeObserver* observer) {
+void RenderNode::decParentRefCount(TreeObserver* observer, TreeInfo* info) {
     LOG_ALWAYS_FATAL_IF(!mParentCount, "already 0!");
     mParentCount--;
     if (!mParentCount) {
         if (observer) {
             observer->onMaybeRemovedFromTree(this);
         }
+        if (CC_UNLIKELY(mPositionListener.get())) {
+            mPositionListener->onPositionLost(*this, info);
+        }
         // If a child of ours is being attached to our parent then this will incorrectly
         // destroy its hardware resources. However, this situation is highly unlikely
         // and the failure is "just" that the layer is re-created, so this should
         // be safe enough
-        destroyHardwareResources(observer);
+        destroyHardwareResources(observer, info);
     }
 }
 
diff --git a/libs/hwui/RenderNode.h b/libs/hwui/RenderNode.h
index acdc3d8..f80be5e 100644
--- a/libs/hwui/RenderNode.h
+++ b/libs/hwui/RenderNode.h
@@ -196,7 +196,7 @@
     }
 
     ANDROID_API virtual void prepareTree(TreeInfo& info);
-    void destroyHardwareResources(TreeObserver* observer);
+    void destroyHardwareResources(TreeObserver* observer, TreeInfo* info = nullptr);
 
     // UI thread only!
     ANDROID_API void addAnimator(const sp<BaseRenderNodeAnimator>& animator);
@@ -228,10 +228,19 @@
     OffscreenBuffer** getLayerHandle() { return &mLayer; } // ugh...
 #endif
 
+    // Note: The position callbacks are relying on the listener using
+    // the frameNumber to appropriately batch/synchronize these transactions.
+    // There is no other filtering/batching to ensure that only the "final"
+    // state called once per frame.
     class ANDROID_API PositionListener {
     public:
         virtual ~PositionListener() {}
+        // Called when the RenderNode's position changes
         virtual void onPositionUpdated(RenderNode& node, const TreeInfo& info) = 0;
+        // Called when the RenderNode no longer has a position. As in, it's
+        // no longer being drawn.
+        // Note, tree info might be null
+        virtual void onPositionLost(RenderNode& node, const TreeInfo* info) = 0;
     };
 
     // Note this is not thread safe, this needs to be called
@@ -306,7 +315,7 @@
 
 
     void syncProperties();
-    void syncDisplayList(TreeObserver* observer);
+    void syncDisplayList(TreeInfo* info);
 
     void prepareTreeImpl(TreeInfo& info, bool functorsNeedLayer);
     void pushStagingPropertiesChanges(TreeInfo& info);
@@ -317,11 +326,11 @@
 #endif
     void prepareLayer(TreeInfo& info, uint32_t dirtyMask);
     void pushLayerUpdate(TreeInfo& info);
-    void deleteDisplayList(TreeObserver* observer);
+    void deleteDisplayList(TreeObserver* observer, TreeInfo* info = nullptr);
     void damageSelf(TreeInfo& info);
 
     void incParentRefCount() { mParentCount++; }
-    void decParentRefCount(TreeObserver* observer);
+    void decParentRefCount(TreeObserver* observer, TreeInfo* info = nullptr);
 
     String8 mName;
     sp<VirtualLightRefBase> mUserContext;
diff --git a/libs/hwui/renderthread/TimeLord.cpp b/libs/hwui/renderthread/TimeLord.cpp
index f846d6a..6c2575f 100644
--- a/libs/hwui/renderthread/TimeLord.cpp
+++ b/libs/hwui/renderthread/TimeLord.cpp
@@ -43,10 +43,6 @@
     return mFrameTimeNanos;
 }
 
-nsecs_t TimeLord::computeFrameTimeMs() {
-    return nanoseconds_to_milliseconds(computeFrameTimeNanos());
-}
-
 } /* namespace renderthread */
 } /* namespace uirenderer */
 } /* namespace android */
diff --git a/libs/hwui/renderthread/TimeLord.h b/libs/hwui/renderthread/TimeLord.h
index 5464399..68a0f7f 100644
--- a/libs/hwui/renderthread/TimeLord.h
+++ b/libs/hwui/renderthread/TimeLord.h
@@ -34,7 +34,6 @@
     // returns true if the vsync is newer, false if it was rejected for staleness
     bool vsyncReceived(nsecs_t vsync);
     nsecs_t latestVsync() { return mFrameTimeNanos; }
-    nsecs_t computeFrameTimeMs();
     nsecs_t computeFrameTimeNanos();
 
 private:
diff --git a/location/java/android/location/LocationManager.java b/location/java/android/location/LocationManager.java
index b246360..2b3ed87 100644
--- a/location/java/android/location/LocationManager.java
+++ b/location/java/android/location/LocationManager.java
@@ -2008,7 +2008,7 @@
      * No-op method to keep backward-compatibility.
      * Don't use it. Use {@link #registerGnssMeasurementsCallback} instead.
      * @hide
-     * @deprecated
+     * @deprecated Not supported anymore.
      */
     @Deprecated
     @SystemApi
@@ -2065,7 +2065,7 @@
      * No-op method to keep backward-compatibility.
      * Don't use it. Use {@link #registerGnssNavigationMessageCallback} instead.
      * @hide
-     * @deprecated
+     * @deprecated Not supported anymore.
      */
     @Deprecated
     @SystemApi
diff --git a/media/java/android/media/AudioRecord.java b/media/java/android/media/AudioRecord.java
index 8efd599..39184f1 100644
--- a/media/java/android/media/AudioRecord.java
+++ b/media/java/android/media/AudioRecord.java
@@ -467,11 +467,11 @@
      * <p>
      * If the audio source is not set with {@link #setAudioSource(int)},
      * {@link MediaRecorder.AudioSource#DEFAULT} is used.
-     * <br>If the audio format is not specified or is incomplete, its sample rate will be the
-     * default output sample rate of the device (see
-     * {@link AudioManager#PROPERTY_OUTPUT_SAMPLE_RATE}), its channel configuration will be
+     * <br>If the audio format is not specified or is incomplete, its channel configuration will be
      * {@link AudioFormat#CHANNEL_IN_MONO}, and the encoding will be
      * {@link AudioFormat#ENCODING_PCM_16BIT}.
+     * The sample rate will depend on the device actually selected for capture and can be queried
+     * with {@link #getSampleRate()} method.
      * <br>If the buffer size is not specified with {@link #setBufferSizeInBytes(int)},
      * the minimum buffer size for the source is used.
      */
diff --git a/media/java/android/media/AudioTrack.java b/media/java/android/media/AudioTrack.java
index 9a81668..12d5ead 100644
--- a/media/java/android/media/AudioTrack.java
+++ b/media/java/android/media/AudioTrack.java
@@ -619,11 +619,11 @@
      * <p>
      * If the audio attributes are not set with {@link #setAudioAttributes(AudioAttributes)},
      * attributes comprising {@link AudioAttributes#USAGE_MEDIA} will be used.
-     * <br>If the audio format is not specified or is incomplete, its sample rate will be the
-     * default output sample rate of the device (see
-     * {@link AudioManager#PROPERTY_OUTPUT_SAMPLE_RATE}), its channel configuration will be
+     * <br>If the audio format is not specified or is incomplete, its channel configuration will be
      * {@link AudioFormat#CHANNEL_OUT_STEREO} and the encoding will be
      * {@link AudioFormat#ENCODING_PCM_16BIT}.
+     * The sample rate will depend on the device actually selected for playback and can be queried
+     * with {@link #getSampleRate()} method.
      * <br>If the buffer size is not specified with {@link #setBufferSizeInBytes(int)},
      * and the mode is {@link AudioTrack#MODE_STREAM}, the minimum buffer size is used.
      * <br>If the transfer mode is not specified with {@link #setTransferMode(int)},
diff --git a/media/java/android/media/MediaPlayer.java b/media/java/android/media/MediaPlayer.java
index 4d40e6b..8d4a151 100644
--- a/media/java/android/media/MediaPlayer.java
+++ b/media/java/android/media/MediaPlayer.java
@@ -476,10 +476,10 @@
  *     <td>This method can be called in any state and calling it does not change
  *         the object state. </p></td></tr>
  * <tr><td>setPlaybackParams</p></td>
- *     <td>any </p></td>
- *     <td>{} </p></td>
- *     <td>This method can be called in any state and calling it does not change
- *         the object state. </p></td></tr>
+ *     <td>{Initialized, Prepared, Started, Paused, PlaybackCompleted, Error}</p></td>
+ *     <td>{Idle, Stopped} </p></td>
+ *     <td>This method will change state in some cases, depending on when it's called.
+ *         </p></td></tr>
  * <tr><td>setScreenOnWhilePlaying</></td>
  *     <td>any </p></td>
  *     <td>{} </p></td>
@@ -1449,12 +1449,18 @@
     }
 
     /**
-     * Sets playback rate using {@link PlaybackParams}.
+     * Sets playback rate using {@link PlaybackParams}. The object sets its internal
+     * PlaybackParams to the input, except that the object remembers previous speed
+     * when input speed is zero. This allows the object to resume at previous speed
+     * when start() is called. Calling it before the object is prepared does not change
+     * the object state. After the object is prepared, calling it with zero speed is
+     * equivalent to calling pause(). After the object is prepared, calling it with
+     * non-zero speed is equivalent to calling start().
      *
      * @param params the playback params.
      *
      * @throws IllegalStateException if the internal player engine has not been
-     * initialized.
+     * initialized or has been released.
      * @throws IllegalArgumentException if params is not supported.
      */
     public native void setPlaybackParams(@NonNull PlaybackParams params);
diff --git a/media/jni/android_media_Utils.cpp b/media/jni/android_media_Utils.cpp
index 359ebad..c62d930 100644
--- a/media/jni/android_media_Utils.cpp
+++ b/media/jni/android_media_Utils.cpp
@@ -68,16 +68,19 @@
         if (sizeToRead <= kMinSizeToRead) {
             sizeToRead = kMinSizeToRead;
         }
+
         void* tempBuffer = malloc(sizeToRead);
-        if (tempBuffer != NULL) {
-            size_t bytesRead = mStream->read(tempBuffer, sizeToRead);
-            if (bytesRead != sizeToRead) {
-                free(tempBuffer);
-                return piex::Error::kFail;
-            }
-            mStreamBuffer.write(tempBuffer, bytesRead);
-            free(tempBuffer);
+        if (tempBuffer == NULL) {
+          return piex::Error::kFail;
         }
+
+        size_t bytesRead = mStream->read(tempBuffer, sizeToRead);
+        if (bytesRead != sizeToRead) {
+            free(tempBuffer);
+            return piex::Error::kFail;
+        }
+        mStreamBuffer.write(tempBuffer, bytesRead);
+        free(tempBuffer);
     }
 
     // Read bytes.
@@ -126,8 +129,8 @@
     size_t size = fread((void*)data, sizeof(std::uint8_t), length, mFile);
     mPosition += size;
 
-    // Handle errors.
-    if (ferror(mFile)) {
+    // Handle errors and verify the size.
+    if (ferror(mFile) || size != length) {
         ALOGV("GetData read failed: (offset: %zu, length: %zu)", offset, length);
         return piex::Error::kFail;
     }
diff --git a/packages/CtsShim/CtsShim.apk b/packages/CtsShim/CtsShim.apk
index 7a27a43..2728903 100644
--- a/packages/CtsShim/CtsShim.apk
+++ b/packages/CtsShim/CtsShim.apk
Binary files differ
diff --git a/packages/CtsShim/CtsShimPriv.apk b/packages/CtsShim/CtsShimPriv.apk
index 63e8688..9a8e75c 100644
--- a/packages/CtsShim/CtsShimPriv.apk
+++ b/packages/CtsShim/CtsShimPriv.apk
Binary files differ
diff --git a/packages/DocumentsUI/src/com/android/documentsui/BaseActivity.java b/packages/DocumentsUI/src/com/android/documentsui/BaseActivity.java
index 9d4b50c..1922773 100644
--- a/packages/DocumentsUI/src/com/android/documentsui/BaseActivity.java
+++ b/packages/DocumentsUI/src/com/android/documentsui/BaseActivity.java
@@ -215,9 +215,12 @@
         includeState(state);
 
         // Advanced roots are shown by default without menu option if forced by config or intent.
-        state.showAdvanced = Shared.shouldShowDeviceRoot(this, intent);
+        boolean forceAdvanced = Shared.shouldShowDeviceRoot(this, intent);
+        boolean chosenAdvanced = LocalPreferences.getShowDeviceRoot(this, state.action);
+        state.showAdvanced = forceAdvanced || chosenAdvanced;
+
         // Menu option is shown for whitelisted intents if advanced roots are not shown by default.
-        state.showAdvancedOption = !state.showAdvanced && (
+        state.showAdvancedOption = !forceAdvanced && (
                 Shared.shouldShowFancyFeatures(this)
                 || state.action == ACTION_OPEN
                 || state.action == ACTION_CREATE
@@ -483,6 +486,7 @@
         Metrics.logUserAction(this,
                 display ? Metrics.USER_ACTION_SHOW_ADVANCED : Metrics.USER_ACTION_HIDE_ADVANCED);
 
+        LocalPreferences.setShowDeviceRoot(this, mState.action, display);
         mState.showAdvanced = display;
         RootsFragment.get(getFragmentManager()).onDisplayStateChanged();
         invalidateOptionsMenu();
diff --git a/packages/DocumentsUI/src/com/android/documentsui/LocalPreferences.java b/packages/DocumentsUI/src/com/android/documentsui/LocalPreferences.java
index 2315664..d2e9885 100644
--- a/packages/DocumentsUI/src/com/android/documentsui/LocalPreferences.java
+++ b/packages/DocumentsUI/src/com/android/documentsui/LocalPreferences.java
@@ -18,9 +18,6 @@
 
 import static com.android.documentsui.State.MODE_UNKNOWN;
 
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-
 import android.annotation.IntDef;
 import android.annotation.Nullable;
 import android.content.Context;
@@ -28,11 +25,16 @@
 import android.os.UserHandle;
 import android.preference.PreferenceManager;
 
+import com.android.documentsui.State.ActionType;
 import com.android.documentsui.State.ViewMode;
 import com.android.documentsui.model.RootInfo;
 
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+
 public class LocalPreferences {
     private static final String KEY_FILE_SIZE = "fileSize";
+    private static final String INCLUDE_DEVICE_ROOT = "includeDeviceRoot-";
     private static final String ROOT_VIEW_MODE_PREFIX = "rootViewMode-";
 
     public static boolean getDisplayFileSize(Context context) {
@@ -48,9 +50,17 @@
         getPrefs(context).edit().putBoolean(KEY_FILE_SIZE, display).apply();
     }
 
+    public static boolean getShowDeviceRoot(Context context, @ActionType int action) {
+        return getPrefs(context).getBoolean(INCLUDE_DEVICE_ROOT + action, false);
+    }
+
+    public static void setShowDeviceRoot(
+            Context context, @ActionType int action, boolean display) {
+        getPrefs(context).edit().putBoolean(INCLUDE_DEVICE_ROOT + action, display).apply();
+    }
+
     public static void setViewMode(Context context, RootInfo root, @ViewMode int viewMode) {
         assert(viewMode != MODE_UNKNOWN);
-
         getPrefs(context).edit().putInt(createKey(root), viewMode).apply();
     }
 
diff --git a/packages/DocumentsUI/src/com/android/documentsui/services/CopyJob.java b/packages/DocumentsUI/src/com/android/documentsui/services/CopyJob.java
index f10af43..53fa3cc4 100644
--- a/packages/DocumentsUI/src/com/android/documentsui/services/CopyJob.java
+++ b/packages/DocumentsUI/src/com/android/documentsui/services/CopyJob.java
@@ -227,7 +227,7 @@
         try {
             mBatchSize = calculateSize(mSrcs);
         } catch (ResourceException e) {
-            Log.w(TAG, "Failed to calculate total size. Copying without progress.");
+            Log.w(TAG, "Failed to calculate total size. Copying without progress.", e);
             mBatchSize = -1;
         }
 
@@ -236,25 +236,19 @@
         for (int i = 0; i < mSrcs.size() && !isCanceled(); ++i) {
             srcInfo = mSrcs.get(i);
 
-            // Guard unsupported recursive operation.
-            try {
-                if (dstInfo.equals(srcInfo) || isDescendentOf(srcInfo, dstInfo)) {
-                    throw new ResourceException("Cannot copy to itself recursively.");
-                }
-            } catch (ResourceException e) {
-                Log.e(TAG, e.toString());
-                onFileFailed(srcInfo);
-                continue;
-            }
-
             if (DEBUG) Log.d(TAG,
                     "Copying " + srcInfo.displayName + " (" + srcInfo.derivedUri + ")"
                     + " to " + dstInfo.displayName + " (" + dstInfo.derivedUri + ")");
 
             try {
-                processDocument(srcInfo, null, dstInfo);
+                if (dstInfo.equals(srcInfo) || isDescendentOf(srcInfo, dstInfo)) {
+                    Log.e(TAG, "Skipping recursive copy of " + srcInfo.derivedUri);
+                    onFileFailed(srcInfo);
+                } else {
+                    processDocument(srcInfo, null, dstInfo);
+                }
             } catch (ResourceException e) {
-                Log.e(TAG, e.toString());
+                Log.e(TAG, "Failed to copy " + srcInfo.derivedUri, e);
                 onFileFailed(srcInfo);
             }
         }
@@ -306,7 +300,7 @@
                     }
                 } catch (RemoteException | RuntimeException e) {
                     Log.e(TAG, "Provider side copy failed for: " + src.derivedUri
-                            + " due to an exception: " + e);
+                            + " due to an exception.", e);
                 }
                 // If optimized copy fails, then fallback to byte-by-byte copy.
                 if (DEBUG) Log.d(TAG, "Fallback to byte-by-byte copy for: " + src.derivedUri);
diff --git a/packages/DocumentsUI/src/com/android/documentsui/services/DeleteJob.java b/packages/DocumentsUI/src/com/android/documentsui/services/DeleteJob.java
index 8f45162..36a0f32 100644
--- a/packages/DocumentsUI/src/com/android/documentsui/services/DeleteJob.java
+++ b/packages/DocumentsUI/src/com/android/documentsui/services/DeleteJob.java
@@ -86,7 +86,7 @@
             try {
                 deleteDocument(doc, mSrcParent);
             } catch (ResourceException e) {
-                Log.e(TAG, "Failed to delete document @ " + doc.derivedUri);
+                Log.e(TAG, "Failed to delete document @ " + doc.derivedUri, e);
                 onFileFailed(doc);
             }
         }
diff --git a/packages/DocumentsUI/src/com/android/documentsui/services/MoveJob.java b/packages/DocumentsUI/src/com/android/documentsui/services/MoveJob.java
index aaa7596..1118171 100644
--- a/packages/DocumentsUI/src/com/android/documentsui/services/MoveJob.java
+++ b/packages/DocumentsUI/src/com/android/documentsui/services/MoveJob.java
@@ -98,7 +98,7 @@
                     }
                 } catch (RemoteException | RuntimeException e) {
                     Log.e(TAG, "Provider side move failed for: " + src.derivedUri
-                            + " due to an exception: " + e);
+                            + " due to an exception: ", e);
                 }
                 // If optimized move fails, then fallback to byte-by-byte copy.
                 if (DEBUG) Log.d(TAG, "Fallback to byte-by-byte move for: " + src.derivedUri);
diff --git a/packages/SettingsProvider/src/com/android/providers/settings/GenerationRegistry.java b/packages/SettingsProvider/src/com/android/providers/settings/GenerationRegistry.java
index 8512dca..f4f7986 100644
--- a/packages/SettingsProvider/src/com/android/providers/settings/GenerationRegistry.java
+++ b/packages/SettingsProvider/src/com/android/providers/settings/GenerationRegistry.java
@@ -76,6 +76,8 @@
                         bundle.putParcelable(Settings.CALL_METHOD_TRACK_GENERATION_KEY,
                                 backingStore);
                         bundle.putInt(Settings.CALL_METHOD_GENERATION_INDEX_KEY, index);
+                        bundle.putInt(Settings.CALL_METHOD_GENERATION_KEY,
+                                backingStore.get(index));
                         if (DEBUG) {
                             Slog.i(LOG_TAG, "Exported index:" + index + " for key:"
                                     + SettingsProvider.keyToString(key));
diff --git a/packages/SystemUI/res/values-cs/strings.xml b/packages/SystemUI/res/values-cs/strings.xml
index 2f5d97c..68ce2cb 100644
--- a/packages/SystemUI/res/values-cs/strings.xml
+++ b/packages/SystemUI/res/values-cs/strings.xml
@@ -72,7 +72,7 @@
     <string name="screenshot_saving_ticker" msgid="7403652894056693515">"Ukládání snímku obrazovky..."</string>
     <string name="screenshot_saving_title" msgid="8242282144535555697">"Ukládání snímku obrazovky..."</string>
     <string name="screenshot_saving_text" msgid="2419718443411738818">"Probíhá ukládání snímku obrazovky."</string>
-    <string name="screenshot_saved_title" msgid="6461865960961414961">"Snímek obrazovky Snímek obrazovky pořízen."</string>
+    <string name="screenshot_saved_title" msgid="6461865960961414961">"Snímek obrazovky pořízen"</string>
     <string name="screenshot_saved_text" msgid="2685605830386712477">"Klepnutím zobrazíte snímek obrazovky."</string>
     <string name="screenshot_failed_title" msgid="705781116746922771">"Snímek obrazovky se nepodařilo zachytit."</string>
     <string name="screenshot_failed_to_save_unknown_text" msgid="7887826345701753830">"Při ukládání snímku obrazovky došlo k problému."</string>
diff --git a/packages/SystemUI/res/values/strings_tv.xml b/packages/SystemUI/res/values/strings_tv.xml
index b1d23d8..f49d201 100644
--- a/packages/SystemUI/res/values/strings_tv.xml
+++ b/packages/SystemUI/res/values/strings_tv.xml
@@ -44,4 +44,8 @@
     <string name="font_roboto_regular" translatable="false">sans-serif</string>
     <!-- DO NOT TRANSLATE -->
     <string name="font_roboto_light" translatable="false">sans-serif-light</string>
+    <!-- Package names to be blacklisted in Recents, add package names into overlay as needed -->
+    <string-array name="recents_tv_blacklist_array">
+    </string-array>
+
 </resources>
diff --git a/packages/SystemUI/src/com/android/systemui/SystemUI.java b/packages/SystemUI/src/com/android/systemui/SystemUI.java
index 85befff..f30baee 100644
--- a/packages/SystemUI/src/com/android/systemui/SystemUI.java
+++ b/packages/SystemUI/src/com/android/systemui/SystemUI.java
@@ -16,8 +16,10 @@
 
 package com.android.systemui;
 
+import android.app.Notification;
 import android.content.Context;
 import android.content.res.Configuration;
+import android.os.Bundle;
 
 import java.io.FileDescriptor;
 import java.io.PrintWriter;
@@ -48,4 +50,12 @@
             mComponents.put(interfaceType, component);
         }
     }
+
+    public static void overrideNotificationAppName(Context context, Notification.Builder n) {
+        final Bundle extras = new Bundle();
+        extras.putString(Notification.EXTRA_SUBSTITUTE_APP_NAME,
+                context.getString(com.android.internal.R.string.android_system_label));
+
+        n.addExtras(extras);
+    }
 }
diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java b/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java
index cad7f64..6759e6b 100644
--- a/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java
+++ b/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java
@@ -923,6 +923,11 @@
             // In this case, send out ACTION_USER_PRESENT here instead of in
             // handleKeyguardDone()
             sendUserPresentBroadcast();
+        } else if (mSystemReady && shouldWaitForProvisioning()) {
+            // Skipping the lockscreen because we're not yet provisioned, but we still need to
+            // notify the StrongAuthTracker that it's now safe to run trust agents, in case the
+            // user sets a credential later.
+            getLockPatternUtils().userPresent(KeyguardUpdateMonitor.getCurrentUser());
         }
     }
 
diff --git a/packages/SystemUI/src/com/android/systemui/power/PowerNotificationWarnings.java b/packages/SystemUI/src/com/android/systemui/power/PowerNotificationWarnings.java
index ea1c9bf..b831235 100644
--- a/packages/SystemUI/src/com/android/systemui/power/PowerNotificationWarnings.java
+++ b/packages/SystemUI/src/com/android/systemui/power/PowerNotificationWarnings.java
@@ -38,6 +38,7 @@
 import android.util.Slog;
 
 import com.android.systemui.R;
+import com.android.systemui.SystemUI;
 import com.android.systemui.statusbar.phone.PhoneStatusBar;
 import com.android.systemui.statusbar.phone.SystemUIDialog;
 
@@ -143,6 +144,7 @@
                 .setVisibility(Notification.VISIBILITY_PUBLIC)
                 .setColor(mContext.getColor(
                         com.android.internal.R.color.system_notification_accent_color));
+        SystemUI.overrideNotificationAppName(mContext, nb);
         final Notification n = nb.build();
         mNoMan.notifyAsUser(TAG_NOTIFICATION, R.id.notification_power, n, UserHandle.ALL);
     }
@@ -173,8 +175,8 @@
             attachLowBatterySound(nb);
             mPlaySound = false;
         }
-        final Notification n = nb.build();
-        mNoMan.notifyAsUser(TAG_NOTIFICATION, R.id.notification_power, n, UserHandle.ALL);
+        SystemUI.overrideNotificationAppName(mContext, nb);
+        mNoMan.notifyAsUser(TAG_NOTIFICATION, R.id.notification_power, nb.build(), UserHandle.ALL);
     }
 
     private PendingIntent pendingActivity(Intent intent) {
diff --git a/packages/SystemUI/src/com/android/systemui/qs/QSPanel.java b/packages/SystemUI/src/com/android/systemui/qs/QSPanel.java
index 2c874e5..636a9a50 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/QSPanel.java
+++ b/packages/SystemUI/src/com/android/systemui/qs/QSPanel.java
@@ -72,6 +72,8 @@
     private QSCustomizer mCustomizePanel;
     private Record mDetailRecord;
 
+    private BrightnessMirrorController mBrightnessMirrorController;
+
     public QSPanel(Context context) {
         this(context, null);
     }
@@ -159,7 +161,7 @@
     }
 
     public void setBrightnessMirror(BrightnessMirrorController c) {
-        super.onFinishInflate();
+        mBrightnessMirrorController = c;
         ToggleSlider brightnessSlider = (ToggleSlider) findViewById(R.id.brightness_slider);
         ToggleSlider mirror = (ToggleSlider) c.getMirror().findViewById(R.id.brightness_slider);
         brightnessSlider.setMirror(mirror);
@@ -205,6 +207,11 @@
     protected void onConfigurationChanged(Configuration newConfig) {
         super.onConfigurationChanged(newConfig);
         mFooter.onConfigurationChanged();
+
+        if (mBrightnessMirrorController != null) {
+            // Reload the mirror in case it got reinflated but we didn't.
+            setBrightnessMirror(mBrightnessMirrorController);
+        }
     }
 
     public void onCollapse() {
@@ -353,7 +360,6 @@
             }
         };
         r.tileView.init(click, longClick);
-        callback.onStateChanged(r.tile.getState());
         r.tile.refreshState();
         mRecords.add(r);
 
diff --git a/packages/SystemUI/src/com/android/systemui/qs/QSTile.java b/packages/SystemUI/src/com/android/systemui/qs/QSTile.java
index 974de08..27b079a 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/QSTile.java
+++ b/packages/SystemUI/src/com/android/systemui/qs/QSTile.java
@@ -225,7 +225,7 @@
 
     private void handleAddCallback(Callback callback) {
         mCallbacks.add(callback);
-        handleRefreshState(null);
+        callback.onStateChanged(mState);
     }
 
     private void handleRemoveCallback(Callback callback) {
@@ -634,6 +634,18 @@
         }
     }
 
+    public static class AirplaneBooleanState extends BooleanState {
+        public boolean isAirplaneMode;
+
+        @Override
+        public boolean copyTo(State other) {
+            final AirplaneBooleanState o = (AirplaneBooleanState) other;
+            final boolean changed = super.copyTo(other) || o.isAirplaneMode != isAirplaneMode;
+            o.isAirplaneMode = isAirplaneMode;
+            return changed;
+        }
+    }
+
     public static final class SignalState extends BooleanState {
         public boolean connected;
         public boolean activityIn;
diff --git a/packages/SystemUI/src/com/android/systemui/qs/QuickQSPanel.java b/packages/SystemUI/src/com/android/systemui/qs/QuickQSPanel.java
index c984abe..f287f1b 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/QuickQSPanel.java
+++ b/packages/SystemUI/src/com/android/systemui/qs/QuickQSPanel.java
@@ -113,6 +113,11 @@
     }
 
     @Override
+    protected void onTileClick(QSTile<?> tile) {
+        tile.secondaryClick();
+    }
+
+    @Override
     public void onTuningChanged(String key, String newValue) {
         // No tunings for you.
         if (key.equals(QS_SHOW_BRIGHTNESS)) {
@@ -130,7 +135,7 @@
                 break;
             }
         }
-        super.setTiles(quickTiles, false);
+        super.setTiles(quickTiles, true);
     }
 
     private final Tunable mNumTiles = new Tunable() {
diff --git a/packages/SystemUI/src/com/android/systemui/qs/customize/QSCustomizer.java b/packages/SystemUI/src/com/android/systemui/qs/customize/QSCustomizer.java
index 8a0079d..0de1e30 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/customize/QSCustomizer.java
+++ b/packages/SystemUI/src/com/android/systemui/qs/customize/QSCustomizer.java
@@ -233,6 +233,7 @@
                 setVisibility(View.GONE);
             }
             mNotifQsContainer.setCustomizerAnimating(false);
+            mRecyclerView.setAdapter(mTileAdapter);
         }
 
         @Override
diff --git a/packages/SystemUI/src/com/android/systemui/qs/customize/TileAdapter.java b/packages/SystemUI/src/com/android/systemui/qs/customize/TileAdapter.java
index 60c24d0..8e4ed91 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/customize/TileAdapter.java
+++ b/packages/SystemUI/src/com/android/systemui/qs/customize/TileAdapter.java
@@ -37,6 +37,7 @@
 import android.view.accessibility.AccessibilityManager;
 import android.widget.FrameLayout;
 import android.widget.TextView;
+
 import com.android.internal.logging.MetricsLogger;
 import com.android.internal.logging.MetricsProto;
 import com.android.systemui.R;
@@ -111,6 +112,9 @@
     }
 
     public void setTileSpecs(List<String> currentSpecs) {
+        if (currentSpecs.equals(mCurrentSpecs)) {
+            return;
+        }
         mCurrentSpecs = currentSpecs;
         recalcSpecs();
     }
@@ -227,6 +231,8 @@
             });
             if (mNeedsFocus) {
                 // Wait for this to get laid out then set its focus.
+                // Ensure that tile gets laid out so we get the callback.
+                holder.mTileView.requestLayout();
                 holder.mTileView.addOnLayoutChangeListener(new OnLayoutChangeListener() {
                     @Override
                     public void onLayoutChange(View v, int left, int top, int right, int bottom,
@@ -254,7 +260,7 @@
         }
         holder.mTileView.onStateChanged(info.state);
         holder.mTileView.setAppLabel(info.appLabel);
-        holder.mTileView.setShowAppLabel(mTileDividerIndex > -1 && position > mTileDividerIndex);
+        holder.mTileView.setShowAppLabel(position > mEditIndex && !info.isSystem);
 
         if (mAccessibilityManager.isTouchExplorationEnabled()) {
             final boolean selectable = !mAccessibilityMoving || position < mEditIndex;
@@ -289,13 +295,11 @@
         mTiles.remove(mEditIndex--);
         notifyItemRemoved(mEditIndex - 1);
         move(mAccessibilityFromIndex, position, v);
-        updateDividerLocations();
         notifyDataSetChanged();
-        saveSpecs(mHost);
     }
 
     private void showAccessibilityDialog(final int position, final View v) {
-        TileInfo info = mTiles.get(position);
+        final TileInfo info = mTiles.get(position);
         CharSequence[] options = new CharSequence[] {
                 mContext.getString(R.string.accessibility_qs_edit_move_tile, info.state.label),
                 mContext.getString(R.string.accessibility_qs_edit_remove_tile, info.state.label),
@@ -307,7 +311,9 @@
                         if (which == 0) {
                             startAccessibleDrag(position);
                         } else {
-                            move(position, mEditIndex, v);
+                            move(position, info.isSystem ? mEditIndex : mTileDividerIndex, v);
+                            notifyItemChanged(mTileDividerIndex);
+                            notifyDataSetChanged();
                         }
                     }
                 }).setNegativeButton(android.R.string.cancel, null)
@@ -331,40 +337,12 @@
     }
 
     private boolean move(int from, int to, View v) {
-        if (to >= mEditIndex) {
-            if (from < mEditIndex) {
-                // Removing a tile.
-                // Sort tiles into system/non-system groups.
-                TileInfo tile = mTiles.get(from);
-                if (tile.isSystem) {
-                    if (to > mTileDividerIndex) {
-                        to = mTileDividerIndex;
-                    }
-                } else {
-                    if (mTileDividerIndex == mTiles.size() - 1) {
-                        notifyItemChanged(mTileDividerIndex);
-                    }
-                    if (to <= mTileDividerIndex) {
-                        to = mTileDividerIndex;
-                    }
-                }
-            } else {
-                if (to > mEditIndex) {
-                    // Don't allow tiles to be dragged around when they aren't added.
-                    to = from;
-                }
-                // Allow the case where to == mEditIndex to fall through and swap which
-                // side the tile is currently on.
-                // This lets the the cases where all tiles are on one side of the line
-                // work.
-            }
+        if (to == from) {
+            return true;
         }
         CharSequence fromLabel = mTiles.get(from).state.label;
         move(from, to, mTiles);
         updateDividerLocations();
-        if (to == from) {
-            return true;
-        }
         CharSequence announcement;
         if (to >= mEditIndex) {
             MetricsLogger.action(mContext, MetricsProto.MetricsEvent.ACTION_QS_EDIT_REMOVE_SPEC,
@@ -424,7 +402,6 @@
     private <T> void move(int from, int to, List<T> list) {
         list.add(to, list.remove(from));
         notifyItemMoved(from, to);
-        notifyItemChanged(to);
     }
 
     public class Holder extends ViewHolder {
@@ -496,7 +473,7 @@
             for (int i = 0; i < childCount; i++) {
                 final View child = parent.getChildAt(i);
                 final ViewHolder holder = parent.getChildViewHolder(child);
-                if (holder.getAdapterPosition() < mEditIndex) {
+                if (holder.getAdapterPosition() < mEditIndex && !(child instanceof TextView)) {
                     continue;
                 }
 
@@ -527,7 +504,15 @@
         @Override
         public void onSelectedChanged(ViewHolder viewHolder, int actionState) {
             super.onSelectedChanged(viewHolder, actionState);
+            if (actionState != ItemTouchHelper.ACTION_STATE_DRAG) {
+                viewHolder = null;
+            }
+            if (viewHolder == mCurrentDrag) return;
             if (mCurrentDrag != null) {
+                int position = mCurrentDrag.getAdapterPosition();
+                TileInfo info = mTiles.get(position);
+                mCurrentDrag.mTileView.setShowAppLabel(
+                        position > mEditIndex && !info.isSystem);
                 mCurrentDrag.stopDrag();
                 mCurrentDrag = null;
             }
@@ -544,6 +529,12 @@
         }
 
         @Override
+        public boolean canDropOver(RecyclerView recyclerView, ViewHolder current,
+                ViewHolder target) {
+            return target.getAdapterPosition() <= mEditIndex + 1;
+        }
+
+        @Override
         public int getMovementFlags(RecyclerView recyclerView, ViewHolder viewHolder) {
             if (viewHolder.getItemViewType() == TYPE_EDIT) {
                 return makeMovementFlags(0, 0);
diff --git a/packages/SystemUI/src/com/android/systemui/qs/customize/TileQueryHelper.java b/packages/SystemUI/src/com/android/systemui/qs/customize/TileQueryHelper.java
index 777ed6a..1431b22 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/customize/TileQueryHelper.java
+++ b/packages/SystemUI/src/com/android/systemui/qs/customize/TileQueryHelper.java
@@ -155,7 +155,7 @@
                     addTile(spec, appLabel, state, false);
                     continue;
                 }
-                if (info.serviceInfo.icon == 0) {
+                if (info.serviceInfo.icon == 0 && info.serviceInfo.applicationInfo.icon == 0) {
                     continue;
                 }
                 Drawable icon = info.serviceInfo.loadIcon(pm);
diff --git a/packages/SystemUI/src/com/android/systemui/qs/external/CustomTile.java b/packages/SystemUI/src/com/android/systemui/qs/external/CustomTile.java
index 23a3ca1..d3f5d26 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/external/CustomTile.java
+++ b/packages/SystemUI/src/com/android/systemui/qs/external/CustomTile.java
@@ -71,17 +71,12 @@
         super(host);
         mWindowManager = WindowManagerGlobal.getWindowManagerService();
         mComponent = ComponentName.unflattenFromString(action);
+        mTile = new Tile(mComponent);
+        setTileIcon();
         mServiceManager = host.getTileServices().getTileWrapper(this);
         mService = mServiceManager.getTileService();
         mServiceManager.setTileChangeListener(this);
-        mTile = new Tile(mComponent);
         mUser = ActivityManager.getCurrentUser();
-        setTileIcon();
-        try {
-            mService.setQSTile(mTile);
-        } catch (RemoteException e) {
-            // Called through wrapper, won't happen here.
-        }
     }
 
     private void setTileIcon() {
@@ -89,11 +84,13 @@
             PackageManager pm = mContext.getPackageManager();
             ServiceInfo info = pm.getServiceInfo(mComponent,
                     PackageManager.MATCH_ENCRYPTION_AWARE_AND_UNAWARE);
+            int icon = info.icon != 0 ? info.icon
+                    : info.applicationInfo.icon;
             // Update the icon if its not set or is the default icon.
             boolean updateIcon = mTile.getIcon() == null
                     || iconEquals(mTile.getIcon(), mDefaultIcon);
-            mDefaultIcon = info.icon != 0 ? android.graphics.drawable.Icon
-                    .createWithResource(mComponent.getPackageName(), info.icon) : null;
+            mDefaultIcon = icon != 0 ? android.graphics.drawable.Icon
+                    .createWithResource(mComponent.getPackageName(), icon) : null;
             if (updateIcon) {
                 mTile.setIcon(mDefaultIcon);
             }
diff --git a/packages/SystemUI/src/com/android/systemui/qs/external/QSTileServiceWrapper.java b/packages/SystemUI/src/com/android/systemui/qs/external/QSTileServiceWrapper.java
index 3830ac5..407453c 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/external/QSTileServiceWrapper.java
+++ b/packages/SystemUI/src/com/android/systemui/qs/external/QSTileServiceWrapper.java
@@ -35,16 +35,6 @@
         return mService.asBinder();
     }
 
-    public boolean setQSTile(Tile tile) {
-        try {
-            mService.setQSTile(tile);
-            return true;
-        } catch (Exception e) {
-            Log.d(TAG, "Caught exception from TileService", e);
-            return false;
-        }
-    }
-
     public boolean onTileAdded() {
         try {
             mService.onTileAdded();
@@ -95,16 +85,6 @@
         }
     }
 
-    public boolean setQSService(IQSService service) {
-        try {
-            mService.setQSService(service);
-            return true;
-        } catch (Exception e) {
-            Log.d(TAG, "Caught exception from TileService", e);
-            return false;
-        }
-    }
-
     public boolean onUnlockComplete() {
         try {
             mService.onUnlockComplete();
diff --git a/packages/SystemUI/src/com/android/systemui/qs/external/TileLifecycleManager.java b/packages/SystemUI/src/com/android/systemui/qs/external/TileLifecycleManager.java
index 87d6307..d68502e 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/external/TileLifecycleManager.java
+++ b/packages/SystemUI/src/com/android/systemui/qs/external/TileLifecycleManager.java
@@ -71,23 +71,23 @@
     private Set<Integer> mQueuedMessages = new ArraySet<>();
     private QSTileServiceWrapper mWrapper;
     private boolean mListening;
-    private Tile mTile;
     private IBinder mClickBinder;
 
     private int mBindTryCount;
     private boolean mBound;
     @VisibleForTesting
     boolean mReceiverRegistered;
-    private IQSService mService;
     private boolean mUnbindImmediate;
     private TileChangeListener mChangeListener;
     // Return value from bindServiceAsUser, determines whether safe to call unbind.
     private boolean mIsBound;
 
-    public TileLifecycleManager(Handler handler, Context context, Intent intent, UserHandle user) {
+    public TileLifecycleManager(Handler handler, Context context, IQSService service,
+            Tile tile, Intent intent, UserHandle user) {
         mContext = context;
         mHandler = handler;
         mIntent = intent;
+        mIntent.putExtra(TileService.EXTRA_SERVICE, service.asBinder());
         mUser = user;
         if (DEBUG) Log.d(TAG, "Creating " + mIntent + " " + mUser);
     }
@@ -164,14 +164,6 @@
             service.linkToDeath(this, 0);
         } catch (RemoteException e) {
         }
-        if (!wrapper.setQSService(mService)) {
-            handleDeath();
-            return;
-        }
-        if (!wrapper.setQSTile(mTile)) {
-            handleDeath();
-            return;
-        }
         mWrapper = wrapper;
         handlePendingMessages();
     }
@@ -255,15 +247,6 @@
         }
     }
 
-    @Override
-    public void setQSTile(Tile tile) {
-        if (DEBUG) Log.d(TAG, "setQSTile " + tile);
-        mTile = tile;
-        if (mWrapper != null && !mWrapper.setQSTile(tile)) {
-            handleDeath();
-        }
-    }
-
     private boolean checkComponentState() {
         PackageManager pm = mContext.getPackageManager();
         if (!isPackageAvailable(pm) || !isComponentAvailable(pm)) {
@@ -347,14 +330,6 @@
     }
 
     @Override
-    public void setQSService(IQSService service) {
-        mService = service;
-        if (mWrapper == null || !mWrapper.setQSService(service)) {
-            handleDeath();
-        }
-    }
-
-    @Override
     public void onTileAdded() {
         if (DEBUG) Log.d(TAG, "onTileAdded");
         if (mWrapper == null || !mWrapper.onTileAdded()) {
diff --git a/packages/SystemUI/src/com/android/systemui/qs/external/TileServiceManager.java b/packages/SystemUI/src/com/android/systemui/qs/external/TileServiceManager.java
index ce9bbf4..3d030f9 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/external/TileServiceManager.java
+++ b/packages/SystemUI/src/com/android/systemui/qs/external/TileServiceManager.java
@@ -27,6 +27,7 @@
 import android.os.Handler;
 import android.os.UserHandle;
 import android.service.quicksettings.IQSTileService;
+import android.service.quicksettings.Tile;
 import android.service.quicksettings.TileService;
 import android.support.annotation.VisibleForTesting;
 import android.util.Log;
@@ -68,9 +69,10 @@
     // This defaults to true to ensure tiles start out unavailable.
     private boolean mPendingBind = true;
 
-    TileServiceManager(TileServices tileServices, Handler handler, ComponentName component) {
+    TileServiceManager(TileServices tileServices, Handler handler, ComponentName component,
+            Tile tile) {
         this(tileServices, handler, new TileLifecycleManager(handler,
-                tileServices.getContext(), new Intent().setComponent(component),
+                tileServices.getContext(), tileServices, tile, new Intent().setComponent(component),
                 new UserHandle(ActivityManager.getCurrentUser())));
     }
 
@@ -80,7 +82,6 @@
         mServices = tileServices;
         mHandler = handler;
         mStateManager = tileLifecycleManager;
-        mStateManager.setQSService(tileServices);
 
         IntentFilter filter = new IntentFilter();
         filter.addAction(Intent.ACTION_PACKAGE_REMOVED);
diff --git a/packages/SystemUI/src/com/android/systemui/qs/external/TileServices.java b/packages/SystemUI/src/com/android/systemui/qs/external/TileServices.java
index 2ab6b5f..6f0bed2 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/external/TileServices.java
+++ b/packages/SystemUI/src/com/android/systemui/qs/external/TileServices.java
@@ -78,7 +78,7 @@
 
     public TileServiceManager getTileWrapper(CustomTile tile) {
         ComponentName component = tile.getComponent();
-        TileServiceManager service = onCreateTileService(component);
+        TileServiceManager service = onCreateTileService(component, tile.getQsTile());
         synchronized (mServices) {
             mServices.put(tile, service);
             mTiles.put(component, tile);
@@ -86,8 +86,8 @@
         return service;
     }
 
-    protected TileServiceManager onCreateTileService(ComponentName component) {
-        return new TileServiceManager(this, mHandler, component);
+    protected TileServiceManager onCreateTileService(ComponentName component, Tile tile) {
+        return new TileServiceManager(this, mHandler, component, tile);
     }
 
     public void freeService(CustomTile tile, TileServiceManager service) {
@@ -263,6 +263,16 @@
     }
 
     @Override
+    public Tile getTile(ComponentName componentName) {
+        verifyCaller(componentName.getPackageName());
+        CustomTile customTile = getTileForComponent(componentName);
+        if (customTile != null) {
+            return customTile.getQsTile();
+        }
+        return null;
+    }
+
+    @Override
     public void startUnlockAndRun(Tile tile) {
         ComponentName componentName = tile.getComponentName();
         verifyCaller(componentName.getPackageName());
diff --git a/packages/SystemUI/src/com/android/systemui/qs/tiles/CellularTile.java b/packages/SystemUI/src/com/android/systemui/qs/tiles/CellularTile.java
index 18191cf..0de5105 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/tiles/CellularTile.java
+++ b/packages/SystemUI/src/com/android/systemui/qs/tiles/CellularTile.java
@@ -95,14 +95,6 @@
     }
 
     @Override
-    protected void handleSecondaryClick() {
-        boolean dataEnabled = mDataController.isMobileDataSupported()
-                && mDataController.isMobileDataEnabled();
-        MetricsLogger.action(mContext, MetricsEvent.QS_CELLULAR_TOGGLE, !dataEnabled);
-        mDataController.setMobileDataEnabled(!dataEnabled);
-    }
-
-    @Override
     public CharSequence getTileLabel() {
         return mContext.getString(R.string.quick_settings_cellular_detail_title);
     }
@@ -152,8 +144,8 @@
         }
         state.contentDescription = state.contentDescription + "," + r.getString(
                 R.string.accessibility_quick_settings_open_settings, getTileLabel());
-        state.expandedAccessibilityClassName = Button.class.getName();
-        state.minimalAccessibilityClassName = Switch.class.getName();
+        state.minimalAccessibilityClassName = state.expandedAccessibilityClassName
+                = Button.class.getName();
         state.value = mDataController.isMobileDataSupported()
                 && mDataController.isMobileDataEnabled();
     }
diff --git a/packages/SystemUI/src/com/android/systemui/qs/tiles/HotspotTile.java b/packages/SystemUI/src/com/android/systemui/qs/tiles/HotspotTile.java
index 1c134c1..d3434e5 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/tiles/HotspotTile.java
+++ b/packages/SystemUI/src/com/android/systemui/qs/tiles/HotspotTile.java
@@ -36,15 +36,16 @@
 import com.android.systemui.statusbar.policy.HotspotController;
 
 /** Quick settings tile: Hotspot **/
-public class HotspotTile extends QSTile<QSTile.BooleanState> {
+public class HotspotTile extends QSTile<QSTile.AirplaneBooleanState> {
     private final AnimationIcon mEnable =
             new AnimationIcon(R.drawable.ic_hotspot_enable_animation,
                     R.drawable.ic_hotspot_disable);
     private final AnimationIcon mDisable =
             new AnimationIcon(R.drawable.ic_hotspot_disable_animation,
                     R.drawable.ic_hotspot_enable);
-    private final Icon mUnavailable =
-            ResourceIcon.get(R.drawable.ic_hotspot_unavailable);
+    private final Icon mDisableNoAnimation = ResourceIcon.get(R.drawable.ic_hotspot_enable);
+    private final Icon mUnavailable = ResourceIcon.get(R.drawable.ic_hotspot_unavailable);
+
     private final HotspotController mController;
     private final Callback mCallback = new Callback();
     private final GlobalSetting mAirplaneMode;
@@ -72,8 +73,8 @@
     }
 
     @Override
-    public BooleanState newTileState() {
-        return new BooleanState();
+    public AirplaneBooleanState newTileState() {
+        return new AirplaneBooleanState();
     }
 
     @Override
@@ -84,10 +85,8 @@
             mController.addCallback(mCallback);
             final IntentFilter filter = new IntentFilter();
             filter.addAction(Intent.ACTION_AIRPLANE_MODE_CHANGED);
-            mContext.registerReceiver(mReceiver, filter);
         } else {
             mController.removeCallback(mCallback);
-            mContext.unregisterReceiver(mReceiver);
         }
         mAirplaneMode.setListening(listening);
     }
@@ -113,7 +112,7 @@
     }
 
     @Override
-    protected void handleUpdateState(BooleanState state, Object arg) {
+    protected void handleUpdateState(AirplaneBooleanState state, Object arg) {
         state.label = mContext.getString(R.string.quick_settings_hotspot_label);
 
         checkIfRestrictionEnforcedByAdminOnly(state, UserManager.DISALLOW_CONFIG_TETHERING);
@@ -123,12 +122,16 @@
             state.value = mController.isHotspotEnabled();
         }
         state.icon = state.value ? mEnable : mDisable;
-        if (mAirplaneMode.getValue() != 0) {
+        boolean wasAirplane = state.isAirplaneMode;
+        state.isAirplaneMode = mAirplaneMode.getValue() != 0;
+        if (state.isAirplaneMode) {
             final int disabledColor = mHost.getContext().getColor(R.color.qs_tile_tint_unavailable);
             state.label = new SpannableStringBuilder().append(state.label,
                     new ForegroundColorSpan(disabledColor),
                     SpannableStringBuilder.SPAN_INCLUSIVE_INCLUSIVE);
             state.icon = mUnavailable;
+        } else if (wasAirplane) {
+            state.icon = mDisableNoAnimation;
         }
         state.minimalAccessibilityClassName = state.expandedAccessibilityClassName
                 = Switch.class.getName();
@@ -155,13 +158,4 @@
             refreshState(enabled);
         }
     };
-
-    private final BroadcastReceiver mReceiver = new BroadcastReceiver() {
-        @Override
-        public void onReceive(Context context, Intent intent) {
-            if (Intent.ACTION_AIRPLANE_MODE_CHANGED.equals(intent.getAction())) {
-                refreshState();
-            }
-        }
-    };
 }
diff --git a/packages/SystemUI/src/com/android/systemui/recents/misc/SystemServicesProxy.java b/packages/SystemUI/src/com/android/systemui/recents/misc/SystemServicesProxy.java
index 1a944ce..94231c6 100644
--- a/packages/SystemUI/src/com/android/systemui/recents/misc/SystemServicesProxy.java
+++ b/packages/SystemUI/src/com/android/systemui/recents/misc/SystemServicesProxy.java
@@ -29,6 +29,7 @@
 import android.app.AppGlobals;
 import android.app.IActivityManager;
 import android.app.ITaskStackListener;
+import android.app.UiModeManager;
 import android.content.ComponentName;
 import android.content.ContentResolver;
 import android.content.Context;
@@ -38,6 +39,7 @@
 import android.content.pm.IPackageManager;
 import android.content.pm.PackageManager;
 import android.content.pm.ResolveInfo;
+import android.content.res.Configuration;
 import android.content.res.Resources;
 import android.graphics.Bitmap;
 import android.graphics.BitmapFactory;
@@ -83,6 +85,7 @@
 
 import java.io.IOException;
 import java.util.ArrayList;
+import java.util.Collections;
 import java.util.Iterator;
 import java.util.List;
 import java.util.Random;
@@ -234,6 +237,13 @@
             mDummyIcon = Bitmap.createBitmap(1, 1, Bitmap.Config.ARGB_8888);
             mDummyIcon.eraseColor(0xFF999999);
         }
+
+        UiModeManager uiModeManager = (UiModeManager) context.
+                getSystemService(Context.UI_MODE_SERVICE);
+        if (uiModeManager.getCurrentModeType() == Configuration.UI_MODE_TYPE_TELEVISION) {
+            Collections.addAll(sRecentsBlacklist,
+                    res.getStringArray(R.array.recents_tv_blacklist_array));
+        }
     }
 
     /**
diff --git a/packages/SystemUI/src/com/android/systemui/screenshot/GlobalScreenshot.java b/packages/SystemUI/src/com/android/systemui/screenshot/GlobalScreenshot.java
index e6cbbea..d789477 100644
--- a/packages/SystemUI/src/com/android/systemui/screenshot/GlobalScreenshot.java
+++ b/packages/SystemUI/src/com/android/systemui/screenshot/GlobalScreenshot.java
@@ -60,6 +60,7 @@
 import android.widget.ImageView;
 
 import com.android.systemui.R;
+import com.android.systemui.SystemUI;
 
 import java.io.File;
 import java.io.FileOutputStream;
@@ -165,11 +166,6 @@
         c.drawColor(overlayColor);
         c.setBitmap(null);
 
-        // swap "System UI" out for "Android System"
-        final Bundle extras = new Bundle();
-        extras.putString(Notification.EXTRA_SUBSTITUTE_APP_NAME,
-                context.getString(com.android.internal.R.string.android_system_label));
-
         // Show the intermediate notification
         mTickerAddSpace = !mTickerAddSpace;
         mNotificationManager = nManager;
@@ -187,9 +183,9 @@
                 .setCategory(Notification.CATEGORY_PROGRESS)
                 .setWhen(now)
                 .setShowWhen(true)
-                .addExtras(extras)
                 .setColor(r.getColor(
                         com.android.internal.R.color.system_notification_accent_color));
+        SystemUI.overrideNotificationAppName(context, mPublicNotificationBuilder);
 
         mNotificationBuilder = new Notification.Builder(context)
             .setTicker(r.getString(R.string.screenshot_saving_ticker)
@@ -199,11 +195,11 @@
             .setSmallIcon(R.drawable.stat_notify_image)
             .setWhen(now)
             .setShowWhen(true)
-            .addExtras(extras)
             .setColor(r.getColor(com.android.internal.R.color.system_notification_accent_color))
             .setStyle(mNotificationStyle)
             .setPublicVersion(mPublicNotificationBuilder.build());
         mNotificationBuilder.setFlag(Notification.FLAG_NO_CLEAR, true);
+        SystemUI.overrideNotificationAppName(context, mNotificationBuilder);
 
         mNotificationManager.notify(R.id.notification_screenshot, mNotificationBuilder.build());
 
@@ -864,6 +860,7 @@
             .setAutoCancel(true)
             .setColor(context.getColor(
                         com.android.internal.R.color.system_notification_accent_color));
+        SystemUI.overrideNotificationAppName(context, b);
 
         Notification n = new Notification.BigTextStyle(b)
                 .bigText(errorMsg)
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java
index 91889d3..eb69f55 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java
@@ -134,6 +134,7 @@
             = SystemProperties.getBoolean("debug.child_notifs", true);
     public static final boolean FORCE_REMOTE_INPUT_HISTORY =
             SystemProperties.getBoolean("debug.force_remoteinput_history", false);
+    private static boolean ENABLE_LOCK_SCREEN_ALLOW_REMOTE_INPUT = false;
 
     protected static final int MSG_SHOW_RECENT_APPS = 1019;
     protected static final int MSG_HIDE_RECENT_APPS = 1020;
@@ -704,10 +705,13 @@
                 Settings.Secure.getUriFor(Settings.Secure.LOCK_SCREEN_SHOW_NOTIFICATIONS), false,
                 mSettingsObserver,
                 UserHandle.USER_ALL);
-        mContext.getContentResolver().registerContentObserver(
-                Settings.Secure.getUriFor(Settings.Secure.LOCK_SCREEN_ALLOW_REMOTE_INPUT), false,
-                mSettingsObserver,
-                UserHandle.USER_ALL);
+        if (ENABLE_LOCK_SCREEN_ALLOW_REMOTE_INPUT) {
+            mContext.getContentResolver().registerContentObserver(
+                    Settings.Secure.getUriFor(Settings.Secure.LOCK_SCREEN_ALLOW_REMOTE_INPUT),
+                    false,
+                    mSettingsObserver,
+                    UserHandle.USER_ALL);
+        }
 
         mContext.getContentResolver().registerContentObserver(
                 Settings.Secure.getUriFor(Settings.Secure.LOCK_SCREEN_ALLOW_PRIVATE_NOTIFICATIONS),
@@ -840,7 +844,6 @@
                     new Intent(BANNER_ACTION_SETUP).setPackage(packageName),
                     PendingIntent.FLAG_CANCEL_CURRENT);
 
-            final Resources res = mContext.getResources();
             final int colorRes = com.android.internal.R.color.system_notification_accent_color;
             Notification.Builder note = new Notification.Builder(mContext)
                     .setSmallIcon(R.drawable.ic_android)
@@ -856,6 +859,7 @@
                     .addAction(R.drawable.ic_settings,
                             mContext.getString(R.string.hidden_notifications_setup),
                             setupIntent);
+            overrideNotificationAppName(mContext, note);
 
             NotificationManager noMan =
                     (NotificationManager) mContext.getSystemService(Context.NOTIFICATION_SERVICE);
@@ -1096,6 +1100,7 @@
             settingsButton.setVisibility(View.GONE);
         }
 
+        guts.bindImportance(pmUser, sbn, row, mNotificationData.getImportance(sbn.getKey()));
         row.findViewById(R.id.done).setOnClickListener(new View.OnClickListener() {
             @Override
             public void onClick(View v) {
@@ -1116,7 +1121,6 @@
                 }
             }
         });
-        guts.bindImportance(pmUser, sbn, row, mNotificationData.getImportance(sbn.getKey()));
     }
 
     private void saveImportanceCloseControls(StatusBarNotification sbn,
@@ -2304,16 +2308,20 @@
         final boolean allowedByDpm = (dpmFlags
                 & DevicePolicyManager.KEYGUARD_DISABLE_SECURE_NOTIFICATIONS) == 0;
 
-        final boolean remoteInput = Settings.Secure.getIntForUser(mContext.getContentResolver(),
-                Settings.Secure.LOCK_SCREEN_ALLOW_REMOTE_INPUT,
-                0,
-                mCurrentUserId) != 0;
-        final boolean remoteInputDpm = (dpmFlags
-                & DevicePolicyManager.KEYGUARD_DISABLE_REMOTE_INPUT) == 0;
-
-
         setShowLockscreenNotifications(show && allowedByDpm);
-        setLockScreenAllowRemoteInput(remoteInput && remoteInputDpm);
+
+        if (ENABLE_LOCK_SCREEN_ALLOW_REMOTE_INPUT) {
+            final boolean remoteInput = Settings.Secure.getIntForUser(mContext.getContentResolver(),
+                    Settings.Secure.LOCK_SCREEN_ALLOW_REMOTE_INPUT,
+                    0,
+                    mCurrentUserId) != 0;
+            final boolean remoteInputDpm =
+                    (dpmFlags & DevicePolicyManager.KEYGUARD_DISABLE_REMOTE_INPUT) == 0;
+
+            setLockScreenAllowRemoteInput(remoteInput && remoteInputDpm);
+        } else {
+            setLockScreenAllowRemoteInput(false);
+        }
     }
 
     protected abstract void setAreThereNotifications();
@@ -2483,7 +2491,7 @@
     }
 
     protected boolean shouldPeek(Entry entry, StatusBarNotification sbn) {
-        if (isDeviceInVrMode()) {
+        if (!mUseHeadsUp || isDeviceInVrMode()) {
             return false;
         }
 
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/ExpandableNotificationRow.java b/packages/SystemUI/src/com/android/systemui/statusbar/ExpandableNotificationRow.java
index e1d4c8a..f09eae8 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/ExpandableNotificationRow.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/ExpandableNotificationRow.java
@@ -185,6 +185,7 @@
                 }
     };
     private OnClickListener mOnClickListener;
+    private boolean mHeadsupDisappearRunning;
     private View mChildAfterViewWhenDismissed;
     private View mGroupParentWhenDismissed;
     private boolean mRefocusOnDismiss;
@@ -759,15 +760,17 @@
         mRemoved = true;
 
         mPrivateLayout.setRemoved();
-        if (mChildrenContainer != null) {
-            mChildrenContainer.setRemoved();
-        }
     }
 
     public NotificationChildrenContainer getChildrenContainer() {
         return mChildrenContainer;
     }
 
+    public void setHeadsupDisappearRunning(boolean running) {
+        mHeadsupDisappearRunning = running;
+        mPrivateLayout.setHeadsupDisappearRunning(running);
+    }
+
     public View getChildAfterViewWhenDismissed() {
         return mChildAfterViewWhenDismissed;
     }
@@ -1173,8 +1176,8 @@
             return getMinHeight();
         } else if (mIsSummaryWithChildren && !mOnKeyguard) {
             return mChildrenContainer.getIntrinsicHeight();
-        } else if (mIsHeadsUp) {
-            if (isPinned()) {
+        } else if (mIsHeadsUp || mHeadsupDisappearRunning) {
+            if (isPinned() || mHeadsupDisappearRunning) {
                 return getPinnedHeadsUpHeight(true /* atLeastMinHeight */);
             } else if (isExpanded()) {
                 return Math.max(getMaxExpandHeight(), mHeadsUpHeight);
@@ -1300,6 +1303,10 @@
         if (!animated) {
             mPublicLayout.animate().cancel();
             mPrivateLayout.animate().cancel();
+            if (mChildrenContainer != null) {
+                mChildrenContainer.animate().cancel();
+                mChildrenContainer.setAlpha(1f);
+            }
             mPublicLayout.setAlpha(1f);
             mPrivateLayout.setAlpha(1f);
             mPublicLayout.setVisibility(mShowingPublic ? View.VISIBLE : View.INVISIBLE);
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationContentView.java b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationContentView.java
index 30ac9ca..9fd09d9 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationContentView.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationContentView.java
@@ -119,6 +119,7 @@
 
     private int mContentHeightAtAnimationStart = UNDEFINED;
     private boolean mFocusOnVisibilityChange;
+    private boolean mHeadsupDisappearRunning;
 
 
     public NotificationContentView(Context context, AttributeSet attrs) {
@@ -446,7 +447,8 @@
             boolean transitioningBetweenHunAndExpanded =
                     isTransitioningFromTo(VISIBLE_TYPE_HEADSUP, VISIBLE_TYPE_EXPANDED) ||
                     isTransitioningFromTo(VISIBLE_TYPE_EXPANDED, VISIBLE_TYPE_HEADSUP);
-            boolean pinned = !isVisibleOrTransitioning(VISIBLE_TYPE_CONTRACTED) && mIsHeadsUp;
+            boolean pinned = !isVisibleOrTransitioning(VISIBLE_TYPE_CONTRACTED)
+                    && (mIsHeadsUp || mHeadsupDisappearRunning);
             if (transitioningBetweenHunAndExpanded || pinned) {
                 return Math.min(mHeadsUpChild.getHeight(), mExpandedChild.getHeight());
             }
@@ -830,7 +832,7 @@
             return VISIBLE_TYPE_SINGLELINE;
         }
 
-        if (mIsHeadsUp && mHeadsUpChild != null) {
+        if ((mIsHeadsUp || mHeadsupDisappearRunning) && mHeadsUpChild != null) {
             if (viewHeight <= mHeadsUpChild.getHeight() || noExpandedChild) {
                 return VISIBLE_TYPE_HEADSUP;
             } else {
@@ -1153,6 +1155,11 @@
         }
     }
 
+    public void setHeadsupDisappearRunning(boolean headsupDisappearRunning) {
+        mHeadsupDisappearRunning = headsupDisappearRunning;
+        selectLayout(false /* animate */, true /* force */);
+    }
+
     public void setFocusOnVisibilityChange() {
         mFocusOnVisibilityChange = true;
     }
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/SignalClusterView.java b/packages/SystemUI/src/com/android/systemui/statusbar/SignalClusterView.java
index 2b59c68..599e575a 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/SignalClusterView.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/SignalClusterView.java
@@ -234,6 +234,14 @@
         super.onDetachedFromWindow();
     }
 
+    @Override
+    protected void onLayout(boolean changed, int l, int t, int r, int b) {
+        super.onLayout(changed, l, t, r, b);
+
+        // Re-run all checks against the tint area for all icons
+        applyIconTint();
+    }
+
     // From SecurityController.
     @Override
     public void onStateChanged() {
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/ViewTransformationHelper.java b/packages/SystemUI/src/com/android/systemui/statusbar/ViewTransformationHelper.java
index f75f3574..1ff2b13 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/ViewTransformationHelper.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/ViewTransformationHelper.java
@@ -20,6 +20,7 @@
 import android.animation.AnimatorListenerAdapter;
 import android.animation.ValueAnimator;
 import android.util.ArrayMap;
+import android.util.ArraySet;
 import android.view.View;
 import android.view.ViewGroup;
 
@@ -194,7 +195,7 @@
         for (Integer viewType : mTransformedViews.keySet()) {
             TransformState ownState = getCurrentState(viewType);
             if (ownState != null) {
-                ownState.setVisible(visible);
+                ownState.setVisible(visible, false /* force */);
                 ownState.recycle();
             }
         }
@@ -252,6 +253,19 @@
         }
     }
 
+    public void resetTransformedView(View view) {
+        TransformState state = TransformState.createFrom(view);
+        state.setVisible(true /* visible */, true /* force */);
+        state.recycle();
+    }
+
+    /**
+     * @return a set of all views are being transformed.
+     */
+    public ArraySet<View> getAllTransformingViews() {
+        return new ArraySet<>(mTransformedViews.values());
+    }
+
     public static abstract class CustomTransformation {
         /**
          * Transform a state to the given view
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/HeaderTransformState.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/HeaderTransformState.java
index 8463e06..9501f90 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/HeaderTransformState.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/HeaderTransformState.java
@@ -123,8 +123,9 @@
         }
     }
 
-    public void setVisible(boolean visible) {
-        super.setVisible(visible);
+    @Override
+    public void setVisible(boolean visible, boolean force) {
+        super.setVisible(visible, force);
         if (!(mTransformedView instanceof NotificationHeaderView)) {
             return;
         }
@@ -132,11 +133,13 @@
         int childCount = header.getChildCount();
         for (int i = 0; i < childCount; i++) {
             View headerChild = header.getChildAt(i);
-            if (headerChild.getVisibility() == View.GONE) {
+            if (!force && headerChild.getVisibility() == View.GONE) {
                 continue;
             }
             headerChild.animate().cancel();
-            headerChild.setVisibility(visible ? View.VISIBLE : View.INVISIBLE);
+            if (headerChild.getVisibility() != View.GONE) {
+                headerChild.setVisibility(visible ? View.VISIBLE : View.INVISIBLE);
+            }
             if (headerChild == mExpandButton) {
                 headerChild.setAlpha(visible ? 1.0f : 0.0f);
             }
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/NotificationHeaderViewWrapper.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/NotificationHeaderViewWrapper.java
index 1bfbaa2..7794d5b 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/NotificationHeaderViewWrapper.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/NotificationHeaderViewWrapper.java
@@ -22,18 +22,17 @@
 import android.content.Context;
 import android.graphics.Color;
 import android.graphics.ColorFilter;
-import android.graphics.ColorMatrix;
 import android.graphics.ColorMatrixColorFilter;
 import android.graphics.PorterDuff;
 import android.graphics.PorterDuffColorFilter;
 import android.graphics.drawable.Drawable;
 import android.service.notification.StatusBarNotification;
+import android.util.ArraySet;
 import android.view.NotificationHeaderView;
 import android.view.View;
 import android.view.ViewGroup;
 import android.widget.ImageView;
 
-import com.android.systemui.Interpolators;
 import com.android.systemui.R;
 import com.android.systemui.ViewInvertHelper;
 import com.android.systemui.statusbar.ExpandableNotificationRow;
@@ -92,12 +91,25 @@
     @Override
     public void notifyContentUpdated(StatusBarNotification notification) {
         super.notifyContentUpdated(notification);
+
+        ArraySet<View> previousViews = mTransformationHelper.getAllTransformingViews();
+
         // Reinspect the notification.
         resolveHeaderViews();
         updateInvertHelper();
         updateTransformedTypes();
         addRemainingTransformTypes();
         updateCropToPaddingForImageViews();
+
+        // We need to reset all views that are no longer transforming in case a view was previously
+        // transformed, but now we decided to transform its container instead.
+        ArraySet<View> currentViews = mTransformationHelper.getAllTransformingViews();
+        for (int i = 0; i < previousViews.size(); i++) {
+            View view = previousViews.valueAt(i);
+            if (!currentViews.contains(view)) {
+                mTransformationHelper.resetTransformedView(view);
+            }
+        }
     }
 
     /**
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/TransformState.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/TransformState.java
index 7d3da1b..f0f5c8d 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/TransformState.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/TransformState.java
@@ -301,6 +301,9 @@
     }
 
     public static void setClippingDeactivated(final View transformedView, boolean deactivated) {
+        if (!(transformedView.getParent() instanceof ViewGroup)) {
+            return;
+        }
         ViewGroup view = (ViewGroup) transformedView.getParent();
         while (true) {
             ArraySet<View> clipSet = (ArraySet<View>) view.getTag(CLIP_CLIPPING_SET);
@@ -456,12 +459,14 @@
         mTransformationEndY = UNDEFINED;
     }
 
-    public void setVisible(boolean visible) {
-        if (mTransformedView.getVisibility() == View.GONE) {
+    public void setVisible(boolean visible, boolean force) {
+        if (!force && mTransformedView.getVisibility() == View.GONE) {
             return;
         }
+        if (mTransformedView.getVisibility() != View.GONE) {
+            mTransformedView.setVisibility(visible ? View.VISIBLE : View.INVISIBLE);
+        }
         mTransformedView.animate().cancel();
-        mTransformedView.setVisibility(visible ? View.VISIBLE : View.INVISIBLE);
         mTransformedView.setAlpha(visible ? 1.0f : 0.0f);
         resetTransformedView();
     }
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationGroupManager.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationGroupManager.java
index 9ecff18d..204ab7e 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationGroupManager.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationGroupManager.java
@@ -213,18 +213,18 @@
         return isGroupSuppressed(getGroupKey(sbn)) && sbn.getNotification().isGroupSummary();
     }
 
-    public boolean isOnlyChildInSuppressedGroup(StatusBarNotification sbn) {
-        return isGroupSuppressed(sbn.getGroupKey())
-                && isOnlyChild(sbn);
-    }
-
     private boolean isOnlyChild(StatusBarNotification sbn) {
         return !sbn.getNotification().isGroupSummary()
                 && getTotalNumberOfChildren(sbn) == 1;
     }
 
     public boolean isOnlyChildInGroup(StatusBarNotification sbn) {
-        return isOnlyChild(sbn) && getLogicalGroupSummary(sbn) != null;
+        if (!isOnlyChild(sbn)) {
+            return false;
+        }
+        ExpandableNotificationRow logicalGroupSummary = getLogicalGroupSummary(sbn);
+        return logicalGroupSummary != null
+                && !logicalGroupSummary.getStatusBarNotification().equals(sbn);
     }
 
     private int getTotalNumberOfChildren(StatusBarNotification sbn) {
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
index de5e06c..8201b06 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
@@ -1408,7 +1408,7 @@
         if (shadeEntry == null) {
             return;
         }
-        boolean isHeadsUped = mUseHeadsUp && shouldPeek(shadeEntry);
+        boolean isHeadsUped = shouldPeek(shadeEntry);
         if (isHeadsUped) {
             mHeadsUpManager.showNotification(shadeEntry);
             // Mark as seen immediately
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/QSTileHost.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/QSTileHost.java
index 68e5d0b..fa57775 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/QSTileHost.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/QSTileHost.java
@@ -29,6 +29,7 @@
 import android.os.UserHandle;
 import android.provider.Settings;
 import android.provider.Settings.Secure;
+import android.service.quicksettings.Tile;
 import android.text.TextUtils;
 import android.util.Log;
 import android.view.View;
@@ -399,10 +400,11 @@
             String tileSpec = previousTiles.get(i);
             if (!tileSpec.startsWith(CustomTile.PREFIX)) continue;
             if (!newTiles.contains(tileSpec)) {
-                Intent intent = new Intent().setComponent(
-                        CustomTile.getComponentFromSpec(tileSpec));
+                ComponentName component = CustomTile.getComponentFromSpec(tileSpec);
+                Intent intent = new Intent().setComponent(component);
                 TileLifecycleManager lifecycleManager = new TileLifecycleManager(new Handler(),
-                        mContext, intent, new UserHandle(ActivityManager.getCurrentUser()));
+                        mContext, mServices, new Tile(component), intent,
+                        new UserHandle(ActivityManager.getCurrentUser()));
                 lifecycleManager.onStopListening();
                 lifecycleManager.onTileRemoved();
                 lifecycleManager.flushMessagesAndUnbind();
@@ -412,10 +414,11 @@
             String tileSpec = newTiles.get(i);
             if (!tileSpec.startsWith(CustomTile.PREFIX)) continue;
             if (!previousTiles.contains(tileSpec)) {
-                Intent intent = new Intent().setComponent(
-                        CustomTile.getComponentFromSpec(tileSpec));
+                ComponentName component = CustomTile.getComponentFromSpec(tileSpec);
+                Intent intent = new Intent().setComponent(component);
                 TileLifecycleManager lifecycleManager = new TileLifecycleManager(new Handler(),
-                        mContext, intent, new UserHandle(ActivityManager.getCurrentUser()));
+                        mContext, mServices, new Tile(component), intent,
+                        new UserHandle(ActivityManager.getCurrentUser()));
                 lifecycleManager.onTileAdded();
                 lifecycleManager.flushMessagesAndUnbind();
             }
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/BluetoothControllerImpl.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/BluetoothControllerImpl.java
index 6439bea..014cc49 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/BluetoothControllerImpl.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/BluetoothControllerImpl.java
@@ -40,7 +40,6 @@
     private static final String TAG = "BluetoothController";
     private static final boolean DEBUG = Log.isLoggable(TAG, Log.DEBUG);
 
-    private final ArrayList<Callback> mCallbacks = new ArrayList<Callback>();
     private final LocalBluetoothManager mLocalBluetoothManager;
     private final UserManager mUserManager;
     private final int mCurrentUser;
@@ -78,7 +77,7 @@
         pw.print("  mEnabled="); pw.println(mEnabled);
         pw.print("  mConnectionState="); pw.println(stateToString(mConnectionState));
         pw.print("  mLastDevice="); pw.println(mLastDevice);
-        pw.print("  mCallbacks.size="); pw.println(mCallbacks.size());
+        pw.print("  mCallbacks.size="); pw.println(mHandler.mCallbacks.size());
         pw.println("  Bluetooth Devices:");
         for (CachedBluetoothDevice device :
                 mLocalBluetoothManager.getCachedDeviceManager().getCachedDevicesCopy()) {
@@ -106,13 +105,13 @@
 
     @Override
     public void addStateChangedCallback(Callback cb) {
-        mCallbacks.add(cb);
+        mHandler.obtainMessage(H.MSG_ADD_CALLBACK, cb).sendToTarget();
         mHandler.sendEmptyMessage(H.MSG_STATE_CHANGED);
     }
 
     @Override
     public void removeStateChangedCallback(Callback cb) {
-        mCallbacks.remove(cb);
+        mHandler.obtainMessage(H.MSG_REMOVE_CALLBACK, cb).sendToTarget();
     }
 
     @Override
@@ -236,8 +235,12 @@
     }
 
     private final class H extends Handler {
+        private final ArrayList<BluetoothController.Callback> mCallbacks = new ArrayList<>();
+
         private static final int MSG_PAIRED_DEVICES_CHANGED = 1;
         private static final int MSG_STATE_CHANGED = 2;
+        private static final int MSG_ADD_CALLBACK = 3;
+        private static final int MSG_REMOVE_CALLBACK = 4;
 
         @Override
         public void handleMessage(Message msg) {
@@ -248,6 +251,12 @@
                 case MSG_STATE_CHANGED:
                     fireStateChange();
                     break;
+                case MSG_ADD_CALLBACK:
+                    mCallbacks.add((BluetoothController.Callback) msg.obj);
+                    break;
+                case MSG_REMOVE_CALLBACK:
+                    mCallbacks.remove((BluetoothController.Callback) msg.obj);
+                    break;
             }
         }
 
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/HotspotControllerImpl.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/HotspotControllerImpl.java
index 9041341..4664851 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/HotspotControllerImpl.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/HotspotControllerImpl.java
@@ -16,12 +16,14 @@
 
 package com.android.systemui.statusbar.policy;
 
+import android.app.ActivityManager;
 import android.content.BroadcastReceiver;
 import android.content.Context;
 import android.content.Intent;
 import android.content.IntentFilter;
 import android.net.ConnectivityManager;
 import android.net.wifi.WifiManager;
+import android.os.UserManager;
 import android.util.Log;
 
 import java.io.FileDescriptor;
@@ -49,7 +51,8 @@
     @Override
     public boolean isHotspotSupported() {
         return mConnectivityManager.isTetheringSupported()
-                && mConnectivityManager.getTetherableWifiRegexs().length != 0;
+                && mConnectivityManager.getTetherableWifiRegexs().length != 0
+                && UserManager.get(mContext).isUserAdmin(ActivityManager.getCurrentUser());
     }
 
     public void dump(FileDescriptor fd, PrintWriter pw, String[] args) {
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/UserSwitcherController.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/UserSwitcherController.java
index 415b7a1..89d2712 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/UserSwitcherController.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/UserSwitcherController.java
@@ -51,6 +51,7 @@
 import com.android.settingslib.RestrictedLockUtils;
 import com.android.systemui.GuestResumeSessionReceiver;
 import com.android.systemui.R;
+import com.android.systemui.SystemUI;
 import com.android.systemui.SystemUISecondaryUserService;
 import com.android.systemui.qs.QSTile;
 import com.android.systemui.qs.tiles.UserDetailView;
@@ -523,7 +524,7 @@
         private void showLogoutNotification(int userId) {
             PendingIntent logoutPI = PendingIntent.getBroadcastAsUser(mContext,
                     0, new Intent(ACTION_LOGOUT_USER), 0, UserHandle.SYSTEM);
-            Notification notification = new Notification.Builder(mContext)
+            Notification.Builder builder = new Notification.Builder(mContext)
                     .setVisibility(Notification.VISIBILITY_SECRET)
                     .setPriority(Notification.PRIORITY_MIN)
                     .setSmallIcon(R.drawable.ic_person)
@@ -534,10 +535,10 @@
                     .setShowWhen(false)
                     .addAction(R.drawable.ic_delete,
                             mContext.getString(R.string.user_logout_notification_action),
-                            logoutPI)
-                    .build();
+                            logoutPI);
+            SystemUI.overrideNotificationAppName(mContext, builder);
             NotificationManager.from(mContext).notifyAsUser(TAG_LOGOUT_USER, ID_LOGOUT_USER,
-                    notification, new UserHandle(userId));
+                    builder.build(), new UserHandle(userId));
         }
     };
 
@@ -547,7 +548,7 @@
         PendingIntent removeGuestPI = canSwitchUsers ? PendingIntent.getBroadcastAsUser(mContext,
                 0, new Intent(ACTION_REMOVE_GUEST), 0, UserHandle.SYSTEM) : null;
 
-        Notification notification = new Notification.Builder(mContext)
+        Notification.Builder builder = new Notification.Builder(mContext)
                 .setVisibility(Notification.VISIBILITY_SECRET)
                 .setPriority(Notification.PRIORITY_MIN)
                 .setSmallIcon(R.drawable.ic_person)
@@ -557,10 +558,10 @@
                 .setShowWhen(false)
                 .addAction(R.drawable.ic_delete,
                         mContext.getString(R.string.guest_notification_remove_action),
-                        removeGuestPI)
-                .build();
+                        removeGuestPI);
+        SystemUI.overrideNotificationAppName(mContext, builder);
         NotificationManager.from(mContext).notifyAsUser(TAG_REMOVE_GUEST, ID_REMOVE_GUEST,
-                notification, new UserHandle(guestUserId));
+                builder.build(), new UserHandle(guestUserId));
     }
 
     private final Runnable mUnpauseRefreshUsers = new Runnable() {
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationChildrenContainer.java b/packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationChildrenContainer.java
index ba191cd..3c9373b 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationChildrenContainer.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationChildrenContainer.java
@@ -856,14 +856,6 @@
                 mNotificationParent.getNotificationColor());
     }
 
-    public void setRemoved() {
-        int childCount = mChildren.size();
-        for (int i = 0; i < childCount; i++) {
-            ExpandableNotificationRow child = mChildren.get(i);
-            child.setRemoved();
-        }
-    }
-
     public int getPositionInLinearLayout(View childInGroup) {
         int position = mNotificationHeaderMargin + mNotificatonTopPadding;
 
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayout.java b/packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayout.java
index 43f847c2..7de3879 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayout.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayout.java
@@ -1961,8 +1961,7 @@
                 // we're ending up at the same location as we are now, lets just skip the animation
                 bottom = finalBottom;
             } else {
-                bottom = (int) (lastView.getTranslationY() + lastView.getActualHeight()
-                        - lastView.getExtraBottomPadding());
+                bottom = (int) (lastView.getTranslationY() + lastView.getActualHeight());
                 bottom = Math.min(bottom, getHeight());
             }
         } else {
@@ -3690,6 +3689,9 @@
         if (mAnimationsEnabled) {
             mHeadsUpChangeAnimations.add(new Pair<>(row, isHeadsUp));
             mNeedsAnimation = true;
+            if (!mIsExpanded && !isHeadsUp) {
+                row.setHeadsupDisappearRunning(true);
+            }
             requestChildrenUpdate();
         }
     }
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/stack/StackScrollAlgorithm.java b/packages/SystemUI/src/com/android/systemui/statusbar/stack/StackScrollAlgorithm.java
index c8c7d3d..5eaea90 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/stack/StackScrollAlgorithm.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/stack/StackScrollAlgorithm.java
@@ -152,8 +152,10 @@
             float newYTranslation = state.yTranslation;
             float newHeight = state.height;
             float newNotificationEnd = newYTranslation + newHeight;
-
-            if (newYTranslation < previousNotificationEnd) {
+            boolean isHeadsUp = (child instanceof ExpandableNotificationRow)
+                    && ((ExpandableNotificationRow) child).isPinned();
+            if (newYTranslation < previousNotificationEnd && ambientState.isShadeExpanded()
+                    && !isHeadsUp) {
                 // The previous view is overlapping on top, clip!
                 float overlapAmount = previousNotificationEnd - newYTranslation;
                 state.clipTopAmount = (int) overlapAmount;
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/stack/StackStateAnimator.java b/packages/SystemUI/src/com/android/systemui/statusbar/stack/StackStateAnimator.java
index 7ac0d80..659eaf7 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/stack/StackStateAnimator.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/stack/StackStateAnimator.java
@@ -225,16 +225,22 @@
         // start height animation
         if (heightChanging) {
             startHeightAnimation(child, viewState, duration, delay);
+        }  else {
+            abortAnimation(child, TAG_ANIMATOR_HEIGHT);
         }
 
         // start shadow alpha animation
         if (shadowAlphaChanging) {
             startShadowAlphaAnimation(child, viewState, duration, delay);
+        } else {
+            abortAnimation(child, TAG_ANIMATOR_SHADOW_ALPHA);
         }
 
         // start top inset animation
         if (topInsetChanging) {
             startInsetAnimation(child, viewState, duration, delay);
+        } else {
+            abortAnimation(child, TAG_ANIMATOR_TOP_INSET);
         }
 
         // start dimmed animation
@@ -286,16 +292,29 @@
         // start translationY animation
         if (yTranslationChanging) {
             startYTranslationAnimation(child, viewState, duration, delay);
+        } else {
+            abortAnimation(child, TAG_ANIMATOR_TRANSLATION_Y);
         }
 
         // start translationZ animation
         if (zTranslationChanging) {
             startZTranslationAnimation(child, viewState, duration, delay);
+        } else {
+            abortAnimation(child, TAG_ANIMATOR_TRANSLATION_Z);
         }
 
         // start alpha animation
         if (alphaChanging && child.getTranslationX() == 0) {
             startAlphaAnimation(child, viewState, duration, delay);
+        }  else {
+            abortAnimation(child, TAG_ANIMATOR_ALPHA);
+        }
+    }
+
+    private void abortAnimation(View child, int animatorTag) {
+        Animator previousAnimator = getChildTag(child, animatorTag);
+        if (previousAnimator != null) {
+            previousAnimator.cancel();
         }
     }
 
@@ -413,7 +432,8 @@
         animator.setInterpolator(Interpolators.FAST_OUT_SLOW_IN);
         long newDuration = cancelAnimatorAndGetNewDuration(duration, previousAnimator);
         animator.setDuration(newDuration);
-        if (delay > 0 && (previousAnimator == null || !previousAnimator.isRunning())) {
+        if (delay > 0 && (previousAnimator == null
+                || previousAnimator.getAnimatedFraction() == 0)) {
             animator.setStartDelay(delay);
         }
         animator.addListener(getGlobalAnimationFinishedListener());
@@ -472,7 +492,8 @@
         animator.setInterpolator(Interpolators.FAST_OUT_SLOW_IN);
         long newDuration = cancelAnimatorAndGetNewDuration(duration, previousAnimator);
         animator.setDuration(newDuration);
-        if (delay > 0 && (previousAnimator == null || !previousAnimator.isRunning())) {
+        if (delay > 0 && (previousAnimator == null
+                || previousAnimator.getAnimatedFraction() == 0)) {
             animator.setStartDelay(delay);
         }
         animator.addListener(getGlobalAnimationFinishedListener());
@@ -548,7 +569,8 @@
         animator.setInterpolator(Interpolators.FAST_OUT_SLOW_IN);
         long newDuration = cancelAnimatorAndGetNewDuration(duration, previousAnimator);
         animator.setDuration(newDuration);
-        if (delay > 0 && (previousAnimator == null || !previousAnimator.isRunning())) {
+        if (delay > 0 && (previousAnimator == null
+                || previousAnimator.getAnimatedFraction() == 0)) {
             animator.setStartDelay(delay);
         }
         animator.addListener(getGlobalAnimationFinishedListener());
@@ -630,7 +652,8 @@
         });
         long newDuration = cancelAnimatorAndGetNewDuration(duration, previousAnimator);
         animator.setDuration(newDuration);
-        if (delay > 0 && (previousAnimator == null || !previousAnimator.isRunning())) {
+        if (delay > 0 && (previousAnimator == null
+                || previousAnimator.getAnimatedFraction() == 0)) {
             animator.setStartDelay(delay);
         }
         animator.addListener(getGlobalAnimationFinishedListener());
@@ -674,7 +697,8 @@
         animator.setInterpolator(Interpolators.FAST_OUT_SLOW_IN);
         long newDuration = cancelAnimatorAndGetNewDuration(duration, previousAnimator);
         animator.setDuration(newDuration);
-        if (delay > 0 && (previousAnimator == null || !previousAnimator.isRunning())) {
+        if (delay > 0 && (previousAnimator == null
+                || previousAnimator.getAnimatedFraction() == 0)) {
             animator.setStartDelay(delay);
         }
         animator.addListener(getGlobalAnimationFinishedListener());
@@ -729,10 +753,12 @@
         animator.setInterpolator(interpolator);
         long newDuration = cancelAnimatorAndGetNewDuration(duration, previousAnimator);
         animator.setDuration(newDuration);
-        if (delay > 0 && (previousAnimator == null || !previousAnimator.isRunning())) {
+        if (delay > 0 && (previousAnimator == null
+                || previousAnimator.getAnimatedFraction() == 0)) {
             animator.setStartDelay(delay);
         }
         animator.addListener(getGlobalAnimationFinishedListener());
+        final boolean isHeadsUpDisappear = mHeadsUpDisappearChildren.contains(child);
         // remove the tag when the animation is finished
         animator.addListener(new AnimatorListenerAdapter() {
             @Override
@@ -741,6 +767,9 @@
                 child.setTag(TAG_ANIMATOR_TRANSLATION_Y, null);
                 child.setTag(TAG_START_TRANSLATION_Y, null);
                 child.setTag(TAG_END_TRANSLATION_Y, null);
+                if (isHeadsUpDisappear) {
+                    ((ExpandableNotificationRow) child).setHeadsupDisappearRunning(false);
+                }
             }
         });
         startAnimator(animator);
diff --git a/packages/SystemUI/src/com/android/systemui/usb/StorageNotification.java b/packages/SystemUI/src/com/android/systemui/usb/StorageNotification.java
index 36dd727..97d5e10 100644
--- a/packages/SystemUI/src/com/android/systemui/usb/StorageNotification.java
+++ b/packages/SystemUI/src/com/android/systemui/usb/StorageNotification.java
@@ -198,7 +198,7 @@
                         rec.getNickname());
                 final CharSequence text = mContext.getString(R.string.ext_media_missing_message);
 
-                final Notification notif = new Notification.Builder(mContext)
+                Notification.Builder builder = new Notification.Builder(mContext)
                         .setSmallIcon(R.drawable.ic_sd_card_48dp)
                         .setColor(mContext.getColor(R.color.system_notification_accent_color))
                         .setContentTitle(title)
@@ -208,10 +208,11 @@
                         .setVisibility(Notification.VISIBILITY_PUBLIC)
                         .setLocalOnly(true)
                         .setCategory(Notification.CATEGORY_SYSTEM)
-                        .setDeleteIntent(buildSnoozeIntent(fsUuid))
-                        .build();
+                        .setDeleteIntent(buildSnoozeIntent(fsUuid));
+                SystemUI.overrideNotificationAppName(mContext, builder);
 
-                mNotificationManager.notifyAsUser(fsUuid, PRIVATE_ID, notif, UserHandle.ALL);
+                mNotificationManager.notifyAsUser(fsUuid, PRIVATE_ID, builder
+                        .build(), UserHandle.ALL);
             }
         }
     }
@@ -224,7 +225,7 @@
             final CharSequence text = mContext.getString(
                     R.string.ext_media_unsupported_notification_message, disk.getDescription());
 
-            final Notification notif = new Notification.Builder(mContext)
+            Notification.Builder builder = new Notification.Builder(mContext)
                     .setSmallIcon(getSmallIcon(disk, VolumeInfo.STATE_UNMOUNTABLE))
                     .setColor(mContext.getColor(R.color.system_notification_accent_color))
                     .setContentTitle(title)
@@ -233,10 +234,11 @@
                     .setStyle(new Notification.BigTextStyle().bigText(text))
                     .setVisibility(Notification.VISIBILITY_PUBLIC)
                     .setLocalOnly(true)
-                    .setCategory(Notification.CATEGORY_ERROR)
-                    .build();
+                    .setCategory(Notification.CATEGORY_ERROR);
+            SystemUI.overrideNotificationAppName(mContext, builder);
 
-            mNotificationManager.notifyAsUser(disk.getId(), DISK_ID, notif, UserHandle.ALL);
+            mNotificationManager.notifyAsUser(disk.getId(), DISK_ID, builder.build(),
+                    UserHandle.ALL);
 
         } else {
             // Yay, we have volumes!
@@ -471,7 +473,7 @@
             intent = buildWizardMigratePendingIntent(move);
         }
 
-        final Notification notif = new Notification.Builder(mContext)
+        Notification.Builder builder = new Notification.Builder(mContext)
                 .setSmallIcon(R.drawable.ic_sd_card_48dp)
                 .setColor(mContext.getColor(R.color.system_notification_accent_color))
                 .setContentTitle(title)
@@ -483,10 +485,11 @@
                 .setCategory(Notification.CATEGORY_PROGRESS)
                 .setPriority(Notification.PRIORITY_LOW)
                 .setProgress(100, status, false)
-                .setOngoing(true)
-                .build();
+                .setOngoing(true);
+        SystemUI.overrideNotificationAppName(mContext, builder);
 
-        mNotificationManager.notifyAsUser(move.packageName, MOVE_ID, notif, UserHandle.ALL);
+        mNotificationManager.notifyAsUser(move.packageName, MOVE_ID,
+                builder.build(), UserHandle.ALL);
     }
 
     private void onMoveFinished(MoveInfo move, int status) {
@@ -520,7 +523,7 @@
             intent = null;
         }
 
-        final Notification notif = new Notification.Builder(mContext)
+        Notification.Builder builder = new Notification.Builder(mContext)
                 .setSmallIcon(R.drawable.ic_sd_card_48dp)
                 .setColor(mContext.getColor(R.color.system_notification_accent_color))
                 .setContentTitle(title)
@@ -531,10 +534,11 @@
                 .setLocalOnly(true)
                 .setCategory(Notification.CATEGORY_SYSTEM)
                 .setPriority(Notification.PRIORITY_LOW)
-                .setAutoCancel(true)
-                .build();
+                .setAutoCancel(true);
+        SystemUI.overrideNotificationAppName(mContext, builder);
 
-        mNotificationManager.notifyAsUser(move.packageName, MOVE_ID, notif, UserHandle.ALL);
+        mNotificationManager.notifyAsUser(move.packageName, MOVE_ID, builder.build(),
+                UserHandle.ALL);
     }
 
     private int getSmallIcon(DiskInfo disk, int state) {
@@ -555,7 +559,7 @@
 
     private Notification.Builder buildNotificationBuilder(VolumeInfo vol, CharSequence title,
             CharSequence text) {
-        return new Notification.Builder(mContext)
+        Notification.Builder builder = new Notification.Builder(mContext)
                 .setSmallIcon(getSmallIcon(vol.getDisk(), vol.getState()))
                 .setColor(mContext.getColor(R.color.system_notification_accent_color))
                 .setContentTitle(title)
@@ -563,6 +567,8 @@
                 .setStyle(new Notification.BigTextStyle().bigText(text))
                 .setVisibility(Notification.VISIBILITY_PUBLIC)
                 .setLocalOnly(true);
+        overrideNotificationAppName(mContext, builder);
+        return builder;
     }
 
     private PendingIntent buildInitPendingIntent(DiskInfo disk) {
diff --git a/packages/SystemUI/src/com/android/systemui/volume/VolumeUI.java b/packages/SystemUI/src/com/android/systemui/volume/VolumeUI.java
index 2688813..c820302 100644
--- a/packages/SystemUI/src/com/android/systemui/volume/VolumeUI.java
+++ b/packages/SystemUI/src/com/android/systemui/volume/VolumeUI.java
@@ -228,22 +228,23 @@
             }
             final Intent intent =  new Intent(Receiver.DISABLE)
                     .putExtra(Receiver.EXTRA_COMPONENT, component);
+            Notification.Builder builder = new Notification.Builder(mContext)
+                    .setSmallIcon(R.drawable.ic_volume_media)
+                    .setWhen(0)
+                    .setShowWhen(false)
+                    .setOngoing(true)
+                    .setContentTitle(mContext.getString(
+                            R.string.volumeui_notification_title, getAppLabel(component)))
+                    .setContentText(mContext.getString(R.string.volumeui_notification_text))
+                    .setContentIntent(PendingIntent.getBroadcast(mContext, 0, intent,
+                            PendingIntent.FLAG_UPDATE_CURRENT))
+                    .setPriority(Notification.PRIORITY_MIN)
+                    .setVisibility(Notification.VISIBILITY_PUBLIC)
+                    .setColor(mContext.getColor(
+                            com.android.internal.R.color.system_notification_accent_color));
+            overrideNotificationAppName(mContext, builder);
             mNotificationManager.notify(R.id.notification_volumeui,
-                    new Notification.Builder(mContext)
-                            .setSmallIcon(R.drawable.ic_volume_media)
-                            .setWhen(0)
-                            .setShowWhen(false)
-                            .setOngoing(true)
-                            .setContentTitle(mContext.getString(
-                                    R.string.volumeui_notification_title, getAppLabel(component)))
-                            .setContentText(mContext.getString(R.string.volumeui_notification_text))
-                            .setContentIntent(PendingIntent.getBroadcast(mContext, 0, intent,
-                                    PendingIntent.FLAG_UPDATE_CURRENT))
-                            .setPriority(Notification.PRIORITY_MIN)
-                            .setVisibility(Notification.VISIBILITY_PUBLIC)
-                            .setColor(mContext.getColor(
-                                    com.android.internal.R.color.system_notification_accent_color))
-                            .build());
+                    builder.build());
         }
     }
 }
diff --git a/packages/SystemUI/tests/src/com/android/systemui/qs/external/TileLifecycleManagerTests.java b/packages/SystemUI/tests/src/com/android/systemui/qs/external/TileLifecycleManagerTests.java
index a30f507..c93377a 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/qs/external/TileLifecycleManagerTests.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/qs/external/TileLifecycleManagerTests.java
@@ -36,6 +36,8 @@
 import android.util.ArraySet;
 import android.util.Log;
 
+import org.mockito.Mockito;
+
 @SmallTest
 public class TileLifecycleManagerTests extends AndroidTestCase {
     public static final String TILE_UPDATE_BROADCAST = "com.android.systemui.tests.TILE_UPDATE";
@@ -54,8 +56,11 @@
         mThread = new HandlerThread("TestThread");
         mThread.start();
         mHandler = new Handler(mThread.getLooper());
+        ComponentName component = new ComponentName(mContext, FakeTileService.class);
         mStateManager = new TileLifecycleManager(mHandler, getContext(),
-                new Intent(mContext, FakeTileService.class), new UserHandle(UserHandle.myUserId()));
+                Mockito.mock(IQSService.class), new Tile(component),
+                new Intent().setComponent(component),
+                new UserHandle(UserHandle.myUserId()));
         mCallbacks.clear();
         getContext().registerReceiver(mReceiver, new IntentFilter(TILE_UPDATE_BROADCAST));
     }
@@ -251,16 +256,6 @@
         @Override
         public IBinder onBind(Intent intent) {
             return new IQSTileService.Stub() {
-
-                @Override
-                public void setQSService(IQSService service) {
-
-                }
-
-                @Override
-                public void setQSTile(Tile tile) throws RemoteException {
-                }
-
                 @Override
                 public void onTileAdded() throws RemoteException {
                     sendCallback("onTileAdded");
diff --git a/packages/SystemUI/tests/src/com/android/systemui/qs/external/TileServicesTests.java b/packages/SystemUI/tests/src/com/android/systemui/qs/external/TileServicesTests.java
index 94c98d6..de3864d 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/qs/external/TileServicesTests.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/qs/external/TileServicesTests.java
@@ -17,6 +17,7 @@
 
 import android.content.ComponentName;
 import android.os.Looper;
+import android.service.quicksettings.Tile;
 import android.test.suitebuilder.annotation.SmallTest;
 import com.android.systemui.SysuiTestCase;
 import com.android.systemui.statusbar.phone.QSTileHost;
@@ -109,7 +110,7 @@
         }
 
         @Override
-        protected TileServiceManager onCreateTileService(ComponentName component) {
+        protected TileServiceManager onCreateTileService(ComponentName component, Tile qsTile) {
             TileServiceManager manager = Mockito.mock(TileServiceManager.class);
             mManagers.add(manager);
             return manager;
diff --git a/packages/WallpaperBackup/src/com/android/wallpaperbackup/WallpaperBackupAgent.java b/packages/WallpaperBackup/src/com/android/wallpaperbackup/WallpaperBackupAgent.java
index a3ea592..47d1493 100644
--- a/packages/WallpaperBackup/src/com/android/wallpaperbackup/WallpaperBackupAgent.java
+++ b/packages/WallpaperBackup/src/com/android/wallpaperbackup/WallpaperBackupAgent.java
@@ -92,6 +92,11 @@
                 if (DEBUG) {
                     Slog.v(TAG, "Wallpaper is backup-eligible; linking & writing");
                 }
+
+                // In case of prior muddled state
+                infoStage.delete();
+                imageStage.delete();
+
                 Os.link(mWallpaperInfo.getCanonicalPath(), infoStage.getCanonicalPath());
                 fullBackupFile(infoStage, data);
                 Os.link(mWallpaperFile.getCanonicalPath(), imageStage.getCanonicalPath());
diff --git a/services/accessibility/java/com/android/server/accessibility/AccessibilityManagerService.java b/services/accessibility/java/com/android/server/accessibility/AccessibilityManagerService.java
index 7da969f..60d3339 100644
--- a/services/accessibility/java/com/android/server/accessibility/AccessibilityManagerService.java
+++ b/services/accessibility/java/com/android/server/accessibility/AccessibilityManagerService.java
@@ -2228,7 +2228,8 @@
             @Override
             public void handleMessage(Message message) {
                 final int eventType =  message.what;
-                notifyAccessibilityEventInternal(eventType);
+                AccessibilityEvent event = (AccessibilityEvent) message.obj;
+                notifyAccessibilityEventInternal(eventType, event);
             }
         };
 
@@ -3130,16 +3131,22 @@
                 // be modified to remove its source if the receiving service does
                 // not have permission to access the window content.
                 AccessibilityEvent newEvent = AccessibilityEvent.obtain(event);
-                AccessibilityEvent oldEvent = mPendingEvents.get(eventType);
-                mPendingEvents.put(eventType, newEvent);
-
-                final int what = eventType;
-                if (oldEvent != null) {
-                    mEventDispatchHandler.removeMessages(what);
-                    oldEvent.recycle();
+                Message message;
+                if ((mNotificationTimeout > 0)
+                        && (eventType != AccessibilityEvent.TYPE_WINDOW_CONTENT_CHANGED)) {
+                    // Allow at most one pending event
+                    final AccessibilityEvent oldEvent = mPendingEvents.get(eventType);
+                    mPendingEvents.put(eventType, newEvent);
+                    if (oldEvent != null) {
+                        mEventDispatchHandler.removeMessages(eventType);
+                        oldEvent.recycle();
+                    }
+                    message = mEventDispatchHandler.obtainMessage(eventType);
+                } else {
+                    // Send all messages, bypassing mPendingEvents
+                    message = mEventDispatchHandler.obtainMessage(eventType, newEvent);
                 }
 
-                Message message = mEventDispatchHandler.obtainMessage(what);
                 mEventDispatchHandler.sendMessageDelayed(message, mNotificationTimeout);
             }
         }
@@ -3149,9 +3156,8 @@
          *
          * @param eventType The type of the event to dispatch.
          */
-        private void notifyAccessibilityEventInternal(int eventType) {
+        private void notifyAccessibilityEventInternal(int eventType, AccessibilityEvent event) {
             IAccessibilityServiceClient listener;
-            AccessibilityEvent event;
 
             synchronized (mLock) {
                 listener = mServiceInterface;
@@ -3162,28 +3168,32 @@
                     return;
                 }
 
-                event = mPendingEvents.get(eventType);
-
-                // Check for null here because there is a concurrent scenario in which this
-                // happens: 1) A binder thread calls notifyAccessibilityServiceDelayedLocked
-                // which posts a message for dispatching an event. 2) The message is pulled
-                // from the queue by the handler on the service thread and the latter is
-                // just about to acquire the lock and call this method. 3) Now another binder
-                // thread acquires the lock calling notifyAccessibilityServiceDelayedLocked
-                // so the service thread waits for the lock; 4) The binder thread replaces
-                // the event with a more recent one (assume the same event type) and posts a
-                // dispatch request releasing the lock. 5) Now the main thread is unblocked and
-                // dispatches the event which is removed from the pending ones. 6) And ... now
-                // the service thread handles the last message posted by the last binder call
-                // but the event is already dispatched and hence looking it up in the pending
-                // ones yields null. This check is much simpler that keeping count for each
-                // event type of each service to catch such a scenario since only one message
-                // is processed at a time.
+                // There are two ways we notify for events, throttled and non-throttled. If we
+                // are not throttling, then messages come with events, which we handle with
+                // minimal fuss.
                 if (event == null) {
-                    return;
+                    // We are throttling events, so we'll send the event for this type in
+                    // mPendingEvents as long as it it's null. It can only null due to a race
+                    // condition:
+                    //
+                    //   1) A binder thread calls notifyAccessibilityServiceDelayedLocked
+                    //      which posts a message for dispatching an event and stores the event
+                    //      in mPendingEvents.
+                    //   2) The message is pulled from the queue by the handler on the service
+                    //      thread and this method is just about to acquire the lock.
+                    //   3) Another binder thread acquires the lock in notifyAccessibilityEvent
+                    //   4) notifyAccessibilityEvent recycles the event that this method was about
+                    //      to process, replaces it with a new one, and posts a second message
+                    //   5) This method grabs the new event, processes it, and removes it from
+                    //      mPendingEvents
+                    //   6) The second message dispatched in (4) arrives, but the event has been
+                    //      remvoved in (5).
+                    event = mPendingEvents.get(eventType);
+                    if (event == null) {
+                        return;
+                    }
+                    mPendingEvents.remove(eventType);
                 }
-
-                mPendingEvents.remove(eventType);
                 if (mSecurityPolicy.canRetrieveWindowContentLocked(this)) {
                     event.setConnectionId(mId);
                 } else {
diff --git a/services/appwidget/java/com/android/server/appwidget/AppWidgetServiceImpl.java b/services/appwidget/java/com/android/server/appwidget/AppWidgetServiceImpl.java
index 4e0ddd6..2a30229 100644
--- a/services/appwidget/java/com/android/server/appwidget/AppWidgetServiceImpl.java
+++ b/services/appwidget/java/com/android/server/appwidget/AppWidgetServiceImpl.java
@@ -20,6 +20,7 @@
 import static android.content.Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS;
 import static android.content.Intent.FLAG_ACTIVITY_NEW_TASK;
 
+import android.annotation.UserIdInt;
 import android.app.AlarmManager;
 import android.app.AppGlobals;
 import android.app.AppOpsManager;
@@ -66,6 +67,7 @@
 import android.os.SystemClock;
 import android.os.UserHandle;
 import android.os.UserManager;
+import android.os.storage.StorageManager;
 import android.text.TextUtils;
 import android.util.ArraySet;
 import android.util.AtomicFile;
@@ -647,7 +649,7 @@
     }
 
     private void ensureGroupStateLoadedLocked(int userId, boolean enforceUserUnlockingOrUnlocked) {
-        if (enforceUserUnlockingOrUnlocked && !mUserManager.isUserUnlockingOrUnlocked(userId)) {
+        if (enforceUserUnlockingOrUnlocked && !isUserRunningAndUnlocked(userId)) {
             throw new IllegalStateException(
                     "User " + userId + " must be unlocked for widgets to be available");
         }
@@ -692,6 +694,10 @@
         loadGroupStateLocked(newProfileIds);
     }
 
+    private boolean isUserRunningAndUnlocked(@UserIdInt int userId) {
+        return mUserManager.isUserRunning(userId) && StorageManager.isUserKeyUnlocked(userId);
+    }
+
     @Override
     public void dump(FileDescriptor fd, PrintWriter pw, String[] args) {
         mContext.enforceCallingOrSelfPermission(android.Manifest.permission.DUMP,
@@ -3358,7 +3364,7 @@
             if (userInfo != null && userInfo.isManagedProfile()) {
                 UserInfo parentInfo = mUserManager.getProfileParent(userId);
                 if (parentInfo != null
-                        && !mUserManager.isUserUnlockingOrUnlocked(parentInfo.getUserHandle())) {
+                        && !isUserRunningAndUnlocked(parentInfo.getUserHandle().getIdentifier())) {
                     return true;
                 }
             }
diff --git a/services/backup/java/com/android/server/backup/BackupManagerService.java b/services/backup/java/com/android/server/backup/BackupManagerService.java
index 334b228..e6f99c1 100644
--- a/services/backup/java/com/android/server/backup/BackupManagerService.java
+++ b/services/backup/java/com/android/server/backup/BackupManagerService.java
@@ -725,6 +725,19 @@
         return true;
     }
 
+    /* adb backup: is this app only capable of doing key/value?  We say otherwise if
+     * the app has a backup agent and does not say fullBackupOnly, *unless* it
+     * is a package that we know _a priori_ explicitly supports both key/value and
+     * full-data backup.
+     */
+    private static boolean appIsKeyValueOnly(PackageInfo pkg) {
+        if ("com.android.providers.settings".equals(pkg.packageName)) {
+            return false;
+        }
+
+        return !appGetsFullBackup(pkg);
+    }
+
     // ----- Asynchronous backup/restore handler thread -----
 
     private class BackupHandler extends Handler {
@@ -2356,7 +2369,8 @@
             mConnecting = true;
             mConnectedAgent = null;
             try {
-                if (mActivityManager.bindBackupAgent(app, mode)) {
+                if (mActivityManager.bindBackupAgent(app.packageName, mode,
+                        UserHandle.USER_OWNER)) {
                     Slog.d(TAG, "awaiting agent for " + app);
 
                     // success; wait for the agent to arrive
@@ -3445,8 +3459,8 @@
             Intent obbIntent = new Intent().setComponent(new ComponentName(
                     "com.android.sharedstoragebackup",
                     "com.android.sharedstoragebackup.ObbBackupService"));
-            BackupManagerService.this.mContext.bindService(
-                    obbIntent, this, Context.BIND_AUTO_CREATE);
+            BackupManagerService.this.mContext.bindServiceAsUser(
+                    obbIntent, this, Context.BIND_AUTO_CREATE, UserHandle.SYSTEM);
         }
 
         public void tearDown() {
@@ -3964,7 +3978,7 @@
     }
 
     // Full backup task variant used for adb backup
-    class PerformAdbBackupTask extends FullBackupTask {
+    class PerformAdbBackupTask extends FullBackupTask implements BackupRestoreTask {
         FullBackupEngine mBackupEngine;
         final AtomicBoolean mLatch;
 
@@ -3978,6 +3992,7 @@
         boolean mIncludeSystem;
         boolean mCompress;
         ArrayList<String> mPackages;
+        PackageInfo mCurrentTarget;
         String mCurrentPassword;
         String mEncryptPassword;
 
@@ -4008,6 +4023,9 @@
             } else {
                 mEncryptPassword = encryptPassword;
             }
+            if (MORE_DEBUG) {
+                Slog.w(TAG, "Encrypting backup with passphrase=" + mEncryptPassword);
+            }
             mCompress = doCompress;
         }
 
@@ -4164,7 +4182,9 @@
             Iterator<Entry<String, PackageInfo>> iter = packagesToBackup.entrySet().iterator();
             while (iter.hasNext()) {
                 PackageInfo pkg = iter.next().getValue();
-                if (!appIsEligibleForBackup(pkg.applicationInfo)) {
+                if (!appIsEligibleForBackup(pkg.applicationInfo)
+                        || appIsStopped(pkg.applicationInfo)
+                        || appIsKeyValueOnly(pkg)) {
                     iter.remove();
                 }
             }
@@ -4266,9 +4286,11 @@
                     final boolean isSharedStorage =
                             pkg.packageName.equals(SHARED_BACKUP_AGENT_PACKAGE);
 
-                    mBackupEngine = new FullBackupEngine(out, null, pkg, mIncludeApks, null);
+                    mBackupEngine = new FullBackupEngine(out, null, pkg, mIncludeApks, this);
                     sendOnBackupPackage(isSharedStorage ? "Shared storage" : pkg.packageName);
+
                     // Don't need to check preflight result as there is no preflight hook.
+                    mCurrentTarget = pkg;
                     mBackupEngine.backupOnePackage();
 
                     // after the app's agent runs to handle its private filesystem
@@ -4307,6 +4329,28 @@
                 mWakelock.release();
             }
         }
+
+        // BackupRestoreTask methods, used for timeout handling
+        @Override
+        public void execute() {
+            // Unused
+        }
+
+        @Override
+        public void operationComplete(long result) {
+            // Unused
+        }
+
+        @Override
+        public void handleTimeout() {
+            final PackageInfo target = mCurrentTarget;
+            if (DEBUG) {
+                Slog.w(TAG, "adb backup timeout of " + target);
+            }
+            if (target != null) {
+                tearDownAgentAndKill(mCurrentTarget.applicationInfo);
+            }
+        }
     }
 
     // Full backup task extension used for transport-oriented operation
@@ -5254,7 +5298,7 @@
         byte[] mWidgetData = null;
 
         // Runner that can be placed in a separate thread to do in-process
-        // invocations of the full restore API asynchronously
+        // invocations of the full restore API asynchronously. Used by adb restore.
         class RestoreFileRunnable implements Runnable {
             IBackupAgent mAgent;
             FileMetadata mInfo;
@@ -6403,6 +6447,46 @@
 
     // ***** end new engine class ***
 
+    // Used for synchronizing doRestoreFinished during adb restore
+    class AdbRestoreFinishedLatch implements BackupRestoreTask {
+        static final String TAG = "AdbRestoreFinishedLatch";
+        final CountDownLatch mLatch;
+
+        AdbRestoreFinishedLatch() {
+            mLatch = new CountDownLatch(1);
+        }
+
+        void await() {
+            boolean latched = false;
+            try {
+                latched = mLatch.await(TIMEOUT_FULL_BACKUP_INTERVAL, TimeUnit.MILLISECONDS);
+            } catch (InterruptedException e) {
+                Slog.w(TAG, "Interrupted!");
+            }
+        }
+
+        @Override
+        public void execute() {
+            // Unused
+        }
+
+        @Override
+        public void operationComplete(long result) {
+            if (MORE_DEBUG) {
+                Slog.w(TAG, "adb onRestoreFinished() complete");
+            }
+            mLatch.countDown();
+        }
+
+        @Override
+        public void handleTimeout() {
+            if (DEBUG) {
+                Slog.w(TAG, "adb onRestoreFinished() timed out");
+            }
+            mLatch.countDown();
+        }
+    }
+
     class PerformAdbRestoreTask implements Runnable {
         ParcelFileDescriptor mInputFile;
         String mCurrentPassword;
@@ -6418,6 +6502,27 @@
 
         long mBytes;
 
+        // Runner that can be placed on a separate thread to do in-process invocation
+        // of the "restore finished" API asynchronously.  Used by adb restore.
+        class RestoreFinishedRunnable implements Runnable {
+            final IBackupAgent mAgent;
+            final int mToken;
+
+            RestoreFinishedRunnable(IBackupAgent agent, int token) {
+                mAgent = agent;
+                mToken = token;
+            }
+
+            @Override
+            public void run() {
+                try {
+                    mAgent.doRestoreFinished(mToken, mBackupManagerBinder);
+                } catch (RemoteException e) {
+                    // never happens; this is used only for local binder calls
+                }
+            }
+        }
+
         // possible handling states for a given package in the restore dataset
         final HashMap<String, RestorePolicy> mPackagePolicies
                 = new HashMap<String, RestorePolicy>();
@@ -6559,7 +6664,7 @@
                 Slog.e(TAG, "Unable to read restore input");
             } finally {
                 tearDownPipes();
-                tearDownAgent(mTargetApp);
+                tearDownAgent(mTargetApp, true);
 
                 try {
                     if (rawDataIn != null) rawDataIn.close();
@@ -6713,7 +6818,7 @@
                             if (DEBUG) Slog.d(TAG, "Saw new package; finalizing old one");
                             // Now we're really done
                             tearDownPipes();
-                            tearDownAgent(mTargetApp);
+                            tearDownAgent(mTargetApp, true);
                             mTargetApp = null;
                             mAgentPackage = null;
                         }
@@ -6935,10 +7040,12 @@
                             // okay, if the remote end failed at any point, deal with
                             // it by ignoring the rest of the restore on it
                             if (!agentSuccess) {
+                                if (DEBUG) {
+                                    Slog.d(TAG, "Agent failure restoring " + pkg + "; now ignoring");
+                                }
                                 mBackupHandler.removeMessages(MSG_TIMEOUT);
                                 tearDownPipes();
-                                tearDownAgent(mTargetApp);
-                                mAgent = null;
+                                tearDownAgent(mTargetApp, false);
                                 mPackagePolicies.put(pkg, RestorePolicy.IGNORE);
                             }
                         }
@@ -6987,9 +7094,27 @@
             }
         }
 
-        void tearDownAgent(ApplicationInfo app) {
+        void tearDownAgent(ApplicationInfo app, boolean doRestoreFinished) {
             if (mAgent != null) {
                 try {
+                    // In the adb restore case, we do restore-finished here
+                    if (doRestoreFinished) {
+                        final int token = generateToken();
+                        final AdbRestoreFinishedLatch latch = new AdbRestoreFinishedLatch();
+                        prepareOperationTimeout(token, TIMEOUT_FULL_BACKUP_INTERVAL, latch);
+                        if (mTargetApp.processName.equals("system")) {
+                            if (MORE_DEBUG) {
+                                Slog.d(TAG, "system agent - restoreFinished on thread");
+                            }
+                            Runnable runner = new RestoreFinishedRunnable(mAgent, token);
+                            new Thread(runner, "restore-sys-finished-runner").start();
+                        } else {
+                            mAgent.doRestoreFinished(token, mBackupManagerBinder);
+                        }
+
+                        latch.await();
+                    }
+
                     // unbind and tidy up even on timeout or failure, just in case
                     mActivityManager.unbindBackupAgent(app);
 
@@ -9353,7 +9478,7 @@
                     "com.android.backupconfirm.BackupRestoreConfirmation");
             confIntent.putExtra(FullBackup.CONF_TOKEN_INTENT_EXTRA, token);
             confIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
-            mContext.startActivity(confIntent);
+            mContext.startActivityAsUser(confIntent, UserHandle.SYSTEM);
         } catch (ActivityNotFoundException e) {
             return false;
         }
@@ -9597,6 +9722,15 @@
         return list;
     }
 
+    public String[] getTransportWhitelist() {
+        // No permission check, intentionally.
+        String[] whitelist = new String[mTransportWhitelist.size()];
+        for (int i = mTransportWhitelist.size() - 1; i >= 0; i--) {
+            whitelist[i] = mTransportWhitelist.valueAt(i).flattenToShortString();
+        }
+        return whitelist;
+    }
+
     // Select which transport to use for the next backup operation.
     public String selectBackupTransport(String transport) {
         mContext.enforceCallingOrSelfPermission(android.Manifest.permission.BACKUP,
diff --git a/services/backup/java/com/android/server/backup/Trampoline.java b/services/backup/java/com/android/server/backup/Trampoline.java
index e745263..312b878 100644
--- a/services/backup/java/com/android/server/backup/Trampoline.java
+++ b/services/backup/java/com/android/server/backup/Trampoline.java
@@ -275,6 +275,12 @@
     }
 
     @Override
+    public String[] getTransportWhitelist() {
+        BackupManagerService svc = mService;
+        return (svc != null) ? svc.getTransportWhitelist() : null;
+    }
+
+    @Override
     public String selectBackupTransport(String transport) throws RemoteException {
         BackupManagerService svc = mService;
         return (svc != null) ? svc.selectBackupTransport(transport) : null;
diff --git a/services/core/java/com/android/server/AlarmManagerService.java b/services/core/java/com/android/server/AlarmManagerService.java
index 400c4a7..312553a 100644
--- a/services/core/java/com/android/server/AlarmManagerService.java
+++ b/services/core/java/com/android/server/AlarmManagerService.java
@@ -3074,9 +3074,6 @@
                 if (alarm.workSource != null && alarm.workSource.size() > 0) {
                     for (int wi=0; wi<alarm.workSource.size(); wi++) {
                         final String wsName = alarm.workSource.getName(wi);
-                        if (wsName == null) {
-                            Slog.w(TAG, "Null worksource name for alarm " + alarm);
-                        }
                         ActivityManagerNative.noteWakeupAlarm(
                                 alarm.operation, alarm.workSource.get(wi),
                                 (wsName != null) ? wsName : alarm.packageName,
diff --git a/services/core/java/com/android/server/BluetoothManagerService.java b/services/core/java/com/android/server/BluetoothManagerService.java
index 9154b8e..59e4f28 100644
--- a/services/core/java/com/android/server/BluetoothManagerService.java
+++ b/services/core/java/com/android/server/BluetoothManagerService.java
@@ -1153,8 +1153,27 @@
                     }
                     mHandler.removeMessages(MESSAGE_RESTART_BLUETOOTH_SERVICE);
                     mEnable = true;
+
+                    // Use service interface to get the exact state
+                    try {
+                        mBluetoothLock.readLock().lock();
+                        if (mBluetooth != null) {
+                            int state = mBluetooth.getState();
+                            if (state == BluetoothAdapter.STATE_BLE_ON) {
+                                Slog.w(TAG, "BT is in BLE_ON State");
+                                mBluetooth.onLeServiceUp();
+                                break;
+                            }
+                        }
+                    } catch (RemoteException e) {
+                        Slog.e(TAG, "", e);
+                    } finally {
+                        mBluetoothLock.readLock().unlock();
+                    }
+
+                    mQuietEnable = (msg.arg1 == 1);
                     if (mBluetooth == null) {
-                        handleEnable(msg.arg1 == 1);
+                        handleEnable(mQuietEnable);
                     } else {
                         //
                         // We need to wait until transitioned to STATE_OFF and
@@ -1172,7 +1191,6 @@
                         // on the order of (2 * SERVICE_RESTART_TIME_MS).
                         //
                         waitForOnOff(false, true);
-                        mQuietEnable = (msg.arg1 == 1);
                         Message restartMsg = mHandler.obtainMessage(
                                 MESSAGE_RESTART_BLUETOOTH_SERVICE);
                         mHandler.sendMessageDelayed(restartMsg,
@@ -1335,17 +1353,30 @@
                     // handle error state transition case from TURNING_ON to OFF
                     // unbind and rebind bluetooth service and enable bluetooth
                     if ((prevState == BluetoothAdapter.STATE_BLE_TURNING_ON) &&
-                        (newState == BluetoothAdapter.STATE_OFF) &&
-                        (mBluetooth != null) && mEnable) {
+                            (newState == BluetoothAdapter.STATE_OFF) &&
+                            (mBluetooth != null) && mEnable) {
                         recoverBluetoothServiceFromError();
                     }
                     if ((prevState == BluetoothAdapter.STATE_TURNING_ON) &&
-                        (newState == BluetoothAdapter.STATE_BLE_ON) &&
-                        (mBluetooth != null) && mEnable) {
+                            (newState == BluetoothAdapter.STATE_BLE_ON) &&
+                            (mBluetooth != null) && mEnable) {
                         recoverBluetoothServiceFromError();
                     }
+                    // If we tried to enable BT while BT was in the process of shutting down,
+                    // wait for the BT process to fully tear down and then force a restart
+                    // here.  This is a bit of a hack (b/29363429).
+                    if ((prevState == BluetoothAdapter.STATE_BLE_TURNING_OFF) &&
+                            (newState == BluetoothAdapter.STATE_OFF)) {
+                        if (mEnable) {
+                            Slog.d(TAG, "Entering STATE_OFF but mEnabled is true; restarting.");
+                            waitForOnOff(false, true);
+                            Message restartMsg = mHandler.obtainMessage(
+                                    MESSAGE_RESTART_BLUETOOTH_SERVICE);
+                            mHandler.sendMessageDelayed(restartMsg, 2 * SERVICE_RESTART_TIME_MS);
+                        }
+                    }
                     if (newState == BluetoothAdapter.STATE_ON ||
-                        newState == BluetoothAdapter.STATE_BLE_ON) {
+                            newState == BluetoothAdapter.STATE_BLE_ON) {
                         // bluetooth is working, reset the counter
                         if (mErrorRecoveryRetryCounter != 0) {
                             Slog.w(TAG, "bluetooth is recovered from error");
@@ -1388,7 +1419,7 @@
                     // Send BT state broadcast to update
                     // the BT icon correctly
                     if ((mState == BluetoothAdapter.STATE_TURNING_ON) ||
-                        (mState == BluetoothAdapter.STATE_ON)) {
+                            (mState == BluetoothAdapter.STATE_ON)) {
                         bluetoothStateChangeHandler(BluetoothAdapter.STATE_ON,
                                                     BluetoothAdapter.STATE_TURNING_OFF);
                         mState = BluetoothAdapter.STATE_TURNING_OFF;
@@ -1621,8 +1652,8 @@
         boolean isStandardBroadcast = true;
         if (prevState != newState) {
             //Notify all proxy objects first of adapter state change
-            if (newState == BluetoothAdapter.STATE_BLE_ON
-                   || newState == BluetoothAdapter.STATE_OFF) {
+            if (newState == BluetoothAdapter.STATE_BLE_ON ||
+                    newState == BluetoothAdapter.STATE_OFF) {
                 boolean intermediate_off = (prevState == BluetoothAdapter.STATE_TURNING_OFF
                    && newState == BluetoothAdapter.STATE_BLE_ON);
 
@@ -1667,13 +1698,13 @@
                 sendBluetoothStateCallback(isUp);
                 sendBleStateChanged(prevState, newState);
 
-            } else if (newState == BluetoothAdapter.STATE_BLE_TURNING_ON
-                || newState == BluetoothAdapter.STATE_BLE_TURNING_OFF ) {
+            } else if (newState == BluetoothAdapter.STATE_BLE_TURNING_ON ||
+                    newState == BluetoothAdapter.STATE_BLE_TURNING_OFF ) {
                 sendBleStateChanged(prevState, newState);
                 isStandardBroadcast = false;
 
-            } else if (newState == BluetoothAdapter.STATE_TURNING_ON
-                || newState == BluetoothAdapter.STATE_TURNING_OFF) {
+            } else if (newState == BluetoothAdapter.STATE_TURNING_ON ||
+                    newState == BluetoothAdapter.STATE_TURNING_OFF) {
                 sendBleStateChanged(prevState, newState);
             }
 
diff --git a/services/core/java/com/android/server/ConnectivityService.java b/services/core/java/com/android/server/ConnectivityService.java
index 130fb7c..b12972c 100644
--- a/services/core/java/com/android/server/ConnectivityService.java
+++ b/services/core/java/com/android/server/ConnectivityService.java
@@ -30,8 +30,6 @@
 import static android.net.NetworkCapabilities.NET_CAPABILITY_VALIDATED;
 import static android.net.NetworkPolicyManager.RULE_ALLOW_ALL;
 import static android.net.NetworkPolicyManager.RULE_ALLOW_METERED;
-import static android.net.NetworkPolicyManager.MASK_METERED_NETWORKS;
-import static android.net.NetworkPolicyManager.MASK_ALL_NETWORKS;
 import static android.net.NetworkPolicyManager.RULE_NONE;
 import static android.net.NetworkPolicyManager.RULE_REJECT_ALL;
 import static android.net.NetworkPolicyManager.RULE_REJECT_METERED;
@@ -921,7 +919,7 @@
         // Networks aren't blocked when ignoring blocked status
         if (ignoreBlocked) return false;
         // Networks are never blocked for system services
-        if (uid < Process.FIRST_APPLICATION_UID) return false;
+        if (isSystem(uid)) return false;
 
         final boolean networkMetered;
         final int uidRules;
@@ -4032,12 +4030,18 @@
         return false;
     }
 
+    private boolean isSystem(int uid) {
+        return uid < Process.FIRST_APPLICATION_UID;
+    }
 
     private void enforceMeteredApnPolicy(NetworkCapabilities networkCapabilities) {
+        final int uid = Binder.getCallingUid();
+        if (isSystem(uid)) {
+            return;
+        }
         // if UID is restricted, don't allow them to bring up metered APNs
         if (networkCapabilities.hasCapability(NET_CAPABILITY_NOT_METERED) == false) {
             final int uidRules;
-            final int uid = Binder.getCallingUid();
             synchronized(mRulesLock) {
                 uidRules = mUidRules.get(uid, RULE_ALLOW_ALL);
             }
diff --git a/services/core/java/com/android/server/DeviceIdleController.java b/services/core/java/com/android/server/DeviceIdleController.java
index bb966f7..afed5ef 100644
--- a/services/core/java/com/android/server/DeviceIdleController.java
+++ b/services/core/java/com/android/server/DeviceIdleController.java
@@ -212,7 +212,6 @@
 
     private int mActiveIdleOpCount;
     private PowerManager.WakeLock mActiveIdleWakeLock;
-    private IBinder mDownloadServiceActive;
     private boolean mJobsActive;
     private boolean mAlarmsActive;
     private boolean mReportedMaintenanceActivity;
@@ -607,7 +606,7 @@
          * This is the minimum amount of time that we will stay in maintenance mode after
          * a light doze.  We have this minimum to allow various things to respond to switching
          * in to maintenance mode and scheduling their work -- otherwise we may
-         * see there is nothing to do (no jobs or downloads pending) and go out of maintenance
+         * see there is nothing to do (no jobs pending) and go out of maintenance
          * mode immediately.
          * @see Settings.Global#DEVICE_IDLE_CONSTANTS
          * @see #KEY_MIN_LIGHT_MAINTENANCE_TIME
@@ -618,7 +617,7 @@
          * This is the minimum amount of time that we will stay in maintenance mode after
          * a full doze.  We have this minimum to allow various things to respond to switching
          * in to maintenance mode and scheduling their work -- otherwise we may
-         * see there is nothing to do (no jobs or downloads pending) and go out of maintenance
+         * see there is nothing to do (no jobs pending) and go out of maintenance
          * mode immediately.
          * @see Settings.Global#DEVICE_IDLE_CONSTANTS
          * @see #KEY_MIN_DEEP_MAINTENANCE_TIME
@@ -1220,28 +1219,6 @@
             }
         }
 
-        @Override public void downloadServiceActive(IBinder token) {
-            getContext().enforceCallingOrSelfPermission(
-                    "android.permission.SEND_DOWNLOAD_COMPLETED_INTENTS", null);
-            long ident = Binder.clearCallingIdentity();
-            try {
-                DeviceIdleController.this.downloadServiceActive(token);
-            } finally {
-                Binder.restoreCallingIdentity(ident);
-            }
-        }
-
-        @Override public void downloadServiceInactive() {
-            getContext().enforceCallingOrSelfPermission(
-                    "android.permission.SEND_DOWNLOAD_COMPLETED_INTENTS", null);
-            long ident = Binder.clearCallingIdentity();
-            try {
-                DeviceIdleController.this.downloadServiceInactive();
-            } finally {
-                Binder.restoreCallingIdentity(ident);
-            }
-        }
-
         @Override public boolean registerMaintenanceActivityListener(
                 IMaintenanceActivityListener listener) {
             return DeviceIdleController.this.registerMaintenanceActivityListener(listener);
@@ -2086,30 +2063,6 @@
         }
     }
 
-    void downloadServiceActive(IBinder token) {
-        synchronized (this) {
-            mDownloadServiceActive = token;
-            reportMaintenanceActivityIfNeededLocked();
-            try {
-                token.linkToDeath(new IBinder.DeathRecipient() {
-                    @Override public void binderDied() {
-                        downloadServiceInactive();
-                    }
-                }, 0);
-            } catch (RemoteException e) {
-                mDownloadServiceActive = null;
-            }
-        }
-    }
-
-    void downloadServiceInactive() {
-        synchronized (this) {
-            mDownloadServiceActive = null;
-            reportMaintenanceActivityIfNeededLocked();
-            exitMaintenanceEarlyIfNeededLocked();
-        }
-    }
-
     void setJobsActive(boolean active) {
         synchronized (this) {
             mJobsActive = active;
@@ -2143,7 +2096,7 @@
     }
 
     void reportMaintenanceActivityIfNeededLocked() {
-        boolean active = mJobsActive | (mDownloadServiceActive != null);
+        boolean active = mJobsActive;
         if (active == mReportedMaintenanceActivity) {
             return;
         }
@@ -2154,8 +2107,7 @@
     }
 
     boolean isOpsInactiveLocked() {
-        return mActiveIdleOpCount <= 0 && mDownloadServiceActive == null
-                && !mJobsActive && !mAlarmsActive;
+        return mActiveIdleOpCount <= 0 && !mJobsActive && !mAlarmsActive;
     }
 
     void exitMaintenanceEarlyIfNeededLocked() {
@@ -3053,9 +3005,6 @@
             if (mAlarmsActive) {
                 pw.print("  mAlarmsActive="); pw.println(mAlarmsActive);
             }
-            if (mDownloadServiceActive != null) {
-                pw.print("  mDownloadServiceActive="); pw.println(mDownloadServiceActive);
-            }
         }
     }
 
diff --git a/services/core/java/com/android/server/LockSettingsService.java b/services/core/java/com/android/server/LockSettingsService.java
index ef7b787..d64fe32 100644
--- a/services/core/java/com/android/server/LockSettingsService.java
+++ b/services/core/java/com/android/server/LockSettingsService.java
@@ -423,6 +423,9 @@
             if (Intent.ACTION_USER_ADDED.equals(intent.getAction())) {
                 // Notify keystore that a new user was added.
                 final int userHandle = intent.getIntExtra(Intent.EXTRA_USER_HANDLE, 0);
+                if (userHandle > UserHandle.USER_SYSTEM) {
+                    removeUser(userHandle, /* unknownUser= */ true);
+                }
                 final KeyStore ks = KeyStore.getInstance();
                 final UserInfo parentInfo = mUserManager.getProfileParent(userHandle);
                 final int parentHandle = parentInfo != null ? parentInfo.id : -1;
@@ -433,7 +436,7 @@
             } else if (Intent.ACTION_USER_REMOVED.equals(intent.getAction())) {
                 final int userHandle = intent.getIntExtra(Intent.EXTRA_USER_HANDLE, 0);
                 if (userHandle > 0) {
-                    removeUser(userHandle);
+                    removeUser(userHandle, /* unknownUser= */ false);
                 }
             }
         }
@@ -1465,7 +1468,7 @@
         return false;
     }
 
-    private void removeUser(int userId) {
+    private void removeUser(int userId, boolean unknownUser) {
         mStorage.removeUser(userId);
         mStrongAuth.removeUser(userId);
 
@@ -1480,7 +1483,7 @@
         } catch (RemoteException ex) {
             Slog.w(TAG, "unable to clear GK secure user id");
         }
-        if (mUserManager.getUserInfo(userId).isManagedProfile()) {
+        if (unknownUser || mUserManager.getUserInfo(userId).isManagedProfile()) {
             removeKeystoreProfileKey(userId);
         }
     }
diff --git a/services/core/java/com/android/server/MountService.java b/services/core/java/com/android/server/MountService.java
index 9c75a00..55464e4 100644
--- a/services/core/java/com/android/server/MountService.java
+++ b/services/core/java/com/android/server/MountService.java
@@ -2030,6 +2030,9 @@
         enforcePermission(android.Manifest.permission.MOUNT_UNMOUNT_FILESYSTEMS);
         waitForReady();
 
+        final VolumeInfo from;
+        final VolumeInfo to;
+
         synchronized (mLock) {
             if (Objects.equals(mPrimaryStorageUuid, volumeUuid)) {
                 throw new IllegalArgumentException("Primary storage already at " + volumeUuid);
@@ -2049,10 +2052,11 @@
                 onMoveStatusLocked(MOVE_STATUS_COPY_FINISHED);
                 onMoveStatusLocked(PackageManager.MOVE_SUCCEEDED);
                 mHandler.obtainMessage(H_RESET).sendToTarget();
+                return;
 
             } else {
-                final VolumeInfo from = findStorageForUuid(mPrimaryStorageUuid);
-                final VolumeInfo to = findStorageForUuid(volumeUuid);
+                from = findStorageForUuid(mPrimaryStorageUuid);
+                to = findStorageForUuid(volumeUuid);
 
                 if (from == null) {
                     Slog.w(TAG, "Failing move due to missing from volume " + mPrimaryStorageUuid);
@@ -2063,14 +2067,14 @@
                     onMoveStatusLocked(PackageManager.MOVE_FAILED_INTERNAL_ERROR);
                     return;
                 }
-
-                try {
-                    mConnector.execute("volume", "move_storage", from.id, to.id);
-                } catch (NativeDaemonConnectorException e) {
-                    throw e.rethrowAsParcelableException();
-                }
             }
         }
+
+        try {
+            mConnector.execute("volume", "move_storage", from.id, to.id);
+        } catch (NativeDaemonConnectorException e) {
+            throw e.rethrowAsParcelableException();
+        }
     }
 
     @Override
diff --git a/services/core/java/com/android/server/accounts/AccountManagerService.java b/services/core/java/com/android/server/accounts/AccountManagerService.java
index 0cf5172..f7bd04b 100644
--- a/services/core/java/com/android/server/accounts/AccountManagerService.java
+++ b/services/core/java/com/android/server/accounts/AccountManagerService.java
@@ -3538,7 +3538,7 @@
 
     @Override
     public void addSharedAccountsFromParentUser(int parentUserId, int userId) {
-        checkManageUsersPermission("addSharedAccountsFromParentUser");
+        checkManageOrCreateUsersPermission("addSharedAccountsFromParentUser");
         Account[] accounts = getAccountsAsUser(null, parentUserId, mContext.getOpPackageName());
         for (Account account : accounts) {
             addSharedAccountAsUser(account, userId);
@@ -5092,6 +5092,16 @@
         }
     }
 
+    private static void checkManageOrCreateUsersPermission(String message) {
+        if (ActivityManager.checkComponentPermission(android.Manifest.permission.MANAGE_USERS,
+                Binder.getCallingUid(), -1, true) != PackageManager.PERMISSION_GRANTED &&
+                ActivityManager.checkComponentPermission(android.Manifest.permission.CREATE_USERS,
+                        Binder.getCallingUid(), -1, true) != PackageManager.PERMISSION_GRANTED) {
+            throw new SecurityException("You need MANAGE_USERS or CREATE_USERS permission to: "
+                    + message);
+        }
+    }
+
     private boolean hasExplicitlyGrantedPermission(Account account, String authTokenType,
             int callerUid) {
         if (callerUid == Process.SYSTEM_UID) {
diff --git a/services/core/java/com/android/server/am/ActiveServices.java b/services/core/java/com/android/server/am/ActiveServices.java
index dcd9b0c..7986629 100755
--- a/services/core/java/com/android/server/am/ActiveServices.java
+++ b/services/core/java/com/android/server/am/ActiveServices.java
@@ -1443,6 +1443,12 @@
             boolean allowCancel) {
         boolean canceled = false;
 
+        if (mAm.isShuttingDownLocked()) {
+            Slog.w(TAG, "Not scheduling restart of crashed service " + r.shortName
+                    + " - system is shutting down");
+            return false;
+        }
+
         ServiceMap smap = getServiceMap(r.userId);
         if (smap.mServicesByName.get(r.name) != r) {
             ServiceRecord cur = smap.mServicesByName.get(r.name);
diff --git a/services/core/java/com/android/server/am/ActivityManagerService.java b/services/core/java/com/android/server/am/ActivityManagerService.java
index 09f24ed..d1ee634 100644
--- a/services/core/java/com/android/server/am/ActivityManagerService.java
+++ b/services/core/java/com/android/server/am/ActivityManagerService.java
@@ -102,7 +102,6 @@
 import android.app.PendingIntent;
 import android.app.ProfilerInfo;
 import android.app.admin.DevicePolicyManager;
-import android.app.admin.DevicePolicyManagerInternal;
 import android.app.assist.AssistContent;
 import android.app.assist.AssistStructure;
 import android.app.backup.IBackupManager;
@@ -205,6 +204,7 @@
 import android.util.ArraySet;
 import android.util.AtomicFile;
 import android.util.DebugUtils;
+import android.util.DisplayMetrics;
 import android.util.EventLog;
 import android.util.Log;
 import android.util.Pair;
@@ -273,6 +273,10 @@
 import static android.content.pm.PackageManager.MATCH_UNINSTALLED_PACKAGES;
 import static android.content.pm.PackageManager.PERMISSION_GRANTED;
 import static android.content.res.Configuration.UI_MODE_TYPE_TELEVISION;
+import static android.os.Process.PROC_CHAR;
+import static android.os.Process.PROC_OUT_LONG;
+import static android.os.Process.PROC_PARENS;
+import static android.os.Process.PROC_SPACE_TERM;
 import static android.provider.Settings.Global.ALWAYS_FINISH_ACTIVITIES;
 import static android.provider.Settings.Global.DEBUG_APP;
 import static android.provider.Settings.Global.DEVELOPMENT_ENABLE_FREEFORM_WINDOWS_SUPPORT;
@@ -1513,6 +1517,7 @@
     static final int NOTIFY_FORCED_RESIZABLE_MSG = 67;
     static final int NOTIFY_ACTIVITY_DISMISSING_DOCKED_STACK_MSG = 68;
     static final int VR_MODE_APPLY_IF_NEEDED_MSG = 69;
+    static final int SHOW_UNSUPPORTED_DISPLAY_SIZE_DIALOG_MSG = 70;
 
     static final int FIRST_ACTIVITY_STACK_MSG = 100;
     static final int FIRST_BROADCAST_QUEUE_MSG = 200;
@@ -1523,6 +1528,7 @@
     static KillHandler sKillHandler = null;
 
     CompatModeDialog mCompatModeDialog;
+    UnsupportedDisplaySizeDialog mUnsupportedDisplaySizeDialog;
     long mLastMemUsageReportTime = 0;
 
     /**
@@ -1693,6 +1699,22 @@
                 }
                 break;
             }
+            case SHOW_UNSUPPORTED_DISPLAY_SIZE_DIALOG_MSG: {
+                synchronized (ActivityManagerService.this) {
+                    final ActivityRecord ar = (ActivityRecord) msg.obj;
+                    if (mUnsupportedDisplaySizeDialog != null) {
+                        mUnsupportedDisplaySizeDialog.dismiss();
+                        mUnsupportedDisplaySizeDialog = null;
+                    }
+                    if (ar != null && mCompatModePackages.getPackageNotifyUnsupportedZoomLocked(
+                            ar.packageName)) {
+                        mUnsupportedDisplaySizeDialog = new UnsupportedDisplaySizeDialog(
+                                ActivityManagerService.this, mContext, ar.info.applicationInfo);
+                        mUnsupportedDisplaySizeDialog.show();
+                    }
+                }
+                break;
+            }
             case START_USER_SWITCH_UI_MSG: {
                 mUserController.showUserSwitchDialog((Pair<UserInfo, UserInfo>) msg.obj);
                 break;
@@ -3099,6 +3121,16 @@
         mUiHandler.sendMessage(msg);
     }
 
+    final void showUnsupportedZoomDialogIfNeededLocked(ActivityRecord r) {
+        if (mConfiguration.densityDpi != DisplayMetrics.DENSITY_DEVICE_STABLE
+                && r.appInfo.requiresSmallestWidthDp > mConfiguration.smallestScreenWidthDp) {
+            final Message msg = Message.obtain();
+            msg.what = SHOW_UNSUPPORTED_DISPLAY_SIZE_DIALOG_MSG;
+            msg.obj = r;
+            mUiHandler.sendMessage(msg);
+        }
+    }
+
     private int updateLruProcessInternalLocked(ProcessRecord app, long now, int index,
             String what, Object obj, ProcessRecord srcApp) {
         app.lastActivityTime = now;
@@ -3492,13 +3524,11 @@
 
         // app launch boost for big.little configurations
         // use cpusets to migrate freshly launched tasks to big cores
-        synchronized(ActivityManagerService.this) {
-            nativeMigrateToBoost();
-            mIsBoosted = true;
-            mBoostStartTime = SystemClock.uptimeMillis();
-            Message msg = mHandler.obtainMessage(APP_BOOST_DEACTIVATE_MSG);
-            mHandler.sendMessageDelayed(msg, APP_BOOST_MESSAGE_DELAY);
-        }
+        nativeMigrateToBoost();
+        mIsBoosted = true;
+        mBoostStartTime = SystemClock.uptimeMillis();
+        Message msg = mHandler.obtainMessage(APP_BOOST_DEACTIVATE_MSG);
+        mHandler.sendMessageDelayed(msg, APP_BOOST_MESSAGE_DELAY);
 
         // We don't have to do anything more if:
         // (1) There is an existing application record; and
@@ -3511,7 +3541,7 @@
                 + " thread=" + (app != null ? app.thread : null)
                 + " pid=" + (app != null ? app.pid : -1));
         if (app != null && app.pid > 0) {
-            if (!knownToBeDead || app.thread == null) {
+            if ((!knownToBeDead && !app.killed) || app.thread == null) {
                 // We already have the app running, or are waiting for it to
                 // come up (we have a pid but not yet its thread), so keep it.
                 if (DEBUG_PROCESSES) Slog.v(TAG_PROCESSES, "App already running: " + app);
@@ -6386,7 +6416,7 @@
         EventLog.writeEvent(EventLogTags.AM_PROC_BOUND, app.userId, app.pid, app.processName);
 
         app.makeActive(thread, mProcessStats);
-        app.curAdj = app.setAdj = ProcessList.INVALID_ADJ;
+        app.curAdj = app.setAdj = app.verifiedAdj = ProcessList.INVALID_ADJ;
         app.curSchedGroup = app.setSchedGroup = ProcessList.SCHED_GROUP_DEFAULT;
         app.forcingToForeground = null;
         updateProcessForegroundLocked(app, false, false);
@@ -8307,7 +8337,7 @@
         final IPackageManager pm = AppGlobals.getPackageManager();
         final String authority = grantUri.uri.getAuthority();
         final ProviderInfo pi = getProviderInfoLocked(authority, grantUri.sourceUserId,
-                MATCH_DEBUG_TRIAGED_MISSING);
+                MATCH_DIRECT_BOOT_AWARE | MATCH_DIRECT_BOOT_UNAWARE);
         if (pi == null) {
             Slog.w(TAG, "No content provider found for permission revoke: "
                     + grantUri.toSafeString());
@@ -8405,7 +8435,7 @@
 
             final String authority = uri.getAuthority();
             final ProviderInfo pi = getProviderInfoLocked(authority, userId,
-                    MATCH_DEBUG_TRIAGED_MISSING);
+                    MATCH_DIRECT_BOOT_AWARE | MATCH_DIRECT_BOOT_UNAWARE);
             if (pi == null) {
                 Slog.w(TAG, "No content provider found for permission revoke: "
                         + uri.toSafeString());
@@ -8802,10 +8832,11 @@
         Preconditions.checkNotNull(packageName, "packageName");
 
         final int callingUid = Binder.getCallingUid();
+        final int callingUserId = UserHandle.getUserId(callingUid);
         final IPackageManager pm = AppGlobals.getPackageManager();
         try {
-            final int packageUid = pm.getPackageUid(packageName, MATCH_DEBUG_TRIAGED_MISSING,
-                    UserHandle.getUserId(callingUid));
+            final int packageUid = pm.getPackageUid(packageName,
+                    MATCH_DIRECT_BOOT_AWARE | MATCH_DIRECT_BOOT_UNAWARE, callingUserId);
             if (packageUid != callingUid) {
                 throw new SecurityException(
                         "Package " + packageName + " does not belong to calling UID " + callingUid);
@@ -8822,30 +8853,8 @@
                 if (perms == null) {
                     Slog.w(TAG, "No permission grants found for " + packageName);
                 } else {
-                    final int userId = UserHandle.getUserId(callingUid);
-                    Set<String> existingAuthorities = null;
-
                     for (UriPermission perm : perms.values()) {
                         if (packageName.equals(perm.targetPkg) && perm.persistedModeFlags != 0) {
-                            // Is this provider available in the current boot state? If the user
-                            // is not running and unlocked we check if the provider package exists.
-                            if (!mUserController.isUserRunningLocked(userId,
-                                    ActivityManager.FLAG_AND_UNLOCKED)) {
-                                String authority = perm.uri.uri.getAuthority();
-                                if (existingAuthorities == null
-                                        || !existingAuthorities.contains(authority)) {
-                                    ProviderInfo providerInfo = getProviderInfoLocked(authority,
-                                            userId, MATCH_DEBUG_TRIAGED_MISSING);
-                                    if (providerInfo != null) {
-                                        if (existingAuthorities == null) {
-                                            existingAuthorities = new ArraySet<>();
-                                        }
-                                        existingAuthorities.add(authority);
-                                    } else {
-                                        continue;
-                                    }
-                                }
-                            }
                             result.add(perm.buildPersistedPublicApiObject());
                         }
                     }
@@ -10509,6 +10518,30 @@
         }
     }
 
+    private static final int[] PROCESS_STATE_STATS_FORMAT = new int[] {
+            PROC_SPACE_TERM,
+            PROC_SPACE_TERM|PROC_PARENS,
+            PROC_SPACE_TERM|PROC_CHAR|PROC_OUT_LONG,        // 3: process state
+    };
+
+    private final long[] mProcessStateStatsLongs = new long[1];
+
+    boolean isProcessAliveLocked(ProcessRecord proc) {
+        if (proc.procStatFile == null) {
+            proc.procStatFile = "/proc/" + proc.pid + "/stat";
+        }
+        mProcessStateStatsLongs[0] = 0;
+        if (!Process.readProcFile(proc.procStatFile, PROCESS_STATE_STATS_FORMAT, null,
+                mProcessStateStatsLongs, null)) {
+            if (DEBUG_OOM_ADJ) Slog.d(TAG, "UNABLE TO RETRIEVE STATE FOR " + proc.procStatFile);
+            return false;
+        }
+        final long state = mProcessStateStatsLongs[0];
+        if (DEBUG_OOM_ADJ) Slog.d(TAG, "RETRIEVED STATE FOR " + proc.procStatFile + ": "
+                + (char)state);
+        return state != 'Z' && state != 'X' && state != 'x' && state != 'K';
+    }
+
     private ContentProviderHolder getContentProviderImpl(IApplicationThread caller,
             String name, IBinder token, boolean stable, int userId) {
         ContentProviderRecord cpr;
@@ -10553,7 +10586,7 @@
                 }
             }
 
-            boolean providerRunning = cpr != null;
+            boolean providerRunning = cpr != null && cpr.proc != null && !cpr.proc.killed;
             if (providerRunning) {
                 cpi = cpr.info;
                 String msg;
@@ -10595,35 +10628,44 @@
                     }
                 }
 
-                if (cpr.proc != null) {
-                    checkTime(startTime, "getContentProviderImpl: before updateOomAdj");
-                    boolean success = updateOomAdjLocked(cpr.proc);
-                    maybeUpdateProviderUsageStatsLocked(r, cpr.info.packageName, name);
-                    checkTime(startTime, "getContentProviderImpl: after updateOomAdj");
-                    if (DEBUG_PROVIDER) Slog.i(TAG_PROVIDER, "Adjust success: " + success);
-                    // NOTE: there is still a race here where a signal could be
-                    // pending on the process even though we managed to update its
-                    // adj level.  Not sure what to do about this, but at least
-                    // the race is now smaller.
-                    if (!success) {
-                        // Uh oh...  it looks like the provider's process
-                        // has been killed on us.  We need to wait for a new
-                        // process to be started, and make sure its death
-                        // doesn't kill our process.
-                        Slog.i(TAG, "Existing provider " + cpr.name.flattenToShortString()
-                                + " is crashing; detaching " + r);
-                        boolean lastRef = decProviderCountLocked(conn, cpr, token, stable);
-                        checkTime(startTime, "getContentProviderImpl: before appDied");
-                        appDiedLocked(cpr.proc);
-                        checkTime(startTime, "getContentProviderImpl: after appDied");
-                        if (!lastRef) {
-                            // This wasn't the last ref our process had on
-                            // the provider...  we have now been killed, bail.
-                            return null;
-                        }
-                        providerRunning = false;
-                        conn = null;
+                checkTime(startTime, "getContentProviderImpl: before updateOomAdj");
+                final int verifiedAdj = cpr.proc.verifiedAdj;
+                boolean success = updateOomAdjLocked(cpr.proc);
+                // XXX things have changed so updateOomAdjLocked doesn't actually tell us
+                // if the process has been successfully adjusted.  So to reduce races with
+                // it, we will check whether the process still exists.  Note that this doesn't
+                // completely get rid of races with LMK killing the process, but should make
+                // them much smaller.
+                if (success && verifiedAdj != cpr.proc.setAdj && !isProcessAliveLocked(cpr.proc)) {
+                    success = false;
+                }
+                maybeUpdateProviderUsageStatsLocked(r, cpr.info.packageName, name);
+                checkTime(startTime, "getContentProviderImpl: after updateOomAdj");
+                if (DEBUG_PROVIDER) Slog.i(TAG_PROVIDER, "Adjust success: " + success);
+                // NOTE: there is still a race here where a signal could be
+                // pending on the process even though we managed to update its
+                // adj level.  Not sure what to do about this, but at least
+                // the race is now smaller.
+                if (!success) {
+                    // Uh oh...  it looks like the provider's process
+                    // has been killed on us.  We need to wait for a new
+                    // process to be started, and make sure its death
+                    // doesn't kill our process.
+                    Slog.i(TAG, "Existing provider " + cpr.name.flattenToShortString()
+                            + " is crashing; detaching " + r);
+                    boolean lastRef = decProviderCountLocked(conn, cpr, token, stable);
+                    checkTime(startTime, "getContentProviderImpl: before appDied");
+                    appDiedLocked(cpr.proc);
+                    checkTime(startTime, "getContentProviderImpl: after appDied");
+                    if (!lastRef) {
+                        // This wasn't the last ref our process had on
+                        // the provider...  we have now been killed, bail.
+                        return null;
                     }
+                    providerRunning = false;
+                    conn = null;
+                } else {
+                    cpr.proc.verifiedAdj = cpr.proc.setAdj;
                 }
 
                 Binder.restoreCallingIdentity(origId);
@@ -10767,7 +10809,7 @@
                         checkTime(startTime, "getContentProviderImpl: looking for process record");
                         ProcessRecord proc = getProcessRecordLocked(
                                 cpi.processName, cpr.appInfo.uid, false);
-                        if (proc != null && proc.thread != null) {
+                        if (proc != null && proc.thread != null && !proc.killed) {
                             if (DEBUG_PROVIDER) Slog.d(TAG_PROVIDER,
                                     "Installing in existing process " + proc);
                             if (!proc.pubProviders.containsKey(cpi.name)) {
@@ -11476,11 +11518,15 @@
 
     // Actually is sleeping or shutting down or whatever else in the future
     // is an inactive state.
-    public boolean isSleepingOrShuttingDown() {
-        return isSleeping() || mShuttingDown;
+    boolean isSleepingOrShuttingDownLocked() {
+        return isSleepingLocked() || mShuttingDown;
     }
 
-    public boolean isSleeping() {
+    boolean isShuttingDownLocked() {
+        return mShuttingDown;
+    }
+
+    boolean isSleepingLocked() {
         return mSleeping;
     }
 
@@ -12850,7 +12896,7 @@
                     proc.notCachedSinceIdle = true;
                     proc.initialIdlePss = 0;
                     proc.nextPssTime = ProcessList.computeNextPssTime(proc.setProcState, true,
-                            mTestPssMode, isSleeping(), now);
+                            mTestPssMode, isSleepingLocked(), now);
                 }
             }
 
@@ -16568,7 +16614,8 @@
                         && capp.pid != MY_PID) {
                     capp.kill("depends on provider "
                             + cpr.name.flattenToShortString()
-                            + " in dying proc " + (proc != null ? proc.processName : "??"), true);
+                            + " in dying proc " + (proc != null ? proc.processName : "??")
+                            + " (adj " + (proc != null ? proc.setAdj : "??") + ")", true);
                 }
             } else if (capp.thread != null && conn.provider.provider != null) {
                 try {
@@ -17041,11 +17088,22 @@
     // Cause the target app to be launched if necessary and its backup agent
     // instantiated.  The backup agent will invoke backupAgentCreated() on the
     // activity manager to announce its creation.
-    public boolean bindBackupAgent(ApplicationInfo app, int backupMode) {
-        if (DEBUG_BACKUP) Slog.v(TAG_BACKUP,
-                "bindBackupAgent: app=" + app + " mode=" + backupMode);
+    public boolean bindBackupAgent(String packageName, int backupMode, int userId) {
+        if (DEBUG_BACKUP) Slog.v(TAG, "bindBackupAgent: app=" + packageName + " mode=" + backupMode);
         enforceCallingPermission("android.permission.CONFIRM_FULL_BACKUP", "bindBackupAgent");
 
+        IPackageManager pm = AppGlobals.getPackageManager();
+        ApplicationInfo app = null;
+        try {
+            app = pm.getApplicationInfo(packageName, 0, userId);
+        } catch (RemoteException e) {
+            // can't happen; package manager is process-local
+        }
+        if (app == null) {
+            Slog.w(TAG, "Unable to bind backup agent for " + packageName);
+            return false;
+        }
+
         synchronized(this) {
             // !!! TODO: currently no check here that we're already bound
             BatteryStatsImpl.Uid.Pkg.Serv ss = null;
@@ -17752,6 +17810,14 @@
                                         removeUriPermissionsForPackageLocked(ssp, userId, true);
 
                                         removeTasksByPackageNameLocked(ssp, userId);
+
+                                        // Hide the "unsupported display" dialog if necessary.
+                                        if (mUnsupportedDisplaySizeDialog != null && ssp.equals(
+                                                mUnsupportedDisplaySizeDialog.getPackageName())) {
+                                            mUnsupportedDisplaySizeDialog.dismiss();
+                                            mUnsupportedDisplaySizeDialog = null;
+                                        }
+                                        mCompatModePackages.handlePackageUninstalledLocked(ssp);
                                         mBatteryStatsService.notePackageUninstalled(ssp);
                                     }
                                 } else {
@@ -17823,6 +17889,21 @@
                     }
                     break;
                 }
+                case Intent.ACTION_PACKAGE_DATA_CLEARED:
+                {
+                    Uri data = intent.getData();
+                    String ssp;
+                    if (data != null && (ssp = data.getSchemeSpecificPart()) != null) {
+                        // Hide the "unsupported display" dialog if necessary.
+                        if (mUnsupportedDisplaySizeDialog != null && ssp.equals(
+                                mUnsupportedDisplaySizeDialog.getPackageName())) {
+                            mUnsupportedDisplaySizeDialog.dismiss();
+                            mUnsupportedDisplaySizeDialog = null;
+                        }
+                        mCompatModePackages.handlePackageDataClearedLocked(ssp);
+                    }
+                    break;
+                }
                 case Intent.ACTION_TIMEZONE_CHANGED:
                     // If this is the time zone changed action, queue up a message that will reset
                     // the timezone of all currently running processes. This message will get
@@ -17854,6 +17935,19 @@
                     // Apps should use JobScehduler to monitor for media provider changes.
                     Slog.w(TAG, action + " no longer allowed; dropping from "
                             + UserHandle.formatUid(callingUid));
+                    if (resultTo != null) {
+                        final BroadcastQueue queue = broadcastQueueForIntent(intent);
+                        try {
+                            queue.performReceiveLocked(callerApp, resultTo, intent,
+                                    Activity.RESULT_CANCELED, null, null,
+                                    false, false, userId);
+                        } catch (RemoteException e) {
+                            Slog.w(TAG, "Failure ["
+                                    + queue.mQueueName + "] sending broadcast result of "
+                                    + intent, e);
+
+                        }
+                    }
                     // Lie; we don't want to crash the app.
                     return ActivityManager.BROADCAST_SUCCESS;
             }
@@ -18645,6 +18739,9 @@
 
                 final boolean isDensityChange = (changes & ActivityInfo.CONFIG_DENSITY) != 0;
                 if (isDensityChange) {
+                    // Reset the unsupported display size dialog.
+                    mUiHandler.sendEmptyMessage(SHOW_UNSUPPORTED_DISPLAY_SIZE_DIALOG_MSG);
+
                     killAllBackgroundProcessesExcept(Build.VERSION_CODES.N,
                             ActivityManager.PROCESS_STATE_FOREGROUND_SERVICE);
                 }
@@ -19190,6 +19287,7 @@
         }
 
         boolean mayBeTop = false;
+        app.whitelistManager = false;
 
         for (int is = app.services.size()-1;
                 is >= 0 && (adj > ProcessList.FOREGROUND_APP_ADJ
@@ -19230,8 +19328,6 @@
                 }
             }
 
-            app.whitelistManager = false;
-
             for (int conni = s.connections.size()-1;
                     conni >= 0 && (adj > ProcessList.FOREGROUND_APP_ADJ
                             || schedGroup == ProcessList.SCHED_GROUP_BACKGROUND
@@ -19745,7 +19841,7 @@
             if (memLowered || now > (app.lastStateTime+ProcessList.PSS_ALL_INTERVAL)) {
                 app.pssProcState = app.setProcState;
                 app.nextPssTime = ProcessList.computeNextPssTime(app.curProcState, true,
-                        mTestPssMode, isSleeping(), now);
+                        mTestPssMode, isSleepingLocked(), now);
                 mPendingPssProcesses.add(app);
             }
         }
@@ -19793,7 +19889,7 @@
             }
         }
         return !processingBroadcasts
-                && (isSleeping() || mStackSupervisor.allResumedActivitiesIdle());
+                && (isSleepingLocked() || mStackSupervisor.allResumedActivitiesIdle());
     }
 
     /**
@@ -20003,6 +20099,7 @@
                     "Set " + app.pid + " " + app.processName + " adj " + app.curAdj + ": "
                     + app.adjType);
             app.setAdj = app.curAdj;
+            app.verifiedAdj = ProcessList.INVALID_ADJ;
         }
 
         if (app.setSchedGroup != app.curSchedGroup) {
@@ -20084,7 +20181,7 @@
             }
             app.lastStateTime = now;
             app.nextPssTime = ProcessList.computeNextPssTime(app.curProcState, true,
-                    mTestPssMode, isSleeping(), now);
+                    mTestPssMode, isSleepingLocked(), now);
             if (DEBUG_PSS) Slog.d(TAG_PSS, "Process state change from "
                     + ProcessList.makeProcStateString(app.setProcState) + " to "
                     + ProcessList.makeProcStateString(app.curProcState) + " next pss in "
@@ -20095,7 +20192,7 @@
                     mTestPssMode)))) {
                 requestPssLocked(app, app.setProcState);
                 app.nextPssTime = ProcessList.computeNextPssTime(app.curProcState, false,
-                        mTestPssMode, isSleeping(), now);
+                        mTestPssMode, isSleepingLocked(), now);
             } else if (false && DEBUG_PSS) Slog.d(TAG_PSS,
                     "Not requesting PSS of " + app + ": next=" + (app.nextPssTime-now));
         }
@@ -20621,7 +20718,7 @@
         }
         mLastMemoryLevel = memFactor;
         mLastNumProcesses = mLruProcesses.size();
-        boolean allChanged = mProcessStats.setMemFactorLocked(memFactor, !isSleeping(), now);
+        boolean allChanged = mProcessStats.setMemFactorLocked(memFactor, !isSleepingLocked(), now);
         final int trackerMemFactor = mProcessStats.getMemFactorLocked();
         if (memFactor != ProcessStats.ADJ_MEM_FACTOR_NORMAL) {
             if (mLowRamStartTime == 0) {
diff --git a/services/core/java/com/android/server/am/ActivityRecord.java b/services/core/java/com/android/server/am/ActivityRecord.java
index 3ccac9e..50b6c0c 100755
--- a/services/core/java/com/android/server/am/ActivityRecord.java
+++ b/services/core/java/com/android/server/am/ActivityRecord.java
@@ -444,10 +444,17 @@
             return;
         }
         try {
+            // Make sure fontScale is always equal to global. For fullscreen apps, config is
+            // the shared EMPTY config, which has default fontScale of 1.0. We don't want it
+            // to be applied as an override config.
+            Configuration overrideConfig = new Configuration(config);
+            overrideConfig.fontScale = service.mConfiguration.fontScale;
+
             if (DEBUG_CONFIGURATION) Slog.v(TAG, "Sending new config to " + this + " " +
-                    "reportToActivity=" + reportToActivity + " and config: " + config);
+                    "reportToActivity=" + reportToActivity + " and config: " + overrideConfig);
+
             app.thread.scheduleActivityConfigurationChanged(
-                    appToken, new Configuration(config), reportToActivity);
+                    appToken, overrideConfig, reportToActivity);
         } catch (RemoteException e) {
             // If process died, whatever.
         }
@@ -931,7 +938,7 @@
         final ReferrerIntent rintent = new ReferrerIntent(intent, referrer);
         boolean unsent = true;
         if ((state == ActivityState.RESUMED
-                || (service.isSleeping() && task.stack != null
+                || (service.isSleepingLocked() && task.stack != null
                     && task.stack.topRunningActivityLocked() == this))
                 && app != null && app.thread != null) {
             try {
@@ -1150,13 +1157,6 @@
 
     public void reportFullyDrawnLocked() {
         final long curTime = SystemClock.uptimeMillis();
-        // Normally launch time counts from the point when the activity is resumed, to when the
-        // first window is drawn. However the activity could become visible before it is resumed,
-        // due to some other activity in the same task being launched. In this case we still need
-        // to report launch time to unblock ActivityStarter.startActivityMayWait().
-        if (displayStartTime == 0 && task != null && task.isLaunching) {
-            displayStartTime = curTime;
-        }
         if (displayStartTime != 0) {
             reportLaunchTimeLocked(curTime);
         }
@@ -1222,22 +1222,13 @@
             //service.mUsageStatsService.noteLaunchTime(realActivity, (int)totalTime);
         }
         displayStartTime = 0;
-        task.isLaunching = false;
         stack.mLaunchStartTime = 0;
     }
 
     void windowsDrawnLocked() {
         mStackSupervisor.mActivityMetricsLogger.notifyWindowsDrawn();
-        final long curTime = SystemClock.uptimeMillis();
-        // Normally launch time counts from the point when the activity is resumed, to when the
-        // first window is drawn. However the activity could become visible before it is resumed,
-        // due to some other activity in the same task being launched. In this case we still need
-        // to report launch time to unblock ActivityStarter.startActivityMayWait().
-        if (displayStartTime == 0 && task != null && task.isLaunching) {
-            displayStartTime = curTime;
-        }
         if (displayStartTime != 0) {
-            reportLaunchTimeLocked(curTime);
+            reportLaunchTimeLocked(SystemClock.uptimeMillis());
         }
         mStackSupervisor.sendWaitingVisibleReportLocked(this);
         startTime = 0;
diff --git a/services/core/java/com/android/server/am/ActivityStack.java b/services/core/java/com/android/server/am/ActivityStack.java
index d83a750..a5c34e2 100644
--- a/services/core/java/com/android/server/am/ActivityStack.java
+++ b/services/core/java/com/android/server/am/ActivityStack.java
@@ -825,7 +825,8 @@
      * is the same as the given activity.  Returns null if no such activity
      * is found.
      */
-    ActivityRecord findActivityLocked(Intent intent, ActivityInfo info) {
+    ActivityRecord findActivityLocked(Intent intent, ActivityInfo info,
+                                      boolean compareIntentFilters) {
         ComponentName cls = intent.getComponent();
         if (info.targetActivity != null) {
             cls = new ComponentName(info.packageName, info.targetActivity);
@@ -843,8 +844,16 @@
                 if (notCurrentUserTask && (r.info.flags & FLAG_SHOW_FOR_ALL_USERS) == 0) {
                     continue;
                 }
-                if (!r.finishing && r.intent.getComponent().equals(cls) && r.userId == userId) {
-                    return r;
+                if (!r.finishing && r.userId == userId) {
+                    if (compareIntentFilters) {
+                        if (r.intent.filterEquals(intent)) {
+                            return r;
+                        }
+                    } else {
+                        if (r.intent.getComponent().equals(cls)) {
+                            return r;
+                        }
+                    }
                 }
             }
         }
@@ -924,9 +933,6 @@
     void setLaunchTime(ActivityRecord r) {
         if (r.displayStartTime == 0) {
             r.fullyDrawnStartTime = r.displayStartTime = SystemClock.uptimeMillis();
-            if (r.task != null) {
-                r.task.isLaunching = true;
-            }
             if (mLaunchStartTime == 0) {
                 startLaunchTraces(r.packageName);
                 mLaunchStartTime = mFullyDrawnStartTime = r.displayStartTime;
@@ -941,9 +947,6 @@
         // Make sure that there is no activity waiting for this to launch.
         if (mStackSupervisor.mWaitingActivityLaunched.isEmpty()) {
             r.displayStartTime = r.fullyDrawnStartTime = 0;
-            if (r.task != null) {
-                r.task.isLaunching = false;
-            }
         } else {
             mStackSupervisor.removeTimeoutsForActivityLocked(r);
             mStackSupervisor.scheduleIdleTimeoutLocked(r);
@@ -1075,7 +1078,7 @@
         if (mPausingActivity != null) {
             Slog.wtf(TAG, "Going to pause when pause is already pending for " + mPausingActivity
                     + " state=" + mPausingActivity.state);
-            if (!mService.isSleeping()) {
+            if (!mService.isSleepingLocked()) {
                 // Avoid recursion among check for sleep and complete pause during sleeping.
                 // Because activity will be paused immediately after resume, just let pause
                 // be completed by the order of activity paused from clients.
@@ -1139,7 +1142,7 @@
 
         // If we are not going to sleep, we want to ensure the device is
         // awake until the next activity is started.
-        if (!uiSleeping && !mService.isSleepingOrShuttingDown()) {
+        if (!uiSleeping && !mService.isSleepingOrShuttingDownLocked()) {
             mStackSupervisor.acquireLaunchWakelock();
         }
 
@@ -1292,7 +1295,7 @@
                     // We don't need to schedule another stop, we only need to let it happen.
                     prev.state = ActivityState.STOPPING;
                 } else if ((!prev.visible && !hasVisibleBehindActivity())
-                        || mService.isSleepingOrShuttingDown()) {
+                        || mService.isSleepingOrShuttingDownLocked()) {
                     // If we were visible then resumeTopActivities will release resources before
                     // stopping.
                     addToStopping(prev, true /* immediate */);
@@ -1310,7 +1313,7 @@
 
         if (resumeNext) {
             final ActivityStack topStack = mStackSupervisor.getFocusedStack();
-            if (!mService.isSleepingOrShuttingDown()) {
+            if (!mService.isSleepingOrShuttingDownLocked()) {
                 mStackSupervisor.resumeFocusedStackTopActivityLocked(topStack, prev, null);
             } else {
                 mStackSupervisor.checkReadyForSleepLocked();
@@ -1398,6 +1401,7 @@
 
         if (next.nowVisible) {
             // We won't get a call to reportActivityVisibleLocked() so dismiss lockscreen now.
+            mStackSupervisor.reportActivityVisibleLocked(next);
             mStackSupervisor.notifyActivityDrawnForKeyguard();
         }
 
@@ -2195,7 +2199,7 @@
 
         // If we are sleeping, and there is no resumed activity, and the top
         // activity is paused, well that is the state we want.
-        if (mService.isSleepingOrShuttingDown()
+        if (mService.isSleepingOrShuttingDownLocked()
                 && mLastPausedActivity == next
                 && mStackSupervisor.allPausedActivitiesComplete()) {
             // Make sure we have executed any pending transitions, since there
@@ -2277,7 +2281,7 @@
         // If the most recent activity was noHistory but was only stopped rather
         // than stopped+finished because the device went to sleep, we need to make
         // sure to finish it as we're making a new activity topmost.
-        if (mService.isSleeping() && mLastNoHistoryActivity != null &&
+        if (mService.isSleepingLocked() && mLastNoHistoryActivity != null &&
                 !mLastNoHistoryActivity.finishing) {
             if (DEBUG_STATES) Slog.d(TAG_STATES,
                     "no-history finish of " + mLastNoHistoryActivity + " on new resume");
@@ -2480,6 +2484,7 @@
                         System.identityHashCode(next), next.task.taskId, next.shortComponentName);
 
                 next.sleeping = false;
+                mService.showUnsupportedZoomDialogIfNeededLocked(next);
                 mService.showAskCompatModeDialogLocked(next);
                 next.app.pendingUiClean = true;
                 next.app.forceProcessStateUpTo(mService.mTopProcessState);
@@ -3211,7 +3216,7 @@
         if ((r.intent.getFlags()&Intent.FLAG_ACTIVITY_NO_HISTORY) != 0
                 || (r.info.flags&ActivityInfo.FLAG_NO_HISTORY) != 0) {
             if (!r.finishing) {
-                if (!mService.isSleeping()) {
+                if (!mService.isSleepingLocked()) {
                     if (DEBUG_STATES) Slog.d(TAG_STATES, "no-history finish of " + r);
                     if (requestFinishActivityLocked(r.appToken, Activity.RESULT_CANCELED, null,
                             "stop-no-history", false)) {
@@ -3243,7 +3248,7 @@
                 EventLogTags.writeAmStopActivity(
                         r.userId, System.identityHashCode(r), r.shortComponentName);
                 r.app.thread.scheduleStopActivity(r.appToken, r.visible, r.configChangeFlags);
-                if (mService.isSleepingOrShuttingDown()) {
+                if (mService.isSleepingOrShuttingDownLocked()) {
                     r.setSleeping(true);
                 }
                 Message msg = mHandler.obtainMessage(STOP_TIMEOUT_MSG, r);
@@ -4447,7 +4452,7 @@
             }
         }
         if (updatedConfig) {
-            // Ensure the resumed state of the focus activity if we updated the confiugaration of
+            // Ensure the resumed state of the focus activity if we updated the configuration of
             // any activity.
             mStackSupervisor.resumeFocusedStackTopActivityLocked();
         }
@@ -4467,6 +4472,15 @@
             return true;
         }
 
+        // TODO: We could probably make the condition below just check that the activity state is
+        // stopped, but also checking the sleep state for now to reduce change impact late in
+        // development cycle.
+        if (mService.isSleepingOrShuttingDownLocked() && r.state == ActivityState.STOPPED) {
+            if (DEBUG_SWITCH || DEBUG_CONFIGURATION) Slog.v(TAG_CONFIGURATION,
+                    "Skipping config check (stopped while sleeping): " + r);
+            return true;
+        }
+
         if (DEBUG_SWITCH || DEBUG_CONFIGURATION) Slog.v(TAG_CONFIGURATION,
                 "Ensuring correct configuration: " + r);
 
@@ -5177,7 +5191,8 @@
                 r.task.taskId, mStackId, r.info.screenOrientation, r.fullscreen,
                 (r.info.flags & FLAG_SHOW_FOR_ALL_USERS) != 0, r.userId, r.info.configChanges,
                 task.voiceSession != null, r.mLaunchTaskBehind, bounds, task.mOverrideConfig,
-                task.mResizeMode, r.isAlwaysFocusable(), task.isHomeTask());
+                task.mResizeMode, r.isAlwaysFocusable(), task.isHomeTask(),
+                r.appInfo.targetSdkVersion);
         r.taskConfigOverride = task.mOverrideConfig;
     }
 
diff --git a/services/core/java/com/android/server/am/ActivityStackSupervisor.java b/services/core/java/com/android/server/am/ActivityStackSupervisor.java
index 7a43d53..36207c4 100644
--- a/services/core/java/com/android/server/am/ActivityStackSupervisor.java
+++ b/services/core/java/com/android/server/am/ActivityStackSupervisor.java
@@ -111,6 +111,7 @@
 import static android.app.ActivityManager.LOCK_TASK_MODE_PINNED;
 import static android.app.ActivityManager.RESIZE_MODE_FORCED;
 import static android.app.ActivityManager.RESIZE_MODE_SYSTEM;
+import static android.app.ActivityManager.START_TASK_TO_FRONT;
 import static android.app.ActivityManager.StackId.DOCKED_STACK_ID;
 import static android.app.ActivityManager.StackId.FIRST_DYNAMIC_STACK_ID;
 import static android.app.ActivityManager.StackId.FIRST_STATIC_STACK_ID;
@@ -1002,6 +1003,24 @@
         }
     }
 
+    void reportTaskToFrontNoLaunch(ActivityRecord r) {
+        boolean changed = false;
+        for (int i = mWaitingActivityLaunched.size() - 1; i >= 0; i--) {
+            WaitResult w = mWaitingActivityLaunched.remove(i);
+            if (w.who == null) {
+                changed = true;
+                // Set result to START_TASK_TO_FRONT so that startActivityMayWait() knows that
+                // the starting activity ends up moving another activity to front, and it should
+                // wait for this new activity to become visible instead.
+                // Do not modify other fields.
+                w.result = START_TASK_TO_FRONT;
+            }
+        }
+        if (changed) {
+            mService.notifyAll();
+        }
+    }
+
     void reportActivityLaunchedLocked(boolean timeout, ActivityRecord r,
             long thisTime, long totalTime) {
         boolean changed = false;
@@ -1015,6 +1034,7 @@
                 }
                 w.thisTime = thisTime;
                 w.totalTime = totalTime;
+                // Do not modify w.result.
             }
         }
         if (changed) {
@@ -1217,6 +1237,7 @@
                                       PackageManager.NOTIFY_PACKAGE_USE_ACTIVITY);
             r.sleeping = false;
             r.forceNewConfig = false;
+            mService.showUnsupportedZoomDialogIfNeededLocked(r);
             mService.showAskCompatModeDialogLocked(r);
             r.compat = mService.compatibilityInfoForPackageLocked(r.info.applicationInfo);
             ProfilerInfo profilerInfo = null;
@@ -2618,11 +2639,13 @@
         return mTmpFindTaskResult.r;
     }
 
-    ActivityRecord findActivityLocked(Intent intent, ActivityInfo info) {
+    ActivityRecord findActivityLocked(Intent intent, ActivityInfo info,
+                                      boolean compareIntentFilters) {
         for (int displayNdx = mActivityDisplays.size() - 1; displayNdx >= 0; --displayNdx) {
             final ArrayList<ActivityStack> stacks = mActivityDisplays.valueAt(displayNdx).mStacks;
             for (int stackNdx = stacks.size() - 1; stackNdx >= 0; --stackNdx) {
-                final ActivityRecord ar = stacks.get(stackNdx).findActivityLocked(intent, info);
+                final ActivityRecord ar = stacks.get(stackNdx)
+                        .findActivityLocked(intent, info, compareIntentFilters);
                 if (ar != null) {
                     return ar;
                 }
@@ -2707,7 +2730,7 @@
     }
 
     void checkReadyForSleepLocked() {
-        if (!mService.isSleepingOrShuttingDown()) {
+        if (!mService.isSleepingOrShuttingDownLocked()) {
             // Do not care.
             return;
         }
@@ -3022,8 +3045,9 @@
 
     /** Checks whether the activity should be shown for current user. */
     boolean okToShowLocked(ActivityRecord r) {
-        return r != null && (isCurrentProfileLocked(r.userId)
-                || (r.info.flags & FLAG_SHOW_FOR_ALL_USERS) != 0);
+        return r != null && ((r.info.flags & FLAG_SHOW_FOR_ALL_USERS) != 0
+                || (isCurrentProfileLocked(r.userId)
+                && !mService.mUserController.isUserStoppingOrShuttingDownLocked(r.userId)));
     }
 
     final ArrayList<ActivityRecord> processStoppingActivitiesLocked(boolean remove) {
@@ -3047,7 +3071,7 @@
                     mWindowManager.setAppVisibility(s.appToken, false);
                 }
             }
-            if ((!waitingVisible || mService.isSleepingOrShuttingDown()) && remove) {
+            if ((!waitingVisible || mService.isSleepingOrShuttingDownLocked()) && remove) {
                 if (DEBUG_STATES) Slog.v(TAG, "Ready to stop: " + s);
                 if (stops == null) {
                     stops = new ArrayList<>();
@@ -3771,7 +3795,7 @@
                 } break;
                 case SLEEP_TIMEOUT_MSG: {
                     synchronized (mService) {
-                        if (mService.isSleepingOrShuttingDown()) {
+                        if (mService.isSleepingOrShuttingDownLocked()) {
                             Slog.w(TAG, "Sleep timeout!  Sleeping now.");
                             mSleepTimeout = true;
                             checkReadyForSleepLocked();
diff --git a/services/core/java/com/android/server/am/ActivityStartInterceptor.java b/services/core/java/com/android/server/am/ActivityStartInterceptor.java
index a2c2040..f26e47e 100644
--- a/services/core/java/com/android/server/am/ActivityStartInterceptor.java
+++ b/services/core/java/com/android/server/am/ActivityStartInterceptor.java
@@ -186,9 +186,13 @@
         if (mActivityOptions == null) {
             mActivityOptions = ActivityOptions.makeBasic();
         }
-        // Showing credential confirmation activity in home task to avoid stopping multi-windowed
-        // mode after showing the full-screen credential confirmation activity.
-        mActivityOptions.setLaunchTaskId(mSupervisor.getHomeActivity().task.taskId);
+
+        ActivityRecord homeActivityRecord = mSupervisor.getHomeActivity();
+        if (homeActivityRecord != null && homeActivityRecord.task != null) {
+            // Showing credential confirmation activity in home task to avoid stopping multi-windowed
+            // mode after showing the full-screen credential confirmation activity.
+            mActivityOptions.setLaunchTaskId(homeActivityRecord.task.taskId);
+        }
 
         final UserInfo parent = mUserManager.getProfileParent(mUserId);
         mRInfo = mSupervisor.resolveIntent(mIntent, mResolvedType, parent.id);
diff --git a/services/core/java/com/android/server/am/ActivityStarter.java b/services/core/java/com/android/server/am/ActivityStarter.java
index 522e42b..234a467 100644
--- a/services/core/java/com/android/server/am/ActivityStarter.java
+++ b/services/core/java/com/android/server/am/ActivityStarter.java
@@ -553,6 +553,13 @@
             return;
         }
 
+        // We're waiting for an activity launch to finish, but that activity simply
+        // brought another activity to front. Let startActivityMayWait() know about
+        // this, so it waits for the new activity to become visible instead.
+        if (result == START_TASK_TO_FRONT && !mSupervisor.mWaitingActivityLaunched.isEmpty()) {
+            mSupervisor.reportTaskToFrontNoLaunch(mStartActivity);
+        }
+
         int startedActivityStackId = INVALID_STACK_ID;
         if (r.task != null && r.task.stack != null) {
             startedActivityStackId = r.task.stack.mStackId;
@@ -840,8 +847,13 @@
                             mService.wait();
                         } catch (InterruptedException e) {
                         }
-                    } while (!outResult.timeout && outResult.who == null);
-                } else if (res == START_TASK_TO_FRONT) {
+                    } while (outResult.result != START_TASK_TO_FRONT
+                            && !outResult.timeout && outResult.who == null);
+                    if (outResult.result == START_TASK_TO_FRONT) {
+                        res = START_TASK_TO_FRONT;
+                    }
+                }
+                if (res == START_TASK_TO_FRONT) {
                     ActivityRecord r = stack.topRunningActivityLocked();
                     if (r.nowVisible && r.state == RESUMED) {
                         outResult.timeout = false;
@@ -1409,11 +1421,11 @@
             if (mLaunchSingleInstance) {
                 // There can be one and only one instance of single instance activity in the
                 // history, and it is always in its own unique task, so we do a special search.
-               intentActivity = mSupervisor.findActivityLocked(mIntent, mStartActivity.info);
+               intentActivity = mSupervisor.findActivityLocked(mIntent, mStartActivity.info, false);
             } else if ((mLaunchFlags & FLAG_ACTIVITY_LAUNCH_ADJACENT) != 0) {
                 // For the launch adjacent case we only want to put the activity in an existing
                 // task if the activity already exists in the history.
-                intentActivity = mSupervisor.findActivityLocked(mIntent, mStartActivity.info);
+                intentActivity = mSupervisor.findActivityLocked(mIntent, mStartActivity.info, true);
             } else {
                 // Otherwise find the best task to put the activity in.
                 intentActivity = mSupervisor.findTaskLocked(mStartActivity);
@@ -1465,14 +1477,23 @@
                                 intentActivity.task, mNoAnimation, mOptions,
                                 mStartActivity.appTimeTracker, "bringingFoundTaskToFront");
                         mMovedToFront = true;
-                    } else if ((launchStack.mStackId == DOCKED_STACK_ID
-                            || launchStack.mStackId == FULLSCREEN_WORKSPACE_STACK_ID)
-                            && (mLaunchFlags & FLAG_ACTIVITY_LAUNCH_ADJACENT) != 0) {
-                        // If we want to launch adjacent and mTargetStack is not the computed
-                        // launch stack - move task to top of computed stack.
-                        mSupervisor.moveTaskToStackLocked(intentActivity.task.taskId,
-                                launchStack.mStackId, ON_TOP, FORCE_FOCUS, "launchToSide",
-                                ANIMATE);
+                    } else if (launchStack.mStackId == DOCKED_STACK_ID
+                            || launchStack.mStackId == FULLSCREEN_WORKSPACE_STACK_ID) {
+                        if ((mLaunchFlags & FLAG_ACTIVITY_LAUNCH_ADJACENT) != 0) {
+                            // If we want to launch adjacent and mTargetStack is not the computed
+                            // launch stack - move task to top of computed stack.
+                            mSupervisor.moveTaskToStackLocked(intentActivity.task.taskId,
+                                    launchStack.mStackId, ON_TOP, FORCE_FOCUS, "launchToSide",
+                                    ANIMATE);
+                        } else {
+                            // TODO: This should be reevaluated in MW v2.
+                            // We choose to move task to front instead of launching it adjacent
+                            // when specific stack was requested explicitly and it appeared to be
+                            // adjacent stack, but FLAG_ACTIVITY_LAUNCH_ADJACENT was not set.
+                            mTargetStack.moveTaskToFrontLocked(intentActivity.task, mNoAnimation,
+                                    mOptions, mStartActivity.appTimeTracker,
+                                    "bringToFrontInsteadOfAdjacentLaunch");
+                        }
                         mMovedToFront = true;
                     }
                     mOptions = null;
diff --git a/services/core/java/com/android/server/am/BroadcastQueue.java b/services/core/java/com/android/server/am/BroadcastQueue.java
index 88645c1..a279290 100644
--- a/services/core/java/com/android/server/am/BroadcastQueue.java
+++ b/services/core/java/com/android/server/am/BroadcastQueue.java
@@ -456,7 +456,7 @@
         }
     }
 
-    private void performReceiveLocked(ProcessRecord app, IIntentReceiver receiver,
+    void performReceiveLocked(ProcessRecord app, IIntentReceiver receiver,
             Intent intent, int resultCode, String data, Bundle extras,
             boolean ordered, boolean sticky, int sendingUser) throws RemoteException {
         // Send the intent to the receiver asynchronously using one-way binder calls.
diff --git a/services/core/java/com/android/server/am/CompatModePackages.java b/services/core/java/com/android/server/am/CompatModePackages.java
index 26264e5..a54df4b 100644
--- a/services/core/java/com/android/server/am/CompatModePackages.java
+++ b/services/core/java/com/android/server/am/CompatModePackages.java
@@ -57,6 +57,8 @@
     public static final int COMPAT_FLAG_DONT_ASK = 1<<0;
     // Compatibility state: compatibility mode is enabled.
     public static final int COMPAT_FLAG_ENABLED = 1<<1;
+    // Unsupported zoom state: don't warn the user about unsupported zoom mode.
+    public static final int UNSUPPORTED_ZOOM_FLAG_DONT_NOTIFY = 1<<2;
 
     private final HashMap<String, Integer> mPackages = new HashMap<String, Integer>();
 
@@ -147,6 +149,24 @@
         return flags != null ? flags : 0;
     }
 
+    public void handlePackageDataClearedLocked(String packageName) {
+        // User has explicitly asked to clear all associated data.
+        removePackage(packageName);
+    }
+
+    public void handlePackageUninstalledLocked(String packageName) {
+        // Clear settings when app is uninstalled since this is an explicit
+        // signal from the user to remove the app and all associated data.
+        removePackage(packageName);
+    }
+
+    private void removePackage(String packageName) {
+        if (mPackages.containsKey(packageName)) {
+            mPackages.remove(packageName);
+            scheduleWrite();
+        }
+    }
+
     public void handlePackageAddedLocked(String packageName, boolean updated) {
         ApplicationInfo ai = null;
         try {
@@ -165,13 +185,17 @@
             // any current settings for it.
             if (!mayCompat && mPackages.containsKey(packageName)) {
                 mPackages.remove(packageName);
-                mHandler.removeMessages(MSG_WRITE);
-                Message msg = mHandler.obtainMessage(MSG_WRITE);
-                mHandler.sendMessageDelayed(msg, 10000);
+                scheduleWrite();
             }
         }
     }
 
+    private void scheduleWrite() {
+        mHandler.removeMessages(MSG_WRITE);
+        Message msg = mHandler.obtainMessage(MSG_WRITE);
+        mHandler.sendMessageDelayed(msg, 10000);
+    }
+
     public CompatibilityInfo compatibilityInfoForPackageLocked(ApplicationInfo ai) {
         CompatibilityInfo ci = new CompatibilityInfo(ai, mService.mConfiguration.screenLayout,
                 mService.mConfiguration.smallestScreenWidthDp,
@@ -207,6 +231,10 @@
         return (getPackageFlags(packageName)&COMPAT_FLAG_DONT_ASK) == 0;
     }
 
+    public boolean getPackageNotifyUnsupportedZoomLocked(String packageName) {
+        return (getPackageFlags(packageName)&UNSUPPORTED_ZOOM_FLAG_DONT_NOTIFY) == 0;
+    }
+
     public void setFrontActivityAskCompatModeLocked(boolean ask) {
         ActivityRecord r = mService.getFocusedStack().topRunningActivityLocked();
         if (r != null) {
@@ -223,9 +251,21 @@
             } else {
                 mPackages.remove(packageName);
             }
-            mHandler.removeMessages(MSG_WRITE);
-            Message msg = mHandler.obtainMessage(MSG_WRITE);
-            mHandler.sendMessageDelayed(msg, 10000);
+            scheduleWrite();
+        }
+    }
+
+    public void setPackageNotifyUnsupportedZoomLocked(String packageName, boolean notify) {
+        final int curFlags = getPackageFlags(packageName);
+        final int newFlags = notify ? (curFlags&~UNSUPPORTED_ZOOM_FLAG_DONT_NOTIFY) :
+                (curFlags|UNSUPPORTED_ZOOM_FLAG_DONT_NOTIFY);
+        if (curFlags != newFlags) {
+            if (newFlags != 0) {
+                mPackages.put(packageName, newFlags);
+            } else {
+                mPackages.remove(packageName);
+            }
+            scheduleWrite();
         }
     }
 
@@ -321,9 +361,7 @@
             // Need to get compatibility info in new state.
             ci = compatibilityInfoForPackageLocked(ai);
 
-            mHandler.removeMessages(MSG_WRITE);
-            Message msg = mHandler.obtainMessage(MSG_WRITE);
-            mHandler.sendMessageDelayed(msg, 10000);
+            scheduleWrite();
 
             final ActivityStack stack = mService.getFocusedStack();
             ActivityRecord starting = stack.restartPackage(packageName);
diff --git a/services/core/java/com/android/server/am/ProcessRecord.java b/services/core/java/com/android/server/am/ProcessRecord.java
index 691fd2a..8911a3e 100644
--- a/services/core/java/com/android/server/am/ProcessRecord.java
+++ b/services/core/java/com/android/server/am/ProcessRecord.java
@@ -75,6 +75,7 @@
     ProcessState baseProcessTracker;
     BatteryStatsImpl.Uid.Proc curProcBatteryStats;
     int pid;                    // The process of this application; 0 if none
+    String procStatFile;        // path to /proc/<pid>/stat
     int[] gids;                 // The gids this process was launched with
     String requiredAbi;         // The ABI this process was launched with
     String instructionSet;      // The instruction set this process was launched with
@@ -93,6 +94,7 @@
     int setRawAdj;              // Last set OOM unlimited adjustment for this process
     int curAdj;                 // Current OOM adjustment for this process
     int setAdj;                 // Last set OOM adjustment for this process
+    int verifiedAdj;            // The last adjustment that was verified as actually being set
     int curSchedGroup;          // Currently desired scheduling class
     int setSchedGroup;          // Last set to background scheduling class
     int trimMemoryLevel;        // Last selected memory trimming level
@@ -441,7 +443,7 @@
         pkgList.put(_info.packageName, new ProcessStats.ProcessStateHolder(_info.versionCode));
         maxAdj = ProcessList.UNKNOWN_ADJ;
         curRawAdj = setRawAdj = ProcessList.INVALID_ADJ;
-        curAdj = setAdj = ProcessList.INVALID_ADJ;
+        curAdj = setAdj = verifiedAdj = ProcessList.INVALID_ADJ;
         persistent = false;
         removed = false;
         lastStateTime = lastPssTime = nextPssTime = SystemClock.uptimeMillis();
@@ -449,6 +451,7 @@
 
     public void setPid(int _pid) {
         pid = _pid;
+        procStatFile = null;
         shortStringName = null;
         stringName = null;
     }
diff --git a/services/core/java/com/android/server/am/TaskRecord.java b/services/core/java/com/android/server/am/TaskRecord.java
index c84aaac..3f6db99 100644
--- a/services/core/java/com/android/server/am/TaskRecord.java
+++ b/services/core/java/com/android/server/am/TaskRecord.java
@@ -154,7 +154,6 @@
     long lastActiveTime;    // Last time this task was active, including sleep.
     boolean inRecents;      // Actually in the recents list?
     boolean isAvailable;    // Is the activity available to be launched?
-    boolean isLaunching;    // Is an activity in this task launching?
     boolean rootWasReset;   // True if the intent at the root of the task had
                             // the FLAG_ACTIVITY_RESET_TASK_IF_NEEDED flag.
     boolean autoRemoveRecents;  // If true, we should automatically remove the task from
diff --git a/services/core/java/com/android/server/am/UnsupportedDisplaySizeDialog.java b/services/core/java/com/android/server/am/UnsupportedDisplaySizeDialog.java
new file mode 100644
index 0000000..501cd6b
--- /dev/null
+++ b/services/core/java/com/android/server/am/UnsupportedDisplaySizeDialog.java
@@ -0,0 +1,78 @@
+/*
+ * 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.
+ */
+
+package com.android.server.am;
+
+import com.android.internal.R;
+
+import android.app.AlertDialog;
+import android.content.Context;
+import android.content.pm.ApplicationInfo;
+import android.content.pm.PackageManager;
+import android.view.Window;
+import android.view.WindowManager;
+import android.widget.CheckBox;
+
+public class UnsupportedDisplaySizeDialog {
+    private final AlertDialog mDialog;
+    private final String mPackageName;
+
+    public UnsupportedDisplaySizeDialog(final ActivityManagerService service, Context context,
+            ApplicationInfo appInfo) {
+        mPackageName = appInfo.packageName;
+
+        final PackageManager pm = context.getPackageManager();
+        final CharSequence label = appInfo.loadSafeLabel(pm);
+        final CharSequence message = context.getString(
+                R.string.unsupported_display_size_message, label);
+
+        mDialog = new AlertDialog.Builder(context)
+                .setPositiveButton(R.string.ok, null)
+                .setMessage(message)
+                .setView(R.layout.unsupported_display_size_dialog_content)
+                .create();
+
+        // Ensure the content view is prepared.
+        mDialog.create();
+
+        final Window window = mDialog.getWindow();
+        window.setType(WindowManager.LayoutParams.TYPE_PHONE);
+
+        // DO NOT MODIFY. Used by CTS to verify the dialog is displayed.
+        window.getAttributes().setTitle("UnsupportedDisplaySizeDialog");
+
+        final CheckBox alwaysShow = (CheckBox) mDialog.findViewById(R.id.ask_checkbox);
+        alwaysShow.setChecked(true);
+        alwaysShow.setOnCheckedChangeListener((buttonView, isChecked) -> {
+            synchronized (service) {
+                service.mCompatModePackages.setPackageNotifyUnsupportedZoomLocked(
+                        mPackageName, isChecked);
+            }
+        });
+    }
+
+    public String getPackageName() {
+        return mPackageName;
+    }
+
+    public void show() {
+        mDialog.show();
+    }
+
+    public void dismiss() {
+        mDialog.dismiss();
+    }
+}
diff --git a/services/core/java/com/android/server/am/UserController.java b/services/core/java/com/android/server/am/UserController.java
index 4380af3..b685dd3 100644
--- a/services/core/java/com/android/server/am/UserController.java
+++ b/services/core/java/com/android/server/am/UserController.java
@@ -1335,6 +1335,15 @@
         return mStartedUserArray;
     }
 
+    boolean isUserStoppingOrShuttingDownLocked(int userId) {
+        UserState state = getStartedUserStateLocked(userId);
+        if (state == null) {
+            return false;
+        }
+        return state.state == UserState.STATE_STOPPING
+                || state.state == UserState.STATE_SHUTDOWN;
+    }
+
     boolean isUserRunningLocked(int userId, int flags) {
         UserState state = getStartedUserStateLocked(userId);
         if (state == null) {
diff --git a/services/core/java/com/android/server/content/ContentService.java b/services/core/java/com/android/server/content/ContentService.java
index 9220aa3..01b2393 100644
--- a/services/core/java/com/android/server/content/ContentService.java
+++ b/services/core/java/com/android/server/content/ContentService.java
@@ -394,18 +394,9 @@
             for (int i=0; i<numCalls; i++) {
                 ObserverCall oc = calls.get(i);
                 try {
-                    // If the uri does not belong to the same user as the observer: we must add
-                    // the userId to the uri. Otherewise the observer would think the uri belongs
-                    // to his user.
-                    final Uri tempUri;
-                    if (oc.mObserverUserId != userHandle) {
-                        tempUri = ContentProvider.maybeAddUserId(uri, userHandle);
-                    } else {
-                        tempUri = uri;
-                    }
-                    oc.mObserver.onChange(oc.mSelfChange, tempUri, userHandle);
+                    oc.mObserver.onChange(oc.mSelfChange, uri, userHandle);
                     if (DEBUG) Slog.d(TAG, "Notified " + oc.mObserver + " of " + "update at "
-                            + tempUri);
+                            + uri);
                 } catch (RemoteException ex) {
                     synchronized (mRootNode) {
                         Log.w(TAG, "Found dead observer, removing");
diff --git a/services/core/java/com/android/server/content/SyncManager.java b/services/core/java/com/android/server/content/SyncManager.java
index 493fc4a..39ddc3a 100644
--- a/services/core/java/com/android/server/content/SyncManager.java
+++ b/services/core/java/com/android/server/content/SyncManager.java
@@ -1355,7 +1355,11 @@
             operation.extras.remove(ContentResolver.SYNC_EXTRAS_IGNORE_BACKOFF);
         }
 
-        if (operation.extras.getBoolean(ContentResolver.SYNC_EXTRAS_DO_NOT_RETRY, false)) {
+        if (operation.extras.getBoolean(ContentResolver.SYNC_EXTRAS_DO_NOT_RETRY, false)
+                && !syncResult.syncAlreadyInProgress) {
+            // syncAlreadyInProgress flag is set by AbstractThreadedSyncAdapter. The sync adapter
+            // has no way of knowing that a sync error occured. So we DO retry if the error is
+            // syncAlreadyInProgress.
             if (isLoggable) {
                 Log.d(TAG, "not retrying sync operation because SYNC_EXTRAS_DO_NOT_RETRY was specified "
                         + operation);
@@ -2445,6 +2449,10 @@
             if (op.isPeriodic) {
                 scheduleSyncOperationH(op.createOneTimeSyncOperation(), delay);
             } else {
+                // mSyncJobService.callJobFinished is async, so cancel the job to ensure we don't
+                // find the this job in the pending jobs list while looking for duplicates
+                // before scheduling it at a later time.
+                getJobScheduler().cancel(op.jobId);
                 scheduleSyncOperationH(op, delay);
             }
         }
@@ -2886,6 +2894,14 @@
             String historyMessage;
             int downstreamActivity;
             int upstreamActivity;
+
+            if (!syncOperation.isPeriodic) {
+                // mSyncJobService.jobFinidhed is async, we need to ensure that this job is
+                // removed from JobScheduler's pending jobs list before moving forward and
+                // potentially rescheduling all pending jobs to respect new backoff values.
+                getJobScheduler().cancel(syncOperation.jobId);
+            }
+
             if (syncResult != null) {
                 if (isLoggable) {
                     Slog.v(TAG, "runSyncFinishedOrCanceled [finished]: "
diff --git a/services/core/java/com/android/server/job/JobSchedulerService.java b/services/core/java/com/android/server/job/JobSchedulerService.java
index 27b3aa2..8589de1 100644
--- a/services/core/java/com/android/server/job/JobSchedulerService.java
+++ b/services/core/java/com/android/server/job/JobSchedulerService.java
@@ -692,8 +692,13 @@
         boolean active = mPendingJobs.size() > 0;
         if (mPendingJobs.size() <= 0) {
             for (int i=0; i<mActiveServices.size(); i++) {
-                JobServiceContext jsc = mActiveServices.get(i);
-                if (jsc.getRunningJob() != null) {
+                final JobServiceContext jsc = mActiveServices.get(i);
+                final JobStatus job = jsc.getRunningJob();
+                if (job != null
+                        && (job.getJob().getFlags() & JobInfo.FLAG_WILL_BE_FOREGROUND) == 0
+                        && !job.dozeWhitelisted) {
+                    // We will report active if we have a job running and it is not an exception
+                    // due to being in the foreground or whitelisted.
                     active = true;
                     break;
                 }
diff --git a/services/core/java/com/android/server/job/controllers/AppIdleController.java b/services/core/java/com/android/server/job/controllers/AppIdleController.java
index a23af35..2dbecbd 100644
--- a/services/core/java/com/android/server/job/controllers/AppIdleController.java
+++ b/services/core/java/com/android/server/job/controllers/AppIdleController.java
@@ -142,8 +142,11 @@
                 UserHandle.formatUid(pw, jobStatus.getSourceUid());
                 pw.print(": ");
                 pw.print(jobStatus.getSourcePackageName());
-                pw.print(", runnable=");
-                pw.println((jobStatus.satisfiedConstraints&JobStatus.CONSTRAINT_APP_NOT_IDLE) != 0);
+                if ((jobStatus.satisfiedConstraints&JobStatus.CONSTRAINT_APP_NOT_IDLE) != 0) {
+                    pw.println(" RUNNABLE");
+                } else {
+                    pw.println(" WAITING");
+                }
             }
         });
     }
diff --git a/services/core/java/com/android/server/job/controllers/ContentObserverController.java b/services/core/java/com/android/server/job/controllers/ContentObserverController.java
index 26660e8..9dce070 100644
--- a/services/core/java/com/android/server/job/controllers/ContentObserverController.java
+++ b/services/core/java/com/android/server/job/controllers/ContentObserverController.java
@@ -57,7 +57,7 @@
     private static volatile ContentObserverController sController;
 
     final private List<JobStatus> mTrackedTasks = new ArrayList<JobStatus>();
-    ArrayMap<Uri, ObserverInstance> mObservers = new ArrayMap<>();
+    ArrayMap<JobInfo.TriggerContentUri, ObserverInstance> mObservers = new ArrayMap<>();
     final Handler mHandler;
 
     public static ContentObserverController get(JobSchedulerService taskManagerService) {
@@ -253,10 +253,10 @@
             final JobInfo.TriggerContentUri[] uris = jobStatus.getJob().getTriggerContentUris();
             if (uris != null) {
                 for (JobInfo.TriggerContentUri uri : uris) {
-                    ObserverInstance obs = mObservers.get(uri.getUri());
+                    ObserverInstance obs = mObservers.get(uri);
                     if (obs == null) {
                         obs = new ObserverInstance(mHandler, uri.getUri());
-                        mObservers.put(uri.getUri(), obs);
+                        mObservers.put(uri, obs);
                         mContext.getContentResolver().registerContentObserver(
                                 uri.getUri(),
                                 (uri.getFlags() &
@@ -316,7 +316,7 @@
                 obs.mJobs.remove(this);
                 if (obs.mJobs.size() == 0) {
                     mContext.getContentResolver().unregisterContentObserver(obs);
-                    mObservers.remove(obs.mUri);
+                    mObservers.remove(obs);
                 }
             }
         }
@@ -355,7 +355,10 @@
                     continue;
                 }
                 pw.print("    ");
-                pw.print(mObservers.keyAt(i));
+                JobInfo.TriggerContentUri trigger = mObservers.keyAt(i);
+                pw.print(trigger.getUri());
+                pw.print(" 0x");
+                pw.print(Integer.toHexString(trigger.getFlags()));
                 pw.print(" (");
                 pw.print(System.identityHashCode(obs));
                 pw.println("):");
diff --git a/services/core/java/com/android/server/job/controllers/DeviceIdleJobsController.java b/services/core/java/com/android/server/job/controllers/DeviceIdleJobsController.java
index bf1297f..f7706d7 100644
--- a/services/core/java/com/android/server/job/controllers/DeviceIdleJobsController.java
+++ b/services/core/java/com/android/server/job/controllers/DeviceIdleJobsController.java
@@ -157,8 +157,9 @@
     }
 
     private void updateTaskStateLocked(JobStatus task) {
-        boolean enableTask = !mDeviceIdleMode || isWhitelistedLocked(task);
-        task.setDeviceNotDozingConstraintSatisfied(enableTask);
+        final boolean whitelisted = isWhitelistedLocked(task);
+        final boolean enableTask = !mDeviceIdleMode || whitelisted;
+        task.setDeviceNotDozingConstraintSatisfied(enableTask, whitelisted);
     }
 
     @Override
@@ -186,9 +187,13 @@
                 UserHandle.formatUid(pw, jobStatus.getSourceUid());
                 pw.print(": ");
                 pw.print(jobStatus.getSourcePackageName());
-                pw.print(", runnable=");
-                pw.println((jobStatus.satisfiedConstraints
-                        & JobStatus.CONSTRAINT_DEVICE_NOT_DOZING) != 0);
+                pw.print((jobStatus.satisfiedConstraints
+                        & JobStatus.CONSTRAINT_DEVICE_NOT_DOZING) != 0
+                                ? " RUNNABLE" : " WAITING");
+                if (jobStatus.dozeWhitelisted) {
+                    pw.print(" WHITELISTED");
+                }
+                pw.println();
             }
         });
     }
diff --git a/services/core/java/com/android/server/job/controllers/JobStatus.java b/services/core/java/com/android/server/job/controllers/JobStatus.java
index ded7a2f..552c990 100644
--- a/services/core/java/com/android/server/job/controllers/JobStatus.java
+++ b/services/core/java/com/android/server/job/controllers/JobStatus.java
@@ -103,6 +103,9 @@
     final int requiredConstraints;
     int satisfiedConstraints = 0;
 
+    // Set to true if doze constraint was satisfied due to app being whitelisted.
+    public boolean dozeWhitelisted;
+
     // These are filled in by controllers when preparing for execution.
     public ArraySet<Uri> changedUris;
     public ArraySet<String> changedAuthorities;
@@ -403,7 +406,8 @@
         return setConstraintSatisfied(CONSTRAINT_CONTENT_TRIGGER, state);
     }
 
-    boolean setDeviceNotDozingConstraintSatisfied(boolean state) {
+    boolean setDeviceNotDozingConstraintSatisfied(boolean state, boolean whitelisted) {
+        dozeWhitelisted = whitelisted;
         return setConstraintSatisfied(CONSTRAINT_DEVICE_NOT_DOZING, state);
     }
 
@@ -651,6 +655,9 @@
             pw.print(prefix); pw.print("Unsatisfied constraints:");
             dumpConstraints(pw, (requiredConstraints & ~satisfiedConstraints));
             pw.println();
+            if (dozeWhitelisted) {
+                pw.print(prefix); pw.println("Doze whitelisted: true");
+            }
         }
         if (changedAuthorities != null) {
             pw.print(prefix); pw.println("Changed authorities:");
diff --git a/services/core/java/com/android/server/location/GnssLocationProvider.java b/services/core/java/com/android/server/location/GnssLocationProvider.java
index 6b916be..173f76f 100644
--- a/services/core/java/com/android/server/location/GnssLocationProvider.java
+++ b/services/core/java/com/android/server/location/GnssLocationProvider.java
@@ -899,6 +899,7 @@
 
         // hold wake lock while task runs
         mWakeLock.acquire();
+        Log.i(TAG, "WakeLock acquired by handleInjectNtpTime()");
         AsyncTask.THREAD_POOL_EXECUTOR.execute(new Runnable() {
             @Override
             public void run() {
@@ -951,6 +952,7 @@
 
                 // release wake lock held by task
                 mWakeLock.release();
+                Log.i(TAG, "WakeLock released by handleInjectNtpTime()");
             }
         });
     }
@@ -969,6 +971,7 @@
 
         // hold wake lock while task runs
         mWakeLock.acquire();
+        Log.i(TAG, "WakeLock acquired by handleDownloadXtraData()");
         AsyncTask.THREAD_POOL_EXECUTOR.execute(new Runnable() {
             @Override
             public void run() {
@@ -991,6 +994,7 @@
 
                 // release wake lock held by task
                 mWakeLock.release();
+                Log.i(TAG, "WakeLock released by handleDownloadXtraData()");
             }
         });
     }
@@ -1192,7 +1196,7 @@
         }
 
         if (DEBUG) Log.d(TAG, "setRequest " + mProviderRequest);
-        if (mProviderRequest.reportLocation && !mDisableGps) {
+        if (mProviderRequest.reportLocation && !mDisableGps && isEnabled()) {
             // update client uids
             updateClientUids(mWorkSource);
 
@@ -2040,6 +2044,7 @@
         // note that this assumes the message will not be removed from the queue before
         // it is handled (otherwise the wake lock would be leaked).
         mWakeLock.acquire();
+        Log.i(TAG, "WakeLock acquired by sendMessage(" + message + ", " + arg + ", " + obj + ")");
         mHandler.obtainMessage(message, arg, 1, obj).sendToTarget();
     }
 
@@ -2099,6 +2104,8 @@
             if (msg.arg2 == 1) {
                 // wakelock was taken for this message, release it
                 mWakeLock.release();
+                Log.i(TAG, "WakeLock released by handleMessage(" + message + ", " + msg.arg1 + ", "
+                        + msg.obj + ")");
             }
         }
 
diff --git a/services/core/java/com/android/server/net/NetworkPolicyManagerService.java b/services/core/java/com/android/server/net/NetworkPolicyManagerService.java
index 67cd7c3..228c015 100644
--- a/services/core/java/com/android/server/net/NetworkPolicyManagerService.java
+++ b/services/core/java/com/android/server/net/NetworkPolicyManagerService.java
@@ -1989,6 +1989,7 @@
     }
 
     private void setRestrictBackgroundLocked(boolean restrictBackground) {
+        Slog.d(TAG, "setRestrictBackgroundLocked(): " + restrictBackground);
         final boolean oldRestrictBackground = mRestrictBackground;
         mRestrictBackground = restrictBackground;
         // Must whitelist foreground apps before turning data saver mode on.
diff --git a/services/core/java/com/android/server/net/NetworkStatsObservers.java b/services/core/java/com/android/server/net/NetworkStatsObservers.java
index ea36170..3360584 100644
--- a/services/core/java/com/android/server/net/NetworkStatsObservers.java
+++ b/services/core/java/com/android/server/net/NetworkStatsObservers.java
@@ -355,9 +355,10 @@
         @Override
         protected void recordSample(StatsContext statsContext) {
             // Recorder does not need to be locked in this context since only the handler
-            // thread will update it
+            // thread will update it. We pass a null VPN array because usage is aggregated by uid
+            // for this snapshot, so VPN traffic can't be reattributed to responsible apps.
             mRecorder.recordSnapshotLocked(statsContext.mXtSnapshot, statsContext.mActiveIfaces,
-                    statsContext.mVpnArray, statsContext.mCurrentTime);
+                    null /* vpnArray */, statsContext.mCurrentTime);
         }
 
         /**
@@ -396,7 +397,8 @@
         @Override
         protected void recordSample(StatsContext statsContext) {
             // Recorder does not need to be locked in this context since only the handler
-            // thread will update it
+            // thread will update it. We pass the VPN info so VPN traffic is reattributed to
+            // responsible apps.
             mRecorder.recordSnapshotLocked(statsContext.mUidSnapshot, statsContext.mActiveUidIfaces,
                     statsContext.mVpnArray, statsContext.mCurrentTime);
         }
diff --git a/services/core/java/com/android/server/net/NetworkStatsRecorder.java b/services/core/java/com/android/server/net/NetworkStatsRecorder.java
index 04dc917..090a076 100644
--- a/services/core/java/com/android/server/net/NetworkStatsRecorder.java
+++ b/services/core/java/com/android/server/net/NetworkStatsRecorder.java
@@ -22,6 +22,7 @@
 import static android.text.format.DateUtils.YEAR_IN_MILLIS;
 import static com.android.internal.util.Preconditions.checkNotNull;
 
+import android.annotation.Nullable;
 import android.net.NetworkStats;
 import android.net.NetworkStats.NonMonotonicObserver;
 import android.net.NetworkStatsHistory;
@@ -199,9 +200,14 @@
      * Record any delta that occurred since last {@link NetworkStats} snapshot,
      * using the given {@link Map} to identify network interfaces. First
      * snapshot is considered bootstrap, and is not counted as delta.
+     *
+     * @param vpnArray Optional info about the currently active VPN, if any. This is used to
+     *                 redistribute traffic from the VPN app to the underlying responsible apps.
+     *                 This should always be set to null if the provided snapshot is aggregated
+     *                 across all UIDs (e.g. contains UID_ALL buckets), regardless of VPN state.
      */
     public void recordSnapshotLocked(NetworkStats snapshot,
-            Map<String, NetworkIdentitySet> ifaceIdent, VpnInfo[] vpnArray,
+            Map<String, NetworkIdentitySet> ifaceIdent, @Nullable VpnInfo[] vpnArray,
             long currentTimeMillis) {
         final HashSet<String> unknownIfaces = Sets.newHashSet();
 
diff --git a/services/core/java/com/android/server/net/NetworkStatsService.java b/services/core/java/com/android/server/net/NetworkStatsService.java
index 8610fa1..23c111e 100644
--- a/services/core/java/com/android/server/net/NetworkStatsService.java
+++ b/services/core/java/com/android/server/net/NetworkStatsService.java
@@ -1009,9 +1009,16 @@
         final NetworkStats xtSnapshot = mNetworkManager.getNetworkStatsSummaryXt();
         final NetworkStats devSnapshot = mNetworkManager.getNetworkStatsSummaryDev();
 
+
+        // For xt/dev, we pass a null VPN array because usage is aggregated by UID, so VPN traffic
+        // can't be reattributed to responsible apps.
+        mDevRecorder.recordSnapshotLocked(
+                devSnapshot, mActiveIfaces, null /* vpnArray */, currentTime);
+        mXtRecorder.recordSnapshotLocked(
+                xtSnapshot, mActiveIfaces, null /* vpnArray */, currentTime);
+
+        // For per-UID stats, pass the VPN info so VPN traffic is reattributed to responsible apps.
         VpnInfo[] vpnArray = mConnManager.getAllVpnInfo();
-        mDevRecorder.recordSnapshotLocked(devSnapshot, mActiveIfaces, null, currentTime);
-        mXtRecorder.recordSnapshotLocked(xtSnapshot, mActiveIfaces, null, currentTime);
         mUidRecorder.recordSnapshotLocked(uidSnapshot, mActiveUidIfaces, vpnArray, currentTime);
         mUidTagRecorder.recordSnapshotLocked(uidSnapshot, mActiveUidIfaces, vpnArray, currentTime);
 
diff --git a/services/core/java/com/android/server/notification/NotificationManagerService.java b/services/core/java/com/android/server/notification/NotificationManagerService.java
index 0af0c73..73850de 100644
--- a/services/core/java/com/android/server/notification/NotificationManagerService.java
+++ b/services/core/java/com/android/server/notification/NotificationManagerService.java
@@ -67,7 +67,6 @@
 import android.content.ComponentName;
 import android.content.ContentResolver;
 import android.content.Context;
-import android.content.IIntentSender;
 import android.content.Intent;
 import android.content.IntentFilter;
 import android.content.pm.ApplicationInfo;
@@ -2521,6 +2520,8 @@
             return;
         }
 
+        mUsageStats.registerEnqueuedByApp(pkg);
+
         // Limit the number of notifications that any given package except the android
         // package or a registered listener can enqueue.  Prevents DOS attacks and deals with leaks.
         if (!isSystemNotification && !isNotificationFromListener) {
@@ -2614,17 +2615,18 @@
     private static void setPendingIntentWhitelistDuration(ActivityManagerInternal am, long duration,
             Bundle extras) {
         for (String key : extras.keySet()) {
-            setPendingIntentWhitelistDuration(am, duration, extras.getParcelable(key));
-            final Parcelable[] parcelableArray = extras.getParcelableArray(key);
-            if (parcelableArray != null) {
-                for (Parcelable parcelable: parcelableArray) {
+            final Object value = extras.get(key);
+            if (value instanceof Parcelable) {
+                setPendingIntentWhitelistDuration(am, duration, (Parcelable) value);
+            } else if (value instanceof Parcelable[]) {
+                for (Parcelable parcelable : (Parcelable[]) value) {
                     setPendingIntentWhitelistDuration(am, duration, parcelable);
                 }
-            }
-            final ArrayList<Parcelable> parcelableList = extras.getParcelableArrayList(key);
-            if (parcelableList != null) {
-                for (Parcelable parcelable: parcelableList) {
-                    setPendingIntentWhitelistDuration(am, duration, parcelable);
+            } else if (value instanceof List) {
+                for (Object element : (List <?>) value) {
+                    if (element instanceof Parcelable) {
+                        setPendingIntentWhitelistDuration(am, duration, (Parcelable) element);
+                    }
                 }
             }
         }
@@ -2802,7 +2804,7 @@
         // notification was a summary and its group key changed.
         if (oldIsSummary && (!isSummary || !oldGroup.equals(group))) {
             cancelGroupChildrenLocked(old, callingUid, callingPid, null,
-                    REASON_GROUP_SUMMARY_CANCELED);
+                    REASON_GROUP_SUMMARY_CANCELED, false /* sendDelete */);
         }
     }
 
@@ -3435,7 +3437,7 @@
 
                         cancelNotificationLocked(r, sendDelete, reason);
                         cancelGroupChildrenLocked(r, callingUid, callingPid, listenerName,
-                                REASON_GROUP_SUMMARY_CANCELED);
+                                REASON_GROUP_SUMMARY_CANCELED, sendDelete);
                         updateLightsLocked();
                     }
                 }
@@ -3514,7 +3516,7 @@
                 final int M = canceledNotifications.size();
                 for (int i = 0; i < M; i++) {
                     cancelGroupChildrenLocked(canceledNotifications.get(i), callingUid, callingPid,
-                            listenerName, REASON_GROUP_SUMMARY_CANCELED);
+                            listenerName, REASON_GROUP_SUMMARY_CANCELED, false /* sendDelete */);
                 }
             }
             if (canceledNotifications != null) {
@@ -3558,14 +3560,14 @@
         int M = canceledNotifications != null ? canceledNotifications.size() : 0;
         for (int i = 0; i < M; i++) {
             cancelGroupChildrenLocked(canceledNotifications.get(i), callingUid, callingPid,
-                    listenerName, REASON_GROUP_SUMMARY_CANCELED);
+                    listenerName, REASON_GROUP_SUMMARY_CANCELED, false /* sendDelete */);
         }
         updateLightsLocked();
     }
 
     // Warning: The caller is responsible for invoking updateLightsLocked().
     private void cancelGroupChildrenLocked(NotificationRecord r, int callingUid, int callingPid,
-            String listenerName, int reason) {
+            String listenerName, int reason, boolean sendDelete) {
         Notification n = r.getNotification();
         if (!n.isGroupSummary()) {
             return;
@@ -3588,7 +3590,7 @@
                 EventLogTags.writeNotificationCancel(callingUid, callingPid, pkg, childSbn.getId(),
                         childSbn.getTag(), userId, 0, 0, reason, listenerName);
                 mNotificationList.remove(i);
-                cancelNotificationLocked(childR, false, reason);
+                cancelNotificationLocked(childR, sendDelete, reason);
             }
         }
     }
@@ -3896,7 +3898,9 @@
         @Override
         public void onUserSwitched(int user) {
             synchronized (mNotificationList) {
-                for (ManagedServiceInfo info : mServices) {
+                int i = mServices.size()-1;
+                while (i --> 0) {
+                    final ManagedServiceInfo info = mServices.get(i);
                     unregisterService(info.service, info.userid);
                 }
             }
diff --git a/services/core/java/com/android/server/notification/NotificationUsageStats.java b/services/core/java/com/android/server/notification/NotificationUsageStats.java
index 7b573da..34c5283 100644
--- a/services/core/java/com/android/server/notification/NotificationUsageStats.java
+++ b/services/core/java/com/android/server/notification/NotificationUsageStats.java
@@ -114,6 +114,17 @@
     }
 
     /**
+     * Called when a notification is tentatively enqueued by an app, before rate checking.
+     */
+    public synchronized void registerEnqueuedByApp(String packageName) {
+        AggregatedStats[] aggregatedStatsArray = getAggregatedStatsLocked(packageName);
+        for (AggregatedStats stats : aggregatedStatsArray) {
+            stats.numEnqueuedByApp++;
+        }
+        releaseAggregatedStatsLocked(aggregatedStatsArray);
+    }
+
+    /**
      * Called when a notification has been posted.
      */
     public synchronized void registerPostedByApp(NotificationRecord notification) {
@@ -135,7 +146,8 @@
     /**
      * Called when a notification has been updated.
      */
-    public void registerUpdatedByApp(NotificationRecord notification, NotificationRecord old) {
+    public synchronized void registerUpdatedByApp(NotificationRecord notification,
+            NotificationRecord old) {
         notification.stats.updateFrom(old.stats);
         AggregatedStats[] aggregatedStatsArray = getAggregatedStatsLocked(notification);
         for (AggregatedStats stats : aggregatedStatsArray) {
@@ -344,6 +356,7 @@
         private AggregatedStats mPrevious;
 
         // ---- Updated as the respective events occur.
+        public int numEnqueuedByApp;
         public int numPostedByApp;
         public int numUpdatedByApp;
         public int numRemovedByApp;
@@ -470,6 +483,7 @@
 
         public void emit() {
             AggregatedStats previous = getPrevious();
+            maybeCount("note_enqueued", (numEnqueuedByApp - previous.numEnqueuedByApp));
             maybeCount("note_post", (numPostedByApp - previous.numPostedByApp));
             maybeCount("note_update", (numUpdatedByApp - previous.numUpdatedByApp));
             maybeCount("note_remove", (numRemovedByApp - previous.numRemovedByApp));
@@ -501,6 +515,7 @@
             quietImportance.maybeCount(previous.quietImportance);
             finalImportance.maybeCount(previous.finalImportance);
 
+            previous.numEnqueuedByApp = numEnqueuedByApp;
             previous.numPostedByApp = numPostedByApp;
             previous.numUpdatedByApp = numUpdatedByApp;
             previous.numRemovedByApp = numRemovedByApp;
@@ -568,6 +583,8 @@
             output.append(indentPlusTwo);
             output.append("key='").append(key).append("',\n");
             output.append(indentPlusTwo);
+            output.append("numEnqueuedByApp=").append(numEnqueuedByApp).append(",\n");
+            output.append(indentPlusTwo);
             output.append("numPostedByApp=").append(numPostedByApp).append(",\n");
             output.append(indentPlusTwo);
             output.append("numUpdatedByApp=").append(numUpdatedByApp).append(",\n");
@@ -631,6 +648,7 @@
             JSONObject dump = new JSONObject();
             dump.put("key", key);
             dump.put("duration", SystemClock.elapsedRealtime() - mCreated);
+            maybePut(dump, "numEnqueuedByApp", numEnqueuedByApp);
             maybePut(dump, "numPostedByApp", numPostedByApp);
             maybePut(dump, "numUpdatedByApp", numUpdatedByApp);
             maybePut(dump, "numRemovedByApp", numRemovedByApp);
diff --git a/services/core/java/com/android/server/notification/RateEstimator.java b/services/core/java/com/android/server/notification/RateEstimator.java
index c17db4a..a2f93dc 100644
--- a/services/core/java/com/android/server/notification/RateEstimator.java
+++ b/services/core/java/com/android/server/notification/RateEstimator.java
@@ -26,9 +26,12 @@
     private static final double RATE_ALPHA = 0.8;
     private static final double MINIMUM_DT = 0.0005;
     private Long mLastEventTime;
-    private Float mInterarrivalTime;
+    private double mInterarrivalTime;
 
-    public RateEstimator() {}
+    public RateEstimator() {
+        // assume something generous if we have no information
+        mInterarrivalTime = 1000.0;
+    }
 
     /** Update the estimate to account for an event that just happened. */
     public float update(long now) {
@@ -38,7 +41,7 @@
             rate = 0f;
         } else {
             // Calculate the new inter-arrival time based on last event time.
-            mInterarrivalTime = (float) getInterarrivalEstimate(now);
+            mInterarrivalTime = getInterarrivalEstimate(now);
             rate = (float) (1.0 / mInterarrivalTime);
         }
         mLastEventTime = now;
@@ -57,10 +60,6 @@
     private double getInterarrivalEstimate(long now) {
         double dt = ((double) (now - mLastEventTime)) / 1000.0;
         dt = Math.max(dt, MINIMUM_DT);
-        if (mInterarrivalTime == null) {
-            // No last inter-arrival time, return the new value directly.
-            return dt;
-        }
         // a*iat_old + (1-a)*(t_now-t_last)
         return (RATE_ALPHA * mInterarrivalTime + (1.0 - RATE_ALPHA) * dt);
     }
diff --git a/services/core/java/com/android/server/pm/PackageManagerService.java b/services/core/java/com/android/server/pm/PackageManagerService.java
index a560c83..96513b9 100644
--- a/services/core/java/com/android/server/pm/PackageManagerService.java
+++ b/services/core/java/com/android/server/pm/PackageManagerService.java
@@ -1214,7 +1214,9 @@
                     StringBuffer sb = new StringBuffer();
 
                     String firstLine = readLine(in, sb);
-                    if (firstLine.equals(USAGE_FILE_MAGIC_VERSION_1)) {
+                    if (firstLine == null) {
+                        // Empty file. Do nothing.
+                    } else if (USAGE_FILE_MAGIC_VERSION_1.equals(firstLine)) {
                         readVersion1LP(in, sb);
                     } else {
                         readVersion0LP(in, sb, firstLine);
@@ -4753,10 +4755,8 @@
                 final SharedUserSetting sus = (SharedUserSetting) obj;
                 final int N = sus.packages.size();
                 final String[] res = new String[N];
-                final Iterator<PackageSetting> it = sus.packages.iterator();
-                int i = 0;
-                while (it.hasNext()) {
-                    res[i++] = it.next().name;
+                for (int i = 0; i < N; i++) {
+                    res[i] = sus.packages.valueAt(i).name;
                 }
                 return res;
             } else if (obj instanceof PackageSetting) {
@@ -12526,13 +12526,12 @@
             }
 
             if (mSuccess) {
-                final boolean mounted;
-                if (Environment.isExternalStorageEmulated()) {
-                    mounted = true;
-                } else {
+                boolean mounted = false;
+                try {
                     final String status = Environment.getExternalStorageState();
                     mounted = (Environment.MEDIA_MOUNTED.equals(status)
                             || Environment.MEDIA_MOUNTED_READ_ONLY.equals(status));
+                } catch (Exception e) {
                 }
 
                 if (mounted) {
@@ -14478,7 +14477,9 @@
         // Remove existing system package
         removePackageLI(deletedPackage, true);
 
-        disabledSystem = disableSystemPackageLPw(deletedPackage, pkg);
+        synchronized (mPackages) {
+            disabledSystem = disableSystemPackageLPw(deletedPackage, pkg);
+        }
         if (!disabledSystem) {
             // We didn't need to disable the .apk as a current system package,
             // which means we are replacing another update that is already
@@ -15132,16 +15133,13 @@
             }
             Trace.traceBegin(TRACE_TAG_PACKAGE_MANAGER, "dexopt");
             // Do not run PackageDexOptimizer through the local performDexOpt
-            // method because `pkg` is not in `mPackages` yet.
-            int result = mPackageDexOptimizer.performDexOpt(pkg, pkg.usesLibraryFiles,
+            // method because `pkg` may not be in `mPackages` yet.
+            //
+            // Also, don't fail application installs if the dexopt step fails.
+            mPackageDexOptimizer.performDexOpt(pkg, pkg.usesLibraryFiles,
                     null /* instructionSets */, false /* checkProfiles */,
                     getCompilerFilterForReason(REASON_INSTALL));
             Trace.traceEnd(TRACE_TAG_PACKAGE_MANAGER);
-            if (result == PackageDexOptimizer.DEX_OPT_FAILED) {
-                String msg = "Extracting package failed for " + pkgName;
-                res.setError(INSTALL_FAILED_DEXOPT, msg);
-                return;
-            }
 
             // Notify BackgroundDexOptService that the package has been changed.
             // If this is an update of a package which used to fail to compile,
diff --git a/services/core/java/com/android/server/pm/UserManagerService.java b/services/core/java/com/android/server/pm/UserManagerService.java
index a85064b..d8a1c77 100644
--- a/services/core/java/com/android/server/pm/UserManagerService.java
+++ b/services/core/java/com/android/server/pm/UserManagerService.java
@@ -732,9 +732,9 @@
             long identity = Binder.clearCallingIdentity();
             try {
                 if (enableQuietMode) {
+                    ActivityManagerNative.getDefault().stopUser(userHandle, /* force */true, null);
                     LocalServices.getService(ActivityManagerInternal.class)
                             .killForegroundAppsForUser(userHandle);
-                    ActivityManagerNative.getDefault().stopUser(userHandle, /* force */true, null);
                 } else {
                     ActivityManagerNative.getDefault().startUserInBackground(userHandle);
                 }
@@ -1303,14 +1303,16 @@
         }
 
         if (mAppOpsService != null) { // We skip it until system-ready.
-            final long token = Binder.clearCallingIdentity();
-            try {
-                mAppOpsService.setUserRestrictions(effective, mUserRestriconToken, userId);
-            } catch (RemoteException e) {
-                Log.w(LOG_TAG, "Unable to notify AppOpsService of UserRestrictions");
-            } finally {
-                Binder.restoreCallingIdentity(token);
-            }
+            mHandler.post(new Runnable() {
+                @Override
+                public void run() {
+                    try {
+                        mAppOpsService.setUserRestrictions(effective, mUserRestriconToken, userId);
+                    } catch (RemoteException e) {
+                        Log.w(LOG_TAG, "Unable to notify AppOpsService of UserRestrictions");
+                    }
+                }
+            });
         }
 
         propagateUserRestrictionsLR(userId, effective, prevAppliedRestrictions);
@@ -2296,7 +2298,7 @@
      */
     @Override
     public UserInfo createRestrictedProfile(String name, int parentUserId) {
-        checkManageUsersPermission("setupRestrictedProfile");
+        checkManageOrCreateUsersPermission("setupRestrictedProfile");
         final UserInfo user = createProfileForUser(name, UserInfo.FLAG_RESTRICTED, parentUserId);
         if (user == null) {
             return null;
diff --git a/services/core/java/com/android/server/webkit/SystemImpl.java b/services/core/java/com/android/server/webkit/SystemImpl.java
index 361f0d4..bb76449 100644
--- a/services/core/java/com/android/server/webkit/SystemImpl.java
+++ b/services/core/java/com/android/server/webkit/SystemImpl.java
@@ -270,5 +270,6 @@
 
     // flags declaring we want extra info from the package manager for webview providers
     private final static int PACKAGE_FLAGS = PackageManager.GET_META_DATA
-            | PackageManager.GET_SIGNATURES | PackageManager.MATCH_DEBUG_TRIAGED_MISSING;
+            | PackageManager.GET_SIGNATURES | PackageManager.MATCH_DEBUG_TRIAGED_MISSING
+            | PackageManager.MATCH_UNINSTALLED_PACKAGES;
 }
diff --git a/services/core/java/com/android/server/webkit/WebViewUpdateService.java b/services/core/java/com/android/server/webkit/WebViewUpdateService.java
index 9b971e0..846169c 100644
--- a/services/core/java/com/android/server/webkit/WebViewUpdateService.java
+++ b/services/core/java/com/android/server/webkit/WebViewUpdateService.java
@@ -63,6 +63,7 @@
         mWebViewUpdatedReceiver = new BroadcastReceiver() {
                 @Override
                 public void onReceive(Context context, Intent intent) {
+                    int userId = intent.getIntExtra(Intent.EXTRA_USER_HANDLE, UserHandle.USER_NULL);
                     switch (intent.getAction()) {
                         case Intent.ACTION_PACKAGE_REMOVED:
                             // When a package is replaced we will receive two intents, one
@@ -73,24 +74,22 @@
                             // run the update-logic twice.
                             if (intent.getExtras().getBoolean(Intent.EXTRA_REPLACING)) return;
                             mImpl.packageStateChanged(packageNameFromIntent(intent),
-                                    PACKAGE_REMOVED);
+                                    PACKAGE_REMOVED, userId);
                             break;
                         case Intent.ACTION_PACKAGE_CHANGED:
                             // Ensure that we only heed PACKAGE_CHANGED intents if they change an
                             // entire package, not just a component
                             if (entirePackageChanged(intent)) {
                                 mImpl.packageStateChanged(packageNameFromIntent(intent),
-                                        PACKAGE_CHANGED);
+                                        PACKAGE_CHANGED, userId);
                             }
                             break;
                         case Intent.ACTION_PACKAGE_ADDED:
                             mImpl.packageStateChanged(packageNameFromIntent(intent),
                                     (intent.getExtras().getBoolean(Intent.EXTRA_REPLACING)
-                                     ? PACKAGE_ADDED_REPLACED : PACKAGE_ADDED));
+                                     ? PACKAGE_ADDED_REPLACED : PACKAGE_ADDED), userId);
                             break;
                         case Intent.ACTION_USER_ADDED:
-                            int userId =
-                                intent.getIntExtra(Intent.EXTRA_USER_HANDLE, UserHandle.USER_NULL);
                             mImpl.handleNewUser(userId);
                             break;
                     }
@@ -105,11 +104,14 @@
         for (WebViewProviderInfo provider : mImpl.getWebViewPackages()) {
             filter.addDataSchemeSpecificPart(provider.packageName, PatternMatcher.PATTERN_LITERAL);
         }
-        getContext().registerReceiver(mWebViewUpdatedReceiver, filter);
+
+        getContext().registerReceiverAsUser(mWebViewUpdatedReceiver, UserHandle.ALL, filter,
+                null /* broadcast permission */, null /* handler */);
 
         IntentFilter userAddedFilter = new IntentFilter();
         userAddedFilter.addAction(Intent.ACTION_USER_ADDED);
-        getContext().registerReceiver(mWebViewUpdatedReceiver, userAddedFilter);
+        getContext().registerReceiverAsUser(mWebViewUpdatedReceiver, UserHandle.ALL,
+                userAddedFilter, null /* broadcast permission */, null /* handler */);
 
         publishBinderService("webviewupdate", new BinderService(), true /*allowIsolated*/);
     }
diff --git a/services/core/java/com/android/server/webkit/WebViewUpdateServiceImpl.java b/services/core/java/com/android/server/webkit/WebViewUpdateServiceImpl.java
index ecab009..2cf1722 100644
--- a/services/core/java/com/android/server/webkit/WebViewUpdateServiceImpl.java
+++ b/services/core/java/com/android/server/webkit/WebViewUpdateServiceImpl.java
@@ -20,6 +20,7 @@
 import android.content.pm.PackageInfo;
 import android.content.pm.PackageManager.NameNotFoundException;
 import android.content.pm.Signature;
+import android.os.UserHandle;
 import android.util.Base64;
 import android.util.Slog;
 import android.webkit.WebViewFactory;
@@ -49,7 +50,10 @@
         mWebViewUpdater = new WebViewUpdater(mContext, mSystemInterface);
     }
 
-    void packageStateChanged(String packageName, int changedState) {
+    void packageStateChanged(String packageName, int changedState, int userId) {
+        // We don't early out here in different cases where we could potentially early-out (e.g. if
+        // we receive PACKAGE_CHANGED for another user than the system user) since that would
+        // complicate this logic further and open up for more edge cases.
         updateFallbackStateOnPackageChange(packageName, changedState);
         mWebViewUpdater.packageStateChanged(packageName, changedState);
     }
@@ -64,7 +68,7 @@
             if (provider.availableByDefault && !provider.isFallback) {
                 try {
                     PackageInfo packageInfo = mSystemInterface.getPackageInfoForProvider(provider);
-                    if (isEnabledPackage(packageInfo)
+                    if (isInstalledPackage(packageInfo) && isEnabledPackage(packageInfo)
                             && mWebViewUpdater.isValidProvider(provider, packageInfo)) {
                         return true;
                     }
@@ -103,7 +107,7 @@
     }
 
     WebViewProviderInfo[] getValidWebViewPackages() {
-        return mWebViewUpdater.getValidWebViewPackages();
+        return mWebViewUpdater.getValidAndInstalledWebViewPackages();
     }
 
     WebViewProviderInfo[] getWebViewPackages() {
@@ -254,6 +258,12 @@
                                     // (not if it has been enabled/disabled).
                                     return;
                                 }
+                                if (newPackage.packageName.equals(oldProviderName)
+                                        && (newPackage.lastUpdateTime
+                                            == mCurrentWebViewPackage.lastUpdateTime)) {
+                                    // If the chosen package hasn't been updated, then early-out
+                                    return;
+                                }
                             }
                             // Only trigger update actions if the updated package is the one
                             // that will be used, or the one that was in use before the
@@ -373,14 +383,15 @@
             }
         }
 
-        private ProviderAndPackageInfo[] getValidWebViewPackagesAndInfos() {
+        private ProviderAndPackageInfo[] getValidWebViewPackagesAndInfos(boolean onlyInstalled) {
             WebViewProviderInfo[] allProviders = mSystemInterface.getWebViewPackages();
             List<ProviderAndPackageInfo> providers = new ArrayList<>();
             for(int n = 0; n < allProviders.length; n++) {
                 try {
                     PackageInfo packageInfo =
                         mSystemInterface.getPackageInfoForProvider(allProviders[n]);
-                    if (isValidProvider(allProviders[n], packageInfo)) {
+                    if ((!onlyInstalled || isInstalledPackage(packageInfo))
+                            && isValidProvider(allProviders[n], packageInfo)) {
                         providers.add(new ProviderAndPackageInfo(allProviders[n], packageInfo));
                     }
                 } catch (NameNotFoundException e) {
@@ -393,8 +404,9 @@
         /**
          * Fetch only the currently valid WebView packages.
          **/
-        public WebViewProviderInfo[] getValidWebViewPackages() {
-            ProviderAndPackageInfo[] providersAndPackageInfos = getValidWebViewPackagesAndInfos();
+        public WebViewProviderInfo[] getValidAndInstalledWebViewPackages() {
+            ProviderAndPackageInfo[] providersAndPackageInfos =
+                getValidWebViewPackagesAndInfos(true /* only fetch installed packages */);
             WebViewProviderInfo[] providers =
                 new WebViewProviderInfo[providersAndPackageInfos.length];
             for(int n = 0; n < providersAndPackageInfos.length; n++) {
@@ -421,29 +433,33 @@
          *
          */
         private PackageInfo findPreferredWebViewPackage() {
-            ProviderAndPackageInfo[] providers = getValidWebViewPackagesAndInfos();
+            ProviderAndPackageInfo[] providers =
+                getValidWebViewPackagesAndInfos(false /* onlyInstalled */);
 
             String userChosenProvider = mSystemInterface.getUserChosenWebViewProvider(mContext);
 
             // If the user has chosen provider, use that
             for (ProviderAndPackageInfo providerAndPackage : providers) {
                 if (providerAndPackage.provider.packageName.equals(userChosenProvider)
+                        && isInstalledPackage(providerAndPackage.packageInfo)
                         && isEnabledPackage(providerAndPackage.packageInfo)) {
                     return providerAndPackage.packageInfo;
                 }
             }
 
             // User did not choose, or the choice failed; use the most stable provider that is
-            // enabled and available by default (not through user choice).
+            // installed and enabled for the device owner, and available by default (not through
+            // user choice).
             for (ProviderAndPackageInfo providerAndPackage : providers) {
                 if (providerAndPackage.provider.availableByDefault
+                        && isInstalledPackage(providerAndPackage.packageInfo)
                         && isEnabledPackage(providerAndPackage.packageInfo)) {
                     return providerAndPackage.packageInfo;
                 }
             }
 
-            // Could not find any enabled package either, use the most stable and default-available
-            // provider.
+            // Could not find any installed and enabled package either, use the most stable and
+            // default-available provider.
             for (ProviderAndPackageInfo providerAndPackage : providers) {
                 if (providerAndPackage.provider.availableByDefault) {
                     return providerAndPackage.packageInfo;
@@ -642,4 +658,13 @@
         return packageInfo.applicationInfo.enabled;
     }
 
+    /**
+     * Return true if the package is installed and not hidden
+     */
+    private static boolean isInstalledPackage(PackageInfo packageInfo) {
+        return (((packageInfo.applicationInfo.flags & ApplicationInfo.FLAG_INSTALLED) != 0)
+            && ((packageInfo.applicationInfo.privateFlags
+                        & ApplicationInfo.PRIVATE_FLAG_HIDDEN) == 0));
+    }
+
 }
diff --git a/services/core/java/com/android/server/wm/AppWindowToken.java b/services/core/java/com/android/server/wm/AppWindowToken.java
index f57e83aa..b907da6 100644
--- a/services/core/java/com/android/server/wm/AppWindowToken.java
+++ b/services/core/java/com/android/server/wm/AppWindowToken.java
@@ -72,6 +72,7 @@
     int requestedOrientation = ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED;
     boolean layoutConfigChanges;
     boolean showForAllUsers;
+    int targetSdk;
 
     // The input dispatching timeout for this application token in nanoseconds.
     long inputDispatchingTimeoutNanos;
diff --git a/services/core/java/com/android/server/wm/DragState.java b/services/core/java/com/android/server/wm/DragState.java
index c4eca08..9d0fb61 100644
--- a/services/core/java/com/android/server/wm/DragState.java
+++ b/services/core/java/com/android/server/wm/DragState.java
@@ -28,6 +28,7 @@
 import android.graphics.Matrix;
 import android.graphics.Point;
 import android.hardware.input.InputManager;
+import android.os.Build;
 import android.os.IBinder;
 import android.os.Message;
 import android.os.Process;
@@ -289,7 +290,7 @@
         if (!targetWin.isPotentialDragTarget()) {
             return false;
         }
-        if ((mFlags & View.DRAG_FLAG_GLOBAL) == 0) {
+        if ((mFlags & View.DRAG_FLAG_GLOBAL) == 0 || !targetWindowSupportsGlobalDrag(targetWin)) {
             // Drag is limited to the current window.
             if (mLocalWin != targetWin.mClient.asBinder()) {
                 return false;
@@ -300,6 +301,13 @@
                 mSourceUserId == UserHandle.getUserId(targetWin.getOwningUid());
     }
 
+    private boolean targetWindowSupportsGlobalDrag(WindowState targetWin) {
+        // Global drags are limited to system windows, and windows for apps that are targeting N and
+        // above.
+        return targetWin.mAppToken == null
+                || targetWin.mAppToken.targetSdk >= Build.VERSION_CODES.N;
+    }
+
     /* helper - send a ACTION_DRAG_STARTED event only if the window has not
      * previously been notified, i.e. it became visible after the drag operation
      * was begun.  This is a rare case.
diff --git a/services/core/java/com/android/server/wm/WindowManagerService.java b/services/core/java/com/android/server/wm/WindowManagerService.java
index 8474fcf..3687512 100644
--- a/services/core/java/com/android/server/wm/WindowManagerService.java
+++ b/services/core/java/com/android/server/wm/WindowManagerService.java
@@ -3420,7 +3420,7 @@
             int requestedOrientation, boolean fullscreen, boolean showForAllUsers, int userId,
             int configChanges, boolean voiceInteraction, boolean launchTaskBehind,
             Rect taskBounds, Configuration config, int taskResizeMode, boolean alwaysFocusable,
-            boolean homeTask) {
+            boolean homeTask, int targetSdkVersion) {
         if (!checkCallingPermission(android.Manifest.permission.MANAGE_APP_TOKENS,
                 "addAppToken()")) {
             throw new SecurityException("Requires MANAGE_APP_TOKENS permission");
@@ -3450,6 +3450,7 @@
             atoken.inputDispatchingTimeoutNanos = inputDispatchingTimeoutNanos;
             atoken.appFullscreen = fullscreen;
             atoken.showForAllUsers = showForAllUsers;
+            atoken.targetSdk = targetSdkVersion;
             atoken.requestedOrientation = requestedOrientation;
             atoken.layoutConfigChanges = (configChanges &
                     (ActivityInfo.CONFIG_SCREEN_SIZE | ActivityInfo.CONFIG_ORIENTATION)) != 0;
diff --git a/services/core/java/com/android/server/wm/WindowSurfacePlacer.java b/services/core/java/com/android/server/wm/WindowSurfacePlacer.java
index 4148cd0..359063c 100644
--- a/services/core/java/com/android/server/wm/WindowSurfacePlacer.java
+++ b/services/core/java/com/android/server/wm/WindowSurfacePlacer.java
@@ -731,9 +731,7 @@
                     }
 
                     try {
-                        if (task == null || task.mStack.getBoundsAnimating()) {
-                            w.mClient.moved(left, top);
-                        }
+                        w.mClient.moved(left, top);
                     } catch (RemoteException e) {
                     }
                     w.mMovedByResize = false;
diff --git a/services/tests/servicestests/src/com/android/server/notification/RateEstimatorTest.java b/services/tests/servicestests/src/com/android/server/notification/RateEstimatorTest.java
index b5698d5..3278cf1 100644
--- a/services/tests/servicestests/src/com/android/server/notification/RateEstimatorTest.java
+++ b/services/tests/servicestests/src/com/android/server/notification/RateEstimatorTest.java
@@ -59,6 +59,15 @@
     }
 
     @SmallTest
+    public void testInstantaneousBurstIsEstimatedUnderTwoPercent() throws Exception {
+        assertUpdateTime(mTestStartTime);
+        long eventStart = mTestStartTime + 1000; // start event a long time after initialization
+        long nextEventTime = postEvents(eventStart, 0, 5); // five events at \inf
+        final float rate = mEstimator.getRate(nextEventTime);
+        assertLessThan("Rate", rate, 20f);
+    }
+
+    @SmallTest
     public void testCompactBurstIsEstimatedUnderTwoPercent() throws Exception {
         assertUpdateTime(mTestStartTime);
         long eventStart = mTestStartTime + 1000; // start event a long time after initialization
@@ -110,12 +119,19 @@
         assertLessThan("Rate", rate, 0.1f);
     }
 
+    @SmallTest
+    public void testGetRateWithOneUpdate() throws Exception {
+        assertUpdateTime(mTestStartTime);
+        final float rate = mEstimator.getRate(mTestStartTime+1);
+        assertLessThan("Rate", rate, 1f);
+    }
+
     private void assertLessThan(String label, float a, float b)  {
-        assertTrue(String.format("%s was %f, but should be less than %f", label, a, b), a < b);
+        assertTrue(String.format("%s was %f, but should be less than %f", label, a, b), a <= b);
     }
 
     private void assertGreaterThan(String label, float a, float b)  {
-        assertTrue(String.format("%s was %f, but should be more than %f", label, a, b), a > b);
+        assertTrue(String.format("%s was %f, but should be more than %f", label, a, b), a >= b);
     }
 
     /** @returns the next event time. */
diff --git a/services/tests/servicestests/src/com/android/server/webkit/WebViewUpdateServiceTest.java b/services/tests/servicestests/src/com/android/server/webkit/WebViewUpdateServiceTest.java
index c03324a..b737033 100644
--- a/services/tests/servicestests/src/com/android/server/webkit/WebViewUpdateServiceTest.java
+++ b/services/tests/servicestests/src/com/android/server/webkit/WebViewUpdateServiceTest.java
@@ -86,7 +86,7 @@
     private void setEnabledAndValidPackageInfos(WebViewProviderInfo[] providers) {
         for(WebViewProviderInfo wpi : providers) {
             mTestSystemImpl.setPackageInfo(createPackageInfo(wpi.packageName, true /* enabled */,
-                        true /* valid */));
+                        true /* valid */, true /* installed */));
         }
     }
 
@@ -137,12 +137,17 @@
     }
 
     private static PackageInfo createPackageInfo(
-            String packageName, boolean enabled, boolean valid) {
+            String packageName, boolean enabled, boolean valid, boolean installed) {
         PackageInfo p = new PackageInfo();
         p.packageName = packageName;
         p.applicationInfo = new ApplicationInfo();
         p.applicationInfo.enabled = enabled;
         p.applicationInfo.metaData = new Bundle();
+        if (installed) {
+            p.applicationInfo.flags |= ApplicationInfo.FLAG_INSTALLED;
+        } else {
+            p.applicationInfo.flags &= ~ApplicationInfo.FLAG_INSTALLED;
+        }
         if (valid) {
             // no flag means invalid
             p.applicationInfo.metaData.putString(WEBVIEW_LIBRARY_FLAG, "blah");
@@ -150,10 +155,23 @@
         return p;
     }
 
-    private static PackageInfo createPackageInfo(
-            String packageName, boolean enabled, boolean valid, Signature[] signatures) {
-        PackageInfo p = createPackageInfo(packageName, enabled, valid);
+    private static PackageInfo createPackageInfo(String packageName, boolean enabled, boolean valid,
+            boolean installed, Signature[] signatures, long updateTime) {
+        PackageInfo p = createPackageInfo(packageName, enabled, valid, installed);
         p.signatures = signatures;
+        p.lastUpdateTime = updateTime;
+        return p;
+    }
+
+    private static PackageInfo createPackageInfo(String packageName, boolean enabled, boolean valid,
+            boolean installed, Signature[] signatures, long updateTime, boolean hidden) {
+        PackageInfo p =
+            createPackageInfo(packageName, enabled, valid, installed, signatures, updateTime);
+        if (hidden) {
+            p.applicationInfo.privateFlags |= ApplicationInfo.PRIVATE_FLAG_HIDDEN;
+        } else {
+            p.applicationInfo.privateFlags &= ~ApplicationInfo.PRIVATE_FLAG_HIDDEN;
+        }
         return p;
     }
 
@@ -223,9 +241,11 @@
         setupWithPackages(packages, true /* fallback logic enabled */, 1 /* numRelros */,
                 false /* isDebuggable */);
         mTestSystemImpl.setPackageInfo(createPackageInfo(invalidPackage, true /* enabled */,
-                    true /* valid */, new Signature[]{invalidPackageSignature}));
+                    true /* valid */, true /* installed */, new Signature[]{invalidPackageSignature}
+                    , 0 /* updateTime */));
         mTestSystemImpl.setPackageInfo(createPackageInfo(validPackage, true /* enabled */,
-                    true /* valid */, new Signature[]{validSignature}));
+                    true /* valid */, true /* installed */, new Signature[]{validSignature}
+                    , 0 /* updateTime */));
 
         mWebViewUpdateServiceImpl.prepareWebViewInSystemServer();
 
@@ -273,7 +293,8 @@
         WebViewProviderInfo[] packages = new WebViewProviderInfo[] {wpi};
         setupWithPackages(packages);
         mTestSystemImpl.setPackageInfo(
-                createPackageInfo(wpi.packageName, true /* enabled */, false /* valid */));
+                createPackageInfo(wpi.packageName, true /* enabled */, false /* valid */,
+                    true /* installed */));
 
         mWebViewUpdateServiceImpl.prepareWebViewInSystemServer();
 
@@ -285,9 +306,10 @@
 
         // Verify that we can recover from failing to list webview packages.
         mTestSystemImpl.setPackageInfo(
-                createPackageInfo(wpi.packageName, true /* enabled */, true /* valid */));
+                createPackageInfo(wpi.packageName, true /* enabled */, true /* valid */,
+                    true /* installed */));
         mWebViewUpdateServiceImpl.packageStateChanged(wpi.packageName,
-                WebViewUpdateService.PACKAGE_ADDED_REPLACED);
+                WebViewUpdateService.PACKAGE_ADDED_REPLACED, 0);
 
         checkPreparationPhasesForPackage(wpi.packageName, 1);
     }
@@ -345,7 +367,7 @@
             // Have all packages be disabled so that we can change one to enabled later
             for(WebViewProviderInfo wpi : packages) {
                 mTestSystemImpl.setPackageInfo(createPackageInfo(wpi.packageName,
-                            false /* enabled */, true /* valid */));
+                            false /* enabled */, true /* valid */, true /* installed */));
             }
         }
 
@@ -371,7 +393,7 @@
             }
         }).start();
         try {
-            Thread.sleep(1000); // Let the new thread run / be blocked
+            Thread.sleep(500); // Let the new thread run / be blocked
         } catch (InterruptedException e) {
         }
 
@@ -380,9 +402,9 @@
         } else {
             // Switch provider by enabling the second one
             mTestSystemImpl.setPackageInfo(createPackageInfo(secondPackage, true /* enabled */,
-                        true /* valid */));
+                        true /* valid */, true /* installed */));
             mWebViewUpdateServiceImpl.packageStateChanged(
-                    secondPackage, WebViewUpdateService.PACKAGE_CHANGED);
+                    secondPackage, WebViewUpdateService.PACKAGE_CHANGED, 0);
         }
         mWebViewUpdateServiceImpl.notifyRelroCreationCompleted();
         // first package done, should start on second
@@ -432,9 +454,9 @@
 
         // Enable fallback package
         mTestSystemImpl.setPackageInfo(createPackageInfo(fallbackPackage, true /* enabled */,
-                        true /* valid */));
+                        true /* valid */, true /* installed */));
         mWebViewUpdateServiceImpl.packageStateChanged(
-                fallbackPackage, WebViewUpdateService.PACKAGE_CHANGED);
+                fallbackPackage, WebViewUpdateService.PACKAGE_CHANGED, 0);
 
         if (fallbackLogicEnabled) {
             // Check that we have now disabled the fallback package twice
@@ -463,7 +485,8 @@
                     fallbackPackage, "", true /* default available */, true /* fallback */, null)};
         setupWithPackages(packages, true /* isFallbackLogicEnabled */);
         mTestSystemImpl.setPackageInfo(
-                createPackageInfo(fallbackPackage, true /* enabled */ , true /* valid */));
+                createPackageInfo(fallbackPackage, true /* enabled */ , true /* valid */,
+                    true /* installed */));
 
         mWebViewUpdateServiceImpl.prepareWebViewInSystemServer();
         Mockito.verify(mTestSystemImpl, Mockito.never()).uninstallAndDisablePackageForAllUsers(
@@ -474,9 +497,10 @@
 
         // Install primary package
         mTestSystemImpl.setPackageInfo(
-                createPackageInfo(primaryPackage, true /* enabled */ , true /* valid */));
+                createPackageInfo(primaryPackage, true /* enabled */ , true /* valid */,
+                    true /* installed */));
         mWebViewUpdateServiceImpl.packageStateChanged(primaryPackage,
-                WebViewUpdateService.PACKAGE_ADDED_REPLACED);
+                WebViewUpdateService.PACKAGE_ADDED_REPLACED, 0);
 
         // Verify fallback disabled, primary package used as provider, and fallback package killed
         Mockito.verify(mTestSystemImpl).uninstallAndDisablePackageForAllUsers(
@@ -507,9 +531,10 @@
 
         // Disable primary package and ensure fallback becomes enabled and used
         mTestSystemImpl.setPackageInfo(
-                createPackageInfo(primaryPackage, false /* enabled */, true /* valid */));
+                createPackageInfo(primaryPackage, false /* enabled */, true /* valid */,
+                    true /* installed */));
         mWebViewUpdateServiceImpl.packageStateChanged(primaryPackage,
-                WebViewUpdateService.PACKAGE_CHANGED);
+                WebViewUpdateService.PACKAGE_CHANGED, 0);
 
         Mockito.verify(mTestSystemImpl).enablePackageForUser(
                 Mockito.eq(fallbackPackage), Mockito.eq(true) /* enable */,
@@ -520,9 +545,10 @@
 
         // Again enable primary package and verify primary is used and fallback becomes disabled
         mTestSystemImpl.setPackageInfo(
-                createPackageInfo(primaryPackage, true /* enabled */, true /* valid */));
+                createPackageInfo(primaryPackage, true /* enabled */, true /* valid */,
+                    true /* installed */));
         mWebViewUpdateServiceImpl.packageStateChanged(primaryPackage,
-                WebViewUpdateService.PACKAGE_CHANGED);
+                WebViewUpdateService.PACKAGE_CHANGED, 0);
 
         // Verify fallback is disabled a second time when primary package becomes enabled
         Mockito.verify(mTestSystemImpl, Mockito.times(2)).enablePackageForUser(
@@ -593,9 +619,10 @@
 
         // Make packages invalid to cause exception to be thrown
         mTestSystemImpl.setPackageInfo(createPackageInfo(firstPackage, true /* enabled */,
-                    false /* valid */));
+                    false /* valid */, true /* installed */, null /* signatures */,
+                    0 /* updateTime */));
         mTestSystemImpl.setPackageInfo(createPackageInfo(secondPackage, true /* enabled */,
-                    false /* valid */));
+                    false /* valid */, true /* installed */));
 
         // This shouldn't throw an exception!
         mWebViewUpdateServiceImpl.notifyRelroCreationCompleted();
@@ -605,10 +632,11 @@
 
         // Now make a package valid again and verify that we can switch back to that
         mTestSystemImpl.setPackageInfo(createPackageInfo(firstPackage, true /* enabled */,
-                    true /* valid */));
+                    true /* valid */, true /* installed */, null /* signatures */,
+                    1 /* updateTime */ ));
 
         mWebViewUpdateServiceImpl.packageStateChanged(firstPackage,
-                WebViewUpdateService.PACKAGE_ADDED_REPLACED);
+                WebViewUpdateService.PACKAGE_ADDED_REPLACED, 0);
 
         // Ensure we use firstPackage
         checkPreparationPhasesForPackage(firstPackage, 2 /* second preparation for this package */);
@@ -634,16 +662,16 @@
 
         // Remove second package (invalidate it) and verify that first package is used
         mTestSystemImpl.setPackageInfo(createPackageInfo(secondPackage, true /* enabled */,
-                    false /* valid */));
+                    false /* valid */, true /* installed */));
         mWebViewUpdateServiceImpl.packageStateChanged(secondPackage,
-                WebViewUpdateService.PACKAGE_ADDED);
+                WebViewUpdateService.PACKAGE_ADDED, 0);
         checkPreparationPhasesForPackage(firstPackage, 2 /* second time for this package */);
 
         // Now make the second package valid again and verify that it is used again
         mTestSystemImpl.setPackageInfo(createPackageInfo(secondPackage, true /* enabled */,
-                    true /* valid */));
+                    true /* valid */, true /* installed */));
         mWebViewUpdateServiceImpl.packageStateChanged(secondPackage,
-                WebViewUpdateService.PACKAGE_ADDED);
+                WebViewUpdateService.PACKAGE_ADDED, 0);
         checkPreparationPhasesForPackage(secondPackage, 2 /* second time for this package */);
     }
 
@@ -663,7 +691,7 @@
         setupWithPackages(packages);
         // Only 'install' nonChosenPackage
         mTestSystemImpl.setPackageInfo(
-                createPackageInfo(nonChosenPackage, true /* enabled */, true /* valid */));
+                createPackageInfo(nonChosenPackage, true /* enabled */, true /* valid */, true /* installed */));
 
         // Set user-chosen package
         mTestSystemImpl.updateUserSetting(null, chosenPackage);
@@ -702,16 +730,16 @@
 
         // Make both packages invalid so that we fail listing WebView packages
         mTestSystemImpl.setPackageInfo(createPackageInfo(firstPackage, true /* enabled */,
-                    false /* valid */));
+                    false /* valid */, true /* installed */));
         mTestSystemImpl.setPackageInfo(createPackageInfo(secondPackage, true /* enabled */,
-                    false /* valid */));
+                    false /* valid */, true /* installed */));
 
         // Change package to hit the webview packages listing problem.
         if (settingsChange) {
             mWebViewUpdateServiceImpl.changeProviderAndSetting(secondPackage);
         } else {
             mWebViewUpdateServiceImpl.packageStateChanged(secondPackage,
-                    WebViewUpdateService.PACKAGE_ADDED_REPLACED);
+                    WebViewUpdateService.PACKAGE_ADDED_REPLACED, 0);
         }
 
         WebViewProviderResponse response = mWebViewUpdateServiceImpl.waitForAndGetProvider();
@@ -719,10 +747,10 @@
 
         // Make second package valid and verify that we can load it again
         mTestSystemImpl.setPackageInfo(createPackageInfo(secondPackage, true /* enabled */,
-                    true /* valid */));
+                    true /* valid */, true /* installed */));
 
         mWebViewUpdateServiceImpl.packageStateChanged(secondPackage,
-                WebViewUpdateService.PACKAGE_ADDED_REPLACED);
+                WebViewUpdateService.PACKAGE_ADDED_REPLACED, 0);
 
 
         checkPreparationPhasesForPackage(secondPackage, 1);
@@ -749,13 +777,14 @@
         // Replace or remove the current webview package
         if (replaced) {
             mTestSystemImpl.setPackageInfo(
-                    createPackageInfo(firstPackage, true /* enabled */, false /* valid */));
+                    createPackageInfo(firstPackage, true /* enabled */, false /* valid */,
+                        true /* installed */));
             mWebViewUpdateServiceImpl.packageStateChanged(firstPackage,
-                    WebViewUpdateService.PACKAGE_ADDED_REPLACED);
+                    WebViewUpdateService.PACKAGE_ADDED_REPLACED, 0);
         } else {
             mTestSystemImpl.removePackageInfo(firstPackage);
             mWebViewUpdateServiceImpl.packageStateChanged(firstPackage,
-                    WebViewUpdateService.PACKAGE_REMOVED);
+                    WebViewUpdateService.PACKAGE_REMOVED, 0);
         }
 
         checkPreparationPhasesForPackage(secondPackage, 1);
@@ -806,7 +835,7 @@
         checkPreparationPhasesForPackage(thirdPackage, 1);
 
         mTestSystemImpl.setPackageInfo(
-                createPackageInfo(secondPackage, true /* enabled */, false /* valid */));
+                createPackageInfo(secondPackage, true /* enabled */, false /* valid */, true /* installed */));
 
         // Try to switch to the invalid second package, this should result in switching to the first
         // package, since that is more preferred than the third one.
@@ -817,4 +846,229 @@
 
         Mockito.verify(mTestSystemImpl).killPackageDependents(Mockito.eq(thirdPackage));
     }
+
+    // Ensure that the update service uses an uninstalled package if that is the only package
+    // available.
+    public void testWithSingleUninstalledPackage() {
+        String testPackageName = "test.package.name";
+        WebViewProviderInfo[] webviewPackages = new WebViewProviderInfo[] {
+                new WebViewProviderInfo(testPackageName, "",
+                        true /*default available*/, false /* fallback */, null)};
+        setupWithPackages(webviewPackages, true /* fallback logic enabled */, 1 /* numRelros */);
+        mTestSystemImpl.setPackageInfo(createPackageInfo(testPackageName, true /* enabled */,
+                    true /* valid */, false /* installed */));
+
+        mWebViewUpdateServiceImpl.prepareWebViewInSystemServer();
+
+        checkPreparationPhasesForPackage(testPackageName, 1 /* first preparation phase */);
+    }
+
+    public void testNonhiddenPackageUserOverHidden() {
+        checkVisiblePackageUserOverNonVisible(false /* true == uninstalled, false == hidden */);
+    }
+
+    public void testInstalledPackageUsedOverUninstalled() {
+        checkVisiblePackageUserOverNonVisible(true /* true == uninstalled, false == hidden */);
+    }
+
+    private void checkVisiblePackageUserOverNonVisible(boolean uninstalledNotHidden) {
+        boolean testUninstalled = uninstalledNotHidden;
+        boolean testHidden = !uninstalledNotHidden;
+        String installedPackage = "installedPackage";
+        String uninstalledPackage = "uninstalledPackage";
+        WebViewProviderInfo[] webviewPackages = new WebViewProviderInfo[] {
+            new WebViewProviderInfo(uninstalledPackage, "", true /* available by default */,
+                    false /* fallback */, null),
+            new WebViewProviderInfo(installedPackage, "", true /* available by default */,
+                    false /* fallback */, null)};
+
+        setupWithPackages(webviewPackages, true /* fallback logic enabled */, 1 /* numRelros */);
+        mTestSystemImpl.setPackageInfo(createPackageInfo(installedPackage, true /* enabled */,
+                    true /* valid */, true /* installed */));
+        mTestSystemImpl.setPackageInfo(createPackageInfo(uninstalledPackage, true /* enabled */,
+                    true /* valid */, (testUninstalled ? false : true) /* installed */,
+                    null /* signatures */, 0 /* updateTime */, (testHidden ? true : false)));
+
+        mWebViewUpdateServiceImpl.prepareWebViewInSystemServer();
+
+        checkPreparationPhasesForPackage(installedPackage, 1 /* first preparation phase */);
+    }
+
+    public void testCantSwitchToHiddenPackage () {
+        checkCantSwitchToNonVisiblePackage(false /* true == uninstalled, false == hidden */);
+    }
+
+
+    public void testCantSwitchToUninstalledPackage () {
+        checkCantSwitchToNonVisiblePackage(true /* true == uninstalled, false == hidden */);
+    }
+
+    /**
+     * Ensure that we won't prioritize an uninstalled (or hidden) package even if it is user-chosen,
+     * and that an uninstalled (or hidden) package is not considered valid (in the
+     * getValidWebViewPackages() API).
+     */
+    private void checkCantSwitchToNonVisiblePackage(boolean uninstalledNotHidden) {
+        boolean testUninstalled = uninstalledNotHidden;
+        boolean testHidden = !uninstalledNotHidden;
+        String installedPackage = "installedPackage";
+        String uninstalledPackage = "uninstalledPackage";
+        WebViewProviderInfo[] webviewPackages = new WebViewProviderInfo[] {
+            new WebViewProviderInfo(uninstalledPackage, "", true /* available by default */,
+                    false /* fallback */, null),
+            new WebViewProviderInfo(installedPackage, "", true /* available by default */,
+                    false /* fallback */, null)};
+
+        setupWithPackages(webviewPackages, true /* fallback logic enabled */, 1 /* numRelros */);
+        mTestSystemImpl.setPackageInfo(createPackageInfo(installedPackage, true /* enabled */,
+                    true /* valid */, true /* installed */));
+        mTestSystemImpl.setPackageInfo(createPackageInfo(uninstalledPackage, true /* enabled */,
+                    true /* valid */, (testUninstalled ? false : true) /* installed */,
+                    null /* signatures */, 0 /* updateTime */,
+                    (testHidden ? true : false) /* hidden */));
+
+        mWebViewUpdateServiceImpl.prepareWebViewInSystemServer();
+
+        checkPreparationPhasesForPackage(installedPackage, 1 /* first preparation phase */);
+
+        // Ensure that only the installed package is considered valid
+        WebViewProviderInfo[] validPackages = mWebViewUpdateServiceImpl.getValidWebViewPackages();
+        assertEquals(1, validPackages.length);
+        assertEquals(installedPackage, validPackages[0].packageName);
+
+        // ensure that we don't switch to the uninstalled package (it will be used if it becomes
+        // installed later)
+        assertEquals(installedPackage,
+                mWebViewUpdateServiceImpl.changeProviderAndSetting(uninstalledPackage));
+
+        // We should only have called onWebViewProviderChanged once (before calling
+        // changeProviderAndSetting
+        Mockito.verify(mTestSystemImpl, Mockito.times(1)).onWebViewProviderChanged(
+                Mockito.argThat(new IsPackageInfoWithName(installedPackage)));
+    }
+
+    public void testHiddenPackageNotPrioritizedEvenIfChosen() {
+        checkNonvisiblePackageNotPrioritizedEvenIfChosen(
+                false /* true == uninstalled, false == hidden */);
+    }
+
+    public void testUninstalledPackageNotPrioritizedEvenIfChosen() {
+        checkNonvisiblePackageNotPrioritizedEvenIfChosen(
+                true /* true == uninstalled, false == hidden */);
+    }
+
+    public void checkNonvisiblePackageNotPrioritizedEvenIfChosen(boolean uninstalledNotHidden) {
+        boolean testUninstalled = uninstalledNotHidden;
+        boolean testHidden = !uninstalledNotHidden;
+        String installedPackage = "installedPackage";
+        String uninstalledPackage = "uninstalledPackage";
+        WebViewProviderInfo[] webviewPackages = new WebViewProviderInfo[] {
+            new WebViewProviderInfo(uninstalledPackage, "", true /* available by default */,
+                    false /* fallback */, null),
+            new WebViewProviderInfo(installedPackage, "", true /* available by default */,
+                    false /* fallback */, null)};
+
+        setupWithPackages(webviewPackages, true /* fallback logic enabled */, 1 /* numRelros */);
+        mTestSystemImpl.setPackageInfo(createPackageInfo(installedPackage, true /* enabled */,
+                    true /* valid */, true /* installed */));
+        mTestSystemImpl.setPackageInfo(createPackageInfo(uninstalledPackage, true /* enabled */,
+                    true /* valid */, (testUninstalled ? false : true) /* installed */,
+                    null /* signatures */, 0 /* updateTime */,
+                    (testHidden ? true : false) /* hidden */));
+
+        // Start with the setting pointing to the uninstalled package
+        mTestSystemImpl.updateUserSetting(null, uninstalledPackage);
+
+        mWebViewUpdateServiceImpl.prepareWebViewInSystemServer();
+
+        checkPreparationPhasesForPackage(installedPackage, 1 /* first preparation phase */);
+    }
+
+    /**
+     * Ensures that fallback becomes enabled if the primary package is uninstalled for the current
+     * user.
+     */
+    public void testFallbackEnabledIfPrimaryUninstalled() {
+        String primaryPackage = "primary";
+        String fallbackPackage = "fallback";
+        WebViewProviderInfo[] packages = new WebViewProviderInfo[] {
+            new WebViewProviderInfo(
+                    primaryPackage, "", true /* default available */, false /* fallback */, null),
+            new WebViewProviderInfo(
+                    fallbackPackage, "", true /* default available */, true /* fallback */, null)};
+        setupWithPackages(packages, true /* fallback logic enabled */);
+        mTestSystemImpl.setPackageInfo(createPackageInfo(primaryPackage, true /* enabled */,
+                    true /* valid */, false /* installed */));
+        mTestSystemImpl.setPackageInfo(createPackageInfo(fallbackPackage, true /* enabled */,
+                    true /* valid */, true /* installed */));
+
+        mWebViewUpdateServiceImpl.prepareWebViewInSystemServer();
+        // Verify that we enable the fallback package
+        Mockito.verify(mTestSystemImpl).enablePackageForAllUsers(
+                Mockito.anyObject(), Mockito.eq(fallbackPackage), Mockito.eq(true) /* enable */);
+
+        checkPreparationPhasesForPackage(fallbackPackage, 1 /* first preparation phase */);
+    }
+
+    public void testPreparationRunsIffNewPackage() {
+        String primaryPackage = "primary";
+        String fallbackPackage = "fallback";
+        WebViewProviderInfo[] packages = new WebViewProviderInfo[] {
+            new WebViewProviderInfo(
+                    primaryPackage, "", true /* default available */, false /* fallback */, null),
+            new WebViewProviderInfo(
+                    fallbackPackage, "", true /* default available */, true /* fallback */, null)};
+        setupWithPackages(packages, true /* fallback logic enabled */);
+        mTestSystemImpl.setPackageInfo(createPackageInfo(primaryPackage, true /* enabled */,
+                    true /* valid */, true /* installed */, null /* signatures */,
+                    10 /* lastUpdateTime*/ ));
+        mTestSystemImpl.setPackageInfo(createPackageInfo(fallbackPackage, true /* enabled */,
+                    true /* valid */, true /* installed */));
+
+        mWebViewUpdateServiceImpl.prepareWebViewInSystemServer();
+
+        checkPreparationPhasesForPackage(primaryPackage, 1 /* first preparation phase */);
+        Mockito.verify(mTestSystemImpl, Mockito.times(1)).enablePackageForUser(
+                Mockito.eq(fallbackPackage), Mockito.eq(false) /* enable */,
+                Matchers.anyInt() /* user */);
+
+
+        mWebViewUpdateServiceImpl.packageStateChanged(primaryPackage,
+                WebViewUpdateService.PACKAGE_ADDED_REPLACED, 0 /* userId */);
+        mWebViewUpdateServiceImpl.packageStateChanged(primaryPackage,
+                WebViewUpdateService.PACKAGE_ADDED_REPLACED, 1 /* userId */);
+        mWebViewUpdateServiceImpl.packageStateChanged(primaryPackage,
+                WebViewUpdateService.PACKAGE_ADDED_REPLACED, 2 /* userId */);
+        // package still has the same update-time so we shouldn't run preparation here
+        Mockito.verify(mTestSystemImpl, Mockito.times(1)).onWebViewProviderChanged(
+                Mockito.argThat(new IsPackageInfoWithName(primaryPackage)));
+        Mockito.verify(mTestSystemImpl, Mockito.times(1)).enablePackageForUser(
+                Mockito.eq(fallbackPackage), Mockito.eq(false) /* enable */,
+                Matchers.anyInt() /* user */);
+
+        // Ensure we can still load the package
+        WebViewProviderResponse response = mWebViewUpdateServiceImpl.waitForAndGetProvider();
+        assertEquals(WebViewFactory.LIBLOAD_SUCCESS, response.status);
+        assertEquals(primaryPackage, response.packageInfo.packageName);
+
+
+        mTestSystemImpl.setPackageInfo(createPackageInfo(primaryPackage, true /* enabled */,
+                    true /* valid */, true /* installed */, null /* signatures */,
+                    20 /* lastUpdateTime*/ ));
+        mWebViewUpdateServiceImpl.packageStateChanged(primaryPackage,
+                WebViewUpdateService.PACKAGE_ADDED_REPLACED, 0);
+        // The package has now changed - ensure that we have run the preparation phase a second time
+        checkPreparationPhasesForPackage(primaryPackage, 2 /* second preparation phase */);
+
+
+        mTestSystemImpl.setPackageInfo(createPackageInfo(primaryPackage, true /* enabled */,
+                    true /* valid */, true /* installed */, null /* signatures */,
+                    50 /* lastUpdateTime*/ ));
+        // Receive intent for different user
+        mWebViewUpdateServiceImpl.packageStateChanged(primaryPackage,
+                WebViewUpdateService.PACKAGE_ADDED_REPLACED, 2);
+
+        checkPreparationPhasesForPackage(primaryPackage, 3 /* third preparation phase */);
+    }
+
 }
diff --git a/test-runner/src/android/test/mock/MockContext.java b/test-runner/src/android/test/mock/MockContext.java
index b14fc41..9471326 100644
--- a/test-runner/src/android/test/mock/MockContext.java
+++ b/test-runner/src/android/test/mock/MockContext.java
@@ -702,6 +702,12 @@
         throw new UnsupportedOperationException();
     }
 
+    /** @hide */
+    @Override
+    public Display getDisplay() {
+        throw new UnsupportedOperationException();
+    }
+
     @Override
     public File[] getExternalFilesDirs(String type) {
         throw new UnsupportedOperationException();
diff --git a/tests/permission/src/com/android/framework/permission/tests/WindowManagerPermissionTests.java b/tests/permission/src/com/android/framework/permission/tests/WindowManagerPermissionTests.java
index 0286506..a726a15 100644
--- a/tests/permission/src/com/android/framework/permission/tests/WindowManagerPermissionTests.java
+++ b/tests/permission/src/com/android/framework/permission/tests/WindowManagerPermissionTests.java
@@ -93,7 +93,7 @@
 
         try {
             mWm.addAppToken(0, null, 0, 0, 0, false, false, 0, 0, false, false, null,
-                    Configuration.EMPTY, 0, false, false);
+                    Configuration.EMPTY, 0, false, false, 0);
             fail("IWindowManager.addAppToken did not throw SecurityException as"
                     + " expected");
         } catch (SecurityException e) {
diff --git a/tools/layoutlib/bridge/src/android/view/IWindowManagerImpl.java b/tools/layoutlib/bridge/src/android/view/IWindowManagerImpl.java
index ceebdd5..04a59bc 100644
--- a/tools/layoutlib/bridge/src/android/view/IWindowManagerImpl.java
+++ b/tools/layoutlib/bridge/src/android/view/IWindowManagerImpl.java
@@ -78,7 +78,7 @@
     @Override
     public void addAppToken(int arg0, IApplicationToken arg1, int arg2, int arg3, int arg4,
             boolean arg5, boolean arg6, int arg7, int arg8, boolean arg9, boolean arg10,
-            Rect arg11, Configuration arg12, int arg13, boolean arg14, boolean arg15)
+            Rect arg11, Configuration arg12, int arg13, boolean arg14, boolean arg15, int arg16)
             throws RemoteException {
         // TODO Auto-generated method stub
     }
diff --git a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgeContext.java b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgeContext.java
index f87269b..616cb57 100644
--- a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgeContext.java
+++ b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgeContext.java
@@ -1799,6 +1799,12 @@
     }
 
     @Override
+    public Display getDisplay() {
+        // pass
+        return null;
+    }
+
+    @Override
     public int getUserId() {
         return 0; // not used
     }
diff --git a/wifi/java/android/net/wifi/RttManager.java b/wifi/java/android/net/wifi/RttManager.java
index a404a90..590ff1b 100644
--- a/wifi/java/android/net/wifi/RttManager.java
+++ b/wifi/java/android/net/wifi/RttManager.java
@@ -691,7 +691,7 @@
 
         /**
          * spread (i.e. max - min) distance
-         * @deprecate Use {@link android.net.wifi.RttManager.RttResult#distanceSpread} API.
+         * @deprecated Use {@link android.net.wifi.RttManager.RttResult#distanceSpread} API.
          */
         @Deprecated
         public int distance_spread_cm;
diff --git a/wifi/java/android/net/wifi/WifiScanner.java b/wifi/java/android/net/wifi/WifiScanner.java
index 2ee1aef..2636c3f 100644
--- a/wifi/java/android/net/wifi/WifiScanner.java
+++ b/wifi/java/android/net/wifi/WifiScanner.java
@@ -141,7 +141,7 @@
     /**
      * reports {@link ScanListener#onResults} when underlying buffers are full
      * this is simply the lack of the {@link #REPORT_EVENT_AFTER_EACH_SCAN} flag
-     * @deprecated
+     * @deprecated It is not supported anymore.
      */
     @Deprecated
     public static final int REPORT_EVENT_AFTER_BUFFER_FULL = 0;