Merge "Add managed profile whitelist to control NotificationListenerServices" into oc-dev
diff --git a/api/current.txt b/api/current.txt
index 0434840..bb083f1 100644
--- a/api/current.txt
+++ b/api/current.txt
@@ -15,7 +15,6 @@
     field public static final java.lang.String ACCESS_WIFI_STATE = "android.permission.ACCESS_WIFI_STATE";
     field public static final java.lang.String ACCOUNT_MANAGER = "android.permission.ACCOUNT_MANAGER";
     field public static final java.lang.String ADD_VOICEMAIL = "com.android.voicemail.permission.ADD_VOICEMAIL";
-    field public static final java.lang.String ALLOCATE_AGGRESSIVE = "android.permission.ALLOCATE_AGGRESSIVE";
     field public static final java.lang.String ANSWER_PHONE_CALLS = "android.permission.ANSWER_PHONE_CALLS";
     field public static final java.lang.String BATTERY_STATS = "android.permission.BATTERY_STATS";
     field public static final java.lang.String BIND_ACCESSIBILITY_SERVICE = "android.permission.BIND_ACCESSIBILITY_SERVICE";
@@ -116,12 +115,13 @@
     field public static final java.lang.String RECEIVE_WAP_PUSH = "android.permission.RECEIVE_WAP_PUSH";
     field public static final java.lang.String RECORD_AUDIO = "android.permission.RECORD_AUDIO";
     field public static final java.lang.String REORDER_TASKS = "android.permission.REORDER_TASKS";
+    field public static final java.lang.String REQUEST_COMPANION_RUN_IN_BACKGROUND = "android.permission.REQUEST_COMPANION_RUN_IN_BACKGROUND";
+    field public static final java.lang.String REQUEST_COMPANION_USE_DATA_IN_BACKGROUND = "android.permission.REQUEST_COMPANION_USE_DATA_IN_BACKGROUND";
     field public static final java.lang.String REQUEST_DELETE_PACKAGES = "android.permission.REQUEST_DELETE_PACKAGES";
     field public static final java.lang.String REQUEST_IGNORE_BATTERY_OPTIMIZATIONS = "android.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS";
     field public static final java.lang.String REQUEST_INSTALL_PACKAGES = "android.permission.REQUEST_INSTALL_PACKAGES";
     field public static final deprecated java.lang.String RESTART_PACKAGES = "android.permission.RESTART_PACKAGES";
     field public static final java.lang.String RESTRICTED_VR_ACCESS = "android.permission.RESTRICTED_VR_ACCESS";
-    field public static final java.lang.String RUN_IN_BACKGROUND = "android.permission.RUN_IN_BACKGROUND";
     field public static final java.lang.String SEND_RESPOND_VIA_MESSAGE = "android.permission.SEND_RESPOND_VIA_MESSAGE";
     field public static final java.lang.String SEND_SMS = "android.permission.SEND_SMS";
     field public static final java.lang.String SET_ALARM = "com.android.alarm.permission.SET_ALARM";
@@ -140,7 +140,6 @@
     field public static final java.lang.String TRANSMIT_IR = "android.permission.TRANSMIT_IR";
     field public static final java.lang.String UNINSTALL_SHORTCUT = "com.android.launcher.permission.UNINSTALL_SHORTCUT";
     field public static final java.lang.String UPDATE_DEVICE_STATS = "android.permission.UPDATE_DEVICE_STATS";
-    field public static final java.lang.String USE_DATA_IN_BACKGROUND = "android.permission.USE_DATA_IN_BACKGROUND";
     field public static final java.lang.String USE_FINGERPRINT = "android.permission.USE_FINGERPRINT";
     field public static final java.lang.String USE_SIP = "android.permission.USE_SIP";
     field public static final java.lang.String VIBRATE = "android.permission.VIBRATE";
@@ -313,6 +312,7 @@
     field public static final int autoUrlDetect = 16843404; // 0x101028c
     field public static final int autoVerify = 16844014; // 0x10104ee
     field public static final int autofillHints = 16844121; // 0x1010559
+    field public static final int autofilledHighlight = 16844139; // 0x101056b
     field public static final int background = 16842964; // 0x10100d4
     field public static final int backgroundDimAmount = 16842802; // 0x1010032
     field public static final int backgroundDimEnabled = 16843295; // 0x101021f
@@ -357,12 +357,12 @@
     field public static final int calendarTextColor = 16843931; // 0x101049b
     field public static final int calendarViewShown = 16843596; // 0x101034c
     field public static final int calendarViewStyle = 16843613; // 0x101035d
-    field public static final int canCaptureFingerprintGestures = 16844111; // 0x101054f
     field public static final int canControlMagnification = 16844039; // 0x1010507
     field public static final int canPerformGestures = 16844045; // 0x101050d
     field public static final int canRecord = 16844060; // 0x101051c
     field public static final deprecated int canRequestEnhancedWebAccessibility = 16843736; // 0x10103d8
     field public static final int canRequestFilterKeyEvents = 16843737; // 0x10103d9
+    field public static final int canRequestFingerprintGestures = 16844111; // 0x101054f
     field public static final int canRequestTouchExplorationMode = 16843735; // 0x10103d7
     field public static final int canRetrieveWindowContent = 16843653; // 0x1010385
     field public static final int candidatesTextStyleSpans = 16843312; // 0x1010230
@@ -1297,7 +1297,7 @@
     field public static final int targetId = 16843740; // 0x10103dc
     field public static final int targetName = 16843853; // 0x101044d
     field public static final int targetPackage = 16842785; // 0x1010021
-    field public static final int targetProcess = 16844097; // 0x1010541
+    field public static final int targetProcesses = 16844097; // 0x1010541
     field public static final int targetSandboxVersion = 16844110; // 0x101054e
     field public static final int targetSdkVersion = 16843376; // 0x1010270
     field public static final int taskAffinity = 16842770; // 0x1010012
@@ -1612,7 +1612,6 @@
     field public static final int alert_light_frame = 17301505; // 0x1080001
     field public static final int arrow_down_float = 17301506; // 0x1080002
     field public static final int arrow_up_float = 17301507; // 0x1080003
-    field public static final int autofilled_highlight = 17301684; // 0x10800b4
     field public static final int bottom_bar = 17301658; // 0x108009a
     field public static final int btn_default = 17301508; // 0x1080004
     field public static final int btn_default_small = 17301509; // 0x1080005
@@ -2833,11 +2832,11 @@
     method public java.lang.String loadDescription(android.content.pm.PackageManager);
     method public java.lang.String loadSummary(android.content.pm.PackageManager);
     method public void writeToParcel(android.os.Parcel, int);
-    field public static final int CAPABILITY_CAN_CAPTURE_FINGERPRINT_GESTURES = 64; // 0x40
     field public static final int CAPABILITY_CAN_CONTROL_MAGNIFICATION = 16; // 0x10
     field public static final int CAPABILITY_CAN_PERFORM_GESTURES = 32; // 0x20
     field public static final deprecated int CAPABILITY_CAN_REQUEST_ENHANCED_WEB_ACCESSIBILITY = 4; // 0x4
     field public static final int CAPABILITY_CAN_REQUEST_FILTER_KEY_EVENTS = 8; // 0x8
+    field public static final int CAPABILITY_CAN_REQUEST_FINGERPRINT_GESTURES = 64; // 0x40
     field public static final int CAPABILITY_CAN_REQUEST_TOUCH_EXPLORATION = 2; // 0x2
     field public static final int CAPABILITY_CAN_RETRIEVE_WINDOW_CONTENT = 1; // 0x1
     field public static final android.os.Parcelable.Creator<android.accessibilityservice.AccessibilityServiceInfo> CREATOR;
@@ -2849,13 +2848,13 @@
     field public static final int FEEDBACK_HAPTIC = 2; // 0x2
     field public static final int FEEDBACK_SPOKEN = 1; // 0x1
     field public static final int FEEDBACK_VISUAL = 8; // 0x8
-    field public static final int FLAG_CAPTURE_FINGERPRINT_GESTURES = 512; // 0x200
     field public static final int FLAG_ENABLE_ACCESSIBILITY_VOLUME = 128; // 0x80
     field public static final int FLAG_INCLUDE_NOT_IMPORTANT_VIEWS = 2; // 0x2
     field public static final int FLAG_REPORT_VIEW_IDS = 16; // 0x10
     field public static final int FLAG_REQUEST_ACCESSIBILITY_BUTTON = 256; // 0x100
     field public static final deprecated int FLAG_REQUEST_ENHANCED_WEB_ACCESSIBILITY = 8; // 0x8
     field public static final int FLAG_REQUEST_FILTER_KEY_EVENTS = 32; // 0x20
+    field public static final int FLAG_REQUEST_FINGERPRINT_GESTURES = 512; // 0x200
     field public static final int FLAG_REQUEST_TOUCH_EXPLORATION_MODE = 4; // 0x4
     field public static final int FLAG_RETRIEVE_INTERACTIVE_WINDOWS = 64; // 0x40
     field public int eventTypes;
@@ -2877,7 +2876,7 @@
 
   public static abstract class FingerprintGestureController.FingerprintGestureCallback {
     ctor public FingerprintGestureController.FingerprintGestureCallback();
-    method public void onGesture(int);
+    method public void onGestureDetected(int);
     method public void onGestureDetectionAvailabilityChanged(boolean);
   }
 
@@ -2896,14 +2895,12 @@
 
   public static class GestureDescription.StrokeDescription {
     ctor public GestureDescription.StrokeDescription(android.graphics.Path, long, long);
-    ctor public GestureDescription.StrokeDescription(android.graphics.Path, long, long, int, boolean);
-    method public int getContinuedStrokeId();
+    ctor public GestureDescription.StrokeDescription(android.graphics.Path, long, long, boolean);
+    method public android.accessibilityservice.GestureDescription.StrokeDescription continueStroke(android.graphics.Path, long, long, boolean);
     method public long getDuration();
-    method public int getId();
     method public android.graphics.Path getPath();
     method public long getStartTime();
-    method public boolean isContinued();
-    field public static final int INVALID_STROKE_ID = -1; // 0xffffffff
+    method public boolean willContinue();
   }
 
 }
@@ -3035,8 +3032,8 @@
     field public static final java.lang.String KEY_PASSWORD = "password";
     field public static final java.lang.String KEY_USERDATA = "userdata";
     field public static final deprecated java.lang.String LOGIN_ACCOUNTS_CHANGED_ACTION = "android.accounts.LOGIN_ACCOUNTS_CHANGED";
-    field public static final java.lang.String PACKAGE_NAME_KEY_LEGACY_NOT_VISIBLE = "android.accounts.key_legacy_not_visible";
-    field public static final java.lang.String PACKAGE_NAME_KEY_LEGACY_VISIBLE = "android.accounts.key_legacy_visible";
+    field public static final java.lang.String PACKAGE_NAME_KEY_LEGACY_NOT_VISIBLE = "android:accounts:key_legacy_not_visible";
+    field public static final java.lang.String PACKAGE_NAME_KEY_LEGACY_VISIBLE = "android:accounts:key_legacy_visible";
     field public static final int VISIBILITY_NOT_VISIBLE = 3; // 0x3
     field public static final int VISIBILITY_UNDEFINED = 0; // 0x0
     field public static final int VISIBILITY_USER_MANAGED_NOT_VISIBLE = 4; // 0x4
@@ -3682,7 +3679,6 @@
     method public void onLowMemory();
     method public boolean onMenuItemSelected(int, android.view.MenuItem);
     method public boolean onMenuOpened(int, android.view.Menu);
-    method public void onMovedToDisplay(int, android.content.res.Configuration);
     method public void onMultiWindowModeChanged(boolean, android.content.res.Configuration);
     method public deprecated void onMultiWindowModeChanged(boolean);
     method public boolean onNavigateUp();
@@ -3944,7 +3940,7 @@
     field public static final int IMPORTANCE_FOREGROUND_SERVICE = 125; // 0x7d
     field public static final int IMPORTANCE_GONE = 1000; // 0x3e8
     field public static final int IMPORTANCE_PERCEPTIBLE = 230; // 0xe6
-    field public static final deprecated int IMPORTANCE_PERCEPTIBLE_DEPRECATED = 130; // 0x82
+    field public static final int IMPORTANCE_PERCEPTIBLE_PRE_26 = 130; // 0x82
     field public static final int IMPORTANCE_SERVICE = 300; // 0x12c
     field public static final int IMPORTANCE_TOP_SLEEPING = 150; // 0x96
     field public static final int IMPORTANCE_VISIBLE = 200; // 0xc8
@@ -4031,6 +4027,7 @@
     method public static android.app.ActivityOptions makeTaskLaunchBehind();
     method public static android.app.ActivityOptions makeThumbnailScaleUpAnimation(android.view.View, android.graphics.Bitmap, int, int);
     method public void requestUsageTimeReport(android.app.PendingIntent);
+    method public android.app.ActivityOptions setAppVerificationBundle(android.os.Bundle);
     method public android.app.ActivityOptions setLaunchBounds(android.graphics.Rect);
     method public android.app.ActivityOptions setLaunchDisplayId(int);
     method public android.os.Bundle toBundle();
@@ -4818,6 +4815,7 @@
     method public void onFragmentDetached(android.app.FragmentManager, android.app.Fragment);
     method public void onFragmentPaused(android.app.FragmentManager, android.app.Fragment);
     method public void onFragmentPreAttached(android.app.FragmentManager, android.app.Fragment, android.content.Context);
+    method public void onFragmentPreCreated(android.app.FragmentManager, android.app.Fragment, android.os.Bundle);
     method public void onFragmentResumed(android.app.FragmentManager, android.app.Fragment);
     method public void onFragmentSaveInstanceState(android.app.FragmentManager, android.app.Fragment, android.os.Bundle);
     method public void onFragmentStarted(android.app.FragmentManager, android.app.Fragment);
@@ -4850,11 +4848,10 @@
     method public abstract android.app.FragmentTransaction hide(android.app.Fragment);
     method public abstract boolean isAddToBackStackAllowed();
     method public abstract boolean isEmpty();
-    method public abstract android.app.FragmentTransaction postOnCommit(java.lang.Runnable);
     method public abstract android.app.FragmentTransaction remove(android.app.Fragment);
     method public abstract android.app.FragmentTransaction replace(int, android.app.Fragment);
     method public abstract android.app.FragmentTransaction replace(int, android.app.Fragment, java.lang.String);
-    method public abstract android.app.FragmentTransaction setAllowOptimization(boolean);
+    method public abstract android.app.FragmentTransaction runOnCommit(java.lang.Runnable);
     method public abstract android.app.FragmentTransaction setBreadCrumbShortTitle(int);
     method public abstract android.app.FragmentTransaction setBreadCrumbShortTitle(java.lang.CharSequence);
     method public abstract android.app.FragmentTransaction setBreadCrumbTitle(int);
@@ -4862,6 +4859,7 @@
     method public abstract android.app.FragmentTransaction setCustomAnimations(int, int);
     method public abstract android.app.FragmentTransaction setCustomAnimations(int, int, int, int);
     method public abstract android.app.FragmentTransaction setPrimaryNavigationFragment(android.app.Fragment);
+    method public abstract android.app.FragmentTransaction setReorderingAllowed(boolean);
     method public abstract android.app.FragmentTransaction setTransition(int);
     method public abstract android.app.FragmentTransaction setTransitionStyle(int);
     method public abstract android.app.FragmentTransaction show(android.app.Fragment);
@@ -4955,7 +4953,7 @@
     method public final android.app.Activity getLastActivity();
     method public final android.app.Instrumentation.ActivityResult getResult();
     method public final boolean isBlocking();
-    method public android.app.Instrumentation.ActivityResult onMatchIntent(android.content.Intent);
+    method public android.app.Instrumentation.ActivityResult onStartActivity(android.content.Intent);
     method public final android.app.Activity waitForActivity();
     method public final android.app.Activity waitForActivityWithTimeout(long);
   }
@@ -4975,7 +4973,7 @@
 
   public class KeyguardManager {
     method public android.content.Intent createConfirmDeviceCredentialIntent(java.lang.CharSequence, java.lang.CharSequence);
-    method public void dismissKeyguard(android.app.Activity, android.app.KeyguardManager.KeyguardDismissCallback, android.os.Handler);
+    method public deprecated void dismissKeyguard(android.app.Activity, android.app.KeyguardManager.KeyguardDismissCallback, android.os.Handler);
     method public deprecated void exitKeyguardSecurely(android.app.KeyguardManager.OnKeyguardExitResult);
     method public boolean inKeyguardRestrictedInputMode();
     method public boolean isDeviceLocked();
@@ -4983,6 +4981,7 @@
     method public boolean isKeyguardLocked();
     method public boolean isKeyguardSecure();
     method public deprecated android.app.KeyguardManager.KeyguardLock newKeyguardLock(java.lang.String);
+    method public void requestDismissKeyguard(android.app.Activity, android.app.KeyguardManager.KeyguardDismissCallback);
   }
 
   public static abstract class KeyguardManager.KeyguardDismissCallback {
@@ -6113,17 +6112,6 @@
     method public void onDetached();
   }
 
-  public final class WallpaperColors implements android.os.Parcelable {
-    ctor public WallpaperColors(android.os.Parcel);
-    ctor public WallpaperColors(java.util.List<android.util.Pair<android.graphics.Color, java.lang.Integer>>);
-    ctor public WallpaperColors(java.util.List<android.util.Pair<android.graphics.Color, java.lang.Integer>>, boolean);
-    method public int describeContents();
-    method public java.util.List<android.util.Pair<android.graphics.Color, java.lang.Integer>> getColors();
-    method public boolean supportsDarkText();
-    method public void writeToParcel(android.os.Parcel, int);
-    field public static final android.os.Parcelable.Creator<android.app.WallpaperColors> CREATOR;
-  }
-
   public final class WallpaperInfo implements android.os.Parcelable {
     ctor public WallpaperInfo(android.content.Context, android.content.pm.ResolveInfo) throws java.io.IOException, org.xmlpull.v1.XmlPullParserException;
     method public int describeContents();
@@ -6146,8 +6134,6 @@
   }
 
   public class WallpaperManager {
-    method public void addOnColorsChangedListener(android.app.WallpaperManager.OnColorsChangedListener);
-    method public void addOnColorsChangedListener(android.app.WallpaperManager.OnColorsChangedListener, android.os.Handler);
     method public void clear() throws java.io.IOException;
     method public void clear(int) throws java.io.IOException;
     method public void clearWallpaperOffsets(android.os.IBinder);
@@ -6162,7 +6148,6 @@
     method public android.graphics.drawable.Drawable getDrawable();
     method public android.graphics.drawable.Drawable getFastDrawable();
     method public static android.app.WallpaperManager getInstance(android.content.Context);
-    method public android.app.WallpaperColors getWallpaperColors(int);
     method public android.os.ParcelFileDescriptor getWallpaperFile(int);
     method public int getWallpaperId(int);
     method public android.app.WallpaperInfo getWallpaperInfo();
@@ -6171,7 +6156,6 @@
     method public boolean isWallpaperSupported();
     method public android.graphics.drawable.Drawable peekDrawable();
     method public android.graphics.drawable.Drawable peekFastDrawable();
-    method public void removeOnColorsChangedListener(android.app.WallpaperManager.OnColorsChangedListener);
     method public void sendWallpaperCommand(android.os.IBinder, java.lang.String, int, int, int, android.os.Bundle);
     method public void setBitmap(android.graphics.Bitmap) throws java.io.IOException;
     method public int setBitmap(android.graphics.Bitmap, android.graphics.Rect, boolean) throws java.io.IOException;
@@ -6196,16 +6180,12 @@
     field public static final java.lang.String WALLPAPER_PREVIEW_META_DATA = "android.wallpaper.preview";
   }
 
-  public static abstract interface WallpaperManager.OnColorsChangedListener {
-    method public abstract void onColorsChanged(android.app.WallpaperColors, int);
-  }
-
 }
 
 package android.app.admin {
 
   public final class ConnectEvent extends android.app.admin.NetworkEvent implements android.os.Parcelable {
-    method public java.lang.String getIpAddress();
+    method public java.net.InetAddress getInetAddress();
     method public int getPort();
     method public void writeToParcel(android.os.Parcel, int);
     field public static final android.os.Parcelable.Creator<android.app.admin.ConnectEvent> CREATOR;
@@ -6512,7 +6492,7 @@
     field public static final java.lang.String EXTRA_PROVISIONING_WIFI_PROXY_PORT = "android.app.extra.PROVISIONING_WIFI_PROXY_PORT";
     field public static final java.lang.String EXTRA_PROVISIONING_WIFI_SECURITY_TYPE = "android.app.extra.PROVISIONING_WIFI_SECURITY_TYPE";
     field public static final java.lang.String EXTRA_PROVISIONING_WIFI_SSID = "android.app.extra.PROVISIONING_WIFI_SSID";
-    field public static final int FLAG_EVICT_CE_KEY = 1; // 0x1
+    field public static final int FLAG_EVICT_CREDENTIAL_ENCRYPTION_KEY = 1; // 0x1
     field public static final int FLAG_MANAGED_CAN_ACCESS_PARENT = 2; // 0x2
     field public static final int FLAG_PARENT_CAN_ACCESS_MANAGED = 1; // 0x1
     field public static final int KEYGUARD_DISABLE_FEATURES_ALL = 2147483647; // 0x7fffffff
@@ -6550,8 +6530,8 @@
 
   public final class DnsEvent extends android.app.admin.NetworkEvent implements android.os.Parcelable {
     method public java.lang.String getHostname();
-    method public java.lang.String[] getIpAddresses();
-    method public int getIpAddressesCount();
+    method public java.util.List<java.net.InetAddress> getInetAddresses();
+    method public int getTotalResolvedAddressCount();
     method public void writeToParcel(android.os.Parcel, int);
     field public static final android.os.Parcelable.Creator<android.app.admin.DnsEvent> CREATOR;
   }
@@ -6722,7 +6702,6 @@
   public abstract class BackupAgent extends android.content.ContextWrapper {
     ctor public BackupAgent();
     method public final void fullBackupFile(java.io.File, android.app.backup.FullBackupDataOutput);
-    method public long getBackupQuota();
     method public abstract void onBackup(android.os.ParcelFileDescriptor, android.app.backup.BackupDataOutput, android.os.ParcelFileDescriptor) throws java.io.IOException;
     method public void onCreate();
     method public void onDestroy();
@@ -6757,6 +6736,7 @@
   }
 
   public class BackupDataOutput {
+    method public long getQuota();
     method public int writeEntityData(byte[], int) throws java.io.IOException;
     method public int writeEntityHeader(java.lang.String, int) throws java.io.IOException;
   }
@@ -6785,6 +6765,7 @@
   }
 
   public class FullBackupDataOutput {
+    method public long getQuota();
   }
 
   public abstract class RestoreObserver {
@@ -7010,8 +6991,8 @@
 
   public final class StorageStats implements android.os.Parcelable {
     method public int describeContents();
+    method public long getAppBytes();
     method public long getCacheBytes();
-    method public long getCodeBytes();
     method public long getDataBytes();
     method public void writeToParcel(android.os.Parcel, int);
     field public static final android.os.Parcelable.Creator<android.app.usage.StorageStats> CREATOR;
@@ -8044,7 +8025,7 @@
     method public void setAdvertisingData(android.bluetooth.le.AdvertiseData);
     method public void setAdvertisingParameters(android.bluetooth.le.AdvertisingSetParameters);
     method public void setPeriodicAdvertisingData(android.bluetooth.le.AdvertiseData);
-    method public void setPeriodicAdvertisingEnable(boolean);
+    method public void setPeriodicAdvertisingEnabled(boolean);
     method public void setPeriodicAdvertisingParameters(android.bluetooth.le.PeriodicAdvertisingParameters);
     method public void setScanResponseData(android.bluetooth.le.AdvertiseData);
   }
@@ -8219,8 +8200,10 @@
     field public static final android.os.Parcelable.Creator<android.bluetooth.le.ScanResult> CREATOR;
     field public static final int DATA_COMPLETE = 0; // 0x0
     field public static final int DATA_TRUNCATED = 2; // 0x2
+    field public static final int PERIODIC_INTERVAL_NOT_PRESENT = 0; // 0x0
     field public static final int PHY_UNUSED = 0; // 0x0
     field public static final int SID_NOT_PRESENT = 255; // 0xff
+    field public static final int TX_POWER_NOT_PRESENT = 127; // 0x7f
   }
 
   public final class ScanSettings implements android.os.Parcelable {
@@ -8291,21 +8274,21 @@
     method public android.companion.BluetoothDeviceFilter.Builder setNamePattern(java.util.regex.Pattern);
   }
 
-  public final class BluetoothLEDeviceFilter implements android.companion.DeviceFilter {
+  public final class BluetoothLeDeviceFilter implements android.companion.DeviceFilter {
     method public int describeContents();
     method public static int getRenamePrefixLengthLimit();
     method public void writeToParcel(android.os.Parcel, int);
-    field public static final android.os.Parcelable.Creator<android.companion.BluetoothLEDeviceFilter> CREATOR;
+    field public static final android.os.Parcelable.Creator<android.companion.BluetoothLeDeviceFilter> CREATOR;
   }
 
-  public static final class BluetoothLEDeviceFilter.Builder {
-    ctor public BluetoothLEDeviceFilter.Builder();
-    method public android.companion.BluetoothLEDeviceFilter build();
-    method public android.companion.BluetoothLEDeviceFilter.Builder setNamePattern(java.util.regex.Pattern);
-    method public android.companion.BluetoothLEDeviceFilter.Builder setRawDataFilter(byte[], byte[]);
-    method public android.companion.BluetoothLEDeviceFilter.Builder setRenameFromBytes(java.lang.String, java.lang.String, int, int, boolean);
-    method public android.companion.BluetoothLEDeviceFilter.Builder setRenameFromName(java.lang.String, java.lang.String, int, int);
-    method public android.companion.BluetoothLEDeviceFilter.Builder setScanFilter(android.bluetooth.le.ScanFilter);
+  public static final class BluetoothLeDeviceFilter.Builder {
+    ctor public BluetoothLeDeviceFilter.Builder();
+    method public android.companion.BluetoothLeDeviceFilter build();
+    method public android.companion.BluetoothLeDeviceFilter.Builder setNamePattern(java.util.regex.Pattern);
+    method public android.companion.BluetoothLeDeviceFilter.Builder setRawDataFilter(byte[], byte[]);
+    method public android.companion.BluetoothLeDeviceFilter.Builder setRenameFromBytes(java.lang.String, java.lang.String, int, int, java.nio.ByteOrder);
+    method public android.companion.BluetoothLeDeviceFilter.Builder setRenameFromName(java.lang.String, java.lang.String, int, int);
+    method public android.companion.BluetoothLeDeviceFilter.Builder setScanFilter(android.bluetooth.le.ScanFilter);
   }
 
   public final class CompanionDeviceManager {
@@ -8441,7 +8424,7 @@
     ctor public ClipData(android.content.ClipDescription, android.content.ClipData.Item);
     ctor public ClipData(android.content.ClipData);
     method public void addItem(android.content.ClipData.Item);
-    method public void addItem(android.content.ClipData.Item, android.content.ContentResolver);
+    method public void addItem(android.content.ContentResolver, android.content.ClipData.Item);
     method public int describeContents();
     method public android.content.ClipDescription getDescription();
     method public android.content.ClipData.Item getItemAt(int);
@@ -9513,6 +9496,7 @@
     field public static final java.lang.String EXTRA_CHOOSER_TARGETS = "android.intent.extra.CHOOSER_TARGETS";
     field public static final java.lang.String EXTRA_CHOSEN_COMPONENT = "android.intent.extra.CHOSEN_COMPONENT";
     field public static final java.lang.String EXTRA_CHOSEN_COMPONENT_INTENT_SENDER = "android.intent.extra.CHOSEN_COMPONENT_INTENT_SENDER";
+    field public static final java.lang.String EXTRA_COMPONENT_NAME = "android.intent.extra.COMPONENT_NAME";
     field public static final java.lang.String EXTRA_CONTENT_ANNOTATIONS = "android.intent.extra.CONTENT_ANNOTATIONS";
     field public static final java.lang.String EXTRA_DATA_REMOVED = "android.intent.extra.DATA_REMOVED";
     field public static final java.lang.String EXTRA_DOCK_STATE = "android.intent.extra.DOCK_STATE";
@@ -10336,7 +10320,7 @@
     field public java.lang.String[] splitPublicSourceDirs;
     field public java.lang.String[] splitSourceDirs;
     field public java.lang.String targetPackage;
-    field public java.lang.String targetProcess;
+    field public java.lang.String targetProcesses;
   }
 
   public class LabeledIntent extends android.content.Intent {
@@ -13302,7 +13286,7 @@
     method public void setFilterBitmap(boolean);
     method public void setFlags(int);
     method public void setFontFeatureSettings(java.lang.String);
-    method public boolean setFontVariationSettings(java.lang.String) throws android.graphics.fonts.FontVariationAxis.InvalidFormatException;
+    method public boolean setFontVariationSettings(java.lang.String);
     method public void setHinting(int);
     method public void setLetterSpacing(float);
     method public void setLinearText(boolean);
@@ -13778,6 +13762,7 @@
     method public void detachFromGLContext();
     method public long getTimestamp();
     method public void getTransformMatrix(float[]);
+    method public boolean isReleased();
     method public void release();
     method public void releaseTexImage();
     method public void setDefaultBufferSize(int, int);
@@ -13828,7 +13813,7 @@
     ctor public Typeface.Builder(android.content.res.AssetManager, java.lang.String);
     method public android.graphics.Typeface build();
     method public android.graphics.Typeface.Builder setFallback(java.lang.String);
-    method public android.graphics.Typeface.Builder setFontVariationSettings(java.lang.String) throws android.graphics.fonts.FontVariationAxis.InvalidFormatException;
+    method public android.graphics.Typeface.Builder setFontVariationSettings(java.lang.String);
     method public android.graphics.Typeface.Builder setFontVariationSettings(android.graphics.fonts.FontVariationAxis[]);
     method public android.graphics.Typeface.Builder setItalic(boolean);
     method public android.graphics.Typeface.Builder setTtcIndex(int);
@@ -14412,17 +14397,13 @@
 package android.graphics.fonts {
 
   public final class FontVariationAxis {
-    ctor public FontVariationAxis(java.lang.String, float) throws android.graphics.fonts.FontVariationAxis.InvalidFormatException;
-    method public static android.graphics.fonts.FontVariationAxis[] fromFontVariationSettings(java.lang.String) throws android.graphics.fonts.FontVariationAxis.InvalidFormatException;
+    ctor public FontVariationAxis(java.lang.String, float);
+    method public static android.graphics.fonts.FontVariationAxis[] fromFontVariationSettings(java.lang.String);
     method public float getStyleValue();
     method public java.lang.String getTag();
     method public static java.lang.String toFontVariationSettings(android.graphics.fonts.FontVariationAxis[]);
   }
 
-  public static class FontVariationAxis.InvalidFormatException extends java.lang.Exception {
-    ctor public FontVariationAxis.InvalidFormatException(java.lang.String);
-  }
-
 }
 
 package android.graphics.pdf {
@@ -14510,7 +14491,7 @@
     method public final void takePicture(android.hardware.Camera.ShutterCallback, android.hardware.Camera.PictureCallback, android.hardware.Camera.PictureCallback, android.hardware.Camera.PictureCallback);
     method public final void unlock();
     field public static final java.lang.String ACTION_NEW_PICTURE = "android.hardware.action.NEW_PICTURE";
-    field public static final deprecated java.lang.String ACTION_NEW_VIDEO = "android.hardware.action.NEW_VIDEO";
+    field public static final java.lang.String ACTION_NEW_VIDEO = "android.hardware.action.NEW_VIDEO";
     field public static final int CAMERA_ERROR_EVICTED = 2; // 0x2
     field public static final int CAMERA_ERROR_SERVER_DIED = 100; // 0x64
     field public static final int CAMERA_ERROR_UNKNOWN = 1; // 0x1
@@ -14771,18 +14752,16 @@
     field public static final int RGBX_8888 = 2; // 0x2
     field public static final int RGB_565 = 4; // 0x4
     field public static final int RGB_888 = 3; // 0x3
-    field public static final long USAGE0_CPU_READ = 2L; // 0x2L
-    field public static final long USAGE0_CPU_READ_OFTEN = 6L; // 0x6L
-    field public static final long USAGE0_CPU_WRITE = 32L; // 0x20L
-    field public static final long USAGE0_CPU_WRITE_OFTEN = 96L; // 0x60L
-    field public static final long USAGE0_GPU_COLOR_OUTPUT = 2048L; // 0x800L
-    field public static final long USAGE0_GPU_CUBEMAP = 8192L; // 0x2000L
-    field public static final long USAGE0_GPU_DATA_BUFFER = 16384L; // 0x4000L
-    field public static final long USAGE0_GPU_SAMPLED_IMAGE = 1024L; // 0x400L
-    field public static final long USAGE0_GPU_STORAGE_IMAGE = 3072L; // 0xc00L
-    field public static final long USAGE0_PROTECTED_CONTENT = 262144L; // 0x40000L
-    field public static final long USAGE0_SENSOR_DIRECT_DATA = 536870912L; // 0x20000000L
-    field public static final long USAGE0_VIDEO_ENCODE = 2097152L; // 0x200000L
+    field public static final long USAGE_CPU_READ_OFTEN = 3L; // 0x3L
+    field public static final long USAGE_CPU_READ_RARELY = 2L; // 0x2L
+    field public static final long USAGE_CPU_WRITE_OFTEN = 48L; // 0x30L
+    field public static final long USAGE_CPU_WRITE_RARELY = 32L; // 0x20L
+    field public static final long USAGE_GPU_COLOR_OUTPUT = 512L; // 0x200L
+    field public static final long USAGE_GPU_DATA_BUFFER = 16777216L; // 0x1000000L
+    field public static final long USAGE_GPU_SAMPLED_IMAGE = 256L; // 0x100L
+    field public static final long USAGE_PROTECTED_CONTENT = 16384L; // 0x4000L
+    field public static final long USAGE_SENSOR_DIRECT_DATA = 8388608L; // 0x800000L
+    field public static final long USAGE_VIDEO_ENCODE = 65536L; // 0x10000L
   }
 
   public final class Sensor {
@@ -25414,8 +25393,8 @@
     method public boolean requestBandwidthUpdate(android.net.Network);
     method public void requestNetwork(android.net.NetworkRequest, android.net.ConnectivityManager.NetworkCallback);
     method public void requestNetwork(android.net.NetworkRequest, android.net.ConnectivityManager.NetworkCallback, android.os.Handler);
-    method public void requestNetwork(android.net.NetworkRequest, int, android.net.ConnectivityManager.NetworkCallback);
-    method public void requestNetwork(android.net.NetworkRequest, int, android.net.ConnectivityManager.NetworkCallback, android.os.Handler);
+    method public void requestNetwork(android.net.NetworkRequest, android.net.ConnectivityManager.NetworkCallback, int);
+    method public void requestNetwork(android.net.NetworkRequest, android.net.ConnectivityManager.NetworkCallback, android.os.Handler, int);
     method public void requestNetwork(android.net.NetworkRequest, android.app.PendingIntent);
     method public deprecated void setNetworkPreference(int);
     method public static deprecated boolean setProcessDefaultNetwork(android.net.Network);
@@ -30694,7 +30673,6 @@
     method public android.util.SizeF getSizeF(java.lang.String);
     method public <T extends android.os.Parcelable> android.util.SparseArray<T> getSparseParcelableArray(java.lang.String);
     method public java.util.ArrayList<java.lang.String> getStringArrayList(java.lang.String);
-    method public java.util.UUID getUuid(java.lang.String);
     method public boolean hasFileDescriptors();
     method public void putAll(android.os.Bundle);
     method public void putBinder(java.lang.String, android.os.IBinder);
@@ -30719,7 +30697,6 @@
     method public void putSizeF(java.lang.String, android.util.SizeF);
     method public void putSparseParcelableArray(java.lang.String, android.util.SparseArray<? extends android.os.Parcelable>);
     method public void putStringArrayList(java.lang.String, java.util.ArrayList<java.lang.String>);
-    method public void putUuid(java.lang.String, java.util.UUID);
     method public void readFromParcel(android.os.Parcel);
     method public void setClassLoader(java.lang.ClassLoader);
     method public void writeToParcel(android.os.Parcel, int);
@@ -31249,7 +31226,6 @@
     method public final <T> void readTypedArray(T[], android.os.Parcelable.Creator<T>);
     method public final <T> void readTypedList(java.util.List<T>, android.os.Parcelable.Creator<T>);
     method public final <T> T readTypedObject(android.os.Parcelable.Creator<T>);
-    method public final java.util.UUID readUuid();
     method public final java.lang.Object readValue(java.lang.ClassLoader);
     method public final void recycle();
     method public final void setDataCapacity(int);
@@ -31295,7 +31271,6 @@
     method public final <T extends android.os.Parcelable> void writeTypedArray(T[], int);
     method public final <T extends android.os.Parcelable> void writeTypedList(java.util.List<T>);
     method public final <T extends android.os.Parcelable> void writeTypedObject(T, int);
-    method public final void writeUuid(java.util.UUID);
     method public final void writeValue(java.lang.Object);
     field public static final android.os.Parcelable.Creator<java.lang.String> STRING_CREATOR;
   }
@@ -31698,6 +31673,7 @@
     field public static final java.lang.String DISALLOW_APPS_CONTROL = "no_control_apps";
     field public static final java.lang.String DISALLOW_AUTOFILL = "no_autofill";
     field public static final java.lang.String DISALLOW_BLUETOOTH = "no_bluetooth";
+    field public static final java.lang.String DISALLOW_BLUETOOTH_SHARING = "no_bluetooth_sharing";
     field public static final java.lang.String DISALLOW_CONFIG_BLUETOOTH = "no_config_bluetooth";
     field public static final java.lang.String DISALLOW_CONFIG_CELL_BROADCASTS = "no_config_cell_broadcasts";
     field public static final java.lang.String DISALLOW_CONFIG_CREDENTIALS = "no_config_credentials";
@@ -31926,9 +31902,9 @@
   }
 
   public class StorageManager {
-    method public void allocateBytes(java.util.UUID, long, int) throws java.io.IOException;
-    method public void allocateBytes(java.io.FileDescriptor, long, int) throws java.io.IOException;
-    method public long getAllocatableBytes(java.util.UUID, int) throws java.io.IOException;
+    method public void allocateBytes(java.util.UUID, long) throws java.io.IOException;
+    method public void allocateBytes(java.io.FileDescriptor, long) throws java.io.IOException;
+    method public long getAllocatableBytes(java.util.UUID) throws java.io.IOException;
     method public long getCacheQuotaBytes(java.util.UUID) throws java.io.IOException;
     method public long getCacheSizeBytes(java.util.UUID) throws java.io.IOException;
     method public java.lang.String getMountedObbPath(java.lang.String);
@@ -31941,7 +31917,6 @@
     method public boolean isEncrypted(java.io.File);
     method public boolean isObbMounted(java.lang.String);
     method public boolean mountObb(java.lang.String, java.lang.String, android.os.storage.OnObbStateChangeListener);
-    method public android.os.ParcelFileDescriptor openProxyFileDescriptor(int, android.os.ProxyFileDescriptorCallback) throws java.io.IOException;
     method public android.os.ParcelFileDescriptor openProxyFileDescriptor(int, android.os.ProxyFileDescriptorCallback, android.os.Handler) throws java.io.IOException;
     method public void setCacheBehaviorGroup(java.io.File, boolean) throws java.io.IOException;
     method public void setCacheBehaviorTombstone(java.io.File, boolean) throws java.io.IOException;
@@ -31949,7 +31924,6 @@
     field public static final java.lang.String ACTION_MANAGE_STORAGE = "android.os.storage.action.MANAGE_STORAGE";
     field public static final java.lang.String EXTRA_REQUESTED_BYTES = "android.os.storage.extra.REQUESTED_BYTES";
     field public static final java.lang.String EXTRA_UUID = "android.os.storage.extra.UUID";
-    field public static final int FLAG_ALLOCATE_AGGRESSIVE = 1; // 0x1
     field public static final java.util.UUID UUID_DEFAULT;
   }
 
@@ -34440,7 +34414,6 @@
   }
 
   public class FontsContract {
-    method public static android.graphics.Typeface buildTypeface(android.content.Context, android.os.CancellationSignal, android.provider.FontsContract.FontInfo[], int, boolean, java.lang.String);
     method public static android.graphics.Typeface buildTypeface(android.content.Context, android.os.CancellationSignal, android.provider.FontsContract.FontInfo[]);
     method public static android.provider.FontsContract.FontFamilyResult fetchFonts(android.content.Context, android.os.CancellationSignal, android.provider.FontRequest) throws android.content.pm.PackageManager.NameNotFoundException;
     method public static void requestFonts(android.content.Context, android.provider.FontRequest, android.os.Handler, android.os.CancellationSignal, android.provider.FontsContract.FontRequestCallback);
@@ -37502,7 +37475,6 @@
     method public final void unlockAndRun(java.lang.Runnable);
     field public static final java.lang.String ACTION_QS_TILE = "android.service.quicksettings.action.QS_TILE";
     field public static final java.lang.String ACTION_QS_TILE_PREFERENCES = "android.service.quicksettings.action.QS_TILE_PREFERENCES";
-    field public static final java.lang.String EXTRA_COMPONENT = "android.service.quicksettings.extra.COMPONENT";
     field public static final java.lang.String META_DATA_ACTIVE_TILE = "android.service.quicksettings.ACTIVE_TILE";
   }
 
@@ -37732,12 +37704,10 @@
     method public int getDesiredMinimumHeight();
     method public int getDesiredMinimumWidth();
     method public android.view.SurfaceHolder getSurfaceHolder();
-    method public void invalidateColors();
     method public boolean isPreview();
     method public boolean isVisible();
     method public void onApplyWindowInsets(android.view.WindowInsets);
     method public android.os.Bundle onCommand(java.lang.String, int, int, int, android.os.Bundle, boolean);
-    method public android.app.WallpaperColors onComputeWallpaperColors();
     method public void onCreate(android.view.SurfaceHolder);
     method public void onDesiredSizeChanged(int, int);
     method public void onDestroy();
@@ -45611,7 +45581,6 @@
     method public boolean onKeyUp(int, android.view.KeyEvent);
     method protected void onLayout(boolean, int, int, int, int);
     method protected void onMeasure(int, int);
-    method public void onMovedToDisplay(int, android.content.res.Configuration);
     method protected void onOverScrolled(int, int, boolean, boolean);
     method public void onPointerCaptureChange(boolean);
     method public void onPopulateAccessibilityEvent(android.view.accessibility.AccessibilityEvent);
@@ -45831,6 +45800,7 @@
     field public static final int ACCESSIBILITY_LIVE_REGION_NONE = 0; // 0x0
     field public static final int ACCESSIBILITY_LIVE_REGION_POLITE = 1; // 0x1
     field public static final android.util.Property<android.view.View, java.lang.Float> ALPHA;
+    field public static final int AUTOFILL_FLAG_INCLUDE_NOT_IMPORTANT_VIEWS = 1; // 0x1
     field public static final java.lang.String AUTOFILL_HINT_CREDIT_CARD_EXPIRATION_DATE = "creditCardExpirationDate";
     field public static final java.lang.String AUTOFILL_HINT_CREDIT_CARD_EXPIRATION_DAY = "creditCardExpirationDay";
     field public static final java.lang.String AUTOFILL_HINT_CREDIT_CARD_EXPIRATION_MONTH = "creditCardExpirationMonth";
@@ -46542,7 +46512,7 @@
 
   public static abstract class ViewStructure.HtmlInfo {
     ctor public ViewStructure.HtmlInfo();
-    method public abstract java.util.ArrayList<android.util.Pair<java.lang.String, java.lang.String>> getAttributes();
+    method public abstract java.util.List<android.util.Pair<java.lang.String, java.lang.String>> getAttributes();
     method public abstract java.lang.String getTag();
   }
 
@@ -47254,8 +47224,8 @@
     field public static final java.lang.String ACTION_ARGUMENT_EXTEND_SELECTION_BOOLEAN = "ACTION_ARGUMENT_EXTEND_SELECTION_BOOLEAN";
     field public static final java.lang.String ACTION_ARGUMENT_HTML_ELEMENT_STRING = "ACTION_ARGUMENT_HTML_ELEMENT_STRING";
     field public static final java.lang.String ACTION_ARGUMENT_MOVEMENT_GRANULARITY_INT = "ACTION_ARGUMENT_MOVEMENT_GRANULARITY_INT";
-    field public static final java.lang.String ACTION_ARGUMENT_MOVE_WINDOW_X = "android.view.accessibility.action.ARGUMENT_MOVE_WINDOW_X";
-    field public static final java.lang.String ACTION_ARGUMENT_MOVE_WINDOW_Y = "android.view.accessibility.action.ARGUMENT_MOVE_WINDOW_Y";
+    field public static final java.lang.String ACTION_ARGUMENT_MOVE_WINDOW_X = "ACTION_ARGUMENT_MOVE_WINDOW_X";
+    field public static final java.lang.String ACTION_ARGUMENT_MOVE_WINDOW_Y = "ACTION_ARGUMENT_MOVE_WINDOW_Y";
     field public static final java.lang.String ACTION_ARGUMENT_PROGRESS_VALUE = "android.view.accessibility.action.ARGUMENT_PROGRESS_VALUE";
     field public static final java.lang.String ACTION_ARGUMENT_ROW_INT = "android.view.accessibility.action.ARGUMENT_ROW_INT";
     field public static final java.lang.String ACTION_ARGUMENT_SELECTION_END_INT = "ACTION_ARGUMENT_SELECTION_END_INT";
@@ -47437,10 +47407,10 @@
     method public android.view.accessibility.AccessibilityNodeInfo getRoot();
     method public java.lang.CharSequence getTitle();
     method public int getType();
-    method public boolean inPictureInPicture();
     method public boolean isAccessibilityFocused();
     method public boolean isActive();
     method public boolean isFocused();
+    method public boolean isInPictureInPictureMode();
     method public static android.view.accessibility.AccessibilityWindowInfo obtain();
     method public static android.view.accessibility.AccessibilityWindowInfo obtain(android.view.accessibility.AccessibilityWindowInfo);
     method public void recycle();
@@ -47798,7 +47768,7 @@
     method public void unregisterCallback(android.view.autofill.AutofillManager.AutofillCallback);
     field public static final java.lang.String EXTRA_ASSIST_STRUCTURE = "android.view.autofill.extra.ASSIST_STRUCTURE";
     field public static final java.lang.String EXTRA_AUTHENTICATION_RESULT = "android.view.autofill.extra.AUTHENTICATION_RESULT";
-    field public static final java.lang.String EXTRA_DATA_EXTRAS = "android.view.autofill.extra.DATA_EXTRAS";
+    field public static final java.lang.String EXTRA_CLIENT_STATE = "android.view.autofill.extra.EXTRA_CLIENT_STATE";
   }
 
   public static abstract class AutofillManager.AutofillCallback {
@@ -48939,7 +48909,6 @@
     method public int getRendererRequestedPriority();
     method public deprecated float getScale();
     method public android.webkit.WebSettings getSettings();
-    method public android.view.textclassifier.TextClassifier getTextClassifier();
     method public java.lang.String getTitle();
     method public java.lang.String getUrl();
     method public android.webkit.WebChromeClient getWebChromeClient();
@@ -48986,7 +48955,6 @@
     method public void setNetworkAvailable(boolean);
     method public deprecated void setPictureListener(android.webkit.WebView.PictureListener);
     method public void setRendererPriorityPolicy(int, boolean);
-    method public void setTextClassifier(android.view.textclassifier.TextClassifier);
     method public deprecated void setVerticalScrollbarOverlay(boolean);
     method public void setWebChromeClient(android.webkit.WebChromeClient);
     method public static void setWebContentsDebuggingEnabled(boolean);
@@ -51446,7 +51414,7 @@
     method public void setExtractedText(android.view.inputmethod.ExtractedText);
     method public void setFilters(android.text.InputFilter[]);
     method public void setFontFeatureSettings(java.lang.String);
-    method public boolean setFontVariationSettings(java.lang.String) throws android.graphics.fonts.FontVariationAxis.InvalidFormatException;
+    method public boolean setFontVariationSettings(java.lang.String);
     method protected boolean setFrame(int, int, int, int);
     method public void setFreezesText(boolean);
     method public void setGravity(int);
diff --git a/api/removed.txt b/api/removed.txt
index 13bccd6..779ff7c 100644
--- a/api/removed.txt
+++ b/api/removed.txt
@@ -18,12 +18,17 @@
     method public deprecated java.lang.String getDeviceInitializerApp();
     method public deprecated android.content.ComponentName getDeviceInitializerComponent();
     method public void setAffiliationIds(android.content.ComponentName, java.util.List<java.lang.String>);
+    field public static final deprecated int FLAG_EVICT_CE_KEY = 1; // 0x1
   }
 
 }
 
 package android.app.usage {
 
+  public final class StorageStats implements android.os.Parcelable {
+    method public deprecated long getCodeBytes();
+  }
+
   public class StorageStatsManager {
     method public deprecated long getFreeBytes(java.lang.String) throws java.io.IOException;
     method public deprecated long getTotalBytes(java.lang.String) throws java.io.IOException;
@@ -38,6 +43,10 @@
 
 package android.content {
 
+  public class ClipData implements android.os.Parcelable {
+    method public deprecated void addItem(android.content.ClipData.Item, android.content.ContentResolver);
+  }
+
   public abstract class Context {
     method public abstract android.content.SharedPreferences getSharedPreferences(java.io.File, int);
     method public abstract java.io.File getSharedPreferencesPath(java.lang.String);
@@ -443,6 +452,14 @@
 
 }
 
+package android.view.accessibility {
+
+  public final class AccessibilityWindowInfo implements android.os.Parcelable {
+    method public boolean inPictureInPicture();
+  }
+
+}
+
 package android.webkit {
 
   public class WebViewClient {
diff --git a/api/system-current.txt b/api/system-current.txt
index a5239ed..5bb85be 100644
--- a/api/system-current.txt
+++ b/api/system-current.txt
@@ -211,6 +211,8 @@
     field public static final java.lang.String REGISTER_SIM_SUBSCRIPTION = "android.permission.REGISTER_SIM_SUBSCRIPTION";
     field public static final java.lang.String REMOVE_DRM_CERTIFICATES = "android.permission.REMOVE_DRM_CERTIFICATES";
     field public static final java.lang.String REORDER_TASKS = "android.permission.REORDER_TASKS";
+    field public static final java.lang.String REQUEST_COMPANION_RUN_IN_BACKGROUND = "android.permission.REQUEST_COMPANION_RUN_IN_BACKGROUND";
+    field public static final java.lang.String REQUEST_COMPANION_USE_DATA_IN_BACKGROUND = "android.permission.REQUEST_COMPANION_USE_DATA_IN_BACKGROUND";
     field public static final java.lang.String REQUEST_DELETE_PACKAGES = "android.permission.REQUEST_DELETE_PACKAGES";
     field public static final java.lang.String REQUEST_IGNORE_BATTERY_OPTIMIZATIONS = "android.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS";
     field public static final java.lang.String REQUEST_INSTALL_PACKAGES = "android.permission.REQUEST_INSTALL_PACKAGES";
@@ -218,7 +220,6 @@
     field public static final java.lang.String RESTRICTED_VR_ACCESS = "android.permission.RESTRICTED_VR_ACCESS";
     field public static final java.lang.String RETRIEVE_WINDOW_CONTENT = "android.permission.RETRIEVE_WINDOW_CONTENT";
     field public static final java.lang.String REVOKE_RUNTIME_PERMISSIONS = "android.permission.REVOKE_RUNTIME_PERMISSIONS";
-    field public static final java.lang.String RUN_IN_BACKGROUND = "android.permission.RUN_IN_BACKGROUND";
     field public static final java.lang.String SCORE_NETWORKS = "android.permission.SCORE_NETWORKS";
     field public static final java.lang.String SEND_RESPOND_VIA_MESSAGE = "android.permission.SEND_RESPOND_VIA_MESSAGE";
     field public static final java.lang.String SEND_SMS = "android.permission.SEND_SMS";
@@ -256,7 +257,6 @@
     field public static final java.lang.String UPDATE_DEVICE_STATS = "android.permission.UPDATE_DEVICE_STATS";
     field public static final java.lang.String UPDATE_LOCK = "android.permission.UPDATE_LOCK";
     field public static final java.lang.String USER_ACTIVITY = "android.permission.USER_ACTIVITY";
-    field public static final java.lang.String USE_DATA_IN_BACKGROUND = "android.permission.USE_DATA_IN_BACKGROUND";
     field public static final java.lang.String USE_FINGERPRINT = "android.permission.USE_FINGERPRINT";
     field public static final java.lang.String USE_SIP = "android.permission.USE_SIP";
     field public static final java.lang.String VIBRATE = "android.permission.VIBRATE";
@@ -432,6 +432,7 @@
     field public static final int autoUrlDetect = 16843404; // 0x101028c
     field public static final int autoVerify = 16844014; // 0x10104ee
     field public static final int autofillHints = 16844121; // 0x1010559
+    field public static final int autofilledHighlight = 16844139; // 0x101056b
     field public static final int background = 16842964; // 0x10100d4
     field public static final int backgroundDimAmount = 16842802; // 0x1010032
     field public static final int backgroundDimEnabled = 16843295; // 0x101021f
@@ -476,12 +477,12 @@
     field public static final int calendarTextColor = 16843931; // 0x101049b
     field public static final int calendarViewShown = 16843596; // 0x101034c
     field public static final int calendarViewStyle = 16843613; // 0x101035d
-    field public static final int canCaptureFingerprintGestures = 16844111; // 0x101054f
     field public static final int canControlMagnification = 16844039; // 0x1010507
     field public static final int canPerformGestures = 16844045; // 0x101050d
     field public static final int canRecord = 16844060; // 0x101051c
     field public static final deprecated int canRequestEnhancedWebAccessibility = 16843736; // 0x10103d8
     field public static final int canRequestFilterKeyEvents = 16843737; // 0x10103d9
+    field public static final int canRequestFingerprintGestures = 16844111; // 0x101054f
     field public static final int canRequestTouchExplorationMode = 16843735; // 0x10103d7
     field public static final int canRetrieveWindowContent = 16843653; // 0x1010385
     field public static final int candidatesTextStyleSpans = 16843312; // 0x1010230
@@ -1422,7 +1423,7 @@
     field public static final int targetId = 16843740; // 0x10103dc
     field public static final int targetName = 16843853; // 0x101044d
     field public static final int targetPackage = 16842785; // 0x1010021
-    field public static final int targetProcess = 16844097; // 0x1010541
+    field public static final int targetProcesses = 16844097; // 0x1010541
     field public static final int targetSandboxVersion = 16844110; // 0x101054e
     field public static final int targetSdkVersion = 16843376; // 0x1010270
     field public static final int taskAffinity = 16842770; // 0x1010012
@@ -1737,7 +1738,6 @@
     field public static final int alert_light_frame = 17301505; // 0x1080001
     field public static final int arrow_down_float = 17301506; // 0x1080002
     field public static final int arrow_up_float = 17301507; // 0x1080003
-    field public static final int autofilled_highlight = 17301684; // 0x10800b4
     field public static final int bottom_bar = 17301658; // 0x108009a
     field public static final int btn_default = 17301508; // 0x1080004
     field public static final int btn_default_small = 17301509; // 0x1080005
@@ -2961,11 +2961,11 @@
     method public java.lang.String loadDescription(android.content.pm.PackageManager);
     method public java.lang.String loadSummary(android.content.pm.PackageManager);
     method public void writeToParcel(android.os.Parcel, int);
-    field public static final int CAPABILITY_CAN_CAPTURE_FINGERPRINT_GESTURES = 64; // 0x40
     field public static final int CAPABILITY_CAN_CONTROL_MAGNIFICATION = 16; // 0x10
     field public static final int CAPABILITY_CAN_PERFORM_GESTURES = 32; // 0x20
     field public static final deprecated int CAPABILITY_CAN_REQUEST_ENHANCED_WEB_ACCESSIBILITY = 4; // 0x4
     field public static final int CAPABILITY_CAN_REQUEST_FILTER_KEY_EVENTS = 8; // 0x8
+    field public static final int CAPABILITY_CAN_REQUEST_FINGERPRINT_GESTURES = 64; // 0x40
     field public static final int CAPABILITY_CAN_REQUEST_TOUCH_EXPLORATION = 2; // 0x2
     field public static final int CAPABILITY_CAN_RETRIEVE_WINDOW_CONTENT = 1; // 0x1
     field public static final android.os.Parcelable.Creator<android.accessibilityservice.AccessibilityServiceInfo> CREATOR;
@@ -2977,13 +2977,13 @@
     field public static final int FEEDBACK_HAPTIC = 2; // 0x2
     field public static final int FEEDBACK_SPOKEN = 1; // 0x1
     field public static final int FEEDBACK_VISUAL = 8; // 0x8
-    field public static final int FLAG_CAPTURE_FINGERPRINT_GESTURES = 512; // 0x200
     field public static final int FLAG_ENABLE_ACCESSIBILITY_VOLUME = 128; // 0x80
     field public static final int FLAG_INCLUDE_NOT_IMPORTANT_VIEWS = 2; // 0x2
     field public static final int FLAG_REPORT_VIEW_IDS = 16; // 0x10
     field public static final int FLAG_REQUEST_ACCESSIBILITY_BUTTON = 256; // 0x100
     field public static final deprecated int FLAG_REQUEST_ENHANCED_WEB_ACCESSIBILITY = 8; // 0x8
     field public static final int FLAG_REQUEST_FILTER_KEY_EVENTS = 32; // 0x20
+    field public static final int FLAG_REQUEST_FINGERPRINT_GESTURES = 512; // 0x200
     field public static final int FLAG_REQUEST_TOUCH_EXPLORATION_MODE = 4; // 0x4
     field public static final int FLAG_RETRIEVE_INTERACTIVE_WINDOWS = 64; // 0x40
     field public int eventTypes;
@@ -3005,7 +3005,7 @@
 
   public static abstract class FingerprintGestureController.FingerprintGestureCallback {
     ctor public FingerprintGestureController.FingerprintGestureCallback();
-    method public void onGesture(int);
+    method public void onGestureDetected(int);
     method public void onGestureDetectionAvailabilityChanged(boolean);
   }
 
@@ -3024,14 +3024,12 @@
 
   public static class GestureDescription.StrokeDescription {
     ctor public GestureDescription.StrokeDescription(android.graphics.Path, long, long);
-    ctor public GestureDescription.StrokeDescription(android.graphics.Path, long, long, int, boolean);
-    method public int getContinuedStrokeId();
+    ctor public GestureDescription.StrokeDescription(android.graphics.Path, long, long, boolean);
+    method public android.accessibilityservice.GestureDescription.StrokeDescription continueStroke(android.graphics.Path, long, long, boolean);
     method public long getDuration();
-    method public int getId();
     method public android.graphics.Path getPath();
     method public long getStartTime();
-    method public boolean isContinued();
-    field public static final int INVALID_STROKE_ID = -1; // 0xffffffff
+    method public boolean willContinue();
   }
 
 }
@@ -3164,8 +3162,8 @@
     field public static final java.lang.String KEY_PASSWORD = "password";
     field public static final java.lang.String KEY_USERDATA = "userdata";
     field public static final deprecated java.lang.String LOGIN_ACCOUNTS_CHANGED_ACTION = "android.accounts.LOGIN_ACCOUNTS_CHANGED";
-    field public static final java.lang.String PACKAGE_NAME_KEY_LEGACY_NOT_VISIBLE = "android.accounts.key_legacy_not_visible";
-    field public static final java.lang.String PACKAGE_NAME_KEY_LEGACY_VISIBLE = "android.accounts.key_legacy_visible";
+    field public static final java.lang.String PACKAGE_NAME_KEY_LEGACY_NOT_VISIBLE = "android:accounts:key_legacy_not_visible";
+    field public static final java.lang.String PACKAGE_NAME_KEY_LEGACY_VISIBLE = "android:accounts:key_legacy_visible";
     field public static final int VISIBILITY_NOT_VISIBLE = 3; // 0x3
     field public static final int VISIBILITY_UNDEFINED = 0; // 0x0
     field public static final int VISIBILITY_USER_MANAGED_NOT_VISIBLE = 4; // 0x4
@@ -3815,7 +3813,6 @@
     method public void onLowMemory();
     method public boolean onMenuItemSelected(int, android.view.MenuItem);
     method public boolean onMenuOpened(int, android.view.Menu);
-    method public void onMovedToDisplay(int, android.content.res.Configuration);
     method public void onMultiWindowModeChanged(boolean, android.content.res.Configuration);
     method public deprecated void onMultiWindowModeChanged(boolean);
     method public boolean onNavigateUp();
@@ -4093,7 +4090,7 @@
     field public static final int IMPORTANCE_FOREGROUND_SERVICE = 125; // 0x7d
     field public static final int IMPORTANCE_GONE = 1000; // 0x3e8
     field public static final int IMPORTANCE_PERCEPTIBLE = 230; // 0xe6
-    field public static final deprecated int IMPORTANCE_PERCEPTIBLE_DEPRECATED = 130; // 0x82
+    field public static final int IMPORTANCE_PERCEPTIBLE_PRE_26 = 130; // 0x82
     field public static final int IMPORTANCE_SERVICE = 300; // 0x12c
     field public static final int IMPORTANCE_TOP_SLEEPING = 150; // 0x96
     field public static final int IMPORTANCE_VISIBLE = 200; // 0xc8
@@ -4180,6 +4177,7 @@
     method public static android.app.ActivityOptions makeTaskLaunchBehind();
     method public static android.app.ActivityOptions makeThumbnailScaleUpAnimation(android.view.View, android.graphics.Bitmap, int, int);
     method public void requestUsageTimeReport(android.app.PendingIntent);
+    method public android.app.ActivityOptions setAppVerificationBundle(android.os.Bundle);
     method public android.app.ActivityOptions setLaunchBounds(android.graphics.Rect);
     method public android.app.ActivityOptions setLaunchDisplayId(int);
     method public android.os.Bundle toBundle();
@@ -4986,6 +4984,7 @@
     method public void onFragmentDetached(android.app.FragmentManager, android.app.Fragment);
     method public void onFragmentPaused(android.app.FragmentManager, android.app.Fragment);
     method public void onFragmentPreAttached(android.app.FragmentManager, android.app.Fragment, android.content.Context);
+    method public void onFragmentPreCreated(android.app.FragmentManager, android.app.Fragment, android.os.Bundle);
     method public void onFragmentResumed(android.app.FragmentManager, android.app.Fragment);
     method public void onFragmentSaveInstanceState(android.app.FragmentManager, android.app.Fragment, android.os.Bundle);
     method public void onFragmentStarted(android.app.FragmentManager, android.app.Fragment);
@@ -5018,11 +5017,10 @@
     method public abstract android.app.FragmentTransaction hide(android.app.Fragment);
     method public abstract boolean isAddToBackStackAllowed();
     method public abstract boolean isEmpty();
-    method public abstract android.app.FragmentTransaction postOnCommit(java.lang.Runnable);
     method public abstract android.app.FragmentTransaction remove(android.app.Fragment);
     method public abstract android.app.FragmentTransaction replace(int, android.app.Fragment);
     method public abstract android.app.FragmentTransaction replace(int, android.app.Fragment, java.lang.String);
-    method public abstract android.app.FragmentTransaction setAllowOptimization(boolean);
+    method public abstract android.app.FragmentTransaction runOnCommit(java.lang.Runnable);
     method public abstract android.app.FragmentTransaction setBreadCrumbShortTitle(int);
     method public abstract android.app.FragmentTransaction setBreadCrumbShortTitle(java.lang.CharSequence);
     method public abstract android.app.FragmentTransaction setBreadCrumbTitle(int);
@@ -5030,6 +5028,7 @@
     method public abstract android.app.FragmentTransaction setCustomAnimations(int, int);
     method public abstract android.app.FragmentTransaction setCustomAnimations(int, int, int, int);
     method public abstract android.app.FragmentTransaction setPrimaryNavigationFragment(android.app.Fragment);
+    method public abstract android.app.FragmentTransaction setReorderingAllowed(boolean);
     method public abstract android.app.FragmentTransaction setTransition(int);
     method public abstract android.app.FragmentTransaction setTransitionStyle(int);
     method public abstract android.app.FragmentTransaction show(android.app.Fragment);
@@ -5135,7 +5134,7 @@
     method public final android.app.Activity getLastActivity();
     method public final android.app.Instrumentation.ActivityResult getResult();
     method public final boolean isBlocking();
-    method public android.app.Instrumentation.ActivityResult onMatchIntent(android.content.Intent);
+    method public android.app.Instrumentation.ActivityResult onStartActivity(android.content.Intent);
     method public final android.app.Activity waitForActivity();
     method public final android.app.Activity waitForActivityWithTimeout(long);
   }
@@ -5155,7 +5154,7 @@
 
   public class KeyguardManager {
     method public android.content.Intent createConfirmDeviceCredentialIntent(java.lang.CharSequence, java.lang.CharSequence);
-    method public void dismissKeyguard(android.app.Activity, android.app.KeyguardManager.KeyguardDismissCallback, android.os.Handler);
+    method public deprecated void dismissKeyguard(android.app.Activity, android.app.KeyguardManager.KeyguardDismissCallback, android.os.Handler);
     method public deprecated void exitKeyguardSecurely(android.app.KeyguardManager.OnKeyguardExitResult);
     method public boolean inKeyguardRestrictedInputMode();
     method public boolean isDeviceLocked();
@@ -5163,6 +5162,7 @@
     method public boolean isKeyguardLocked();
     method public boolean isKeyguardSecure();
     method public deprecated android.app.KeyguardManager.KeyguardLock newKeyguardLock(java.lang.String);
+    method public void requestDismissKeyguard(android.app.Activity, android.app.KeyguardManager.KeyguardDismissCallback);
   }
 
   public static abstract class KeyguardManager.KeyguardDismissCallback {
@@ -6322,17 +6322,6 @@
     method public void setPersistentVrModeEnabled(boolean);
   }
 
-  public final class WallpaperColors implements android.os.Parcelable {
-    ctor public WallpaperColors(android.os.Parcel);
-    ctor public WallpaperColors(java.util.List<android.util.Pair<android.graphics.Color, java.lang.Integer>>);
-    ctor public WallpaperColors(java.util.List<android.util.Pair<android.graphics.Color, java.lang.Integer>>, boolean);
-    method public int describeContents();
-    method public java.util.List<android.util.Pair<android.graphics.Color, java.lang.Integer>> getColors();
-    method public boolean supportsDarkText();
-    method public void writeToParcel(android.os.Parcel, int);
-    field public static final android.os.Parcelable.Creator<android.app.WallpaperColors> CREATOR;
-  }
-
   public final class WallpaperInfo implements android.os.Parcelable {
     ctor public WallpaperInfo(android.content.Context, android.content.pm.ResolveInfo) throws java.io.IOException, org.xmlpull.v1.XmlPullParserException;
     method public int describeContents();
@@ -6355,8 +6344,6 @@
   }
 
   public class WallpaperManager {
-    method public void addOnColorsChangedListener(android.app.WallpaperManager.OnColorsChangedListener);
-    method public void addOnColorsChangedListener(android.app.WallpaperManager.OnColorsChangedListener, android.os.Handler);
     method public void clear() throws java.io.IOException;
     method public void clear(int) throws java.io.IOException;
     method public void clearWallpaper();
@@ -6373,7 +6360,6 @@
     method public android.graphics.drawable.Drawable getDrawable();
     method public android.graphics.drawable.Drawable getFastDrawable();
     method public static android.app.WallpaperManager getInstance(android.content.Context);
-    method public android.app.WallpaperColors getWallpaperColors(int);
     method public android.os.ParcelFileDescriptor getWallpaperFile(int);
     method public int getWallpaperId(int);
     method public android.app.WallpaperInfo getWallpaperInfo();
@@ -6382,7 +6368,6 @@
     method public boolean isWallpaperSupported();
     method public android.graphics.drawable.Drawable peekDrawable();
     method public android.graphics.drawable.Drawable peekFastDrawable();
-    method public void removeOnColorsChangedListener(android.app.WallpaperManager.OnColorsChangedListener);
     method public void sendWallpaperCommand(android.os.IBinder, java.lang.String, int, int, int, android.os.Bundle);
     method public void setBitmap(android.graphics.Bitmap) throws java.io.IOException;
     method public int setBitmap(android.graphics.Bitmap, android.graphics.Rect, boolean) throws java.io.IOException;
@@ -6410,16 +6395,12 @@
     field public static final java.lang.String WALLPAPER_PREVIEW_META_DATA = "android.wallpaper.preview";
   }
 
-  public static abstract interface WallpaperManager.OnColorsChangedListener {
-    method public abstract void onColorsChanged(android.app.WallpaperColors, int);
-  }
-
 }
 
 package android.app.admin {
 
   public final class ConnectEvent extends android.app.admin.NetworkEvent implements android.os.Parcelable {
-    method public java.lang.String getIpAddress();
+    method public java.net.InetAddress getInetAddress();
     method public int getPort();
     method public void writeToParcel(android.os.Parcel, int);
     field public static final android.os.Parcelable.Creator<android.app.admin.ConnectEvent> CREATOR;
@@ -6755,7 +6736,7 @@
     field public static final java.lang.String EXTRA_PROVISIONING_WIFI_PROXY_PORT = "android.app.extra.PROVISIONING_WIFI_PROXY_PORT";
     field public static final java.lang.String EXTRA_PROVISIONING_WIFI_SECURITY_TYPE = "android.app.extra.PROVISIONING_WIFI_SECURITY_TYPE";
     field public static final java.lang.String EXTRA_PROVISIONING_WIFI_SSID = "android.app.extra.PROVISIONING_WIFI_SSID";
-    field public static final int FLAG_EVICT_CE_KEY = 1; // 0x1
+    field public static final int FLAG_EVICT_CREDENTIAL_ENCRYPTION_KEY = 1; // 0x1
     field public static final int FLAG_MANAGED_CAN_ACCESS_PARENT = 2; // 0x2
     field public static final int FLAG_PARENT_CAN_ACCESS_MANAGED = 1; // 0x1
     field public static final int KEYGUARD_DISABLE_FEATURES_ALL = 2147483647; // 0x7fffffff
@@ -6798,8 +6779,8 @@
 
   public final class DnsEvent extends android.app.admin.NetworkEvent implements android.os.Parcelable {
     method public java.lang.String getHostname();
-    method public java.lang.String[] getIpAddresses();
-    method public int getIpAddressesCount();
+    method public java.util.List<java.net.InetAddress> getInetAddresses();
+    method public int getTotalResolvedAddressCount();
     method public void writeToParcel(android.os.Parcel, int);
     field public static final android.os.Parcelable.Creator<android.app.admin.DnsEvent> CREATOR;
   }
@@ -6970,7 +6951,6 @@
   public abstract class BackupAgent extends android.content.ContextWrapper {
     ctor public BackupAgent();
     method public final void fullBackupFile(java.io.File, android.app.backup.FullBackupDataOutput);
-    method public long getBackupQuota();
     method public abstract void onBackup(android.os.ParcelFileDescriptor, android.app.backup.BackupDataOutput, android.os.ParcelFileDescriptor) throws java.io.IOException;
     method public void onCreate();
     method public void onDestroy();
@@ -7007,6 +6987,8 @@
 
   public class BackupDataOutput {
     ctor public BackupDataOutput(java.io.FileDescriptor);
+    ctor public BackupDataOutput(java.io.FileDescriptor, long);
+    method public long getQuota();
     method public int writeEntityData(byte[], int) throws java.io.IOException;
     method public int writeEntityHeader(java.lang.String, int) throws java.io.IOException;
   }
@@ -7183,6 +7165,7 @@
   }
 
   public class FullBackupDataOutput {
+    method public long getQuota();
   }
 
   public class RestoreDescription implements android.os.Parcelable {
@@ -7478,8 +7461,8 @@
 
   public final class StorageStats implements android.os.Parcelable {
     method public int describeContents();
+    method public long getAppBytes();
     method public long getCacheBytes();
-    method public long getCodeBytes();
     method public long getDataBytes();
     method public void writeToParcel(android.os.Parcel, int);
     field public static final android.os.Parcelable.Creator<android.app.usage.StorageStats> CREATOR;
@@ -8521,7 +8504,7 @@
     method public void setAdvertisingData(android.bluetooth.le.AdvertiseData);
     method public void setAdvertisingParameters(android.bluetooth.le.AdvertisingSetParameters);
     method public void setPeriodicAdvertisingData(android.bluetooth.le.AdvertiseData);
-    method public void setPeriodicAdvertisingEnable(boolean);
+    method public void setPeriodicAdvertisingEnabled(boolean);
     method public void setPeriodicAdvertisingParameters(android.bluetooth.le.PeriodicAdvertisingParameters);
     method public void setScanResponseData(android.bluetooth.le.AdvertiseData);
   }
@@ -8709,8 +8692,10 @@
     field public static final android.os.Parcelable.Creator<android.bluetooth.le.ScanResult> CREATOR;
     field public static final int DATA_COMPLETE = 0; // 0x0
     field public static final int DATA_TRUNCATED = 2; // 0x2
+    field public static final int PERIODIC_INTERVAL_NOT_PRESENT = 0; // 0x0
     field public static final int PHY_UNUSED = 0; // 0x0
     field public static final int SID_NOT_PRESENT = 255; // 0xff
+    field public static final int TX_POWER_NOT_PRESENT = 127; // 0x7f
   }
 
   public final class ScanSettings implements android.os.Parcelable {
@@ -8790,21 +8775,21 @@
     method public android.companion.BluetoothDeviceFilter.Builder setNamePattern(java.util.regex.Pattern);
   }
 
-  public final class BluetoothLEDeviceFilter implements android.companion.DeviceFilter {
+  public final class BluetoothLeDeviceFilter implements android.companion.DeviceFilter {
     method public int describeContents();
     method public static int getRenamePrefixLengthLimit();
     method public void writeToParcel(android.os.Parcel, int);
-    field public static final android.os.Parcelable.Creator<android.companion.BluetoothLEDeviceFilter> CREATOR;
+    field public static final android.os.Parcelable.Creator<android.companion.BluetoothLeDeviceFilter> CREATOR;
   }
 
-  public static final class BluetoothLEDeviceFilter.Builder {
-    ctor public BluetoothLEDeviceFilter.Builder();
-    method public android.companion.BluetoothLEDeviceFilter build();
-    method public android.companion.BluetoothLEDeviceFilter.Builder setNamePattern(java.util.regex.Pattern);
-    method public android.companion.BluetoothLEDeviceFilter.Builder setRawDataFilter(byte[], byte[]);
-    method public android.companion.BluetoothLEDeviceFilter.Builder setRenameFromBytes(java.lang.String, java.lang.String, int, int, boolean);
-    method public android.companion.BluetoothLEDeviceFilter.Builder setRenameFromName(java.lang.String, java.lang.String, int, int);
-    method public android.companion.BluetoothLEDeviceFilter.Builder setScanFilter(android.bluetooth.le.ScanFilter);
+  public static final class BluetoothLeDeviceFilter.Builder {
+    ctor public BluetoothLeDeviceFilter.Builder();
+    method public android.companion.BluetoothLeDeviceFilter build();
+    method public android.companion.BluetoothLeDeviceFilter.Builder setNamePattern(java.util.regex.Pattern);
+    method public android.companion.BluetoothLeDeviceFilter.Builder setRawDataFilter(byte[], byte[]);
+    method public android.companion.BluetoothLeDeviceFilter.Builder setRenameFromBytes(java.lang.String, java.lang.String, int, int, java.nio.ByteOrder);
+    method public android.companion.BluetoothLeDeviceFilter.Builder setRenameFromName(java.lang.String, java.lang.String, int, int);
+    method public android.companion.BluetoothLeDeviceFilter.Builder setScanFilter(android.bluetooth.le.ScanFilter);
   }
 
   public final class CompanionDeviceManager {
@@ -8940,7 +8925,7 @@
     ctor public ClipData(android.content.ClipDescription, android.content.ClipData.Item);
     ctor public ClipData(android.content.ClipData);
     method public void addItem(android.content.ClipData.Item);
-    method public void addItem(android.content.ClipData.Item, android.content.ContentResolver);
+    method public void addItem(android.content.ContentResolver, android.content.ClipData.Item);
     method public int describeContents();
     method public android.content.ClipDescription getDescription();
     method public android.content.ClipData.Item getItemAt(int);
@@ -9895,6 +9880,7 @@
     field public static final java.lang.String ACTION_FACTORY_TEST = "android.intent.action.FACTORY_TEST";
     field public static final java.lang.String ACTION_GET_CONTENT = "android.intent.action.GET_CONTENT";
     field public static final java.lang.String ACTION_GET_RESTRICTION_ENTRIES = "android.intent.action.GET_RESTRICTION_ENTRIES";
+    field public static final java.lang.String ACTION_GLOBAL_BUTTON = "android.intent.action.GLOBAL_BUTTON";
     field public static final java.lang.String ACTION_GTALK_SERVICE_CONNECTED = "android.intent.action.GTALK_CONNECTED";
     field public static final java.lang.String ACTION_GTALK_SERVICE_DISCONNECTED = "android.intent.action.GTALK_DISCONNECTED";
     field public static final java.lang.String ACTION_HEADSET_PLUG = "android.intent.action.HEADSET_PLUG";
@@ -10061,6 +10047,7 @@
     field public static final java.lang.String EXTRA_CHOOSER_TARGETS = "android.intent.extra.CHOOSER_TARGETS";
     field public static final java.lang.String EXTRA_CHOSEN_COMPONENT = "android.intent.extra.CHOSEN_COMPONENT";
     field public static final java.lang.String EXTRA_CHOSEN_COMPONENT_INTENT_SENDER = "android.intent.extra.CHOSEN_COMPONENT_INTENT_SENDER";
+    field public static final java.lang.String EXTRA_COMPONENT_NAME = "android.intent.extra.COMPONENT_NAME";
     field public static final java.lang.String EXTRA_CONTENT_ANNOTATIONS = "android.intent.extra.CONTENT_ANNOTATIONS";
     field public static final deprecated java.lang.String EXTRA_CSS_INDICATOR = "cssIndicator";
     field public static final deprecated java.lang.String EXTRA_DATA_OPERATOR_ALPHA_LONG = "data-operator-alpha-long";
@@ -10995,7 +10982,7 @@
     field public java.lang.String[] splitPublicSourceDirs;
     field public java.lang.String[] splitSourceDirs;
     field public java.lang.String targetPackage;
-    field public java.lang.String targetProcess;
+    field public java.lang.String targetProcesses;
   }
 
   public final class IntentFilterVerificationInfo implements android.os.Parcelable {
@@ -14079,7 +14066,7 @@
     method public void setFilterBitmap(boolean);
     method public void setFlags(int);
     method public void setFontFeatureSettings(java.lang.String);
-    method public boolean setFontVariationSettings(java.lang.String) throws android.graphics.fonts.FontVariationAxis.InvalidFormatException;
+    method public boolean setFontVariationSettings(java.lang.String);
     method public void setHinting(int);
     method public void setLetterSpacing(float);
     method public void setLinearText(boolean);
@@ -14555,6 +14542,7 @@
     method public void detachFromGLContext();
     method public long getTimestamp();
     method public void getTransformMatrix(float[]);
+    method public boolean isReleased();
     method public void release();
     method public void releaseTexImage();
     method public void setDefaultBufferSize(int, int);
@@ -14605,7 +14593,7 @@
     ctor public Typeface.Builder(android.content.res.AssetManager, java.lang.String);
     method public android.graphics.Typeface build();
     method public android.graphics.Typeface.Builder setFallback(java.lang.String);
-    method public android.graphics.Typeface.Builder setFontVariationSettings(java.lang.String) throws android.graphics.fonts.FontVariationAxis.InvalidFormatException;
+    method public android.graphics.Typeface.Builder setFontVariationSettings(java.lang.String);
     method public android.graphics.Typeface.Builder setFontVariationSettings(android.graphics.fonts.FontVariationAxis[]);
     method public android.graphics.Typeface.Builder setItalic(boolean);
     method public android.graphics.Typeface.Builder setTtcIndex(int);
@@ -15189,17 +15177,13 @@
 package android.graphics.fonts {
 
   public final class FontVariationAxis {
-    ctor public FontVariationAxis(java.lang.String, float) throws android.graphics.fonts.FontVariationAxis.InvalidFormatException;
-    method public static android.graphics.fonts.FontVariationAxis[] fromFontVariationSettings(java.lang.String) throws android.graphics.fonts.FontVariationAxis.InvalidFormatException;
+    ctor public FontVariationAxis(java.lang.String, float);
+    method public static android.graphics.fonts.FontVariationAxis[] fromFontVariationSettings(java.lang.String);
     method public float getStyleValue();
     method public java.lang.String getTag();
     method public static java.lang.String toFontVariationSettings(android.graphics.fonts.FontVariationAxis[]);
   }
 
-  public static class FontVariationAxis.InvalidFormatException extends java.lang.Exception {
-    ctor public FontVariationAxis.InvalidFormatException(java.lang.String);
-  }
-
 }
 
 package android.graphics.pdf {
@@ -15287,7 +15271,7 @@
     method public final void takePicture(android.hardware.Camera.ShutterCallback, android.hardware.Camera.PictureCallback, android.hardware.Camera.PictureCallback, android.hardware.Camera.PictureCallback);
     method public final void unlock();
     field public static final java.lang.String ACTION_NEW_PICTURE = "android.hardware.action.NEW_PICTURE";
-    field public static final deprecated java.lang.String ACTION_NEW_VIDEO = "android.hardware.action.NEW_VIDEO";
+    field public static final java.lang.String ACTION_NEW_VIDEO = "android.hardware.action.NEW_VIDEO";
     field public static final int CAMERA_ERROR_EVICTED = 2; // 0x2
     field public static final int CAMERA_ERROR_SERVER_DIED = 100; // 0x64
     field public static final int CAMERA_ERROR_UNKNOWN = 1; // 0x1
@@ -15548,18 +15532,16 @@
     field public static final int RGBX_8888 = 2; // 0x2
     field public static final int RGB_565 = 4; // 0x4
     field public static final int RGB_888 = 3; // 0x3
-    field public static final long USAGE0_CPU_READ = 2L; // 0x2L
-    field public static final long USAGE0_CPU_READ_OFTEN = 6L; // 0x6L
-    field public static final long USAGE0_CPU_WRITE = 32L; // 0x20L
-    field public static final long USAGE0_CPU_WRITE_OFTEN = 96L; // 0x60L
-    field public static final long USAGE0_GPU_COLOR_OUTPUT = 2048L; // 0x800L
-    field public static final long USAGE0_GPU_CUBEMAP = 8192L; // 0x2000L
-    field public static final long USAGE0_GPU_DATA_BUFFER = 16384L; // 0x4000L
-    field public static final long USAGE0_GPU_SAMPLED_IMAGE = 1024L; // 0x400L
-    field public static final long USAGE0_GPU_STORAGE_IMAGE = 3072L; // 0xc00L
-    field public static final long USAGE0_PROTECTED_CONTENT = 262144L; // 0x40000L
-    field public static final long USAGE0_SENSOR_DIRECT_DATA = 536870912L; // 0x20000000L
-    field public static final long USAGE0_VIDEO_ENCODE = 2097152L; // 0x200000L
+    field public static final long USAGE_CPU_READ_OFTEN = 3L; // 0x3L
+    field public static final long USAGE_CPU_READ_RARELY = 2L; // 0x2L
+    field public static final long USAGE_CPU_WRITE_OFTEN = 48L; // 0x30L
+    field public static final long USAGE_CPU_WRITE_RARELY = 32L; // 0x20L
+    field public static final long USAGE_GPU_COLOR_OUTPUT = 512L; // 0x200L
+    field public static final long USAGE_GPU_DATA_BUFFER = 16777216L; // 0x1000000L
+    field public static final long USAGE_GPU_SAMPLED_IMAGE = 256L; // 0x100L
+    field public static final long USAGE_PROTECTED_CONTENT = 16384L; // 0x4000L
+    field public static final long USAGE_SENSOR_DIRECT_DATA = 8388608L; // 0x800000L
+    field public static final long USAGE_VIDEO_ENCODE = 65536L; // 0x10000L
   }
 
   public final class Sensor {
@@ -27288,6 +27270,7 @@
     method public java.lang.Object getTaggedData(int);
     method public long getTimestamp();
     method public int getType();
+    method public int getUid();
     method public boolean isLongCounterBucket();
     method public boolean isSubsetOf(android.metrics.LogMaker);
     method public boolean isValidValue(java.lang.Object);
@@ -27594,8 +27577,8 @@
     method public boolean requestBandwidthUpdate(android.net.Network);
     method public void requestNetwork(android.net.NetworkRequest, android.net.ConnectivityManager.NetworkCallback);
     method public void requestNetwork(android.net.NetworkRequest, android.net.ConnectivityManager.NetworkCallback, android.os.Handler);
-    method public void requestNetwork(android.net.NetworkRequest, int, android.net.ConnectivityManager.NetworkCallback);
-    method public void requestNetwork(android.net.NetworkRequest, int, android.net.ConnectivityManager.NetworkCallback, android.os.Handler);
+    method public void requestNetwork(android.net.NetworkRequest, android.net.ConnectivityManager.NetworkCallback, int);
+    method public void requestNetwork(android.net.NetworkRequest, android.net.ConnectivityManager.NetworkCallback, android.os.Handler, int);
     method public void requestNetwork(android.net.NetworkRequest, android.app.PendingIntent);
     method public deprecated void setNetworkPreference(int);
     method public static deprecated boolean setProcessDefaultNetwork(android.net.Network);
@@ -33454,7 +33437,6 @@
     method public android.util.SizeF getSizeF(java.lang.String);
     method public <T extends android.os.Parcelable> android.util.SparseArray<T> getSparseParcelableArray(java.lang.String);
     method public java.util.ArrayList<java.lang.String> getStringArrayList(java.lang.String);
-    method public java.util.UUID getUuid(java.lang.String);
     method public boolean hasFileDescriptors();
     method public void putAll(android.os.Bundle);
     method public void putBinder(java.lang.String, android.os.IBinder);
@@ -33479,7 +33461,6 @@
     method public void putSizeF(java.lang.String, android.util.SizeF);
     method public void putSparseParcelableArray(java.lang.String, android.util.SparseArray<? extends android.os.Parcelable>);
     method public void putStringArrayList(java.lang.String, java.util.ArrayList<java.lang.String>);
-    method public void putUuid(java.lang.String, java.util.UUID);
     method public void readFromParcel(android.os.Parcel);
     method public void setClassLoader(java.lang.ClassLoader);
     method public void writeToParcel(android.os.Parcel, int);
@@ -34041,7 +34022,6 @@
     method public final <T> void readTypedArray(T[], android.os.Parcelable.Creator<T>);
     method public final <T> void readTypedList(java.util.List<T>, android.os.Parcelable.Creator<T>);
     method public final <T> T readTypedObject(android.os.Parcelable.Creator<T>);
-    method public final java.util.UUID readUuid();
     method public final java.lang.Object readValue(java.lang.ClassLoader);
     method public final void recycle();
     method public final void setDataCapacity(int);
@@ -34087,7 +34067,6 @@
     method public final <T extends android.os.Parcelable> void writeTypedArray(T[], int);
     method public final <T extends android.os.Parcelable> void writeTypedList(java.util.List<T>);
     method public final <T extends android.os.Parcelable> void writeTypedObject(T, int);
-    method public final void writeUuid(java.util.UUID);
     method public final void writeValue(java.lang.Object);
     field public static final android.os.Parcelable.Creator<java.lang.String> STRING_CREATOR;
   }
@@ -34580,6 +34559,7 @@
     field public static final java.lang.String DISALLOW_APPS_CONTROL = "no_control_apps";
     field public static final java.lang.String DISALLOW_AUTOFILL = "no_autofill";
     field public static final java.lang.String DISALLOW_BLUETOOTH = "no_bluetooth";
+    field public static final java.lang.String DISALLOW_BLUETOOTH_SHARING = "no_bluetooth_sharing";
     field public static final java.lang.String DISALLOW_CONFIG_BLUETOOTH = "no_config_bluetooth";
     field public static final java.lang.String DISALLOW_CONFIG_CELL_BROADCASTS = "no_config_cell_broadcasts";
     field public static final java.lang.String DISALLOW_CONFIG_CREDENTIALS = "no_config_credentials";
@@ -34824,8 +34804,11 @@
   }
 
   public class StorageManager {
+    method public void allocateBytes(java.util.UUID, long) throws java.io.IOException;
     method public void allocateBytes(java.util.UUID, long, int) throws java.io.IOException;
+    method public void allocateBytes(java.io.FileDescriptor, long) throws java.io.IOException;
     method public void allocateBytes(java.io.FileDescriptor, long, int) throws java.io.IOException;
+    method public long getAllocatableBytes(java.util.UUID) throws java.io.IOException;
     method public long getAllocatableBytes(java.util.UUID, int) throws java.io.IOException;
     method public long getCacheQuotaBytes(java.util.UUID) throws java.io.IOException;
     method public long getCacheSizeBytes(java.util.UUID) throws java.io.IOException;
@@ -34839,7 +34822,6 @@
     method public boolean isEncrypted(java.io.File);
     method public boolean isObbMounted(java.lang.String);
     method public boolean mountObb(java.lang.String, java.lang.String, android.os.storage.OnObbStateChangeListener);
-    method public android.os.ParcelFileDescriptor openProxyFileDescriptor(int, android.os.ProxyFileDescriptorCallback) throws java.io.IOException;
     method public android.os.ParcelFileDescriptor openProxyFileDescriptor(int, android.os.ProxyFileDescriptorCallback, android.os.Handler) throws java.io.IOException;
     method public void setCacheBehaviorGroup(java.io.File, boolean) throws java.io.IOException;
     method public void setCacheBehaviorTombstone(java.io.File, boolean) throws java.io.IOException;
@@ -37430,7 +37412,6 @@
   }
 
   public class FontsContract {
-    method public static android.graphics.Typeface buildTypeface(android.content.Context, android.os.CancellationSignal, android.provider.FontsContract.FontInfo[], int, boolean, java.lang.String);
     method public static android.graphics.Typeface buildTypeface(android.content.Context, android.os.CancellationSignal, android.provider.FontsContract.FontInfo[]);
     method public static android.provider.FontsContract.FontFamilyResult fetchFonts(android.content.Context, android.os.CancellationSignal, android.provider.FontRequest) throws android.content.pm.PackageManager.NameNotFoundException;
     method public static void requestFonts(android.content.Context, android.provider.FontRequest, android.os.Handler, android.os.CancellationSignal, android.provider.FontsContract.FontRequestCallback);
@@ -40697,7 +40678,6 @@
     method public final void unlockAndRun(java.lang.Runnable);
     field public static final java.lang.String ACTION_QS_TILE = "android.service.quicksettings.action.QS_TILE";
     field public static final java.lang.String ACTION_QS_TILE_PREFERENCES = "android.service.quicksettings.action.QS_TILE_PREFERENCES";
-    field public static final java.lang.String EXTRA_COMPONENT = "android.service.quicksettings.extra.COMPONENT";
     field public static final java.lang.String META_DATA_ACTIVE_TILE = "android.service.quicksettings.ACTIVE_TILE";
   }
 
@@ -40990,12 +40970,10 @@
     method public int getDesiredMinimumHeight();
     method public int getDesiredMinimumWidth();
     method public android.view.SurfaceHolder getSurfaceHolder();
-    method public void invalidateColors();
     method public boolean isPreview();
     method public boolean isVisible();
     method public void onApplyWindowInsets(android.view.WindowInsets);
     method public android.os.Bundle onCommand(java.lang.String, int, int, int, android.os.Bundle, boolean);
-    method public android.app.WallpaperColors onComputeWallpaperColors();
     method public void onCreate(android.view.SurfaceHolder);
     method public void onDesiredSizeChanged(int, int);
     method public void onDestroy();
@@ -46762,6 +46740,7 @@
     method public int getTag();
     method public int getThreadId();
     method public long getTimeNanos();
+    method public int getUid();
   }
 
   public deprecated class EventLogTags {
@@ -49195,7 +49174,6 @@
     method public boolean onKeyUp(int, android.view.KeyEvent);
     method protected void onLayout(boolean, int, int, int, int);
     method protected void onMeasure(int, int);
-    method public void onMovedToDisplay(int, android.content.res.Configuration);
     method protected void onOverScrolled(int, int, boolean, boolean);
     method public void onPointerCaptureChange(boolean);
     method public void onPopulateAccessibilityEvent(android.view.accessibility.AccessibilityEvent);
@@ -49415,6 +49393,7 @@
     field public static final int ACCESSIBILITY_LIVE_REGION_NONE = 0; // 0x0
     field public static final int ACCESSIBILITY_LIVE_REGION_POLITE = 1; // 0x1
     field public static final android.util.Property<android.view.View, java.lang.Float> ALPHA;
+    field public static final int AUTOFILL_FLAG_INCLUDE_NOT_IMPORTANT_VIEWS = 1; // 0x1
     field public static final java.lang.String AUTOFILL_HINT_CREDIT_CARD_EXPIRATION_DATE = "creditCardExpirationDate";
     field public static final java.lang.String AUTOFILL_HINT_CREDIT_CARD_EXPIRATION_DAY = "creditCardExpirationDay";
     field public static final java.lang.String AUTOFILL_HINT_CREDIT_CARD_EXPIRATION_MONTH = "creditCardExpirationMonth";
@@ -50126,7 +50105,7 @@
 
   public static abstract class ViewStructure.HtmlInfo {
     ctor public ViewStructure.HtmlInfo();
-    method public abstract java.util.ArrayList<android.util.Pair<java.lang.String, java.lang.String>> getAttributes();
+    method public abstract java.util.List<android.util.Pair<java.lang.String, java.lang.String>> getAttributes();
     method public abstract java.lang.String getTag();
   }
 
@@ -50841,8 +50820,8 @@
     field public static final java.lang.String ACTION_ARGUMENT_EXTEND_SELECTION_BOOLEAN = "ACTION_ARGUMENT_EXTEND_SELECTION_BOOLEAN";
     field public static final java.lang.String ACTION_ARGUMENT_HTML_ELEMENT_STRING = "ACTION_ARGUMENT_HTML_ELEMENT_STRING";
     field public static final java.lang.String ACTION_ARGUMENT_MOVEMENT_GRANULARITY_INT = "ACTION_ARGUMENT_MOVEMENT_GRANULARITY_INT";
-    field public static final java.lang.String ACTION_ARGUMENT_MOVE_WINDOW_X = "android.view.accessibility.action.ARGUMENT_MOVE_WINDOW_X";
-    field public static final java.lang.String ACTION_ARGUMENT_MOVE_WINDOW_Y = "android.view.accessibility.action.ARGUMENT_MOVE_WINDOW_Y";
+    field public static final java.lang.String ACTION_ARGUMENT_MOVE_WINDOW_X = "ACTION_ARGUMENT_MOVE_WINDOW_X";
+    field public static final java.lang.String ACTION_ARGUMENT_MOVE_WINDOW_Y = "ACTION_ARGUMENT_MOVE_WINDOW_Y";
     field public static final java.lang.String ACTION_ARGUMENT_PROGRESS_VALUE = "android.view.accessibility.action.ARGUMENT_PROGRESS_VALUE";
     field public static final java.lang.String ACTION_ARGUMENT_ROW_INT = "android.view.accessibility.action.ARGUMENT_ROW_INT";
     field public static final java.lang.String ACTION_ARGUMENT_SELECTION_END_INT = "ACTION_ARGUMENT_SELECTION_END_INT";
@@ -51024,10 +51003,10 @@
     method public android.view.accessibility.AccessibilityNodeInfo getRoot();
     method public java.lang.CharSequence getTitle();
     method public int getType();
-    method public boolean inPictureInPicture();
     method public boolean isAccessibilityFocused();
     method public boolean isActive();
     method public boolean isFocused();
+    method public boolean isInPictureInPictureMode();
     method public static android.view.accessibility.AccessibilityWindowInfo obtain();
     method public static android.view.accessibility.AccessibilityWindowInfo obtain(android.view.accessibility.AccessibilityWindowInfo);
     method public void recycle();
@@ -51385,7 +51364,7 @@
     method public void unregisterCallback(android.view.autofill.AutofillManager.AutofillCallback);
     field public static final java.lang.String EXTRA_ASSIST_STRUCTURE = "android.view.autofill.extra.ASSIST_STRUCTURE";
     field public static final java.lang.String EXTRA_AUTHENTICATION_RESULT = "android.view.autofill.extra.AUTHENTICATION_RESULT";
-    field public static final java.lang.String EXTRA_DATA_EXTRAS = "android.view.autofill.extra.DATA_EXTRAS";
+    field public static final java.lang.String EXTRA_CLIENT_STATE = "android.view.autofill.extra.EXTRA_CLIENT_STATE";
   }
 
   public static abstract class AutofillManager.AutofillCallback {
@@ -52619,7 +52598,6 @@
     method public int getRendererRequestedPriority();
     method public deprecated float getScale();
     method public android.webkit.WebSettings getSettings();
-    method public android.view.textclassifier.TextClassifier getTextClassifier();
     method public java.lang.String getTitle();
     method public java.lang.String getUrl();
     method public android.webkit.WebChromeClient getWebChromeClient();
@@ -52667,7 +52645,6 @@
     method public void setNetworkAvailable(boolean);
     method public deprecated void setPictureListener(android.webkit.WebView.PictureListener);
     method public void setRendererPriorityPolicy(int, boolean);
-    method public void setTextClassifier(android.view.textclassifier.TextClassifier);
     method public deprecated void setVerticalScrollbarOverlay(boolean);
     method public void setWebChromeClient(android.webkit.WebChromeClient);
     method public static void setWebContentsDebuggingEnabled(boolean);
@@ -55398,7 +55375,7 @@
     method public void setExtractedText(android.view.inputmethod.ExtractedText);
     method public void setFilters(android.text.InputFilter[]);
     method public void setFontFeatureSettings(java.lang.String);
-    method public boolean setFontVariationSettings(java.lang.String) throws android.graphics.fonts.FontVariationAxis.InvalidFormatException;
+    method public boolean setFontVariationSettings(java.lang.String);
     method protected boolean setFrame(int, int, int, int);
     method public void setFreezesText(boolean);
     method public void setGravity(int);
diff --git a/api/system-removed.txt b/api/system-removed.txt
index 2ef8690..fe51248 100644
--- a/api/system-removed.txt
+++ b/api/system-removed.txt
@@ -16,12 +16,17 @@
     method public deprecated android.os.UserHandle createAndInitializeUser(android.content.ComponentName, java.lang.String, java.lang.String, android.content.ComponentName, android.os.Bundle);
     method public deprecated android.os.UserHandle createUser(android.content.ComponentName, java.lang.String);
     method public void setAffiliationIds(android.content.ComponentName, java.util.List<java.lang.String>);
+    field public static final deprecated int FLAG_EVICT_CE_KEY = 1; // 0x1
   }
 
 }
 
 package android.app.usage {
 
+  public final class StorageStats implements android.os.Parcelable {
+    method public deprecated long getCodeBytes();
+  }
+
   public class StorageStatsManager {
     method public deprecated long getFreeBytes(java.lang.String) throws java.io.IOException;
     method public deprecated long getTotalBytes(java.lang.String) throws java.io.IOException;
@@ -36,6 +41,10 @@
 
 package android.content {
 
+  public class ClipData implements android.os.Parcelable {
+    method public deprecated void addItem(android.content.ClipData.Item, android.content.ContentResolver);
+  }
+
   public abstract class Context {
     method public abstract android.content.SharedPreferences getSharedPreferences(java.io.File, int);
     method public abstract java.io.File getSharedPreferencesPath(java.lang.String);
@@ -437,6 +446,14 @@
 
 }
 
+package android.view.accessibility {
+
+  public final class AccessibilityWindowInfo implements android.os.Parcelable {
+    method public boolean inPictureInPicture();
+  }
+
+}
+
 package android.webkit {
 
   public class WebViewClient {
diff --git a/api/test-current.txt b/api/test-current.txt
index 53c932d..c39e490 100644
--- a/api/test-current.txt
+++ b/api/test-current.txt
@@ -15,7 +15,6 @@
     field public static final java.lang.String ACCESS_WIFI_STATE = "android.permission.ACCESS_WIFI_STATE";
     field public static final java.lang.String ACCOUNT_MANAGER = "android.permission.ACCOUNT_MANAGER";
     field public static final java.lang.String ADD_VOICEMAIL = "com.android.voicemail.permission.ADD_VOICEMAIL";
-    field public static final java.lang.String ALLOCATE_AGGRESSIVE = "android.permission.ALLOCATE_AGGRESSIVE";
     field public static final java.lang.String ANSWER_PHONE_CALLS = "android.permission.ANSWER_PHONE_CALLS";
     field public static final java.lang.String BATTERY_STATS = "android.permission.BATTERY_STATS";
     field public static final java.lang.String BIND_ACCESSIBILITY_SERVICE = "android.permission.BIND_ACCESSIBILITY_SERVICE";
@@ -116,12 +115,13 @@
     field public static final java.lang.String RECEIVE_WAP_PUSH = "android.permission.RECEIVE_WAP_PUSH";
     field public static final java.lang.String RECORD_AUDIO = "android.permission.RECORD_AUDIO";
     field public static final java.lang.String REORDER_TASKS = "android.permission.REORDER_TASKS";
+    field public static final java.lang.String REQUEST_COMPANION_RUN_IN_BACKGROUND = "android.permission.REQUEST_COMPANION_RUN_IN_BACKGROUND";
+    field public static final java.lang.String REQUEST_COMPANION_USE_DATA_IN_BACKGROUND = "android.permission.REQUEST_COMPANION_USE_DATA_IN_BACKGROUND";
     field public static final java.lang.String REQUEST_DELETE_PACKAGES = "android.permission.REQUEST_DELETE_PACKAGES";
     field public static final java.lang.String REQUEST_IGNORE_BATTERY_OPTIMIZATIONS = "android.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS";
     field public static final java.lang.String REQUEST_INSTALL_PACKAGES = "android.permission.REQUEST_INSTALL_PACKAGES";
     field public static final deprecated java.lang.String RESTART_PACKAGES = "android.permission.RESTART_PACKAGES";
     field public static final java.lang.String RESTRICTED_VR_ACCESS = "android.permission.RESTRICTED_VR_ACCESS";
-    field public static final java.lang.String RUN_IN_BACKGROUND = "android.permission.RUN_IN_BACKGROUND";
     field public static final java.lang.String SEND_RESPOND_VIA_MESSAGE = "android.permission.SEND_RESPOND_VIA_MESSAGE";
     field public static final java.lang.String SEND_SMS = "android.permission.SEND_SMS";
     field public static final java.lang.String SET_ALARM = "com.android.alarm.permission.SET_ALARM";
@@ -140,7 +140,6 @@
     field public static final java.lang.String TRANSMIT_IR = "android.permission.TRANSMIT_IR";
     field public static final java.lang.String UNINSTALL_SHORTCUT = "com.android.launcher.permission.UNINSTALL_SHORTCUT";
     field public static final java.lang.String UPDATE_DEVICE_STATS = "android.permission.UPDATE_DEVICE_STATS";
-    field public static final java.lang.String USE_DATA_IN_BACKGROUND = "android.permission.USE_DATA_IN_BACKGROUND";
     field public static final java.lang.String USE_FINGERPRINT = "android.permission.USE_FINGERPRINT";
     field public static final java.lang.String USE_SIP = "android.permission.USE_SIP";
     field public static final java.lang.String VIBRATE = "android.permission.VIBRATE";
@@ -313,6 +312,7 @@
     field public static final int autoUrlDetect = 16843404; // 0x101028c
     field public static final int autoVerify = 16844014; // 0x10104ee
     field public static final int autofillHints = 16844121; // 0x1010559
+    field public static final int autofilledHighlight = 16844139; // 0x101056b
     field public static final int background = 16842964; // 0x10100d4
     field public static final int backgroundDimAmount = 16842802; // 0x1010032
     field public static final int backgroundDimEnabled = 16843295; // 0x101021f
@@ -357,12 +357,12 @@
     field public static final int calendarTextColor = 16843931; // 0x101049b
     field public static final int calendarViewShown = 16843596; // 0x101034c
     field public static final int calendarViewStyle = 16843613; // 0x101035d
-    field public static final int canCaptureFingerprintGestures = 16844111; // 0x101054f
     field public static final int canControlMagnification = 16844039; // 0x1010507
     field public static final int canPerformGestures = 16844045; // 0x101050d
     field public static final int canRecord = 16844060; // 0x101051c
     field public static final deprecated int canRequestEnhancedWebAccessibility = 16843736; // 0x10103d8
     field public static final int canRequestFilterKeyEvents = 16843737; // 0x10103d9
+    field public static final int canRequestFingerprintGestures = 16844111; // 0x101054f
     field public static final int canRequestTouchExplorationMode = 16843735; // 0x10103d7
     field public static final int canRetrieveWindowContent = 16843653; // 0x1010385
     field public static final int candidatesTextStyleSpans = 16843312; // 0x1010230
@@ -1297,7 +1297,7 @@
     field public static final int targetId = 16843740; // 0x10103dc
     field public static final int targetName = 16843853; // 0x101044d
     field public static final int targetPackage = 16842785; // 0x1010021
-    field public static final int targetProcess = 16844097; // 0x1010541
+    field public static final int targetProcesses = 16844097; // 0x1010541
     field public static final int targetSandboxVersion = 16844110; // 0x101054e
     field public static final int targetSdkVersion = 16843376; // 0x1010270
     field public static final int taskAffinity = 16842770; // 0x1010012
@@ -1612,7 +1612,6 @@
     field public static final int alert_light_frame = 17301505; // 0x1080001
     field public static final int arrow_down_float = 17301506; // 0x1080002
     field public static final int arrow_up_float = 17301507; // 0x1080003
-    field public static final int autofilled_highlight = 17301684; // 0x10800b4
     field public static final int bottom_bar = 17301658; // 0x108009a
     field public static final int btn_default = 17301508; // 0x1080004
     field public static final int btn_default_small = 17301509; // 0x1080005
@@ -2833,11 +2832,11 @@
     method public java.lang.String loadDescription(android.content.pm.PackageManager);
     method public java.lang.String loadSummary(android.content.pm.PackageManager);
     method public void writeToParcel(android.os.Parcel, int);
-    field public static final int CAPABILITY_CAN_CAPTURE_FINGERPRINT_GESTURES = 64; // 0x40
     field public static final int CAPABILITY_CAN_CONTROL_MAGNIFICATION = 16; // 0x10
     field public static final int CAPABILITY_CAN_PERFORM_GESTURES = 32; // 0x20
     field public static final deprecated int CAPABILITY_CAN_REQUEST_ENHANCED_WEB_ACCESSIBILITY = 4; // 0x4
     field public static final int CAPABILITY_CAN_REQUEST_FILTER_KEY_EVENTS = 8; // 0x8
+    field public static final int CAPABILITY_CAN_REQUEST_FINGERPRINT_GESTURES = 64; // 0x40
     field public static final int CAPABILITY_CAN_REQUEST_TOUCH_EXPLORATION = 2; // 0x2
     field public static final int CAPABILITY_CAN_RETRIEVE_WINDOW_CONTENT = 1; // 0x1
     field public static final android.os.Parcelable.Creator<android.accessibilityservice.AccessibilityServiceInfo> CREATOR;
@@ -2849,13 +2848,13 @@
     field public static final int FEEDBACK_HAPTIC = 2; // 0x2
     field public static final int FEEDBACK_SPOKEN = 1; // 0x1
     field public static final int FEEDBACK_VISUAL = 8; // 0x8
-    field public static final int FLAG_CAPTURE_FINGERPRINT_GESTURES = 512; // 0x200
     field public static final int FLAG_ENABLE_ACCESSIBILITY_VOLUME = 128; // 0x80
     field public static final int FLAG_INCLUDE_NOT_IMPORTANT_VIEWS = 2; // 0x2
     field public static final int FLAG_REPORT_VIEW_IDS = 16; // 0x10
     field public static final int FLAG_REQUEST_ACCESSIBILITY_BUTTON = 256; // 0x100
     field public static final deprecated int FLAG_REQUEST_ENHANCED_WEB_ACCESSIBILITY = 8; // 0x8
     field public static final int FLAG_REQUEST_FILTER_KEY_EVENTS = 32; // 0x20
+    field public static final int FLAG_REQUEST_FINGERPRINT_GESTURES = 512; // 0x200
     field public static final int FLAG_REQUEST_TOUCH_EXPLORATION_MODE = 4; // 0x4
     field public static final int FLAG_RETRIEVE_INTERACTIVE_WINDOWS = 64; // 0x40
     field public int eventTypes;
@@ -2877,7 +2876,7 @@
 
   public static abstract class FingerprintGestureController.FingerprintGestureCallback {
     ctor public FingerprintGestureController.FingerprintGestureCallback();
-    method public void onGesture(int);
+    method public void onGestureDetected(int);
     method public void onGestureDetectionAvailabilityChanged(boolean);
   }
 
@@ -2896,14 +2895,12 @@
 
   public static class GestureDescription.StrokeDescription {
     ctor public GestureDescription.StrokeDescription(android.graphics.Path, long, long);
-    ctor public GestureDescription.StrokeDescription(android.graphics.Path, long, long, int, boolean);
-    method public int getContinuedStrokeId();
+    ctor public GestureDescription.StrokeDescription(android.graphics.Path, long, long, boolean);
+    method public android.accessibilityservice.GestureDescription.StrokeDescription continueStroke(android.graphics.Path, long, long, boolean);
     method public long getDuration();
-    method public int getId();
     method public android.graphics.Path getPath();
     method public long getStartTime();
-    method public boolean isContinued();
-    field public static final int INVALID_STROKE_ID = -1; // 0xffffffff
+    method public boolean willContinue();
   }
 
 }
@@ -3035,8 +3032,8 @@
     field public static final java.lang.String KEY_PASSWORD = "password";
     field public static final java.lang.String KEY_USERDATA = "userdata";
     field public static final deprecated java.lang.String LOGIN_ACCOUNTS_CHANGED_ACTION = "android.accounts.LOGIN_ACCOUNTS_CHANGED";
-    field public static final java.lang.String PACKAGE_NAME_KEY_LEGACY_NOT_VISIBLE = "android.accounts.key_legacy_not_visible";
-    field public static final java.lang.String PACKAGE_NAME_KEY_LEGACY_VISIBLE = "android.accounts.key_legacy_visible";
+    field public static final java.lang.String PACKAGE_NAME_KEY_LEGACY_NOT_VISIBLE = "android:accounts:key_legacy_not_visible";
+    field public static final java.lang.String PACKAGE_NAME_KEY_LEGACY_VISIBLE = "android:accounts:key_legacy_visible";
     field public static final int VISIBILITY_NOT_VISIBLE = 3; // 0x3
     field public static final int VISIBILITY_UNDEFINED = 0; // 0x0
     field public static final int VISIBILITY_USER_MANAGED_NOT_VISIBLE = 4; // 0x4
@@ -3684,7 +3681,6 @@
     method public void onLowMemory();
     method public boolean onMenuItemSelected(int, android.view.MenuItem);
     method public boolean onMenuOpened(int, android.view.Menu);
-    method public void onMovedToDisplay(int, android.content.res.Configuration);
     method public void onMultiWindowModeChanged(boolean, android.content.res.Configuration);
     method public deprecated void onMultiWindowModeChanged(boolean);
     method public boolean onNavigateUp();
@@ -3954,7 +3950,7 @@
     field public static final int IMPORTANCE_FOREGROUND_SERVICE = 125; // 0x7d
     field public static final int IMPORTANCE_GONE = 1000; // 0x3e8
     field public static final int IMPORTANCE_PERCEPTIBLE = 230; // 0xe6
-    field public static final deprecated int IMPORTANCE_PERCEPTIBLE_DEPRECATED = 130; // 0x82
+    field public static final int IMPORTANCE_PERCEPTIBLE_PRE_26 = 130; // 0x82
     field public static final int IMPORTANCE_SERVICE = 300; // 0x12c
     field public static final int IMPORTANCE_TOP_SLEEPING = 150; // 0x96
     field public static final int IMPORTANCE_VISIBLE = 200; // 0xc8
@@ -4041,6 +4037,7 @@
     method public static android.app.ActivityOptions makeTaskLaunchBehind();
     method public static android.app.ActivityOptions makeThumbnailScaleUpAnimation(android.view.View, android.graphics.Bitmap, int, int);
     method public void requestUsageTimeReport(android.app.PendingIntent);
+    method public android.app.ActivityOptions setAppVerificationBundle(android.os.Bundle);
     method public android.app.ActivityOptions setLaunchBounds(android.graphics.Rect);
     method public android.app.ActivityOptions setLaunchDisplayId(int);
     method public void setLaunchStackId(int);
@@ -4831,6 +4828,7 @@
     method public void onFragmentDetached(android.app.FragmentManager, android.app.Fragment);
     method public void onFragmentPaused(android.app.FragmentManager, android.app.Fragment);
     method public void onFragmentPreAttached(android.app.FragmentManager, android.app.Fragment, android.content.Context);
+    method public void onFragmentPreCreated(android.app.FragmentManager, android.app.Fragment, android.os.Bundle);
     method public void onFragmentResumed(android.app.FragmentManager, android.app.Fragment);
     method public void onFragmentSaveInstanceState(android.app.FragmentManager, android.app.Fragment, android.os.Bundle);
     method public void onFragmentStarted(android.app.FragmentManager, android.app.Fragment);
@@ -4863,11 +4861,10 @@
     method public abstract android.app.FragmentTransaction hide(android.app.Fragment);
     method public abstract boolean isAddToBackStackAllowed();
     method public abstract boolean isEmpty();
-    method public abstract android.app.FragmentTransaction postOnCommit(java.lang.Runnable);
     method public abstract android.app.FragmentTransaction remove(android.app.Fragment);
     method public abstract android.app.FragmentTransaction replace(int, android.app.Fragment);
     method public abstract android.app.FragmentTransaction replace(int, android.app.Fragment, java.lang.String);
-    method public abstract android.app.FragmentTransaction setAllowOptimization(boolean);
+    method public abstract android.app.FragmentTransaction runOnCommit(java.lang.Runnable);
     method public abstract android.app.FragmentTransaction setBreadCrumbShortTitle(int);
     method public abstract android.app.FragmentTransaction setBreadCrumbShortTitle(java.lang.CharSequence);
     method public abstract android.app.FragmentTransaction setBreadCrumbTitle(int);
@@ -4875,6 +4872,7 @@
     method public abstract android.app.FragmentTransaction setCustomAnimations(int, int);
     method public abstract android.app.FragmentTransaction setCustomAnimations(int, int, int, int);
     method public abstract android.app.FragmentTransaction setPrimaryNavigationFragment(android.app.Fragment);
+    method public abstract android.app.FragmentTransaction setReorderingAllowed(boolean);
     method public abstract android.app.FragmentTransaction setTransition(int);
     method public abstract android.app.FragmentTransaction setTransitionStyle(int);
     method public abstract android.app.FragmentTransaction show(android.app.Fragment);
@@ -4968,7 +4966,7 @@
     method public final android.app.Activity getLastActivity();
     method public final android.app.Instrumentation.ActivityResult getResult();
     method public final boolean isBlocking();
-    method public android.app.Instrumentation.ActivityResult onMatchIntent(android.content.Intent);
+    method public android.app.Instrumentation.ActivityResult onStartActivity(android.content.Intent);
     method public final android.app.Activity waitForActivity();
     method public final android.app.Activity waitForActivityWithTimeout(long);
   }
@@ -4988,7 +4986,7 @@
 
   public class KeyguardManager {
     method public android.content.Intent createConfirmDeviceCredentialIntent(java.lang.CharSequence, java.lang.CharSequence);
-    method public void dismissKeyguard(android.app.Activity, android.app.KeyguardManager.KeyguardDismissCallback, android.os.Handler);
+    method public deprecated void dismissKeyguard(android.app.Activity, android.app.KeyguardManager.KeyguardDismissCallback, android.os.Handler);
     method public deprecated void exitKeyguardSecurely(android.app.KeyguardManager.OnKeyguardExitResult);
     method public boolean inKeyguardRestrictedInputMode();
     method public boolean isDeviceLocked();
@@ -4996,6 +4994,7 @@
     method public boolean isKeyguardLocked();
     method public boolean isKeyguardSecure();
     method public deprecated android.app.KeyguardManager.KeyguardLock newKeyguardLock(java.lang.String);
+    method public void requestDismissKeyguard(android.app.Activity, android.app.KeyguardManager.KeyguardDismissCallback);
   }
 
   public static abstract class KeyguardManager.KeyguardDismissCallback {
@@ -6133,17 +6132,6 @@
     method public void onDetached();
   }
 
-  public final class WallpaperColors implements android.os.Parcelable {
-    ctor public WallpaperColors(android.os.Parcel);
-    ctor public WallpaperColors(java.util.List<android.util.Pair<android.graphics.Color, java.lang.Integer>>);
-    ctor public WallpaperColors(java.util.List<android.util.Pair<android.graphics.Color, java.lang.Integer>>, boolean);
-    method public int describeContents();
-    method public java.util.List<android.util.Pair<android.graphics.Color, java.lang.Integer>> getColors();
-    method public boolean supportsDarkText();
-    method public void writeToParcel(android.os.Parcel, int);
-    field public static final android.os.Parcelable.Creator<android.app.WallpaperColors> CREATOR;
-  }
-
   public final class WallpaperInfo implements android.os.Parcelable {
     ctor public WallpaperInfo(android.content.Context, android.content.pm.ResolveInfo) throws java.io.IOException, org.xmlpull.v1.XmlPullParserException;
     method public int describeContents();
@@ -6166,8 +6154,6 @@
   }
 
   public class WallpaperManager {
-    method public void addOnColorsChangedListener(android.app.WallpaperManager.OnColorsChangedListener);
-    method public void addOnColorsChangedListener(android.app.WallpaperManager.OnColorsChangedListener, android.os.Handler);
     method public void clear() throws java.io.IOException;
     method public void clear(int) throws java.io.IOException;
     method public void clearWallpaperOffsets(android.os.IBinder);
@@ -6182,7 +6168,6 @@
     method public android.graphics.drawable.Drawable getDrawable();
     method public android.graphics.drawable.Drawable getFastDrawable();
     method public static android.app.WallpaperManager getInstance(android.content.Context);
-    method public android.app.WallpaperColors getWallpaperColors(int);
     method public android.os.ParcelFileDescriptor getWallpaperFile(int);
     method public int getWallpaperId(int);
     method public android.app.WallpaperInfo getWallpaperInfo();
@@ -6191,7 +6176,6 @@
     method public boolean isWallpaperSupported();
     method public android.graphics.drawable.Drawable peekDrawable();
     method public android.graphics.drawable.Drawable peekFastDrawable();
-    method public void removeOnColorsChangedListener(android.app.WallpaperManager.OnColorsChangedListener);
     method public void sendWallpaperCommand(android.os.IBinder, java.lang.String, int, int, int, android.os.Bundle);
     method public void setBitmap(android.graphics.Bitmap) throws java.io.IOException;
     method public int setBitmap(android.graphics.Bitmap, android.graphics.Rect, boolean) throws java.io.IOException;
@@ -6216,16 +6200,12 @@
     field public static final java.lang.String WALLPAPER_PREVIEW_META_DATA = "android.wallpaper.preview";
   }
 
-  public static abstract interface WallpaperManager.OnColorsChangedListener {
-    method public abstract void onColorsChanged(android.app.WallpaperColors, int);
-  }
-
 }
 
 package android.app.admin {
 
   public final class ConnectEvent extends android.app.admin.NetworkEvent implements android.os.Parcelable {
-    method public java.lang.String getIpAddress();
+    method public java.net.InetAddress getInetAddress();
     method public int getPort();
     method public void writeToParcel(android.os.Parcel, int);
     field public static final android.os.Parcelable.Creator<android.app.admin.ConnectEvent> CREATOR;
@@ -6542,7 +6522,7 @@
     field public static final java.lang.String EXTRA_PROVISIONING_WIFI_SECURITY_TYPE = "android.app.extra.PROVISIONING_WIFI_SECURITY_TYPE";
     field public static final java.lang.String EXTRA_PROVISIONING_WIFI_SSID = "android.app.extra.PROVISIONING_WIFI_SSID";
     field public static final java.lang.String EXTRA_RESTRICTION = "android.app.extra.RESTRICTION";
-    field public static final int FLAG_EVICT_CE_KEY = 1; // 0x1
+    field public static final int FLAG_EVICT_CREDENTIAL_ENCRYPTION_KEY = 1; // 0x1
     field public static final int FLAG_MANAGED_CAN_ACCESS_PARENT = 2; // 0x2
     field public static final int FLAG_PARENT_CAN_ACCESS_MANAGED = 1; // 0x1
     field public static final int KEYGUARD_DISABLE_FEATURES_ALL = 2147483647; // 0x7fffffff
@@ -6580,8 +6560,8 @@
 
   public final class DnsEvent extends android.app.admin.NetworkEvent implements android.os.Parcelable {
     method public java.lang.String getHostname();
-    method public java.lang.String[] getIpAddresses();
-    method public int getIpAddressesCount();
+    method public java.util.List<java.net.InetAddress> getInetAddresses();
+    method public int getTotalResolvedAddressCount();
     method public void writeToParcel(android.os.Parcel, int);
     field public static final android.os.Parcelable.Creator<android.app.admin.DnsEvent> CREATOR;
   }
@@ -6752,7 +6732,6 @@
   public abstract class BackupAgent extends android.content.ContextWrapper {
     ctor public BackupAgent();
     method public final void fullBackupFile(java.io.File, android.app.backup.FullBackupDataOutput);
-    method public long getBackupQuota();
     method public abstract void onBackup(android.os.ParcelFileDescriptor, android.app.backup.BackupDataOutput, android.os.ParcelFileDescriptor) throws java.io.IOException;
     method public void onCreate();
     method public void onDestroy();
@@ -6787,6 +6766,7 @@
   }
 
   public class BackupDataOutput {
+    method public long getQuota();
     method public int writeEntityData(byte[], int) throws java.io.IOException;
     method public int writeEntityHeader(java.lang.String, int) throws java.io.IOException;
   }
@@ -6815,6 +6795,7 @@
   }
 
   public class FullBackupDataOutput {
+    method public long getQuota();
   }
 
   public abstract class RestoreObserver {
@@ -7040,8 +7021,8 @@
 
   public final class StorageStats implements android.os.Parcelable {
     method public int describeContents();
+    method public long getAppBytes();
     method public long getCacheBytes();
-    method public long getCodeBytes();
     method public long getDataBytes();
     method public void writeToParcel(android.os.Parcel, int);
     field public static final android.os.Parcelable.Creator<android.app.usage.StorageStats> CREATOR;
@@ -8075,7 +8056,7 @@
     method public void setAdvertisingData(android.bluetooth.le.AdvertiseData);
     method public void setAdvertisingParameters(android.bluetooth.le.AdvertisingSetParameters);
     method public void setPeriodicAdvertisingData(android.bluetooth.le.AdvertiseData);
-    method public void setPeriodicAdvertisingEnable(boolean);
+    method public void setPeriodicAdvertisingEnabled(boolean);
     method public void setPeriodicAdvertisingParameters(android.bluetooth.le.PeriodicAdvertisingParameters);
     method public void setScanResponseData(android.bluetooth.le.AdvertiseData);
   }
@@ -8250,8 +8231,10 @@
     field public static final android.os.Parcelable.Creator<android.bluetooth.le.ScanResult> CREATOR;
     field public static final int DATA_COMPLETE = 0; // 0x0
     field public static final int DATA_TRUNCATED = 2; // 0x2
+    field public static final int PERIODIC_INTERVAL_NOT_PRESENT = 0; // 0x0
     field public static final int PHY_UNUSED = 0; // 0x0
     field public static final int SID_NOT_PRESENT = 255; // 0xff
+    field public static final int TX_POWER_NOT_PRESENT = 127; // 0x7f
   }
 
   public final class ScanSettings implements android.os.Parcelable {
@@ -8322,21 +8305,21 @@
     method public android.companion.BluetoothDeviceFilter.Builder setNamePattern(java.util.regex.Pattern);
   }
 
-  public final class BluetoothLEDeviceFilter implements android.companion.DeviceFilter {
+  public final class BluetoothLeDeviceFilter implements android.companion.DeviceFilter {
     method public int describeContents();
     method public static int getRenamePrefixLengthLimit();
     method public void writeToParcel(android.os.Parcel, int);
-    field public static final android.os.Parcelable.Creator<android.companion.BluetoothLEDeviceFilter> CREATOR;
+    field public static final android.os.Parcelable.Creator<android.companion.BluetoothLeDeviceFilter> CREATOR;
   }
 
-  public static final class BluetoothLEDeviceFilter.Builder {
-    ctor public BluetoothLEDeviceFilter.Builder();
-    method public android.companion.BluetoothLEDeviceFilter build();
-    method public android.companion.BluetoothLEDeviceFilter.Builder setNamePattern(java.util.regex.Pattern);
-    method public android.companion.BluetoothLEDeviceFilter.Builder setRawDataFilter(byte[], byte[]);
-    method public android.companion.BluetoothLEDeviceFilter.Builder setRenameFromBytes(java.lang.String, java.lang.String, int, int, boolean);
-    method public android.companion.BluetoothLEDeviceFilter.Builder setRenameFromName(java.lang.String, java.lang.String, int, int);
-    method public android.companion.BluetoothLEDeviceFilter.Builder setScanFilter(android.bluetooth.le.ScanFilter);
+  public static final class BluetoothLeDeviceFilter.Builder {
+    ctor public BluetoothLeDeviceFilter.Builder();
+    method public android.companion.BluetoothLeDeviceFilter build();
+    method public android.companion.BluetoothLeDeviceFilter.Builder setNamePattern(java.util.regex.Pattern);
+    method public android.companion.BluetoothLeDeviceFilter.Builder setRawDataFilter(byte[], byte[]);
+    method public android.companion.BluetoothLeDeviceFilter.Builder setRenameFromBytes(java.lang.String, java.lang.String, int, int, java.nio.ByteOrder);
+    method public android.companion.BluetoothLeDeviceFilter.Builder setRenameFromName(java.lang.String, java.lang.String, int, int);
+    method public android.companion.BluetoothLeDeviceFilter.Builder setScanFilter(android.bluetooth.le.ScanFilter);
   }
 
   public final class CompanionDeviceManager {
@@ -8472,7 +8455,7 @@
     ctor public ClipData(android.content.ClipDescription, android.content.ClipData.Item);
     ctor public ClipData(android.content.ClipData);
     method public void addItem(android.content.ClipData.Item);
-    method public void addItem(android.content.ClipData.Item, android.content.ContentResolver);
+    method public void addItem(android.content.ContentResolver, android.content.ClipData.Item);
     method public int describeContents();
     method public android.content.ClipDescription getDescription();
     method public android.content.ClipData.Item getItemAt(int);
@@ -9547,6 +9530,7 @@
     field public static final java.lang.String EXTRA_CHOOSER_TARGETS = "android.intent.extra.CHOOSER_TARGETS";
     field public static final java.lang.String EXTRA_CHOSEN_COMPONENT = "android.intent.extra.CHOSEN_COMPONENT";
     field public static final java.lang.String EXTRA_CHOSEN_COMPONENT_INTENT_SENDER = "android.intent.extra.CHOSEN_COMPONENT_INTENT_SENDER";
+    field public static final java.lang.String EXTRA_COMPONENT_NAME = "android.intent.extra.COMPONENT_NAME";
     field public static final java.lang.String EXTRA_CONTENT_ANNOTATIONS = "android.intent.extra.CONTENT_ANNOTATIONS";
     field public static final java.lang.String EXTRA_DATA_REMOVED = "android.intent.extra.DATA_REMOVED";
     field public static final java.lang.String EXTRA_DOCK_STATE = "android.intent.extra.DOCK_STATE";
@@ -10372,7 +10356,7 @@
     field public java.lang.String[] splitPublicSourceDirs;
     field public java.lang.String[] splitSourceDirs;
     field public java.lang.String targetPackage;
-    field public java.lang.String targetProcess;
+    field public java.lang.String targetProcesses;
   }
 
   public class LabeledIntent extends android.content.Intent {
@@ -13344,7 +13328,7 @@
     method public void setFilterBitmap(boolean);
     method public void setFlags(int);
     method public void setFontFeatureSettings(java.lang.String);
-    method public boolean setFontVariationSettings(java.lang.String) throws android.graphics.fonts.FontVariationAxis.InvalidFormatException;
+    method public boolean setFontVariationSettings(java.lang.String);
     method public void setHinting(int);
     method public void setLetterSpacing(float);
     method public void setLinearText(boolean);
@@ -13820,6 +13804,7 @@
     method public void detachFromGLContext();
     method public long getTimestamp();
     method public void getTransformMatrix(float[]);
+    method public boolean isReleased();
     method public void release();
     method public void releaseTexImage();
     method public void setDefaultBufferSize(int, int);
@@ -13870,7 +13855,7 @@
     ctor public Typeface.Builder(android.content.res.AssetManager, java.lang.String);
     method public android.graphics.Typeface build();
     method public android.graphics.Typeface.Builder setFallback(java.lang.String);
-    method public android.graphics.Typeface.Builder setFontVariationSettings(java.lang.String) throws android.graphics.fonts.FontVariationAxis.InvalidFormatException;
+    method public android.graphics.Typeface.Builder setFontVariationSettings(java.lang.String);
     method public android.graphics.Typeface.Builder setFontVariationSettings(android.graphics.fonts.FontVariationAxis[]);
     method public android.graphics.Typeface.Builder setItalic(boolean);
     method public android.graphics.Typeface.Builder setTtcIndex(int);
@@ -14458,17 +14443,13 @@
 package android.graphics.fonts {
 
   public final class FontVariationAxis {
-    ctor public FontVariationAxis(java.lang.String, float) throws android.graphics.fonts.FontVariationAxis.InvalidFormatException;
-    method public static android.graphics.fonts.FontVariationAxis[] fromFontVariationSettings(java.lang.String) throws android.graphics.fonts.FontVariationAxis.InvalidFormatException;
+    ctor public FontVariationAxis(java.lang.String, float);
+    method public static android.graphics.fonts.FontVariationAxis[] fromFontVariationSettings(java.lang.String);
     method public float getStyleValue();
     method public java.lang.String getTag();
     method public static java.lang.String toFontVariationSettings(android.graphics.fonts.FontVariationAxis[]);
   }
 
-  public static class FontVariationAxis.InvalidFormatException extends java.lang.Exception {
-    ctor public FontVariationAxis.InvalidFormatException(java.lang.String);
-  }
-
 }
 
 package android.graphics.pdf {
@@ -14556,7 +14537,7 @@
     method public final void takePicture(android.hardware.Camera.ShutterCallback, android.hardware.Camera.PictureCallback, android.hardware.Camera.PictureCallback, android.hardware.Camera.PictureCallback);
     method public final void unlock();
     field public static final java.lang.String ACTION_NEW_PICTURE = "android.hardware.action.NEW_PICTURE";
-    field public static final deprecated java.lang.String ACTION_NEW_VIDEO = "android.hardware.action.NEW_VIDEO";
+    field public static final java.lang.String ACTION_NEW_VIDEO = "android.hardware.action.NEW_VIDEO";
     field public static final int CAMERA_ERROR_EVICTED = 2; // 0x2
     field public static final int CAMERA_ERROR_SERVER_DIED = 100; // 0x64
     field public static final int CAMERA_ERROR_UNKNOWN = 1; // 0x1
@@ -14817,18 +14798,16 @@
     field public static final int RGBX_8888 = 2; // 0x2
     field public static final int RGB_565 = 4; // 0x4
     field public static final int RGB_888 = 3; // 0x3
-    field public static final long USAGE0_CPU_READ = 2L; // 0x2L
-    field public static final long USAGE0_CPU_READ_OFTEN = 6L; // 0x6L
-    field public static final long USAGE0_CPU_WRITE = 32L; // 0x20L
-    field public static final long USAGE0_CPU_WRITE_OFTEN = 96L; // 0x60L
-    field public static final long USAGE0_GPU_COLOR_OUTPUT = 2048L; // 0x800L
-    field public static final long USAGE0_GPU_CUBEMAP = 8192L; // 0x2000L
-    field public static final long USAGE0_GPU_DATA_BUFFER = 16384L; // 0x4000L
-    field public static final long USAGE0_GPU_SAMPLED_IMAGE = 1024L; // 0x400L
-    field public static final long USAGE0_GPU_STORAGE_IMAGE = 3072L; // 0xc00L
-    field public static final long USAGE0_PROTECTED_CONTENT = 262144L; // 0x40000L
-    field public static final long USAGE0_SENSOR_DIRECT_DATA = 536870912L; // 0x20000000L
-    field public static final long USAGE0_VIDEO_ENCODE = 2097152L; // 0x200000L
+    field public static final long USAGE_CPU_READ_OFTEN = 3L; // 0x3L
+    field public static final long USAGE_CPU_READ_RARELY = 2L; // 0x2L
+    field public static final long USAGE_CPU_WRITE_OFTEN = 48L; // 0x30L
+    field public static final long USAGE_CPU_WRITE_RARELY = 32L; // 0x20L
+    field public static final long USAGE_GPU_COLOR_OUTPUT = 512L; // 0x200L
+    field public static final long USAGE_GPU_DATA_BUFFER = 16777216L; // 0x1000000L
+    field public static final long USAGE_GPU_SAMPLED_IMAGE = 256L; // 0x100L
+    field public static final long USAGE_PROTECTED_CONTENT = 16384L; // 0x4000L
+    field public static final long USAGE_SENSOR_DIRECT_DATA = 8388608L; // 0x800000L
+    field public static final long USAGE_VIDEO_ENCODE = 65536L; // 0x10000L
   }
 
   public final class Sensor {
@@ -25522,8 +25501,8 @@
     method public boolean requestBandwidthUpdate(android.net.Network);
     method public void requestNetwork(android.net.NetworkRequest, android.net.ConnectivityManager.NetworkCallback);
     method public void requestNetwork(android.net.NetworkRequest, android.net.ConnectivityManager.NetworkCallback, android.os.Handler);
-    method public void requestNetwork(android.net.NetworkRequest, int, android.net.ConnectivityManager.NetworkCallback);
-    method public void requestNetwork(android.net.NetworkRequest, int, android.net.ConnectivityManager.NetworkCallback, android.os.Handler);
+    method public void requestNetwork(android.net.NetworkRequest, android.net.ConnectivityManager.NetworkCallback, int);
+    method public void requestNetwork(android.net.NetworkRequest, android.net.ConnectivityManager.NetworkCallback, android.os.Handler, int);
     method public void requestNetwork(android.net.NetworkRequest, android.app.PendingIntent);
     method public deprecated void setNetworkPreference(int);
     method public static deprecated boolean setProcessDefaultNetwork(android.net.Network);
@@ -30802,7 +30781,6 @@
     method public android.util.SizeF getSizeF(java.lang.String);
     method public <T extends android.os.Parcelable> android.util.SparseArray<T> getSparseParcelableArray(java.lang.String);
     method public java.util.ArrayList<java.lang.String> getStringArrayList(java.lang.String);
-    method public java.util.UUID getUuid(java.lang.String);
     method public boolean hasFileDescriptors();
     method public void putAll(android.os.Bundle);
     method public void putBinder(java.lang.String, android.os.IBinder);
@@ -30827,7 +30805,6 @@
     method public void putSizeF(java.lang.String, android.util.SizeF);
     method public void putSparseParcelableArray(java.lang.String, android.util.SparseArray<? extends android.os.Parcelable>);
     method public void putStringArrayList(java.lang.String, java.util.ArrayList<java.lang.String>);
-    method public void putUuid(java.lang.String, java.util.UUID);
     method public void readFromParcel(android.os.Parcel);
     method public void setClassLoader(java.lang.ClassLoader);
     method public void writeToParcel(android.os.Parcel, int);
@@ -31378,7 +31355,6 @@
     method public final <T> void readTypedArray(T[], android.os.Parcelable.Creator<T>);
     method public final <T> void readTypedList(java.util.List<T>, android.os.Parcelable.Creator<T>);
     method public final <T> T readTypedObject(android.os.Parcelable.Creator<T>);
-    method public final java.util.UUID readUuid();
     method public final java.lang.Object readValue(java.lang.ClassLoader);
     method public final void recycle();
     method public final void setDataCapacity(int);
@@ -31424,7 +31400,6 @@
     method public final <T extends android.os.Parcelable> void writeTypedArray(T[], int);
     method public final <T extends android.os.Parcelable> void writeTypedList(java.util.List<T>);
     method public final <T extends android.os.Parcelable> void writeTypedObject(T, int);
-    method public final void writeUuid(java.util.UUID);
     method public final void writeValue(java.lang.Object);
     field public static final android.os.Parcelable.Creator<java.lang.String> STRING_CREATOR;
   }
@@ -31831,6 +31806,7 @@
     field public static final java.lang.String DISALLOW_APPS_CONTROL = "no_control_apps";
     field public static final java.lang.String DISALLOW_AUTOFILL = "no_autofill";
     field public static final java.lang.String DISALLOW_BLUETOOTH = "no_bluetooth";
+    field public static final java.lang.String DISALLOW_BLUETOOTH_SHARING = "no_bluetooth_sharing";
     field public static final java.lang.String DISALLOW_CONFIG_BLUETOOTH = "no_config_bluetooth";
     field public static final java.lang.String DISALLOW_CONFIG_CELL_BROADCASTS = "no_config_cell_broadcasts";
     field public static final java.lang.String DISALLOW_CONFIG_CREDENTIALS = "no_config_credentials";
@@ -32059,9 +32035,9 @@
   }
 
   public class StorageManager {
-    method public void allocateBytes(java.util.UUID, long, int) throws java.io.IOException;
-    method public void allocateBytes(java.io.FileDescriptor, long, int) throws java.io.IOException;
-    method public long getAllocatableBytes(java.util.UUID, int) throws java.io.IOException;
+    method public void allocateBytes(java.util.UUID, long) throws java.io.IOException;
+    method public void allocateBytes(java.io.FileDescriptor, long) throws java.io.IOException;
+    method public long getAllocatableBytes(java.util.UUID) throws java.io.IOException;
     method public long getCacheQuotaBytes(java.util.UUID) throws java.io.IOException;
     method public long getCacheSizeBytes(java.util.UUID) throws java.io.IOException;
     method public java.lang.String getMountedObbPath(java.lang.String);
@@ -32074,7 +32050,6 @@
     method public boolean isEncrypted(java.io.File);
     method public boolean isObbMounted(java.lang.String);
     method public boolean mountObb(java.lang.String, java.lang.String, android.os.storage.OnObbStateChangeListener);
-    method public android.os.ParcelFileDescriptor openProxyFileDescriptor(int, android.os.ProxyFileDescriptorCallback) throws java.io.IOException;
     method public android.os.ParcelFileDescriptor openProxyFileDescriptor(int, android.os.ProxyFileDescriptorCallback, android.os.Handler) throws java.io.IOException;
     method public void setCacheBehaviorGroup(java.io.File, boolean) throws java.io.IOException;
     method public void setCacheBehaviorTombstone(java.io.File, boolean) throws java.io.IOException;
@@ -32082,7 +32057,6 @@
     field public static final java.lang.String ACTION_MANAGE_STORAGE = "android.os.storage.action.MANAGE_STORAGE";
     field public static final java.lang.String EXTRA_REQUESTED_BYTES = "android.os.storage.extra.REQUESTED_BYTES";
     field public static final java.lang.String EXTRA_UUID = "android.os.storage.extra.UUID";
-    field public static final int FLAG_ALLOCATE_AGGRESSIVE = 1; // 0x1
     field public static final java.util.UUID UUID_DEFAULT;
   }
 
@@ -34576,7 +34550,6 @@
   }
 
   public class FontsContract {
-    method public static android.graphics.Typeface buildTypeface(android.content.Context, android.os.CancellationSignal, android.provider.FontsContract.FontInfo[], int, boolean, java.lang.String);
     method public static android.graphics.Typeface buildTypeface(android.content.Context, android.os.CancellationSignal, android.provider.FontsContract.FontInfo[]);
     method public static android.provider.FontsContract.FontFamilyResult fetchFonts(android.content.Context, android.os.CancellationSignal, android.provider.FontRequest) throws android.content.pm.PackageManager.NameNotFoundException;
     method public static void requestFonts(android.content.Context, android.provider.FontRequest, android.os.Handler, android.os.CancellationSignal, android.provider.FontsContract.FontRequestCallback);
@@ -37697,7 +37670,6 @@
     method public final void unlockAndRun(java.lang.Runnable);
     field public static final java.lang.String ACTION_QS_TILE = "android.service.quicksettings.action.QS_TILE";
     field public static final java.lang.String ACTION_QS_TILE_PREFERENCES = "android.service.quicksettings.action.QS_TILE_PREFERENCES";
-    field public static final java.lang.String EXTRA_COMPONENT = "android.service.quicksettings.extra.COMPONENT";
     field public static final java.lang.String META_DATA_ACTIVE_TILE = "android.service.quicksettings.ACTIVE_TILE";
   }
 
@@ -37927,12 +37899,10 @@
     method public int getDesiredMinimumHeight();
     method public int getDesiredMinimumWidth();
     method public android.view.SurfaceHolder getSurfaceHolder();
-    method public void invalidateColors();
     method public boolean isPreview();
     method public boolean isVisible();
     method public void onApplyWindowInsets(android.view.WindowInsets);
     method public android.os.Bundle onCommand(java.lang.String, int, int, int, android.os.Bundle, boolean);
-    method public android.app.WallpaperColors onComputeWallpaperColors();
     method public void onCreate(android.view.SurfaceHolder);
     method public void onDesiredSizeChanged(int, int);
     method public void onDestroy();
@@ -45979,7 +45949,6 @@
     method public boolean onKeyUp(int, android.view.KeyEvent);
     method protected void onLayout(boolean, int, int, int, int);
     method protected void onMeasure(int, int);
-    method public void onMovedToDisplay(int, android.content.res.Configuration);
     method protected void onOverScrolled(int, int, boolean, boolean);
     method public void onPointerCaptureChange(boolean);
     method public void onPopulateAccessibilityEvent(android.view.accessibility.AccessibilityEvent);
@@ -46202,6 +46171,7 @@
     field public static final int ACCESSIBILITY_LIVE_REGION_NONE = 0; // 0x0
     field public static final int ACCESSIBILITY_LIVE_REGION_POLITE = 1; // 0x1
     field public static final android.util.Property<android.view.View, java.lang.Float> ALPHA;
+    field public static final int AUTOFILL_FLAG_INCLUDE_NOT_IMPORTANT_VIEWS = 1; // 0x1
     field public static final java.lang.String AUTOFILL_HINT_CREDIT_CARD_EXPIRATION_DATE = "creditCardExpirationDate";
     field public static final java.lang.String AUTOFILL_HINT_CREDIT_CARD_EXPIRATION_DAY = "creditCardExpirationDay";
     field public static final java.lang.String AUTOFILL_HINT_CREDIT_CARD_EXPIRATION_MONTH = "creditCardExpirationMonth";
@@ -46917,7 +46887,7 @@
 
   public static abstract class ViewStructure.HtmlInfo {
     ctor public ViewStructure.HtmlInfo();
-    method public abstract java.util.ArrayList<android.util.Pair<java.lang.String, java.lang.String>> getAttributes();
+    method public abstract java.util.List<android.util.Pair<java.lang.String, java.lang.String>> getAttributes();
     method public abstract java.lang.String getTag();
   }
 
@@ -47632,8 +47602,8 @@
     field public static final java.lang.String ACTION_ARGUMENT_EXTEND_SELECTION_BOOLEAN = "ACTION_ARGUMENT_EXTEND_SELECTION_BOOLEAN";
     field public static final java.lang.String ACTION_ARGUMENT_HTML_ELEMENT_STRING = "ACTION_ARGUMENT_HTML_ELEMENT_STRING";
     field public static final java.lang.String ACTION_ARGUMENT_MOVEMENT_GRANULARITY_INT = "ACTION_ARGUMENT_MOVEMENT_GRANULARITY_INT";
-    field public static final java.lang.String ACTION_ARGUMENT_MOVE_WINDOW_X = "android.view.accessibility.action.ARGUMENT_MOVE_WINDOW_X";
-    field public static final java.lang.String ACTION_ARGUMENT_MOVE_WINDOW_Y = "android.view.accessibility.action.ARGUMENT_MOVE_WINDOW_Y";
+    field public static final java.lang.String ACTION_ARGUMENT_MOVE_WINDOW_X = "ACTION_ARGUMENT_MOVE_WINDOW_X";
+    field public static final java.lang.String ACTION_ARGUMENT_MOVE_WINDOW_Y = "ACTION_ARGUMENT_MOVE_WINDOW_Y";
     field public static final java.lang.String ACTION_ARGUMENT_PROGRESS_VALUE = "android.view.accessibility.action.ARGUMENT_PROGRESS_VALUE";
     field public static final java.lang.String ACTION_ARGUMENT_ROW_INT = "android.view.accessibility.action.ARGUMENT_ROW_INT";
     field public static final java.lang.String ACTION_ARGUMENT_SELECTION_END_INT = "ACTION_ARGUMENT_SELECTION_END_INT";
@@ -47815,10 +47785,10 @@
     method public android.view.accessibility.AccessibilityNodeInfo getRoot();
     method public java.lang.CharSequence getTitle();
     method public int getType();
-    method public boolean inPictureInPicture();
     method public boolean isAccessibilityFocused();
     method public boolean isActive();
     method public boolean isFocused();
+    method public boolean isInPictureInPictureMode();
     method public static android.view.accessibility.AccessibilityWindowInfo obtain();
     method public static android.view.accessibility.AccessibilityWindowInfo obtain(android.view.accessibility.AccessibilityWindowInfo);
     method public void recycle();
@@ -48177,7 +48147,7 @@
     method public void unregisterCallback(android.view.autofill.AutofillManager.AutofillCallback);
     field public static final java.lang.String EXTRA_ASSIST_STRUCTURE = "android.view.autofill.extra.ASSIST_STRUCTURE";
     field public static final java.lang.String EXTRA_AUTHENTICATION_RESULT = "android.view.autofill.extra.AUTHENTICATION_RESULT";
-    field public static final java.lang.String EXTRA_DATA_EXTRAS = "android.view.autofill.extra.DATA_EXTRAS";
+    field public static final java.lang.String EXTRA_CLIENT_STATE = "android.view.autofill.extra.EXTRA_CLIENT_STATE";
   }
 
   public static abstract class AutofillManager.AutofillCallback {
@@ -49318,7 +49288,6 @@
     method public int getRendererRequestedPriority();
     method public deprecated float getScale();
     method public android.webkit.WebSettings getSettings();
-    method public android.view.textclassifier.TextClassifier getTextClassifier();
     method public java.lang.String getTitle();
     method public java.lang.String getUrl();
     method public android.webkit.WebChromeClient getWebChromeClient();
@@ -49365,7 +49334,6 @@
     method public void setNetworkAvailable(boolean);
     method public deprecated void setPictureListener(android.webkit.WebView.PictureListener);
     method public void setRendererPriorityPolicy(int, boolean);
-    method public void setTextClassifier(android.view.textclassifier.TextClassifier);
     method public deprecated void setVerticalScrollbarOverlay(boolean);
     method public void setWebChromeClient(android.webkit.WebChromeClient);
     method public static void setWebContentsDebuggingEnabled(boolean);
@@ -51832,7 +51800,7 @@
     method public void setExtractedText(android.view.inputmethod.ExtractedText);
     method public void setFilters(android.text.InputFilter[]);
     method public void setFontFeatureSettings(java.lang.String);
-    method public boolean setFontVariationSettings(java.lang.String) throws android.graphics.fonts.FontVariationAxis.InvalidFormatException;
+    method public boolean setFontVariationSettings(java.lang.String);
     method protected boolean setFrame(int, int, int, int);
     method public void setFreezesText(boolean);
     method public void setGravity(int);
diff --git a/api/test-removed.txt b/api/test-removed.txt
index 13bccd6..779ff7c 100644
--- a/api/test-removed.txt
+++ b/api/test-removed.txt
@@ -18,12 +18,17 @@
     method public deprecated java.lang.String getDeviceInitializerApp();
     method public deprecated android.content.ComponentName getDeviceInitializerComponent();
     method public void setAffiliationIds(android.content.ComponentName, java.util.List<java.lang.String>);
+    field public static final deprecated int FLAG_EVICT_CE_KEY = 1; // 0x1
   }
 
 }
 
 package android.app.usage {
 
+  public final class StorageStats implements android.os.Parcelable {
+    method public deprecated long getCodeBytes();
+  }
+
   public class StorageStatsManager {
     method public deprecated long getFreeBytes(java.lang.String) throws java.io.IOException;
     method public deprecated long getTotalBytes(java.lang.String) throws java.io.IOException;
@@ -38,6 +43,10 @@
 
 package android.content {
 
+  public class ClipData implements android.os.Parcelable {
+    method public deprecated void addItem(android.content.ClipData.Item, android.content.ContentResolver);
+  }
+
   public abstract class Context {
     method public abstract android.content.SharedPreferences getSharedPreferences(java.io.File, int);
     method public abstract java.io.File getSharedPreferencesPath(java.lang.String);
@@ -443,6 +452,14 @@
 
 }
 
+package android.view.accessibility {
+
+  public final class AccessibilityWindowInfo implements android.os.Parcelable {
+    method public boolean inPictureInPicture();
+  }
+
+}
+
 package android.webkit {
 
   public class WebViewClient {
diff --git a/core/java/android/accessibilityservice/AccessibilityButtonController.java b/core/java/android/accessibilityservice/AccessibilityButtonController.java
index c3a5dab..ee19768 100644
--- a/core/java/android/accessibilityservice/AccessibilityButtonController.java
+++ b/core/java/android/accessibilityservice/AccessibilityButtonController.java
@@ -23,6 +23,8 @@
 import android.util.ArrayMap;
 import android.util.Slog;
 
+import com.android.internal.util.Preconditions;
+
 /**
  * Controller for the accessibility button within the system's navigation area
  * <p>
@@ -89,7 +91,7 @@
      * @param callback the callback to add, must be non-null
      */
     public void registerAccessibilityButtonCallback(@NonNull AccessibilityButtonCallback callback) {
-        registerAccessibilityButtonCallback(callback, null);
+        registerAccessibilityButtonCallback(callback, new Handler());
     }
 
     /**
@@ -99,11 +101,12 @@
      * {@code null}.
      *
      * @param callback the callback to add, must be non-null
-     * @param handler the handler on which to callback should execute, or {@code null} to
-     *                execute on the service's main thread
+     * @param handler the handler on which the callback should execute, must be non-null
      */
     public void registerAccessibilityButtonCallback(@NonNull AccessibilityButtonCallback callback,
-            @Nullable Handler handler) {
+            @NonNull Handler handler) {
+        Preconditions.checkNotNull(callback);
+        Preconditions.checkNotNull(handler);
         synchronized (mLock) {
             if (mCallbacks == null) {
                 mCallbacks = new ArrayMap<>();
@@ -121,6 +124,7 @@
      */
     public void unregisterAccessibilityButtonCallback(
             @NonNull AccessibilityButtonCallback callback) {
+        Preconditions.checkNotNull(callback);
         synchronized (mLock) {
             if (mCallbacks == null) {
                 return;
@@ -154,12 +158,7 @@
         for (int i = 0, count = entries.size(); i < count; i++) {
             final AccessibilityButtonCallback callback = entries.keyAt(i);
             final Handler handler = entries.valueAt(i);
-            if (handler != null) {
-                handler.post(() -> callback.onClicked(this));
-            } else {
-                // We're already on the main thread, just run the callback.
-                callback.onClicked(this);
-            }
+            handler.post(() -> callback.onClicked(this));
         }
     }
 
@@ -184,12 +183,7 @@
         for (int i = 0, count = entries.size(); i < count; i++) {
             final AccessibilityButtonCallback callback = entries.keyAt(i);
             final Handler handler = entries.valueAt(i);
-            if (handler != null) {
-                handler.post(() -> callback.onAvailabilityChanged(this, available));
-            } else {
-                // We're already on the main thread, just run the callback.
-                callback.onAvailabilityChanged(this, available);
-            }
+            handler.post(() -> callback.onAvailabilityChanged(this, available));
         }
     }
 
diff --git a/core/java/android/accessibilityservice/AccessibilityService.java b/core/java/android/accessibilityservice/AccessibilityService.java
index 64d7d4c..af0a204 100644
--- a/core/java/android/accessibilityservice/AccessibilityService.java
+++ b/core/java/android/accessibilityservice/AccessibilityService.java
@@ -619,20 +619,10 @@
      * @return The controller for fingerprint gestures, or {@code null} if gestures are unavailable.
      */
     @RequiresPermission(android.Manifest.permission.USE_FINGERPRINT)
-    public final @Nullable FingerprintGestureController getFingerprintGestureController() {
-        if ((mFingerprintGestureController == null)
-                && getPackageManager().hasSystemFeature(FEATURE_FINGERPRINT)) {
-            FingerprintManager fingerprintManager = getSystemService(FingerprintManager.class);
-            if ((fingerprintManager != null) && fingerprintManager.isHardwareDetected()) {
-                AccessibilityServiceInfo info = getServiceInfo();
-                int fingerprintCapabilityMask =
-                        AccessibilityServiceInfo.CAPABILITY_CAN_CAPTURE_FINGERPRINT_GESTURES;
-                if ((info.getCapabilities() & fingerprintCapabilityMask) != 0) {
-                    mFingerprintGestureController = new FingerprintGestureController(
-                            AccessibilityInteractionClient.getInstance()
-                                    .getConnection(mConnectionId));
-                }
-            }
+    public final @NonNull FingerprintGestureController getFingerprintGestureController() {
+        if (mFingerprintGestureController == null) {
+            mFingerprintGestureController = new FingerprintGestureController(
+                    AccessibilityInteractionClient.getInstance().getConnection(mConnectionId));
         }
         return mFingerprintGestureController;
     }
diff --git a/core/java/android/accessibilityservice/AccessibilityServiceInfo.java b/core/java/android/accessibilityservice/AccessibilityServiceInfo.java
index 3cda489..70a6ce6 100644
--- a/core/java/android/accessibilityservice/AccessibilityServiceInfo.java
+++ b/core/java/android/accessibilityservice/AccessibilityServiceInfo.java
@@ -119,9 +119,9 @@
 
     /**
      * Capability: This accessibility service can capture gestures from the fingerprint sensor
-     * @see android.R.styleable#AccessibilityService_canCaptureFingerprintGestures
+     * @see android.R.styleable#AccessibilityService_canRequestFingerprintGestures
      */
-    public static final int CAPABILITY_CAN_CAPTURE_FINGERPRINT_GESTURES = 0x00000040;
+    public static final int CAPABILITY_CAN_REQUEST_FINGERPRINT_GESTURES = 0x00000040;
 
     private static SparseArray<CapabilityInfo> sAvailableCapabilityInfos;
 
@@ -301,7 +301,7 @@
      * This flag requests that all fingerprint gestures be sent to the accessibility service.
      * It is handled in {@link FingerprintGestureController}
      */
-    public static final int FLAG_CAPTURE_FINGERPRINT_GESTURES = 0x00000200;
+    public static final int FLAG_REQUEST_FINGERPRINT_GESTURES = 0x00000200;
 
     /** {@hide} */
     public static final int FLAG_FORCE_DIRECT_BOOT_AWARE = 0x00010000;
@@ -521,8 +521,8 @@
                 mCapabilities |= CAPABILITY_CAN_PERFORM_GESTURES;
             }
             if (asAttributes.getBoolean(com.android.internal.R.styleable
-                    .AccessibilityService_canCaptureFingerprintGestures, false)) {
-                mCapabilities |= CAPABILITY_CAN_CAPTURE_FINGERPRINT_GESTURES;
+                    .AccessibilityService_canRequestFingerprintGestures, false)) {
+                mCapabilities |= CAPABILITY_CAN_REQUEST_FINGERPRINT_GESTURES;
             }
             TypedValue peekedValue = asAttributes.peekValue(
                     com.android.internal.R.styleable.AccessibilityService_description);
@@ -971,8 +971,8 @@
                 return "FLAG_ENABLE_ACCESSIBILITY_VOLUME";
             case FLAG_REQUEST_ACCESSIBILITY_BUTTON:
                 return "FLAG_REQUEST_ACCESSIBILITY_BUTTON";
-            case FLAG_CAPTURE_FINGERPRINT_GESTURES:
-                return "FLAG_CAPTURE_FINGERPRINT_GESTURES";
+            case FLAG_REQUEST_FINGERPRINT_GESTURES:
+                return "FLAG_REQUEST_FINGERPRINT_GESTURES";
             default:
                 return null;
         }
@@ -1000,8 +1000,8 @@
                 return "CAPABILITY_CAN_CONTROL_MAGNIFICATION";
             case CAPABILITY_CAN_PERFORM_GESTURES:
                 return "CAPABILITY_CAN_PERFORM_GESTURES";
-            case CAPABILITY_CAN_CAPTURE_FINGERPRINT_GESTURES:
-                return "CAPABILITY_CAN_CAPTURE_FINGERPRINT_GESTURES";
+            case CAPABILITY_CAN_REQUEST_FINGERPRINT_GESTURES:
+                return "CAPABILITY_CAN_REQUEST_FINGERPRINT_GESTURES";
             default:
                 return "UNKNOWN";
         }
@@ -1064,8 +1064,8 @@
                             R.string.capability_title_canPerformGestures,
                             R.string.capability_desc_canPerformGestures));
             if ((context == null) || fingerprintAvailable(context)) {
-                sAvailableCapabilityInfos.put(CAPABILITY_CAN_CAPTURE_FINGERPRINT_GESTURES,
-                        new CapabilityInfo(CAPABILITY_CAN_CAPTURE_FINGERPRINT_GESTURES,
+                sAvailableCapabilityInfos.put(CAPABILITY_CAN_REQUEST_FINGERPRINT_GESTURES,
+                        new CapabilityInfo(CAPABILITY_CAN_REQUEST_FINGERPRINT_GESTURES,
                                 R.string.capability_title_canCaptureFingerprintGestures,
                                 R.string.capability_desc_canCaptureFingerprintGestures));
             }
diff --git a/core/java/android/accessibilityservice/FingerprintGestureController.java b/core/java/android/accessibilityservice/FingerprintGestureController.java
index e203c6d..9f04cea 100644
--- a/core/java/android/accessibilityservice/FingerprintGestureController.java
+++ b/core/java/android/accessibilityservice/FingerprintGestureController.java
@@ -156,9 +156,9 @@
             FingerprintGestureCallback callback = handlerMap.keyAt(i);
             Handler handler = handlerMap.valueAt(i);
             if (handler != null) {
-                handler.post(() -> callback.onGesture(gesture));
+                handler.post(() -> callback.onGestureDetected(gesture));
             } else {
-                callback.onGesture(gesture);
+                callback.onGestureDetected(gesture);
             }
         }
     }
@@ -180,6 +180,6 @@
          * @param gesture The id of the gesture that was detected. For example,
          * {@link #FINGERPRINT_GESTURE_SWIPE_RIGHT}.
          */
-        public void onGesture(int gesture) {}
+        public void onGestureDetected(int gesture) {}
     }
 }
diff --git a/core/java/android/accessibilityservice/GestureDescription.java b/core/java/android/accessibilityservice/GestureDescription.java
index c9da152..92567d7 100644
--- a/core/java/android/accessibilityservice/GestureDescription.java
+++ b/core/java/android/accessibilityservice/GestureDescription.java
@@ -24,6 +24,8 @@
 import android.os.Parcel;
 import android.os.Parcelable;
 
+import com.android.internal.util.Preconditions;
+
 import java.util.ArrayList;
 import java.util.List;
 
@@ -130,7 +132,7 @@
                 touchPoints[numPointsFound].mIsStartOfPath =
                         (strokeDescription.getContinuedStrokeId() < 0)
                                 && (time == strokeDescription.mStartTime);
-                touchPoints[numPointsFound].mIsEndOfPath = !strokeDescription.isContinued()
+                touchPoints[numPointsFound].mIsEndOfPath = !strokeDescription.willContinue()
                         && (time == strokeDescription.mEndTime);
                 strokeDescription.getPosForTime(time, mTempPos);
                 touchPoints[numPointsFound].mX = Math.round(mTempPos[0]);
@@ -197,7 +199,7 @@
      * Immutable description of stroke that can be part of a gesture.
      */
     public static class StrokeDescription {
-        public static final int INVALID_STROKE_ID = -1;
+        private static final int INVALID_STROKE_ID = -1;
 
         static int sIdCounter;
 
@@ -210,7 +212,7 @@
         float[] mTapLocation;
         int mId;
         boolean mContinued;
-        int mContinuedStrokeId;
+        int mContinuedStrokeId = INVALID_STROKE_ID;
 
         /**
          * @param path The path to follow. Must have exactly one contour. The bounds of the path
@@ -219,12 +221,12 @@
          * @param startTime The time, in milliseconds, from the time the gesture starts to the
          * time the stroke should start. Must not be negative.
          * @param duration The duration, in milliseconds, the stroke takes to traverse the path.
-         * Must not be negative.
+         * Must be positive.
          */
         public StrokeDescription(@NonNull Path path,
                 @IntRange(from = 0) long startTime,
                 @IntRange(from = 0) long duration) {
-            this(path, startTime, duration, INVALID_STROKE_ID, false);
+            this(path, startTime, duration, false);
         }
 
         /**
@@ -235,36 +237,23 @@
          * time the stroke should start. Must not be negative.
          * @param duration The duration, in milliseconds, the stroke takes to traverse the path.
          * Must be positive.
-         * @param continuedStrokeId The ID of the stroke that this stroke continues, or
-         * {@link #INVALID_STROKE_ID} if it continues no stroke. The stroke it
-         * continues must have its isContinued flag set to {@code true} and must be in the
-         * gesture dispatched immediately before the one containing this stroke.
-         * @param isContinued {@code true} if this stroke will be continued by one in the
+         * @param willContinue {@code true} if this stroke will be continued by one in the
          * next gesture {@code false} otherwise. Continued strokes keep their pointers down when
          * the gesture completes.
          */
         public StrokeDescription(@NonNull Path path,
                 @IntRange(from = 0) long startTime,
                 @IntRange(from = 0) long duration,
-                @IntRange(from = 0) int continuedStrokeId,
-                boolean isContinued) {
-            mContinued = isContinued;
-            mContinuedStrokeId = continuedStrokeId;
-            if (duration <= 0) {
-                throw new IllegalArgumentException("Duration must be positive");
-            }
-            if (startTime < 0) {
-                throw new IllegalArgumentException("Start time must not be negative");
-            }
+                boolean willContinue) {
+            mContinued = willContinue;
+            Preconditions.checkArgument(duration > 0, "Duration must be positive");
+            Preconditions.checkArgument(startTime >= 0, "Start time must not be negative");
+            Preconditions.checkArgument(!path.isEmpty(), "Path is empty");
             RectF bounds = new RectF();
             path.computeBounds(bounds, false /* unused */);
-            if ((bounds.bottom < 0) || (bounds.top < 0) || (bounds.right < 0)
-                    || (bounds.left < 0)) {
-                throw new IllegalArgumentException("Path bounds must not be negative");
-            }
-            if (path.isEmpty()) {
-                throw new IllegalArgumentException("Path is empty");
-            }
+            Preconditions.checkArgument((bounds.bottom >= 0) && (bounds.top >= 0)
+                    && (bounds.right >= 0) && (bounds.left >= 0),
+                    "Path bounds must not be negative");
             mPath = new Path(path);
             mPathMeasure = new PathMeasure(path, false);
             if (mPathMeasure.getLength() == 0) {
@@ -321,17 +310,44 @@
          * stroke in a future gesture.
          *
          * @return the ID of this stroke
+         * @hide
          */
         public int getId() {
             return mId;
         }
 
         /**
+         * Create a new stroke that will continue this one. This is only possible if this stroke
+         * will continue.
+         *
+         * @param path The path for the stroke that continues this one. The starting point of
+         *             this path must match the ending point of the stroke it continues.
+         * @param startTime The time, in milliseconds, from the time the gesture starts to the
+         *                  time this stroke should start. Must not be negative. This time is from
+         *                  the start of the new gesture, not the one being continued.
+         * @param duration The duration for the new stroke. Must not be negative.
+         * @param willContinue {@code true} if this stroke will be continued by one in the
+         *             next gesture {@code false} otherwise.
+         * @return
+         */
+        public StrokeDescription continueStroke(Path path, long startTime, long duration,
+                boolean willContinue) {
+            if (!mContinued) {
+                throw new IllegalStateException(
+                        "Only strokes marked willContinue can be continued");
+            }
+            StrokeDescription strokeDescription =
+                    new StrokeDescription(path, startTime, duration, willContinue);
+            strokeDescription.mContinuedStrokeId = mId;
+            return strokeDescription;
+        }
+
+        /**
          * Check if this stroke is marked to continue in the next gesture.
          *
          * @return {@code true} if the stroke is to be continued.
          */
-        public boolean isContinued() {
+        public boolean willContinue() {
             return mContinued;
         }
 
@@ -339,6 +355,7 @@
          * Get the ID of the stroke that this one will continue.
          *
          * @return The ID of the stroke that this stroke continues, or 0 if no such stroke exists.
+         * @hide
          */
         public int getContinuedStrokeId() {
             return mContinuedStrokeId;
diff --git a/core/java/android/accounts/AccountManager.java b/core/java/android/accounts/AccountManager.java
index 06b09c0..a5b37f3 100644
--- a/core/java/android/accounts/AccountManager.java
+++ b/core/java/android/accounts/AccountManager.java
@@ -376,7 +376,7 @@
      * {@link #VISIBILITY_USER_MANAGED_NOT_VISIBLE} is used.
      */
     public static final String PACKAGE_NAME_KEY_LEGACY_VISIBLE =
-            "android.accounts.key_legacy_visible";
+        "android:accounts:key_legacy_visible";
 
     /**
      * Key to set visibility for applications which satisfy one of the following conditions:
@@ -395,7 +395,7 @@
      * {@link #VISIBILITY_USER_MANAGED_VISIBLE} is used.
      */
     public static final String PACKAGE_NAME_KEY_LEGACY_NOT_VISIBLE =
-            "android.accounts.key_legacy_not_visible";
+            "android:accounts:key_legacy_not_visible";
 
     /**
      * @hide
diff --git a/core/java/android/animation/AnimatorSet.java b/core/java/android/animation/AnimatorSet.java
index cdeca13..ca4b4d5 100644
--- a/core/java/android/animation/AnimatorSet.java
+++ b/core/java/android/animation/AnimatorSet.java
@@ -930,12 +930,14 @@
     }
 
     /**
-     * Gets the current position of the animation in time, which is equal to the current
-     * time minus the time that the animation started. An animation that is not yet started will
-     * return a value of zero, unless the animation has has its play time set via
-     * {@link #setCurrentPlayTime(long)}, in which case it will return the time that was set.
+     * Returns the milliseconds elapsed since the start of the animation.
      *
-     * @return The current position in time of the animation.
+     * <p>For ongoing animations, this method returns the current progress of the animation in
+     * terms of play time. For an animation that has not yet been started: if the animation has been
+     * seeked to a certain time via {@link #setCurrentPlayTime(long)}, the seeked play time will
+     * be returned; otherwise, this method will return 0.
+     *
+     * @return the current position in time of the animation in milliseconds
      */
     public long getCurrentPlayTime() {
         if (mSeekState.isActive()) {
diff --git a/core/java/android/app/Activity.java b/core/java/android/app/Activity.java
index e621c01..ab4f33d 100644
--- a/core/java/android/app/Activity.java
+++ b/core/java/android/app/Activity.java
@@ -2172,6 +2172,7 @@
      *
      * @see #onConfigurationChanged(Configuration)
      * @see View#onMovedToDisplay(int, Configuration)
+     * @hide
      */
     public void onMovedToDisplay(int displayId, Configuration config) {
     }
diff --git a/core/java/android/app/ActivityManager.java b/core/java/android/app/ActivityManager.java
index 6e7b750..2230472 100644
--- a/core/java/android/app/ActivityManager.java
+++ b/core/java/android/app/ActivityManager.java
@@ -3143,10 +3143,15 @@
          * before {@link Build.VERSION_CODES#O}.  Since the {@link Build.VERSION_CODES#O} SDK,
          * the value of {@link #IMPORTANCE_PERCEPTIBLE} has been fixed.
          *
-         * @deprecated Use {@link #IMPORTANCE_PERCEPTIBLE} instead.
+         * <p>The system will return this value instead of {@link #IMPORTANCE_PERCEPTIBLE}
+         * on Android versions below {@link Build.VERSION_CODES#O}.
+         *
+         * <p>On Android version {@link Build.VERSION_CODES#O} and later, this value will still be
+         * returned for apps with the target API level below {@link Build.VERSION_CODES#O}.
+         * For apps targeting version {@link Build.VERSION_CODES#O} and later,
+         * the correct value {@link #IMPORTANCE_PERCEPTIBLE} will be returned.
          */
-        @Deprecated
-        public static final int IMPORTANCE_PERCEPTIBLE_DEPRECATED = 130;
+        public static final int IMPORTANCE_PERCEPTIBLE_PRE_26 = 130;
 
         /**
          * Constant for {@link #importance}: This process is not something the user
@@ -3160,11 +3165,17 @@
          * before {@link Build.VERSION_CODES#O}.  Since the {@link Build.VERSION_CODES#O} SDK,
          * the value of {@link #IMPORTANCE_CANT_SAVE_STATE} has been fixed.
          *
-         * @deprecated Use {@link #IMPORTANCE_CANT_SAVE_STATE} instead.
+         * <p>The system will return this value instead of {@link #IMPORTANCE_CANT_SAVE_STATE}
+         * on Android versions below {@link Build.VERSION_CODES#O}.
+         *
+         * <p>On Android version {@link Build.VERSION_CODES#O} after, this value will still be
+         * returned for apps with the target API level below {@link Build.VERSION_CODES#O}.
+         * For apps targeting version {@link Build.VERSION_CODES#O} and later,
+         * the correct value {@link #IMPORTANCE_CANT_SAVE_STATE} will be returned.
+         *
          * @hide
          */
-        @Deprecated
-        public static final int IMPORTANCE_CANT_SAVE_STATE_DEPRECATED = 170;
+        public static final int IMPORTANCE_CANT_SAVE_STATE_PRE_26 = 170;
 
         /**
          * Constant for {@link #importance}: This process is running an
@@ -3244,15 +3255,25 @@
          */
         public static @Importance int procStateToImportanceForClient(int procState,
                 Context clientContext) {
+            return procStateToImportanceForTargetSdk(procState,
+                    clientContext.getApplicationInfo().targetSdkVersion);
+        }
+
+        /**
+         * See {@link #procStateToImportanceForClient}.
+         * @hide
+         */
+        public static @Importance int procStateToImportanceForTargetSdk(int procState,
+                int targetSdkVersion) {
             final int importance = procStateToImportance(procState);
 
             // For pre O apps, convert to the old, wrong values.
-            if (clientContext.getApplicationInfo().targetSdkVersion < VERSION_CODES.O) {
+            if (targetSdkVersion < VERSION_CODES.O) {
                 switch (importance) {
                     case IMPORTANCE_PERCEPTIBLE:
-                        return IMPORTANCE_PERCEPTIBLE_DEPRECATED;
+                        return IMPORTANCE_PERCEPTIBLE_PRE_26;
                     case IMPORTANCE_CANT_SAVE_STATE:
-                        return IMPORTANCE_CANT_SAVE_STATE_DEPRECATED;
+                        return IMPORTANCE_CANT_SAVE_STATE_PRE_26;
                 }
             }
             return importance;
diff --git a/core/java/android/app/ActivityOptions.java b/core/java/android/app/ActivityOptions.java
index 63e8cc6..3eec596 100644
--- a/core/java/android/app/ActivityOptions.java
+++ b/core/java/android/app/ActivityOptions.java
@@ -211,6 +211,9 @@
     private static final String KEY_USAGE_TIME_REPORT = "android:activity.usageTimeReport";
     private static final String KEY_ROTATION_ANIMATION_HINT = "android:activity.rotationAnimationHint";
 
+    private static final String KEY_INSTANT_APP_VERIFICATION_BUNDLE
+            = "android:instantapps.installerbundle";
+
     /** @hide */
     public static final int ANIM_NONE = 0;
     /** @hide */
@@ -264,6 +267,7 @@
     private boolean mTaskOverlayCanResume;
     private AppTransitionAnimationSpec mAnimSpecs[];
     private int mRotationAnimationHint = -1;
+    private Bundle mAppVerificationBundle;
 
     /**
      * Create an ActivityOptions specifying a custom animation to run when
@@ -886,6 +890,7 @@
                     opts.getBinder(KEY_ANIMATION_FINISHED_LISTENER));
         }
         mRotationAnimationHint = opts.getInt(KEY_ROTATION_ANIMATION_HINT);
+        mAppVerificationBundle = opts.getBundle(KEY_INSTANT_APP_VERIFICATION_BUNDLE);
     }
 
     /**
@@ -1275,6 +1280,9 @@
             b.putBinder(KEY_ANIMATION_FINISHED_LISTENER, mAnimationFinishedListener.asBinder());
         }
         b.putInt(KEY_ROTATION_ANIMATION_HINT, mRotationAnimationHint);
+        if (mAppVerificationBundle != null) {
+            b.putBundle(KEY_INSTANT_APP_VERIFICATION_BUNDLE, mAppVerificationBundle);
+        }
 
         return b;
     }
@@ -1342,6 +1350,30 @@
         mRotationAnimationHint = hint;
     }
 
+    /**
+     * Pop the extra verification bundle for the installer.
+     * This removes the bundle from the ActivityOptions to make sure the installer bundle
+     * is only available once.
+     * @hide
+     */
+    public Bundle popAppVerificationBundle() {
+        Bundle out = mAppVerificationBundle;
+        mAppVerificationBundle = null;
+        return out;
+    }
+
+    /**
+     * Set the {@link Bundle} that is provided to the app installer for additional verification
+     * if the call to {@link Context#startActivity} results in an app being installed.
+     *
+     * This Bundle is not provided to any other app besides the installer.
+     */
+    public ActivityOptions setAppVerificationBundle(Bundle bundle) {
+        mAppVerificationBundle = bundle;
+        return this;
+
+    }
+
     /** @hide */
     @Override
     public String toString() {
diff --git a/core/java/android/app/ActivityThread.java b/core/java/android/app/ActivityThread.java
index 195ba24..dd9db8a 100644
--- a/core/java/android/app/ActivityThread.java
+++ b/core/java/android/app/ActivityThread.java
@@ -670,6 +670,7 @@
         IBinder requestToken;
         int requestType;
         int sessionId;
+        int flags;
     }
 
     static final class ActivityConfigChangeData {
@@ -1288,12 +1289,13 @@
 
         @Override
         public void requestAssistContextExtras(IBinder activityToken, IBinder requestToken,
-                int requestType, int sessionId) {
+                int requestType, int sessionId, int flags) {
             RequestAssistContextExtras cmd = new RequestAssistContextExtras();
             cmd.activityToken = activityToken;
             cmd.requestToken = requestToken;
             cmd.requestType = requestType;
             cmd.sessionId = sessionId;
+            cmd.flags = flags;
             sendMessage(H.REQUEST_ASSIST_CONTEXT_EXTRAS, cmd);
         }
 
@@ -3030,7 +3032,7 @@
                 referrer = r.activity.onProvideReferrer();
             }
             if (cmd.requestType == ActivityManager.ASSIST_CONTEXT_FULL || forAutofill) {
-                structure = new AssistStructure(r.activity, forAutofill);
+                structure = new AssistStructure(r.activity, forAutofill, cmd.flags);
                 Intent activityIntent = r.activity.getIntent();
                 boolean notSecure = r.window == null ||
                         (r.window.getAttributes().flags
diff --git a/core/java/android/app/BackStackRecord.java b/core/java/android/app/BackStackRecord.java
index cf274b4..46e6def 100644
--- a/core/java/android/app/BackStackRecord.java
+++ b/core/java/android/app/BackStackRecord.java
@@ -16,8 +16,6 @@
 
 package android.app;
 
-import android.content.Context;
-import android.content.pm.ApplicationInfo;
 import android.os.Build;
 import android.os.Parcel;
 import android.os.Parcelable;
@@ -45,7 +43,7 @@
     final CharSequence mBreadCrumbShortTitleText;
     final ArrayList<String> mSharedElementSourceNames;
     final ArrayList<String> mSharedElementTargetNames;
-    final boolean mAllowOptimization;
+    final boolean mReorderingAllowed;
 
     public BackStackState(FragmentManagerImpl fm, BackStackRecord bse) {
         final int numOps = bse.mOps.size();
@@ -75,7 +73,7 @@
         mBreadCrumbShortTitleText = bse.mBreadCrumbShortTitleText;
         mSharedElementSourceNames = bse.mSharedElementSourceNames;
         mSharedElementTargetNames = bse.mSharedElementTargetNames;
-        mAllowOptimization = bse.mAllowOptimization;
+        mReorderingAllowed = bse.mReorderingAllowed;
     }
 
     public BackStackState(Parcel in) {
@@ -90,7 +88,7 @@
         mBreadCrumbShortTitleText = TextUtils.CHAR_SEQUENCE_CREATOR.createFromParcel(in);
         mSharedElementSourceNames = in.createStringArrayList();
         mSharedElementTargetNames = in.createStringArrayList();
-        mAllowOptimization = in.readInt() != 0;
+        mReorderingAllowed = in.readInt() != 0;
     }
 
     public BackStackRecord instantiate(FragmentManagerImpl fm) {
@@ -133,7 +131,7 @@
         bse.mBreadCrumbShortTitleText = mBreadCrumbShortTitleText;
         bse.mSharedElementSourceNames = mSharedElementSourceNames;
         bse.mSharedElementTargetNames = mSharedElementTargetNames;
-        bse.mAllowOptimization = mAllowOptimization;
+        bse.mReorderingAllowed = mReorderingAllowed;
         bse.bumpBackStackNesting(1);
         return bse;
     }
@@ -154,7 +152,7 @@
         TextUtils.writeToParcel(mBreadCrumbShortTitleText, dest, 0);
         dest.writeStringList(mSharedElementSourceNames);
         dest.writeStringList(mSharedElementTargetNames);
-        dest.writeInt(mAllowOptimization ? 1 : 0);
+        dest.writeInt(mReorderingAllowed ? 1 : 0);
     }
 
     public static final Parcelable.Creator<BackStackState> CREATOR
@@ -218,7 +216,7 @@
     String mName;
     boolean mCommitted;
     int mIndex = -1;
-    boolean mAllowOptimization;
+    boolean mReorderingAllowed;
 
     ArrayList<Runnable> mCommitRunnables;
 
@@ -370,7 +368,7 @@
 
     public BackStackRecord(FragmentManagerImpl manager) {
         mManager = manager;
-        mAllowOptimization = mManager.getTargetSdk() > Build.VERSION_CODES.N_MR1;
+        mReorderingAllowed = mManager.getTargetSdk() > Build.VERSION_CODES.N_MR1;
     }
 
     public int getId() {
@@ -623,7 +621,7 @@
     }
 
     @Override
-    public FragmentTransaction postOnCommit(Runnable runnable) {
+    public FragmentTransaction runOnCommit(Runnable runnable) {
         if (runnable == null) {
             throw new IllegalArgumentException("runnable cannot be null");
         }
@@ -665,8 +663,8 @@
     }
 
     @Override
-    public FragmentTransaction setAllowOptimization(boolean allowOptimization) {
-        mAllowOptimization = allowOptimization;
+    public FragmentTransaction setReorderingAllowed(boolean reorderingAllowed) {
+        mReorderingAllowed = reorderingAllowed;
         return this;
     }
 
@@ -800,11 +798,11 @@
                 default:
                     throw new IllegalArgumentException("Unknown cmd: " + op.cmd);
             }
-            if (!mAllowOptimization && op.cmd != OP_ADD && f != null) {
+            if (!mReorderingAllowed && op.cmd != OP_ADD && f != null) {
                 mManager.moveFragmentToExpectedState(f);
             }
         }
-        if (!mAllowOptimization) {
+        if (!mReorderingAllowed) {
             // Added fragments are added at the end to comply with prior behavior.
             mManager.moveToState(mManager.mCurState, true);
         }
@@ -859,11 +857,11 @@
                 default:
                     throw new IllegalArgumentException("Unknown cmd: " + op.cmd);
             }
-            if (!mAllowOptimization && op.cmd != OP_REMOVE && f != null) {
+            if (!mReorderingAllowed && op.cmd != OP_REMOVE && f != null) {
                 mManager.moveFragmentToExpectedState(f);
             }
         }
-        if (!mAllowOptimization && moveToState) {
+        if (!mReorderingAllowed && moveToState) {
             mManager.moveToState(mManager.mCurState, true);
         }
     }
diff --git a/core/java/android/app/Fragment.java b/core/java/android/app/Fragment.java
index 759efdb..c2fd007 100644
--- a/core/java/android/app/Fragment.java
+++ b/core/java/android/app/Fragment.java
@@ -2417,7 +2417,7 @@
      * enabled.
      *
      * @see Activity#postponeEnterTransition()
-     * @see FragmentTransaction#setAllowOptimization(boolean)
+     * @see FragmentTransaction#setReorderingAllowed(boolean)
      */
     public void postponeEnterTransition() {
         ensureAnimationInfo().mEnterTransitionPostponed = true;
diff --git a/core/java/android/app/FragmentManager.java b/core/java/android/app/FragmentManager.java
index 9e8809a..63c0ef3 100644
--- a/core/java/android/app/FragmentManager.java
+++ b/core/java/android/app/FragmentManager.java
@@ -54,7 +54,6 @@
 import java.io.PrintWriter;
 import java.util.ArrayList;
 import java.util.Arrays;
-import java.util.Collection;
 import java.util.Collections;
 import java.util.List;
 import java.util.concurrent.CopyOnWriteArrayList;
@@ -453,6 +452,18 @@
         public void onFragmentAttached(FragmentManager fm, Fragment f, Context context) {}
 
         /**
+         * Called right before the fragment's {@link Fragment#onCreate(Bundle)} method is called.
+         * This is a good time to inject any required dependencies or perform other configuration
+         * for the fragment.
+         *
+         * @param fm Host FragmentManager
+         * @param f Fragment changing state
+         * @param savedInstanceState Saved instance bundle from a previous instance
+         */
+        public void onFragmentPreCreated(FragmentManager fm, Fragment f,
+                Bundle savedInstanceState) {}
+
+        /**
          * Called after the fragment has returned from the FragmentManager's call to
          * {@link Fragment#onCreate(Bundle)}. This will only happen once for any given
          * fragment instance, though the fragment may be attached and detached multiple times.
@@ -682,7 +693,7 @@
     String mNoTransactionsBecause;
     boolean mHavePendingDeferredStart;
 
-    // Temporary vars for optimizing execution of BackStackRecords:
+    // Temporary vars for removing redundant operations in BackStackRecords:
     ArrayList<BackStackRecord> mTmpRecords;
     ArrayList<Boolean> mTmpIsPop;
     ArrayList<Fragment> mTmpAddedFragments;
@@ -853,7 +864,7 @@
         if (executePop) {
             mExecutingActions = true;
             try {
-                optimizeAndExecuteOps(mTmpRecords, mTmpIsPop);
+                removeRedundantOperationsAndExecute(mTmpRecords, mTmpIsPop);
             } finally {
                 cleanupExec();
             }
@@ -1219,6 +1230,7 @@
                         dispatchOnFragmentAttached(f, mHost.getContext(), false);
 
                         if (!f.mRetaining) {
+                            dispatchOnFragmentPreCreated(f, f.mSavedFragmentState, false);
                             f.performCreate(f.mSavedFragmentState);
                             dispatchOnFragmentCreated(f, f.mSavedFragmentState, false);
                         } else {
@@ -2002,7 +2014,7 @@
         if (action.generateOps(mTmpRecords, mTmpIsPop)) {
             mExecutingActions = true;
             try {
-                optimizeAndExecuteOps(mTmpRecords, mTmpIsPop);
+                removeRedundantOperationsAndExecute(mTmpRecords, mTmpIsPop);
             } finally {
                 cleanupExec();
             }
@@ -2032,7 +2044,7 @@
         while (generateOpsForPendingActions(mTmpRecords, mTmpIsPop)) {
             mExecutingActions = true;
             try {
-                optimizeAndExecuteOps(mTmpRecords, mTmpIsPop);
+                removeRedundantOperationsAndExecute(mTmpRecords, mTmpIsPop);
             } finally {
                 cleanupExec();
             }
@@ -2080,19 +2092,20 @@
     }
 
     /**
-     * Optimizes BackStackRecord operations. This method merges operations of proximate records
-     * that allow optimization. See {@link FragmentTransaction#setAllowOptimization(boolean)}.
+     * Remove redundant BackStackRecord operations and executes them. This method merges operations
+     * of proximate records that allow reordering. See
+     * {@link FragmentTransaction#setReorderingAllowed(boolean)}.
      * <p>
      * For example, a transaction that adds to the back stack and then another that pops that
-     * back stack record will be optimized.
+     * back stack record will be optimized to remove the unnecessary operation.
      * <p>
      * Likewise, two transactions committed that are executed at the same time will be optimized
-     * as well as two pop operations executed together.
+     * to remove the redundant operations as well as two pop operations executed together.
      *
      * @param records The records pending execution
      * @param isRecordPop The direction that these records are being run.
      */
-    private void optimizeAndExecuteOps(ArrayList<BackStackRecord> records,
+    private void removeRedundantOperationsAndExecute(ArrayList<BackStackRecord> records,
             ArrayList<Boolean> isRecordPop) {
         if (records == null || records.isEmpty()) {
             return;
@@ -2108,24 +2121,25 @@
         final int numRecords = records.size();
         int startIndex = 0;
         for (int recordNum = 0; recordNum < numRecords; recordNum++) {
-            final boolean canOptimize = records.get(recordNum).mAllowOptimization;
-            if (!canOptimize) {
+            final boolean canReorder = records.get(recordNum).mReorderingAllowed;
+            if (!canReorder) {
                 // execute all previous transactions
                 if (startIndex != recordNum) {
                     executeOpsTogether(records, isRecordPop, startIndex, recordNum);
                 }
-                // execute all unoptimized pop operations together or one add operation
-                int optimizeEnd = recordNum + 1;
+                // execute all pop operations that don't allow reordering together or
+                // one add operation
+                int reorderingEnd = recordNum + 1;
                 if (isRecordPop.get(recordNum)) {
-                    while (optimizeEnd < numRecords
-                            && isRecordPop.get(optimizeEnd)
-                            && !records.get(optimizeEnd).mAllowOptimization) {
-                        optimizeEnd++;
+                    while (reorderingEnd < numRecords
+                            && isRecordPop.get(reorderingEnd)
+                            && !records.get(reorderingEnd).mReorderingAllowed) {
+                        reorderingEnd++;
                     }
                 }
-                executeOpsTogether(records, isRecordPop, recordNum, optimizeEnd);
-                startIndex = optimizeEnd;
-                recordNum = optimizeEnd - 1;
+                executeOpsTogether(records, isRecordPop, recordNum, reorderingEnd);
+                startIndex = reorderingEnd;
+                recordNum = reorderingEnd - 1;
             }
         }
         if (startIndex != numRecords) {
@@ -2134,16 +2148,16 @@
     }
 
     /**
-     * Optimizes a subset of a list of BackStackRecords, all of which either allow optimization or
-     * do not allow optimization.
-     * @param records A list of BackStackRecords that are to be optimized
+     * Executes a subset of a list of BackStackRecords, all of which either allow reordering or
+     * do not allow ordering.
+     * @param records A list of BackStackRecords that are to be executed together
      * @param isRecordPop The direction that these records are being run.
-     * @param startIndex The index of the first record in <code>records</code> to be optimized
-     * @param endIndex One more than the final record index in <code>records</code> to optimize.
+     * @param startIndex The index of the first record in <code>records</code> to be executed
+     * @param endIndex One more than the final record index in <code>records</code> to executed.
      */
     private void executeOpsTogether(ArrayList<BackStackRecord> records,
             ArrayList<Boolean> isRecordPop, int startIndex, int endIndex) {
-        final boolean allowOptimization = records.get(startIndex).mAllowOptimization;
+        final boolean allowReordering = records.get(startIndex).mReorderingAllowed;
         boolean addToBackStack = false;
         if (mTmpAddedFragments == null) {
             mTmpAddedFragments = new ArrayList<>();
@@ -2166,14 +2180,14 @@
         }
         mTmpAddedFragments.clear();
 
-        if (!allowOptimization) {
+        if (!allowReordering) {
             FragmentTransition.startTransitions(this, records, isRecordPop, startIndex, endIndex,
                     false);
         }
         executeOps(records, isRecordPop, startIndex, endIndex);
 
         int postponeIndex = endIndex;
-        if (allowOptimization) {
+        if (allowReordering) {
             ArraySet<Fragment> addedFragments = new ArraySet<>();
             addAddedFragments(addedFragments);
             postponeIndex = postponePostponableTransactions(records, isRecordPop,
@@ -2181,7 +2195,7 @@
             makeRemovedFragmentsInvisible(addedFragments);
         }
 
-        if (postponeIndex != startIndex && allowOptimization) {
+        if (postponeIndex != startIndex && allowReordering) {
             // need to run something now
             FragmentTransition.startTransitions(this, records, isRecordPop, startIndex,
                     postponeIndex, true);
@@ -3273,6 +3287,25 @@
         }
     }
 
+    void dispatchOnFragmentPreCreated(Fragment f, Bundle savedInstanceState,
+            boolean onlyRecursive) {
+        if (mParent != null) {
+            FragmentManager parentManager = mParent.getFragmentManager();
+            if (parentManager instanceof FragmentManagerImpl) {
+                ((FragmentManagerImpl) parentManager)
+                        .dispatchOnFragmentPreCreated(f, savedInstanceState, true);
+            }
+        }
+        if (mLifecycleCallbacks == null) {
+            return;
+        }
+        for (Pair<FragmentLifecycleCallbacks, Boolean> p : mLifecycleCallbacks) {
+            if (!onlyRecursive || p.second) {
+                p.first.onFragmentPreCreated(this, f, savedInstanceState);
+            }
+        }
+    }
+
     void dispatchOnFragmentCreated(Fragment f, Bundle savedInstanceState, boolean onlyRecursive) {
         if (mParent != null) {
             FragmentManager parentManager = mParent.getFragmentManager();
diff --git a/core/java/android/app/FragmentTransaction.java b/core/java/android/app/FragmentTransaction.java
index c938aa6..c910e90 100644
--- a/core/java/android/app/FragmentTransaction.java
+++ b/core/java/android/app/FragmentTransaction.java
@@ -6,6 +6,7 @@
 import android.annotation.Nullable;
 import android.annotation.StringRes;
 import android.annotation.StyleRes;
+import android.os.Bundle;
 import android.view.View;
 
 import java.lang.annotation.Retention;
@@ -279,45 +280,57 @@
 
     /**
      * Sets whether or not to allow optimizing operations within and across
-     * transactions. Optimizing fragment transaction's operations can eliminate
+     * transactions. This will remove redundant operations, eliminating
      * operations that cancel. For example, if two transactions are executed
      * together, one that adds a fragment A and the next replaces it with fragment B,
      * the operations will cancel and only fragment B will be added. That means that
      * fragment A may not go through the creation/destruction lifecycle.
      * <p>
-     * The side effect of optimization is that fragments may have state changes
+     * The side effect of removing redundant operations is that fragments may have state changes
      * out of the expected order. For example, one transaction adds fragment A,
-     * a second adds fragment B, then a third removes fragment A. Without optimization,
-     * fragment B could expect that while it is being created, fragment A will also
+     * a second adds fragment B, then a third removes fragment A. Without removing the redundant
+     * operations, fragment B could expect that while it is being created, fragment A will also
      * exist because fragment A will be removed after fragment B was added.
-     * With optimization, fragment B cannot expect fragment A to exist when
+     * With removing redundant operations, fragment B cannot expect fragment A to exist when
      * it has been created because fragment A's add/remove will be optimized out.
      * <p>
+     * It can also reorder the state changes of Fragments to allow for better Transitions.
+     * Added Fragments may have {@link Fragment#onCreate(Bundle)} called before replaced
+     * Fragments have {@link Fragment#onDestroy()} called.
+     * <p>
      * The default is {@code false} for applications targeting version
      * versions prior to O and {@code true} for applications targeting O and
      * later.
      *
-     * @param allowOptimization {@code true} to enable optimizing operations
-     *                          or {@code false} to disable optimizing
+     * @param reorderingAllowed {@code true} to enable optimizing out redundant operations
+     *                          or {@code false} to disable optimizing out redundant
      *                          operations on this transaction.
      */
-    public abstract FragmentTransaction setAllowOptimization(boolean allowOptimization);
+    public abstract FragmentTransaction setReorderingAllowed(boolean reorderingAllowed);
 
     /**
      * Add a Runnable to this transaction that will be run after this transaction has
-     * been committed. If fragment transactions are {@link #setAllowOptimization(boolean) optimized}
+     * been committed. If fragment transactions are {@link #setReorderingAllowed(boolean) optimized}
      * this may be after other subsequent fragment operations have also taken place, or operations
      * in this transaction may have been optimized out due to the presence of a subsequent
      * fragment transaction in the batch.
      *
-     * <p><code>postOnCommit</code> may not be used with transactions
+     *
+     * <p>If a transaction is committed using {@link #commitAllowingStateLoss()} this runnable
+     * may be executed when the FragmentManager is in a state where new transactions may not
+     * be committed without allowing state loss.</p>
+     *
+     * <p><code>runOnCommit</code> may not be used with transactions
      * {@link #addToBackStack(String) added to the back stack} as Runnables cannot be persisted
-     * with back stack state.</p>
+     * with back stack state. {@link IllegalStateException} will be thrown if
+     * {@link #addToBackStack(String)} has been previously called for this transaction
+     * or if it is called after a call to <code>runOnCommit</code>.</p>
      *
      * @param runnable Runnable to add
      * @return this FragmentTransaction
+     * @throws IllegalStateException if {@link #addToBackStack(String)} has been called
      */
-    public abstract FragmentTransaction postOnCommit(Runnable runnable);
+    public abstract FragmentTransaction runOnCommit(Runnable runnable);
 
     /**
      * Schedules a commit of this transaction.  The commit does
diff --git a/core/java/android/app/FragmentTransition.java b/core/java/android/app/FragmentTransition.java
index b4c6dce..ceb828b 100644
--- a/core/java/android/app/FragmentTransition.java
+++ b/core/java/android/app/FragmentTransition.java
@@ -34,9 +34,10 @@
 import java.util.Map;
 
 /**
- * Contains the Fragment Transition functionality for both optimized and unoptimized
- * Fragment Transactions. With optimized fragment transactions, all Views have been
- * added to the View hierarchy prior to calling startTransitions. With
+ * Contains the Fragment Transition functionality for both ordered and reordered
+ * Fragment Transactions. With reordered fragment transactions, all Views have been
+ * added to the View hierarchy prior to calling startTransitions. With ordered
+ * fragment transactions, Views will be removed and added after calling startTransitions.
  */
 class FragmentTransition {
     /**
@@ -65,9 +66,9 @@
      * {@link Fragment#getSharedElementReturnTransition()} and the entering
      * {@link Fragment#getReenterTransition()} will be run.
      * <p>
-     * With optimized Fragment Transitions, all Views have been added to the
+     * With reordered Fragment Transitions, all Views have been added to the
      * View hierarchy prior to calling this method. The incoming Fragment's Views
-     * will be INVISIBLE. With unoptimized Fragment Transitions, this method
+     * will be INVISIBLE. With ordered Fragment Transitions, this method
      * is called before any change has been made to the hierarchy. That means
      * that the added Fragments have not created their Views yet and the hierarchy
      * is unknown.
@@ -79,13 +80,13 @@
      *                   part of this transition.
      * @param endIndex One past the last index into records and isRecordPop to execute
      *                 as part of this transition.
-     * @param isOptimized true if this is an optimized transaction, meaning that the
+     * @param isReordered true if this is a reordered transaction, meaning that the
      *                    Views of incoming fragments have been added. false if the
      *                    transaction has yet to be run and Views haven't been created.
      */
     static void startTransitions(FragmentManagerImpl fragmentManager,
             ArrayList<BackStackRecord> records, ArrayList<Boolean> isRecordPop,
-            int startIndex, int endIndex, boolean isOptimized) {
+            int startIndex, int endIndex, boolean isReordered) {
         if (fragmentManager.mCurState < Fragment.CREATED) {
             return;
         }
@@ -95,9 +96,9 @@
             final BackStackRecord record = records.get(i);
             final boolean isPop = isRecordPop.get(i);
             if (isPop) {
-                calculatePopFragments(record, transitioningFragments, isOptimized);
+                calculatePopFragments(record, transitioningFragments, isReordered);
             } else {
-                calculateFragments(record, transitioningFragments, isOptimized);
+                calculateFragments(record, transitioningFragments, isReordered);
             }
         }
 
@@ -111,11 +112,11 @@
 
                 FragmentContainerTransition containerTransition = transitioningFragments.valueAt(i);
 
-                if (isOptimized) {
-                    configureTransitionsOptimized(fragmentManager, containerId,
+                if (isReordered) {
+                    configureTransitionsReordered(fragmentManager, containerId,
                             containerTransition, nonExistentView, nameOverrides);
                 } else {
-                    configureTransitionsUnoptimized(fragmentManager, containerId,
+                    configureTransitionsOrdered(fragmentManager, containerId,
                             containerTransition, nonExistentView, nameOverrides);
                 }
             }
@@ -175,7 +176,7 @@
 
     /**
      * Configures a transition for a single fragment container for which the transaction was
-     * optimized. That means that all Fragment Views have been added and incoming fragment
+     * reordered. That means that all Fragment Views have been added and incoming fragment
      * Views are marked invisible.
      *
      * @param fragmentManager The executing FragmentManagerImpl
@@ -188,7 +189,7 @@
      *                      the final fragment's Views as given in
      *                      {@link FragmentTransaction#addSharedElement(View, String)}.
      */
-    private static void configureTransitionsOptimized(FragmentManagerImpl fragmentManager,
+    private static void configureTransitionsReordered(FragmentManagerImpl fragmentManager,
             int containerId, FragmentContainerTransition fragments,
             View nonExistentView, ArrayMap<String, String> nameOverrides) {
         ViewGroup sceneRoot = null;
@@ -208,7 +209,7 @@
         Transition enterTransition = getEnterTransition(inFragment, inIsPop);
         Transition exitTransition = getExitTransition(outFragment, outIsPop);
 
-        TransitionSet sharedElementTransition = configureSharedElementsOptimized(sceneRoot,
+        TransitionSet sharedElementTransition = configureSharedElementsReordered(sceneRoot,
                 nonExistentView, nameOverrides, fragments, sharedElementsOut, sharedElementsIn,
                 enterTransition, exitTransition);
 
@@ -247,7 +248,7 @@
 
     /**
      * Configures a transition for a single fragment container for which the transaction was
-     * not optimized. That means that the transaction has not been executed yet, so incoming
+     * ordered. That means that the transaction has not been executed yet, so incoming
      * Views are not yet known.
      *
      * @param fragmentManager The executing FragmentManagerImpl
@@ -260,7 +261,7 @@
      *                      the final fragment's Views as given in
      *                      {@link FragmentTransaction#addSharedElement(View, String)}.
      */
-    private static void configureTransitionsUnoptimized(FragmentManagerImpl fragmentManager,
+    private static void configureTransitionsOrdered(FragmentManagerImpl fragmentManager,
             int containerId, FragmentContainerTransition fragments,
             View nonExistentView, ArrayMap<String, String> nameOverrides) {
         ViewGroup sceneRoot = null;
@@ -281,7 +282,7 @@
         ArrayList<View> sharedElementsOut = new ArrayList<>();
         ArrayList<View> sharedElementsIn = new ArrayList<>();
 
-        TransitionSet sharedElementTransition = configureSharedElementsUnoptimized(sceneRoot,
+        TransitionSet sharedElementTransition = configureSharedElementsOrdered(sceneRoot,
                 nonExistentView, nameOverrides, fragments, sharedElementsOut, sharedElementsIn,
                 enterTransition, exitTransition);
 
@@ -345,7 +346,7 @@
     }
 
     /**
-     * This method is used for fragment transitions for unoptimized transactions to change the
+     * This method is used for fragment transitions for ordered transactions to change the
      * enter and exit transition targets after the call to
      * {@link TransitionManager#beginDelayedTransition(ViewGroup, Transition)}. The exit transition
      * must ensure that it does not target any Views and the enter transition must start targeting
@@ -448,7 +449,7 @@
     }
 
     /**
-     * Configures the shared elements of an optimized fragment transaction's transition.
+     * Configures the shared elements of an reordered fragment transaction's transition.
      * This retrieves the shared elements of the outgoing and incoming fragments, maps the
      * views, and sets up the epicenter on the transitions.
      * <p>
@@ -474,7 +475,7 @@
      *                       epicenter
      * @return The shared element transition or null if no shared elements exist
      */
-    private static TransitionSet configureSharedElementsOptimized(final ViewGroup sceneRoot,
+    private static TransitionSet configureSharedElementsReordered(final ViewGroup sceneRoot,
             final View nonExistentView, ArrayMap<String, String> nameOverrides,
             final FragmentContainerTransition fragments,
             final ArrayList<View> sharedElementsOut,
@@ -576,7 +577,7 @@
     }
 
     /**
-     * Configures the shared elements of an unoptimized fragment transaction's transition.
+     * Configures the shared elements of an ordered fragment transaction's transition.
      * This retrieves the shared elements of the incoming fragments, and schedules capturing
      * the incoming fragment's shared elements. It also maps the views, and sets up the epicenter
      * on the transitions.
@@ -603,7 +604,7 @@
      *                       epicenter
      * @return The shared element transition or null if no shared elements exist
      */
-    private static TransitionSet configureSharedElementsUnoptimized(final ViewGroup sceneRoot,
+    private static TransitionSet configureSharedElementsOrdered(final ViewGroup sceneRoot,
             final View nonExistentView, ArrayMap<String, String> nameOverrides,
             final FragmentContainerTransition fragments,
             final ArrayList<View> sharedElementsOut,
@@ -1195,11 +1196,11 @@
      */
     public static void calculateFragments(BackStackRecord transaction,
             SparseArray<FragmentContainerTransition> transitioningFragments,
-            boolean isOptimized) {
+            boolean isReordered) {
         final int numOps = transaction.mOps.size();
         for (int opNum = 0; opNum < numOps; opNum++) {
             final BackStackRecord.Op op = transaction.mOps.get(opNum);
-            addToFirstInLastOut(transaction, op, transitioningFragments, false, isOptimized);
+            addToFirstInLastOut(transaction, op, transitioningFragments, false, isReordered);
         }
     }
 
@@ -1212,14 +1213,14 @@
      *                               this method.
      */
     public static void calculatePopFragments(BackStackRecord transaction,
-            SparseArray<FragmentContainerTransition> transitioningFragments, boolean isOptimized) {
+            SparseArray<FragmentContainerTransition> transitioningFragments, boolean isReordered) {
         if (!transaction.mManager.mContainer.onHasView()) {
             return; // nothing to see, so no transitions
         }
         final int numOps = transaction.mOps.size();
         for (int opNum = numOps - 1; opNum >= 0; opNum--) {
             final BackStackRecord.Op op = transaction.mOps.get(opNum);
-            addToFirstInLastOut(transaction, op, transitioningFragments, true, isOptimized);
+            addToFirstInLastOut(transaction, op, transitioningFragments, true, isReordered);
         }
     }
 
@@ -1232,14 +1233,14 @@
      * @param transitioningFragments A structure holding the first in and last out fragments
      *                               for each fragment container.
      * @param isPop Is the operation a pop?
-     * @param isOptimizedTransaction True if the operations have been partially executed and the
+     * @param isReorderedTransaction True if the operations have been partially executed and the
      *                               added fragments have Views in the hierarchy or false if the
      *                               operations haven't been executed yet.
      */
     @SuppressWarnings("ReferenceEquality")
     private static void addToFirstInLastOut(BackStackRecord transaction, BackStackRecord.Op op,
             SparseArray<FragmentContainerTransition> transitioningFragments, boolean isPop,
-            boolean isOptimizedTransaction) {
+            boolean isReorderedTransaction) {
         final Fragment fragment = op.fragment;
         if (fragment == null) {
             return; // no fragment, no transition
@@ -1255,7 +1256,7 @@
         boolean wasAdded = false;
         switch (command) {
             case BackStackRecord.OP_SHOW:
-                if (isOptimizedTransaction) {
+                if (isReorderedTransaction) {
                     setLastIn = fragment.mHiddenChanged && !fragment.mHidden &&
                             fragment.mAdded;
                 } else {
@@ -1265,7 +1266,7 @@
                 break;
             case BackStackRecord.OP_ADD:
             case BackStackRecord.OP_ATTACH:
-                if (isOptimizedTransaction) {
+                if (isReorderedTransaction) {
                     setLastIn = fragment.mIsNewlyAdded;
                 } else {
                     setLastIn = !fragment.mAdded && !fragment.mHidden;
@@ -1273,7 +1274,7 @@
                 wasAdded = true;
                 break;
             case BackStackRecord.OP_HIDE:
-                if (isOptimizedTransaction) {
+                if (isReorderedTransaction) {
                     setFirstOut = fragment.mHiddenChanged && fragment.mAdded &&
                             fragment.mHidden;
                 } else {
@@ -1283,7 +1284,7 @@
                 break;
             case BackStackRecord.OP_REMOVE:
             case BackStackRecord.OP_DETACH:
-                if (isOptimizedTransaction) {
+                if (isReorderedTransaction) {
                     setFirstOut = !fragment.mAdded && fragment.mView != null
                             && fragment.mView.getVisibility() == View.VISIBLE
                             && fragment.mView.getTransitionAlpha() > 0;
@@ -1301,7 +1302,7 @@
             containerTransition.lastInIsPop = isPop;
             containerTransition.lastInTransaction = transaction;
         }
-        if (!isOptimizedTransaction && wasAdded) {
+        if (!isReorderedTransaction && wasAdded) {
             if (containerTransition != null && containerTransition.firstOut == fragment) {
                 containerTransition.firstOut = null;
             }
@@ -1313,7 +1314,7 @@
             FragmentManagerImpl manager = transaction.mManager;
             if (fragment.mState < Fragment.CREATED && manager.mCurState >= Fragment.CREATED &&
                     manager.mHost.getContext().getApplicationInfo().targetSdkVersion >=
-                            Build.VERSION_CODES.N && !transaction.mAllowOptimization) {
+                            Build.VERSION_CODES.N && !transaction.mReorderingAllowed) {
                 manager.makeActive(fragment);
                 manager.moveToState(fragment, Fragment.CREATED, 0, 0, false);
             }
@@ -1326,7 +1327,7 @@
             containerTransition.firstOutTransaction = transaction;
         }
 
-        if (!isOptimizedTransaction && wasRemoved &&
+        if (!isReorderedTransaction && wasRemoved &&
                 (containerTransition != null && containerTransition.lastIn == fragment)) {
             containerTransition.lastIn = null;
         }
diff --git a/core/java/android/app/IActivityManager.aidl b/core/java/android/app/IActivityManager.aidl
index 5ee8e0c..aeccf56 100644
--- a/core/java/android/app/IActivityManager.aidl
+++ b/core/java/android/app/IActivityManager.aidl
@@ -594,7 +594,7 @@
     void unregisterTaskStackListener(ITaskStackListener listener);
     void moveStackToDisplay(int stackId, int displayId);
     boolean requestAutofillData(in IResultReceiver receiver, in Bundle receiverExtras,
-                                in IBinder activityToken);
+                                in IBinder activityToken, int flags);
     void dismissKeyguard(in IBinder token, in IKeyguardDismissCallback callback);
     int restartUserInBackground(int userId);
 
@@ -605,7 +605,7 @@
     void cancelTaskThumbnailTransition(int taskId);
 
     /**
-     * @param taskId the id of the task to retrieve the snapshots for
+     * @param taskId the id of the task to retrieve the sAutoapshots for
      * @param reducedResolution if set, if the snapshot needs to be loaded from disk, this will load
      *                          a reduced resolution of it, which is much faster
      * @return a graphic buffer representing a screenshot of a task
diff --git a/core/java/android/app/IApplicationThread.aidl b/core/java/android/app/IApplicationThread.aidl
index 1b3c00b..b3521c0 100644
--- a/core/java/android/app/IApplicationThread.aidl
+++ b/core/java/android/app/IApplicationThread.aidl
@@ -135,7 +135,7 @@
     void dumpDbInfo(in ParcelFileDescriptor fd, in String[] args);
     void unstableProviderDied(IBinder provider);
     void requestAssistContextExtras(IBinder activityToken, IBinder requestToken,
-            int requestType, int sessionId);
+            int requestType, int sessionId, int flags);
     void scheduleTranslucentConversionComplete(IBinder token, boolean timeout);
     void setProcessState(int state);
     void scheduleInstallProvider(in ProviderInfo provider);
diff --git a/core/java/android/app/Instrumentation.java b/core/java/android/app/Instrumentation.java
index 9377d35..69ed439 100644
--- a/core/java/android/app/Instrumentation.java
+++ b/core/java/android/app/Instrumentation.java
@@ -543,10 +543,10 @@
          * Create a new ActivityMonitor that can be used for intercepting any activity to be
          * started.
          *
-         * <p> When an activity is started, {@link #onMatchIntent(Intent)} will be called on
+         * <p> When an activity is started, {@link #onStartActivity(Intent)} will be called on
          * instances created using this constructor to see if it is a hit.
          *
-         * @see #onMatchIntent(Intent)
+         * @see #onStartActivity(Intent)
          */
         public ActivityMonitor() {
             mWhich = null;
@@ -558,7 +558,7 @@
 
         /**
          * @return true if this monitor is used for intercepting any started activity by calling
-         *         into {@link #onMatchIntent(Intent)}, false if this monitor is only used
+         *         into {@link #onStartActivity(Intent)}, false if this monitor is only used
          *         for specific intents corresponding to the intent filter or activity class
          *         passed in the constructor.
          */
@@ -665,7 +665,7 @@
          * @param intent The intent used for starting the activity.
          * @return The {@link ActivityResult} that needs to be used in case of a match.
          */
-        public ActivityResult onMatchIntent(Intent intent) {
+        public ActivityResult onStartActivity(Intent intent) {
             return null;
         }
 
@@ -1589,7 +1589,7 @@
                     final ActivityMonitor am = mActivityMonitors.get(i);
                     ActivityResult result = null;
                     if (am.ignoreMatchingSpecificIntents()) {
-                        result = am.onMatchIntent(intent);
+                        result = am.onStartActivity(intent);
                     }
                     if (result != null) {
                         am.mHits++;
@@ -1652,7 +1652,7 @@
                     final ActivityMonitor am = mActivityMonitors.get(i);
                     ActivityResult result = null;
                     if (am.ignoreMatchingSpecificIntents()) {
-                        result = am.onMatchIntent(intents[0]);
+                        result = am.onStartActivity(intents[0]);
                     }
                     if (result != null) {
                         am.mHits++;
@@ -1722,7 +1722,7 @@
                     final ActivityMonitor am = mActivityMonitors.get(i);
                     ActivityResult result = null;
                     if (am.ignoreMatchingSpecificIntents()) {
-                        result = am.onMatchIntent(intent);
+                        result = am.onStartActivity(intent);
                     }
                     if (result != null) {
                         am.mHits++;
@@ -1789,7 +1789,7 @@
                     final ActivityMonitor am = mActivityMonitors.get(i);
                     ActivityResult result = null;
                     if (am.ignoreMatchingSpecificIntents()) {
-                        result = am.onMatchIntent(intent);
+                        result = am.onStartActivity(intent);
                     }
                     if (result != null) {
                         am.mHits++;
@@ -1835,7 +1835,7 @@
                     final ActivityMonitor am = mActivityMonitors.get(i);
                     ActivityResult result = null;
                     if (am.ignoreMatchingSpecificIntents()) {
-                        result = am.onMatchIntent(intent);
+                        result = am.onStartActivity(intent);
                     }
                     if (result != null) {
                         am.mHits++;
@@ -1880,7 +1880,7 @@
                     final ActivityMonitor am = mActivityMonitors.get(i);
                     ActivityResult result = null;
                     if (am.ignoreMatchingSpecificIntents()) {
-                        result = am.onMatchIntent(intent);
+                        result = am.onStartActivity(intent);
                     }
                     if (result != null) {
                         am.mHits++;
diff --git a/core/java/android/app/KeyguardManager.java b/core/java/android/app/KeyguardManager.java
index b8a5f57..4de6e44 100644
--- a/core/java/android/app/KeyguardManager.java
+++ b/core/java/android/app/KeyguardManager.java
@@ -381,27 +381,58 @@
      *                 or {@code null} if the caller isn't interested in knowing the result.
      * @param handler The handler to invoke the callback on, or {@code null} to use the main
      *                handler.
+     *
+     * TO BE REMOVED
      */
+    @Deprecated
     public void dismissKeyguard(@NonNull Activity activity,
             @Nullable KeyguardDismissCallback callback, @Nullable Handler handler) {
+        requestDismissKeyguard(activity, callback);
+    }
+
+    /**
+     * If the device is currently locked (see {@link #isKeyguardLocked()}, requests the Keyguard to
+     * be dismissed.
+     * <p>
+     * If the Keyguard is not secure or the device is currently in a trusted state, calling this
+     * method will immediately dismiss the Keyguard without any user interaction.
+     * <p>
+     * If the Keyguard is secure and the device is not in a trusted state, this will bring up the
+     * UI so the user can enter their credentials.
+     *
+     * @param activity The activity requesting the dismissal. The activity must be either visible
+     *                 by using {@link LayoutParams#FLAG_SHOW_WHEN_LOCKED} or must be in a state in
+     *                 which it would be visible if Keyguard would not be hiding it. If that's not
+     *                 the case, the request will fail immediately and
+     *                 {@link KeyguardDismissCallback#onDismissError} will be invoked.
+     * @param callback The callback to be called if the request to dismiss Keyguard was successful
+     *                 or {@code null} if the caller isn't interested in knowing the result. The
+     *                 callback will not be invoked if the activity was destroyed before the
+     *                 callback was received.
+     */
+    public void requestDismissKeyguard(@NonNull Activity activity,
+            @Nullable KeyguardDismissCallback callback) {
         try {
-            final Handler actualHandler = handler != null
-                    ? handler
-                    : new Handler(Looper.getMainLooper());
             mAm.dismissKeyguard(activity.getActivityToken(), new IKeyguardDismissCallback.Stub() {
                 @Override
                 public void onDismissError() throws RemoteException {
-                    actualHandler.post(callback::onDismissError);
+                    if (callback != null && !activity.isDestroyed()) {
+                        activity.mHandler.post(callback::onDismissError);
+                    }
                 }
 
                 @Override
                 public void onDismissSucceeded() throws RemoteException {
-                    actualHandler.post(callback::onDismissSucceeded);
+                    if (callback != null && !activity.isDestroyed()) {
+                        activity.mHandler.post(callback::onDismissSucceeded);
+                    }
                 }
 
                 @Override
                 public void onDismissCancelled() throws RemoteException {
-                    actualHandler.post(callback::onDismissCancelled);
+                    if (callback != null && !activity.isDestroyed()) {
+                        activity.mHandler.post(callback::onDismissCancelled);
+                    }
                 }
             });
         } catch (RemoteException e) {
diff --git a/core/java/android/app/Notification.java b/core/java/android/app/Notification.java
index 00a8f46..28fe319 100644
--- a/core/java/android/app/Notification.java
+++ b/core/java/android/app/Notification.java
@@ -239,16 +239,11 @@
      * The number of events that this notification represents. For example, in a new mail
      * notification, this could be the number of unread messages.
      *
-     * The system may or may not use this field to modify the appearance of the notification. For
-     * example, before {@link android.os.Build.VERSION_CODES#HONEYCOMB}, this number was
-     * superimposed over the icon in the status bar. Starting with
-     * {@link android.os.Build.VERSION_CODES#HONEYCOMB}, the template used by
-     * {@link Notification.Builder} has displayed the number in the expanded notification view.
+     * The system may or may not use this field to modify the appearance of the notification.
      * Starting with {@link android.os.Build.VERSION_CODES#O}, the number may be displayed as a
      * badge icon in Launchers that support badging.
-     *
      */
-    public int number = 1;
+    public int number = 0;
 
     /**
      * The intent to execute when the expanded status entry is clicked.  If
@@ -1290,7 +1285,7 @@
          * action is sent. These remote inputs are guaranteed to return true on a call to
          * {@link RemoteInput#isDataOnly}.
          *
-         * May return null if no data-only remote inputs were added.
+         * Returns null if there are no data-only remote inputs.
          *
          * This method exists so that legacy RemoteInput collectors that pre-date the addition
          * of non-textual RemoteInputs do not access these remote inputs.
@@ -2681,21 +2676,12 @@
         private int mPrimaryTextColor = COLOR_INVALID;
         private int mSecondaryTextColor = COLOR_INVALID;
         private int mActionBarColor = COLOR_INVALID;
+        private int mBackgroundColor = COLOR_INVALID;
+        private int mForegroundColor = COLOR_INVALID;
 
         /**
          * Constructs a new Builder with the defaults:
          *
-
-         * <table>
-         * <tr><th align=right>priority</th>
-         *     <td>{@link #PRIORITY_DEFAULT}</td></tr>
-         * <tr><th align=right>when</th>
-         *     <td>now ({@link System#currentTimeMillis()})</td></tr>
-         * <tr><th align=right>audio stream</th>
-         *     <td>{@link #STREAM_DEFAULT}</td></tr>
-         * </table>
-         *
-
          * @param context
          *            A {@link Context} that will be used by the Builder to construct the
          *            RemoteViews. The Context will not be held past the lifetime of this Builder
@@ -3854,10 +3840,62 @@
                     || mActionBarColor == COLOR_INVALID
                     || mTextColorsAreForBackground != backgroundColor) {
                 mTextColorsAreForBackground = backgroundColor;
-                mPrimaryTextColor = NotificationColorUtil.resolvePrimaryColor(
-                        mContext, backgroundColor);
-                mSecondaryTextColor = NotificationColorUtil.resolveSecondaryColor(
-                        mContext, backgroundColor);
+                if (mForegroundColor == COLOR_INVALID || !isColorized()) {
+                    mPrimaryTextColor = NotificationColorUtil.resolvePrimaryColor(mContext,
+                            backgroundColor);
+                    mSecondaryTextColor = NotificationColorUtil.resolveSecondaryColor(mContext,
+                            backgroundColor);
+                } else {
+                    double backLum = NotificationColorUtil.calculateLuminance(backgroundColor);
+                    double textLum = NotificationColorUtil.calculateLuminance(mForegroundColor);
+                    double contrast = NotificationColorUtil.calculateContrast(mForegroundColor,
+                            backgroundColor);
+                    boolean textDark = backLum > textLum;
+                    if (contrast < 4.5f) {
+                        if (textDark) {
+                            mSecondaryTextColor = NotificationColorUtil.findContrastColor(
+                                    mForegroundColor,
+                                    backgroundColor,
+                                    true /* findFG */,
+                                    4.5f);
+                            mPrimaryTextColor = NotificationColorUtil.changeColorLightness(
+                                    mSecondaryTextColor, -20);
+                        } else {
+                            mSecondaryTextColor =
+                                    NotificationColorUtil.findContrastColorAgainstDark(
+                                    mForegroundColor,
+                                    backgroundColor,
+                                    true /* findFG */,
+                                    4.5f);
+                            mPrimaryTextColor = NotificationColorUtil.changeColorLightness(
+                                    mSecondaryTextColor, 10);
+                        }
+                    } else {
+                        mPrimaryTextColor = mForegroundColor;
+                        mSecondaryTextColor = NotificationColorUtil.changeColorLightness(
+                                mPrimaryTextColor, textDark ? 10 : -20);
+                        if (NotificationColorUtil.calculateContrast(mSecondaryTextColor,
+                                backgroundColor) < 4.5f) {
+                            // oh well the secondary is not good enough
+                            if (textDark) {
+                                mSecondaryTextColor = NotificationColorUtil.findContrastColor(
+                                        mSecondaryTextColor,
+                                        backgroundColor,
+                                        true /* findFG */,
+                                        4.5f);
+                            } else {
+                                mSecondaryTextColor
+                                        = NotificationColorUtil.findContrastColorAgainstDark(
+                                        mSecondaryTextColor,
+                                        backgroundColor,
+                                        true /* findFG */,
+                                        4.5f);
+                            }
+                            mPrimaryTextColor = NotificationColorUtil.changeColorLightness(
+                                    mSecondaryTextColor, textDark ? -20 : 10);
+                        }
+                    }
+                }
                 mActionBarColor = NotificationColorUtil.resolveActionBarColor(mContext,
                         backgroundColor);
             }
@@ -4845,7 +4883,7 @@
 
         private int getBackgroundColor() {
             if (isColorized()) {
-                return mN.color;
+                return mBackgroundColor != COLOR_INVALID ? mBackgroundColor : mN.color;
             } else {
                 return COLOR_DEFAULT;
             }
@@ -4863,6 +4901,21 @@
             return targetSdkVersion > Build.VERSION_CODES.M
                     && targetSdkVersion < Build.VERSION_CODES.O;
         }
+
+        /**
+         * Set a color palette to be used as the background and textColors
+         *
+         * @param backgroundColor the color to be used as the background
+         * @param foregroundColor the color to be used as the foreground
+         *
+         * @hide
+         */
+        public void setColorPalette(int backgroundColor, int foregroundColor) {
+            mBackgroundColor = backgroundColor;
+            mForegroundColor = foregroundColor;
+            mTextColorsAreForBackground = COLOR_INVALID;
+            ensureColors();
+        }
     }
 
     /**
@@ -4899,6 +4952,18 @@
      * @hide
      */
     public boolean isColorized() {
+        if (isColorizedMedia()) {
+            return true;
+        }
+        return extras.getBoolean(EXTRA_COLORIZED) && isForegroundService();
+    }
+
+    /**
+     * @return true if this notification is colorized and it is a media notification
+     *
+     * @hide
+     */
+    public boolean isColorizedMedia() {
         Class<? extends Style> style = getNotificationStyle();
         if (MediaStyle.class.equals(style)) {
             Boolean colorized = (Boolean) extras.get(EXTRA_COLORIZED);
@@ -4910,7 +4975,23 @@
                 return true;
             }
         }
-        return extras.getBoolean(EXTRA_COLORIZED) && isForegroundService();
+        return false;
+    }
+
+
+    /**
+     * @return true if this is a media notification
+     *
+     * @hide
+     */
+    public boolean isMediaNotification() {
+        Class<? extends Style> style = getNotificationStyle();
+        if (MediaStyle.class.equals(style)) {
+            return true;
+        } else if (DecoratedMediaCustomViewStyle.class.equals(style)) {
+            return true;
+        }
+        return false;
     }
 
     private boolean hasLargeIcon() {
diff --git a/core/java/android/app/NotificationManager.java b/core/java/android/app/NotificationManager.java
index 7c361b9..6c55548 100644
--- a/core/java/android/app/NotificationManager.java
+++ b/core/java/android/app/NotificationManager.java
@@ -422,7 +422,9 @@
      * Creates a notification channel that notifications can be posted to.
      *
      * This can also be used to restore a deleted channel and to update an existing channel's
-     * name and description. The name and description should only be changed if the locale changes
+     * name and description.
+     *
+     * <p>The name and description should only be changed if the locale changes
      * or in response to the user renaming this channel. For example, if a user has a channel
      * named 'John Doe' that represents messages from a 'John Doe', and 'John Doe' changes his name
      * to 'John Smith,' the channel can be renamed to match.
@@ -454,6 +456,8 @@
 
     /**
      * Returns the notification channel settings for a given channel id.
+     *
+     * The channel must belong to your package, or it will not be returned.
      */
     public NotificationChannel getNotificationChannel(String channelId) {
         INotificationManager service = getService();
@@ -465,7 +469,7 @@
     }
 
     /**
-     * Returns all notification channels belonging to the calling app.
+     * Returns all notification channels belonging to the calling package.
      */
     public List<NotificationChannel> getNotificationChannels() {
         INotificationManager service = getService();
@@ -478,6 +482,10 @@
 
     /**
      * Deletes the given notification channel.
+     *
+     * <p>If you {@link #createNotificationChannel(NotificationChannel) create} a new channel with
+     * this same id, the deleted channel will be un-deleted with all of the same settings it
+     * had before it was deleted.
      */
     public void deleteNotificationChannel(String channelId) {
         INotificationManager service = getService();
@@ -501,7 +509,8 @@
     }
 
     /**
-     * Deletes the given notification channel group.
+     * Deletes the given notification channel group, and all notification channels that
+     * belong to it.
      */
     public void deleteNotificationChannelGroup(String groupId) {
         INotificationManager service = getService();
diff --git a/core/java/android/app/PictureInPictureParams.java b/core/java/android/app/PictureInPictureParams.java
index 875d592..e1df33b 100644
--- a/core/java/android/app/PictureInPictureParams.java
+++ b/core/java/android/app/PictureInPictureParams.java
@@ -238,7 +238,7 @@
      */
     public void truncateActions(int size) {
         if (hasSetActions()) {
-            mUserActions = mUserActions.subList(0, size);
+            mUserActions = mUserActions.subList(0, Math.min(mUserActions.size(), size));
         }
     }
 
diff --git a/core/java/android/app/RemoteInput.java b/core/java/android/app/RemoteInput.java
index d1dc859..8ab19c0 100644
--- a/core/java/android/app/RemoteInput.java
+++ b/core/java/android/app/RemoteInput.java
@@ -118,6 +118,11 @@
         return mChoices;
     }
 
+    /**
+     * Get possible non-textual inputs that are accepted.
+     * This can be {@code null} if the input does not accept non-textual values.
+     * See {@link Builder#setAllowDataType}.
+     */
     public Set<String> getAllowedDataTypes() {
         return mAllowedDataTypes;
     }
@@ -202,7 +207,9 @@
         }
 
         /**
-         * Specifies whether the user can provide arbitrary values.
+         * Specifies whether the user can provide arbitrary values. This allows an input
+         * to accept non-textual values. Examples of usage are an input that wants audio
+         * or an image.
          *
          * @param mimeType A mime type that results are allowed to come in.
          *         Be aware that text results (see {@link #setAllowFreeFormInput}
@@ -374,7 +381,12 @@
     }
 
     /**
-     * Same as {@link #addResultsToIntent} but for setting data results.
+     * Same as {@link #addResultsToIntent} but for setting data results. This is used
+     * for inputs that accept non-textual results (see {@link Builder#setAllowDataType}).
+     * Only one result can be provided for every mime type accepted by the RemoteInput.
+     * If multiple inputs of the same mime type are expected then multiple RemoteInputs
+     * should be used.
+     *
      * @param remoteInput The remote input for which results are being provided
      * @param intent The intent to add remote input results to. The {@link ClipData}
      *               field of the intent will be modified to contain the results.
diff --git a/core/java/android/app/WallpaperColors.java b/core/java/android/app/WallpaperColors.java
deleted file mode 100644
index 5ed66ca..0000000
--- a/core/java/android/app/WallpaperColors.java
+++ /dev/null
@@ -1,97 +0,0 @@
-/*
- * Copyright (C) 2017 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License
- */
-
-package android.app;
-
-import android.graphics.Color;
-import android.os.Parcel;
-import android.os.Parcelable;
-
-import android.util.Pair;
-
-import java.util.List;
-
-/**
- * A class containing information about the colors of a wallpaper.
- */
-public final class WallpaperColors implements Parcelable {
-
-    public WallpaperColors(Parcel parcel) {
-    }
-
-    /**
-     * Wallpaper color details containing a list of colors and their weights,
-     * as if it were an histogram.
-     * This list can be extracted from a bitmap by the Palette API.
-     *
-     * Dark text support will be calculated internally based on the histogram.
-     *
-     * @param colors list of pairs where each pair contains a color
-     *               and number of occurrences/influence.
-     */
-    public WallpaperColors(List<Pair<Color, Integer>> colors) {
-    }
-
-    /**
-     * Wallpaper color details containing a list of colors and their weights,
-     * as if it were an histogram.
-     * Explicit dark text support.
-     *
-     * @param colors list of pairs where each pair contains a color
-     *               and number of occurrences/influence.
-     * @param supportsDarkText can have dark text on top or not
-     */
-    public WallpaperColors(List<Pair<Color, Integer>> colors, boolean supportsDarkText) {
-    }
-
-    public static final Creator<WallpaperColors> CREATOR = new Creator<WallpaperColors>() {
-        @Override
-        public WallpaperColors createFromParcel(Parcel in) {
-            return new WallpaperColors(in);
-        }
-
-        @Override
-        public WallpaperColors[] newArray(int size) {
-            return new WallpaperColors[size];
-        }
-    };
-
-    @Override
-    public int describeContents() {
-        return 0;
-    }
-
-    @Override
-    public void writeToParcel(Parcel dest, int flags) {
-    }
-
-    /**
-     * List of colors with their occurrences. The bigger the int, the more relevant the color.
-     * @return list of colors paired with their weights.
-     */
-    public List<Pair<Color, Integer>> getColors() {
-        return null;
-    }
-
-    /**
-     * Whether or not dark text is legible on top of this wallpaper.
-     *
-     * @return true if dark text is supported
-     */
-    public boolean supportsDarkText() {
-        return false;
-    }
-}
diff --git a/core/java/android/app/WallpaperManager.java b/core/java/android/app/WallpaperManager.java
index 6d87de8..db2f937 100644
--- a/core/java/android/app/WallpaperManager.java
+++ b/core/java/android/app/WallpaperManager.java
@@ -17,8 +17,6 @@
 package android.app;
 
 import android.annotation.IntDef;
-import android.annotation.NonNull;
-import android.annotation.Nullable;
 import android.annotation.RawRes;
 import android.annotation.SdkConstant;
 import android.annotation.SystemApi;
@@ -746,43 +744,6 @@
         return getWallpaperFile(which, mContext.getUserId());
     }
 
-
-    /**
-     * Registers a listener to get notified when the wallpaper colors change.
-     * Callback might be called from an arbitrary background thread.
-     *
-     * @param listener A listener to register
-     */
-    public void addOnColorsChangedListener(@NonNull OnColorsChangedListener listener) {
-    }
-
-    /**
-     * Registers a listener to get notified when the wallpaper colors change
-     * @param listener A listener to register
-     * @param handler Where to call it from. Might be called from a background thread
-     *                if null.
-     */
-    public void addOnColorsChangedListener(@NonNull OnColorsChangedListener listener,
-            @Nullable Handler handler) {
-    }
-
-    /**
-     * Stop listening to color updates.
-     * @param callback A callback to unsubscribe
-     */
-    public void removeOnColorsChangedListener(@NonNull OnColorsChangedListener callback) {
-    }
-
-    /**
-     * Get the primary colors of a wallpaper
-     * @param which wallpaper type. Must be either {@link #FLAG_SYSTEM} or
-     *     {@link #FLAG_LOCK}
-     * @return a list of colors ordered by priority
-     */
-    public @Nullable WallpaperColors getWallpaperColors(int which) {
-        return null;
-    }
-
     /**
      * Version of {@link #getWallpaperFile(int)} that can access the wallpaper data
      * for a given user.  The caller must hold the INTERACT_ACROSS_USERS_FULL
@@ -1774,19 +1735,4 @@
             mLatch.countDown();
         }
     }
-
-    /**
-     * Interface definition for a callback to be invoked when colors change on a wallpaper.
-     */
-    public interface OnColorsChangedListener {
-        /**
-         * Called when colors change.
-         * A {@link android.app.WallpaperColors} object containing a simplified
-         * color histogram will be given.
-         *
-         * @param colors Wallpaper color info
-         * @param which A combination of {@link #FLAG_LOCK} and {@link #FLAG_SYSTEM}
-         */
-        void onColorsChanged(WallpaperColors colors, int which);
-    }
 }
diff --git a/core/java/android/app/admin/ConnectEvent.java b/core/java/android/app/admin/ConnectEvent.java
index 5111443..423ee52 100644
--- a/core/java/android/app/admin/ConnectEvent.java
+++ b/core/java/android/app/admin/ConnectEvent.java
@@ -19,6 +19,9 @@
 import android.os.Parcel;
 import android.os.Parcelable;
 
+import java.net.InetAddress;
+import java.net.UnknownHostException;
+
 /**
  * A class that represents a connect library call event.
  */
@@ -44,8 +47,14 @@
         this.timestamp = in.readLong();
     }
 
-    public String getIpAddress() {
-        return ipAddress;
+    public InetAddress getInetAddress() {
+        try {
+            // ipAddress is already an address, not a host name, no DNS resolution will happen.
+            return InetAddress.getByName(ipAddress);
+        } catch (UnknownHostException e) {
+            // Should never happen as we aren't passing a host name.
+            return InetAddress.getLoopbackAddress();
+        }
     }
 
     public int getPort() {
diff --git a/core/java/android/app/admin/DevicePolicyManager.java b/core/java/android/app/admin/DevicePolicyManager.java
index 049c1d3..9b1b6cd 100644
--- a/core/java/android/app/admin/DevicePolicyManager.java
+++ b/core/java/android/app/admin/DevicePolicyManager.java
@@ -3030,17 +3030,24 @@
      * keyring. The user's credential will need to be entered again in order to derive the
      * credential encryption key that will be stored back in the keyring for future use.
      * <p>
-     * This flag can only be used by a profile owner when locking a managed profile on an FBE
-     * device.
+     * This flag can only be used by a profile owner when locking a managed profile when
+     * {@link #getStorageEncryptionStatus} returns {@link #ENCRYPTION_STATUS_ACTIVE_PER_USER}.
      * <p>
      * In order to secure user data, the user will be stopped and restarted so apps should wait
      * until they are next run to perform further actions.
      */
+    public static final int FLAG_EVICT_CREDENTIAL_ENCRYPTION_KEY = 1;
+
+    /**
+     * Instead use {@link #FLAG_EVICT_CREDENTIAL_ENCRYPTION_KEY}.
+     * @removed
+     */
+    @Deprecated
     public static final int FLAG_EVICT_CE_KEY = 1;
 
     /** @hide */
     @Retention(RetentionPolicy.SOURCE)
-    @IntDef(flag=true, value={FLAG_EVICT_CE_KEY})
+    @IntDef(flag=true, value={FLAG_EVICT_CREDENTIAL_ENCRYPTION_KEY})
     public @interface LockNowFlag {}
 
     /**
@@ -3072,15 +3079,17 @@
      * This method can be called on the {@link DevicePolicyManager} instance returned by
      * {@link #getParentProfileInstance(ComponentName)} in order to lock the parent profile.
      *
-     * @param flags May be 0 or {@link #FLAG_EVICT_CE_KEY}.
+     * @param flags May be 0 or {@link #FLAG_EVICT_CREDENTIAL_ENCRYPTION_KEY}.
      * @throws SecurityException if the calling application does not own an active administrator
      *             that uses {@link DeviceAdminInfo#USES_POLICY_FORCE_LOCK} or the
-     *             {@link #FLAG_EVICT_CE_KEY} flag is passed by an application that is not a profile
+     *             {@link #FLAG_EVICT_CREDENTIAL_ENCRYPTION_KEY} flag is passed by an application
+     *             that is not a profile
      *             owner of a managed profile.
-     * @throws IllegalArgumentException if the {@link #FLAG_EVICT_CE_KEY} flag is passed when
-     *             locking the parent profile.
-     * @throws UnsupportedOperationException if the {@link #FLAG_EVICT_CE_KEY} flag is passed on a
-     *             non-FBE device.
+     * @throws IllegalArgumentException if the {@link #FLAG_EVICT_CREDENTIAL_ENCRYPTION_KEY} flag is
+     *             passed when locking the parent profile.
+     * @throws UnsupportedOperationException if the {@link #FLAG_EVICT_CREDENTIAL_ENCRYPTION_KEY}
+     *             flag is passed when {@link #getStorageEncryptionStatus} does not return
+     *             {@link #ENCRYPTION_STATUS_ACTIVE_PER_USER}.
      */
     public void lockNow(@LockNowFlag int flags) {
         if (mService != null) {
diff --git a/core/java/android/app/admin/DnsEvent.java b/core/java/android/app/admin/DnsEvent.java
index a3a3f58..c21725f 100644
--- a/core/java/android/app/admin/DnsEvent.java
+++ b/core/java/android/app/admin/DnsEvent.java
@@ -19,6 +19,12 @@
 import android.os.Parcel;
 import android.os.Parcelable;
 
+import java.net.InetAddress;
+import java.net.UnknownHostException;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
 /**
  * A class that represents a DNS lookup event.
  */
@@ -59,15 +65,28 @@
     }
 
     /** Returns (possibly a subset of) the IP addresses returned. */
-    public String[] getIpAddresses() {
-        return ipAddresses;
+    public List<InetAddress> getInetAddresses() {
+        if (ipAddresses == null || ipAddresses.length == 0) {
+            return Collections.emptyList();
+        }
+        final List<InetAddress> inetAddresses = new ArrayList<>(ipAddresses.length);
+        for (final String ipAddress : ipAddresses) {
+            try {
+                // ipAddress is already an address, not a host name, no DNS resolution will happen.
+                inetAddresses.add(InetAddress.getByName(ipAddress));
+            } catch (UnknownHostException e) {
+                // Should never happen as we aren't passing a host name.
+            }
+        }
+        return inetAddresses;
     }
 
     /**
      * Returns the number of IP addresses returned from the DNS lookup event. May be different from
-     * the length of ipAddresses if there were too many addresses to log.
+     * the length of the list returned by {@link #getInetAddresses()} if there were too many
+     * addresses to log.
      */
-    public int getIpAddressesCount() {
+    public int getTotalResolvedAddressCount() {
         return ipAddressesCount;
     }
 
diff --git a/core/java/android/app/assist/AssistStructure.java b/core/java/android/app/assist/AssistStructure.java
index d6b89a1..3353530 100644
--- a/core/java/android/app/assist/AssistStructure.java
+++ b/core/java/android/app/assist/AssistStructure.java
@@ -29,10 +29,12 @@
 import android.view.WindowManager;
 import android.view.WindowManagerGlobal;
 import android.view.autofill.AutofillId;
+import android.view.autofill.AutofillManager;
 import android.view.autofill.AutofillValue;
 
 import java.util.ArrayList;
 import java.util.Arrays;
+import java.util.List;
 
 /**
  * Assist data automatically created by the platform's implementation of Assist and Autofill.
@@ -62,6 +64,7 @@
 
     ComponentName mActivityComponent;
     private boolean mIsHomeActivity;
+    private int mFlags;
 
     final ArrayList<WindowNode> mWindowNodes = new ArrayList<>();
 
@@ -184,6 +187,7 @@
             mSanitizeOnWrite = as.mSanitizeOnWrite;
             mWriteStructure = as.waitForReady();
             ComponentName.writeToParcel(as.mActivityComponent, out);
+            out.writeInt(as.mFlags);
             out.writeLong(as.mAcquisitionStartTime);
             out.writeLong(as.mAcquisitionEndTime);
             mNumWindows = as.mWindowNodes.size();
@@ -338,6 +342,7 @@
         void go() {
             fetchData();
             mActivityComponent = ComponentName.readFromParcel(mCurParcel);
+            mFlags = mCurParcel.readInt();
             mAcquisitionStartTime = mCurParcel.readLong();
             mAcquisitionEndTime = mCurParcel.readLong();
             final int N = mCurParcel.readInt();
@@ -473,7 +478,7 @@
         final int mDisplayId;
         final ViewNode mRoot;
 
-        WindowNode(AssistStructure assist, ViewRootImpl root, boolean forAutoFill) {
+        WindowNode(AssistStructure assist, ViewRootImpl root, boolean forAutoFill, int flags) {
             View view = root.getView();
             Rect rect = new Rect();
             view.getBoundsOnScreen(rect);
@@ -488,8 +493,9 @@
             ViewNodeBuilder builder = new ViewNodeBuilder(assist, mRoot, false);
             if ((root.getWindowFlags() & WindowManager.LayoutParams.FLAG_SECURE) != 0) {
                 if (forAutoFill) {
-                    // NOTE: flags are currently not supported, hence 0
-                    view.onProvideAutofillStructure(builder, 0);
+                    final int autofillFlags = (flags & AutofillManager.FLAG_MANUAL_REQUEST) != 0
+                            ? View.AUTOFILL_FLAG_INCLUDE_NOT_IMPORTANT_VIEWS : 0;
+                    view.onProvideAutofillStructure(builder, autofillFlags);
                 } else {
                     // This is a secure window, so it doesn't want a screenshot, and that
                     // means we should also not copy out its view hierarchy for Assist
@@ -499,8 +505,9 @@
                 }
             }
             if (forAutoFill) {
-                // NOTE: flags are currently not supported, hence 0
-                view.dispatchProvideAutofillStructure(builder, 0);
+                final int autofillFlags = (flags & AutofillManager.FLAG_MANUAL_REQUEST) != 0
+                        ? View.AUTOFILL_FLAG_INCLUDE_NOT_IMPORTANT_VIEWS : 0;
+                view.dispatchProvideAutofillStructure(builder, autofillFlags);
             } else {
                 view.dispatchProvideStructure(builder);
             }
@@ -1788,7 +1795,7 @@
         }
 
         @Override
-        public ArrayList<Pair<String, String>> getAttributes() {
+        public List<Pair<String, String>> getAttributes() {
             if (mAttributes == null && mNames != null) {
                 mAttributes = new ArrayList<>(mNames.length);
                 for (int i = 0; i < mNames.length; i++) {
@@ -1869,20 +1876,22 @@
     }
 
     /** @hide */
-    public AssistStructure(Activity activity, boolean forAutoFill) {
+    public AssistStructure(Activity activity, boolean forAutoFill, int flags) {
         mHaveData = true;
         mActivityComponent = activity.getComponentName();
+        mFlags = flags;
         ArrayList<ViewRootImpl> views = WindowManagerGlobal.getInstance().getRootViews(
                 activity.getActivityToken());
         for (int i=0; i<views.size(); i++) {
             ViewRootImpl root = views.get(i);
-            mWindowNodes.add(new WindowNode(this, root, forAutoFill));
+            mWindowNodes.add(new WindowNode(this, root, forAutoFill, flags));
         }
     }
 
     public AssistStructure() {
         mHaveData = true;
         mActivityComponent = null;
+        mFlags = 0;
     }
 
     /** @hide */
@@ -1909,6 +1918,7 @@
         }
         Log.i(TAG, "Activity: " + mActivityComponent.flattenToShortString());
         Log.i(TAG, "Sanitize on write: " + mSanitizeOnWrite);
+        Log.i(TAG, "Flags: " + mFlags);
         final int N = getWindowNodeCount();
         for (int i=0; i<N; i++) {
             WindowNode node = getWindowNodeAt(i);
@@ -2021,10 +2031,16 @@
         return mActivityComponent;
     }
 
+    /** @hide */
+    public int getFlags() {
+        return mFlags;
+    }
+
     /**
      * Returns whether the activity associated with this AssistStructure was the home activity
-     * at the time the assist data was acquired.
+     * (Launcher) at the time the assist data was acquired.
      * @return Whether the activity was the home activity.
+     * @see android.content.Intent#CATEGORY_HOME
      */
     public boolean isHomeActivity() {
         return mIsHomeActivity;
diff --git a/core/java/android/app/backup/BackupAgent.java b/core/java/android/app/backup/BackupAgent.java
index 11636a5..5f92af9 100644
--- a/core/java/android/app/backup/BackupAgent.java
+++ b/core/java/android/app/backup/BackupAgent.java
@@ -133,8 +133,6 @@
 
     Handler mHandler = null;
 
-    private long mBackupQuotaBytes = -1;
-
     Handler getHandler() {
         if (mHandler == null) {
             mHandler = new Handler(Looper.getMainLooper());
@@ -186,21 +184,6 @@
     }
 
     /**
-     * Returns the quota in bytes for the currently requested backup operation. The value can
-     * vary for each operation depending on the type of backup being done.
-     *
-     * <p>Can be called only from {@link BackupAgent#onFullBackup(FullBackupDataOutput)} or
-     * {@link BackupAgent#onBackup(ParcelFileDescriptor, BackupDataOutput, ParcelFileDescriptor)}.
-     */
-    public long getBackupQuota() {
-        if (mBackupQuotaBytes < 0) {
-            throw new IllegalStateException(
-                    "Backup quota is available only during backup operations.");
-        }
-        return mBackupQuotaBytes;
-    }
-
-    /**
      * The application is being asked to write any data changed since the last
      * time it performed a backup operation. The state data recorded during the
      * last backup pass is provided in the <code>oldState</code> file
@@ -918,10 +901,8 @@
             // Ensure that we're running with the app's normal permission level
             long ident = Binder.clearCallingIdentity();
 
-            mBackupQuotaBytes = quotaBytes;
-
             if (DEBUG) Log.v(TAG, "doBackup() invoked");
-            BackupDataOutput output = new BackupDataOutput(data.getFileDescriptor());
+            BackupDataOutput output = new BackupDataOutput(data.getFileDescriptor(), quotaBytes);
 
             try {
                 BackupAgent.this.onBackup(oldState, output, newState);
@@ -937,9 +918,6 @@
                 // guarantee themselves).
                 waitForSharedPrefs();
 
-                // Unset quota after onBackup is done.
-                mBackupQuotaBytes = -1;
-
                 Binder.restoreCallingIdentity(ident);
                 try {
                     callbackBinder.opComplete(token, 0);
@@ -997,8 +975,6 @@
             // Ensure that we're running with the app's normal permission level
             long ident = Binder.clearCallingIdentity();
 
-            mBackupQuotaBytes = quotaBytes;
-
             if (DEBUG) Log.v(TAG, "doFullBackup() invoked");
 
             // Ensure that any SharedPreferences writes have landed *before*
@@ -1006,7 +982,7 @@
             waitForSharedPrefs();
 
             try {
-                BackupAgent.this.onFullBackup(new FullBackupDataOutput(data));
+                BackupAgent.this.onFullBackup(new FullBackupDataOutput(data, quotaBytes));
             } catch (IOException ex) {
                 Log.d(TAG, "onFullBackup (" + BackupAgent.this.getClass().getName() + ") threw", ex);
                 throw new RuntimeException(ex);
@@ -1017,9 +993,6 @@
                 // ... and then again after, as in the doBackup() case
                 waitForSharedPrefs();
 
-                // Unset quota after onFullBackup is done.
-                mBackupQuotaBytes = -1;
-
                 // Send the EOD marker indicating that there is no more data
                 // forthcoming from this agent.
                 try {
@@ -1046,9 +1019,7 @@
         public void doMeasureFullBackup(long quotaBytes, int token, IBackupManager callbackBinder) {
             // Ensure that we're running with the app's normal permission level
             final long ident = Binder.clearCallingIdentity();
-            FullBackupDataOutput measureOutput = new FullBackupDataOutput();
-
-            mBackupQuotaBytes = quotaBytes;
+            FullBackupDataOutput measureOutput = new FullBackupDataOutput(quotaBytes);
 
             waitForSharedPrefs();
             try {
@@ -1060,8 +1031,6 @@
                 Log.d(TAG, "onFullBackup[M] (" + BackupAgent.this.getClass().getName() + ") threw", ex);
                 throw ex;
             } finally {
-                // Unset quota after onFullBackup is done.
-                mBackupQuotaBytes = -1;
                 Binder.restoreCallingIdentity(ident);
                 try {
                     callbackBinder.opComplete(token, measureOutput.getSize());
diff --git a/core/java/android/app/backup/BackupDataOutput.java b/core/java/android/app/backup/BackupDataOutput.java
index 1fe63e7..c7586a2 100644
--- a/core/java/android/app/backup/BackupDataOutput.java
+++ b/core/java/android/app/backup/BackupDataOutput.java
@@ -62,12 +62,23 @@
  * @see BackupAgent
  */
 public class BackupDataOutput {
+    final long mQuota;
     long mBackupWriter;
 
+    /**
+     * Construct a BackupDataOutput purely for data-stream manipulation.  This instance will
+     * not report usable quota information.
+     * @hide */
+    @SystemApi
+    public BackupDataOutput(FileDescriptor fd) {
+        this(fd, -1);
+    }
+
     /** @hide */
     @SystemApi
-    public BackupDataOutput(FileDescriptor fd) {
+    public BackupDataOutput(FileDescriptor fd, long quota) {
         if (fd == null) throw new NullPointerException();
+        mQuota = quota;
         mBackupWriter = ctor(fd);
         if (mBackupWriter == 0) {
             throw new RuntimeException("Native initialization failed with fd=" + fd);
@@ -75,6 +86,16 @@
     }
 
     /**
+     * Returns the quota in bytes for the application's current backup operation.  The
+     * value can vary for each operation.
+     *
+     * @see FullBackupDataOutput#getQuota()
+     */
+    public long getQuota() {
+        return mQuota;
+    }
+
+    /**
      * Mark the beginning of one record in the backup data stream. This must be called before
      * {@link #writeEntityData}.
      * @param key A string key that uniquely identifies the data record within the application.
diff --git a/core/java/android/app/backup/FullBackupDataOutput.java b/core/java/android/app/backup/FullBackupDataOutput.java
index 94704b9..5deedd0 100644
--- a/core/java/android/app/backup/FullBackupDataOutput.java
+++ b/core/java/android/app/backup/FullBackupDataOutput.java
@@ -10,17 +10,35 @@
 public class FullBackupDataOutput {
     // Currently a name-scoping shim around BackupDataOutput
     private final BackupDataOutput mData;
+    private final long mQuota;
     private long mSize;
 
+    /**
+     * Returns the quota in bytes for the application's current backup operation.  The
+     * value can vary for each operation.
+     *
+     * @see BackupDataOutput#getQuota()
+     */
+    public long getQuota() {
+        return mQuota;
+    }
+
     /** @hide - used only in measure operation */
-    public FullBackupDataOutput() {
+    public FullBackupDataOutput(long quota) {
         mData = null;
+        mQuota = quota;
         mSize = 0;
     }
 
     /** @hide */
+    public FullBackupDataOutput(ParcelFileDescriptor fd, long quota) {
+        mData = new BackupDataOutput(fd.getFileDescriptor(), quota);
+        mQuota = quota;
+    }
+
+    /** @hide - used only internally to the backup manager service's stream construction */
     public FullBackupDataOutput(ParcelFileDescriptor fd) {
-        mData = new BackupDataOutput(fd.getFileDescriptor());
+        this(fd, -1);
     }
 
     /** @hide */
diff --git a/core/java/android/app/usage/ExternalStorageStats.java b/core/java/android/app/usage/ExternalStorageStats.java
index 10c9b5f..83ac779 100644
--- a/core/java/android/app/usage/ExternalStorageStats.java
+++ b/core/java/android/app/usage/ExternalStorageStats.java
@@ -16,6 +16,7 @@
 
 package android.app.usage;
 
+import android.annotation.BytesLong;
 import android.os.Parcel;
 import android.os.Parcelable;
 import android.os.UserHandle;
@@ -37,7 +38,7 @@
      * Return the total bytes used by all files in the shared/external storage
      * hosted on this volume.
      */
-    public long getTotalBytes() {
+    public @BytesLong long getTotalBytes() {
         return totalBytes;
     }
 
@@ -45,7 +46,7 @@
      * Return the total bytes used by audio files in the shared/external storage
      * hosted on this volume.
      */
-    public long getAudioBytes() {
+    public @BytesLong long getAudioBytes() {
         return audioBytes;
     }
 
@@ -53,7 +54,7 @@
      * Return the total bytes used by video files in the shared/external storage
      * hosted on this volume.
      */
-    public long getVideoBytes() {
+    public @BytesLong long getVideoBytes() {
         return videoBytes;
     }
 
@@ -61,7 +62,7 @@
      * Return the total bytes used by image files in the shared/external storage
      * hosted on this volume.
      */
-    public long getImageBytes() {
+    public @BytesLong long getImageBytes() {
         return imageBytes;
     }
 
@@ -72,7 +73,7 @@
      * This data is already accounted against individual apps as returned
      * through {@link StorageStats}.
      */
-    public long getAppBytes() {
+    public @BytesLong long getAppBytes() {
         return appBytes;
     }
 
diff --git a/core/java/android/app/usage/StorageStats.java b/core/java/android/app/usage/StorageStats.java
index 26c702c0..3a27751 100644
--- a/core/java/android/app/usage/StorageStats.java
+++ b/core/java/android/app/usage/StorageStats.java
@@ -16,6 +16,7 @@
 
 package android.app.usage;
 
+import android.annotation.BytesLong;
 import android.content.Context;
 import android.os.Parcel;
 import android.os.Parcelable;
@@ -33,18 +34,24 @@
     /** {@hide} */ public long cacheBytes;
 
     /**
-     * Return the size of all code. This includes {@code APK} files and
-     * optimized compiler output.
+     * Return the size of app. This includes {@code APK} files, optimized
+     * compiler output, and unpacked native libraries.
      * <p>
      * If the primary external/shared storage is hosted on this storage device,
      * then this includes files stored under {@link Context#getObbDir()}.
      * <p>
      * Code is shared between all users on a multiuser device.
      */
-    public long getCodeBytes() {
+    public @BytesLong long getAppBytes() {
         return codeBytes;
     }
 
+    /** @removed */
+    @Deprecated
+    public long getCodeBytes() {
+        return getAppBytes();
+    }
+
     /**
      * Return the size of all data. This includes files stored under
      * {@link Context#getDataDir()}, {@link Context#getCacheDir()},
@@ -58,7 +65,7 @@
      * <p>
      * Data is isolated for each user on a multiuser device.
      */
-    public long getDataBytes() {
+    public @BytesLong long getDataBytes() {
         return dataBytes;
     }
 
@@ -72,7 +79,7 @@
      * <p>
      * Cached data is isolated for each user on a multiuser device.
      */
-    public long getCacheBytes() {
+    public @BytesLong long getCacheBytes() {
         return cacheBytes;
     }
 
diff --git a/core/java/android/app/usage/StorageStatsManager.java b/core/java/android/app/usage/StorageStatsManager.java
index 5497d57..d9d958c 100644
--- a/core/java/android/app/usage/StorageStatsManager.java
+++ b/core/java/android/app/usage/StorageStatsManager.java
@@ -18,6 +18,7 @@
 
 import static android.os.storage.StorageManager.convert;
 
+import android.annotation.BytesLong;
 import android.annotation.NonNull;
 import android.annotation.TestApi;
 import android.annotation.WorkerThread;
@@ -37,13 +38,16 @@
 import java.util.UUID;
 
 /**
- * Provides access to detailed storage statistics.
+ * Access to detailed storage statistics. This provides a summary of how apps,
+ * users, and external/shared storage is utilizing disk space.
  * <p class="note">
- * Note: this API requires the permission
- * {@code android.permission.PACKAGE_USAGE_STATS}, which is a system-level
- * permission that will not be granted to normal apps. However, declaring the
- * permission expresses your intention to use this API and an end user can then
- * choose to grant this permission through the Settings application.
+ * Note: no permissions are required when calling these APIs for your own
+ * package or UID. However, requesting details for any other package requires
+ * the {@code android.Manifest.permission#PACKAGE_USAGE_STATS} permission, which
+ * is a system-level permission that will not be granted to normal apps.
+ * Declaring that permission expresses your intention to use this API and an end
+ * user can then choose to grant this permission through the Settings
+ * application.
  * </p>
  */
 public class StorageStatsManager {
@@ -73,19 +77,22 @@
     }
 
     /**
-     * Return the total size of the underlying media that is hosting this
-     * storage volume.
+     * Return the total size of the underlying physical media that is hosting
+     * this storage volume.
      * <p>
-     * To reduce end user confusion, this value matches the total storage size
-     * advertised in a retail environment, which is typically larger than the
-     * actual usable partition space.
+     * This value is best suited for visual display to end users, since it's
+     * designed to reflect the total storage size advertised in a retail
+     * environment.
+     * <p>
+     * Apps making logical decisions about disk space should always use
+     * {@link File#getTotalSpace()} instead of this value.
      *
      * @param storageUuid the UUID of the storage volume you're interested in,
      *            such as {@link StorageManager#UUID_DEFAULT}.
      * @throws IOException when the storage device isn't present.
      */
     @WorkerThread
-    public long getTotalBytes(@NonNull UUID storageUuid) throws IOException {
+    public @BytesLong long getTotalBytes(@NonNull UUID storageUuid) throws IOException {
         try {
             return mService.getTotalBytes(convert(storageUuid), mContext.getOpPackageName());
         } catch (ParcelableException e) {
@@ -105,19 +112,20 @@
     /**
      * Return the free space on the requested storage volume.
      * <p>
-     * The free space is equivalent to {@link File#getUsableSpace()} plus the
-     * size of any cached data that can be automatically deleted by the system
-     * as additional space is needed.
+     * This value is best suited for visual display to end users, since it's
+     * designed to reflect both unused space <em>and</em> and cached space that
+     * could be reclaimed by the system.
      * <p>
-     * This method may take several seconds to calculate the requested values,
-     * so it should only be called from a worker thread.
+     * Apps making logical decisions about disk space should always use
+     * {@link StorageManager#getAllocatableBytes(UUID, int)} instead of this
+     * value.
      *
      * @param storageUuid the UUID of the storage volume you're interested in,
      *            such as {@link StorageManager#UUID_DEFAULT}.
      * @throws IOException when the storage device isn't present.
      */
     @WorkerThread
-    public long getFreeBytes(@NonNull UUID storageUuid) throws IOException {
+    public @BytesLong long getFreeBytes(@NonNull UUID storageUuid) throws IOException {
         try {
             return mService.getFreeBytes(convert(storageUuid), mContext.getOpPackageName());
         } catch (ParcelableException e) {
@@ -137,9 +145,15 @@
     /**
      * Return storage statistics for a specific package on the requested storage
      * volume.
-     * <p>
-     * This method may take several seconds to calculate the requested values,
-     * so it should only be called from a worker thread.
+     * <p class="note">
+     * Note: no permissions are required when calling this API for your own
+     * package. However, requesting details for any other package requires the
+     * {@code android.Manifest.permission#PACKAGE_USAGE_STATS} permission, which
+     * is a system-level permission that will not be granted to normal apps.
+     * Declaring that permission expresses your intention to use this API and an
+     * end user can then choose to grant this permission through the Settings
+     * application.
+     * </p>
      * <p class="note">
      * Note: if the requested package uses the {@code android:sharedUserId}
      * manifest feature, this call will be forced into a slower manual
@@ -158,8 +172,9 @@
      * @see PackageInfo#packageName
      */
     @WorkerThread
-    public @NonNull StorageStats queryStatsForPackage(@NonNull UUID storageUuid, String packageName,
-            UserHandle user) throws PackageManager.NameNotFoundException, IOException {
+    public @NonNull StorageStats queryStatsForPackage(@NonNull UUID storageUuid,
+            @NonNull String packageName, @NonNull UserHandle user)
+            throws PackageManager.NameNotFoundException, IOException {
         try {
             return mService.queryStatsForPackage(convert(storageUuid), packageName,
                     user.getIdentifier(), mContext.getOpPackageName());
@@ -182,9 +197,15 @@
     /**
      * Return storage statistics for a specific UID on the requested storage
      * volume.
-     * <p>
-     * This method may take several seconds to calculate the requested values,
-     * so it should only be called from a worker thread.
+     * <p class="note">
+     * Note: no permissions are required when calling this API for your own UID.
+     * However, requesting details for any other UID requires the
+     * {@code android.Manifest.permission#PACKAGE_USAGE_STATS} permission, which
+     * is a system-level permission that will not be granted to normal apps.
+     * Declaring that permission expresses your intention to use this API and an
+     * end user can then choose to grant this permission through the Settings
+     * application.
+     * </p>
      *
      * @param storageUuid the UUID of the storage volume you're interested in,
      *            such as {@link StorageManager#UUID_DEFAULT}.
@@ -194,7 +215,8 @@
      * @see ApplicationInfo#uid
      */
     @WorkerThread
-    public StorageStats queryStatsForUid(@NonNull UUID storageUuid, int uid) throws IOException {
+    public @NonNull StorageStats queryStatsForUid(@NonNull UUID storageUuid, int uid)
+            throws IOException {
         try {
             return mService.queryStatsForUid(convert(storageUuid), uid,
                     mContext.getOpPackageName());
@@ -215,9 +237,14 @@
     /**
      * Return storage statistics for a specific {@link UserHandle} on the
      * requested storage volume.
-     * <p>
-     * This method may take several seconds to calculate the requested values,
-     * so it should only be called from a worker thread.
+     * <p class="note">
+     * Note: this API requires the
+     * {@code android.Manifest.permission#PACKAGE_USAGE_STATS} permission, which
+     * is a system-level permission that will not be granted to normal apps.
+     * Declaring that permission expresses your intention to use this API and an
+     * end user can then choose to grant this permission through the Settings
+     * application.
+     * </p>
      *
      * @param storageUuid the UUID of the storage volume you're interested in,
      *            such as {@link StorageManager#UUID_DEFAULT}.
@@ -226,8 +253,8 @@
      * @see android.os.Process#myUserHandle()
      */
     @WorkerThread
-    public StorageStats queryStatsForUser(@NonNull UUID storageUuid, UserHandle user)
-            throws IOException {
+    public @NonNull StorageStats queryStatsForUser(@NonNull UUID storageUuid,
+            @NonNull UserHandle user) throws IOException {
         try {
             return mService.queryStatsForUser(convert(storageUuid), user.getIdentifier(),
                     mContext.getOpPackageName());
@@ -248,9 +275,14 @@
     /**
      * Return shared/external storage statistics for a specific
      * {@link UserHandle} on the requested storage volume.
-     * <p>
-     * This method may take several seconds to calculate the requested values,
-     * so it should only be called from a worker thread.
+     * <p class="note">
+     * Note: this API requires the
+     * {@code android.Manifest.permission#PACKAGE_USAGE_STATS} permission, which
+     * is a system-level permission that will not be granted to normal apps.
+     * Declaring that permission expresses your intention to use this API and an
+     * end user can then choose to grant this permission through the Settings
+     * application.
+     * </p>
      *
      * @param storageUuid the UUID of the storage volume you're interested in,
      *            such as {@link StorageManager#UUID_DEFAULT}.
@@ -258,8 +290,8 @@
      * @see android.os.Process#myUserHandle()
      */
     @WorkerThread
-    public ExternalStorageStats queryExternalStatsForUser(@NonNull UUID storageUuid,
-            UserHandle user) throws IOException {
+    public @NonNull ExternalStorageStats queryExternalStatsForUser(@NonNull UUID storageUuid,
+            @NonNull UserHandle user) throws IOException {
         try {
             return mService.queryExternalStatsForUser(convert(storageUuid), user.getIdentifier(),
                     mContext.getOpPackageName());
diff --git a/core/java/android/bluetooth/BluetoothGatt.java b/core/java/android/bluetooth/BluetoothGatt.java
index 713dbf4..0f01d62 100644
--- a/core/java/android/bluetooth/BluetoothGatt.java
+++ b/core/java/android/bluetooth/BluetoothGatt.java
@@ -159,8 +159,10 @@
                     mHandler.post(new Runnable() {
                         @Override
                         public void run() {
-                            mCallback.onConnectionStateChange(BluetoothGatt.this, GATT_FAILURE,
-                                              BluetoothProfile.STATE_DISCONNECTED);
+                            if (mCallback != null) {
+                                mCallback.onConnectionStateChange(BluetoothGatt.this, GATT_FAILURE,
+                                                  BluetoothProfile.STATE_DISCONNECTED);
+                            }
                         }
                     });
 
@@ -192,7 +194,9 @@
                 mHandler.post(new Runnable() {
                     @Override
                     public void run() {
-                        mCallback.onPhyUpdate(BluetoothGatt.this, txPhy, rxPhy, status);
+                        if (mCallback != null) {
+                            mCallback.onPhyUpdate(BluetoothGatt.this, txPhy, rxPhy, status);
+                        }
                     }
                 });
             }
@@ -212,7 +216,9 @@
                 mHandler.post(new Runnable() {
                     @Override
                     public void run() {
-                        mCallback.onPhyRead(BluetoothGatt.this, txPhy, rxPhy, status);
+                        if (mCallback != null) {
+                            mCallback.onPhyRead(BluetoothGatt.this, txPhy, rxPhy, status);
+                        }
                     }
                 });
             }
@@ -235,7 +241,10 @@
                 mHandler.post(new Runnable() {
                     @Override
                     public void run() {
-                        mCallback.onConnectionStateChange(BluetoothGatt.this, status, profileState);
+                        if (mCallback != null) {
+                            mCallback.onConnectionStateChange(BluetoothGatt.this, status,
+                                                              profileState);
+                        }
                     }
                 });
 
@@ -294,7 +303,9 @@
                 mHandler.post(new Runnable() {
                     @Override
                     public void run() {
-                        mCallback.onServicesDiscovered(BluetoothGatt.this, status);
+                        if (mCallback != null) {
+                            mCallback.onServicesDiscovered(BluetoothGatt.this, status);
+                        }
                     }
                 });
             }
@@ -344,7 +355,10 @@
                 mHandler.post(new Runnable() {
                     @Override
                     public void run() {
-                        mCallback.onCharacteristicRead(BluetoothGatt.this, characteristic, status);
+                        if (mCallback != null) {
+                            mCallback.onCharacteristicRead(BluetoothGatt.this, characteristic,
+                                                           status);
+                        }
                     }
                 });
             }
@@ -390,7 +404,10 @@
                 mHandler.post(new Runnable() {
                     @Override
                     public void run() {
-                        mCallback.onCharacteristicWrite(BluetoothGatt.this, characteristic, status);
+                        if (mCallback != null) {
+                            mCallback.onCharacteristicWrite(BluetoothGatt.this, characteristic,
+                                                            status);
+                        }
                     }
                 });
             }
@@ -416,7 +433,9 @@
                 mHandler.post(new Runnable() {
                     @Override
                     public void run() {
-                        mCallback.onCharacteristicChanged(BluetoothGatt.this, characteristic);
+                        if (mCallback != null) {
+                            mCallback.onCharacteristicChanged(BluetoothGatt.this, characteristic);
+                        }
                     }
                 });
             }
@@ -461,7 +480,9 @@
                 mHandler.post(new Runnable() {
                     @Override
                     public void run() {
-                        mCallback.onDescriptorRead(BluetoothGatt.this, descriptor, status);
+                        if (mCallback != null) {
+                            mCallback.onDescriptorRead(BluetoothGatt.this, descriptor, status);
+                        }
                     }
                 });
             }
@@ -505,7 +526,9 @@
                 mHandler.post(new Runnable() {
                     @Override
                     public void run() {
-                        mCallback.onDescriptorWrite(BluetoothGatt.this, descriptor, status);
+                        if (mCallback != null) {
+                            mCallback.onDescriptorWrite(BluetoothGatt.this, descriptor, status);
+                        }
                     }
                 });
             }
@@ -529,7 +552,9 @@
                 mHandler.post(new Runnable() {
                     @Override
                     public void run() {
-                        mCallback.onReliableWriteCompleted(BluetoothGatt.this, status);
+                        if (mCallback != null) {
+                           mCallback.onReliableWriteCompleted(BluetoothGatt.this, status);
+                        }
                     }
                 });
             }
@@ -548,7 +573,9 @@
                 mHandler.post(new Runnable() {
                     @Override
                     public void run() {
-                        mCallback.onReadRemoteRssi(BluetoothGatt.this, rssi, status);
+                        if (mCallback != null) {
+                            mCallback.onReadRemoteRssi(BluetoothGatt.this, rssi, status);
+                        }
                     }
                 });
             }
@@ -568,7 +595,9 @@
                 mHandler.post(new Runnable() {
                     @Override
                     public void run() {
-                        mCallback.onMtuChanged(BluetoothGatt.this, mtu, status);
+                        if (mCallback != null) {
+                            mCallback.onMtuChanged(BluetoothGatt.this, mtu, status);
+                        }
                     }
                 });
             }
@@ -590,8 +619,10 @@
                 mHandler.post(new Runnable() {
                     @Override
                     public void run() {
-                        mCallback.onConnectionUpdated(BluetoothGatt.this, interval, latency,
-                                                      timeout, status);
+                        if (mCallback != null) {
+                            mCallback.onConnectionUpdated(BluetoothGatt.this, interval, latency,
+                                                          timeout, status);
+                        }
                     }
                 });
             }
@@ -973,6 +1004,41 @@
     }
 
     /**
+     * Reads the characteristic using its UUID from the associated remote device.
+     *
+     * <p>This is an asynchronous operation. The result of the read operation
+     * is reported by the {@link BluetoothGattCallback#onCharacteristicRead}
+     * callback.
+     *
+     * <p>Requires {@link android.Manifest.permission#BLUETOOTH} permission.
+     *
+     * @param uuid UUID of characteristic to read from the remote device
+     * @return true, if the read operation was initiated successfully
+     * @hide
+     */
+    public boolean readUsingCharacteristicUuid(UUID uuid, int startHandle, int endHandle) {
+        if (VDBG) Log.d(TAG, "readUsingCharacteristicUuid() - uuid: " + uuid);
+        if (mService == null || mClientIf == 0) return false;
+
+        synchronized(mDeviceBusy) {
+            if (mDeviceBusy) return false;
+            mDeviceBusy = true;
+        }
+
+        try {
+            mService.readUsingCharacteristicUuid(mClientIf, mDevice.getAddress(),
+                new ParcelUuid(uuid), startHandle, endHandle, AUTHENTICATION_NONE);
+        } catch (RemoteException e) {
+            Log.e(TAG,"",e);
+            mDeviceBusy = false;
+            return false;
+        }
+
+        return true;
+    }
+
+
+    /**
      * Writes a given characteristic and its values to the associated remote device.
      *
      * <p>Once the write operation has been completed, the
diff --git a/core/java/android/bluetooth/IBluetoothGatt.aidl b/core/java/android/bluetooth/IBluetoothGatt.aidl
index 12e9baa..e2d4f5b 100644
--- a/core/java/android/bluetooth/IBluetoothGatt.aidl
+++ b/core/java/android/bluetooth/IBluetoothGatt.aidl
@@ -59,6 +59,7 @@
                                 in IAdvertisingSetCallback callback);
     void stopAdvertisingSet(in IAdvertisingSetCallback callback);
 
+    void getOwnAddress(in int advertiserId);
     void enableAdvertisingSet(in int advertiserId, in boolean enable, in int duration, in int maxExtAdvEvents);
     void setAdvertisingData(in int advertiserId, in AdvertiseData data);
     void setScanResponseData(in int advertiserId, in AdvertiseData data);
@@ -80,6 +81,8 @@
     void refreshDevice(in int clientIf, in String address);
     void discoverServices(in int clientIf, in String address);
     void readCharacteristic(in int clientIf, in String address, in int handle, in int authReq);
+    void readUsingCharacteristicUuid(in int clientIf, in String address, in ParcelUuid uuid,
+                           in int startHandle, in int endHandle, in int authReq);
     void writeCharacteristic(in int clientIf, in String address, in int handle,
                             in int writeType, in int authReq, in byte[] value);
     void readDescriptor(in int clientIf, in String address, in int handle, in int authReq);
diff --git a/core/java/android/bluetooth/le/AdvertisingSet.java b/core/java/android/bluetooth/le/AdvertisingSet.java
index 51571b2..1bc211c 100644
--- a/core/java/android/bluetooth/le/AdvertisingSet.java
+++ b/core/java/android/bluetooth/le/AdvertisingSet.java
@@ -172,7 +172,7 @@
      *
      * @param enable whether the periodic advertising should be enabled (true), or disabled (false).
      */
-    public void setPeriodicAdvertisingEnable(boolean enable) {
+    public void setPeriodicAdvertisingEnabled(boolean enable) {
         try {
             gatt.setPeriodicAdvertisingEnable(this.advertiserId, enable);
         } catch (RemoteException e) {
@@ -181,7 +181,23 @@
     }
 
     /**
-     * Returns advertiserId associated with thsi advertising set.
+     * Returns address associated with this advertising set.
+     * This method is exposed only for Bluetooth PTS tests, no app or system service
+     * should ever use it.
+     *
+     * This method requires {@link android.Manifest.permission#BLUETOOTH_PRIVILEGED} permission.
+     * @hide
+     */
+    public void getOwnAddress(){
+        try {
+            gatt.getOwnAddress(this.advertiserId);
+        } catch (RemoteException e) {
+            Log.e(TAG, "remote exception - ", e);
+        }
+    }
+
+    /**
+     * Returns advertiserId associated with this advertising set.
      *
      * @hide
      */
diff --git a/core/java/android/bluetooth/le/AdvertisingSetCallback.java b/core/java/android/bluetooth/le/AdvertisingSetCallback.java
index fe3b1cd..c3c16a4 100644
--- a/core/java/android/bluetooth/le/AdvertisingSetCallback.java
+++ b/core/java/android/bluetooth/le/AdvertisingSetCallback.java
@@ -135,7 +135,7 @@
                                              int status) {}
 
     /**
-     * Callback triggered in response to {@link AdvertisingSet#setPeriodicAdvertisingEnable}
+     * Callback triggered in response to {@link AdvertisingSet#setPeriodicAdvertisingEnabled}
      * indicating result of the operation.
      *
      * @param advertisingSet The advertising set.
@@ -143,4 +143,15 @@
      */
     public void onPeriodicAdvertisingEnabled(AdvertisingSet advertisingSet, boolean enable,
                                             int status) {}
+
+    /**
+     * Callback triggered in response to {@link AdvertisingSet#getOwnAddress()}
+     * indicating result of the operation.
+     *
+     * @param advertisingSet The advertising set.
+     * @param addressType type of address.
+     * @param address advertising set bluetooth address.
+     * @hide
+     */
+    public void onOwnAddressRead(AdvertisingSet advertisingSet, int addressType, String address) {}
 }
\ No newline at end of file
diff --git a/core/java/android/bluetooth/le/AdvertisingSetParameters.java b/core/java/android/bluetooth/le/AdvertisingSetParameters.java
index 31d8f48..71c4484 100644
--- a/core/java/android/bluetooth/le/AdvertisingSetParameters.java
+++ b/core/java/android/bluetooth/le/AdvertisingSetParameters.java
@@ -242,7 +242,7 @@
          * non-connectable.
          * Legacy advertisements can be both connectable and scannable. Non-legacy
          * advertisements can be only scannable or only connectable.
-         * @param connectable Controls whether the advertisment type will be
+         * @param connectable Controls whether the advertisement type will be
          * connectable (true) or non-connectable (false).
          */
         public Builder setConnectable(boolean connectable) {
@@ -254,7 +254,7 @@
          * Set whether the advertisement type should be scannable.
          * Legacy advertisements can be both connectable and scannable. Non-legacy
          * advertisements can be only scannable or only connectable.
-         * @param scannable Controls whether the advertisment type will be
+         * @param scannable Controls whether the advertisement type will be
          * scannable (true) or non-scannable (false).
          */
         public Builder setScannable(boolean scannable) {
@@ -386,6 +386,7 @@
 
         /**
          * Build the {@link AdvertisingSetParameters} object.
+         * @throws IllegalStateException if invalid combination of parameters is used.
          */
         public AdvertisingSetParameters build() {
             if (isLegacy) {
@@ -394,22 +395,22 @@
                 }
 
                 if (connectable == true && scannable == false) {
-                    throw new IllegalArgumentException(
+                    throw new IllegalStateException(
                         "Legacy advertisement can't be connectable and non-scannable");
                 }
 
                 if (includeTxPower) {
-                    throw new IllegalArgumentException(
+                    throw new IllegalStateException(
                         "Legacy advertising can't include TX power level in header");
                 }
             } else {
                 if (connectable && scannable) {
-                    throw new IllegalArgumentException(
+                    throw new IllegalStateException(
                         "Advertising can't be both connectable and scannable");
                 }
 
                 if (isAnonymous && connectable) {
-                    throw new IllegalArgumentException(
+                    throw new IllegalStateException(
                         "Advertising can't be both connectable and anonymous");
                 }
             }
diff --git a/core/java/android/bluetooth/le/BluetoothLeAdvertiser.java b/core/java/android/bluetooth/le/BluetoothLeAdvertiser.java
index 0c7958d..67d56d5 100644
--- a/core/java/android/bluetooth/le/BluetoothLeAdvertiser.java
+++ b/core/java/android/bluetooth/le/BluetoothLeAdvertiser.java
@@ -544,6 +544,17 @@
             }
 
             @Override
+            public void onOwnAddressRead(int advertiserId, int addressType, String address) {
+                handler.post(new Runnable() {
+                    @Override
+                    public void run() {
+                        AdvertisingSet advertisingSet = mAdvertisingSets.get(advertiserId);
+                        callback.onOwnAddressRead(advertisingSet, addressType, address);
+                    }
+                });
+            }
+
+            @Override
             public void onAdvertisingSetStopped(int advertiserId) {
                 handler.post(new Runnable() {
                     @Override
diff --git a/core/java/android/bluetooth/le/IAdvertisingSetCallback.aidl b/core/java/android/bluetooth/le/IAdvertisingSetCallback.aidl
index 2c9f4ba..3628c77 100644
--- a/core/java/android/bluetooth/le/IAdvertisingSetCallback.aidl
+++ b/core/java/android/bluetooth/le/IAdvertisingSetCallback.aidl
@@ -21,6 +21,7 @@
  */
 oneway interface IAdvertisingSetCallback {
   void onAdvertisingSetStarted(in int advertiserId, in int tx_power, in int status);
+  void onOwnAddressRead(in int advertiserId, in int addressType, in String address);
   void onAdvertisingSetStopped(in int advertiserId);
   void onAdvertisingEnabled(in int advertiserId, in boolean enable, in int status);
   void onAdvertisingDataSet(in int advertiserId, in int status);
diff --git a/core/java/android/bluetooth/le/ScanResult.java b/core/java/android/bluetooth/le/ScanResult.java
index 5b2fa40..e552398 100644
--- a/core/java/android/bluetooth/le/ScanResult.java
+++ b/core/java/android/bluetooth/le/ScanResult.java
@@ -52,6 +52,16 @@
     public static final int SID_NOT_PRESENT = 0xFF;
 
     /**
+     * TX power is not present in the packet.
+     */
+    public static final int TX_POWER_NOT_PRESENT = 0x7F;
+
+    /**
+     * Periodic advertising interval is not present in the packet.
+     */
+    public static final int PERIODIC_INTERVAL_NOT_PRESENT = 0x00;
+
+    /**
      * Mask for checking whether event type represents legacy advertisement.
      */
     private static final int ET_LEGACY_MASK = 0x10;
@@ -265,15 +275,16 @@
 
     /**
      * Returns the transmit power in dBm.
-     * Valid range is [-127, 126]. A value of 127 indicates that the
-     * advertisement did not indicate TX power.
+     * Valid range is [-127, 126]. A value of {@link ScanResult#TX_POWER_NOT_PRESENT}
+     * indicates that the TX power is not present.
      */
     public int getTxPower() { return mTxPower; }
 
     /**
      * Returns the periodic advertising interval in units of 1.25ms.
-     * Valid range is 6 (7.5ms) to 65536 (81918.75ms). A value of 0 means
-     * periodic advertising is not used for this scan result.
+     * Valid range is 6 (7.5ms) to 65536 (81918.75ms). A value of
+     * {@link ScanResult#PERIODIC_INTERVAL_NOT_PRESENT} means periodic
+     * advertising interval is not present.
      */
     public int getPeriodicAdvertisingInterval() {
         return mPeriodicAdvertisingInterval;
diff --git a/core/java/android/companion/BluetoothLEDeviceFilter.java b/core/java/android/companion/BluetoothLeDeviceFilter.java
similarity index 82%
rename from core/java/android/companion/BluetoothLEDeviceFilter.java
rename to core/java/android/companion/BluetoothLeDeviceFilter.java
index e5ea4e9..7fb768c 100644
--- a/core/java/android/companion/BluetoothLEDeviceFilter.java
+++ b/core/java/android/companion/BluetoothLeDeviceFilter.java
@@ -38,6 +38,7 @@
 import com.android.internal.util.ObjectUtils;
 import com.android.internal.util.Preconditions;
 
+import java.nio.ByteOrder;
 import java.util.Arrays;
 import java.util.Objects;
 import java.util.regex.Pattern;
@@ -47,10 +48,10 @@
  *
  * @see ScanFilter
  */
-public final class BluetoothLEDeviceFilter implements DeviceFilter<ScanResult> {
+public final class BluetoothLeDeviceFilter implements DeviceFilter<ScanResult> {
 
     private static final boolean DEBUG = false;
-    private static final String LOG_TAG = "BluetoothLEDeviceFilter";
+    private static final String LOG_TAG = "BluetoothLeDeviceFilter";
 
     private static final int RENAME_PREFIX_LENGTH_LIMIT = 10;
 
@@ -61,15 +62,15 @@
     private final String mRenamePrefix;
     private final String mRenameSuffix;
     private final int mRenameBytesFrom;
-    private final int mRenameBytesTo;
+    private final int mRenameBytesLength;
     private final int mRenameNameFrom;
-    private final int mRenameNameTo;
+    private final int mRenameNameLength;
     private final boolean mRenameBytesReverseOrder;
 
-    private BluetoothLEDeviceFilter(Pattern namePattern, ScanFilter scanFilter,
+    private BluetoothLeDeviceFilter(Pattern namePattern, ScanFilter scanFilter,
             byte[] rawDataFilter, byte[] rawDataFilterMask, String renamePrefix,
-            String renameSuffix, int renameBytesFrom, int renameBytesTo,
-            int renameNameFrom, int renameNameTo, boolean renameBytesReverseOrder) {
+            String renameSuffix, int renameBytesFrom, int renameBytesLength,
+            int renameNameFrom, int renameNameLength, boolean renameBytesReverseOrder) {
         mNamePattern = namePattern;
         mScanFilter = ObjectUtils.firstNotNull(scanFilter, ScanFilter.EMPTY);
         mRawDataFilter = rawDataFilter;
@@ -77,9 +78,9 @@
         mRenamePrefix = renamePrefix;
         mRenameSuffix = renameSuffix;
         mRenameBytesFrom = renameBytesFrom;
-        mRenameBytesTo = renameBytesTo;
+        mRenameBytesLength = renameBytesLength;
         mRenameNameFrom = renameNameFrom;
-        mRenameNameTo = renameNameTo;
+        mRenameNameLength = renameNameLength;
         mRenameBytesReverseOrder = renameBytesReverseOrder;
     }
 
@@ -125,8 +126,8 @@
     }
 
     /** @hide */
-    public int getRenameBytesTo() {
-        return mRenameBytesTo;
+    public int getRenameBytesLength() {
+        return mRenameBytesLength;
     }
 
     /** @hide */
@@ -145,7 +146,7 @@
         if (mRenameBytesFrom >= 0) {
             final byte[] bytes = sr.getScanRecord().getBytes();
             int startInclusive = mRenameBytesFrom;
-            int endInclusive = mRenameBytesTo - 1;
+            int endInclusive = mRenameBytesFrom + mRenameBytesLength -1;
             int initial = mRenameBytesReverseOrder ? endInclusive : startInclusive;
             int step = mRenameBytesReverseOrder ? -1 : 1;
             for (int i = initial; startInclusive <= i && i <= endInclusive; i += step) {
@@ -154,7 +155,7 @@
         } else {
             sb.append(
                     getDeviceDisplayNameInternal(sr.getDevice())
-                            .substring(mRenameNameFrom, mRenameNameTo));
+                            .substring(mRenameNameFrom, mRenameNameFrom + mRenameNameLength));
         }
         return sb.append(TextUtils.emptyIfNull(mRenameSuffix)).toString();
     }
@@ -186,9 +187,11 @@
     public boolean equals(Object o) {
         if (this == o) return true;
         if (o == null || getClass() != o.getClass()) return false;
-        BluetoothLEDeviceFilter that = (BluetoothLEDeviceFilter) o;
+        BluetoothLeDeviceFilter that = (BluetoothLeDeviceFilter) o;
         return mRenameBytesFrom == that.mRenameBytesFrom &&
-                mRenameBytesTo == that.mRenameBytesTo &&
+                mRenameBytesLength == that.mRenameBytesLength &&
+                mRenameNameFrom == that.mRenameNameFrom &&
+                mRenameNameLength == that.mRenameNameLength &&
                 mRenameBytesReverseOrder == that.mRenameBytesReverseOrder &&
                 Objects.equals(mNamePattern, that.mNamePattern) &&
                 Objects.equals(mScanFilter, that.mScanFilter) &&
@@ -201,8 +204,8 @@
     @Override
     public int hashCode() {
         return Objects.hash(mNamePattern, mScanFilter, mRawDataFilter, mRawDataFilterMask,
-                mRenamePrefix, mRenameSuffix, mRenameBytesFrom, mRenameBytesTo,
-                mRenameBytesReverseOrder);
+                mRenamePrefix, mRenameSuffix, mRenameBytesFrom, mRenameBytesLength,
+                mRenameNameFrom, mRenameNameLength, mRenameBytesReverseOrder);
     }
 
     @Override
@@ -214,9 +217,9 @@
         dest.writeString(mRenamePrefix);
         dest.writeString(mRenameSuffix);
         dest.writeInt(mRenameBytesFrom);
-        dest.writeInt(mRenameBytesTo);
+        dest.writeInt(mRenameBytesLength);
         dest.writeInt(mRenameNameFrom);
-        dest.writeInt(mRenameNameTo);
+        dest.writeInt(mRenameNameLength);
         dest.writeBoolean(mRenameBytesReverseOrder);
     }
 
@@ -235,17 +238,17 @@
                 ", mRenamePrefix='" + mRenamePrefix + '\'' +
                 ", mRenameSuffix='" + mRenameSuffix + '\'' +
                 ", mRenameBytesFrom=" + mRenameBytesFrom +
-                ", mRenameBytesTo=" + mRenameBytesTo +
+                ", mRenameBytesLength=" + mRenameBytesLength +
                 ", mRenameNameFrom=" + mRenameNameFrom +
-                ", mRenameNameTo=" + mRenameNameTo +
+                ", mRenameNameLength=" + mRenameNameLength +
                 ", mRenameBytesReverseOrder=" + mRenameBytesReverseOrder +
                 '}';
     }
 
-    public static final Creator<BluetoothLEDeviceFilter> CREATOR
-            = new Creator<BluetoothLEDeviceFilter>() {
+    public static final Creator<BluetoothLeDeviceFilter> CREATOR
+            = new Creator<BluetoothLeDeviceFilter>() {
         @Override
-        public BluetoothLEDeviceFilter createFromParcel(Parcel in) {
+        public BluetoothLeDeviceFilter createFromParcel(Parcel in) {
             Builder builder = new Builder()
                     .setNamePattern(patternFromString(in.readString()))
                     .setScanFilter(in.readParcelable(null));
@@ -264,7 +267,7 @@
             if (renamePrefix != null) {
                 if (bytesFrom >= 0) {
                     builder.setRenameFromBytes(renamePrefix, suffix, bytesFrom, bytesTo,
-                            bytesReverseOrder);
+                            bytesReverseOrder ? ByteOrder.LITTLE_ENDIAN : ByteOrder.BIG_ENDIAN);
                 } else {
                     builder.setRenameFromName(renamePrefix, suffix, nameFrom, nameTo);
                 }
@@ -273,8 +276,8 @@
         }
 
         @Override
-        public BluetoothLEDeviceFilter[] newArray(int size) {
-            return new BluetoothLEDeviceFilter[size];
+        public BluetoothLeDeviceFilter[] newArray(int size) {
+            return new BluetoothLeDeviceFilter[size];
         }
     };
 
@@ -283,9 +286,9 @@
     }
 
     /**
-     * Builder for {@link BluetoothLEDeviceFilter}
+     * Builder for {@link BluetoothLeDeviceFilter}
      */
-    public static final class Builder extends OneTimeUseBuilder<BluetoothLEDeviceFilter> {
+    public static final class Builder extends OneTimeUseBuilder<BluetoothLeDeviceFilter> {
         private ScanFilter mScanFilter;
         private Pattern mNamePattern;
         private byte[] mRawDataFilter;
@@ -293,9 +296,9 @@
         private String mRenamePrefix;
         private String mRenameSuffix;
         private int mRenameBytesFrom = -1;
-        private int mRenameBytesTo;
+        private int mRenameBytesLength;
         private int mRenameNameFrom = -1;
-        private int mRenameNameTo;
+        private int mRenameNameLength;
         private boolean mRenameBytesReverseOrder = false;
 
         /**
@@ -355,19 +358,19 @@
          * @param prefix to be displayed before the byte data
          * @param suffix to be displayed after the byte data
          * @param bytesFrom the start byte index to be displayed (inclusive)
-         * @param bytesTo the end byte index to be displayed (exclusive)
-         * @param bytesReverseOrder if true, the byte order of the provided range will be flipped
-         *                          when displaying
+         * @param bytesLength the number of bytes to be displayed from the given index
+         * @param byteOrder whether the given range of bytes is big endian (will be displayed
+         *                   in same order) or little endian (will be flipped before displaying)
          * @return self for chaining
          */
         @NonNull
         public Builder setRenameFromBytes(@NonNull String prefix, @NonNull String suffix,
-                int bytesFrom, int bytesTo, boolean bytesReverseOrder) {
+                int bytesFrom, int bytesLength, ByteOrder byteOrder) {
             checkRenameNotSet();
-            checkRangeNotEmpty(bytesFrom, bytesTo);
+            checkRangeNotEmpty(bytesLength);
             mRenameBytesFrom = bytesFrom;
-            mRenameBytesTo = bytesTo;
-            mRenameBytesReverseOrder = bytesReverseOrder;
+            mRenameBytesLength = bytesLength;
+            mRenameBytesReverseOrder = byteOrder == ByteOrder.LITTLE_ENDIAN;
             return setRename(prefix, suffix);
         }
 
@@ -383,16 +386,16 @@
          * @param prefix to be displayed before the byte data
          * @param suffix to be displayed after the byte data
          * @param nameFrom the start name character index to be displayed (inclusive)
-         * @param nameTo the end name character index to be displayed (exclusive)
+         * @param nameLength the number of characters to be displayed from the given index
          * @return self for chaining
          */
         @NonNull
         public Builder setRenameFromName(@NonNull String prefix, @NonNull String suffix,
-                int nameFrom, int nameTo) {
+                int nameFrom, int nameLength) {
             checkRenameNotSet();
-            checkRangeNotEmpty(nameFrom, nameTo);
+            checkRangeNotEmpty(nameLength);
             mRenameNameFrom = nameFrom;
-            mRenameNameTo = nameTo;
+            mRenameNameLength = nameLength;
             mRenameBytesReverseOrder = false;
             return setRename(prefix, suffix);
         }
@@ -401,8 +404,8 @@
             checkState(mRenamePrefix == null, "Renaming rule can only be set once");
         }
 
-        private void checkRangeNotEmpty(int bytesFrom, int bytesTo) {
-            checkArgument(bytesFrom < bytesTo, "Range must be non-empty");
+        private void checkRangeNotEmpty(int length) {
+            checkArgument(length > 0, "Range must be non-empty");
         }
 
         @NonNull
@@ -418,13 +421,13 @@
         /** @inheritDoc */
         @Override
         @NonNull
-        public BluetoothLEDeviceFilter build() {
+        public BluetoothLeDeviceFilter build() {
             markUsed();
-            return new BluetoothLEDeviceFilter(mNamePattern, mScanFilter,
+            return new BluetoothLeDeviceFilter(mNamePattern, mScanFilter,
                     mRawDataFilter, mRawDataFilterMask,
                     mRenamePrefix, mRenameSuffix,
-                    mRenameBytesFrom, mRenameBytesTo,
-                    mRenameNameFrom, mRenameNameTo,
+                    mRenameBytesFrom, mRenameBytesLength,
+                    mRenameNameFrom, mRenameNameLength,
                     mRenameBytesReverseOrder);
         }
     }
diff --git a/core/java/android/content/ClipData.java b/core/java/android/content/ClipData.java
index 6703bd4..5bc1f18 100644
--- a/core/java/android/content/ClipData.java
+++ b/core/java/android/content/ClipData.java
@@ -846,7 +846,7 @@
      * Add a new Item to the overall ClipData container.
      * <p> This method will <em>not</em> update the list of available MIME types in the
      * {@link ClipDescription}. It should be used only when adding items which do not add new
-     * MIME types to this clip. If this is not the case, use {@link #addItem(Item, ContentResolver)}
+     * MIME types to this clip. If this is not the case, use {@link #addItem(ContentResolver, Item)}
      * or call {@link #ClipData(CharSequence, String[], Item)} with a complete list of MIME types.
      * @param item Item to be added.
      */
@@ -857,15 +857,21 @@
         mItems.add(item);
     }
 
+    /** @removed use #addItem(ContentResolver, Item) instead */
+    @Deprecated
+    public void addItem(Item item, ContentResolver resolver) {
+        addItem(resolver, item);
+    }
+
     /**
      * Add a new Item to the overall ClipData container.
      * <p> Unlike {@link #addItem(Item)}, this method will update the list of available MIME types
      * in the {@link ClipDescription}.
-     * @param item Item to be added.
      * @param resolver ContentResolver used to get information about the URI possibly contained in
      * the item.
+     * @param item Item to be added.
      */
-    public void addItem(Item item, ContentResolver resolver) {
+    public void addItem(ContentResolver resolver, Item item) {
         addItem(item);
 
         if (item.getHtmlText() != null) {
diff --git a/core/java/android/content/ContentResolver.java b/core/java/android/content/ContentResolver.java
index 28cfd33..309827c 100644
--- a/core/java/android/content/ContentResolver.java
+++ b/core/java/android/content/ContentResolver.java
@@ -36,7 +36,6 @@
 import android.graphics.Point;
 import android.graphics.drawable.Drawable;
 import android.net.Uri;
-import android.os.Build;
 import android.os.Bundle;
 import android.os.CancellationSignal;
 import android.os.DeadObjectException;
@@ -516,12 +515,7 @@
     public ContentResolver(Context context) {
         mContext = context != null ? context : ActivityThread.currentApplication();
         mPackageName = mContext.getOpPackageName();
-        if (android.os.Process.myUid() == android.os.Process.PHONE_UID) {
-            // STOPSHIP: Telephony needs to fix b/35792675
-            mTargetSdkVersion = Build.VERSION_CODES.N_MR1;
-        } else {
-            mTargetSdkVersion = mContext.getApplicationInfo().targetSdkVersion;
-        }
+        mTargetSdkVersion = mContext.getApplicationInfo().targetSdkVersion;
     }
 
     /** @hide */
diff --git a/core/java/android/content/Intent.java b/core/java/android/content/Intent.java
index 5f7947f..e013662 100644
--- a/core/java/android/content/Intent.java
+++ b/core/java/android/content/Intent.java
@@ -1840,6 +1840,14 @@
     public static final String EXTRA_SPLIT_NAME = "android.intent.extra.SPLIT_NAME";
 
     /**
+     * Intent extra: A {@link ComponentName} value.
+     * <p>
+     * Type: String
+     * </p>
+     */
+    public static final String EXTRA_COMPONENT_NAME = "android.intent.extra.COMPONENT_NAME";
+
+    /**
      * Intent extra: An extra for specifying whether a result is needed.
      * <p>
      * Type: boolean
@@ -3228,6 +3236,7 @@
      * caused the broadcast.
      * @hide
      */
+    @SystemApi
     public static final String ACTION_GLOBAL_BUTTON = "android.intent.action.GLOBAL_BUTTON";
 
     /**
@@ -4422,6 +4431,21 @@
     public static final String EXTRA_VERSION_CODE = "android.intent.extra.VERSION_CODE";
 
     /**
+     * The app that triggered the ephemeral installation.
+     * @hide
+     */
+    public static final String EXTRA_CALLING_PACKAGE
+            = "android.intent.extra.CALLING_PACKAGE";
+
+    /**
+     * Optional calling app provided bundle containing additional launch information the
+     * installer may use.
+     * @hide
+     */
+    public static final String EXTRA_VERIFICATION_BUNDLE
+            = "android.intent.extra.VERIFICATION_BUNDLE";
+
+    /**
      * A Bundle forming a mapping of potential target package names to different extras Bundles
      * to add to the default intent extras in {@link #EXTRA_INTENT} when used with
      * {@link #ACTION_CHOOSER}. Each key should be a package name. The package need not
diff --git a/core/java/android/content/pm/ApplicationInfo.java b/core/java/android/content/pm/ApplicationInfo.java
index 6c5d26a..06f7916 100644
--- a/core/java/android/content/pm/ApplicationInfo.java
+++ b/core/java/android/content/pm/ApplicationInfo.java
@@ -1205,7 +1205,8 @@
         dest.writeInt(largestWidthLimitDp);
         if (storageUuid != null) {
             dest.writeInt(1);
-            dest.writeUuid(storageUuid);
+            dest.writeLong(storageUuid.getMostSignificantBits());
+            dest.writeLong(storageUuid.getLeastSignificantBits());
         } else {
             dest.writeInt(0);
         }
@@ -1271,7 +1272,7 @@
         compatibleWidthLimitDp = source.readInt();
         largestWidthLimitDp = source.readInt();
         if (source.readInt() != 0) {
-            storageUuid = source.readUuid();
+            storageUuid = new UUID(source.readLong(), source.readLong());
             volumeUuid = StorageManager.convert(storageUuid);
         }
         scanSourceDir = source.readString();
diff --git a/core/java/android/content/pm/InstantAppRequest.java b/core/java/android/content/pm/InstantAppRequest.java
index b45169d..27d2828 100644
--- a/core/java/android/content/pm/InstantAppRequest.java
+++ b/core/java/android/content/pm/InstantAppRequest.java
@@ -17,6 +17,7 @@
 package android.content.pm;
 
 import android.content.Intent;
+import android.os.Bundle;
 
 /**
  * Information needed to make an instant application resolution request.
@@ -33,13 +34,18 @@
     public final String callingPackage;
     /** ID of the user requesting the instant application */
     public final int userId;
+    /**
+     * Optional extra bundle provided by the source application to the installer for additional
+     * verification. */
+    public final Bundle verificationBundle;
 
     public InstantAppRequest(AuxiliaryResolveInfo responseObj, Intent origIntent,
-            String resolvedType, String callingPackage, int userId) {
+            String resolvedType, String callingPackage, int userId, Bundle verificationBundle) {
         this.responseObj = responseObj;
         this.origIntent = origIntent;
         this.resolvedType = resolvedType;
         this.callingPackage = callingPackage;
         this.userId = userId;
+        this.verificationBundle = verificationBundle;
     }
-}
\ No newline at end of file
+}
diff --git a/core/java/android/content/pm/InstrumentationInfo.java b/core/java/android/content/pm/InstrumentationInfo.java
index f6f1be6..3faa951 100644
--- a/core/java/android/content/pm/InstrumentationInfo.java
+++ b/core/java/android/content/pm/InstrumentationInfo.java
@@ -19,7 +19,6 @@
 import android.os.Parcel;
 import android.os.Parcelable;
 import android.util.SparseArray;
-import android.util.SparseIntArray;
 
 /**
  * Information you can retrieve about a particular piece of test
@@ -38,7 +37,7 @@
      * runs in the main process of the targetPackage.  Can either be a comma-separated list
      * of process names or '*' for any process that launches to run targetPackage code.
      */
-    public String targetProcess;
+    public String targetProcesses;
 
     /**
      * Full path to the base APK for this application.
@@ -122,7 +121,7 @@
     public InstrumentationInfo(InstrumentationInfo orig) {
         super(orig);
         targetPackage = orig.targetPackage;
-        targetProcess = orig.targetProcess;
+        targetProcesses = orig.targetProcesses;
         sourceDir = orig.sourceDir;
         publicSourceDir = orig.publicSourceDir;
         splitNames = orig.splitNames;
@@ -151,7 +150,7 @@
     public void writeToParcel(Parcel dest, int parcelableFlags) {
         super.writeToParcel(dest, parcelableFlags);
         dest.writeString(targetPackage);
-        dest.writeString(targetProcess);
+        dest.writeString(targetProcesses);
         dest.writeString(sourceDir);
         dest.writeString(publicSourceDir);
         dest.writeStringArray(splitNames);
@@ -181,7 +180,7 @@
     private InstrumentationInfo(Parcel source) {
         super(source);
         targetPackage = source.readString();
-        targetProcess = source.readString();
+        targetProcesses = source.readString();
         sourceDir = source.readString();
         publicSourceDir = source.readString();
         splitNames = source.readStringArray();
diff --git a/core/java/android/content/pm/PackageManagerInternal.java b/core/java/android/content/pm/PackageManagerInternal.java
index 7bfde75..426f3cf 100644
--- a/core/java/android/content/pm/PackageManagerInternal.java
+++ b/core/java/android/content/pm/PackageManagerInternal.java
@@ -19,6 +19,7 @@
 import android.content.ComponentName;
 import android.content.Intent;
 import android.content.pm.PackageManager.NameNotFoundException;
+import android.os.Bundle;
 import android.util.SparseArray;
 
 import java.util.List;
@@ -215,11 +216,13 @@
      * @param origIntent The original intent that triggered ephemeral resolution
      * @param resolvedType The resolved type of the intent
      * @param callingPackage The name of the package requesting the ephemeral application
+     * @param verificationBundle Optional bundle to pass to the installer for additional
+     * verification
      * @param userId The ID of the user that triggered ephemeral resolution
      */
     public abstract void requestInstantAppResolutionPhaseTwo(AuxiliaryResolveInfo responseObj,
             Intent origIntent, String resolvedType, String callingPackage,
-            int userId);
+            Bundle verificationBundle, int userId);
 
     /**
      * Grants access to the package metadata for an ephemeral application.
@@ -333,4 +336,9 @@
      * @param isolatedUid isolated uid that is no longer being used.
      */
     public abstract void removeIsolatedUid(int isolatedUid);
+
+    /**
+     * Return the taget SDK version for the app with the given UID.
+     */
+    public abstract int getUidTargetSdkVersion(int uid);
 }
diff --git a/core/java/android/content/pm/PackageParser.java b/core/java/android/content/pm/PackageParser.java
index e4db0f0..fc26d0e 100644
--- a/core/java/android/content/pm/PackageParser.java
+++ b/core/java/android/content/pm/PackageParser.java
@@ -148,7 +148,7 @@
     private static final String PROPERTY_CHILD_PACKAGES_ENABLED =
             "persist.sys.child_packages_enabled";
 
-    private static final boolean MULTI_PACKAGE_APK_ENABLED =
+    private static final boolean MULTI_PACKAGE_APK_ENABLED = Build.IS_DEBUGGABLE &&
             SystemProperties.getBoolean(PROPERTY_CHILD_PACKAGES_ENABLED, false);
 
     private static final int MAX_PACKAGES_PER_APK = 5;
@@ -547,6 +547,8 @@
      */
     public interface Callback {
         boolean hasFeature(String feature);
+        String[] getOverlayPaths(String targetPackageName, String targetPath);
+        String[] getOverlayApks(String targetPackageName);
     }
 
     /**
@@ -563,6 +565,14 @@
         @Override public boolean hasFeature(String feature) {
             return mPm.hasSystemFeature(feature);
         }
+
+        @Override public String[] getOverlayPaths(String targetPackageName, String targetPath) {
+            return null;
+        }
+
+        @Override public String[] getOverlayApks(String targetPackageName) {
+            return null;
+        }
     }
 
     /**
@@ -1054,7 +1064,19 @@
 
         try {
             final byte[] bytes = IoUtils.readFileAsByteArray(cacheFile.getAbsolutePath());
-            return fromCacheEntry(bytes);
+            Package p = fromCacheEntry(bytes);
+            if (mCallback != null) {
+                String[] overlayApks = mCallback.getOverlayApks(p.packageName);
+                if (overlayApks != null && overlayApks.length > 0) {
+                    for (String overlayApk : overlayApks) {
+                        // If a static RRO is updated, return null.
+                        if (!isCacheUpToDate(new File(overlayApk), cacheFile)) {
+                            return null;
+                        }
+                    }
+                }
+            }
+            return p;
         } catch (Exception e) {
             Slog.w(TAG, "Error reading package cache: ", e);
 
@@ -1238,7 +1260,7 @@
             parser = assets.openXmlResourceParser(cookie, ANDROID_MANIFEST_FILENAME);
 
             final String[] outError = new String[1];
-            final Package pkg = parseBaseApk(res, parser, flags, outError);
+            final Package pkg = parseBaseApk(apkPath, res, parser, flags, outError);
             if (pkg == null) {
                 throw new PackageParserException(mParseError,
                         apkPath + " (at " + parser.getPositionDescription() + "): " + outError[0]);
@@ -1938,6 +1960,7 @@
      * need to consider whether they should be supported by split APKs and child
      * packages.
      *
+     * @param apkPath The package apk file path
      * @param res The resources from which to resolve values
      * @param parser The manifest parser
      * @param flags Flags how to parse
@@ -1947,7 +1970,7 @@
      * @throws XmlPullParserException
      * @throws IOException
      */
-    private Package parseBaseApk(Resources res, XmlResourceParser parser, int flags,
+    private Package parseBaseApk(String apkPath, Resources res, XmlResourceParser parser, int flags,
             String[] outError) throws XmlPullParserException, IOException {
         final String splitName;
         final String pkgName;
@@ -1967,6 +1990,15 @@
             return null;
         }
 
+        if (mCallback != null) {
+            String[] overlayPaths = mCallback.getOverlayPaths(pkgName, apkPath);
+            if (overlayPaths != null && overlayPaths.length > 0) {
+                for (String overlayPath : overlayPaths) {
+                    res.getAssets().addOverlayPath(overlayPath);
+                }
+            }
+        }
+
         final Package pkg = new Package(pkgName);
 
         TypedArray sa = res.obtainAttributes(parser,
@@ -3268,8 +3300,8 @@
         a.info.targetPackage = str != null ? str.intern() : null;
 
         str = sa.getNonResourceString(
-                com.android.internal.R.styleable.AndroidManifestInstrumentation_targetProcess);
-        a.info.targetProcess = str != null ? str.intern() : null;
+                com.android.internal.R.styleable.AndroidManifestInstrumentation_targetProcesses);
+        a.info.targetProcesses = str != null ? str.intern() : null;
 
         a.info.handleProfiling = sa.getBoolean(
                 com.android.internal.R.styleable.AndroidManifestInstrumentation_handleProfiling,
@@ -7205,8 +7237,8 @@
                 info.targetPackage = info.targetPackage.intern();
             }
 
-            if (info.targetProcess != null) {
-                info.targetProcess = info.targetProcess.intern();
+            if (info.targetProcesses != null) {
+                info.targetProcesses = info.targetProcesses.intern();
             }
         }
 
diff --git a/core/java/android/content/res/AssetManager.java b/core/java/android/content/res/AssetManager.java
index a044804..f0adcd6 100644
--- a/core/java/android/content/res/AssetManager.java
+++ b/core/java/android/content/res/AssetManager.java
@@ -788,8 +788,8 @@
     /**
      * Retrieve the resource identifier for the given resource name.
      */
-    /*package*/ native final int getResourceIdentifier(String type,
-                                                       String name,
+    /*package*/ native final int getResourceIdentifier(String name,
+                                                       String defType,
                                                        String defPackage);
 
     /*package*/ native final String getResourceName(int resid);
diff --git a/core/java/android/hardware/Camera.java b/core/java/android/hardware/Camera.java
index 061346c..aa35a66 100644
--- a/core/java/android/hardware/Camera.java
+++ b/core/java/android/hardware/Camera.java
@@ -189,7 +189,7 @@
      *
      * <p>In {@link android.os.Build.VERSION_CODES#O Android O} this broadcast has been brought
      * back, but only for <em>registered</em> receivers.  Apps that are actively running can
-     * against listen to the broadcast if they want an immediate clear signal about a picture
+     * again listen to the broadcast if they want an immediate clear signal about a picture
      * being taken, however anything doing heavy work (or needing to be launched) as a result of
      * this should still use JobScheduler.</p>
      */
@@ -208,12 +208,11 @@
      *
      * <p>In {@link android.os.Build.VERSION_CODES#O Android O} this broadcast has been brought
      * back, but only for <em>registered</em> receivers.  Apps that are actively running can
-     * against listen to the broadcast if they want an immediate clear signal about a video
+     * again listen to the broadcast if they want an immediate clear signal about a video
      * being taken, however anything doing heavy work (or needing to be launched) as a result of
      * this should still use JobScheduler.</p>
      */
     @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION)
-    @Deprecated
     public static final String ACTION_NEW_VIDEO = "android.hardware.action.NEW_VIDEO";
 
     /**
diff --git a/core/java/android/hardware/HardwareBuffer.java b/core/java/android/hardware/HardwareBuffer.java
index 9d217d3..7049628 100644
--- a/core/java/android/hardware/HardwareBuffer.java
+++ b/core/java/android/hardware/HardwareBuffer.java
@@ -70,37 +70,34 @@
 
     /** @hide */
     @Retention(RetentionPolicy.SOURCE)
-    @IntDef(flag = true, value = {USAGE0_CPU_READ, USAGE0_CPU_READ_OFTEN, USAGE0_CPU_WRITE,
-            USAGE0_CPU_WRITE_OFTEN, USAGE0_GPU_SAMPLED_IMAGE, USAGE0_GPU_COLOR_OUTPUT,
-            USAGE0_GPU_STORAGE_IMAGE, USAGE0_GPU_CUBEMAP, USAGE0_GPU_DATA_BUFFER,
-            USAGE0_PROTECTED_CONTENT, USAGE0_SENSOR_DIRECT_DATA, USAGE0_VIDEO_ENCODE})
-    public @interface Usage0 {};
+    @IntDef(flag = true, value = {USAGE_CPU_READ_RARELY, USAGE_CPU_READ_OFTEN,
+            USAGE_CPU_WRITE_RARELY, USAGE_CPU_WRITE_OFTEN, USAGE_GPU_SAMPLED_IMAGE,
+            USAGE_GPU_COLOR_OUTPUT, USAGE_PROTECTED_CONTENT, USAGE_VIDEO_ENCODE,
+            USAGE_GPU_DATA_BUFFER, USAGE_SENSOR_DIRECT_DATA})
+    public @interface Usage {};
 
-    /** Usage0: the buffer will sometimes be read by the CPU */
-    public static final long USAGE0_CPU_READ               = (1 << 1);
-    /** Usage0: the buffer will often be read by the CPU*/
-    public static final long USAGE0_CPU_READ_OFTEN         = (1 << 2 | USAGE0_CPU_READ);
-    /** Usage0: the buffer will sometimes be written to by the CPU */
-    public static final long USAGE0_CPU_WRITE              = (1 << 5);
-    /** Usage0: the buffer will often be written to by the CPU */
-    public static final long USAGE0_CPU_WRITE_OFTEN        = (1 << 6 | USAGE0_CPU_WRITE);
-    /** Usage0: the buffer will be read from by the GPU */
-    public static final long USAGE0_GPU_SAMPLED_IMAGE      = (1 << 10);
-    /** Usage0: the buffer will be written to by the GPU */
-    public static final long USAGE0_GPU_COLOR_OUTPUT       = (1 << 11);
-    /** Usage0: the buffer will be read from and written to by the GPU */
-    public static final long USAGE0_GPU_STORAGE_IMAGE      = (USAGE0_GPU_SAMPLED_IMAGE |
-            USAGE0_GPU_COLOR_OUTPUT);
-    /** Usage0: the buffer will be used as a cubemap texture */
-    public static final long USAGE0_GPU_CUBEMAP            = (1 << 13);
-    /** Usage0: the buffer will be used as a shader storage or uniform buffer object*/
-    public static final long USAGE0_GPU_DATA_BUFFER        = (1 << 14);
-    /** Usage0: the buffer must not be used outside of a protected hardware path */
-    public static final long USAGE0_PROTECTED_CONTENT      = (1 << 18);
-    /** Usage0: the buffer will be used for sensor direct data */
-    public static final long USAGE0_SENSOR_DIRECT_DATA     = (1 << 29);
-    /** Usage0: the buffer will be read by a hardware video encoder */
-    public static final long USAGE0_VIDEO_ENCODE           = (1 << 21);
+    /** Usage: The buffer will sometimes be read by the CPU */
+    public static final long USAGE_CPU_READ_RARELY       = 2;
+    /** Usage: The buffer will often be read by the CPU */
+    public static final long USAGE_CPU_READ_OFTEN        = 3;
+
+    /** Usage: The buffer will sometimes be written to by the CPU */
+    public static final long USAGE_CPU_WRITE_RARELY      = 2 << 4;
+    /** Usage: The buffer will often be written to by the CPU */
+    public static final long USAGE_CPU_WRITE_OFTEN       = 3 << 4;
+
+    /** Usage: The buffer will be read from by the GPU */
+    public static final long USAGE_GPU_SAMPLED_IMAGE      = 1 << 8;
+    /** Usage: The buffer will be written to by the GPU */
+    public static final long USAGE_GPU_COLOR_OUTPUT       = 1 << 9;
+    /** Usage: The buffer must not be used outside of a protected hardware path */
+    public static final long USAGE_PROTECTED_CONTENT      = 1 << 14;
+    /** Usage: The buffer will be read by a hardware video encoder */
+    public static final long USAGE_VIDEO_ENCODE           = 1 << 16;
+    /** Usage: The buffer will be used for sensor direct data */
+    public static final long USAGE_SENSOR_DIRECT_DATA     = 1 << 23;
+    /** Usage: The buffer will be used as a shader storage or uniform buffer object */
+    public static final long USAGE_GPU_DATA_BUFFER        = 1 << 24;
 
     // The approximate size of a native AHardwareBuffer object.
     private static final long NATIVE_HARDWARE_BUFFER_SIZE = 232;
@@ -116,13 +113,11 @@
      * {@link #RGBX_8888}, {@link #RGB_565}, {@link #RGB_888}, {@link #RGBA_1010102}, {@link #BLOB}
      * @param layers The number of layers in the buffer
      * @param usage Flags describing how the buffer will be used, one of
-     *     {@link #USAGE0_CPU_READ}, {@link #USAGE0_CPU_READ_OFTEN}, {@link #USAGE0_CPU_WRITE},
-     *     {@link #USAGE0_CPU_WRITE_OFTEN}, {@link #USAGE0_GPU_SAMPLED_IMAGE},
-     *     {@link #USAGE0_GPU_COLOR_OUTPUT},{@link #USAGE0_GPU_STORAGE_IMAGE},
-     *     {@link #USAGE0_GPU_CUBEMAP}, {@link #USAGE0_GPU_DATA_BUFFER},
-     *     {@link #USAGE0_PROTECTED_CONTENT}, {@link #USAGE0_SENSOR_DIRECT_DATA},
-     *     {@link #USAGE0_VIDEO_ENCODE}
-     *
+     *     {@link #USAGE_CPU_READ_RARELY}, {@link #USAGE_CPU_READ_OFTEN},
+     *     {@link #USAGE_CPU_WRITE_RARELY}, {@link #USAGE_CPU_WRITE_OFTEN},
+     *     {@link #USAGE_GPU_SAMPLED_IMAGE}, {@link #USAGE_GPU_COLOR_OUTPUT},
+     *     {@link #USAGE_GPU_DATA_BUFFER}, {@link #USAGE_PROTECTED_CONTENT},
+     *     {@link #USAGE_SENSOR_DIRECT_DATA}, {@link #USAGE_VIDEO_ENCODE}
      * @return A <code>HardwareBuffer</code> instance if successful, or throws an
      *     IllegalArgumentException if the dimensions passed are invalid (either zero, negative, or
      *     too large to allocate), if the format is not supported, if the requested number of layers
@@ -130,7 +125,7 @@
      */
     @NonNull
     public static HardwareBuffer create(int width, int height, @Format int format, int layers,
-            @Usage0 long usage) {
+            @Usage long usage) {
         if (!HardwareBuffer.isSupportedFormat(format)) {
             throw new IllegalArgumentException("Invalid pixel format " + format);
         }
diff --git a/core/java/android/hardware/SystemSensorManager.java b/core/java/android/hardware/SystemSensorManager.java
index 80cbde7..0dab5d7 100644
--- a/core/java/android/hardware/SystemSensorManager.java
+++ b/core/java/android/hardware/SystemSensorManager.java
@@ -589,9 +589,9 @@
                         "Width if HaradwareBuffer must be greater than "
                         + MIN_DIRECT_CHANNEL_BUFFER_SIZE);
             }
-            if ((hardwareBuffer.getUsage() & HardwareBuffer.USAGE0_SENSOR_DIRECT_DATA) == 0) {
+            if ((hardwareBuffer.getUsage() & HardwareBuffer.USAGE_SENSOR_DIRECT_DATA) == 0) {
                 throw new IllegalArgumentException(
-                        "HardwareBuffer must set usage flag USAGE0_SENSOR_DIRECT_DATA");
+                        "HardwareBuffer must set usage flag USAGE_SENSOR_DIRECT_DATA");
             }
             size = hardwareBuffer.getWidth();
             id = nativeCreateDirectChannel(
diff --git a/core/java/android/metrics/LogMaker.java b/core/java/android/metrics/LogMaker.java
index 3c6baa7..2bb43bd 100644
--- a/core/java/android/metrics/LogMaker.java
+++ b/core/java/android/metrics/LogMaker.java
@@ -170,6 +170,27 @@
     }
 
     /**
+     * This will be set by the system when the log is persisted.
+     * Client-supplied values will be ignored.
+     *
+     * @param uid to replace the existing setting.
+     * @hide
+     */
+    public LogMaker setUid(int uid) {
+        entries.put(MetricsEvent.RESERVED_FOR_LOGBUILDER_UID, uid);
+        return this;
+    }
+
+    /**
+     * Remove the UID property.
+     * @hide
+     */
+    public LogMaker clearUid() {
+        entries.remove(MetricsEvent.RESERVED_FOR_LOGBUILDER_UID);
+        return this;
+    }
+
+    /**
      * The name of the counter or histogram.
      * Only useful for counter or histogram category objects.
      * @param name to replace the existing setting.
@@ -319,6 +340,16 @@
         }
     }
 
+    /** @return the UID of the log, or -1. */
+    public int getUid() {
+        Object obj = entries.get(MetricsEvent.RESERVED_FOR_LOGBUILDER_UID);
+        if (obj instanceof Integer) {
+            return (Integer) obj;
+        } else {
+            return -1;
+        }
+    }
+
     /** @return the name of the counter, or null. */
     public String getCounterName() {
         Object obj = entries.get(MetricsEvent.RESERVED_FOR_LOGBUILDER_NAME);
diff --git a/core/java/android/metrics/MetricsReader.java b/core/java/android/metrics/MetricsReader.java
index 5be977a..5f356ca 100644
--- a/core/java/android/metrics/MetricsReader.java
+++ b/core/java/android/metrics/MetricsReader.java
@@ -93,6 +93,7 @@
             }
             final LogMaker log = new LogMaker(objects)
                     .setTimestamp(eventTimestampMs)
+                    .setUid(event.getUid())
                     .setProcessId(event.getProcessId());
             if (log.getCategory() == MetricsEvent.METRICS_CHECKPOINT) {
                 if (log.getSubtype() == mCheckpointTag) {
@@ -155,11 +156,13 @@
     public static class Event {
         long mTimeMillis;
         int mPid;
+        int mUid;
         Object mData;
 
-        public Event(long timeMillis, int pid, Object data) {
+        public Event(long timeMillis, int pid, int uid, Object data) {
             mTimeMillis = timeMillis;
             mPid = pid;
+            mUid = uid;
             mData = data;
         }
 
@@ -167,6 +170,7 @@
             mTimeMillis = TimeUnit.MILLISECONDS.convert(
                     nativeEvent.getTimeNanos(), TimeUnit.NANOSECONDS);
             mPid = nativeEvent.getProcessId();
+            mUid = nativeEvent.getUid();
             mData = nativeEvent.getData();
         }
 
@@ -178,6 +182,10 @@
             return mPid;
         }
 
+        public int getUid() {
+            return mUid;
+        }
+
         public Object getData() {
             return mData;
         }
diff --git a/core/java/android/net/ConnectivityManager.java b/core/java/android/net/ConnectivityManager.java
index b854cbf..2f2e79a 100644
--- a/core/java/android/net/ConnectivityManager.java
+++ b/core/java/android/net/ConnectivityManager.java
@@ -2974,50 +2974,6 @@
     }
 
     /**
-     * Note: this is a deprecated version of
-     * {@link #requestNetwork(NetworkRequest, int, NetworkCallback)} - please transition code to use
-     * the unhidden version of the function.
-     * TODO: replace all callers with the new version of the API
-     *
-     * Request a network to satisfy a set of {@link android.net.NetworkCapabilities}, limited
-     * by a timeout.
-     *
-     * This function behaves identically to the non-timed-out version
-     * {@link #requestNetwork(NetworkRequest, NetworkCallback)}, but if a suitable network
-     * is not found within the given time (in milliseconds) the
-     * {@link NetworkCallback#onUnavailable()} callback is called. The request can still be
-     * released normally by calling {@link #unregisterNetworkCallback(NetworkCallback)} but does
-     * not have to be released if timed-out (it is automatically released). Unregistering a
-     * request that timed out is not an error.
-     *
-     * <p>Do not use this method to poll for the existence of specific networks (e.g. with a small
-     * timeout) - the {@link #registerNetworkCallback(NetworkRequest, NetworkCallback)} is provided
-     * for that purpose. Calling this method will attempt to bring up the requested network.
-     *
-     * <p>This method requires the caller to hold either the
-     * {@link android.Manifest.permission#CHANGE_NETWORK_STATE} permission
-     * or the ability to modify system settings as determined by
-     * {@link android.provider.Settings.System#canWrite}.</p>
-     *
-     * @param request {@link NetworkRequest} describing this request.
-     * @param networkCallback The callbacks to be utilized for this request.  Note
-     *                        the callbacks must not be shared - they uniquely specify
-     *                        this request.
-     * @param timeoutMs The time in milliseconds to attempt looking for a suitable network
-     *                  before {@link NetworkCallback#onUnavailable()} is called. The timeout must
-     *                  be a positive value (i.e. >0).
-     * @hide
-     */
-    public void requestNetwork(NetworkRequest request, NetworkCallback networkCallback,
-            int timeoutMs) {
-        if (timeoutMs <= 0) {
-            throw new IllegalArgumentException("Non-positive timeoutMs: " + timeoutMs);
-        }
-        int legacyType = inferLegacyTypeForNetworkCapabilities(request.networkCapabilities);
-        requestNetwork(request, networkCallback, timeoutMs, legacyType, getDefaultHandler());
-    }
-
-    /**
      * Request a network to satisfy a set of {@link android.net.NetworkCapabilities}, limited
      * by a timeout.
      *
@@ -3039,14 +2995,14 @@
      * {@link android.provider.Settings.System#canWrite}.</p>
      *
      * @param request {@link NetworkRequest} describing this request.
+     * @param networkCallback The {@link NetworkCallback} to be utilized for this request. Note
+     *                        the callback must not be shared - it uniquely specifies this request.
      * @param timeoutMs The time in milliseconds to attempt looking for a suitable network
      *                  before {@link NetworkCallback#onUnavailable()} is called. The timeout must
      *                  be a positive value (i.e. >0).
-     * @param networkCallback The {@link NetworkCallback} to be utilized for this request. Note
-     *                        the callback must not be shared - it uniquely specifies this request.
      */
-    public void requestNetwork(NetworkRequest request, int timeoutMs,
-            NetworkCallback networkCallback) {
+    public void requestNetwork(NetworkRequest request, NetworkCallback networkCallback,
+            int timeoutMs) {
         if (timeoutMs <= 0) {
             throw new IllegalArgumentException("Non-positive timeoutMs: " + timeoutMs);
         }
@@ -3076,14 +3032,14 @@
      * {@link android.provider.Settings.System#canWrite}.</p>
      *
      * @param request {@link NetworkRequest} describing this request.
-     * @param timeoutMs The time in milliseconds to attempt looking for a suitable network
-     *                  before {@link NetworkCallback#onUnavailable} is called.
      * @param networkCallback The {@link NetworkCallback} to be utilized for this request. Note
      *                        the callback must not be shared - it uniquely specifies this request.
      * @param handler {@link Handler} to specify the thread upon which the callback will be invoked.
+     * @param timeoutMs The time in milliseconds to attempt looking for a suitable network
+     *                  before {@link NetworkCallback#onUnavailable} is called.
      */
-    public void requestNetwork(NetworkRequest request, int timeoutMs,
-            NetworkCallback networkCallback, Handler handler) {
+    public void requestNetwork(NetworkRequest request, NetworkCallback networkCallback,
+            Handler handler, int timeoutMs) {
         if (timeoutMs <= 0) {
             throw new IllegalArgumentException("Non-positive timeoutMs");
         }
@@ -3402,8 +3358,8 @@
     /**
      * It is acceptable to briefly use multipath data to provide seamless connectivity for
      * time-sensitive user-facing operations when the system default network is temporarily
-     * unresponsive. The amount of data should be limited (less than one megabyte), and the
-     * operation should be infrequent to ensure that data usage is limited.
+     * unresponsive. The amount of data should be limited (less than one megabyte for every call to
+     * this method), and the operation should be infrequent to ensure that data usage is limited.
      *
      * An example of such an operation might be a time-sensitive foreground activity, such as a
      * voice command, that the user is performing while walking out of range of a Wi-Fi network.
diff --git a/core/java/android/os/Bundle.java b/core/java/android/os/Bundle.java
index 167c46d..9b5ff29 100644
--- a/core/java/android/os/Bundle.java
+++ b/core/java/android/os/Bundle.java
@@ -25,7 +25,6 @@
 import java.io.Serializable;
 import java.util.ArrayList;
 import java.util.List;
-import java.util.UUID;
 
 /**
  * A mapping from String keys to various {@link Parcelable} values.
@@ -477,18 +476,6 @@
     }
 
     /**
-     * Inserts a UUID value into the mapping of this Bundle, replacing
-     * any existing value for the given key.  Either key or value may be null.
-     *
-     * @param key a String, or null
-     * @param value a UUID object, or null
-     */
-    public void putUuid(@Nullable String key, @Nullable UUID value) {
-        unparcel();
-        mMap.put(key, value);
-    }
-
-    /**
      * Inserts an array of Parcelable values into the mapping of this Bundle,
      * replacing any existing value for the given key.  Either key or value may
      * be null.
@@ -871,26 +858,6 @@
      * value is explicitly associated with the key.
      *
      * @param key a String, or null
-     * @return a UUID value, or null
-     */
-    @Nullable
-    public UUID getUuid(@Nullable String key) {
-        unparcel();
-        final Object o = mMap.get(key);
-        try {
-            return (UUID) o;
-        } catch (ClassCastException e) {
-            typeWarning(key, o, "UUID", e);
-            return null;
-        }
-    }
-
-    /**
-     * Returns the value associated with the given key, or null if
-     * no mapping of the desired type exists for the given key or a null
-     * value is explicitly associated with the key.
-     *
-     * @param key a String, or null
      * @return a Bundle value, or null
      */
     @Nullable
diff --git a/core/java/android/os/Parcel.java b/core/java/android/os/Parcel.java
index c1647c7..28bdacf 100644
--- a/core/java/android/os/Parcel.java
+++ b/core/java/android/os/Parcel.java
@@ -50,7 +50,6 @@
 import java.util.List;
 import java.util.Map;
 import java.util.Set;
-import java.util.UUID;
 
 /**
  * Container for a message (data and object references) that can
@@ -242,7 +241,6 @@
     private static final int VAL_SIZE = 26;
     private static final int VAL_SIZEF = 27;
     private static final int VAL_DOUBLEARRAY = 28;
-    private static final int VAL_UUID = 29;
 
     // The initial int32 in a Binder call's reply Parcel header:
     // Keep these in sync with libbinder's binder/Status.h.
@@ -831,15 +829,6 @@
     }
 
     /**
-     * Flatten a UUID into the parcel at the current dataPosition(),
-     * growing dataCapacity() if needed.
-     */
-    public final void writeUuid(UUID val) {
-        writeLong(val.getMostSignificantBits());
-        writeLong(val.getLeastSignificantBits());
-    }
-
-    /**
      * Flatten a List into the parcel at the current dataPosition(), growing
      * dataCapacity() if needed.  The List values are written using
      * {@link #writeValue} and must follow the specification there.
@@ -1687,9 +1676,6 @@
         } else if (v instanceof double[]) {
             writeInt(VAL_DOUBLEARRAY);
             writeDoubleArray((double[]) v);
-        } else if (v instanceof UUID) {
-            writeInt(VAL_UUID);
-            writeUuid((UUID) v);
         } else {
             Class<?> clazz = v.getClass();
             if (clazz.isArray() && clazz.getComponentType() == Object.class) {
@@ -2194,13 +2180,6 @@
     }
 
     /**
-     * Read a UUID from the parcel at the current dataPosition().
-     */
-    public final UUID readUuid() {
-        return new UUID(readLong(), readLong());
-    }
-
-    /**
      * Read and return a byte[] object from the parcel.
      */
     public final byte[] createByteArray() {
@@ -2750,9 +2729,6 @@
         case VAL_DOUBLEARRAY:
             return createDoubleArray();
 
-        case VAL_UUID:
-            return readUuid();
-
         default:
             int off = dataPosition() - 4;
             throw new RuntimeException(
diff --git a/core/java/android/os/UserManager.java b/core/java/android/os/UserManager.java
index f95a34c..52b2f52 100644
--- a/core/java/android/os/UserManager.java
+++ b/core/java/android/os/UserManager.java
@@ -64,7 +64,7 @@
  */
 public class UserManager {
 
-    private static String TAG = "UserManager";
+    private static final String TAG = "UserManager";
     private final IUserManager mService;
     private final Context mContext;
 
@@ -218,6 +218,23 @@
     public static final String DISALLOW_BLUETOOTH = "no_bluetooth";
 
     /**
+     * Specifies if outgoing bluetooth sharing is disallowed on the device. Device owner and profile
+     * owner can set this restriction. When it is set by device owner, all users on this device will
+     * be affected.
+     *
+     * <p>Default is <code>true</code> for managed profiles and false for otherwise. When a device
+     * upgrades to {@link android.os.Build.VERSION_CODES#O}, the system sets it for all existing
+     * managed profiles.
+     *
+     * <p>Key for user restrictions.
+     * <p>Type: Boolean
+     * @see DevicePolicyManager#addUserRestriction(ComponentName, String)
+     * @see DevicePolicyManager#clearUserRestriction(ComponentName, String)
+     * @see #getUserRestrictions()
+     */
+    public static final String DISALLOW_BLUETOOTH_SHARING = "no_bluetooth_sharing";
+
+    /**
      * Specifies if a user is disallowed from transferring files over
      * USB. This can only be set by device owners and profile owners on the primary user.
      * The default value is <code>false</code>.
diff --git a/core/java/android/os/storage/StorageManager.java b/core/java/android/os/storage/StorageManager.java
index baa29b0..bd43d6a 100644
--- a/core/java/android/os/storage/StorageManager.java
+++ b/core/java/android/os/storage/StorageManager.java
@@ -19,14 +19,18 @@
 import static android.net.TrafficStats.GB_IN_BYTES;
 import static android.net.TrafficStats.MB_IN_BYTES;
 
+import android.annotation.BytesLong;
 import android.annotation.IntDef;
 import android.annotation.NonNull;
 import android.annotation.Nullable;
 import android.annotation.RequiresPermission;
 import android.annotation.SdkConstant;
+import android.annotation.SystemApi;
+import android.annotation.WorkerThread;
 import android.app.ActivityThread;
 import android.content.ContentResolver;
 import android.content.Context;
+import android.content.Intent;
 import android.content.pm.ApplicationInfo;
 import android.content.pm.IPackageMoveObserver;
 import android.content.pm.PackageManager;
@@ -135,6 +139,7 @@
      * thus it cannot be used to uniquely identify a particular physical device.
      *
      * @see #getUuidForPath(File)
+     * @see ApplicationInfo#storageUuid
      */
     public static final UUID UUID_DEFAULT = UUID
             .fromString("41217664-9172-527a-b3d5-edabb50a7d69");
@@ -166,6 +171,7 @@
      * @see #ACTION_MANAGE_STORAGE
      * @see #UUID_DEFAULT
      * @see #getUuidForPath(File)
+     * @see Intent#putExtra(String, java.io.Serializable)
      */
     public static final String EXTRA_UUID = "android.os.storage.extra.UUID";
 
@@ -1414,6 +1420,7 @@
     public @NonNull ParcelFileDescriptor openProxyFileDescriptor(
             int mode, ProxyFileDescriptorCallback callback, Handler handler, ThreadFactory factory)
                     throws IOException {
+        Preconditions.checkNotNull(callback);
         MetricsLogger.count(mContext, "storage_open_proxy_file_descriptor", 1);
         // Retry is needed because the mount point mFuseAppLoop is using may be unmounted before
         // invoking StorageManagerService#openProxyFileDescriptor. In this case, we need to re-mount
@@ -1460,19 +1467,7 @@
         }
     }
 
-    /**
-     * Opens seekable ParcelFileDescriptor that routes file operation requests to
-     * ProxyFileDescriptorCallback.
-     *
-     * @param mode The desired access mode, must be one of
-     *     {@link ParcelFileDescriptor#MODE_READ_ONLY},
-     *     {@link ParcelFileDescriptor#MODE_WRITE_ONLY}, or
-     *     {@link ParcelFileDescriptor#MODE_READ_WRITE}
-     * @param callback Callback to process file operation requests issued on returned file
-     *     descriptor.
-     * @return Seekable ParcelFileDescriptor.
-     * @throws IOException
-     */
+    /** {@hide} */
     public @NonNull ParcelFileDescriptor openProxyFileDescriptor(
             int mode, ProxyFileDescriptorCallback callback)
                     throws IOException {
@@ -1496,6 +1491,7 @@
     public @NonNull ParcelFileDescriptor openProxyFileDescriptor(
             int mode, ProxyFileDescriptorCallback callback, Handler handler)
                     throws IOException {
+        Preconditions.checkNotNull(handler);
         return openProxyFileDescriptor(mode, callback, handler, null);
     }
 
@@ -1533,7 +1529,8 @@
      *             doesn't support cache quotas.
      * @see #getCacheSizeBytes(UUID)
      */
-    public long getCacheQuotaBytes(@NonNull UUID storageUuid) throws IOException {
+    @WorkerThread
+    public @BytesLong long getCacheQuotaBytes(@NonNull UUID storageUuid) throws IOException {
         try {
             final ApplicationInfo app = mContext.getApplicationInfo();
             return mStorageManager.getCacheQuotaBytes(convert(storageUuid), app.uid);
@@ -1573,7 +1570,8 @@
      *             doesn't support cache quotas.
      * @see #getCacheQuotaBytes(UUID)
      */
-    public long getCacheSizeBytes(@NonNull UUID storageUuid) throws IOException {
+    @WorkerThread
+    public @BytesLong long getCacheSizeBytes(@NonNull UUID storageUuid) throws IOException {
         try {
             final ApplicationInfo app = mContext.getApplicationInfo();
             return mStorageManager.getCacheSizeBytes(convert(storageUuid), app.uid);
@@ -1631,8 +1629,10 @@
      * @see #getAllocatableBytes(UUID, int)
      * @see #allocateBytes(UUID, long, int)
      * @see #allocateBytes(FileDescriptor, long, int)
+     * @hide
      */
     @RequiresPermission(android.Manifest.permission.ALLOCATE_AGGRESSIVE)
+    @SystemApi
     public static final int FLAG_ALLOCATE_AGGRESSIVE = 1;
 
     /** @hide */
@@ -1656,7 +1656,7 @@
      * the returned value will fail.
      * <p>
      * If the returned value is not large enough for the data you'd like to
-     * store, you can launch {@link #ACTION_MANAGE_STORAGE} with the
+     * persist, you can launch {@link #ACTION_MANAGE_STORAGE} with the
      * {@link #EXTRA_UUID} and {@link #EXTRA_REQUESTED_BYTES} options to help
      * involve the user in freeing up disk space.
      * <p class="note">
@@ -1670,13 +1670,19 @@
      *            vary widely depending on the underlying storage device. The
      *            UUID for a specific path can be obtained using
      *            {@link #getUuidForPath(File)}.
-     * @param flags to apply to the request.
      * @return the maximum number of new bytes that the calling app can allocate
      *         using {@link #allocateBytes(UUID, long, int)} or
      *         {@link #allocateBytes(FileDescriptor, long, int)}.
      * @throws IOException when the storage device isn't present, or when it
      *             doesn't support allocating space.
      */
+    public @BytesLong long getAllocatableBytes(@NonNull UUID storageUuid)
+            throws IOException {
+        return getAllocatableBytes(storageUuid, 0);
+    }
+
+    /** @hide */
+    @SystemApi
     public long getAllocatableBytes(@NonNull UUID storageUuid, @AllocateFlags int flags)
             throws IOException {
         try {
@@ -1713,14 +1719,20 @@
      *            allocate disk space. The UUID for a specific path can be
      *            obtained using {@link #getUuidForPath(File)}.
      * @param bytes the number of bytes to allocate.
-     * @param flags to apply to the request.
      * @throws IOException when the storage device isn't present, or when it
      *             doesn't support allocating space, or if the device had
      *             trouble allocating the requested space.
      * @see #getAllocatableBytes(UUID, int)
      */
-    public void allocateBytes(@NonNull UUID storageUuid, long bytes, @AllocateFlags int flags)
+    public void allocateBytes(@NonNull UUID storageUuid, @BytesLong long bytes)
             throws IOException {
+        allocateBytes(storageUuid, bytes, 0);
+    }
+
+    /** @hide */
+    @SystemApi
+    public void allocateBytes(@NonNull UUID storageUuid, @BytesLong long bytes,
+            @AllocateFlags int flags) throws IOException {
         try {
             mStorageManager.allocateBytes(convert(storageUuid), bytes, flags);
         } catch (ParcelableException e) {
@@ -1732,7 +1744,7 @@
 
     /** @removed */
     @Deprecated
-    public void allocateBytes(@NonNull File path, long bytes, @AllocateFlags int flags)
+    public void allocateBytes(@NonNull File path, @BytesLong long bytes, @AllocateFlags int flags)
             throws IOException {
         allocateBytes(getUuidForPath(path), bytes, flags);
     }
@@ -1756,14 +1768,19 @@
      *            requested size, it will be extended without modifying any
      *            existing contents. If the open file is larger than this
      *            requested size, it will be truncated.
-     * @param flags to apply to the request.
      * @throws IOException when the storage device isn't present, or when it
      *             doesn't support allocating space, or if the device had
      *             trouble allocating the requested space.
      * @see #getAllocatableBytes(UUID, int)
      * @see Environment#isExternalStorageEmulated(File)
      */
-    public void allocateBytes(FileDescriptor fd, long bytes, @AllocateFlags int flags)
+    public void allocateBytes(FileDescriptor fd, @BytesLong long bytes) throws IOException {
+        allocateBytes(fd, bytes, 0);
+    }
+
+    /** @hide */
+    @SystemApi
+    public void allocateBytes(FileDescriptor fd, @BytesLong long bytes, @AllocateFlags int flags)
             throws IOException {
         final File file = ParcelFileDescriptor.getFile(fd);
         for (int i = 0; i < 3; i++) {
diff --git a/core/java/android/provider/FontsContract.java b/core/java/android/provider/FontsContract.java
index 6c038c78..f909114 100644
--- a/core/java/android/provider/FontsContract.java
+++ b/core/java/android/provider/FontsContract.java
@@ -15,7 +15,6 @@
  */
 package android.provider;
 
-import static android.graphics.fonts.FontVariationAxis.InvalidFormatException;
 import static java.lang.annotation.RetentionPolicy.SOURCE;
 
 import android.annotation.IntDef;
@@ -601,49 +600,12 @@
             FontInfo[] fonts = getFontFromProvider(
                     context, request, providerInfo.authority, cancellationSignal);
             return new FontFamilyResult(FontFamilyResult.STATUS_OK, fonts);
-        } catch (InvalidFormatException e) {
+        } catch (IllegalArgumentException e) {
             return new FontFamilyResult(FontFamilyResult.STATUS_UNEXPECTED_DATA_PROVIDED, null);
         }
     }
 
     /**
-     * Build a Typeface from an array of {@link FontInfo}. Results that are marked as not ready
-     * will be skipped.
-     *
-     * @param context A {@link Context} that will be used to fetch the font contents.
-     * @param cancellationSignal A signal to cancel the operation in progress, or null if none. If
-     *                           the operation is canceled, then {@link
-     *                           android.os.OperationCanceledException} will be thrown.
-     * @param fonts An array of {@link FontInfo} to be used to create a Typeface.
-     * @param weight A weight value to be used for selecting a font from a font family.
-     * @param italic {@code true} if this font is of italic style. This will be used for font
-     *               selection from a font family.
-     * @param fallbackFontName A fallback font name used if this method fails to create the
-     *                         Typeface. By passing {@code null}, this method returns {@code null}
-     *                         if typeface creation fails.
-     * @return A Typeface object. May return {@code null} if that is the value passed to {@code
-     *         fallBackFontName}.
-     */
-    public static Typeface buildTypeface(@NonNull Context context,
-            @Nullable CancellationSignal cancellationSignal, @NonNull FontInfo[] fonts,
-            int weight, boolean italic, @Nullable String fallbackFontName) {
-        if (context.isRestricted()) {
-            // TODO: Should we allow if the peer process is system or myself?
-            return null;
-        }
-        final Map<Uri, ByteBuffer> uriBuffer =
-                prepareFontData(context, fonts, cancellationSignal);
-        if (uriBuffer.isEmpty()) {
-            return null;
-        }
-        return new Typeface.Builder(fonts, uriBuffer)
-            .setFallback(fallbackFontName)
-            .setWeight(weight)
-            .setItalic(italic)
-            .build();
-    }
-
-    /**
      * Build a Typeface from an array of {@link FontInfo}
      *
      * Results that are marked as not ready will be skipped.
@@ -792,7 +754,7 @@
     @VisibleForTesting
     public static @NonNull FontInfo[] getFontFromProvider(
             Context context, FontRequest request, String authority,
-            CancellationSignal cancellationSignal) throws InvalidFormatException {
+            CancellationSignal cancellationSignal) {
         ArrayList<FontInfo> result = new ArrayList<>();
         final Uri uri = new Uri.Builder().scheme(ContentResolver.SCHEME_CONTENT)
                 .authority(authority)
diff --git a/core/java/android/provider/Settings.java b/core/java/android/provider/Settings.java
index cbd41c3..95be39b 100755
--- a/core/java/android/provider/Settings.java
+++ b/core/java/android/provider/Settings.java
@@ -6622,6 +6622,13 @@
         public static final String PAYMENT_SERVICE_SEARCH_URI = "payment_service_search_uri";
 
         /**
+         * This is the query URI for finding a auto fill service to install.
+         *
+         * @hide
+         */
+        public static final String AUTOFILL_SERVICE_SEARCH_URI = "autofill_service_search_uri";
+
+        /**
          * If enabled, apps should try to skip any introductory hints on first launch. This might
          * apply to users that are already familiar with the environment or temporary users.
          * <p>
@@ -7065,6 +7072,12 @@
             INSTANT_APP_SETTINGS.add(ACCESSIBILITY_CAPTIONING_FOREGROUND_COLOR);
             INSTANT_APP_SETTINGS.add(ACCESSIBILITY_CAPTIONING_TYPEFACE);
             INSTANT_APP_SETTINGS.add(ACCESSIBILITY_CAPTIONING_FONT_SCALE);
+            INSTANT_APP_SETTINGS.add(ACCESSIBILITY_CAPTIONING_WINDOW_COLOR);
+            INSTANT_APP_SETTINGS.add(ACCESSIBILITY_DISPLAY_DALTONIZER_ENABLED);
+            INSTANT_APP_SETTINGS.add(ACCESSIBILITY_DISPLAY_DALTONIZER);
+            INSTANT_APP_SETTINGS.add(ACCESSIBILITY_AUTOCLICK_DELAY);
+            INSTANT_APP_SETTINGS.add(ACCESSIBILITY_AUTOCLICK_ENABLED);
+            INSTANT_APP_SETTINGS.add(ACCESSIBILITY_LARGE_POINTER_ICON);
 
             INSTANT_APP_SETTINGS.add(DEFAULT_INPUT_METHOD);
             INSTANT_APP_SETTINGS.add(ENABLED_INPUT_METHODS);
@@ -7711,13 +7724,36 @@
                 "location_background_throttle_interval_ms";
 
         /**
+         * Most frequent location update interval in milliseconds that proximity alert is allowed
+         * to request.
+         * @hide
+         */
+        public static final String LOCATION_BACKGROUND_THROTTLE_PROXIMITY_ALERT_INTERVAL_MS =
+                "location_background_throttle_proximity_alert_interval_ms";
+
+        /**
          * Packages that are whitelisted for background throttling (throttling will not be applied).
          * @hide
          */
         public static final String LOCATION_BACKGROUND_THROTTLE_PACKAGE_WHITELIST =
             "location_background_throttle_package_whitelist";
 
-       /**
+        /**
+         * The interval in milliseconds at which wifi scan requests will be throttled when they are
+         * coming from the background.
+         * @hide
+         */
+        public static final String WIFI_SCAN_BACKGROUND_THROTTLE_INTERVAL_MS =
+                "wifi_scan_background_throttle_interval_ms";
+
+        /**
+         * Packages that are whitelisted to be exempt for wifi background throttling.
+         * @hide
+         */
+        public static final String WIFI_SCAN_BACKGROUND_THROTTLE_PACKAGE_WHITELIST =
+                "wifi_scan_background_throttle_package_whitelist";
+
+        /**
         * Whether TV will switch to MHL port when a mobile device is plugged in.
         * (0 = false, 1 = true)
         * @hide
diff --git a/core/java/android/service/autofill/Dataset.java b/core/java/android/service/autofill/Dataset.java
index e04fae7..69f3f67 100644
--- a/core/java/android/service/autofill/Dataset.java
+++ b/core/java/android/service/autofill/Dataset.java
@@ -16,7 +16,7 @@
 
 package android.service.autofill;
 
-import static android.view.autofill.Helper.DEBUG;
+import static android.view.autofill.Helper.sDebug;
 
 import android.annotation.NonNull;
 import android.annotation.Nullable;
@@ -24,7 +24,6 @@
 import android.os.Parcel;
 import android.os.Parcelable;
 import android.view.autofill.AutofillId;
-import android.view.autofill.AutofillManager;
 import android.view.autofill.AutofillValue;
 import android.widget.RemoteViews;
 import com.android.internal.util.Preconditions;
@@ -90,7 +89,7 @@
 
     @Override
     public String toString() {
-        if (!DEBUG) return super.toString();
+        if (!sDebug) return super.toString();
 
         return new StringBuilder("Dataset " + mId + " [")
                 .append("fieldIds=").append(mFieldIds)
diff --git a/core/java/android/service/autofill/FillContext.java b/core/java/android/service/autofill/FillContext.java
index 8a28c45..d6616bf 100644
--- a/core/java/android/service/autofill/FillContext.java
+++ b/core/java/android/service/autofill/FillContext.java
@@ -16,7 +16,7 @@
 
 package android.service.autofill;
 
-import static android.view.autofill.Helper.DEBUG;
+import static android.view.autofill.Helper.sDebug;
 
 import android.annotation.NonNull;
 import android.app.assist.AssistStructure;
@@ -74,11 +74,9 @@
 
     @Override
     public String toString() {
-        if (!DEBUG) {
-            return super.toString();
-        } else {
-            return "FillContext [mRequestId=" + mRequestId + "]";
-        }
+        if (!sDebug)  return super.toString();
+
+        return "FillContext [reqId=" + mRequestId + "]";
     }
 
     @Override
diff --git a/core/java/android/service/autofill/FillResponse.java b/core/java/android/service/autofill/FillResponse.java
index 5c8f3ce..42c0151 100644
--- a/core/java/android/service/autofill/FillResponse.java
+++ b/core/java/android/service/autofill/FillResponse.java
@@ -17,7 +17,7 @@
 package android.service.autofill;
 
 import static android.service.autofill.FillRequest.INVALID_REQUEST_ID;
-import static android.view.autofill.Helper.DEBUG;
+import static android.view.autofill.Helper.sDebug;
 
 import android.annotation.NonNull;
 import android.annotation.Nullable;
@@ -394,7 +394,7 @@
     /////////////////////////////////////
     @Override
     public String toString() {
-        if (!DEBUG) return super.toString();
+        if (!sDebug) return super.toString();
 
         return new StringBuilder(
                 "FillResponse : [mRequestId=" + mRequestId)
diff --git a/core/java/android/service/autofill/SaveInfo.java b/core/java/android/service/autofill/SaveInfo.java
index 94e5e3e..277c622 100644
--- a/core/java/android/service/autofill/SaveInfo.java
+++ b/core/java/android/service/autofill/SaveInfo.java
@@ -16,7 +16,7 @@
 
 package android.service.autofill;
 
-import static android.view.autofill.Helper.DEBUG;
+import static android.view.autofill.Helper.sDebug;
 
 import android.annotation.IntDef;
 import android.annotation.NonNull;
@@ -387,7 +387,7 @@
     /////////////////////////////////////
     @Override
     public String toString() {
-        if (!DEBUG) return super.toString();
+        if (!sDebug) return super.toString();
 
         return new StringBuilder("SaveInfo: [type=")
                 .append(DebugUtils.flagsToString(SaveInfo.class, "SAVE_DATA_TYPE_", mType))
diff --git a/core/java/android/service/notification/NotificationListenerService.java b/core/java/android/service/notification/NotificationListenerService.java
index 00bd304..76c96bd 100644
--- a/core/java/android/service/notification/NotificationListenerService.java
+++ b/core/java/android/service/notification/NotificationListenerService.java
@@ -1094,9 +1094,9 @@
     /**
      * Request that the service be unbound.
      *
-     * <p>This will no longer receive updates until
-     * {@link #requestRebind(ComponentName)} is called.
-     * The service will likely be kiled by the system after this call.
+     * <p>Once this is called, you will no longer receive updates and no method calls are
+     * guaranteed to be successful, until you next receive the {@link #onListenerConnected()} event.
+     * The service will likely be killed by the system after this call.
      *
      * <p>The service should wait for the {@link #onListenerConnected()} event
      * before performing this operation. I know it's tempting, but you must wait.
diff --git a/core/java/android/service/quicksettings/TileService.java b/core/java/android/service/quicksettings/TileService.java
index 56b267f..c35423f 100644
--- a/core/java/android/service/quicksettings/TileService.java
+++ b/core/java/android/service/quicksettings/TileService.java
@@ -80,8 +80,13 @@
 public class TileService extends Service {
 
     /**
-     * An activity that provides a user interface for adjusting TileService preferences.
-     * Optional but recommended for apps that implement a TileService.
+     * An activity that provides a user interface for adjusting TileService
+     * preferences. Optional but recommended for apps that implement a
+     * TileService.
+     * <p>
+     * This intent may also define a {@link Intent#EXTRA_COMPONENT_NAME} value
+     * to indicate the {@link ComponentName} that caused the preferences to be
+     * opened.
      */
     @SdkConstant(SdkConstantType.INTENT_CATEGORY)
     public static final String ACTION_QS_TILE_PREFERENCES
@@ -130,13 +135,6 @@
     public static final String EXTRA_TOKEN = "token";
 
     /**
-     * May be included when {@link #ACTION_QS_TILE_PREFERENCES} is launched from a tile.
-     * This extra may contain the {@link ComponentName} of the tile that triggered
-     * the preferences to be opened.
-     */
-    public static final String EXTRA_COMPONENT = "android.service.quicksettings.extra.COMPONENT";
-
-    /**
      * @hide
      */
     public static final String EXTRA_STATE = "state";
@@ -445,7 +443,7 @@
      */
     public static final void requestListeningState(Context context, ComponentName component) {
         Intent intent = new Intent(ACTION_REQUEST_LISTENING);
-        intent.putExtra(EXTRA_COMPONENT, component);
+        intent.putExtra(Intent.EXTRA_COMPONENT_NAME, component);
         intent.setPackage("com.android.systemui");
         context.sendBroadcast(intent, Manifest.permission.BIND_QUICK_SETTINGS_TILE);
     }
diff --git a/core/java/android/service/wallpaper/WallpaperService.java b/core/java/android/service/wallpaper/WallpaperService.java
index 98780a7..6bbb0ff 100644
--- a/core/java/android/service/wallpaper/WallpaperService.java
+++ b/core/java/android/service/wallpaper/WallpaperService.java
@@ -16,8 +16,6 @@
 
 package android.service.wallpaper;
 
-import android.annotation.Nullable;
-import android.app.WallpaperColors;
 import android.content.res.TypedArray;
 import android.graphics.Canvas;
 import android.util.MergedConfiguration;
@@ -544,24 +542,6 @@
          */
         public void onSurfaceDestroyed(SurfaceHolder holder) {
         }
-
-        /**
-         * Notifies the engine that wallpaper colors changed significantly.
-         * This will trigger a {@link #onComputeWallpaperColors()} call.
-         */
-        public void invalidateColors() {
-        }
-
-        /**
-         * Notifies the system about what colors the wallpaper is using.
-         * You might return null if no color information is available at the moment. In that case
-         * you might want to call {@link #invalidateColors()} in a near future.
-         *
-         * @return List of wallpaper colors and their weights.
-         */
-        public @Nullable WallpaperColors onComputeWallpaperColors() {
-            return null;
-        }
         
         protected void dump(String prefix, FileDescriptor fd, PrintWriter out, String[] args) {
             out.print(prefix); out.print("mInitializing="); out.print(mInitializing);
diff --git a/core/java/android/util/EventLog.java b/core/java/android/util/EventLog.java
index 6d4281b..92f218b 100644
--- a/core/java/android/util/EventLog.java
+++ b/core/java/android/util/EventLog.java
@@ -68,6 +68,7 @@
         private static final int THREAD_OFFSET = 8;
         private static final int SECONDS_OFFSET = 12;
         private static final int NANOSECONDS_OFFSET = 16;
+        private static final int UID_OFFSET = 24;
 
         // Layout for event log v1 format, v2 and v3 use HEADER_SIZE_OFFSET
         private static final int V1_PAYLOAD_START = 20;
@@ -91,6 +92,20 @@
             return mBuffer.getInt(PROCESS_OFFSET);
         }
 
+        /**
+         * @return the UID which wrote the log entry
+         * @hide
+         */
+        @SystemApi
+        public int getUid() {
+            try {
+                return mBuffer.getInt(UID_OFFSET);
+            } catch (IndexOutOfBoundsException e) {
+                // buffer won't contain the UID if the caller doesn't have permission.
+                return -1;
+            }
+        }
+
         /** @return the thread ID which wrote the log entry */
         public int getThreadId() {
             return mBuffer.getInt(THREAD_OFFSET);
diff --git a/core/java/android/view/View.java b/core/java/android/view/View.java
index 695efdd..39f1170 100644
--- a/core/java/android/view/View.java
+++ b/core/java/android/view/View.java
@@ -805,6 +805,14 @@
     public static final int LAST_APP_ACCESSIBILITY_ID = Integer.MAX_VALUE / 2;
 
     /**
+     * Attribute to find the autofilled highlight
+     *
+     * @see #getAutofilledDrawable()
+     */
+    private static final int[] AUTOFILL_HIGHLIGHT_ATTR =
+            new int[]{android.R.attr.autofilledHighlight};
+
+    /**
      * Signals that compatibility booleans have been initialized according to
      * target SDK versions.
      */
@@ -1173,6 +1181,18 @@
      */
     public static final int IMPORTANT_FOR_AUTOFILL_NO_EXCLUDE_DESCENDANTS = 0x8;
 
+    /** @hide */
+    @IntDef(
+            flag = true,
+            value = {AUTOFILL_FLAG_INCLUDE_NOT_IMPORTANT_VIEWS})
+    @Retention(RetentionPolicy.SOURCE)
+    public @interface AutofillFlags {}
+
+    /**
+     * Flag requesting you to add views not-important for autofill to the assist data.
+     */
+    public static final int AUTOFILL_FLAG_INCLUDE_NOT_IMPORTANT_VIEWS = 0x1;
+
     /**
      * This view is enabled. Interpretation varies by subclass.
      * Use with ENABLED_MASK when calling setFlags.
@@ -2745,8 +2765,7 @@
      *                 1                 PFLAG3_IS_AUTOFILLED
      *                1                  PFLAG3_FINGER_DOWN
      *               1                   PFLAG3_FOCUSED_BY_DEFAULT
-     *             __                    unused
-     *           11                      PFLAG3_IMPORTANT_FOR_AUTOFILL
+     *           1111                    PFLAG3_IMPORTANT_FOR_AUTOFILL
      *          1                        PFLAG3_OVERLAPPING_RENDERING_FORCED_VALUE
      *         1                         PFLAG3_HAS_OVERLAPPING_RENDERING_FORCED
      *        1                          PFLAG3_TEMPORARY_DETACH
@@ -2978,14 +2997,16 @@
      * Shift for the bits in {@link #mPrivateFlags3} related to the
      * "importantForAutofill" attribute.
      */
-    static final int PFLAG3_IMPORTANT_FOR_AUTOFILL_SHIFT = 21;
+    static final int PFLAG3_IMPORTANT_FOR_AUTOFILL_SHIFT = 19;
 
     /**
      * Mask for obtaining the bits which specify how to determine
      * whether a view is important for autofill.
      */
     static final int PFLAG3_IMPORTANT_FOR_AUTOFILL_MASK = (IMPORTANT_FOR_AUTOFILL_AUTO
-            | IMPORTANT_FOR_AUTOFILL_YES | IMPORTANT_FOR_AUTOFILL_NO)
+            | IMPORTANT_FOR_AUTOFILL_YES | IMPORTANT_FOR_AUTOFILL_NO
+            | IMPORTANT_FOR_AUTOFILL_YES_EXCLUDE_DESCENDANTS
+            | IMPORTANT_FOR_AUTOFILL_NO_EXCLUDE_DESCENDANTS)
             << PFLAG3_IMPORTANT_FOR_AUTOFILL_SHIFT;
 
     /**
@@ -7292,7 +7313,9 @@
      *
      * @param structure Fill in with structured view data. The default implementation
      * fills in all data that can be inferred from the view itself.
-     * @param flags optional flags (currently {@code 0}).
+     * @param flags optional flags.
+     *
+     * @see #AUTOFILL_FLAG_INCLUDE_NOT_IMPORTANT_VIEWS
      */
     public void onProvideAutofillStructure(ViewStructure structure, int flags) {
         onProvideStructureForAssistOrAutofill(structure, true);
@@ -7456,10 +7479,12 @@
      * <p>See {@link #autofill(AutofillValue)} and
      * {@link #onProvideAutofillVirtualStructure(ViewStructure, int)} for more info.
      * <p>To indicate that a virtual view was autofilled
-     * <code>@android:drawable/autofilled_highlight</code> should be drawn over it until the data
+     * <code>?android:attr/autofilledHighlight</code> should be drawn over it until the data
      * changes.
      *
      * @param values map of values to be autofilled, keyed by virtual child id.
+     *
+     * @attr ref android.R.styleable#Theme_autofilledHighlight
      */
     public void autofill(@NonNull @SuppressWarnings("unused") SparseArray<AutofillValue> values) {
     }
@@ -7546,6 +7571,17 @@
     /**
      * Sets the mode for determining whether this View is important for autofill.
      *
+     * <p>This property controls how this view is presented to the autofill components
+     * which help users to fill credentials, addresses, etc. For example, views
+     * that contain labels and input fields are useful for autofill components to
+     * determine the user context and provide values for the inputs. Note that the
+     * user can always override this by manually triggering autotill which would
+     * expose the view to the autofill provider.
+     *
+     * <p>The platform determines the importance for autofill automatically but you
+     * can use this method to customize the behavior. See the autofill modes below
+     * for more details.
+     *
      * <p>See {@link #setImportantForAutofill(int)} for more info about this mode.
      *
      * @param mode {@link #IMPORTANT_FOR_AUTOFILL_AUTO}, {@link #IMPORTANT_FOR_AUTOFILL_YES},
@@ -7599,24 +7635,40 @@
      *
      * @return whether the view is considered important for autofill.
      *
+     * @see #setImportantForAutofill(int)
      * @see #IMPORTANT_FOR_AUTOFILL_AUTO
      * @see #IMPORTANT_FOR_AUTOFILL_YES
      * @see #IMPORTANT_FOR_AUTOFILL_NO
+     * @see #IMPORTANT_FOR_AUTOFILL_YES_EXCLUDE_DESCENDANTS
+     * @see #IMPORTANT_FOR_AUTOFILL_NO_EXCLUDE_DESCENDANTS
      */
     public final boolean isImportantForAutofill() {
-        final int flag = getImportantForAutofill();
+        // Check parent mode to ensure we're not hidden.
+        ViewParent parent = mParent;
+        while (parent instanceof View) {
+            final int parentImportance = ((View) parent).getImportantForAutofill();
+            if (parentImportance == IMPORTANT_FOR_AUTOFILL_NO_EXCLUDE_DESCENDANTS
+                    || parentImportance == IMPORTANT_FOR_AUTOFILL_YES_EXCLUDE_DESCENDANTS) {
+                return false;
+            }
+            parent = parent.getParent();
+        }
 
-        // First, check if view explicity set it to YES or NO
-        if ((flag & IMPORTANT_FOR_AUTOFILL_YES) != 0) {
+        final int importance = getImportantForAutofill();
+
+        // First, check the explicit states.
+        if (importance == IMPORTANT_FOR_AUTOFILL_YES_EXCLUDE_DESCENDANTS
+                || importance == IMPORTANT_FOR_AUTOFILL_YES) {
             return true;
         }
-        if ((flag & IMPORTANT_FOR_AUTOFILL_NO) != 0) {
+        if (importance == IMPORTANT_FOR_AUTOFILL_NO_EXCLUDE_DESCENDANTS
+                || importance == IMPORTANT_FOR_AUTOFILL_NO) {
             return false;
         }
 
         // Then use some heuristics to handle AUTO.
 
-        // Always include views that have a explicity resource id.
+        // Always include views that have an explicit resource id.
         final int id = mID;
         if (id != NO_ID && !isViewIdGenerated(id)) {
             final Resources res = getResources();
@@ -7642,9 +7694,8 @@
         return mContext.getSystemService(AutofillManager.class);
     }
 
-    /** @hide */
-    public boolean isAutofillable() {
-        return getAutofillType() != AUTOFILL_TYPE_NONE && !isAutofillBlocked();
+    private boolean isAutofillable() {
+        return getAutofillType() != AUTOFILL_TYPE_NONE && isImportantForAutofill();
     }
 
     private void populateVirtualStructure(ViewStructure structure,
@@ -7728,26 +7779,33 @@
      * set the {@link AutofillId} in the structure (for example, by calling
      * {@code structure.setAutofillId(getAutofillId())}).
      *
+     * <p>When providing your implementation you need to decide how to handle
+     * the {@link #AUTOFILL_FLAG_INCLUDE_NOT_IMPORTANT_VIEWS} flag which instructs you
+     * to report all views to the structure regardless if {@link #isImportantForAutofill()}
+     * returns true. We encourage you respect the importance property for a better
+     * user experience in your app. If the flag is not set then you should filter out
+     * not important views to optimize autofill performance in your app.
+     *
      * @param structure Fill in with structured view data.
-     * @param flags optional flags (currently {@code 0}).
+     * @param flags optional flags.
+     *
+     * @see #AUTOFILL_FLAG_INCLUDE_NOT_IMPORTANT_VIEWS
      */
-    public void dispatchProvideAutofillStructure(@NonNull ViewStructure structure, int flags) {
+    public void dispatchProvideAutofillStructure(@NonNull ViewStructure structure,
+            @AutofillFlags int flags) {
         dispatchProvideStructureForAssistOrAutofill(structure, true);
     }
 
     private void dispatchProvideStructureForAssistOrAutofill(ViewStructure structure,
             boolean forAutofill) {
-        boolean blocked = forAutofill ? isAutofillBlocked() : isAssistBlocked();
-        if (!blocked) {
-            if (forAutofill) {
-                structure.setAutofillId(getAutofillId());
-                // NOTE: flags are not currently supported, hence 0
-                onProvideAutofillStructure(structure, 0);
-                onProvideAutofillVirtualStructure(structure, 0);
-            } else {
-                onProvideStructure(structure);
-                onProvideVirtualStructure(structure);
-            }
+        if (forAutofill) {
+            structure.setAutofillId(getAutofillId());
+            // NOTE: flags are not currently supported, hence 0
+            onProvideAutofillStructure(structure, 0);
+            onProvideAutofillVirtualStructure(structure, 0);
+        } else if (!isAssistBlocked()) {
+            onProvideStructure(structure);
+            onProvideVirtualStructure(structure);
         } else {
             structure.setClassName(getAccessibilityClassName().toString());
             structure.setAssistBlocked(true);
@@ -9585,22 +9643,6 @@
 
     /**
      * @hide
-     * Indicates whether this view will participate in data collection through
-     * {@link ViewStructure} for autofill purposes.
-     *
-     * <p>If {@code true}, it will not provide any data for itself or its children.
-     * <p>If {@code false}, the normal data collection will be allowed.
-     *
-     * @return Returns {@code false} if assist data collection for autofill is not blocked,
-     * else {@code true}.
-     */
-    public boolean isAutofillBlocked() {
-        // TODO(b/36171235): properly implement it using isImportantForAutofill()
-        return false;
-    }
-
-    /**
-     * @hide
      * Controls whether assist data collection from this view and its children is enabled
      * (that is, whether {@link #onProvideStructure} and
      * {@link #onProvideVirtualStructure} will be called).  The default value is false,
@@ -16577,6 +16619,7 @@
      * @param config Configuration of the resources on new display after move.
      *
      * @see #onConfigurationChanged(Configuration)
+     * @hide
      */
     public void onMovedToDisplay(int displayId, Configuration config) {
     }
@@ -20373,15 +20416,13 @@
      *
      * @throws IllegalStateException if the drawable could not be found.
      */
-    @NonNull private Drawable getAutofilledDrawable() {
+    @Nullable private Drawable getAutofilledDrawable() {
         // Lazily load the isAutofilled drawable.
         if (mAttachInfo.mAutofilledDrawable == null) {
-            mAttachInfo.mAutofilledDrawable = mContext.getDrawable(R.drawable.autofilled_highlight);
-
-            if (mAttachInfo.mAutofilledDrawable == null) {
-                throw new IllegalStateException(
-                        "Could not find android:drawable/autofilled_highlight");
-            }
+            TypedArray a = mContext.getTheme().obtainStyledAttributes(AUTOFILL_HIGHLIGHT_ATTR);
+            int attributeResourceId = a.getResourceId(0, 0);
+            mAttachInfo.mAutofilledDrawable = mContext.getDrawable(attributeResourceId);
+            a.recycle();
         }
 
         return mAttachInfo.mAutofilledDrawable;
@@ -20396,8 +20437,10 @@
         if (isAutofilled()) {
             Drawable autofilledHighlight = getAutofilledDrawable();
 
-            autofilledHighlight.setBounds(0, 0, getWidth(), getHeight());
-            autofilledHighlight.draw(canvas);
+            if (autofilledHighlight != null) {
+                autofilledHighlight.setBounds(0, 0, getWidth(), getHeight());
+                autofilledHighlight.draw(canvas);
+            }
         }
     }
 
@@ -21084,7 +21127,7 @@
      */
     @Nullable
     public final <T extends View> T findViewById(@IdRes int id) {
-        if (id < 0) {
+        if (id == NO_ID) {
             return null;
         }
         return findViewTraversal(id);
diff --git a/core/java/android/view/ViewGroup.java b/core/java/android/view/ViewGroup.java
index b783482..18c1b8c 100644
--- a/core/java/android/view/ViewGroup.java
+++ b/core/java/android/view/ViewGroup.java
@@ -57,7 +57,6 @@
 import android.view.animation.AnimationUtils;
 import android.view.animation.LayoutAnimationController;
 import android.view.animation.Transformation;
-
 import com.android.internal.R;
 
 import java.util.ArrayList;
@@ -3442,12 +3441,13 @@
      * default {@link View} implementation.
      */
     @Override
-    public void dispatchProvideAutofillStructure(ViewStructure structure, int flags) {
+    public void dispatchProvideAutofillStructure(ViewStructure structure,
+            @AutofillFlags int flags) {
         super.dispatchProvideAutofillStructure(structure, flags);
-        if (isAutofillBlocked() || structure.getChildCount() != 0) {
+        if (structure.getChildCount() != 0) {
             return;
         }
-        final ChildListForAutoFill children = getChildrenForAutofill();
+        final ChildListForAutoFill children = getChildrenForAutofill(flags);
         final int childrenCount = children.size();
         structure.setChildCount(childrenCount);
         for (int i = 0; i < childrenCount; i++) {
@@ -3463,14 +3463,14 @@
      * level descendants that are important for autofill. The returned
      * child list object is pooled and the caller must recycle it once done.
      * @hide */
-    private @NonNull ChildListForAutoFill getChildrenForAutofill() {
+    private @NonNull ChildListForAutoFill getChildrenForAutofill(@AutofillFlags int flags) {
         final ChildListForAutoFill children = ChildListForAutoFill.obtain();
-        populateChildrenForAutofill(children);
+        populateChildrenForAutofill(children, flags);
         return children;
     }
 
     /** @hide */
-    private void populateChildrenForAutofill(ArrayList<View> list) {
+    private void populateChildrenForAutofill(ArrayList<View> list, @AutofillFlags int flags) {
         final int childrenCount = mChildrenCount;
         if (childrenCount <= 0) {
             return;
@@ -3482,10 +3482,11 @@
             final int childIndex = getAndVerifyPreorderedIndex(childrenCount, i, customOrder);
             final View child = (preorderedList == null)
                     ? mChildren[childIndex] : preorderedList.get(childIndex);
-            if (child.isImportantForAutofill()) {
+            if ((flags & AUTOFILL_FLAG_INCLUDE_NOT_IMPORTANT_VIEWS) != 0
+                    || child.isImportantForAutofill()) {
                 list.add(child);
             } else if (child instanceof ViewGroup) {
-                ((ViewGroup) child).populateChildrenForAutofill(list);
+                ((ViewGroup) child).populateChildrenForAutofill(list, flags);
             }
         }
     }
@@ -5413,6 +5414,9 @@
         if (mDefaultFocus != null) {
             clearDefaultFocus(mDefaultFocus);
         }
+        if (mFocusedInCluster != null) {
+            clearFocusedInCluster(mFocusedInCluster);
+        }
         if (clearChildFocus) {
             clearChildFocus(focused);
             if (!rootViewRequestFocus()) {
diff --git a/core/java/android/view/ViewStructure.java b/core/java/android/view/ViewStructure.java
index fb910b8..f71589c 100644
--- a/core/java/android/view/ViewStructure.java
+++ b/core/java/android/view/ViewStructure.java
@@ -26,7 +26,7 @@
 import android.view.autofill.AutofillId;
 import android.view.autofill.AutofillValue;
 
-import java.util.ArrayList;
+import java.util.List;
 
 /**
  * Container for storing additional per-view data generated by {@link View#onProvideStructure
@@ -429,7 +429,7 @@
          * @return list of key/value pairs; could contain pairs with the same keys.
          */
         @Nullable
-        public abstract ArrayList<Pair<String, String>> getAttributes();
+        public abstract List<Pair<String, String>> getAttributes();
 
         /**
          * Builder for {@link HtmlInfo} objects.
diff --git a/core/java/android/view/accessibility/AccessibilityNodeInfo.java b/core/java/android/view/accessibility/AccessibilityNodeInfo.java
index 94a4547..5148d92 100644
--- a/core/java/android/view/accessibility/AccessibilityNodeInfo.java
+++ b/core/java/android/view/accessibility/AccessibilityNodeInfo.java
@@ -487,7 +487,7 @@
      * @see AccessibilityAction#ACTION_MOVE_WINDOW
      */
     public static final String ACTION_ARGUMENT_MOVE_WINDOW_X =
-            "android.view.accessibility.action.ARGUMENT_MOVE_WINDOW_X";
+            "ACTION_ARGUMENT_MOVE_WINDOW_X";
 
     /**
      * Argument for specifying the y coordinate to which to move a window.
@@ -501,7 +501,7 @@
      * @see AccessibilityAction#ACTION_MOVE_WINDOW
      */
     public static final String ACTION_ARGUMENT_MOVE_WINDOW_Y =
-            "android.view.accessibility.action.ARGUMENT_MOVE_WINDOW_Y";
+            "ACTION_ARGUMENT_MOVE_WINDOW_Y";
 
     /**
      * Argument to pass the {@link AccessibilityClickableSpan}.
diff --git a/core/java/android/view/accessibility/AccessibilityWindowInfo.java b/core/java/android/view/accessibility/AccessibilityWindowInfo.java
index 2a7537b..f11767d 100644
--- a/core/java/android/view/accessibility/AccessibilityWindowInfo.java
+++ b/core/java/android/view/accessibility/AccessibilityWindowInfo.java
@@ -231,8 +231,18 @@
      * Check if the window is in picture-in-picture mode.
      *
      * @return {@code true} if the window is in picture-in-picture mode, {@code false} otherwise.
+     * @removed
      */
     public boolean inPictureInPicture() {
+        return isInPictureInPictureMode();
+    }
+
+    /**
+     * Check if the window is in picture-in-picture mode.
+     *
+     * @return {@code true} if the window is in picture-in-picture mode, {@code false} otherwise.
+     */
+    public boolean isInPictureInPictureMode() {
         return mInPictureInPicture;
     }
 
diff --git a/core/java/android/view/autofill/AutofillId.java b/core/java/android/view/autofill/AutofillId.java
index 268f7f3..1cee529 100644
--- a/core/java/android/view/autofill/AutofillId.java
+++ b/core/java/android/view/autofill/AutofillId.java
@@ -15,8 +15,6 @@
  */
 package android.view.autofill;
 
-import static android.view.autofill.Helper.DEBUG;
-
 import android.os.Parcel;
 import android.os.Parcelable;
 import android.view.View;
@@ -92,11 +90,9 @@
 
     @Override
     public String toString() {
-        if (!DEBUG) return super.toString();
-
         final StringBuilder builder = new StringBuilder().append(mViewId);
         if (mVirtual) {
-            builder.append(":").append(mVirtualId);
+            builder.append(':').append(mVirtualId);
         }
         return builder.toString();
     }
diff --git a/core/java/android/view/autofill/AutofillManager.java b/core/java/android/view/autofill/AutofillManager.java
index 9ee0cb1..94ca562 100644
--- a/core/java/android/view/autofill/AutofillManager.java
+++ b/core/java/android/view/autofill/AutofillManager.java
@@ -16,8 +16,8 @@
 
 package android.view.autofill;
 
-import static android.view.autofill.Helper.DEBUG;
-import static android.view.autofill.Helper.VERBOSE;
+import static android.view.autofill.Helper.sDebug;
+import static android.view.autofill.Helper.sVerbose;
 
 import android.annotation.IntDef;
 import android.annotation.NonNull;
@@ -94,7 +94,8 @@
      * <p>
      * Type: {@link android.os.Bundle}
      */
-    public static final String EXTRA_DATA_EXTRAS = "android.view.autofill.extra.DATA_EXTRAS";
+    public static final String EXTRA_CLIENT_STATE =
+            "android.view.autofill.extra.EXTRA_CLIENT_STATE";
 
     static final String SESSION_ID_TAG = "android:sessionId";
     static final String LAST_AUTOFILLED_DATA_TAG = "android:lastAutoFilledData";
@@ -107,11 +108,15 @@
     @Deprecated
     public static final int FLAG_MANUAL_REQUEST = 0x1;
 
-    // TODO(b/37563972): start from 0x1 once FLAG_MANUAL_REQUEST is gone
-    /** @hide */ public static final int FLAG_START_SESSION = 0x80000000;
-    /** @hide */ public static final int FLAG_VIEW_ENTERED =  0x40000000;
-    /** @hide */ public static final int FLAG_VIEW_EXITED =   0x20000000;
-    /** @hide */ public static final int FLAG_VALUE_CHANGED = 0x10000000;
+    /** @hide */ public static final int ACTION_START_SESSION = 1;
+    /** @hide */ public static final int ACTION_VIEW_ENTERED =  2;
+    /** @hide */ public static final int ACTION_VIEW_EXITED = 3;
+    /** @hide */ public static final int ACTION_VALUE_CHANGED = 4;
+
+
+    /** @hide */ public static final int FLAG_ADD_CLIENT_ENABLED = 0x1;
+    /** @hide */ public static final int FLAG_ADD_CLIENT_DEBUG = 0x2;
+    /** @hide */ public static final int FLAG_ADD_CLIENT_VERBOSE = 0x4;
 
     private final MetricsLogger mMetricsLogger = new MetricsLogger();
 
@@ -239,7 +244,7 @@
                             Log.w(TAG, "Session " + mSessionId + " could not be restored");
                             mSessionId = NO_SESSION;
                         } else {
-                            if (DEBUG) {
+                            if (sDebug) {
                                 Log.d(TAG, "session " + mSessionId + " was restored");
                             }
 
@@ -356,21 +361,7 @@
      * @param view view requesting the new autofill context.
      */
     public void requestAutofill(@NonNull View view) {
-        if (!hasAutofillFeature()) {
-            return;
-        }
-        synchronized (mLock) {
-            ensureServiceClientAddedIfNeededLocked();
-
-            if (!mEnabled) {
-                return;
-            }
-
-            final AutofillId id = getAutofillId(view);
-            final AutofillValue value = view.getAutofillValue();
-
-            startSessionLocked(id, view.getWindowToken(), null, value, FLAG_MANUAL_REQUEST);
-        }
+        notifyViewEntered(view, FLAG_MANUAL_REQUEST);
     }
 
     /**
@@ -385,19 +376,7 @@
      * @param bounds child boundaries, relative to the top window.
      */
     public void requestAutofill(@NonNull View view, int childId, @NonNull Rect bounds) {
-        if (!hasAutofillFeature()) {
-            return;
-        }
-        synchronized (mLock) {
-            ensureServiceClientAddedIfNeededLocked();
-
-            if (!mEnabled) {
-                return;
-            }
-
-            final AutofillId id = getAutofillId(view, childId);
-            startSessionLocked(id, view.getWindowToken(), bounds, null, FLAG_MANUAL_REQUEST);
-        }
+        notifyViewEntered(view, childId, bounds, FLAG_MANUAL_REQUEST);
     }
 
     /**
@@ -406,6 +385,10 @@
      * @param view {@link View} that was entered.
      */
     public void notifyViewEntered(@NonNull View view) {
+        notifyViewEntered(view, 0);
+    }
+
+    private void notifyViewEntered(@NonNull View view, int flags) {
         if (!hasAutofillFeature()) {
             return;
         }
@@ -423,10 +406,10 @@
 
                 if (mSessionId == NO_SESSION) {
                     // Starts new session.
-                    startSessionLocked(id, view.getWindowToken(), null, value, 0);
+                    startSessionLocked(id, view.getWindowToken(), null, value, flags);
                 } else {
                     // Update focus on existing session.
-                    updateSessionLocked(id, null, value, FLAG_VIEW_ENTERED);
+                    updateSessionLocked(id, null, value, ACTION_VIEW_ENTERED, flags);
                 }
             }
         }
@@ -452,7 +435,7 @@
                 final AutofillId id = getAutofillId(view);
 
                 // Update focus on existing session.
-                updateSessionLocked(id, null, null, FLAG_VIEW_EXITED);
+                updateSessionLocked(id, null, null, ACTION_VIEW_EXITED, 0);
             }
         }
     }
@@ -481,6 +464,10 @@
      * @param bounds child boundaries, relative to the top window.
      */
     public void notifyViewEntered(@NonNull View view, int childId, @NonNull Rect bounds) {
+        notifyViewEntered(view, childId, bounds, 0);
+    }
+
+    private void notifyViewEntered(View view, int childId, Rect bounds, int flags) {
         if (!hasAutofillFeature()) {
             return;
         }
@@ -497,10 +484,10 @@
 
                 if (mSessionId == NO_SESSION) {
                     // Starts new session.
-                    startSessionLocked(id, view.getWindowToken(), bounds, null, 0);
+                    startSessionLocked(id, view.getWindowToken(), bounds, null, flags);
                 } else {
                     // Update focus on existing session.
-                    updateSessionLocked(id, bounds, null, FLAG_VIEW_ENTERED);
+                    updateSessionLocked(id, bounds, null, ACTION_VIEW_ENTERED, flags);
                 }
             }
         }
@@ -528,7 +515,7 @@
                 final AutofillId id = getAutofillId(view, childId);
 
                 // Update focus on existing session.
-                updateSessionLocked(id, null, null, FLAG_VIEW_EXITED);
+                updateSessionLocked(id, null, null, ACTION_VIEW_EXITED, 0);
             }
         }
     }
@@ -580,7 +567,7 @@
                 value = view.getAutofillValue();
             }
 
-            updateSessionLocked(id, null, value, FLAG_VALUE_CHANGED);
+            updateSessionLocked(id, null, value, ACTION_VALUE_CHANGED, 0);
         }
     }
 
@@ -601,7 +588,7 @@
             }
 
             final AutofillId id = getAutofillId(view, childId);
-            updateSessionLocked(id, null, value, FLAG_VALUE_CHANGED);
+            updateSessionLocked(id, null, value, ACTION_VALUE_CHANGED, 0);
         }
     }
 
@@ -708,7 +695,7 @@
         // set the EXTRA_AUTHENTICATION_RESULT extra, but it could cause weird results if the
         // service set the extra and returned RESULT_CANCELED...
 
-        if (DEBUG) Log.d(TAG, "onAuthenticationResult(): d=" + data);
+        if (sDebug) Log.d(TAG, "onAuthenticationResult(): d=" + data);
 
         synchronized (mLock) {
             if (mSessionId == NO_SESSION || data == null) {
@@ -735,8 +722,8 @@
 
     private void startSessionLocked(@NonNull AutofillId id, @NonNull IBinder windowToken,
             @NonNull Rect bounds, @NonNull AutofillValue value, int flags) {
-        if (DEBUG) {
-            Log.d(TAG, "startSessionLocked(): id=" + id + ", bounds=" + bounds + ", value=" + value
+        if (sVerbose) {
+            Log.v(TAG, "startSessionLocked(): id=" + id + ", bounds=" + bounds + ", value=" + value
                     + ", flags=" + flags);
         }
 
@@ -744,7 +731,7 @@
             mSessionId = mService.startSession(mContext.getActivityToken(), windowToken,
                     mServiceClient.asBinder(), id, bounds, value, mContext.getUserId(),
                     mCallback != null, flags, mContext.getOpPackageName());
-            AutofillClient client = getClientLocked();
+            final AutofillClient client = getClientLocked();
             if (client != null) {
                 client.autofillCallbackResetableStateAvailable();
             }
@@ -754,9 +741,7 @@
     }
 
     private void finishSessionLocked() {
-        if (DEBUG) {
-            Log.d(TAG, "finishSessionLocked()");
-        }
+        if (sVerbose) Log.v(TAG, "finishSessionLocked()");
 
         try {
             mService.finishSession(mSessionId, mContext.getUserId());
@@ -769,9 +754,7 @@
     }
 
     private void cancelSessionLocked() {
-        if (DEBUG) {
-            Log.d(TAG, "cancelSessionLocked()");
-        }
+        if (sVerbose) Log.v(TAG, "cancelSessionLocked()");
 
         try {
             mService.cancelSession(mSessionId, mContext.getUserId());
@@ -787,16 +770,16 @@
         mTrackedViews = null;
     }
 
-    private void updateSessionLocked(AutofillId id, Rect bounds, AutofillValue value, int flags) {
-        if (DEBUG) {
-            if (VERBOSE || (flags & FLAG_VIEW_EXITED) != 0) {
-                Log.d(TAG, "updateSessionLocked(): id=" + id + ", bounds=" + bounds
-                        + ", value=" + value + ", flags=" + flags);
-            }
+    private void updateSessionLocked(AutofillId id, Rect bounds, AutofillValue value, int action,
+            int flags) {
+        if (sVerbose && action != ACTION_VIEW_EXITED) {
+            Log.v(TAG, "updateSessionLocked(): id=" + id + ", bounds=" + bounds
+                    + ", value=" + value + ", action=" + action + ", flags=" + flags);
         }
 
         try {
-            mService.updateSession(mSessionId, id, bounds, value, flags, mContext.getUserId());
+            mService.updateSession(mSessionId, id, bounds, value, action, flags,
+                    mContext.getUserId());
         } catch (RemoteException e) {
             throw e.rethrowFromSystemServer();
         }
@@ -810,7 +793,10 @@
         if (mServiceClient == null) {
             mServiceClient = new AutofillManagerClient(this);
             try {
-                mEnabled = mService.addClient(mServiceClient, mContext.getUserId());
+                final int flags = mService.addClient(mServiceClient, mContext.getUserId());
+                mEnabled = (flags & FLAG_ADD_CLIENT_ENABLED) != 0;
+                sDebug = (flags & FLAG_ADD_CLIENT_DEBUG) != 0;
+                sVerbose = (flags & FLAG_ADD_CLIENT_VERBOSE) != 0;
             } catch (RemoteException e) {
                 throw e.rethrowFromSystemServer();
             }
@@ -1192,8 +1178,8 @@
                 }
             }
 
-            if (DEBUG) {
-                Log.d(TAG, "TrackedViews(trackedIds=" + trackedIds + "): "
+            if (sVerbose) {
+                Log.v(TAG, "TrackedViews(trackedIds=" + trackedIds + "): "
                         + " mVisibleTrackedIds=" + mVisibleTrackedIds
                         + " mInvisibleTrackedIds=" + mInvisibleTrackedIds);
             }
@@ -1213,7 +1199,7 @@
             AutofillId id = getAutofillId(view);
             AutofillClient client = getClientLocked();
 
-            if (DEBUG) {
+            if (sDebug) {
                 Log.d(TAG, "notifyViewVisibilityChange(): id=" + id + " isVisible="
                         + isVisible);
             }
@@ -1254,8 +1240,8 @@
                         if (client.getViewVisibility(id.getViewId())) {
                             updatedVisibleTrackedIds = addToSet(updatedVisibleTrackedIds, id);
 
-                            if (DEBUG) {
-                                Log.i(TAG, "onVisibleForAutofill() " + id + " became visible");
+                            if (sDebug) {
+                                Log.d(TAG, "onVisibleForAutofill() " + id + " became visible");
                             }
                         } else {
                             updatedInvisibleTrackedIds = addToSet(updatedInvisibleTrackedIds, id);
@@ -1270,8 +1256,8 @@
                         } else {
                             updatedInvisibleTrackedIds = addToSet(updatedInvisibleTrackedIds, id);
 
-                            if (DEBUG) {
-                                Log.i(TAG, "onVisibleForAutofill() " + id + " became invisible");
+                            if (sDebug) {
+                                Log.d(TAG, "onVisibleForAutofill() " + id + " became invisible");
                             }
                         }
                     }
diff --git a/core/java/android/view/autofill/AutofillValue.java b/core/java/android/view/autofill/AutofillValue.java
index b1a9d90..b57dab5 100644
--- a/core/java/android/view/autofill/AutofillValue.java
+++ b/core/java/android/view/autofill/AutofillValue.java
@@ -20,8 +20,7 @@
 import static android.view.View.AUTOFILL_TYPE_LIST;
 import static android.view.View.AUTOFILL_TYPE_TEXT;
 import static android.view.View.AUTOFILL_TYPE_TOGGLE;
-import static android.view.autofill.Helper.DEBUG;
-import static android.view.autofill.Helper.VERBOSE;
+import static android.view.autofill.Helper.sDebug;
 
 import android.annotation.NonNull;
 import android.annotation.Nullable;
@@ -171,12 +170,17 @@
 
     @Override
     public String toString() {
-        if (!DEBUG) return super.toString();
+        if (!sDebug) return super.toString();
 
-        final String sanitizedValue = isText() && !VERBOSE
-                ? ((CharSequence) mValue).length() + "_chars" : mValue.toString();
-
-        return "[type=" + mType + ", value=" + sanitizedValue + "]";
+        final StringBuilder string = new StringBuilder()
+                .append("[type=").append(mType)
+                .append(", value=");
+        if (isText()) {
+            string.append(((CharSequence) mValue).length()).append("_chars");
+        } else {
+            string.append(mValue);
+        }
+        return string.append(']').toString();
     }
 
     /////////////////////////////////////
diff --git a/core/java/android/view/autofill/Helper.java b/core/java/android/view/autofill/Helper.java
index 2b25ae7..829e7f3 100644
--- a/core/java/android/view/autofill/Helper.java
+++ b/core/java/android/view/autofill/Helper.java
@@ -25,15 +25,16 @@
 /** @hide */
 public final class Helper {
 
-    // TODO(b/36141126): set to false and remove guard from places that should always be on
-    public static final boolean DEBUG = true;
-    public static final boolean VERBOSE = false;
+    // Debug-level flags are defined when service is bound.
+    public static boolean sDebug = false;
+    public static boolean sVerbose = false;
+
     public static final String REDACTED = "[REDACTED]";
 
     static StringBuilder append(StringBuilder builder, Bundle bundle) {
-        if (bundle == null) {
+        if (bundle == null || !sDebug) {
             builder.append("N/A");
-        } else if (!VERBOSE) {
+        } else if (!sVerbose) {
             builder.append(REDACTED);
         } else {
             final Set<String> keySet = bundle.keySet();
diff --git a/core/java/android/view/autofill/IAutoFillManager.aidl b/core/java/android/view/autofill/IAutoFillManager.aidl
index 9417bd0..f28d8ba 100644
--- a/core/java/android/view/autofill/IAutoFillManager.aidl
+++ b/core/java/android/view/autofill/IAutoFillManager.aidl
@@ -30,7 +30,8 @@
  * {@hide}
  */
 interface IAutoFillManager {
-    boolean addClient(in IAutoFillManagerClient client, int userId);
+    // Returns flags: FLAG_ADD_CLIENT_ENABLED | FLAG_ADD_CLIENT_DEBUG | FLAG_ADD_CLIENT_VERBOSE
+    int addClient(in IAutoFillManagerClient client, int userId);
     int startSession(IBinder activityToken, IBinder windowToken, in IBinder appCallback,
             in AutofillId autoFillId, in Rect bounds, in AutofillValue value, int userId,
             boolean hasCallback, int flags, String packageName);
@@ -38,7 +39,7 @@
     boolean restoreSession(int sessionId, in IBinder activityToken, in IBinder appCallback);
     void setWindow(int sessionId, in IBinder windowToken);
     void updateSession(int sessionId, in AutofillId id, in Rect bounds,
-            in AutofillValue value, int flags, int userId);
+            in AutofillValue value, int action, int flags, int userId);
     void finishSession(int sessionId, int userId);
     void cancelSession(int sessionId, int userId);
     void setAuthenticationResult(in Bundle data, int sessionId, int userId);
diff --git a/core/java/android/view/textclassifier/SmartSelection.java b/core/java/android/view/textclassifier/SmartSelection.java
index f0f39b6..f0e83d1 100644
--- a/core/java/android/view/textclassifier/SmartSelection.java
+++ b/core/java/android/view/textclassifier/SmartSelection.java
@@ -75,6 +75,20 @@
         nativeClose(mCtx);
     }
 
+    /**
+     * Returns the language of the model.
+     */
+    public static String getLanguage(int fd) {
+        return nativeGetLanguage(fd);
+    }
+
+    /**
+     * Returns the version of the model.
+     */
+    public static int getVersion(int fd) {
+        return nativeGetVersion(fd);
+    }
+
     private static native long nativeNew(int fd);
 
     private static native int[] nativeSuggest(
@@ -85,6 +99,10 @@
 
     private static native void nativeClose(long context);
 
+    private static native String nativeGetLanguage(int fd);
+
+    private static native int nativeGetVersion(int fd);
+
     /** Classification result for classifyText method. */
     static final class ClassificationResult {
         final String mCollection;
diff --git a/core/java/android/view/textclassifier/TextClassifierImpl.java b/core/java/android/view/textclassifier/TextClassifierImpl.java
index 246fab3..9c4fc3c 100644
--- a/core/java/android/view/textclassifier/TextClassifierImpl.java
+++ b/core/java/android/view/textclassifier/TextClassifierImpl.java
@@ -44,6 +44,7 @@
 
 import java.io.File;
 import java.io.FileNotFoundException;
+import java.io.IOException;
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.Comparator;
@@ -71,6 +72,8 @@
     private static final String LOG_TAG = "TextClassifierImpl";
     private static final String MODEL_DIR = "/etc/textclassifier/";
     private static final String MODEL_FILE_REGEX = "textclassifier\\.smartselection\\.(.*)\\.model";
+    private static final String UPDATED_MODEL_FILE_PATH =
+            "/data/misc/textclassifier/textclassifier.smartselection.model";
 
     private final Context mContext;
 
@@ -175,15 +178,12 @@
         synchronized (mSmartSelectionLock) {
             localeList = localeList == null ? LocaleList.getEmptyLocaleList() : localeList;
             final Locale locale = findBestSupportedLocaleLocked(localeList);
+            if (locale == null) {
+                throw new FileNotFoundException("No file for null locale");
+            }
             if (mSmartSelection == null || !Objects.equals(mLocale, locale)) {
                 destroySmartSelectionIfExistsLocked();
-                mSmartSelection = new SmartSelection(
-                        ParcelFileDescriptor.open(
-                                // findBestSupportedLocaleLocked should have initialized
-                                // mModelFilePaths
-                                new File(mModelFilePaths.get(locale)),
-                                ParcelFileDescriptor.MODE_READ_ONLY)
-                                .getFd());
+                mSmartSelection = new SmartSelection(getFdLocked(locale));
                 mLocale = locale;
             }
             return mSmartSelection;
@@ -191,6 +191,68 @@
     }
 
     @GuardedBy("mSmartSelectionLock") // Do not call outside this lock.
+    private int getFdLocked(Locale locale) throws FileNotFoundException {
+        ParcelFileDescriptor updateFd;
+        try {
+            updateFd = ParcelFileDescriptor.open(
+                    new File(UPDATED_MODEL_FILE_PATH), ParcelFileDescriptor.MODE_READ_ONLY);
+        } catch (FileNotFoundException e) {
+            updateFd = null;
+        }
+        ParcelFileDescriptor factoryFd;
+        try {
+            final String factoryModelFilePath = getFactoryModelFilePathsLocked().get(locale);
+            if (factoryModelFilePath != null) {
+                factoryFd = ParcelFileDescriptor.open(
+                        new File(factoryModelFilePath), ParcelFileDescriptor.MODE_READ_ONLY);
+            } else {
+                factoryFd = null;
+            }
+        } catch (FileNotFoundException e) {
+            factoryFd = null;
+        }
+
+        if (updateFd == null) {
+            if (factoryFd != null) {
+                return factoryFd.getFd();
+            } else {
+                throw new FileNotFoundException(
+                        String.format("No model file found for %s", locale));
+            }
+        }
+
+        final int updateFdInt = updateFd.getFd();
+        final boolean localeMatches = Objects.equals(
+                locale.getLanguage().trim().toLowerCase(),
+                SmartSelection.getLanguage(updateFdInt).trim().toLowerCase());
+        if (factoryFd == null) {
+            if (localeMatches) {
+                return updateFdInt;
+            } else {
+                closeAndLogError(updateFd);
+                throw new FileNotFoundException(
+                        String.format("No model file found for %s", locale));
+            }
+        }
+
+        if (!localeMatches) {
+            closeAndLogError(updateFd);
+            return factoryFd.getFd();
+        }
+
+        final int updateVersion = SmartSelection.getVersion(updateFdInt);
+        final int factoryFdInt = factoryFd.getFd();
+        final int factoryVersion = SmartSelection.getVersion(factoryFdInt);
+        if (updateVersion > factoryVersion) {
+            closeAndLogError(factoryFd);
+            return updateFdInt;
+        } else {
+            closeAndLogError(updateFd);
+            return factoryFdInt;
+        }
+    }
+
+    @GuardedBy("mSmartSelectionLock") // Do not call outside this lock.
     private void destroySmartSelectionIfExistsLocked() {
         if (mSmartSelection != null) {
             mSmartSelection.close();
@@ -206,11 +268,18 @@
                 ? LocaleList.getDefault().toLanguageTags()
                 : localeList.toLanguageTags() + "," + LocaleList.getDefault().toLanguageTags();
         final List<Locale.LanguageRange> languageRangeList = Locale.LanguageRange.parse(languages);
-        return Locale.lookup(languageRangeList, loadModelFilePathsLocked().keySet());
+
+        final List<Locale> supportedLocales =
+                new ArrayList<>(getFactoryModelFilePathsLocked().keySet());
+        final Locale updatedModelLocale = getUpdatedModelLocale();
+        if (updatedModelLocale != null) {
+            supportedLocales.add(updatedModelLocale);
+        }
+        return Locale.lookup(languageRangeList, supportedLocales);
     }
 
     @GuardedBy("mSmartSelectionLock") // Do not call outside this lock.
-    private Map<Locale, String> loadModelFilePathsLocked() {
+    private Map<Locale, String> getFactoryModelFilePathsLocked() {
         if (mModelFilePaths == null) {
             final Map<Locale, String> modelFilePaths = new HashMap<>();
             final File modelsDir = new File(MODEL_DIR);
@@ -233,6 +302,20 @@
         return mModelFilePaths;
     }
 
+    @Nullable
+    private Locale getUpdatedModelLocale() {
+        try {
+            final ParcelFileDescriptor updateFd = ParcelFileDescriptor.open(
+                    new File(UPDATED_MODEL_FILE_PATH), ParcelFileDescriptor.MODE_READ_ONLY);
+            final Locale locale = Locale.forLanguageTag(
+                    SmartSelection.getLanguage(updateFd.getFd()));
+            closeAndLogError(updateFd);
+            return locale;
+        } catch (FileNotFoundException e) {
+            return null;
+        }
+    }
+
     private TextClassificationResult createClassificationResult(
             SmartSelection.ClassificationResult[] classifications, CharSequence text) {
         final TextClassificationResult.Builder builder = new TextClassificationResult.Builder()
@@ -319,6 +402,17 @@
     }
 
     /**
+     * Closes the ParcelFileDescriptor and logs any errors that occur.
+     */
+    private static void closeAndLogError(ParcelFileDescriptor fd) {
+        try {
+            fd.close();
+        } catch (IOException e) {
+            Log.e(LOG_TAG, "Error closing file.", e);
+        }
+    }
+
+    /**
      * @throws IllegalArgumentException if text is null; startIndex is negative;
      *      endIndex is greater than text.length() or is not greater than startIndex
      */
diff --git a/core/java/android/webkit/WebView.java b/core/java/android/webkit/WebView.java
index 6213a63..52c82a7 100644
--- a/core/java/android/webkit/WebView.java
+++ b/core/java/android/webkit/WebView.java
@@ -2255,6 +2255,7 @@
 
     /**
      * Sets the {@link TextClassifier} for this WebView.
+     * @hide
      */
     public void setTextClassifier(@Nullable TextClassifier textClassifier) {
         mProvider.setTextClassifier(textClassifier);
@@ -2263,6 +2264,7 @@
     /**
      * Returns the {@link TextClassifier} used by this WebView.
      * If no TextClassifier has been set, this WebView uses the default set by the system.
+     * @hide
      */
     @NonNull
     public TextClassifier getTextClassifier() {
@@ -2506,6 +2508,7 @@
         super.onDetachedFromWindowInternal();
     }
 
+    /** @hide */
     @Override
     public void onMovedToDisplay(int displayId, Configuration config) {
         mProvider.getViewDelegate().onMovedToDisplay(displayId, config);
diff --git a/core/java/android/widget/Editor.java b/core/java/android/widget/Editor.java
index 4ae3510..27e3fe5 100644
--- a/core/java/android/widget/Editor.java
+++ b/core/java/android/widget/Editor.java
@@ -3836,9 +3836,11 @@
             }
 
             if (mTextView.canRequestAutofill()) {
+                final int mode = mTextView.getText().length() <= 0
+                        ? MenuItem.SHOW_AS_ACTION_IF_ROOM : MenuItem.SHOW_AS_ACTION_NEVER;
                 menu.add(Menu.NONE, TextView.ID_AUTOFILL, MENU_ITEM_ORDER_AUTOFILL,
                         com.android.internal.R.string.autofill)
-                        .setShowAsAction(MenuItem.SHOW_AS_ACTION_IF_ROOM);
+                        .setShowAsAction(mode);
             }
 
             updateSelectAllItem(menu);
diff --git a/core/java/android/widget/LinearLayout.java b/core/java/android/widget/LinearLayout.java
index ff3c85c..88c3c5b 100644
--- a/core/java/android/widget/LinearLayout.java
+++ b/core/java/android/widget/LinearLayout.java
@@ -258,9 +258,9 @@
 
         mUseLargestChild = a.getBoolean(R.styleable.LinearLayout_measureWithLargestChild, false);
 
-        setDividerDrawable(a.getDrawable(R.styleable.LinearLayout_divider));
         mShowDividers = a.getInt(R.styleable.LinearLayout_showDividers, SHOW_DIVIDER_NONE);
         mDividerPadding = a.getDimensionPixelSize(R.styleable.LinearLayout_dividerPadding, 0);
+        setDividerDrawable(a.getDrawable(R.styleable.LinearLayout_divider));
 
         final int version = context.getApplicationInfo().targetSdkVersion;
         mAllowInconsistentMeasurement = version <= Build.VERSION_CODES.M;
diff --git a/core/java/android/widget/TextView.java b/core/java/android/widget/TextView.java
index 406386aa..eee70e0 100644
--- a/core/java/android/widget/TextView.java
+++ b/core/java/android/widget/TextView.java
@@ -125,6 +125,7 @@
 import android.view.DragEvent;
 import android.view.Gravity;
 import android.view.HapticFeedbackConstants;
+import android.view.InputDevice;
 import android.view.KeyCharacterMap;
 import android.view.KeyEvent;
 import android.view.MotionEvent;
@@ -394,6 +395,14 @@
 
     private TextClassifier mTextClassifier;
 
+    // A flag to prevent repeated movements from escaping the enclosing text view. The idea here is
+    // that if a user is holding down a movement key to traverse text, we shouldn't also traverse
+    // the view hierarchy. On the other hand, if the user is using the movement key to traverse
+    // views (i.e. the first movement was to traverse out of this view, or this view was traversed
+    // into by the user holding the movement key down) then we shouldn't prevent the focus from
+    // changing.
+    private boolean mPreventDefaultMovement;
+
     private TextUtils.TruncateAt mEllipsize;
 
     static class Drawables {
@@ -3886,26 +3895,42 @@
      * are invalid. If a specified axis name is not defined in the font, the settings will be
      * ignored.
      *
+     * <p>
+     * Examples,
+     * <ul>
+     * <li>Set font width to 150.
      * <pre>
-     *   textView.setFontVariationSettings("'wdth' 1.0");
-     *   textView.setFontVariationSettings("'AX  ' 1.8, 'FB  ' 2.0");
+     * <code>
+     *   TextView textView = (TextView) findViewById(R.id.textView);
+     *   textView.setFontVariationSettings("'wdth' 150");
+     * </code>
      * </pre>
+     * </li>
+     *
+     * <li>Set the font slant to 20 degrees and ask for italic style.
+     * <pre>
+     * <code>
+     *   TextView textView = (TextView) findViewById(R.id.textView);
+     *   textView.setFontVariationSettings("'slnt' 20, 'ital' 1");
+     * </code>
+     * </pre>
+     * </p>
+     * </li>
+     * </ul>
      *
      * @param fontVariationSettings font variation settings. You can pass null or empty string as
      *                              no variation settings.
-     *
      * @return true if the given settings is effective to at least one font file underlying this
      *         TextView. This function also returns true for empty settings string. Otherwise
      *         returns false.
      *
-     * @throws FontVariationAxis.InvalidFormatException
-     *         If given string is not a valid font variation settings format.
+     * @throws IllegalArgumentException If given string is not a valid font variation settings
+     *                                  format.
      *
      * @see #getFontVariationSettings()
-     * @see Paint#getFontVariationSettings() Paint.getFontVariationSettings()
+     * @see FontVariationAxis
      */
-    public boolean setFontVariationSettings(@Nullable String fontVariationSettings)
-            throws FontVariationAxis.InvalidFormatException {
+    public boolean setFontVariationSettings(@Nullable String fontVariationSettings) {
         final String existingSettings = mTextPaint.getFontVariationSettings();
         if (fontVariationSettings == existingSettings
                 || (fontVariationSettings != null
@@ -7137,6 +7162,15 @@
             return KEY_EVENT_NOT_HANDLED;
         }
 
+        // If this is the initial keydown, we don't want to prevent a movement away from this view.
+        // While this shouldn't be necessary because any time we're preventing default movement we
+        // should be restricting the focus to remain within this view, thus we'll also receive
+        // the key up event, occasionally key up events will get dropped and we don't want to
+        // prevent the user from traversing out of this on the next key down.
+        if (event.getRepeatCount() == 0 && !KeyEvent.isModifierKey(keyCode)) {
+            mPreventDefaultMovement = false;
+        }
+
         switch (keyCode) {
             case KeyEvent.KEYCODE_ENTER:
                 if (event.hasNoModifiers()) {
@@ -7268,16 +7302,23 @@
             }
             if (doDown) {
                 if (mMovement.onKeyDown(this, (Spannable) mText, keyCode, event)) {
+                    if (event.getRepeatCount() == 0 && !KeyEvent.isModifierKey(keyCode)) {
+                        mPreventDefaultMovement = true;
+                    }
                     return KEY_DOWN_HANDLED_BY_MOVEMENT_METHOD;
                 }
             }
-            // Consume arrows to prevent focus leaving the editor.
-            if (isDirectionalNavigationKey(keyCode)) {
+            // Consume arrows from keyboard devices to prevent focus leaving the editor.
+            // DPAD/JOY devices (Gamepads, TV remotes) often lack a TAB key so allow those
+            // to move focus with arrows.
+            if (event.getSource() == InputDevice.SOURCE_KEYBOARD
+                    && isDirectionalNavigationKey(keyCode)) {
                 return KEY_EVENT_HANDLED;
             }
         }
 
-        return KEY_EVENT_NOT_HANDLED;
+        return mPreventDefaultMovement && !KeyEvent.isModifierKey(keyCode)
+                ? KEY_EVENT_HANDLED : KEY_EVENT_NOT_HANDLED;
     }
 
     /**
@@ -7310,6 +7351,10 @@
             return super.onKeyUp(keyCode, event);
         }
 
+        if (!KeyEvent.isModifierKey(keyCode)) {
+            mPreventDefaultMovement = false;
+        }
+
         switch (keyCode) {
             case KeyEvent.KEYCODE_DPAD_CENTER:
                 if (event.hasNoModifiers()) {
@@ -9286,6 +9331,8 @@
     }
 
     private void notifyAutoFillManagerAfterTextChangedIfNeeded() {
+        // It is important to not check whether the view is important for autofill
+        // since the user can trigger autofill manually on not important views.
         if (!isAutofillable()) {
             return;
         }
@@ -9298,6 +9345,12 @@
         }
     }
 
+    private boolean isAutofillable() {
+        // It is important to not check whether the view is important for autofill
+        // since the user can trigger autofill manually on not important views.
+        return getAutofillType() != AUTOFILL_TYPE_NONE;
+    }
+
     void updateAfterEdit() {
         invalidate();
         int curs = getSelectionStart();
@@ -10174,6 +10227,9 @@
     }
 
     boolean canRequestAutofill() {
+        if (!isAutofillable()) {
+            return false;
+        }
         final AutofillManager afm = mContext.getSystemService(AutofillManager.class);
         if (afm != null) {
             return afm.isEnabled();
diff --git a/core/java/com/android/internal/content/PackageMonitor.java b/core/java/com/android/internal/content/PackageMonitor.java
index c6b6a7fb..d2e9789 100644
--- a/core/java/com/android/internal/content/PackageMonitor.java
+++ b/core/java/com/android/internal/content/PackageMonitor.java
@@ -65,6 +65,7 @@
     int mChangeType;
     int mChangeUserId = UserHandle.USER_NULL;
     boolean mSomePackagesChanged;
+    String[] mModifiedComponents;
 
     String[] mTempArray = new String[1];
 
@@ -269,6 +270,18 @@
         }
         return false;
     }
+
+    public boolean isComponentModified(String className) {
+        if (className == null || mModifiedComponents == null) {
+            return false;
+        }
+        for (int i = mModifiedComponents.length - 1; i >= 0; i--) {
+            if (className.equals(mModifiedComponents[i])) {
+                return true;
+            }
+        }
+        return false;
+    }
     
     public void onSomePackagesChanged() {
     }
@@ -301,6 +314,7 @@
         
         mDisappearingPackages = mAppearingPackages = null;
         mSomePackagesChanged = false;
+        mModifiedComponents = null;
         
         String action = intent.getAction();
         if (Intent.ACTION_PACKAGE_ADDED.equals(action)) {
@@ -358,13 +372,13 @@
         } else if (Intent.ACTION_PACKAGE_CHANGED.equals(action)) {
             String pkg = getPackageName(intent);
             int uid = intent.getIntExtra(Intent.EXTRA_UID, 0);
-            String[] components = intent.getStringArrayExtra(
+            mModifiedComponents = intent.getStringArrayExtra(
                     Intent.EXTRA_CHANGED_COMPONENT_NAME_LIST);
             if (pkg != null) {
                 mModifiedPackages = mTempArray;
                 mTempArray[0] = pkg;
                 mChangeType = PACKAGE_PERMANENT_CHANGE;
-                if (onPackageChanged(pkg, uid, components)) {
+                if (onPackageChanged(pkg, uid, mModifiedComponents)) {
                     mSomePackagesChanged = true;
                 }
                 onPackageModified(pkg);
diff --git a/core/java/com/android/internal/util/NotificationColorUtil.java b/core/java/com/android/internal/util/NotificationColorUtil.java
index 5cb66e5..2c97f8b 100644
--- a/core/java/com/android/internal/util/NotificationColorUtil.java
+++ b/core/java/com/android/internal/util/NotificationColorUtil.java
@@ -257,7 +257,7 @@
      * @return a color with the same hue as {@param color}, potentially darkened to meet the
      *          contrast ratio.
      */
-    private static int findContrastColor(int color, int other, boolean findFg, double minRatio) {
+    public static int findContrastColor(int color, int other, boolean findFg, double minRatio) {
         int fg = findFg ? color : other;
         int bg = findFg ? other : color;
         if (ColorUtilsFromCompat.calculateContrast(fg, bg) >= minRatio) {
@@ -402,16 +402,17 @@
     }
 
     /**
-     * Lighten a color by a specified value
+     * Change a color by a specified value
      * @param baseColor the base color to lighten
      * @param amount the amount to lighten the color from 0 to 100. This corresponds to the L
-     *               increase in the LAB color space.
-     * @return the lightened color
+     *               increase in the LAB color space. A negative value will darken the color and
+     *               a positive will lighten it.
+     * @return the changed color
      */
-    public static int lightenColor(int baseColor, int amount) {
+    public static int changeColorLightness(int baseColor, int amount) {
         final double[] result = ColorUtilsFromCompat.getTempDouble3Array();
         ColorUtilsFromCompat.colorToLAB(baseColor, result);
-        result[0] = Math.min(100, result[0] + amount);
+        result[0] = Math.max(Math.min(100, result[0] + amount), 0);
         return ColorUtilsFromCompat.LABToColor(result[0], result[1], result[2]);
     }
 
@@ -491,6 +492,15 @@
         return useDark;
     }
 
+    public static double calculateLuminance(int backgroundColor) {
+        return ColorUtilsFromCompat.calculateLuminance(backgroundColor);
+    }
+
+
+    public static double calculateContrast(int foregroundColor, int backgroundColor) {
+        return ColorUtilsFromCompat.calculateContrast(foregroundColor, backgroundColor);
+    }
+
     /**
      * Framework copy of functions needed from android.support.v4.graphics.ColorUtils.
      */
diff --git a/core/java/com/android/internal/widget/MediaNotificationView.java b/core/java/com/android/internal/widget/MediaNotificationView.java
index afb2a5e..bbebcc2 100644
--- a/core/java/com/android/internal/widget/MediaNotificationView.java
+++ b/core/java/com/android/internal/widget/MediaNotificationView.java
@@ -23,7 +23,6 @@
 import android.view.ViewGroup;
 import android.widget.FrameLayout;
 import android.widget.ImageView;
-import android.widget.RelativeLayout;
 import android.widget.RemoteViews;
 
 /**
@@ -34,8 +33,7 @@
 @RemoteViews.RemoteView
 public class MediaNotificationView extends FrameLayout {
 
-    private final int mMaxImageSize;
-    private final int mImageMinTopMargin;
+    private final int mSmallImageSize;
     private final int mNotificationContentMarginEnd;
     private final int mNotificationContentImageMarginEnd;
     private ImageView mRightIcon;
@@ -57,72 +55,68 @@
 
     @Override
     protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
-        int mode = MeasureSpec.getMode(widthMeasureSpec);
         boolean hasIcon = mRightIcon.getVisibility() != GONE;
+        if (!hasIcon) {
+            resetHeaderIndention();
+        }
+        super.onMeasure(widthMeasureSpec, heightMeasureSpec);
+        int mode = MeasureSpec.getMode(widthMeasureSpec);
+        boolean reMeasure = false;
         if (hasIcon && mode != MeasureSpec.UNSPECIFIED) {
-            measureChild(mActions, widthMeasureSpec, heightMeasureSpec);
             int size = MeasureSpec.getSize(widthMeasureSpec);
             size = size - mActions.getMeasuredWidth();
             ViewGroup.MarginLayoutParams layoutParams =
                     (MarginLayoutParams) mRightIcon.getLayoutParams();
             int imageEndMargin = layoutParams.getMarginEnd();
             size -= imageEndMargin;
-            size = Math.min(size, mMaxImageSize);
-            size = Math.max(size, mRightIcon.getMinimumWidth());
-            layoutParams.width = size;
-            layoutParams.height = size;
-            mRightIcon.setLayoutParams(layoutParams);
-
-            // lets ensure that the main column doesn't run into the image
-            ViewGroup.MarginLayoutParams mainParams
-                    = (MarginLayoutParams) mMainColumn.getLayoutParams();
-            int marginEnd = size + imageEndMargin + mNotificationContentMarginEnd;
-            if (marginEnd != mainParams.getMarginEnd()) {
-                mainParams.setMarginEnd(marginEnd);
-                mMainColumn.setLayoutParams(mainParams);
+            int fullHeight = getMeasuredHeight();
+            if (size < fullHeight) {
+                size = mSmallImageSize;
+            } else {
+                size = fullHeight;
             }
-
-        }
-        super.onMeasure(widthMeasureSpec, heightMeasureSpec);
-        ViewGroup.MarginLayoutParams iconParams =
-                (MarginLayoutParams) mRightIcon.getLayoutParams();
-        int topMargin = getMeasuredHeight() - mRightIcon.getMeasuredHeight()
-                - iconParams.bottomMargin;
-        // If the topMargin is high enough we can also remove the header constraint!
-        boolean reMeasure = false;
-        if (!hasIcon || topMargin >= mImageMinTopMargin) {
-            reMeasure = resetHeaderIndention();
-        } else {
-            int paddingEnd = mNotificationContentImageMarginEnd;
-            ViewGroup.MarginLayoutParams headerParams =
-                    (MarginLayoutParams) mHeader.getLayoutParams();
-            int newMarginEnd = mRightIcon.getMeasuredWidth() + iconParams.getMarginEnd();
-            if (headerParams.getMarginEnd() != newMarginEnd) {
-                headerParams.setMarginEnd(newMarginEnd);
-                mHeader.setLayoutParams(headerParams);
+            if (layoutParams.width != size || layoutParams.height != size) {
+                layoutParams.width = size;
+                layoutParams.height = size;
+                mRightIcon.setLayoutParams(layoutParams);
                 reMeasure = true;
             }
-            if (mHeader.getPaddingEnd() != paddingEnd) {
+
+            // lets ensure that the main column doesn't run into the image
+            ViewGroup.MarginLayoutParams params
+                    = (MarginLayoutParams) mMainColumn.getLayoutParams();
+            int marginEnd = size + imageEndMargin + mNotificationContentMarginEnd;
+            if (marginEnd != params.getMarginEnd()) {
+                params.setMarginEnd(marginEnd);
+                mMainColumn.setLayoutParams(params);
+                reMeasure = true;
+            }
+            int headerMarginEnd = size + imageEndMargin;
+            params = (MarginLayoutParams) mHeader.getLayoutParams();
+            if (params.getMarginEnd() != headerMarginEnd) {
+                params.setMarginEnd(headerMarginEnd);
+                mHeader.setLayoutParams(params);
+                reMeasure = true;
+            }
+            if (mHeader.getPaddingEnd() != mNotificationContentImageMarginEnd) {
                 mHeader.setPaddingRelative(mHeader.getPaddingStart(),
                         mHeader.getPaddingTop(),
-                        paddingEnd,
+                        mNotificationContentImageMarginEnd,
                         mHeader.getPaddingBottom());
                 reMeasure = true;
             }
         }
         if (reMeasure) {
-            measureChildWithMargins(mHeader, widthMeasureSpec, 0, heightMeasureSpec, 0);
+            super.onMeasure(widthMeasureSpec, heightMeasureSpec);
         }
     }
 
-    private boolean resetHeaderIndention() {
-        boolean remeasure = false;
+    private void resetHeaderIndention() {
         if (mHeader.getPaddingEnd() != mNotificationContentMarginEnd) {
             mHeader.setPaddingRelative(mHeader.getPaddingStart(),
                     mHeader.getPaddingTop(),
                     mNotificationContentMarginEnd,
                     mHeader.getPaddingBottom());
-            remeasure = true;
         }
         ViewGroup.MarginLayoutParams headerParams =
                 (MarginLayoutParams) mHeader.getLayoutParams();
@@ -130,19 +124,14 @@
         if (headerParams.getMarginEnd() != 0) {
             headerParams.setMarginEnd(0);
             mHeader.setLayoutParams(headerParams);
-            remeasure = true;
         }
-        return remeasure;
     }
 
     public MediaNotificationView(Context context, AttributeSet attrs, int defStyleAttr,
             int defStyleRes) {
         super(context, attrs, defStyleAttr, defStyleRes);
-        mMaxImageSize = context.getResources().getDimensionPixelSize(
-                com.android.internal.R.dimen.media_notification_expanded_image_max_size);
-        mImageMinTopMargin = (int) (context.getResources().getDimensionPixelSize(
-                com.android.internal.R.dimen.notification_content_margin_top)
-                + getResources().getDisplayMetrics().density * 2);
+        mSmallImageSize = context.getResources().getDimensionPixelSize(
+                com.android.internal.R.dimen.media_notification_expanded_image_small_size);
         mNotificationContentMarginEnd = context.getResources().getDimensionPixelSize(
                 com.android.internal.R.dimen.notification_content_margin_end);
         mNotificationContentImageMarginEnd = context.getResources().getDimensionPixelSize(
diff --git a/core/jni/android/graphics/Path.cpp b/core/jni/android/graphics/Path.cpp
index 292454b..d3d6882 100644
--- a/core/jni/android/graphics/Path.cpp
+++ b/core/jni/android/graphics/Path.cpp
@@ -26,6 +26,7 @@
 
 #include "SkPath.h"
 #include "SkPathOps.h"
+#include "SkGeometry.h" // WARNING: Internal Skia Header
 
 #include <Caches.h>
 #include <vector>
@@ -355,8 +356,9 @@
         }
     }
 
-    static void createVerbSegments(SkPath::Verb verb, const SkPoint* points,
-        std::vector<SkPoint>& segmentPoints, std::vector<float>& lengths, float errorSquared) {
+    static void createVerbSegments(const SkPath::Iter& pathIter, SkPath::Verb verb,
+            const SkPoint* points, std::vector<SkPoint>& segmentPoints,
+            std::vector<float>& lengths, float errorSquared, float errorConic) {
         switch (verb) {
             case SkPath::kMove_Verb:
                 addMove(segmentPoints, lengths, points[0]);
@@ -375,8 +377,27 @@
                 addBezier(points, cubicBezierCalculation, segmentPoints, lengths,
                     errorSquared, true);
                 break;
+            case SkPath::kConic_Verb: {
+                SkAutoConicToQuads converter;
+                const SkPoint* quads = converter.computeQuads(
+                        points, pathIter.conicWeight(), errorConic);
+                for (int i = 0; i < converter.countQuads(); i++) {
+                    // Note: offset each subsequent quad by 2, since end points are shared
+                    const SkPoint* quad = quads + i * 2;
+                    addBezier(quad, quadraticBezierCalculation, segmentPoints, lengths,
+                        errorConic, false);
+                }
+                break;
+            }
             default:
-                // Leave element as NULL, Conic sections are not supported.
+                static_assert(SkPath::kMove_Verb == 0
+                                && SkPath::kLine_Verb == 1
+                                && SkPath::kQuad_Verb == 2
+                                && SkPath::kConic_Verb == 3
+                                && SkPath::kCubic_Verb == 4
+                                && SkPath::kClose_Verb == 5
+                                && SkPath::kDone_Verb == 6,
+                        "Path enum changed, new types may have been added.");
                 break;
         }
     }
@@ -398,9 +419,11 @@
         std::vector<SkPoint> segmentPoints;
         std::vector<float> lengths;
         float errorSquared = acceptableError * acceptableError;
+        float errorConic = acceptableError / 2; // somewhat arbitrary
 
         while ((verb = pathIter.next(points, false)) != SkPath::kDone_Verb) {
-            createVerbSegments(verb, points, segmentPoints, lengths, errorSquared);
+            createVerbSegments(pathIter, verb, points, segmentPoints, lengths,
+                    errorSquared, errorConic);
         }
 
         if (segmentPoints.empty()) {
diff --git a/core/jni/android_hardware_HardwareBuffer.cpp b/core/jni/android_hardware_HardwareBuffer.cpp
index 4b31c91..ba23450 100644
--- a/core/jni/android_hardware_HardwareBuffer.cpp
+++ b/core/jni/android_hardware_HardwareBuffer.cpp
@@ -80,14 +80,10 @@
         }
         return NULL;
     }
-    uint64_t producerUsage = 0;
-    uint64_t consumerUsage = 0;
-    android_hardware_HardwareBuffer_convertToGrallocUsageBits(
-            &producerUsage, &consumerUsage, usage, 0);
 
+    uint64_t grallocUsage = AHardwareBuffer_convertToGrallocUsageBits(usage);
     sp<GraphicBuffer> buffer = new GraphicBuffer(width, height, pixelFormat, layers,
-            android_convertGralloc1To0Usage(producerUsage, consumerUsage),
-            std::string("HardwareBuffer pid [") + std::to_string(getpid()) +"]");
+            grallocUsage, std::string("HardwareBuffer pid [") + std::to_string(getpid()) +"]");
     status_t error = buffer->initCheck();
     if (error < 0) {
         if (kDebugGraphicBuffer) {
@@ -145,11 +141,7 @@
 static jlong android_hardware_HardwareBuffer_getUsage(JNIEnv* env,
     jobject clazz, jlong nativeObject) {
     GraphicBuffer* buffer = GraphicBufferWrapper_to_GraphicBuffer(nativeObject);
-    uint64_t usage0 = 0;
-    uint64_t usage1 = 0;
-    android_hardware_HardwareBuffer_convertFromGrallocUsageBits(&usage0, &usage1,
-            buffer->getUsage(), buffer->getUsage());
-    return usage0;
+    return AHardwareBuffer_convertFromGrallocUsageBits(buffer->getUsage());
 }
 
 // ----------------------------------------------------------------------------
@@ -221,14 +213,8 @@
     return AHardwareBuffer_convertToPixelFormat(format);
 }
 
-void android_hardware_HardwareBuffer_convertToGrallocUsageBits(uint64_t* outProducerUsage,
-        uint64_t* outConsumerUsage, uint64_t usage0, uint64_t usage1) {
-    AHardwareBuffer_convertToGrallocUsageBits(outProducerUsage, outConsumerUsage, usage0, usage1);
-}
-
-void android_hardware_HardwareBuffer_convertFromGrallocUsageBits(uint64_t* outUsage0,
-        uint64_t* outUsage1, uint64_t producerUsage, uint64_t consumerUsage) {
-    AHardwareBuffer_convertFromGrallocUsageBits(outUsage0, outUsage1, producerUsage, consumerUsage);
+uint64_t android_hardware_HardwareBuffer_convertToGrallocUsageBits(uint64_t usage) {
+    return AHardwareBuffer_convertToGrallocUsageBits(usage);
 }
 
 }  // namespace android
diff --git a/core/jni/include/android_runtime/android_hardware_HardwareBuffer.h b/core/jni/include/android_runtime/android_hardware_HardwareBuffer.h
index 3545c56..c452b74 100644
--- a/core/jni/include/android_runtime/android_hardware_HardwareBuffer.h
+++ b/core/jni/include/android_runtime/android_hardware_HardwareBuffer.h
@@ -32,22 +32,19 @@
         JNIEnv* env, AHardwareBuffer* hardwareBuffer);
 
 /* Convert from HAL_PIXEL_FORMAT values to AHARDWAREBUFFER_FORMAT values. */
-extern uint32_t android_hardware_HardwareBuffer_convertFromPixelFormat(
-      uint32_t format);
+extern uint32_t android_hardware_HardwareBuffer_convertFromPixelFormat(uint32_t format);
 
 /* Convert from AHARDWAREBUFFER_FORMAT values to HAL_PIXEL_FORMAT values. */
-extern uint32_t android_hardware_HardwareBuffer_convertToPixelFormat(
-      uint32_t format);
+extern uint32_t android_hardware_HardwareBuffer_convertToPixelFormat(uint32_t format);
 
 /* Convert from AHARDWAREBUFFER_USAGE* flags to to gralloc usage flags. */
-extern void android_hardware_HardwareBuffer_convertToGrallocUsageBits(
-      uint64_t* outProducerUsage, uint64_t* outConsumerUsage, uint64_t usage0,
-      uint64_t usage1);
+extern uint64_t android_hardware_HardwareBuffer_convertToGrallocUsageBits(uint64_t usage);
 
-/* Convert from gralloc usage flags to to AHARDWAREBUFFER_USAGE0* flags. */
-extern void android_hardware_HardwareBuffer_convertFromGrallocUsageBits(
-      uint64_t* outUsage0, uint64_t* outUsage1, uint64_t producerUsage,
-      uint64_t consumerUsage);
+inline void android_hardware_HardwareBuffer_convertToGrallocUsageBits(
+        uint64_t* outProducerUsage, uint64_t* outConsumerUsage, uint64_t usage, uint64_t) {
+    outProducerUsage[0] = outConsumerUsage[0] =
+            android_hardware_HardwareBuffer_convertToGrallocUsageBits(usage);
+}
 
 } // namespace android
 
diff --git a/core/res/AndroidManifest.xml b/core/res/AndroidManifest.xml
index eacb02f..5b4a454 100644
--- a/core/res/AndroidManifest.xml
+++ b/core/res/AndroidManifest.xml
@@ -1697,7 +1697,8 @@
     <permission android:name="android.permission.CACHE_CONTENT"
         android:protectionLevel="signature" />
 
-    <!-- Allows an application to aggressively allocate disk space.
+    <!-- @SystemApi @hide
+         Allows an application to aggressively allocate disk space.
          <p>Not for use by third-party applications.
     -->
     <permission android:name="android.permission.ALLOCATE_AGGRESSIVE"
@@ -1860,22 +1861,40 @@
         android:description="@string/permdesc_systemAlertWindow"
         android:protectionLevel="signature|preinstalled|appop|pre23|development" />
 
-    <!-- Allows an app to run in the background.
-         <p>Protection level: signature
+    <!-- @deprecated Use {@link android.Manifest.permission#REQUEST_COMPANION_RUN_IN_BACKGROUND}
+         @hide
     -->
     <permission android:name="android.permission.RUN_IN_BACKGROUND"
         android:label="@string/permlab_runInBackground"
         android:description="@string/permdesc_runInBackground"
         android:protectionLevel="signature" />
 
-    <!-- Allows an app to use data in the background.
-         <p>Protection level: signature
+    <!-- @deprecated Use
+        {@link android.Manifest.permission#REQUEST_COMPANION_USE_DATA_IN_BACKGROUND}
+         @hide
     -->
     <permission android:name="android.permission.USE_DATA_IN_BACKGROUND"
         android:label="@string/permlab_useDataInBackground"
         android:description="@string/permdesc_useDataInBackground"
         android:protectionLevel="signature" />
 
+    <!-- Allows a companion app to run in the background.
+         <p>Protection level: signature
+    -->
+    <permission android:name="android.permission.REQUEST_COMPANION_RUN_IN_BACKGROUND"
+                android:label="@string/permlab_runInBackground"
+                android:description="@string/permdesc_runInBackground"
+                android:protectionLevel="signature" />
+
+    <!-- Allows a companion app to use data in the background.
+         <p>Protection level: signature
+    -->
+    <permission android:name="android.permission.REQUEST_COMPANION_USE_DATA_IN_BACKGROUND"
+                android:label="@string/permlab_useDataInBackground"
+                android:description="@string/permdesc_useDataInBackground"
+                android:protectionLevel="signature" />
+
+
     <!-- ================================== -->
     <!-- Permissions affecting the system wallpaper -->
     <!-- ================================== -->
diff --git a/core/res/res/layout/autofill_save.xml b/core/res/res/layout/autofill_save.xml
index 2f7ad3a..60df492 100644
--- a/core/res/res/layout/autofill_save.xml
+++ b/core/res/res/layout/autofill_save.xml
@@ -25,7 +25,7 @@
         android:layout_width="fill_parent"
         android:layout_height="wrap_content"
         android:layout_marginTop="32dp"
-        android:padding="16dp"
+        android:paddingTop="16dp"
         android:elevation="32dp"
         android:background="?android:attr/colorBackground"
         android:orientation="vertical">
@@ -33,43 +33,53 @@
         <LinearLayout
             android:layout_width="fill_parent"
             android:layout_height="wrap_content"
-            android:orientation="horizontal">
+            android:paddingLeft="16dp"
+            android:paddingRight="16dp"
+            android:orientation="vertical">
+
+            <LinearLayout
+                android:layout_width="fill_parent"
+                android:layout_height="wrap_content"
+                android:orientation="horizontal">
+
+                <TextView
+                    android:id="@+id/autofill_save_title"
+                    android:layout_width="0dp"
+                    android:layout_height="wrap_content"
+                    android:text="@string/autofill_save_title"
+                    android:textSize="16sp"
+                    android:textColor="?android:attr/textColorPrimary"
+                    android:layout_weight="1">
+                </TextView>
+
+                <ImageView
+                    android:id="@+id/autofill_save_close"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:layout_marginLeft="16dp"
+                    android:src="@android:drawable/ic_close"
+                    android:alpha="0.54"
+                    android:background="?android:attr/selectableItemBackgroundBorderless">
+                </ImageView>
+
+            </LinearLayout>
 
             <TextView
-                android:id="@+id/autofill_save_title"
-                android:layout_width="0dp"
+                android:id="@+id/autofill_save_subtitle"
+                android:layout_width="fill_parent"
                 android:layout_height="wrap_content"
-                android:text="@string/autofill_save_title"
-                android:textSize="16sp"
-                android:textColor="?android:attr/textColorPrimary"
-                android:layout_weight="1">
+                android:layout_marginTop="4dp"
+                android:visibility="gone">
             </TextView>
 
-            <ImageView
-                android:id="@+id/autofill_save_close"
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
-                android:layout_marginLeft="16dp"
-                android:src="@android:drawable/ic_close"
-                android:alpha="0.54"
-                android:background="?android:attr/selectableItemBackgroundBorderless">
-            </ImageView>
-
         </LinearLayout>
 
-        <TextView
-            android:id="@+id/autofill_save_subtitle"
-            android:layout_width="fill_parent"
-            android:layout_height="wrap_content"
-            android:layout_marginTop="4dp"
-            android:visibility="gone">
-        </TextView>
-
         <com.android.internal.widget.ButtonBarLayout
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
             android:layout_gravity="end"
-            android:layout_marginTop="16dp"
+            android:padding="16dp"
+            android:clipToPadding="false"
             android:layout_weight="1"
             android:orientation="horizontal">
 
@@ -94,6 +104,7 @@
                 android:layout_height="wrap_content"
                 style="@style/Widget.Material.Button.Colored"
                 android:text="@string/autofill_save_yes">
+                <requestFocus />
             </Button>
 
         </com.android.internal.widget.ButtonBarLayout>
diff --git a/core/res/res/layout/notification_template_material_big_media.xml b/core/res/res/layout/notification_template_material_big_media.xml
index 04ea12d..532f28e 100644
--- a/core/res/res/layout/notification_template_material_big_media.xml
+++ b/core/res/res/layout/notification_template_material_big_media.xml
@@ -23,6 +23,13 @@
     android:background="#00000000"
     android:tag="bigMediaNarrow"
     >
+    <!-- The size will actually be determined at runtime -->
+    <ImageView android:id="@+id/right_icon"
+        android:layout_width="0dp"
+        android:layout_height="0dp"
+        android:layout_gravity="top|end"
+        android:scaleType="centerCrop"
+    />
     <include layout="@layout/notification_template_header"
         android:layout_width="match_parent"
         android:layout_height="53dp"
@@ -60,14 +67,4 @@
             <!-- media buttons will be added here -->
         </LinearLayout>
     </LinearLayout>
-
-    <ImageView android:id="@+id/right_icon"
-        android:layout_width="@dimen/media_notification_expanded_image_max_size"
-        android:layout_height="@dimen/media_notification_expanded_image_max_size"
-        android:minWidth="40dp"
-        android:layout_marginEnd="16dp"
-        android:layout_marginBottom="20dp"
-        android:layout_gravity="bottom|end"
-        android:scaleType="centerCrop"
-        />
 </com.android.internal.widget.MediaNotificationView>
diff --git a/core/res/res/layout/notification_template_material_media.xml b/core/res/res/layout/notification_template_material_media.xml
index 4c64207..4be53e0 100644
--- a/core/res/res/layout/notification_template_material_media.xml
+++ b/core/res/res/layout/notification_template_material_media.xml
@@ -23,6 +23,13 @@
     android:background="#00000000"
     android:tag="media"
     >
+    <ImageView android:id="@+id/right_icon"
+        android:layout_width="wrap_content"
+        android:layout_height="match_parent"
+        android:adjustViewBounds="true"
+        android:layout_gravity="top|end"
+        android:scaleType="centerCrop"
+    />
     <include layout="@layout/notification_template_header"
         android:layout_width="fill_parent"
         android:layout_height="53dp" />
@@ -61,5 +68,4 @@
             <!-- media buttons will be added here -->
         </LinearLayout>
     </LinearLayout>
-    <include layout="@layout/notification_template_right_icon" />
 </FrameLayout>
diff --git a/core/res/res/values/attrs.xml b/core/res/res/values/attrs.xml
index 3898cae..c421514 100644
--- a/core/res/res/values/attrs.xml
+++ b/core/res/res/values/attrs.xml
@@ -60,6 +60,9 @@
              mode. -->
         <attr name="colorMultiSelectHighlight" format="color" />
 
+        <!-- Drawable to be drawn over the view to mark it as autofilled-->
+        <attr name="autofilledHighlight" format="reference" />
+
         <!-- Default disabled alpha for widgets that set enabled/disabled alpha programmatically. -->
         <attr name="disabledAlpha" format="float" />
         <!-- The alpha applied to the foreground color to create the primary text color. -->
@@ -3448,8 +3451,8 @@
             <flag name="flagEnableAccessibilityVolume" value="0x00000080" />
             <!-- Has flag {@link android.accessibilityservice.AccessibilityServiceInfo#FLAG_REQUEST_ACCESSIBILITY_BUTTON}. -->
             <flag name="flagRequestAccessibilityButton" value="0x00000100" />
-            <!-- Has flag {@link android.accessibilityservice.AccessibilityServiceInfo#FLAG_CAPTURE_FINGERPRINT_GESTURES}. -->
-            <flag name="flagCaptureFingerprintGestures" value="0x00000200" />
+            <!-- Has flag {@link android.accessibilityservice.AccessibilityServiceInfo#FLAG_REQUEST_FINGERPRINT_GESTURES}. -->
+            <flag name="flagRequestFingerprintGestures" value="0x00000200" />
         </attr>
         <!-- Component name of an activity that allows the user to modify
              the settings for this service. This setting cannot be changed at runtime. -->
@@ -3489,10 +3492,10 @@
              the fingerprint sensor.
              <p>
              Required to allow setting the {@link android.accessibilityservice
-             #AccessibilityServiceInfo#FLAG_CAN_CAPTURE_FINGERPRINT_GESTURES} flag.
+             #AccessibilityServiceInfo#FLAG_REQUEST_FINGERPRINT_GESTURES} flag to have any effect.
              </p>
          -->
-        <attr name="canCaptureFingerprintGestures" format="boolean" />
+        <attr name="canRequestFingerprintGestures" format="boolean" />
         <!-- Short description of the accessibility service purpose or behavior.-->
         <attr name="description" />
         <!-- Brief summary of the accessibility service purpose or behavior. -->
diff --git a/core/res/res/values/attrs_manifest.xml b/core/res/res/values/attrs_manifest.xml
index 95ba942..c883674 100644
--- a/core/res/res/values/attrs_manifest.xml
+++ b/core/res/res/values/attrs_manifest.xml
@@ -897,7 +897,7 @@
          will run against.  If not specified, only runs in the main process of the targetPackage.
          Can either be a comma-separated list of process names or '*' for any process that
          launches to run targetPackage code. -->
-    <attr name="targetProcess" format="string" />
+    <attr name="targetProcesses" format="string" />
 
     <!-- Flag indicating that an Instrumentation class wants to take care
          of starting/stopping profiling itself, rather than relying on
@@ -2355,7 +2355,7 @@
             is a period then it is appended to your package name. -->
         <attr name="name" />
         <attr name="targetPackage" />
-        <attr name="targetProcess" />
+        <attr name="targetProcesses" />
         <attr name="label" />
         <attr name="icon" />
         <attr name="roundIcon" />
diff --git a/core/res/res/values/dimens.xml b/core/res/res/values/dimens.xml
index c5316c6..ef6c21f 100644
--- a/core/res/res/values/dimens.xml
+++ b/core/res/res/values/dimens.xml
@@ -208,8 +208,8 @@
     <!-- The minimum height of the content if there are at least two lines or a picture-->
     <dimen name="notification_min_content_height">41dp</dimen>
 
-    <!-- The maximum size of the image in the expanded media notification -->
-    <dimen name="media_notification_expanded_image_max_size">94dp</dimen>
+    <!-- The small size of the image if the height drawing doesn't work anymore -->
+    <dimen name="media_notification_expanded_image_small_size">72dp</dimen>
 
     <!-- The maximum size of the image in the expanded media notification -->
     <dimen name="media_notification_expanded_image_margin_bottom">20dp</dimen>
diff --git a/core/res/res/values/public.xml b/core/res/res/values/public.xml
index e13026b..89ed9cb 100644
--- a/core/res/res/values/public.xml
+++ b/core/res/res/values/public.xml
@@ -2778,7 +2778,7 @@
         <public name="paddingVertical" />
         <public name="fontStyle" />
         <public name="keyboardNavigationCluster" />
-        <public name="targetProcess" />
+        <public name="targetProcesses" />
         <public name="nextClusterForward" />
         <public name="__removed1" />
         <public name="colorError" />
@@ -2792,7 +2792,7 @@
         <public name="colorMode" />
         <public name="isolatedSplits" />
         <public name="targetSandboxVersion" />
-        <public name="canCaptureFingerprintGestures" />
+        <public name="canRequestFingerprintGestures" />
         <public name="alphabeticModifiers" />
         <public name="numericModifiers" />
         <public name="fontProviderAuthority" />
@@ -2822,6 +2822,7 @@
         <!-- @hide @SystemApi -->
         <public name="requiredSystemPropertyValue" />
         <public name="justificationMode" />
+        <public name="autofilledHighlight" />
     </public-group>
 
     <public-group type="style" first-id="0x010302e0">
@@ -2833,8 +2834,8 @@
         <public name="autofill" />
     </public-group>
 
-    <public-group type="drawable" first-id="0x010800b4">
-        <public name="autofilled_highlight" />
+    <public-group type="drawable" first-id="0x010800b5">
+        <!-- 0x010800b4 was removed -->
         <public name="ic_picture_in_picture" />
     </public-group>
 
diff --git a/core/res/res/values/symbols.xml b/core/res/res/values/symbols.xml
index 63a5cfd7..1e529da7 100644
--- a/core/res/res/values/symbols.xml
+++ b/core/res/res/values/symbols.xml
@@ -238,6 +238,7 @@
   <java-symbol type="attr" name="windowFixedHeightMinor" />
   <java-symbol type="attr" name="accessibilityFocusedDrawable"/>
   <java-symbol type="attr" name="isLightTheme"/>
+  <java-symbol type="attr" name="autofilledHighlight"/>
 
   <java-symbol type="bool" name="action_bar_embed_tabs" />
   <java-symbol type="bool" name="action_bar_expanded_action_views_exclusive" />
@@ -598,11 +599,9 @@
   <java-symbol type="string" name="badPin" />
   <java-symbol type="string" name="badPuk" />
   <java-symbol type="string" name="byteShort" />
-  <java-symbol type="string" name="capability_desc_canRequestEnhancedWebAccessibility" />
   <java-symbol type="string" name="capability_title_canRequestFilterKeyEvents" />
   <java-symbol type="string" name="capability_desc_canRequestTouchExploration" />
   <java-symbol type="string" name="capability_desc_canRetrieveWindowContent" />
-  <java-symbol type="string" name="capability_title_canRequestEnhancedWebAccessibility" />
   <java-symbol type="string" name="capability_desc_canRequestFilterKeyEvents" />
   <java-symbol type="string" name="capability_title_canRequestTouchExploration" />
   <java-symbol type="string" name="capability_title_canRetrieveWindowContent" />
@@ -2616,7 +2615,7 @@
   <java-symbol type="string" name="new_sms_notification_title" />
   <java-symbol type="string" name="new_sms_notification_content" />
 
-  <java-symbol type="dimen" name="media_notification_expanded_image_max_size" />
+  <java-symbol type="dimen" name="media_notification_expanded_image_small_size" />
   <java-symbol type="dimen" name="media_notification_expanded_image_margin_bottom" />
   <java-symbol type="dimen" name="notification_content_image_margin_end" />
 
diff --git a/core/res/res/values/themes.xml b/core/res/res/values/themes.xml
index a661b07..e8fbf34 100644
--- a/core/res/res/values/themes.xml
+++ b/core/res/res/values/themes.xml
@@ -435,6 +435,9 @@
         <!-- Accessibility focused drawable -->
         <item name="accessibilityFocusedDrawable">@drawable/view_accessibility_focused</item>
 
+        <!-- Autofilled highlight drawable -->
+        <item name="autofilledHighlight">@drawable/autofilled_highlight</item>
+
         <!-- Lighting and shadow properties -->
         <item name="lightY">@dimen/light_y</item>
         <item name="lightZ">@dimen/light_z</item>
diff --git a/core/res/res/values/themes_device_defaults.xml b/core/res/res/values/themes_device_defaults.xml
index d80ff1d..7517946 100644
--- a/core/res/res/values/themes_device_defaults.xml
+++ b/core/res/res/values/themes_device_defaults.xml
@@ -744,6 +744,7 @@
         <item name="colorPrimaryDark">@color/primary_dark_device_default_settings_light</item>
         <item name="colorSecondary">@color/secondary_device_default_settings_light</item>
         <item name="colorAccent">@color/accent_device_default_light</item>
+        <item name="colorEdgeEffect">@android:color/black</item>
     </style>
 
     <!-- @hide DeviceDefault theme for a window that should use Settings theme colors
diff --git a/core/tests/coretests/src/android/metrics/LogMakerTest.java b/core/tests/coretests/src/android/metrics/LogMakerTest.java
index 63c1f87..ada59cd 100644
--- a/core/tests/coretests/src/android/metrics/LogMakerTest.java
+++ b/core/tests/coretests/src/android/metrics/LogMakerTest.java
@@ -179,6 +179,14 @@
         assertEquals(-1, builder.getProcessId());
     }
 
+    public void testSetAndClearUid() {
+        LogMaker builder = new LogMaker(0);
+        builder.setUid(1);
+        assertEquals(1, builder.getUid());
+        builder.clearUid();
+        assertEquals(-1, builder.getUid());
+    }
+
     public void testGiantLogOmitted() {
         LogMaker badBuilder = new LogMaker(0);
         StringBuilder b = new StringBuilder();
diff --git a/core/tests/coretests/src/android/metrics/MetricsReaderTest.java b/core/tests/coretests/src/android/metrics/MetricsReaderTest.java
index d06f522..d10b351 100644
--- a/core/tests/coretests/src/android/metrics/MetricsReaderTest.java
+++ b/core/tests/coretests/src/android/metrics/MetricsReaderTest.java
@@ -26,6 +26,8 @@
 public class MetricsReaderTest extends TestCase {
     private static final int FULL_N = 10;
     private static final int CHECKPOINTED_N = 4;
+    private static final int PID = 1;
+    private static final int UID = 2;
 
     class FakeLogReader extends MetricsReader.LogReader {
         MetricsReader.Event[] mEvents;
@@ -36,7 +38,8 @@
             for (int i = 0; i < FULL_N; i++) {
                 mEvents[i] = new MetricsReader.Event(
                         1000L + i,
-                        1,
+                        PID,
+                        UID,
                         new LogMaker(i).serialize());
             }
         }
@@ -88,6 +91,13 @@
         }
     }
 
+    public void testPidUid() {
+        mReader.read(0);
+        LogMaker log = mReader.next();
+        assertEquals(PID, log.getProcessId());
+        assertEquals(UID, log.getUid());
+    }
+
     public void testBlockingRead_readResetsHorizon() {
         mReader.read(1000);
         assertEquals(1000, mLogReader.mHorizonMs);
diff --git a/core/tests/coretests/src/android/provider/FontsContractTest.java b/core/tests/coretests/src/android/provider/FontsContractTest.java
index 56bfbb0..d42d79e 100644
--- a/core/tests/coretests/src/android/provider/FontsContractTest.java
+++ b/core/tests/coretests/src/android/provider/FontsContractTest.java
@@ -32,7 +32,6 @@
 import android.content.pm.ProviderInfo;
 import android.content.pm.Signature;
 import android.database.MatrixCursor;
-import android.graphics.fonts.FontVariationAxis.InvalidFormatException;
 import android.graphics.fonts.FontVariationAxis;
 import android.provider.FontsContract.FontInfo;
 import android.support.test.filters.SmallTest;
@@ -73,7 +72,7 @@
         mPackageManager = mock(PackageManager.class);
     }
 
-    public void testGetFontFromProvider_resultOK() throws InvalidFormatException {
+    public void testGetFontFromProvider_resultOK() {
         FontInfo[] fonts = FontsContract.getFontFromProvider(
                 getMockContext(), request, TestFontsProvider.AUTHORITY, null);
         assertNotNull(fonts);
@@ -90,8 +89,7 @@
         assertEquals(RESULT_CODE_OK, font.getResultCode());
     }
 
-    public void testGetFontFromProvider_providerDoesntReturnAllFields()
-            throws InvalidFormatException {
+    public void testGetFontFromProvider_providerDoesntReturnAllFields() {
         mProvider.setReturnAllFields(false);
 
         FontInfo[] fonts = FontsContract.getFontFromProvider(
@@ -107,7 +105,7 @@
         assertEquals(RESULT_CODE_OK, font.getResultCode());
     }
 
-    public void testGetFontFromProvider_resultFontNotFound() throws InvalidFormatException {
+    public void testGetFontFromProvider_resultFontNotFound() {
         // Make the provider return unknown
         mProvider.setResultCode(RESULT_CODE_FONT_NOT_FOUND);
         FontInfo[] fonts = FontsContract.getFontFromProvider(
@@ -120,7 +118,7 @@
         assertEquals(RESULT_CODE_FONT_NOT_FOUND, font.getResultCode());
     }
 
-    public void testGetFontFromProvider_resultFontUnavailable() throws InvalidFormatException {
+    public void testGetFontFromProvider_resultFontUnavailable() {
         // Make the provider return font unavailable
         mProvider.setResultCode(RESULT_CODE_FONT_UNAVAILABLE);
         FontInfo[] fonts = FontsContract.getFontFromProvider(
@@ -140,7 +138,7 @@
         assertEquals(RESULT_CODE_FONT_UNAVAILABLE, font.getResultCode());
     }
 
-    public void testGetFontFromProvider_resultMalformedQuery() throws InvalidFormatException {
+    public void testGetFontFromProvider_resultMalformedQuery() {
         // Make the provider return font unavailable
         mProvider.setResultCode(RESULT_CODE_MALFORMED_QUERY);
         FontInfo[] fonts = FontsContract.getFontFromProvider(
@@ -160,8 +158,7 @@
         assertEquals(RESULT_CODE_MALFORMED_QUERY, font.getResultCode());
     }
 
-    public void testGetFontFromProvider_resultFontNotFoundSecondRow()
-            throws InvalidFormatException {
+    public void testGetFontFromProvider_resultFontNotFoundSecondRow() {
         MatrixCursor cursor = new MatrixCursor(new String[] { FontsContract.Columns._ID,
                 FontsContract.Columns.TTC_INDEX, FontsContract.Columns.VARIATION_SETTINGS,
                 FontsContract.Columns.WEIGHT, FontsContract.Columns.ITALIC,
@@ -193,7 +190,7 @@
         assertEquals(RESULT_CODE_FONT_NOT_FOUND, font.getResultCode());
     }
 
-    public void testGetFontFromProvider_resultFontNotFoundOtherRow() throws InvalidFormatException {
+    public void testGetFontFromProvider_resultFontNotFoundOtherRow() {
         MatrixCursor cursor = new MatrixCursor(new String[] { FontsContract.Columns._ID,
                 FontsContract.Columns.TTC_INDEX, FontsContract.Columns.VARIATION_SETTINGS,
                 FontsContract.Columns.WEIGHT, FontsContract.Columns.ITALIC,
diff --git a/core/tests/coretests/src/android/provider/SettingsBackupTest.java b/core/tests/coretests/src/android/provider/SettingsBackupTest.java
index ad4afae..99909ac 100644
--- a/core/tests/coretests/src/android/provider/SettingsBackupTest.java
+++ b/core/tests/coretests/src/android/provider/SettingsBackupTest.java
@@ -214,6 +214,7 @@
                     Settings.Global.LANG_ID_UPDATE_CONTENT_URL,
                     Settings.Global.LANG_ID_UPDATE_METADATA_URL,
                     Settings.Global.LOCATION_BACKGROUND_THROTTLE_INTERVAL_MS,
+                    Settings.Global.LOCATION_BACKGROUND_THROTTLE_PROXIMITY_ALERT_INTERVAL_MS,
                     Settings.Global.LOCATION_BACKGROUND_THROTTLE_PACKAGE_WHITELIST,
                     Settings.Global.LOCATION_SETTINGS_LINK_TO_PERMISSIONS_ENABLED,
                     Settings.Global.LOCK_SOUND,
diff --git a/core/tests/coretests/src/android/text/VariationParserTest.java b/core/tests/coretests/src/android/text/VariationParserTest.java
index bcc47e1..b0f55d6 100644
--- a/core/tests/coretests/src/android/text/VariationParserTest.java
+++ b/core/tests/coretests/src/android/text/VariationParserTest.java
@@ -33,7 +33,7 @@
             try {
                 FontVariationAxis.fromFontVariationSettings("'wdth' " + invalidStyle);
                 fail();
-            } catch (FontVariationAxis.InvalidFormatException e) {
+            } catch (IllegalArgumentException e) {
                 // pass
             }
         }
@@ -41,14 +41,14 @@
             try {
                 FontVariationAxis.fromFontVariationSettings("'wght' 1, 'wdth' " + invalidStyle);
                 fail();
-            } catch (FontVariationAxis.InvalidFormatException e) {
+            } catch (IllegalArgumentException e) {
                 // pass
             }
         }
     }
 
     @SmallTest
-    public void testOpenTypeTagValue() throws FontVariationAxis.InvalidFormatException {
+    public void testOpenTypeTagValue() {
       assertEquals(0x77647468, (new FontVariationAxis("wdth", 0).getOpenTypeTagValue()));
       assertEquals(0x41582020, (new FontVariationAxis("AX  ", 0).getOpenTypeTagValue()));
       assertEquals(0x20202020, (new FontVariationAxis("    ", 0).getOpenTypeTagValue()));
diff --git a/graphics/java/android/graphics/FontListParser.java b/graphics/java/android/graphics/FontListParser.java
index 1a4f225..7c07a30 100644
--- a/graphics/java/android/graphics/FontListParser.java
+++ b/graphics/java/android/graphics/FontListParser.java
@@ -134,12 +134,7 @@
         String tagStr = parser.getAttributeValue(null, "tag");
         String styleValueStr = parser.getAttributeValue(null, "stylevalue");
         skip(parser);  // axis tag is empty, ignore any contents and consume end tag
-        try {
-            return new FontVariationAxis(tagStr, Float.parseFloat(styleValueStr));
-        } catch (FontVariationAxis.InvalidFormatException e) {
-            // Treat as system failure since system preinstalled font setting has invalid format.
-            throw new RuntimeException(e);
-        }
+        return new FontVariationAxis(tagStr, Float.parseFloat(styleValueStr));
     }
 
     private static FontConfig.Alias readAlias(XmlPullParser parser)
diff --git a/graphics/java/android/graphics/Paint.java b/graphics/java/android/graphics/Paint.java
index 828729a..e62df8f 100644
--- a/graphics/java/android/graphics/Paint.java
+++ b/graphics/java/android/graphics/Paint.java
@@ -1539,25 +1539,49 @@
     }
 
     /**
-     * Set font variation settings.
+     * Sets TrueType or OpenType font variation settings. The settings string is constructed from
+     * multiple pairs of axis tag and style values. The axis tag must contain four ASCII characters
+     * and must be wrapped with single quotes (U+0027) or double quotes (U+0022). Axis strings that
+     * are longer or shorter than four characters, or contain characters outside of U+0020..U+007E
+     * are invalid. If a specified axis name is not defined in the font, the settings will be
+     * ignored.
      *
-     * This function does nothing if none of the settings is applicable to underlying font files.
+     * Examples,
+     * <ul>
+     * <li>Set font width to 150.
+     * <pre>
+     * <code>
+     *   Paint paint = new Paint();
+     *   paint.setFontVariationSettings("'wdth' 150");
+     * </code>
+     * </pre>
+     * </li>
      *
-     * @param settings font variation settings, e.g. "'wdth' 300, 'wght' 1.8"
+     * <li>Set the font slant to 20 degrees and ask for italic style.
+     * <pre>
+     * <code>
+     *   Paint paint = new Paint();
+     *   paint.setFontVariationSettings("'slnt' 20, 'ital' 1");
+     * </code>
+     * </pre>
+     * </li>
+     * </ul>
      *
-     * @see #getFontVariationSettings()
+     * @param fontVariationSettings font variation settings. You can pass null or empty string as
+     *                              no variation settings.
      *
-     * @param settings the font variation settings. You can pass null or empty string as no
-     *                 variation settings.
      * @return true if the given settings is effective to at least one font file underlying this
      *         typeface. This function also returns true for empty settings string. Otherwise
      *         returns false
-     * @throws FontVariationAxis.InvalidFormatException
-     *         If given string is not a valid font variation settings format.
+     *
+     * @throws IllegalArgumentException If given string is not a valid font variation settings
+     *                                  format
+     *
+     * @see #getFontVariationSettings()
+     * @see FontVariationAxis
      */
-    public boolean setFontVariationSettings(String settings)
-            throws FontVariationAxis.InvalidFormatException {
-        settings = TextUtils.nullIfEmpty(settings);
+    public boolean setFontVariationSettings(String fontVariationSettings) {
+        final String settings = TextUtils.nullIfEmpty(fontVariationSettings);
         if (settings == mFontVariationSettings
                 || (settings != null && settings.equals(mFontVariationSettings))) {
             return true;
diff --git a/graphics/java/android/graphics/Path.java b/graphics/java/android/graphics/Path.java
index 3631373..098cdc6 100644
--- a/graphics/java/android/graphics/Path.java
+++ b/graphics/java/android/graphics/Path.java
@@ -16,8 +16,10 @@
 
 package android.graphics;
 
+import android.annotation.FloatRange;
 import android.annotation.NonNull;
 import android.annotation.Nullable;
+import android.annotation.Size;
 
 import dalvik.annotation.optimization.CriticalNative;
 import dalvik.annotation.optimization.FastNative;
@@ -805,7 +807,12 @@
      *                        the error is less than half a pixel.
      * @return An array of components for points approximating the Path.
      */
-    public float[] approximate(float acceptableError) {
+    @NonNull
+    @Size(min = 6, multiple = 3)
+    public float[] approximate(@FloatRange(from = 0) float acceptableError) {
+        if (acceptableError < 0) {
+            throw new IllegalArgumentException("AcceptableError must be greater than or equal to 0");
+        }
         return nApproximate(mNativePath, acceptableError);
     }
 
diff --git a/graphics/java/android/graphics/SurfaceTexture.java b/graphics/java/android/graphics/SurfaceTexture.java
index 24fb673..97edf22 100644
--- a/graphics/java/android/graphics/SurfaceTexture.java
+++ b/graphics/java/android/graphics/SurfaceTexture.java
@@ -16,14 +16,14 @@
 
 package android.graphics;
 
-import java.lang.ref.WeakReference;
-
 import android.annotation.Nullable;
 import android.os.Handler;
 import android.os.Looper;
 import android.os.Message;
 import android.view.Surface;
 
+import java.lang.ref.WeakReference;
+
 /**
  * Captures frames from an image stream as an OpenGL ES texture.
  *
@@ -345,14 +345,17 @@
      * Always call this method when you are done with SurfaceTexture. Failing
      * to do so may delay resource deallocation for a significant amount of
      * time.
+     *
+     * @see #isReleased()
      */
     public void release() {
         nativeRelease();
     }
 
     /**
-     * Returns true if the SurfaceTexture was released
-     * @hide
+     * Returns true if the SurfaceTexture was released.
+     *
+     * @see #release()
      */
     public boolean isReleased() {
         return nativeIsReleased();
@@ -400,7 +403,6 @@
     private native void nativeReleaseTexImage();
     private native int nativeDetachFromGLContext();
     private native int nativeAttachToGLContext(int texName);
-    private native int nativeGetQueuedCount();
     private native void nativeRelease();
     private native boolean nativeIsReleased();
 }
diff --git a/graphics/java/android/graphics/Typeface.java b/graphics/java/android/graphics/Typeface.java
index ba62a08..ad6ea2b 100644
--- a/graphics/java/android/graphics/Typeface.java
+++ b/graphics/java/android/graphics/Typeface.java
@@ -30,7 +30,6 @@
 import android.content.res.AssetManager;
 import android.graphics.FontListParser;
 import android.graphics.fonts.FontVariationAxis;
-import android.graphics.fonts.FontVariationAxis.InvalidFormatException;
 import android.net.Uri;
 import android.os.Bundle;
 import android.os.Handler;
@@ -432,11 +431,10 @@
          * Sets a font variation settings.
          *
          * @param variationSettings See {@link android.widget.TextView#setFontVariationSettings}.
-         * @throws InvalidFormatException If given string is not a valid font variation settings
-         *                                format.
+         * @throws IllegalArgumentException If given string is not a valid font variation settings
+         *                                  format.
          */
-        public Builder setFontVariationSettings(@Nullable String variationSettings)
-                throws InvalidFormatException {
+        public Builder setFontVariationSettings(@Nullable String variationSettings) {
             if (mFonts != null) {
                 throw new IllegalArgumentException(
                         "Font variation settings can not be specified for FontResult source.");
diff --git a/graphics/java/android/graphics/fonts/FontVariationAxis.java b/graphics/java/android/graphics/fonts/FontVariationAxis.java
index fb2a3a8..99564fa 100644
--- a/graphics/java/android/graphics/fonts/FontVariationAxis.java
+++ b/graphics/java/android/graphics/fonts/FontVariationAxis.java
@@ -37,12 +37,11 @@
      * The axis tag must contain four ASCII characters. Tag string that are longer or shorter than
      * four characters, or contains characters outside of U+0020..U+007E are invalid.
      *
-     * @throws {@link InvalidFormatException} If given tag string is invalid.
+     * @throws IllegalArgumentException If given tag string is invalid.
      */
-    public FontVariationAxis(@NonNull String tagString, float styleValue)
-            throws InvalidFormatException {
+    public FontVariationAxis(@NonNull String tagString, float styleValue) {
         if (!isValidTag(tagString)) {
-            throw new InvalidFormatException("Invalid tag pattern: " + tagString);
+            throw new IllegalArgumentException("Illegal tag pattern: " + tagString);
         }
         mTag = makeTag(tagString);
         mTagString = tagString;
@@ -113,15 +112,6 @@
     }
 
     /**
-     * An exception indicates that the format of font variation settings is invalid.
-     */
-    public static class InvalidFormatException extends Exception {
-        public InvalidFormatException(String message) {
-            super(message);
-        }
-    };
-
-    /**
      * Construct FontVariationAxis array from font variation settings.
      *
      * The settings string is constructed from multiple pairs of axis tag and style values. The axis
@@ -138,10 +128,11 @@
      * @param settings font variation settings.
      * @return FontVariationAxis[] the array of parsed font variation axis. {@code null} if settings
      *                             has no font variation settings.
-     * @throws InvalidFormatException If given string is not a valid font variation settings format.
+     * @throws IllegalArgumentException If given string is not a valid font variation settings
+     *                                  format.
      */
-    public static @Nullable FontVariationAxis[] fromFontVariationSettings(@Nullable String settings)
-            throws InvalidFormatException {
+    public static @Nullable FontVariationAxis[] fromFontVariationSettings(
+            @Nullable String settings) {
         if (settings == null || settings.isEmpty()) {
             return null;
         }
@@ -153,7 +144,7 @@
                 continue;
             }
             if (!(c == '\'' || c == '"') || length < i + 6 || settings.charAt(i + 5) != c) {
-                throw new InvalidFormatException(
+                throw new IllegalArgumentException(
                         "Tag should be wrapped with double or single quote: " + settings);
             }
             final String tagString = settings.substring(i + 1, i + 5);
@@ -168,7 +159,8 @@
                 // Float.parseFloat ignores leading/trailing whitespaces.
                 value = Float.parseFloat(settings.substring(i, endOfValueString));
             } catch (NumberFormatException e) {
-                throw new InvalidFormatException("Failed to parse float string: " + e.getMessage());
+                throw new IllegalArgumentException(
+                        "Failed to parse float string: " + e.getMessage());
             }
             axisList.add(new FontVariationAxis(tagString, value));
             i = endOfValueString;
diff --git a/libs/androidfw/ResourceTypes.cpp b/libs/androidfw/ResourceTypes.cpp
index 09840a5..f661f29b 100644
--- a/libs/androidfw/ResourceTypes.cpp
+++ b/libs/androidfw/ResourceTypes.cpp
@@ -6664,6 +6664,10 @@
     return NO_ERROR;
 }
 
+void DynamicRefTable::addMapping(uint8_t buildPackageId, uint8_t runtimePackageId) {
+    mLookupTable[buildPackageId] = runtimePackageId;
+}
+
 status_t DynamicRefTable::lookupResourceId(uint32_t* resId) const {
     uint32_t res = *resId;
     size_t packageId = Res_GETPACKAGE(res) + 1;
diff --git a/libs/androidfw/include/androidfw/ResourceTypes.h b/libs/androidfw/include/androidfw/ResourceTypes.h
index 306ff9a..7a6e37d 100644
--- a/libs/androidfw/include/androidfw/ResourceTypes.h
+++ b/libs/androidfw/include/androidfw/ResourceTypes.h
@@ -1610,6 +1610,8 @@
     // the given package.
     status_t addMapping(const String16& packageName, uint8_t packageId);
 
+    void addMapping(uint8_t buildPackageId, uint8_t runtimePackageId);
+
     // Performs the actual conversion of build-time resource ID to run-time
     // resource ID.
     status_t lookupResourceId(uint32_t* resId) const;
diff --git a/libs/hwui/Android.mk b/libs/hwui/Android.mk
index fde0e47..5ef49dc 100644
--- a/libs/hwui/Android.mk
+++ b/libs/hwui/Android.mk
@@ -7,7 +7,7 @@
 # Enables fine-grained GLES error checking
 # If set to true, every GLES call is wrapped & error checked
 # Has moderate overhead
-HWUI_ENABLE_OPENGL_VALIDATION := true
+HWUI_ENABLE_OPENGL_VALIDATION := false
 
 hwui_src_files := \
     hwui/Bitmap.cpp \
diff --git a/libs/hwui/PathTessellator.cpp b/libs/hwui/PathTessellator.cpp
index 9246237..64b2c45 100644
--- a/libs/hwui/PathTessellator.cpp
+++ b/libs/hwui/PathTessellator.cpp
@@ -1005,6 +1005,14 @@
                 break;
             }
             default:
+                static_assert(SkPath::kMove_Verb == 0
+                                && SkPath::kLine_Verb == 1
+                                && SkPath::kQuad_Verb == 2
+                                && SkPath::kConic_Verb == 3
+                                && SkPath::kCubic_Verb == 4
+                                && SkPath::kClose_Verb == 5
+                                && SkPath::kDone_Verb == 6,
+                        "Path enum changed, new types may have been added");
                 break;
             }
     }
diff --git a/libs/hwui/tests/common/TestUtils.h b/libs/hwui/tests/common/TestUtils.h
index 0c7bb60..dd45786 100644
--- a/libs/hwui/tests/common/TestUtils.h
+++ b/libs/hwui/tests/common/TestUtils.h
@@ -88,7 +88,8 @@
     }; \
     INNER_PIPELINE_RENDERTHREAD_TEST(test_case_name, test_name, OpenGL); \
     INNER_PIPELINE_RENDERTHREAD_TEST(test_case_name, test_name, SkiaGL); \
-    INNER_PIPELINE_RENDERTHREAD_TEST(test_case_name, test_name, SkiaVulkan); \
+    /* Temporarily disabling Vulkan until we can figure out a way to stub out the driver */ \
+    /* INNER_PIPELINE_RENDERTHREAD_TEST(test_case_name, test_name, SkiaVulkan); */ \
     void test_case_name##_##test_name##_RenderThreadTest::doTheThing(renderthread::RenderThread& renderThread)
 
 /**
@@ -111,7 +112,8 @@
         static void doTheThing(renderthread::RenderThread& renderThread); \
     }; \
     INNER_PIPELINE_RENDERTHREAD_TEST(test_case_name, test_name, SkiaGL); \
-    INNER_PIPELINE_RENDERTHREAD_TEST(test_case_name, test_name, SkiaVulkan); \
+    /* Temporarily disabling Vulkan until we can figure out a way to stub out the driver */ \
+    /* INNER_PIPELINE_RENDERTHREAD_TEST(test_case_name, test_name, SkiaVulkan); */ \
     void test_case_name##_##test_name##_RenderThreadTest::doTheThing(renderthread::RenderThread& renderThread)
 
 /**
diff --git a/media/java/android/media/ImageReader.java b/media/java/android/media/ImageReader.java
index 06555c1..ccdf5ae 100644
--- a/media/java/android/media/ImageReader.java
+++ b/media/java/android/media/ImageReader.java
@@ -728,15 +728,15 @@
 
         if (format == ImageFormat.PRIVATE) {
             // Usage need to be either USAGE0_GPU_SAMPLED_IMAGE or USAGE0_VIDEO_ENCODE or combined.
-            boolean isAllowed = (usage == HardwareBuffer.USAGE0_GPU_SAMPLED_IMAGE);
-            isAllowed = isAllowed || (usage == HardwareBuffer.USAGE0_VIDEO_ENCODE);
+            boolean isAllowed = (usage == HardwareBuffer.USAGE_GPU_SAMPLED_IMAGE);
+            isAllowed = isAllowed || (usage == HardwareBuffer.USAGE_VIDEO_ENCODE);
             isAllowed = isAllowed || (usage ==
-                    (HardwareBuffer.USAGE0_VIDEO_ENCODE | HardwareBuffer.USAGE0_GPU_SAMPLED_IMAGE));
+                    (HardwareBuffer.USAGE_VIDEO_ENCODE | HardwareBuffer.USAGE_GPU_SAMPLED_IMAGE));
             return isAllowed;
         } else {
             // Usage need to make the buffer CPU readable for explicit format.
-            return ((usage == HardwareBuffer.USAGE0_CPU_READ) ||
-                    (usage == HardwareBuffer.USAGE0_CPU_READ_OFTEN));
+            return ((usage == HardwareBuffer.USAGE_CPU_READ_RARELY) ||
+                    (usage == HardwareBuffer.USAGE_CPU_READ_OFTEN));
         }
     }
 
diff --git a/packages/CarrierDefaultApp/AndroidManifest.xml b/packages/CarrierDefaultApp/AndroidManifest.xml
index e450283..2ef1cf5 100644
--- a/packages/CarrierDefaultApp/AndroidManifest.xml
+++ b/packages/CarrierDefaultApp/AndroidManifest.xml
@@ -33,6 +33,7 @@
         <receiver android:name="com.android.carrierdefaultapp.CarrierDefaultBroadcastReceiver">
             <intent-filter>
                 <action android:name="com.android.internal.telephony.CARRIER_SIGNAL_REDIRECTED" />
+                <action android:name="com.android.internal.telephony.CARRIER_SIGNAL_RESET" />
             </intent-filter>
         </receiver>
         <service android:name="com.android.carrierdefaultapp.ProvisionObserver"
diff --git a/packages/CarrierDefaultApp/src/com/android/carrierdefaultapp/CustomConfigLoader.java b/packages/CarrierDefaultApp/src/com/android/carrierdefaultapp/CustomConfigLoader.java
index e1125d9..d5d0b79 100644
--- a/packages/CarrierDefaultApp/src/com/android/carrierdefaultapp/CustomConfigLoader.java
+++ b/packages/CarrierDefaultApp/src/com/android/carrierdefaultapp/CustomConfigLoader.java
@@ -91,6 +91,10 @@
                     arg1 = intent.getStringExtra(TelephonyIntents.EXTRA_APN_TYPE_KEY);
                     arg2 = intent.getStringExtra(TelephonyIntents.EXTRA_ERROR_CODE_KEY);
                     break;
+                case TelephonyIntents.ACTION_CARRIER_SIGNAL_RESET:
+                    configs = b.getStringArray(CarrierConfigManager
+                            .KEY_CARRIER_DEFAULT_ACTIONS_ON_RESET);
+                    break;
                 default:
                     Rlog.e(TAG, "load carrier config failure with un-configured key: " +
                             intent.getAction());
diff --git a/packages/CompanionDeviceManager/src/com/android/companiondevicemanager/DeviceDiscoveryService.java b/packages/CompanionDeviceManager/src/com/android/companiondevicemanager/DeviceDiscoveryService.java
index 11c858f..2a4ab0f 100644
--- a/packages/CompanionDeviceManager/src/com/android/companiondevicemanager/DeviceDiscoveryService.java
+++ b/packages/CompanionDeviceManager/src/com/android/companiondevicemanager/DeviceDiscoveryService.java
@@ -35,7 +35,7 @@
 import android.bluetooth.le.ScanSettings;
 import android.companion.AssociationRequest;
 import android.companion.BluetoothDeviceFilter;
-import android.companion.BluetoothLEDeviceFilter;
+import android.companion.BluetoothLeDeviceFilter;
 import android.companion.DeviceFilter;
 import android.companion.ICompanionDeviceDiscoveryService;
 import android.companion.ICompanionDeviceDiscoveryServiceCallback;
@@ -79,7 +79,7 @@
     private ScanSettings mDefaultScanSettings = new ScanSettings.Builder().build();
 
     private List<DeviceFilter<?>> mFilters;
-    private List<BluetoothLEDeviceFilter> mBLEFilters;
+    private List<BluetoothLeDeviceFilter> mBLEFilters;
     private List<BluetoothDeviceFilter> mBluetoothFilters;
     private List<WifiDeviceFilter> mWifiFilters;
     private List<ScanFilter> mBLEScanFilters;
@@ -144,8 +144,8 @@
             mFilters = request.getDeviceFilters();
             mWifiFilters = CollectionUtils.filter(mFilters, WifiDeviceFilter.class);
             mBluetoothFilters = CollectionUtils.filter(mFilters, BluetoothDeviceFilter.class);
-            mBLEFilters = CollectionUtils.filter(mFilters, BluetoothLEDeviceFilter.class);
-            mBLEScanFilters = CollectionUtils.map(mBLEFilters, BluetoothLEDeviceFilter::getScanFilter);
+            mBLEFilters = CollectionUtils.filter(mFilters, BluetoothLeDeviceFilter.class);
+            mBLEScanFilters = CollectionUtils.map(mBLEFilters, BluetoothLeDeviceFilter::getScanFilter);
 
             reset();
         } else if (DEBUG) Log.i(LOG_TAG, "startDiscovery: duplicate request: " + request);
diff --git a/packages/SettingsLib/res/values-af/strings.xml b/packages/SettingsLib/res/values-af/strings.xml
index f45c2c1..e89b21a 100644
--- a/packages/SettingsLib/res/values-af/strings.xml
+++ b/packages/SettingsLib/res/values-af/strings.xml
@@ -56,10 +56,8 @@
     <string name="bluetooth_profile_pan_nap" msgid="8429049285027482959">"Deling van internetverbinding"</string>
     <string name="bluetooth_profile_map" msgid="5465271250454324383">"Boodskaptoegang"</string>
     <string name="bluetooth_profile_sap" msgid="5764222021851283125">"SIM-toegang"</string>
-    <!-- no translation found for bluetooth_profile_a2dp_high_quality (2221025895896419505) -->
-    <skip />
-    <!-- no translation found for bluetooth_profile_a2dp_high_quality_unknown_codec (5860996587596508755) -->
-    <skip />
+    <string name="bluetooth_profile_a2dp_high_quality" msgid="2221025895896419505">"Gebruik hoëgehalte-oudio: <xliff:g id="CODEC_NAME">%1$s</xliff:g>"</string>
+    <string name="bluetooth_profile_a2dp_high_quality_unknown_codec" msgid="5860996587596508755">"Gebruik hoëgehalte-oudio"</string>
     <string name="bluetooth_a2dp_profile_summary_connected" msgid="963376081347721598">"Gekoppel aan media-oudio"</string>
     <string name="bluetooth_headset_profile_summary_connected" msgid="7661070206715520671">"Gekoppel aan foonoudio"</string>
     <string name="bluetooth_opp_profile_summary_connected" msgid="2611913495968309066">"Gekoppel aan lêeroordragbediener"</string>
diff --git a/packages/SettingsLib/res/values-am/strings.xml b/packages/SettingsLib/res/values-am/strings.xml
index c4e66aa..d8150d1 100644
--- a/packages/SettingsLib/res/values-am/strings.xml
+++ b/packages/SettingsLib/res/values-am/strings.xml
@@ -56,10 +56,8 @@
     <string name="bluetooth_profile_pan_nap" msgid="8429049285027482959">"የበይነ መረብ ተያያዥ ማጋሪያ"</string>
     <string name="bluetooth_profile_map" msgid="5465271250454324383">"የመልዕክት መዳረሻ"</string>
     <string name="bluetooth_profile_sap" msgid="5764222021851283125">"የሲም መዳረሻ"</string>
-    <!-- no translation found for bluetooth_profile_a2dp_high_quality (2221025895896419505) -->
-    <skip />
-    <!-- no translation found for bluetooth_profile_a2dp_high_quality_unknown_codec (5860996587596508755) -->
-    <skip />
+    <string name="bluetooth_profile_a2dp_high_quality" msgid="2221025895896419505">"ከፍተኛ ጥራት ያለውን ኦዲዮ ተጠቀም፦ <xliff:g id="CODEC_NAME">%1$s</xliff:g>"</string>
+    <string name="bluetooth_profile_a2dp_high_quality_unknown_codec" msgid="5860996587596508755">"ከፍተኛ ጥራት ያለውን ኦዲዮ ተጠቀም"</string>
     <string name="bluetooth_a2dp_profile_summary_connected" msgid="963376081347721598">"ወደ ማህደረ  መረጃ  አውዲዮ ተያይዟል"</string>
     <string name="bluetooth_headset_profile_summary_connected" msgid="7661070206715520671">"ወደ ስልክ አውዲዮ ተያይዟል"</string>
     <string name="bluetooth_opp_profile_summary_connected" msgid="2611913495968309066">"ወደ ፋይል ዝውውር አገልጋይ ተያይዟል"</string>
diff --git a/packages/SettingsLib/res/values-ar/strings.xml b/packages/SettingsLib/res/values-ar/strings.xml
index 266b883..034653f 100644
--- a/packages/SettingsLib/res/values-ar/strings.xml
+++ b/packages/SettingsLib/res/values-ar/strings.xml
@@ -56,10 +56,8 @@
     <string name="bluetooth_profile_pan_nap" msgid="8429049285027482959">"مشاركة اتصال الإنترنت"</string>
     <string name="bluetooth_profile_map" msgid="5465271250454324383">"الدخول إلى الرسائل"</string>
     <string name="bluetooth_profile_sap" msgid="5764222021851283125">"‏الوصول إلى شريحة SIM"</string>
-    <!-- no translation found for bluetooth_profile_a2dp_high_quality (2221025895896419505) -->
-    <skip />
-    <!-- no translation found for bluetooth_profile_a2dp_high_quality_unknown_codec (5860996587596508755) -->
-    <skip />
+    <string name="bluetooth_profile_a2dp_high_quality" msgid="2221025895896419505">"استخدام صوت عالي الجودة: <xliff:g id="CODEC_NAME">%1$s</xliff:g>"</string>
+    <string name="bluetooth_profile_a2dp_high_quality_unknown_codec" msgid="5860996587596508755">"استخدام صوت عالي الجودة"</string>
     <string name="bluetooth_a2dp_profile_summary_connected" msgid="963376081347721598">"متصل بالإعدادات الصوتية للوسائط"</string>
     <string name="bluetooth_headset_profile_summary_connected" msgid="7661070206715520671">"متصل بالإعدادات الصوتية للهاتف"</string>
     <string name="bluetooth_opp_profile_summary_connected" msgid="2611913495968309066">"متصل بخادم نقل الملف"</string>
@@ -329,7 +327,7 @@
     <string name="power_charging_duration" msgid="4676999980973411875">"<xliff:g id="LEVEL">%1$s</xliff:g> - <xliff:g id="TIME">%2$s</xliff:g> حتى يكتمل الشحن"</string>
     <string name="power_charging_duration_short" msgid="1098603958472207920">"<xliff:g id="LEVEL">%1$s</xliff:g> - <xliff:g id="TIME">%2$s</xliff:g>"</string>
     <string name="battery_info_status_unknown" msgid="196130600938058547">"غير معروف"</string>
-    <string name="battery_info_status_charging" msgid="1705179948350365604">"شحن"</string>
+    <string name="battery_info_status_charging" msgid="1705179948350365604">"جاري الشحن"</string>
     <string name="battery_info_status_charging_lower" msgid="8689770213898117994">"جارٍ الشحن"</string>
     <string name="battery_info_status_discharging" msgid="310932812698268588">"لا يتم الشحن"</string>
     <string name="battery_info_status_not_charging" msgid="2820070506621483576">"لا يتم الشحن"</string>
diff --git a/packages/SettingsLib/res/values-az/strings.xml b/packages/SettingsLib/res/values-az/strings.xml
index 85e7875..603f6918 100644
--- a/packages/SettingsLib/res/values-az/strings.xml
+++ b/packages/SettingsLib/res/values-az/strings.xml
@@ -56,10 +56,8 @@
     <string name="bluetooth_profile_pan_nap" msgid="8429049285027482959">"internet bağlantı paylaşımı"</string>
     <string name="bluetooth_profile_map" msgid="5465271250454324383">"Mesaj Girişi"</string>
     <string name="bluetooth_profile_sap" msgid="5764222021851283125">"SIM Girişi"</string>
-    <!-- no translation found for bluetooth_profile_a2dp_high_quality (2221025895896419505) -->
-    <skip />
-    <!-- no translation found for bluetooth_profile_a2dp_high_quality_unknown_codec (5860996587596508755) -->
-    <skip />
+    <string name="bluetooth_profile_a2dp_high_quality" msgid="2221025895896419505">"Yüksək keyfiyyətli audio istifadə edin: <xliff:g id="CODEC_NAME">%1$s</xliff:g>"</string>
+    <string name="bluetooth_profile_a2dp_high_quality_unknown_codec" msgid="5860996587596508755">"Yüksək keyfiyyətli audio istifadə edin"</string>
     <string name="bluetooth_a2dp_profile_summary_connected" msgid="963376081347721598">"Media audioya birləşdirilib"</string>
     <string name="bluetooth_headset_profile_summary_connected" msgid="7661070206715520671">"Telefon audiosuna qoşulu"</string>
     <string name="bluetooth_opp_profile_summary_connected" msgid="2611913495968309066">"Fayl transfer serverinə qoşulu"</string>
diff --git a/packages/SettingsLib/res/values-b+sr+Latn/strings.xml b/packages/SettingsLib/res/values-b+sr+Latn/strings.xml
index 802d852..35473b3 100644
--- a/packages/SettingsLib/res/values-b+sr+Latn/strings.xml
+++ b/packages/SettingsLib/res/values-b+sr+Latn/strings.xml
@@ -56,10 +56,8 @@
     <string name="bluetooth_profile_pan_nap" msgid="8429049285027482959">"Deljenje internet veze"</string>
     <string name="bluetooth_profile_map" msgid="5465271250454324383">"Pristup porukama"</string>
     <string name="bluetooth_profile_sap" msgid="5764222021851283125">"Pristup SIM kartici"</string>
-    <!-- no translation found for bluetooth_profile_a2dp_high_quality (2221025895896419505) -->
-    <skip />
-    <!-- no translation found for bluetooth_profile_a2dp_high_quality_unknown_codec (5860996587596508755) -->
-    <skip />
+    <string name="bluetooth_profile_a2dp_high_quality" msgid="2221025895896419505">"Koristi zvuk visokog kvaliteta: <xliff:g id="CODEC_NAME">%1$s</xliff:g>"</string>
+    <string name="bluetooth_profile_a2dp_high_quality_unknown_codec" msgid="5860996587596508755">"Koristi zvuk visokog kvaliteta"</string>
     <string name="bluetooth_a2dp_profile_summary_connected" msgid="963376081347721598">"Povezano sa zvukom medija"</string>
     <string name="bluetooth_headset_profile_summary_connected" msgid="7661070206715520671">"Povezano sa zvukom telefona"</string>
     <string name="bluetooth_opp_profile_summary_connected" msgid="2611913495968309066">"Povezano sa serverom za prenos datoteka"</string>
diff --git a/packages/SettingsLib/res/values-be/strings.xml b/packages/SettingsLib/res/values-be/strings.xml
index 421f0b3..61388c0 100644
--- a/packages/SettingsLib/res/values-be/strings.xml
+++ b/packages/SettingsLib/res/values-be/strings.xml
@@ -56,10 +56,8 @@
     <string name="bluetooth_profile_pan_nap" msgid="8429049285027482959">"Прадастаўленне доступу да Інтэрнэту"</string>
     <string name="bluetooth_profile_map" msgid="5465271250454324383">"Доступ да паведамленняў"</string>
     <string name="bluetooth_profile_sap" msgid="5764222021851283125">"Доступ да SIM-карты"</string>
-    <!-- no translation found for bluetooth_profile_a2dp_high_quality (2221025895896419505) -->
-    <skip />
-    <!-- no translation found for bluetooth_profile_a2dp_high_quality_unknown_codec (5860996587596508755) -->
-    <skip />
+    <string name="bluetooth_profile_a2dp_high_quality" msgid="2221025895896419505">"Выбраць аўдыя высокай якасці: <xliff:g id="CODEC_NAME">%1$s</xliff:g>"</string>
+    <string name="bluetooth_profile_a2dp_high_quality_unknown_codec" msgid="5860996587596508755">"Выбраць аўдыя высокай якасці"</string>
     <string name="bluetooth_a2dp_profile_summary_connected" msgid="963376081347721598">"Падключана да аўдыё медыа"</string>
     <string name="bluetooth_headset_profile_summary_connected" msgid="7661070206715520671">"Падключана да аўдыё тэлефона"</string>
     <string name="bluetooth_opp_profile_summary_connected" msgid="2611913495968309066">"Падключаны да серверу перадачы файлаў"</string>
@@ -349,7 +347,7 @@
     <string name="screen_zoom_summary_default" msgid="2247006805614056507">"Стандартны"</string>
     <string name="screen_zoom_summary_large" msgid="4835294730065424084">"Вялікі"</string>
     <string name="screen_zoom_summary_very_large" msgid="7108563375663670067">"Большы"</string>
-    <string name="screen_zoom_summary_extremely_large" msgid="7427320168263276227">"Найвялікшы"</string>
+    <string name="screen_zoom_summary_extremely_large" msgid="7427320168263276227">"Самы вялікі"</string>
     <string name="screen_zoom_summary_custom" msgid="5611979864124160447">"Карыстальніцкі (<xliff:g id="DENSITYDPI">%d</xliff:g>)"</string>
     <string name="help_feedback_label" msgid="6815040660801785649">"Даведка і водгукі"</string>
     <string name="content_description_menu_button" msgid="8182594799812351266">"Меню"</string>
diff --git a/packages/SettingsLib/res/values-bg/strings.xml b/packages/SettingsLib/res/values-bg/strings.xml
index 1893393..aeea676 100644
--- a/packages/SettingsLib/res/values-bg/strings.xml
+++ b/packages/SettingsLib/res/values-bg/strings.xml
@@ -56,10 +56,8 @@
     <string name="bluetooth_profile_pan_nap" msgid="8429049285027482959">"Споделяне на връзката с интернет"</string>
     <string name="bluetooth_profile_map" msgid="5465271250454324383">"Достъп до съобщенията"</string>
     <string name="bluetooth_profile_sap" msgid="5764222021851283125">"Достъп до SIM картата"</string>
-    <!-- no translation found for bluetooth_profile_a2dp_high_quality (2221025895896419505) -->
-    <skip />
-    <!-- no translation found for bluetooth_profile_a2dp_high_quality_unknown_codec (5860996587596508755) -->
-    <skip />
+    <string name="bluetooth_profile_a2dp_high_quality" msgid="2221025895896419505">"Използване на висококачествен звук: <xliff:g id="CODEC_NAME">%1$s</xliff:g>"</string>
+    <string name="bluetooth_profile_a2dp_high_quality_unknown_codec" msgid="5860996587596508755">"Използване на висококачествен звук"</string>
     <string name="bluetooth_a2dp_profile_summary_connected" msgid="963376081347721598">"Установена е връзка с медийно аудио"</string>
     <string name="bluetooth_headset_profile_summary_connected" msgid="7661070206715520671">"Връзка със звука на телефона"</string>
     <string name="bluetooth_opp_profile_summary_connected" msgid="2611913495968309066">"Установена е връзка със сървър за трансфер на файлове"</string>
diff --git a/packages/SettingsLib/res/values-bn/strings.xml b/packages/SettingsLib/res/values-bn/strings.xml
index b5fa686..21b4fbc 100644
--- a/packages/SettingsLib/res/values-bn/strings.xml
+++ b/packages/SettingsLib/res/values-bn/strings.xml
@@ -26,7 +26,7 @@
     <string name="wifi_disabled_generic" msgid="4259794910584943386">"অক্ষম হয়েছে"</string>
     <string name="wifi_disabled_network_failure" msgid="2364951338436007124">"IP কনফিগারেশনের ব্যর্থতা"</string>
     <string name="wifi_disabled_by_recommendation_provider" msgid="5168315140978066096">"খারাপ নেটওয়ার্কের কারণে সংযুক্ত নয়"</string>
-    <string name="wifi_disabled_wifi_failure" msgid="3081668066612876581">"WiFi সংযোগের ব্যর্থতা"</string>
+    <string name="wifi_disabled_wifi_failure" msgid="3081668066612876581">"ওয়াই ফাই সংযোগের ব্যর্থতা"</string>
     <string name="wifi_disabled_password_failure" msgid="8659805351763133575">"প্রমাণীকরণ সমস্যা"</string>
     <string name="wifi_not_in_range" msgid="1136191511238508967">"পরিসরের মধ্যে নয়"</string>
     <string name="wifi_no_internet_no_reconnect" msgid="5724903347310541706">"স্বয়ংক্রিয়ভাবে সংযোগ করবে না"</string>
@@ -56,10 +56,8 @@
     <string name="bluetooth_profile_pan_nap" msgid="8429049285027482959">"ইন্টারনেট সংযোগ শেয়ার করা হচ্ছে"</string>
     <string name="bluetooth_profile_map" msgid="5465271250454324383">"বার্তা অ্যাক্সেস"</string>
     <string name="bluetooth_profile_sap" msgid="5764222021851283125">"সিম -এর অ্যাক্সেস"</string>
-    <!-- no translation found for bluetooth_profile_a2dp_high_quality (2221025895896419505) -->
-    <skip />
-    <!-- no translation found for bluetooth_profile_a2dp_high_quality_unknown_codec (5860996587596508755) -->
-    <skip />
+    <string name="bluetooth_profile_a2dp_high_quality" msgid="2221025895896419505">"উচ্চ মানের অডিও ব্যবহার করুন: <xliff:g id="CODEC_NAME">%1$s</xliff:g>"</string>
+    <string name="bluetooth_profile_a2dp_high_quality_unknown_codec" msgid="5860996587596508755">"উচ্চ মানের অডিও ব্যবহার করুন"</string>
     <string name="bluetooth_a2dp_profile_summary_connected" msgid="963376081347721598">"মিডিয়া অডিওতে সংযুক্ত রয়েছে"</string>
     <string name="bluetooth_headset_profile_summary_connected" msgid="7661070206715520671">"ফোন অডিওতে সংযুক্ত"</string>
     <string name="bluetooth_opp_profile_summary_connected" msgid="2611913495968309066">"ফাইল স্থানান্তর সার্ভারের সঙ্গে সংযুক্ত"</string>
@@ -106,7 +104,7 @@
     <string name="launch_defaults_none" msgid="4241129108140034876">"কোনো ডিফল্ট সেট করা নেই"</string>
     <string name="tts_settings" msgid="8186971894801348327">"পাঠ্য থেকে ভাষ্য আউটপুট সেটিংস"</string>
     <string name="tts_settings_title" msgid="1237820681016639683">"লেখিত-থেকে-ভাষ্য"</string>
-    <string name="tts_default_rate_title" msgid="6030550998379310088">"ভাষ্য হার"</string>
+    <string name="tts_default_rate_title" msgid="6030550998379310088">"কথা বলার হার"</string>
     <string name="tts_default_rate_summary" msgid="4061815292287182801">"যে গতিতে পাঠ্য উচ্চারিত হয়"</string>
     <string name="tts_default_pitch_title" msgid="6135942113172488671">"পিচ"</string>
     <string name="tts_default_pitch_summary" msgid="1944885882882650009">"সিন্থেসাইজ করা ভাষ্যের স্বরকে প্রভাবিত করে"</string>
diff --git a/packages/SettingsLib/res/values-bs/strings.xml b/packages/SettingsLib/res/values-bs/strings.xml
index 3515347..886d635 100644
--- a/packages/SettingsLib/res/values-bs/strings.xml
+++ b/packages/SettingsLib/res/values-bs/strings.xml
@@ -56,10 +56,8 @@
     <string name="bluetooth_profile_pan_nap" msgid="8429049285027482959">"Dijeljenje internet veze"</string>
     <string name="bluetooth_profile_map" msgid="5465271250454324383">"Pristup poruci"</string>
     <string name="bluetooth_profile_sap" msgid="5764222021851283125">"Pristup SIM-u"</string>
-    <!-- no translation found for bluetooth_profile_a2dp_high_quality (2221025895896419505) -->
-    <skip />
-    <!-- no translation found for bluetooth_profile_a2dp_high_quality_unknown_codec (5860996587596508755) -->
-    <skip />
+    <string name="bluetooth_profile_a2dp_high_quality" msgid="2221025895896419505">"Koristi visokokvalitetan zvuk: <xliff:g id="CODEC_NAME">%1$s</xliff:g>"</string>
+    <string name="bluetooth_profile_a2dp_high_quality_unknown_codec" msgid="5860996587596508755">"Koristi visokokvalitetan zvuk"</string>
     <string name="bluetooth_a2dp_profile_summary_connected" msgid="963376081347721598">"Povezano sa zvukom medija"</string>
     <string name="bluetooth_headset_profile_summary_connected" msgid="7661070206715520671">"Povezano na zvuk telefona"</string>
     <string name="bluetooth_opp_profile_summary_connected" msgid="2611913495968309066">"Povezan na server za prijenos podataka"</string>
@@ -97,7 +95,7 @@
     <string name="tether_settings_title_wifi" msgid="3277144155960302049">"Prijenosna pristupna tačka"</string>
     <string name="tether_settings_title_bluetooth" msgid="355855408317564420">"Dijeljenje Bluetooth veze"</string>
     <string name="tether_settings_title_usb_bluetooth" msgid="5355828977109785001">"Dijeljenje veze"</string>
-    <string name="tether_settings_title_all" msgid="8356136101061143841">"Dijeljenje internetske veze i prijenosna pristupna tačka"</string>
+    <string name="tether_settings_title_all" msgid="8356136101061143841">"Povezivanje putem mobitela i prijenosna pristupna tačka"</string>
     <string name="managed_user_title" msgid="8109605045406748842">"Sve radne aplikacije"</string>
     <string name="user_guest" msgid="8475274842845401871">"Gost"</string>
     <string name="unknown" msgid="1592123443519355854">"Nepoznato"</string>
@@ -129,7 +127,7 @@
     <string name="tts_engine_settings_title" msgid="3499112142425680334">"Postavke za <xliff:g id="TTS_ENGINE_NAME">%s</xliff:g>"</string>
     <string name="tts_engine_settings_button" msgid="1030512042040722285">"Pokreni postavke programa"</string>
     <string name="tts_engine_preference_section_title" msgid="448294500990971413">"Željeni program"</string>
-    <string name="tts_general_section_title" msgid="4402572014604490502">"Opće"</string>
+    <string name="tts_general_section_title" msgid="4402572014604490502">"Opće postavke"</string>
     <string name="tts_reset_speech_pitch_title" msgid="5789394019544785915">"Postavite visinu glasa"</string>
     <string name="tts_reset_speech_pitch_summary" msgid="8700539616245004418">"Visinu glasa koji izgovara tekst postavite na podrazumjevanu."</string>
   <string-array name="tts_rate_entries">
@@ -318,7 +316,7 @@
     <string name="daltonizer_mode_protanomaly" msgid="8424148009038666065">"Protanomalija (crveno-zeleno)"</string>
     <string name="daltonizer_mode_tritanomaly" msgid="481725854987912389">"Tritanomalija (plavo-žuta)"</string>
     <string name="accessibility_display_daltonizer_preference_title" msgid="5800761362678707872">"Ispravka boje"</string>
-    <string name="accessibility_display_daltonizer_preference_subtitle" msgid="3484969015295282911">"Ova funkcija je eksperimentalna te može utjecati na performanse."</string>
+    <string name="accessibility_display_daltonizer_preference_subtitle" msgid="3484969015295282911">"Ova funkcija je eksperimentalna i može uticati na performanse."</string>
     <string name="daltonizer_type_overridden" msgid="3116947244410245916">"Zamjenjuje <xliff:g id="TITLE">%1$s</xliff:g>"</string>
     <string name="power_remaining_duration_only" msgid="845431008899029842">"Preostalo je otprilike još <xliff:g id="TIME">%1$s</xliff:g>"</string>
     <string name="power_remaining_charging_duration_only" msgid="1421102457410268886">"Do potpune napunjenosti preostalo je <xliff:g id="TIME">%1$s</xliff:g>"</string>
@@ -348,8 +346,8 @@
     <string name="screen_zoom_summary_small" msgid="5867245310241621570">"Malo"</string>
     <string name="screen_zoom_summary_default" msgid="2247006805614056507">"Zadano"</string>
     <string name="screen_zoom_summary_large" msgid="4835294730065424084">"Veliko"</string>
-    <string name="screen_zoom_summary_very_large" msgid="7108563375663670067">"Veće"</string>
-    <string name="screen_zoom_summary_extremely_large" msgid="7427320168263276227">"Najveće"</string>
+    <string name="screen_zoom_summary_very_large" msgid="7108563375663670067">"Vrlo veliko"</string>
+    <string name="screen_zoom_summary_extremely_large" msgid="7427320168263276227">"Najveći"</string>
     <string name="screen_zoom_summary_custom" msgid="5611979864124160447">"Prilagodi (<xliff:g id="DENSITYDPI">%d</xliff:g>)"</string>
     <string name="help_feedback_label" msgid="6815040660801785649">"Pomoć i povratne informacije"</string>
     <string name="content_description_menu_button" msgid="8182594799812351266">"Meni"</string>
diff --git a/packages/SettingsLib/res/values-ca/strings.xml b/packages/SettingsLib/res/values-ca/strings.xml
index 6252dcb..1c7ce0c 100644
--- a/packages/SettingsLib/res/values-ca/strings.xml
+++ b/packages/SettingsLib/res/values-ca/strings.xml
@@ -56,10 +56,8 @@
     <string name="bluetooth_profile_pan_nap" msgid="8429049285027482959">"Connexió compartida a Internet"</string>
     <string name="bluetooth_profile_map" msgid="5465271250454324383">"Accés al missatge"</string>
     <string name="bluetooth_profile_sap" msgid="5764222021851283125">"Accés a la SIM"</string>
-    <!-- no translation found for bluetooth_profile_a2dp_high_quality (2221025895896419505) -->
-    <skip />
-    <!-- no translation found for bluetooth_profile_a2dp_high_quality_unknown_codec (5860996587596508755) -->
-    <skip />
+    <string name="bluetooth_profile_a2dp_high_quality" msgid="2221025895896419505">"Utilitza àudio d\'alta qualitat: <xliff:g id="CODEC_NAME">%1$s</xliff:g>"</string>
+    <string name="bluetooth_profile_a2dp_high_quality_unknown_codec" msgid="5860996587596508755">"Utilitza àudio d\'alta qualitat"</string>
     <string name="bluetooth_a2dp_profile_summary_connected" msgid="963376081347721598">"Connectat a l\'àudio del mitjà"</string>
     <string name="bluetooth_headset_profile_summary_connected" msgid="7661070206715520671">"Connectat a àudio del telèfon"</string>
     <string name="bluetooth_opp_profile_summary_connected" msgid="2611913495968309066">"Connectat al servidor de transferència de fitxers"</string>
@@ -349,7 +347,7 @@
     <string name="screen_zoom_summary_default" msgid="2247006805614056507">"Predeterminat"</string>
     <string name="screen_zoom_summary_large" msgid="4835294730065424084">"Gran"</string>
     <string name="screen_zoom_summary_very_large" msgid="7108563375663670067">"Més gran"</string>
-    <string name="screen_zoom_summary_extremely_large" msgid="7427320168263276227">"Màxim"</string>
+    <string name="screen_zoom_summary_extremely_large" msgid="7427320168263276227">"Més grans possible"</string>
     <string name="screen_zoom_summary_custom" msgid="5611979864124160447">"Personalitzat (<xliff:g id="DENSITYDPI">%d</xliff:g>)"</string>
     <string name="help_feedback_label" msgid="6815040660801785649">"Ajuda i suggeriments"</string>
     <string name="content_description_menu_button" msgid="8182594799812351266">"Menú"</string>
diff --git a/packages/SettingsLib/res/values-cs/strings.xml b/packages/SettingsLib/res/values-cs/strings.xml
index 7d91dc1..673d51b 100644
--- a/packages/SettingsLib/res/values-cs/strings.xml
+++ b/packages/SettingsLib/res/values-cs/strings.xml
@@ -56,10 +56,8 @@
     <string name="bluetooth_profile_pan_nap" msgid="8429049285027482959">"Sdílení internetového připojení"</string>
     <string name="bluetooth_profile_map" msgid="5465271250454324383">"Přístup ke zprávám"</string>
     <string name="bluetooth_profile_sap" msgid="5764222021851283125">"Přístup k SIM kartě"</string>
-    <!-- no translation found for bluetooth_profile_a2dp_high_quality (2221025895896419505) -->
-    <skip />
-    <!-- no translation found for bluetooth_profile_a2dp_high_quality_unknown_codec (5860996587596508755) -->
-    <skip />
+    <string name="bluetooth_profile_a2dp_high_quality" msgid="2221025895896419505">"Použít vysokou kvalitu zvuku: <xliff:g id="CODEC_NAME">%1$s</xliff:g>"</string>
+    <string name="bluetooth_profile_a2dp_high_quality_unknown_codec" msgid="5860996587596508755">"Použít vysokou kvalitu zvuku"</string>
     <string name="bluetooth_a2dp_profile_summary_connected" msgid="963376081347721598">"Připojeno ke zvukovému médiu"</string>
     <string name="bluetooth_headset_profile_summary_connected" msgid="7661070206715520671">"Připojeno k náhlavní soupravě"</string>
     <string name="bluetooth_opp_profile_summary_connected" msgid="2611913495968309066">"Připojeno k serveru pro přenos dat"</string>
diff --git a/packages/SettingsLib/res/values-da/strings.xml b/packages/SettingsLib/res/values-da/strings.xml
index 986bc3e..0447c52 100644
--- a/packages/SettingsLib/res/values-da/strings.xml
+++ b/packages/SettingsLib/res/values-da/strings.xml
@@ -56,10 +56,8 @@
     <string name="bluetooth_profile_pan_nap" msgid="8429049285027482959">"Deling af internetforbindelse"</string>
     <string name="bluetooth_profile_map" msgid="5465271250454324383">"Adgang til meddelelse"</string>
     <string name="bluetooth_profile_sap" msgid="5764222021851283125">"SIM-adgang"</string>
-    <!-- no translation found for bluetooth_profile_a2dp_high_quality (2221025895896419505) -->
-    <skip />
-    <!-- no translation found for bluetooth_profile_a2dp_high_quality_unknown_codec (5860996587596508755) -->
-    <skip />
+    <string name="bluetooth_profile_a2dp_high_quality" msgid="2221025895896419505">"Brug lyd i høj kvalitet: <xliff:g id="CODEC_NAME">%1$s</xliff:g>"</string>
+    <string name="bluetooth_profile_a2dp_high_quality_unknown_codec" msgid="5860996587596508755">"Brug lyd i høj kvalitet"</string>
     <string name="bluetooth_a2dp_profile_summary_connected" msgid="963376081347721598">"Forbundet til medielyd"</string>
     <string name="bluetooth_headset_profile_summary_connected" msgid="7661070206715520671">"Forbundet til telefonlyd"</string>
     <string name="bluetooth_opp_profile_summary_connected" msgid="2611913495968309066">"Forbundet til filoverførselsserver"</string>
diff --git a/packages/SettingsLib/res/values-de/strings.xml b/packages/SettingsLib/res/values-de/strings.xml
index d8993fc..0a2cf33 100644
--- a/packages/SettingsLib/res/values-de/strings.xml
+++ b/packages/SettingsLib/res/values-de/strings.xml
@@ -56,10 +56,8 @@
     <string name="bluetooth_profile_pan_nap" msgid="8429049285027482959">"Freigabe der Internetverbindung"</string>
     <string name="bluetooth_profile_map" msgid="5465271250454324383">"Nachrichtenzugriff"</string>
     <string name="bluetooth_profile_sap" msgid="5764222021851283125">"Zugriff auf SIM"</string>
-    <!-- no translation found for bluetooth_profile_a2dp_high_quality (2221025895896419505) -->
-    <skip />
-    <!-- no translation found for bluetooth_profile_a2dp_high_quality_unknown_codec (5860996587596508755) -->
-    <skip />
+    <string name="bluetooth_profile_a2dp_high_quality" msgid="2221025895896419505">"Hohe Audioqualität verwenden: <xliff:g id="CODEC_NAME">%1$s</xliff:g>"</string>
+    <string name="bluetooth_profile_a2dp_high_quality_unknown_codec" msgid="5860996587596508755">"Hohe Audioqualität verwenden"</string>
     <string name="bluetooth_a2dp_profile_summary_connected" msgid="963376081347721598">"Verbunden mit  Audiosystem von Medien"</string>
     <string name="bluetooth_headset_profile_summary_connected" msgid="7661070206715520671">"Verbunden mit Audiosystem des Telefons"</string>
     <string name="bluetooth_opp_profile_summary_connected" msgid="2611913495968309066">"Mit Dateiübertragungsserver verbunden"</string>
@@ -318,7 +316,7 @@
     <string name="daltonizer_mode_protanomaly" msgid="8424148009038666065">"Protanomalie (Rot-Grün-Sehschwäche)"</string>
     <string name="daltonizer_mode_tritanomaly" msgid="481725854987912389">"Tritanomalie (Blau-Gelb-Sehschwäche)"</string>
     <string name="accessibility_display_daltonizer_preference_title" msgid="5800761362678707872">"Farbkorrektur"</string>
-    <string name="accessibility_display_daltonizer_preference_subtitle" msgid="3484969015295282911">"Hierbei handelt es sich um eine experimentelle Funktion. Dies kann sich auf die Leistung auswirken."</string>
+    <string name="accessibility_display_daltonizer_preference_subtitle" msgid="3484969015295282911">"Hierbei handelt es sich um eine experimentelle Funktion, die sich auf die Leistung auswirken kann."</string>
     <string name="daltonizer_type_overridden" msgid="3116947244410245916">"Außer Kraft gesetzt von \"<xliff:g id="TITLE">%1$s</xliff:g>\""</string>
     <string name="power_remaining_duration_only" msgid="845431008899029842">"Ca. <xliff:g id="TIME">%1$s</xliff:g> übrig"</string>
     <string name="power_remaining_charging_duration_only" msgid="1421102457410268886">"<xliff:g id="TIME">%1$s</xliff:g> bis zur vollständigen Aufladung"</string>
diff --git a/packages/SettingsLib/res/values-el/strings.xml b/packages/SettingsLib/res/values-el/strings.xml
index 307ced6..24d3bf4 100644
--- a/packages/SettingsLib/res/values-el/strings.xml
+++ b/packages/SettingsLib/res/values-el/strings.xml
@@ -56,10 +56,8 @@
     <string name="bluetooth_profile_pan_nap" msgid="8429049285027482959">"Κοινή χρήση σύνδεσης στο Διαδίκτυο"</string>
     <string name="bluetooth_profile_map" msgid="5465271250454324383">"Πρόσβαση στο μήνυμα"</string>
     <string name="bluetooth_profile_sap" msgid="5764222021851283125">"Πρόσβαση SIM"</string>
-    <!-- no translation found for bluetooth_profile_a2dp_high_quality (2221025895896419505) -->
-    <skip />
-    <!-- no translation found for bluetooth_profile_a2dp_high_quality_unknown_codec (5860996587596508755) -->
-    <skip />
+    <string name="bluetooth_profile_a2dp_high_quality" msgid="2221025895896419505">"Χρήση ήχου υψηλής ποιότητας: <xliff:g id="CODEC_NAME">%1$s</xliff:g>"</string>
+    <string name="bluetooth_profile_a2dp_high_quality_unknown_codec" msgid="5860996587596508755">"Χρήση ήχου υψηλής ποιότητας"</string>
     <string name="bluetooth_a2dp_profile_summary_connected" msgid="963376081347721598">"Συνδέθηκε σε ήχο πολυμέσων"</string>
     <string name="bluetooth_headset_profile_summary_connected" msgid="7661070206715520671">"Συνδεδεμένο στον ήχο τηλεφώνου"</string>
     <string name="bluetooth_opp_profile_summary_connected" msgid="2611913495968309066">"Συνδεδεμένο σε διακομιστή μεταφοράς αρχείων"</string>
@@ -105,7 +103,7 @@
     <string name="launch_defaults_some" msgid="313159469856372621">"Έχουν οριστεί κάποιες προεπιλογές"</string>
     <string name="launch_defaults_none" msgid="4241129108140034876">"Δεν έχουν οριστεί προεπιλογές"</string>
     <string name="tts_settings" msgid="8186971894801348327">"Ρυθμίσεις μετατροπής κειμένου σε ομιλία"</string>
-    <string name="tts_settings_title" msgid="1237820681016639683">"Έξοδος μετατροπής κειμένου σε ομιλία"</string>
+    <string name="tts_settings_title" msgid="1237820681016639683">"Μετατρ. κειμ. σε ομιλία"</string>
     <string name="tts_default_rate_title" msgid="6030550998379310088">"Ταχύτητα λόγου"</string>
     <string name="tts_default_rate_summary" msgid="4061815292287182801">"Ταχύτητα με την οποία εκφωνείται το κείμενο"</string>
     <string name="tts_default_pitch_title" msgid="6135942113172488671">"Τόνος"</string>
diff --git a/packages/SettingsLib/res/values-en-rAU/strings.xml b/packages/SettingsLib/res/values-en-rAU/strings.xml
index a35da4d..6b9daf7 100644
--- a/packages/SettingsLib/res/values-en-rAU/strings.xml
+++ b/packages/SettingsLib/res/values-en-rAU/strings.xml
@@ -56,10 +56,8 @@
     <string name="bluetooth_profile_pan_nap" msgid="8429049285027482959">"Internet connection sharing"</string>
     <string name="bluetooth_profile_map" msgid="5465271250454324383">"Message Access"</string>
     <string name="bluetooth_profile_sap" msgid="5764222021851283125">"SIM Access"</string>
-    <!-- no translation found for bluetooth_profile_a2dp_high_quality (2221025895896419505) -->
-    <skip />
-    <!-- no translation found for bluetooth_profile_a2dp_high_quality_unknown_codec (5860996587596508755) -->
-    <skip />
+    <string name="bluetooth_profile_a2dp_high_quality" msgid="2221025895896419505">"Use high-quality audio: <xliff:g id="CODEC_NAME">%1$s</xliff:g>"</string>
+    <string name="bluetooth_profile_a2dp_high_quality_unknown_codec" msgid="5860996587596508755">"Use high-quality audio"</string>
     <string name="bluetooth_a2dp_profile_summary_connected" msgid="963376081347721598">"Connected to media audio"</string>
     <string name="bluetooth_headset_profile_summary_connected" msgid="7661070206715520671">"Connected to phone audio"</string>
     <string name="bluetooth_opp_profile_summary_connected" msgid="2611913495968309066">"Connected to file-transfer server"</string>
diff --git a/packages/SettingsLib/res/values-en-rGB/strings.xml b/packages/SettingsLib/res/values-en-rGB/strings.xml
index a35da4d..6b9daf7 100644
--- a/packages/SettingsLib/res/values-en-rGB/strings.xml
+++ b/packages/SettingsLib/res/values-en-rGB/strings.xml
@@ -56,10 +56,8 @@
     <string name="bluetooth_profile_pan_nap" msgid="8429049285027482959">"Internet connection sharing"</string>
     <string name="bluetooth_profile_map" msgid="5465271250454324383">"Message Access"</string>
     <string name="bluetooth_profile_sap" msgid="5764222021851283125">"SIM Access"</string>
-    <!-- no translation found for bluetooth_profile_a2dp_high_quality (2221025895896419505) -->
-    <skip />
-    <!-- no translation found for bluetooth_profile_a2dp_high_quality_unknown_codec (5860996587596508755) -->
-    <skip />
+    <string name="bluetooth_profile_a2dp_high_quality" msgid="2221025895896419505">"Use high-quality audio: <xliff:g id="CODEC_NAME">%1$s</xliff:g>"</string>
+    <string name="bluetooth_profile_a2dp_high_quality_unknown_codec" msgid="5860996587596508755">"Use high-quality audio"</string>
     <string name="bluetooth_a2dp_profile_summary_connected" msgid="963376081347721598">"Connected to media audio"</string>
     <string name="bluetooth_headset_profile_summary_connected" msgid="7661070206715520671">"Connected to phone audio"</string>
     <string name="bluetooth_opp_profile_summary_connected" msgid="2611913495968309066">"Connected to file-transfer server"</string>
diff --git a/packages/SettingsLib/res/values-en-rIN/strings.xml b/packages/SettingsLib/res/values-en-rIN/strings.xml
index a35da4d..6b9daf7 100644
--- a/packages/SettingsLib/res/values-en-rIN/strings.xml
+++ b/packages/SettingsLib/res/values-en-rIN/strings.xml
@@ -56,10 +56,8 @@
     <string name="bluetooth_profile_pan_nap" msgid="8429049285027482959">"Internet connection sharing"</string>
     <string name="bluetooth_profile_map" msgid="5465271250454324383">"Message Access"</string>
     <string name="bluetooth_profile_sap" msgid="5764222021851283125">"SIM Access"</string>
-    <!-- no translation found for bluetooth_profile_a2dp_high_quality (2221025895896419505) -->
-    <skip />
-    <!-- no translation found for bluetooth_profile_a2dp_high_quality_unknown_codec (5860996587596508755) -->
-    <skip />
+    <string name="bluetooth_profile_a2dp_high_quality" msgid="2221025895896419505">"Use high-quality audio: <xliff:g id="CODEC_NAME">%1$s</xliff:g>"</string>
+    <string name="bluetooth_profile_a2dp_high_quality_unknown_codec" msgid="5860996587596508755">"Use high-quality audio"</string>
     <string name="bluetooth_a2dp_profile_summary_connected" msgid="963376081347721598">"Connected to media audio"</string>
     <string name="bluetooth_headset_profile_summary_connected" msgid="7661070206715520671">"Connected to phone audio"</string>
     <string name="bluetooth_opp_profile_summary_connected" msgid="2611913495968309066">"Connected to file-transfer server"</string>
diff --git a/packages/SettingsLib/res/values-es-rUS/strings.xml b/packages/SettingsLib/res/values-es-rUS/strings.xml
index fa092e2..1464d44 100644
--- a/packages/SettingsLib/res/values-es-rUS/strings.xml
+++ b/packages/SettingsLib/res/values-es-rUS/strings.xml
@@ -56,10 +56,8 @@
     <string name="bluetooth_profile_pan_nap" msgid="8429049285027482959">"Compartir conexión a Internet"</string>
     <string name="bluetooth_profile_map" msgid="5465271250454324383">"Acceso a mensajes"</string>
     <string name="bluetooth_profile_sap" msgid="5764222021851283125">"Acceso SIM"</string>
-    <!-- no translation found for bluetooth_profile_a2dp_high_quality (2221025895896419505) -->
-    <skip />
-    <!-- no translation found for bluetooth_profile_a2dp_high_quality_unknown_codec (5860996587596508755) -->
-    <skip />
+    <string name="bluetooth_profile_a2dp_high_quality" msgid="2221025895896419505">"Usar audio de alta calidad: <xliff:g id="CODEC_NAME">%1$s</xliff:g>"</string>
+    <string name="bluetooth_profile_a2dp_high_quality_unknown_codec" msgid="5860996587596508755">"Usar audio de alta calidad"</string>
     <string name="bluetooth_a2dp_profile_summary_connected" msgid="963376081347721598">"Conectado al audio multimedia"</string>
     <string name="bluetooth_headset_profile_summary_connected" msgid="7661070206715520671">"Conectado al audio del dispositivo"</string>
     <string name="bluetooth_opp_profile_summary_connected" msgid="2611913495968309066">"Conectado al servidor de transferencia de archivo"</string>
diff --git a/packages/SettingsLib/res/values-es/arrays.xml b/packages/SettingsLib/res/values-es/arrays.xml
index d527a85..53c547d 100644
--- a/packages/SettingsLib/res/values-es/arrays.xml
+++ b/packages/SettingsLib/res/values-es/arrays.xml
@@ -137,7 +137,7 @@
     <item msgid="364670732877872677">"Mejor esfuerzo (tasa de bits flexible)"</item>
   </string-array>
   <string-array name="select_logd_size_titles">
-    <item msgid="8665206199209698501">"No"</item>
+    <item msgid="8665206199209698501">"Desactivado"</item>
     <item msgid="1593289376502312923">"64 K"</item>
     <item msgid="487545340236145324">"256 K"</item>
     <item msgid="2423528675294333831">"1 M"</item>
@@ -145,13 +145,13 @@
     <item msgid="2803199102589126938">"16 M"</item>
   </string-array>
   <string-array name="select_logd_size_lowram_titles">
-    <item msgid="6089470720451068364">"No"</item>
+    <item msgid="6089470720451068364">"Desactivado"</item>
     <item msgid="4622460333038586791">"64 K"</item>
     <item msgid="2212125625169582330">"256 K"</item>
     <item msgid="1704946766699242653">"1 M"</item>
   </string-array>
   <string-array name="select_logd_size_summaries">
-    <item msgid="6921048829791179331">"No"</item>
+    <item msgid="6921048829791179331">"Desactivado"</item>
     <item msgid="2969458029344750262">"64 K/búfer registro"</item>
     <item msgid="1342285115665698168">"256 K/búfer registro"</item>
     <item msgid="1314234299552254621">"1 M/búfer registro"</item>
@@ -159,13 +159,13 @@
     <item msgid="5431354956856655120">"16 M/búfer registro"</item>
   </string-array>
   <string-array name="select_logpersist_titles">
-    <item msgid="1744840221860799971">"No"</item>
+    <item msgid="1744840221860799971">"Desactivado"</item>
     <item msgid="3054662377365844197">"Todo"</item>
     <item msgid="688870735111627832">"Todo menos señal móvil"</item>
     <item msgid="2850427388488887328">"solo kernel"</item>
   </string-array>
   <string-array name="select_logpersist_summaries">
-    <item msgid="2216470072500521830">"No"</item>
+    <item msgid="2216470072500521830">"Desactivado"</item>
     <item msgid="172978079776521897">"Todos los búferes de registro"</item>
     <item msgid="3873873912383879240">"Todo excepto búferes de registro de señal móvil"</item>
     <item msgid="8489661142527693381">"solo búfer de registro del kernel"</item>
@@ -218,17 +218,17 @@
     <item msgid="1340692776955662664">"Pila de llamadas en glGetError"</item>
   </string-array>
   <string-array name="show_non_rect_clip_entries">
-    <item msgid="993742912147090253">"No"</item>
+    <item msgid="993742912147090253">"Desactivado"</item>
     <item msgid="675719912558941285">"Dibujar región de recorte no rectangular en azul"</item>
     <item msgid="1064373276095698656">"Resaltar comandos de dibujo probados en verde"</item>
   </string-array>
   <string-array name="track_frame_time_entries">
-    <item msgid="2193584639058893150">"No"</item>
+    <item msgid="2193584639058893150">"Desactivado"</item>
     <item msgid="2751513398307949636">"En pantalla como barras"</item>
     <item msgid="2355151170975410323">"En <xliff:g id="AS_TYPED_COMMAND">adb shell dumpsys gfxinfo</xliff:g>"</item>
   </string-array>
   <string-array name="debug_hw_overdraw_entries">
-    <item msgid="8190572633763871652">"No"</item>
+    <item msgid="8190572633763871652">"Desactivado"</item>
     <item msgid="7688197031296835369">"Mostrar áreas sobredibujadas"</item>
     <item msgid="2290859360633824369">"Mostrar áreas para deuteranomalía"</item>
   </string-array>
diff --git a/packages/SettingsLib/res/values-es/strings.xml b/packages/SettingsLib/res/values-es/strings.xml
index 8dc6301..13dde32f 100644
--- a/packages/SettingsLib/res/values-es/strings.xml
+++ b/packages/SettingsLib/res/values-es/strings.xml
@@ -56,10 +56,8 @@
     <string name="bluetooth_profile_pan_nap" msgid="8429049285027482959">"Compartir conexión a Internet"</string>
     <string name="bluetooth_profile_map" msgid="5465271250454324383">"Acceso a mensajes"</string>
     <string name="bluetooth_profile_sap" msgid="5764222021851283125">"Acceso a tarjeta SIM"</string>
-    <!-- no translation found for bluetooth_profile_a2dp_high_quality (2221025895896419505) -->
-    <skip />
-    <!-- no translation found for bluetooth_profile_a2dp_high_quality_unknown_codec (5860996587596508755) -->
-    <skip />
+    <string name="bluetooth_profile_a2dp_high_quality" msgid="2221025895896419505">"Usar audio de alta calidad: <xliff:g id="CODEC_NAME">%1$s</xliff:g>"</string>
+    <string name="bluetooth_profile_a2dp_high_quality_unknown_codec" msgid="5860996587596508755">"Usar audio de alta calidad"</string>
     <string name="bluetooth_a2dp_profile_summary_connected" msgid="963376081347721598">"Conectado al audio del medio"</string>
     <string name="bluetooth_headset_profile_summary_connected" msgid="7661070206715520671">"Conectado al audio del teléfono"</string>
     <string name="bluetooth_opp_profile_summary_connected" msgid="2611913495968309066">"Conectado con el servidor de transferencia de archivos"</string>
@@ -299,8 +297,8 @@
     <string name="inactive_apps_title" msgid="1317817863508274533">"Aplicaciones inactivas"</string>
     <string name="inactive_app_inactive_summary" msgid="5091363706699855725">"Inactiva. Toca para alternar."</string>
     <string name="inactive_app_active_summary" msgid="4174921824958516106">"Activa. Toca para alternar."</string>
-    <string name="runningservices_settings_title" msgid="8097287939865165213">"Servicios en ejecución"</string>
-    <string name="runningservices_settings_summary" msgid="854608995821032748">"Ver y controlar los servicios en ejecución"</string>
+    <string name="runningservices_settings_title" msgid="8097287939865165213">"Servicios en uso"</string>
+    <string name="runningservices_settings_summary" msgid="854608995821032748">"Ver y controlar los servicios en uso"</string>
     <string name="select_webview_provider_title" msgid="4628592979751918907">"Implementación de WebView"</string>
     <string name="select_webview_provider_dialog_title" msgid="4370551378720004872">"Establecer implementación de WebView"</string>
     <string name="select_webview_provider_toast_text" msgid="5466970498308266359">"Esta opción ya no está disponible. Vuelve a intentarlo."</string>
@@ -308,7 +306,7 @@
     <string name="convert_to_file_encryption_enabled" msgid="2861258671151428346">"Convertir…"</string>
     <string name="convert_to_file_encryption_done" msgid="7859766358000523953">"Ya está cifrado"</string>
     <string name="title_convert_fbe" msgid="1263622876196444453">"Convirtiendo a un cifrado basado en archivos"</string>
-    <string name="convert_to_fbe_warning" msgid="6139067817148865527">"Convierte la partición de datos en un cifrado basado en archivos.\n Advertencia: Este proceso borrará todos los datos.\n Esta función es alpha y es posible que no funcione correctamente.\n Pulsa la opción Borrar y convertir… para continuar."</string>
+    <string name="convert_to_fbe_warning" msgid="6139067817148865527">"Convierte la partición de datos en un cifrado basado en archivos.\n Advertencia: Este proceso borrará todos los datos.\n Esta función es alfa y es posible que no funcione correctamente.\n Pulsa la opción Borrar y convertir… para continuar."</string>
     <string name="button_convert_fbe" msgid="5152671181309826405">"Borrar y convertir…"</string>
     <string name="picture_color_mode" msgid="4560755008730283695">"Modo de color de imagen"</string>
     <string name="picture_color_mode_desc" msgid="1141891467675548590">"Utiliza sRGB"</string>
@@ -343,7 +341,7 @@
     <item msgid="8934126114226089439">"50%"</item>
     <item msgid="1286113608943010849">"100%"</item>
   </string-array>
-    <string name="charge_length_format" msgid="8978516217024434156">"Hace <xliff:g id="ID_1">%1$s</xliff:g>"</string>
+    <string name="charge_length_format" msgid="8978516217024434156">"hace <xliff:g id="ID_1">%1$s</xliff:g>"</string>
     <string name="remaining_length_format" msgid="7886337596669190587">"Tiempo restante: <xliff:g id="ID_1">%1$s</xliff:g>"</string>
     <string name="screen_zoom_summary_small" msgid="5867245310241621570">"Pequeño"</string>
     <string name="screen_zoom_summary_default" msgid="2247006805614056507">"Predeterminado"</string>
diff --git a/packages/SettingsLib/res/values-et/arrays.xml b/packages/SettingsLib/res/values-et/arrays.xml
index 904e28e..7766890 100644
--- a/packages/SettingsLib/res/values-et/arrays.xml
+++ b/packages/SettingsLib/res/values-et/arrays.xml
@@ -51,7 +51,7 @@
   <string-array name="hdcp_checking_titles">
     <item msgid="441827799230089869">"Ära kunagi kontrolli"</item>
     <item msgid="6042769699089883931">"Kontrolli ainult DRM-sisu"</item>
-    <item msgid="9174900380056846820">"Pidev kontrollimine"</item>
+    <item msgid="9174900380056846820">"Kontrolli alati"</item>
   </string-array>
   <string-array name="hdcp_checking_summaries">
     <item msgid="505558545611516707">"Ära kunagi kasuta HDCP-kontrollimist"</item>
diff --git a/packages/SettingsLib/res/values-et/strings.xml b/packages/SettingsLib/res/values-et/strings.xml
index a8ebbda..cc52862 100644
--- a/packages/SettingsLib/res/values-et/strings.xml
+++ b/packages/SettingsLib/res/values-et/strings.xml
@@ -56,10 +56,8 @@
     <string name="bluetooth_profile_pan_nap" msgid="8429049285027482959">"Interneti-ühenduse jagamine"</string>
     <string name="bluetooth_profile_map" msgid="5465271250454324383">"Juurdepääs sõnumile"</string>
     <string name="bluetooth_profile_sap" msgid="5764222021851283125">"SIM-kaardi juurdepääs"</string>
-    <!-- no translation found for bluetooth_profile_a2dp_high_quality (2221025895896419505) -->
-    <skip />
-    <!-- no translation found for bluetooth_profile_a2dp_high_quality_unknown_codec (5860996587596508755) -->
-    <skip />
+    <string name="bluetooth_profile_a2dp_high_quality" msgid="2221025895896419505">"Kasuta kvaliteetset heli: <xliff:g id="CODEC_NAME">%1$s</xliff:g>"</string>
+    <string name="bluetooth_profile_a2dp_high_quality_unknown_codec" msgid="5860996587596508755">"Kasuta kvaliteetset heli"</string>
     <string name="bluetooth_a2dp_profile_summary_connected" msgid="963376081347721598">"Ühendatud meediumiheliga"</string>
     <string name="bluetooth_headset_profile_summary_connected" msgid="7661070206715520671">"Ühendatud telefoniheliga"</string>
     <string name="bluetooth_opp_profile_summary_connected" msgid="2611913495968309066">"Ühendatud failiedastuse serveriga"</string>
diff --git a/packages/SettingsLib/res/values-eu/strings.xml b/packages/SettingsLib/res/values-eu/strings.xml
index 1cf26e5..aa6b3c2 100644
--- a/packages/SettingsLib/res/values-eu/strings.xml
+++ b/packages/SettingsLib/res/values-eu/strings.xml
@@ -56,10 +56,8 @@
     <string name="bluetooth_profile_pan_nap" msgid="8429049285027482959">"Interneteko konexioa partekatzea"</string>
     <string name="bluetooth_profile_map" msgid="5465271250454324383">"Mezuetarako sarbidea"</string>
     <string name="bluetooth_profile_sap" msgid="5764222021851283125">"SIM txartelerako sarbidea"</string>
-    <!-- no translation found for bluetooth_profile_a2dp_high_quality (2221025895896419505) -->
-    <skip />
-    <!-- no translation found for bluetooth_profile_a2dp_high_quality_unknown_codec (5860996587596508755) -->
-    <skip />
+    <string name="bluetooth_profile_a2dp_high_quality" msgid="2221025895896419505">"Erabili kalitate handiko audioa: <xliff:g id="CODEC_NAME">%1$s</xliff:g>"</string>
+    <string name="bluetooth_profile_a2dp_high_quality_unknown_codec" msgid="5860996587596508755">"Erabili kalitate handiko audioa"</string>
     <string name="bluetooth_a2dp_profile_summary_connected" msgid="963376081347721598">"Euskarriaren audiora konektatuta"</string>
     <string name="bluetooth_headset_profile_summary_connected" msgid="7661070206715520671">"Telefonoaren audiora konektatuta"</string>
     <string name="bluetooth_opp_profile_summary_connected" msgid="2611913495968309066">"Fitxategi-transferentziako zerbitzarira konektatuta"</string>
diff --git a/packages/SettingsLib/res/values-fa/strings.xml b/packages/SettingsLib/res/values-fa/strings.xml
index c456b1c..65fe22c 100644
--- a/packages/SettingsLib/res/values-fa/strings.xml
+++ b/packages/SettingsLib/res/values-fa/strings.xml
@@ -56,10 +56,8 @@
     <string name="bluetooth_profile_pan_nap" msgid="8429049285027482959">"اشتراک‌گذاری اتصال اینترنت"</string>
     <string name="bluetooth_profile_map" msgid="5465271250454324383">"دسترسی به پیام"</string>
     <string name="bluetooth_profile_sap" msgid="5764222021851283125">"دسترسی سیم‌کارت"</string>
-    <!-- no translation found for bluetooth_profile_a2dp_high_quality (2221025895896419505) -->
-    <skip />
-    <!-- no translation found for bluetooth_profile_a2dp_high_quality_unknown_codec (5860996587596508755) -->
-    <skip />
+    <string name="bluetooth_profile_a2dp_high_quality" msgid="2221025895896419505">"استفاده از صوت با کیفیت بالا: <xliff:g id="CODEC_NAME">%1$s</xliff:g>"</string>
+    <string name="bluetooth_profile_a2dp_high_quality_unknown_codec" msgid="5860996587596508755">"استفاده از صوت با کیفیت بالا"</string>
     <string name="bluetooth_a2dp_profile_summary_connected" msgid="963376081347721598">"به رسانه صوتی متصل شد"</string>
     <string name="bluetooth_headset_profile_summary_connected" msgid="7661070206715520671">"به تلفن صوتی متصل شد"</string>
     <string name="bluetooth_opp_profile_summary_connected" msgid="2611913495968309066">"به سرور انتقال فایل متصل شد"</string>
diff --git a/packages/SettingsLib/res/values-fi/strings.xml b/packages/SettingsLib/res/values-fi/strings.xml
index f3e2d6b..d306e23 100644
--- a/packages/SettingsLib/res/values-fi/strings.xml
+++ b/packages/SettingsLib/res/values-fi/strings.xml
@@ -56,10 +56,8 @@
     <string name="bluetooth_profile_pan_nap" msgid="8429049285027482959">"Internetyhteyden jakaminen"</string>
     <string name="bluetooth_profile_map" msgid="5465271250454324383">"MAP"</string>
     <string name="bluetooth_profile_sap" msgid="5764222021851283125">"SIM-kortin käyttö"</string>
-    <!-- no translation found for bluetooth_profile_a2dp_high_quality (2221025895896419505) -->
-    <skip />
-    <!-- no translation found for bluetooth_profile_a2dp_high_quality_unknown_codec (5860996587596508755) -->
-    <skip />
+    <string name="bluetooth_profile_a2dp_high_quality" msgid="2221025895896419505">"Käytä korkealaatuista ääntä: <xliff:g id="CODEC_NAME">%1$s</xliff:g>"</string>
+    <string name="bluetooth_profile_a2dp_high_quality_unknown_codec" msgid="5860996587596508755">"Käytä korkealaatuista ääntä"</string>
     <string name="bluetooth_a2dp_profile_summary_connected" msgid="963376081347721598">"Yhdistetty median ääneen"</string>
     <string name="bluetooth_headset_profile_summary_connected" msgid="7661070206715520671">"Yhdistetty puhelimen ääneen"</string>
     <string name="bluetooth_opp_profile_summary_connected" msgid="2611913495968309066">"Yhdistetty tiedostonsiirtopalvelimeen"</string>
diff --git a/packages/SettingsLib/res/values-fr-rCA/strings.xml b/packages/SettingsLib/res/values-fr-rCA/strings.xml
index 8c1df6b..5891473 100644
--- a/packages/SettingsLib/res/values-fr-rCA/strings.xml
+++ b/packages/SettingsLib/res/values-fr-rCA/strings.xml
@@ -56,10 +56,8 @@
     <string name="bluetooth_profile_pan_nap" msgid="8429049285027482959">"Partage de connexion Internet"</string>
     <string name="bluetooth_profile_map" msgid="5465271250454324383">"Accès aux messages"</string>
     <string name="bluetooth_profile_sap" msgid="5764222021851283125">"Accès à la carte SIM"</string>
-    <!-- no translation found for bluetooth_profile_a2dp_high_quality (2221025895896419505) -->
-    <skip />
-    <!-- no translation found for bluetooth_profile_a2dp_high_quality_unknown_codec (5860996587596508755) -->
-    <skip />
+    <string name="bluetooth_profile_a2dp_high_quality" msgid="2221025895896419505">"Utiliser l\'audio de haute qualité : <xliff:g id="CODEC_NAME">%1$s</xliff:g>"</string>
+    <string name="bluetooth_profile_a2dp_high_quality_unknown_codec" msgid="5860996587596508755">"Utiliser l\'audio de haute qualité"</string>
     <string name="bluetooth_a2dp_profile_summary_connected" msgid="963376081347721598">"Connecté aux paramètres audio du média"</string>
     <string name="bluetooth_headset_profile_summary_connected" msgid="7661070206715520671">"Connecté à l\'audio du téléphone"</string>
     <string name="bluetooth_opp_profile_summary_connected" msgid="2611913495968309066">"Connexion au serveur de transfert de fichiers"</string>
@@ -113,7 +111,7 @@
     <string name="tts_default_lang_title" msgid="8018087612299820556">"Langue"</string>
     <string name="tts_lang_use_system" msgid="2679252467416513208">"Utiliser la langue du système"</string>
     <string name="tts_lang_not_selected" msgid="7395787019276734765">"Langue non sélectionnée"</string>
-    <string name="tts_default_lang_summary" msgid="5219362163902707785">"Définit la langue utilisée par la syntèse vocale"</string>
+    <string name="tts_default_lang_summary" msgid="5219362163902707785">"Définir la langue utilisée par la syntèse vocale"</string>
     <string name="tts_play_example_title" msgid="7094780383253097230">"Écouter un échantillon"</string>
     <string name="tts_play_example_summary" msgid="8029071615047894486">"Lire une courte démonstration de la synthèse vocale"</string>
     <string name="tts_install_data_title" msgid="4264378440508149986">"Installer les données vocales"</string>
@@ -146,10 +144,10 @@
     <string name="choose_profile" msgid="6921016979430278661">"Sélectionnez un profil"</string>
     <string name="category_personal" msgid="1299663247844969448">"Personnel"</string>
     <string name="category_work" msgid="8699184680584175622">"Travail"</string>
-    <string name="development_settings_title" msgid="215179176067683667">"Options pour les développeurs"</string>
-    <string name="development_settings_enable" msgid="542530994778109538">"Activer les options pour les développeurs"</string>
+    <string name="development_settings_title" msgid="215179176067683667">"Options pour les concepteurs"</string>
+    <string name="development_settings_enable" msgid="542530994778109538">"Activer les options pour les concepteurs"</string>
     <string name="development_settings_summary" msgid="1815795401632854041">"Définir les options pour le développement de l\'application"</string>
-    <string name="development_settings_not_available" msgid="4308569041701535607">"Les options proposées aux développeurs ne sont pas disponibles pour cet utilisateur."</string>
+    <string name="development_settings_not_available" msgid="4308569041701535607">"Les options proposées aux concepteurs ne sont pas disponibles pour cet utilisateur."</string>
     <string name="vpn_settings_not_available" msgid="956841430176985598">"Les paramètres de RPV ne sont pas disponibles pour cet utilisateur"</string>
     <string name="tethering_settings_not_available" msgid="6765770438438291012">"Les paramètres de partage de connexion ne sont pas disponibles pour cet utilisateur"</string>
     <string name="apn_settings_not_available" msgid="7873729032165324000">"Les paramètres de point d\'accès ne sont pas disponibles pour cet utilisateur"</string>
@@ -218,7 +216,7 @@
     <string name="enable_terminal_title" msgid="95572094356054120">"Terminal local"</string>
     <string name="enable_terminal_summary" msgid="67667852659359206">"Activer l\'application Terminal permettant l\'accès au shell local"</string>
     <string name="hdcp_checking_title" msgid="8605478913544273282">"Vérification HDCP"</string>
-    <string name="hdcp_checking_dialog_title" msgid="5141305530923283">"Config. vérification HDCP"</string>
+    <string name="hdcp_checking_dialog_title" msgid="5141305530923283">"Configurer vérification HDCP"</string>
     <string name="debug_debugging_category" msgid="6781250159513471316">"Débogage"</string>
     <string name="debug_app" msgid="8349591734751384446">"Sélectionner une application à déboguer"</string>
     <string name="debug_app_not_set" msgid="718752499586403499">"Aucune application à déboguer définie"</string>
@@ -304,11 +302,11 @@
     <string name="select_webview_provider_title" msgid="4628592979751918907">"Mise en œuvre WebView"</string>
     <string name="select_webview_provider_dialog_title" msgid="4370551378720004872">"Définir la mise en œuvre WebView"</string>
     <string name="select_webview_provider_toast_text" msgid="5466970498308266359">"Ce choix n\'est plus valide. Réessayez."</string>
-    <string name="convert_to_file_encryption" msgid="3060156730651061223">"Convertir en chiffrement basé sur un fichier"</string>
+    <string name="convert_to_file_encryption" msgid="3060156730651061223">"Convertir en chiffrement"</string>
     <string name="convert_to_file_encryption_enabled" msgid="2861258671151428346">"Convertir..."</string>
     <string name="convert_to_file_encryption_done" msgid="7859766358000523953">"Déjà chiffré par un fichier"</string>
     <string name="title_convert_fbe" msgid="1263622876196444453">"Conversion en chiffrement basé sur un fichier en cours"</string>
-    <string name="convert_to_fbe_warning" msgid="6139067817148865527">"Convertir la partition de données en chiffrement basé sur un fichier.\n Avertissement! Cette opération supprimera toutes vos données. \nCette fonctionnalité est en version alpha et peut ne pas fonctionner correctement. \nTouchez « Effacer et convertir » pour continuer."</string>
+    <string name="convert_to_fbe_warning" msgid="6139067817148865527">"Convertir la partition de données en chiffrement basé sur un fichier.\nAvertissement! Cette opération supprimera toutes vos données.\nCette fonctionnalité est en version alpha et peut ne pas fonctionner correctement.\nTouchez « Effacer et convertir… » pour continuer."</string>
     <string name="button_convert_fbe" msgid="5152671181309826405">"Effacer et convertir..."</string>
     <string name="picture_color_mode" msgid="4560755008730283695">"Mode couleur des images"</string>
     <string name="picture_color_mode_desc" msgid="1141891467675548590">"Utiliser sRGB"</string>
diff --git a/packages/SettingsLib/res/values-fr/strings.xml b/packages/SettingsLib/res/values-fr/strings.xml
index 1c6e93b..831515a 100644
--- a/packages/SettingsLib/res/values-fr/strings.xml
+++ b/packages/SettingsLib/res/values-fr/strings.xml
@@ -56,10 +56,8 @@
     <string name="bluetooth_profile_pan_nap" msgid="8429049285027482959">"Partage de connexion Internet"</string>
     <string name="bluetooth_profile_map" msgid="5465271250454324383">"Accès aux messages"</string>
     <string name="bluetooth_profile_sap" msgid="5764222021851283125">"Accès à la carte SIM"</string>
-    <!-- no translation found for bluetooth_profile_a2dp_high_quality (2221025895896419505) -->
-    <skip />
-    <!-- no translation found for bluetooth_profile_a2dp_high_quality_unknown_codec (5860996587596508755) -->
-    <skip />
+    <string name="bluetooth_profile_a2dp_high_quality" msgid="2221025895896419505">"Utiliser le codec audio haute qualité : <xliff:g id="CODEC_NAME">%1$s</xliff:g>"</string>
+    <string name="bluetooth_profile_a2dp_high_quality_unknown_codec" msgid="5860996587596508755">"Utiliser un codec audio haute qualité"</string>
     <string name="bluetooth_a2dp_profile_summary_connected" msgid="963376081347721598">"Connecté aux paramètres audio du média"</string>
     <string name="bluetooth_headset_profile_summary_connected" msgid="7661070206715520671">"Connecté aux paramètres audio du téléphone"</string>
     <string name="bluetooth_opp_profile_summary_connected" msgid="2611913495968309066">"Connexion au serveur de transfert de fichiers"</string>
@@ -282,7 +280,7 @@
     <string name="enable_freeform_support_summary" msgid="8247310463288834487">"Activer la compatibilité avec les fenêtres de forme libre expérimentales."</string>
     <string name="local_backup_password_title" msgid="3860471654439418822">"Mot de passe sauvegarde PC"</string>
     <string name="local_backup_password_summary_none" msgid="6951095485537767956">"Les sauvegardes complètes sur PC ne sont pas protégées actuellement."</string>
-    <string name="local_backup_password_summary_change" msgid="5376206246809190364">"Appuyez pour modifier ou supprimer le mot de passe utilisé pour les sauvegardes complètes sur PC."</string>
+    <string name="local_backup_password_summary_change" msgid="5376206246809190364">"Appuyez pour modifier ou supprimer le mot de passe de sauvegarde complète sur PC."</string>
     <string name="local_backup_password_toast_success" msgid="582016086228434290">"Le nouveau mot de passe de secours a bien été défini."</string>
     <string name="local_backup_password_toast_confirmation_mismatch" msgid="7805892532752708288">"Le nouveau mot de passe et sa confirmation ne correspondent pas."</string>
     <string name="local_backup_password_toast_validation_failure" msgid="5646377234895626531">"Échec de la définition du mot de passe de secours."</string>
diff --git a/packages/SettingsLib/res/values-gl/strings.xml b/packages/SettingsLib/res/values-gl/strings.xml
index 8557fb5..c433c0f 100644
--- a/packages/SettingsLib/res/values-gl/strings.xml
+++ b/packages/SettingsLib/res/values-gl/strings.xml
@@ -56,10 +56,8 @@
     <string name="bluetooth_profile_pan_nap" msgid="8429049285027482959">"Uso compartido da conexión a Internet"</string>
     <string name="bluetooth_profile_map" msgid="5465271250454324383">"Acceso ás mensaxes"</string>
     <string name="bluetooth_profile_sap" msgid="5764222021851283125">"Acceso á SIM"</string>
-    <!-- no translation found for bluetooth_profile_a2dp_high_quality (2221025895896419505) -->
-    <skip />
-    <!-- no translation found for bluetooth_profile_a2dp_high_quality_unknown_codec (5860996587596508755) -->
-    <skip />
+    <string name="bluetooth_profile_a2dp_high_quality" msgid="2221025895896419505">"Usar audio de alta calidade: <xliff:g id="CODEC_NAME">%1$s</xliff:g>"</string>
+    <string name="bluetooth_profile_a2dp_high_quality_unknown_codec" msgid="5860996587596508755">"Usar audio de alta calidade"</string>
     <string name="bluetooth_a2dp_profile_summary_connected" msgid="963376081347721598">"Conectado ao audio multimedia"</string>
     <string name="bluetooth_headset_profile_summary_connected" msgid="7661070206715520671">"Conectado ao audio do teléfono"</string>
     <string name="bluetooth_opp_profile_summary_connected" msgid="2611913495968309066">"Conectado ao servidor de transferencia de ficheiros"</string>
diff --git a/packages/SettingsLib/res/values-gu/strings.xml b/packages/SettingsLib/res/values-gu/strings.xml
index 6bde256..df9eda9 100644
--- a/packages/SettingsLib/res/values-gu/strings.xml
+++ b/packages/SettingsLib/res/values-gu/strings.xml
@@ -56,10 +56,8 @@
     <string name="bluetooth_profile_pan_nap" msgid="8429049285027482959">"ઇન્ટરનેટ કનેક્શન શેરિંગ"</string>
     <string name="bluetooth_profile_map" msgid="5465271250454324383">"સંદેશ ઍક્સેસ"</string>
     <string name="bluetooth_profile_sap" msgid="5764222021851283125">"SIM ઍક્સેસ"</string>
-    <!-- no translation found for bluetooth_profile_a2dp_high_quality (2221025895896419505) -->
-    <skip />
-    <!-- no translation found for bluetooth_profile_a2dp_high_quality_unknown_codec (5860996587596508755) -->
-    <skip />
+    <string name="bluetooth_profile_a2dp_high_quality" msgid="2221025895896419505">"ઉચ્ચ ગુણવત્તાવાળા ઑડિયોનો ઉપયોગ કરો: <xliff:g id="CODEC_NAME">%1$s</xliff:g>"</string>
+    <string name="bluetooth_profile_a2dp_high_quality_unknown_codec" msgid="5860996587596508755">"ઉચ્ચ ગુણવત્તાવાળા ઑડિયોનો ઉપયોગ કરો"</string>
     <string name="bluetooth_a2dp_profile_summary_connected" msgid="963376081347721598">"મીડિયા ઑડિઓ સાથે કનેક્ટ કર્યુ"</string>
     <string name="bluetooth_headset_profile_summary_connected" msgid="7661070206715520671">"ફોન ઑડિઓ સાથે કનેક્ટ થયાં"</string>
     <string name="bluetooth_opp_profile_summary_connected" msgid="2611913495968309066">"ફાઇલ સ્થાનાંતરણ સેવાથી કનેક્ટ થયાં"</string>
diff --git a/packages/SettingsLib/res/values-hi/strings.xml b/packages/SettingsLib/res/values-hi/strings.xml
index 0341a4f..c729027 100644
--- a/packages/SettingsLib/res/values-hi/strings.xml
+++ b/packages/SettingsLib/res/values-hi/strings.xml
@@ -56,10 +56,8 @@
     <string name="bluetooth_profile_pan_nap" msgid="8429049285027482959">"इंटरनेट कनेक्शन साझाकरण"</string>
     <string name="bluetooth_profile_map" msgid="5465271250454324383">"संदेश एक्सेस"</string>
     <string name="bluetooth_profile_sap" msgid="5764222021851283125">"सिम ऐक्सेस"</string>
-    <!-- no translation found for bluetooth_profile_a2dp_high_quality (2221025895896419505) -->
-    <skip />
-    <!-- no translation found for bluetooth_profile_a2dp_high_quality_unknown_codec (5860996587596508755) -->
-    <skip />
+    <string name="bluetooth_profile_a2dp_high_quality" msgid="2221025895896419505">"अच्छी गुणवत्ता वाले ऑडियो का उपयोग करें: <xliff:g id="CODEC_NAME">%1$s</xliff:g>"</string>
+    <string name="bluetooth_profile_a2dp_high_quality_unknown_codec" msgid="5860996587596508755">"अच्छी गुणवत्ता वाले ऑडियो का उपयोग करें"</string>
     <string name="bluetooth_a2dp_profile_summary_connected" msgid="963376081347721598">"मीडिया ऑडियो से कनेक्‍ट किया गया"</string>
     <string name="bluetooth_headset_profile_summary_connected" msgid="7661070206715520671">"फ़ोन ऑडियो से कनेक्‍ट किया गया"</string>
     <string name="bluetooth_opp_profile_summary_connected" msgid="2611913495968309066">"फ़ाइल स्‍थानांतरण सर्वर से कनेक्‍ट किया गया"</string>
diff --git a/packages/SettingsLib/res/values-hr/strings.xml b/packages/SettingsLib/res/values-hr/strings.xml
index f9108c1..e94b6df 100644
--- a/packages/SettingsLib/res/values-hr/strings.xml
+++ b/packages/SettingsLib/res/values-hr/strings.xml
@@ -56,10 +56,8 @@
     <string name="bluetooth_profile_pan_nap" msgid="8429049285027482959">"Dijeljenje internetske veze"</string>
     <string name="bluetooth_profile_map" msgid="5465271250454324383">"Pristup porukama"</string>
     <string name="bluetooth_profile_sap" msgid="5764222021851283125">"Pristup SIM-u"</string>
-    <!-- no translation found for bluetooth_profile_a2dp_high_quality (2221025895896419505) -->
-    <skip />
-    <!-- no translation found for bluetooth_profile_a2dp_high_quality_unknown_codec (5860996587596508755) -->
-    <skip />
+    <string name="bluetooth_profile_a2dp_high_quality" msgid="2221025895896419505">"Upotrebljavaj visokokvalitetan audio: <xliff:g id="CODEC_NAME">%1$s</xliff:g>"</string>
+    <string name="bluetooth_profile_a2dp_high_quality_unknown_codec" msgid="5860996587596508755">"Upotrebljavaj visokokvalitetan audio"</string>
     <string name="bluetooth_a2dp_profile_summary_connected" msgid="963376081347721598">"Povezano s medijskim zvukom"</string>
     <string name="bluetooth_headset_profile_summary_connected" msgid="7661070206715520671">"Povezano sa telefonskim zvukom"</string>
     <string name="bluetooth_opp_profile_summary_connected" msgid="2611913495968309066">"Povezano s poslužiteljem za prijenos datoteka"</string>
@@ -218,7 +216,7 @@
     <string name="enable_terminal_title" msgid="95572094356054120">"Lokalni terminal"</string>
     <string name="enable_terminal_summary" msgid="67667852659359206">"Omogući aplikaciju terminala koja nudi pristup lokalnoj ovojnici"</string>
     <string name="hdcp_checking_title" msgid="8605478913544273282">"HDCP provjera"</string>
-    <string name="hdcp_checking_dialog_title" msgid="5141305530923283">"Postav. ponaš. HDCP prov."</string>
+    <string name="hdcp_checking_dialog_title" msgid="5141305530923283">"Postavke HDCP provjere"</string>
     <string name="debug_debugging_category" msgid="6781250159513471316">"Otklanjanje pogrešaka"</string>
     <string name="debug_app" msgid="8349591734751384446">"Aplikacija za otklanjanje pogrešaka"</string>
     <string name="debug_app_not_set" msgid="718752499586403499">"Nema aplikacije za otklanjanje pogrešaka"</string>
diff --git a/packages/SettingsLib/res/values-hu/strings.xml b/packages/SettingsLib/res/values-hu/strings.xml
index fdd34ad..d06417f 100644
--- a/packages/SettingsLib/res/values-hu/strings.xml
+++ b/packages/SettingsLib/res/values-hu/strings.xml
@@ -56,10 +56,8 @@
     <string name="bluetooth_profile_pan_nap" msgid="8429049285027482959">"Internetkapcsolat megosztása"</string>
     <string name="bluetooth_profile_map" msgid="5465271250454324383">"Üzenet-hozzáférés"</string>
     <string name="bluetooth_profile_sap" msgid="5764222021851283125">"SIM-elérés"</string>
-    <!-- no translation found for bluetooth_profile_a2dp_high_quality (2221025895896419505) -->
-    <skip />
-    <!-- no translation found for bluetooth_profile_a2dp_high_quality_unknown_codec (5860996587596508755) -->
-    <skip />
+    <string name="bluetooth_profile_a2dp_high_quality" msgid="2221025895896419505">"Jó audiominőség használata: <xliff:g id="CODEC_NAME">%1$s</xliff:g>"</string>
+    <string name="bluetooth_profile_a2dp_high_quality_unknown_codec" msgid="5860996587596508755">"Jó audiominőség használata"</string>
     <string name="bluetooth_a2dp_profile_summary_connected" msgid="963376081347721598">"Csatlakoztatva az eszköz hangjához"</string>
     <string name="bluetooth_headset_profile_summary_connected" msgid="7661070206715520671">"Csatlakoztatva a telefon hangjához"</string>
     <string name="bluetooth_opp_profile_summary_connected" msgid="2611913495968309066">"Csatlakozva a fájlküldő szerverhez"</string>
diff --git a/packages/SettingsLib/res/values-hy/strings.xml b/packages/SettingsLib/res/values-hy/strings.xml
index aeb7f46..0ec7637 100644
--- a/packages/SettingsLib/res/values-hy/strings.xml
+++ b/packages/SettingsLib/res/values-hy/strings.xml
@@ -42,7 +42,7 @@
     <string name="bluetooth_connecting" msgid="8555009514614320497">"Միանում է..."</string>
     <string name="bluetooth_connected" msgid="6038755206916626419">"Միացված է"</string>
     <string name="bluetooth_pairing" msgid="1426882272690346242">"Զուգակցում..."</string>
-    <string name="bluetooth_connected_no_headset" msgid="2866994875046035609">"Միացված (առանց հեռախոսի)"</string>
+    <string name="bluetooth_connected_no_headset" msgid="2866994875046035609">"Միացված է (առանց հեռախոսի)"</string>
     <string name="bluetooth_connected_no_a2dp" msgid="4576188601581440337">"Միացված է (առանց մեդիա)"</string>
     <string name="bluetooth_connected_no_map" msgid="6504436917057479986">"Միացված է (հաղորդագրությանը մուտք չկա)"</string>
     <string name="bluetooth_connected_no_headset_no_a2dp" msgid="9195757766755553810">"Միացված է (առանց հեռախոսի և մեդիայի)"</string>
@@ -56,10 +56,8 @@
     <string name="bluetooth_profile_pan_nap" msgid="8429049285027482959">"Ինտերնետ կապի տարածում"</string>
     <string name="bluetooth_profile_map" msgid="5465271250454324383">"Մուտք հաղորդագրություն"</string>
     <string name="bluetooth_profile_sap" msgid="5764222021851283125">"SIM քարտի հասանելիություն"</string>
-    <!-- no translation found for bluetooth_profile_a2dp_high_quality (2221025895896419505) -->
-    <skip />
-    <!-- no translation found for bluetooth_profile_a2dp_high_quality_unknown_codec (5860996587596508755) -->
-    <skip />
+    <string name="bluetooth_profile_a2dp_high_quality" msgid="2221025895896419505">"Օգտագործել բարձրորակ ձայն՝ <xliff:g id="CODEC_NAME">%1$s</xliff:g>"</string>
+    <string name="bluetooth_profile_a2dp_high_quality_unknown_codec" msgid="5860996587596508755">"Օգտագործել բարձրորակ ձայն"</string>
     <string name="bluetooth_a2dp_profile_summary_connected" msgid="963376081347721598">"Միացված է մեդիա աուդիոյին"</string>
     <string name="bluetooth_headset_profile_summary_connected" msgid="7661070206715520671">"Միացված է հեռախոսի ձայնային տվյալներին"</string>
     <string name="bluetooth_opp_profile_summary_connected" msgid="2611913495968309066">"Միացված է ֆայլերի փոխանցման սերվերին"</string>
@@ -104,21 +102,21 @@
     <string name="running_process_item_user_label" msgid="3129887865552025943">"Օտատեր՝ <xliff:g id="USER_NAME">%1$s</xliff:g>"</string>
     <string name="launch_defaults_some" msgid="313159469856372621">"Որոշ կանխադրված կարգավորումներ կան"</string>
     <string name="launch_defaults_none" msgid="4241129108140034876">"Կանխադրված կարգավորումներ չկան"</string>
-    <string name="tts_settings" msgid="8186971894801348327">"Տեքստից-խոսք կարգավորումներ"</string>
+    <string name="tts_settings" msgid="8186971894801348327">"Տեքստի հնչեցման կարգավորումներ"</string>
     <string name="tts_settings_title" msgid="1237820681016639683">"Տեքստի հնչեցում"</string>
-    <string name="tts_default_rate_title" msgid="6030550998379310088">"Խոսքի գնահատական"</string>
+    <string name="tts_default_rate_title" msgid="6030550998379310088">"Խոսքի արագությունը"</string>
     <string name="tts_default_rate_summary" msgid="4061815292287182801">"Տեքստի արտասանման արագությունը"</string>
-    <string name="tts_default_pitch_title" msgid="6135942113172488671">"Բարձրություն"</string>
+    <string name="tts_default_pitch_title" msgid="6135942113172488671">"Ձայնի բարձրությունը"</string>
     <string name="tts_default_pitch_summary" msgid="1944885882882650009">"Ազդում է սինթեզած խոսքի ձայներանգի վրա"</string>
     <string name="tts_default_lang_title" msgid="8018087612299820556">"Լեզու"</string>
     <string name="tts_lang_use_system" msgid="2679252467416513208">"Օգտագործել համակարգի լեզուն"</string>
     <string name="tts_lang_not_selected" msgid="7395787019276734765">"Լեզուն ընտրված չէ"</string>
-    <string name="tts_default_lang_summary" msgid="5219362163902707785">"Կարգավորում է լեզվին բնորոշ ձայնը արտասանվող տեքստի համար"</string>
+    <string name="tts_default_lang_summary" msgid="5219362163902707785">"Ընտրում է լեզուն՝ տեքստն ընթերցելու համար"</string>
     <string name="tts_play_example_title" msgid="7094780383253097230">"Լսել օրինակը"</string>
     <string name="tts_play_example_summary" msgid="8029071615047894486">"Կարճ հնչեցնել խոսքի սինթեզը"</string>
     <string name="tts_install_data_title" msgid="4264378440508149986">"Տեղադրել ձայնային տվյալները"</string>
     <string name="tts_install_data_summary" msgid="5742135732511822589">"Տեղադրել անհրաժեշտ ձայնային տվյալները` խոսքը սինթեզելու համար"</string>
-    <string name="tts_engine_security_warning" msgid="8786238102020223650">"Այս խոսքային սինթեզի գործիքը կարող է հավաքագրել այն ամենը, ինչ արտասանված է, այդ թվում` անձնական տվյալներ, ինչպիսիք են գաղտնաբառն ու բանկային քարտի համարները: Սկզբնաբյուրը <xliff:g id="TTS_PLUGIN_ENGINE_NAME">%s</xliff:g> շարժիչն է: Միացնե՞լ խոսքի սինթեզի շարժիչի օգտագործումը:"</string>
+    <string name="tts_engine_security_warning" msgid="8786238102020223650">"Այս խոսքային սինթեզի գործիքը կարող է հավաքել այն ամենը, ինչ արտասանված է, այդ թվում` անձնական տվյալներ, ինչպիսիք են գաղտնաբառն ու բանկային քարտի համարները: Սկզբնաբյուրը <xliff:g id="TTS_PLUGIN_ENGINE_NAME">%s</xliff:g> շարժիչն է: Միացնե՞լ խոսքի սինթեզի շարժիչի օգտագործումը:"</string>
     <string name="tts_engine_network_required" msgid="1190837151485314743">"Այս լեզուն պահանջում է աշխատող ցանցային կապ գրվածքից խոսք ելքի համար:"</string>
     <string name="tts_default_sample_string" msgid="4040835213373086322">"Սա խոսքային սինթեզի մի նմուշ է:"</string>
     <string name="tts_status_title" msgid="7268566550242584413">"Լռելյայն լեզվի կարգավիճակը"</string>
diff --git a/packages/SettingsLib/res/values-in/strings.xml b/packages/SettingsLib/res/values-in/strings.xml
index 4da60bed..733e2cb 100644
--- a/packages/SettingsLib/res/values-in/strings.xml
+++ b/packages/SettingsLib/res/values-in/strings.xml
@@ -56,10 +56,8 @@
     <string name="bluetooth_profile_pan_nap" msgid="8429049285027482959">"Berbagi sambungan internet"</string>
     <string name="bluetooth_profile_map" msgid="5465271250454324383">"Akses Pesan"</string>
     <string name="bluetooth_profile_sap" msgid="5764222021851283125">"Akses SIM"</string>
-    <!-- no translation found for bluetooth_profile_a2dp_high_quality (2221025895896419505) -->
-    <skip />
-    <!-- no translation found for bluetooth_profile_a2dp_high_quality_unknown_codec (5860996587596508755) -->
-    <skip />
+    <string name="bluetooth_profile_a2dp_high_quality" msgid="2221025895896419505">"Gunakan audio berkualitas tinggi: <xliff:g id="CODEC_NAME">%1$s</xliff:g>"</string>
+    <string name="bluetooth_profile_a2dp_high_quality_unknown_codec" msgid="5860996587596508755">"Gunakan audio berkualitas tinggi"</string>
     <string name="bluetooth_a2dp_profile_summary_connected" msgid="963376081347721598">"Tersambung ke media audio"</string>
     <string name="bluetooth_headset_profile_summary_connected" msgid="7661070206715520671">"Tersambung ke audio ponsel"</string>
     <string name="bluetooth_opp_profile_summary_connected" msgid="2611913495968309066">"Sambungkan ke server transfer file"</string>
diff --git a/packages/SettingsLib/res/values-is/strings.xml b/packages/SettingsLib/res/values-is/strings.xml
index a433b8d..d4fde8a 100644
--- a/packages/SettingsLib/res/values-is/strings.xml
+++ b/packages/SettingsLib/res/values-is/strings.xml
@@ -56,10 +56,8 @@
     <string name="bluetooth_profile_pan_nap" msgid="8429049285027482959">"Deiling nettengingar"</string>
     <string name="bluetooth_profile_map" msgid="5465271250454324383">"Skilaboðaaðgangur"</string>
     <string name="bluetooth_profile_sap" msgid="5764222021851283125">"Aðgangur að SIM-korti"</string>
-    <!-- no translation found for bluetooth_profile_a2dp_high_quality (2221025895896419505) -->
-    <skip />
-    <!-- no translation found for bluetooth_profile_a2dp_high_quality_unknown_codec (5860996587596508755) -->
-    <skip />
+    <string name="bluetooth_profile_a2dp_high_quality" msgid="2221025895896419505">"Nota hágæðahljóð: <xliff:g id="CODEC_NAME">%1$s</xliff:g>"</string>
+    <string name="bluetooth_profile_a2dp_high_quality_unknown_codec" msgid="5860996587596508755">"Nota hágæðahljóð"</string>
     <string name="bluetooth_a2dp_profile_summary_connected" msgid="963376081347721598">"Tengt við hljóðspilun efnis"</string>
     <string name="bluetooth_headset_profile_summary_connected" msgid="7661070206715520671">"Tengt við hljóð símans"</string>
     <string name="bluetooth_opp_profile_summary_connected" msgid="2611913495968309066">"Tengt við skráaflutningsþjón"</string>
diff --git a/packages/SettingsLib/res/values-it/strings.xml b/packages/SettingsLib/res/values-it/strings.xml
index eef124d..14b8e37 100644
--- a/packages/SettingsLib/res/values-it/strings.xml
+++ b/packages/SettingsLib/res/values-it/strings.xml
@@ -56,10 +56,8 @@
     <string name="bluetooth_profile_pan_nap" msgid="8429049285027482959">"Condivisione connessione Internet"</string>
     <string name="bluetooth_profile_map" msgid="5465271250454324383">"Accesso ai messaggi"</string>
     <string name="bluetooth_profile_sap" msgid="5764222021851283125">"Accesso alla SIM"</string>
-    <!-- no translation found for bluetooth_profile_a2dp_high_quality (2221025895896419505) -->
-    <skip />
-    <!-- no translation found for bluetooth_profile_a2dp_high_quality_unknown_codec (5860996587596508755) -->
-    <skip />
+    <string name="bluetooth_profile_a2dp_high_quality" msgid="2221025895896419505">"Utilizza audio di alta qualità: <xliff:g id="CODEC_NAME">%1$s</xliff:g>"</string>
+    <string name="bluetooth_profile_a2dp_high_quality_unknown_codec" msgid="5860996587596508755">"Utilizza audio di alta qualità"</string>
     <string name="bluetooth_a2dp_profile_summary_connected" msgid="963376081347721598">"Collegato ad audio media"</string>
     <string name="bluetooth_headset_profile_summary_connected" msgid="7661070206715520671">"Collegato ad audio telefono"</string>
     <string name="bluetooth_opp_profile_summary_connected" msgid="2611913495968309066">"Collegato al server di trasferimento file"</string>
diff --git a/packages/SettingsLib/res/values-iw/strings.xml b/packages/SettingsLib/res/values-iw/strings.xml
index 9b3686d..213aaf3 100644
--- a/packages/SettingsLib/res/values-iw/strings.xml
+++ b/packages/SettingsLib/res/values-iw/strings.xml
@@ -56,10 +56,8 @@
     <string name="bluetooth_profile_pan_nap" msgid="8429049285027482959">"שיתוף חיבור לאינטרנט"</string>
     <string name="bluetooth_profile_map" msgid="5465271250454324383">"גישה להודעות"</string>
     <string name="bluetooth_profile_sap" msgid="5764222021851283125">"‏גישה ל-SIM"</string>
-    <!-- no translation found for bluetooth_profile_a2dp_high_quality (2221025895896419505) -->
-    <skip />
-    <!-- no translation found for bluetooth_profile_a2dp_high_quality_unknown_codec (5860996587596508755) -->
-    <skip />
+    <string name="bluetooth_profile_a2dp_high_quality" msgid="2221025895896419505">"השתמש באודיו באיכות גבוהה: <xliff:g id="CODEC_NAME">%1$s</xliff:g>"</string>
+    <string name="bluetooth_profile_a2dp_high_quality_unknown_codec" msgid="5860996587596508755">"השתמש באודיו באיכות גבוהה"</string>
     <string name="bluetooth_a2dp_profile_summary_connected" msgid="963376081347721598">"מחובר לאודיו של מדיה"</string>
     <string name="bluetooth_headset_profile_summary_connected" msgid="7661070206715520671">"מחובר לאודיו של הטלפון"</string>
     <string name="bluetooth_opp_profile_summary_connected" msgid="2611913495968309066">"מחובר לשרת העברת קבצים"</string>
@@ -81,7 +79,7 @@
     <string name="bluetooth_pairing_decline" msgid="4185420413578948140">"ביטול"</string>
     <string name="bluetooth_pairing_will_share_phonebook" msgid="4982239145676394429">"לאחר החיבור, התאמה מספקת גישה לאנשי הקשר ולהיסטוריית השיחות שלך."</string>
     <string name="bluetooth_pairing_error_message" msgid="3748157733635947087">"לא ניתן לבצע התאמה עם <xliff:g id="DEVICE_NAME">%1$s</xliff:g>."</string>
-    <string name="bluetooth_pairing_pin_error_message" msgid="8337234855188925274">"‏לא ניתן להתאים את <xliff:g id="DEVICE_NAME">%1$s</xliff:g> בשל קוד PIN או סיסמה שגויים."</string>
+    <string name="bluetooth_pairing_pin_error_message" msgid="8337234855188925274">"לא ניתן להתאים את <xliff:g id="DEVICE_NAME">%1$s</xliff:g> בשל קוד גישה או סיסמה שגויים."</string>
     <string name="bluetooth_pairing_device_down_error_message" msgid="7870998403045801381">"לא ניתן לתקשר עם <xliff:g id="DEVICE_NAME">%1$s</xliff:g>."</string>
     <string name="bluetooth_pairing_rejected_error_message" msgid="1648157108520832454">"ההתאמה נדחתה על ידי <xliff:g id="DEVICE_NAME">%1$s</xliff:g>."</string>
     <string name="accessibility_wifi_off" msgid="1166761729660614716">"‏Wi-Fi כבוי."</string>
@@ -274,7 +272,7 @@
     <string name="app_process_limit_title" msgid="4280600650253107163">"מגבלה של תהליכים ברקע"</string>
     <string name="show_all_anrs" msgid="28462979638729082">"‏הצג את כל פריטי ה-ANR"</string>
     <string name="show_all_anrs_summary" msgid="641908614413544127">"הצג תיבת דו-שיח של \'אפליקציה לא מגיבה\' עבור אפליקציות שפועלות ברקע"</string>
-    <string name="force_allow_on_external" msgid="3215759785081916381">"אילוץ הרשאה של אפליקציות באחסון חיצוני"</string>
+    <string name="force_allow_on_external" msgid="3215759785081916381">"אילוץ הרשאת אפליקציות באחסון חיצוני"</string>
     <string name="force_allow_on_external_summary" msgid="3640752408258034689">"מאפשר כתיבה של כל אפליקציה באחסון חיצוני, ללא התחשבות בערכי המניפסט"</string>
     <string name="force_resizable_activities" msgid="8615764378147824985">"אלץ יכולת קביעת גודל של הפעילויות"</string>
     <string name="force_resizable_activities_summary" msgid="6667493494706124459">"אפשר יכולת קביעת גודל של כל הפעילויות לריבוי חלונות, ללא קשר לערך המניפסט."</string>
diff --git a/packages/SettingsLib/res/values-ja/strings.xml b/packages/SettingsLib/res/values-ja/strings.xml
index 57f20bf..440b04d 100644
--- a/packages/SettingsLib/res/values-ja/strings.xml
+++ b/packages/SettingsLib/res/values-ja/strings.xml
@@ -56,10 +56,8 @@
     <string name="bluetooth_profile_pan_nap" msgid="8429049285027482959">"インターネット接続の共有"</string>
     <string name="bluetooth_profile_map" msgid="5465271250454324383">"メッセージへのアクセス"</string>
     <string name="bluetooth_profile_sap" msgid="5764222021851283125">"SIMアクセス"</string>
-    <!-- no translation found for bluetooth_profile_a2dp_high_quality (2221025895896419505) -->
-    <skip />
-    <!-- no translation found for bluetooth_profile_a2dp_high_quality_unknown_codec (5860996587596508755) -->
-    <skip />
+    <string name="bluetooth_profile_a2dp_high_quality" msgid="2221025895896419505">"高品質音声を使用: <xliff:g id="CODEC_NAME">%1$s</xliff:g>"</string>
+    <string name="bluetooth_profile_a2dp_high_quality_unknown_codec" msgid="5860996587596508755">"高品質音声を使用"</string>
     <string name="bluetooth_a2dp_profile_summary_connected" msgid="963376081347721598">"メディアの音声に接続"</string>
     <string name="bluetooth_headset_profile_summary_connected" msgid="7661070206715520671">"携帯電話の音声に接続"</string>
     <string name="bluetooth_opp_profile_summary_connected" msgid="2611913495968309066">"ファイル転送サーバーに接続"</string>
diff --git a/packages/SettingsLib/res/values-ka/strings.xml b/packages/SettingsLib/res/values-ka/strings.xml
index bac03c7..088d295 100644
--- a/packages/SettingsLib/res/values-ka/strings.xml
+++ b/packages/SettingsLib/res/values-ka/strings.xml
@@ -56,10 +56,8 @@
     <string name="bluetooth_profile_pan_nap" msgid="8429049285027482959">"ინტერნეტ კავშირის გაზიარება"</string>
     <string name="bluetooth_profile_map" msgid="5465271250454324383">"შეტყობინებებზე წვდომა"</string>
     <string name="bluetooth_profile_sap" msgid="5764222021851283125">"SIM წვდომა"</string>
-    <!-- no translation found for bluetooth_profile_a2dp_high_quality (2221025895896419505) -->
-    <skip />
-    <!-- no translation found for bluetooth_profile_a2dp_high_quality_unknown_codec (5860996587596508755) -->
-    <skip />
+    <string name="bluetooth_profile_a2dp_high_quality" msgid="2221025895896419505">"მაღალხარისხიანი აუდიოს გამოყენება: <xliff:g id="CODEC_NAME">%1$s</xliff:g>"</string>
+    <string name="bluetooth_profile_a2dp_high_quality_unknown_codec" msgid="5860996587596508755">"მაღალხარისხიანი აუდიოს გამოყენება"</string>
     <string name="bluetooth_a2dp_profile_summary_connected" msgid="963376081347721598">"დაკავშირებულია აუდიო მულტიმედიურ სისტემასთან"</string>
     <string name="bluetooth_headset_profile_summary_connected" msgid="7661070206715520671">"დაკავშირებულია ტელეფონის აუდიო მოწყობილობასთან"</string>
     <string name="bluetooth_opp_profile_summary_connected" msgid="2611913495968309066">"დაკავშირებულია ფაილების გადაცემის სერვერთან"</string>
diff --git a/packages/SettingsLib/res/values-kk/strings.xml b/packages/SettingsLib/res/values-kk/strings.xml
index 7af0535..cc8b662 100644
--- a/packages/SettingsLib/res/values-kk/strings.xml
+++ b/packages/SettingsLib/res/values-kk/strings.xml
@@ -56,10 +56,8 @@
     <string name="bluetooth_profile_pan_nap" msgid="8429049285027482959">"Интернет байланысын ортақ қолдану"</string>
     <string name="bluetooth_profile_map" msgid="5465271250454324383">"Хабарға кіру"</string>
     <string name="bluetooth_profile_sap" msgid="5764222021851283125">"SIM картасына кіру"</string>
-    <!-- no translation found for bluetooth_profile_a2dp_high_quality (2221025895896419505) -->
-    <skip />
-    <!-- no translation found for bluetooth_profile_a2dp_high_quality_unknown_codec (5860996587596508755) -->
-    <skip />
+    <string name="bluetooth_profile_a2dp_high_quality" msgid="2221025895896419505">"Жоғары сапалы аудио дыбысын пайдалану: <xliff:g id="CODEC_NAME">%1$s</xliff:g>"</string>
+    <string name="bluetooth_profile_a2dp_high_quality_unknown_codec" msgid="5860996587596508755">"Жоғары сапалы аудио дыбысын пайдалану"</string>
     <string name="bluetooth_a2dp_profile_summary_connected" msgid="963376081347721598">"Медиа аудиосына жалғанған"</string>
     <string name="bluetooth_headset_profile_summary_connected" msgid="7661070206715520671">"Телефон аудиосына қосылған"</string>
     <string name="bluetooth_opp_profile_summary_connected" msgid="2611913495968309066">"Файл жіберу серверіне жалғанған"</string>
diff --git a/packages/SettingsLib/res/values-km/strings.xml b/packages/SettingsLib/res/values-km/strings.xml
index a8d1aa0..d299ec6 100644
--- a/packages/SettingsLib/res/values-km/strings.xml
+++ b/packages/SettingsLib/res/values-km/strings.xml
@@ -56,10 +56,8 @@
     <string name="bluetooth_profile_pan_nap" msgid="8429049285027482959">"ចែករំលែក​ការ​តភ្ជាប់​អ៊ីនធឺណិត"</string>
     <string name="bluetooth_profile_map" msgid="5465271250454324383">"​​ចូល​ដំណើរការ​សារ"</string>
     <string name="bluetooth_profile_sap" msgid="5764222021851283125">"ការចូលដំណើរការស៊ីម"</string>
-    <!-- no translation found for bluetooth_profile_a2dp_high_quality (2221025895896419505) -->
-    <skip />
-    <!-- no translation found for bluetooth_profile_a2dp_high_quality_unknown_codec (5860996587596508755) -->
-    <skip />
+    <string name="bluetooth_profile_a2dp_high_quality" msgid="2221025895896419505">"ប្រើ​សំឡេង​គុណភាព​ខ្ពស់៖ <xliff:g id="CODEC_NAME">%1$s</xliff:g>"</string>
+    <string name="bluetooth_profile_a2dp_high_quality_unknown_codec" msgid="5860996587596508755">"ប្រើ​សំឡេង​គុណភាព​ខ្ពស់"</string>
     <string name="bluetooth_a2dp_profile_summary_connected" msgid="963376081347721598">"បា​ន​ភ្ជាប់​ទៅ​អូឌីយ៉ូ​មេឌៀ"</string>
     <string name="bluetooth_headset_profile_summary_connected" msgid="7661070206715520671">"តភ្ជាប់​ទៅ​អូឌីយ៉ូ​ទូរស័ព្ទ"</string>
     <string name="bluetooth_opp_profile_summary_connected" msgid="2611913495968309066">"បាន​តភ្ជាប់​ទៅ​ម៉ាស៊ីន​មេ​ផ្ទេរ​ឯកសារ"</string>
@@ -146,7 +144,7 @@
     <string name="choose_profile" msgid="6921016979430278661">"ជ្រើសរើស​កម្រងព័ត៌មាន"</string>
     <string name="category_personal" msgid="1299663247844969448">"ផ្ទាល់ខ្លួន"</string>
     <string name="category_work" msgid="8699184680584175622">"កន្លែង​ធ្វើការ"</string>
-    <string name="development_settings_title" msgid="215179176067683667">"ជម្រើស​អ្នក​អភិវឌ្ឍ"</string>
+    <string name="development_settings_title" msgid="215179176067683667">"ជម្រើស​អ្នក​អភិវឌ្ឍន៍"</string>
     <string name="development_settings_enable" msgid="542530994778109538">"បើកដំណើរការជម្រើសអ្នកអភិវឌ្ឍន៍"</string>
     <string name="development_settings_summary" msgid="1815795401632854041">"កំណត់​ជម្រើស​សម្រាប់​ការ​អភិវឌ្ឍ​កម្មវិធី"</string>
     <string name="development_settings_not_available" msgid="4308569041701535607">"ជម្រើស​អ្នក​អភិវឌ្ឍ​មិន​អាច​ប្រើ​បាន​សម្រាប់​អ្នក​ប្រើ​នេះ"</string>
@@ -301,15 +299,15 @@
     <string name="inactive_app_active_summary" msgid="4174921824958516106">"សកម្ម។ ប៉ះដើម្បីបិទ/បើក។"</string>
     <string name="runningservices_settings_title" msgid="8097287939865165213">"សេវាកម្ម​កំពុង​ដំណើរការ"</string>
     <string name="runningservices_settings_summary" msgid="854608995821032748">"មើល និង​គ្រប់គ្រង​សេវាកម្ម​កំពុង​ដំណើរការ​បច្ចុប្បន្ន"</string>
-    <string name="select_webview_provider_title" msgid="4628592979751918907">"ការប្រតិបត្តិ WebView"</string>
+    <string name="select_webview_provider_title" msgid="4628592979751918907">"ការអនុវត្ត WebView"</string>
     <string name="select_webview_provider_dialog_title" msgid="4370551378720004872">"កំណត់ការប្រតិបត្តិ WebView"</string>
     <string name="select_webview_provider_toast_text" msgid="5466970498308266359">"ជម្រើសនេះលែងមានសុពលភាពទៀតហើយ ព្យាយាមម្តងទៀត"</string>
-    <string name="convert_to_file_encryption" msgid="3060156730651061223">"បម្លែងទៅជាការអ៊ីនគ្រីបឯកសារ"</string>
+    <string name="convert_to_file_encryption" msgid="3060156730651061223">"បំប្លែងទៅជាការអ៊ិនគ្រីបឯកសារ"</string>
     <string name="convert_to_file_encryption_enabled" msgid="2861258671151428346">"បម្លែង…"</string>
     <string name="convert_to_file_encryption_done" msgid="7859766358000523953">"បានអ៊ីនគ្រីបឯកសាររួចហើយ"</string>
     <string name="title_convert_fbe" msgid="1263622876196444453">"កំពុងបម្លែងទៅការអ៊ីនគ្រីបដែលផ្អែកលើឯកសារ"</string>
-    <string name="convert_to_fbe_warning" msgid="6139067817148865527">"បម្លែងការបែងចែកទិន្នន័យទៅជាការអ៊ីនគ្រីបដែលផ្អែកលើឯកសារ។\n !!ព្រមាន!! សកម្មភាពនេះនឹងលុបទិន្នន័យរបស់អ្នកទាំងអស់។\n លក្ខណៈពិសេសនេះជាការសាកល្បងដំបូង ហើយអាចនឹងដំណើរការមិនប្រក្រតី។\n សូមចុច \'សម្អាត និងបម្លែង...\' ដើម្បីបន្ត។"</string>
-    <string name="button_convert_fbe" msgid="5152671181309826405">"សម្អាត និងបម្លែង…"</string>
+    <string name="convert_to_fbe_warning" msgid="6139067817148865527">"បំប្លែងការបែងចែកទិន្នន័យទៅជាការអ៊ិនគ្រីបដែលផ្អែកលើឯកសារ។\n !!ព្រមាន!! សកម្មភាពនេះនឹងលុបទិន្នន័យរបស់អ្នកទាំងអស់។\n មុខងារនេះសំខាន់ណាស់ ហើយអាចនឹងដំណើរការមិនប្រក្រតី។\n សូមចុច \'សម្អាត និងបំប្លែង...\' ដើម្បីបន្ត។"</string>
+    <string name="button_convert_fbe" msgid="5152671181309826405">"សម្អាត និងបំប្លែង…"</string>
     <string name="picture_color_mode" msgid="4560755008730283695">"របៀបនៃពណ៌រូបភាព"</string>
     <string name="picture_color_mode_desc" msgid="1141891467675548590">"ប្រើ sRGB"</string>
     <string name="daltonizer_mode_disabled" msgid="7482661936053801862">"បាន​បិទ"</string>
@@ -318,7 +316,7 @@
     <string name="daltonizer_mode_protanomaly" msgid="8424148009038666065">"Protanomaly (ក្រហម​ពណ៌​បៃតង​)"</string>
     <string name="daltonizer_mode_tritanomaly" msgid="481725854987912389">"Tritanomaly (ពណ៌​ខៀវ​-លឿង​)"</string>
     <string name="accessibility_display_daltonizer_preference_title" msgid="5800761362678707872">"ការ​កែ​ពណ៌"</string>
-    <string name="accessibility_display_daltonizer_preference_subtitle" msgid="3484969015295282911">"លក្ខណៈ​នេះ​គឺ​ជា​ការ​ពិសោធន៍ ហើយ​អាច​ប៉ះពាល់​ការ​អនុវត្ត។"</string>
+    <string name="accessibility_display_daltonizer_preference_subtitle" msgid="3484969015295282911">"មុខងារនេះ​គឺ​ជា​ការ​ពិសោធន៍ ហើយ​អាច​ប៉ះពាល់​ដំណើរការ​។"</string>
     <string name="daltonizer_type_overridden" msgid="3116947244410245916">"បដិសេធ​ដោយ <xliff:g id="TITLE">%1$s</xliff:g>"</string>
     <string name="power_remaining_duration_only" msgid="845431008899029842">"សល់​ប្រហែល <xliff:g id="TIME">%1$s</xliff:g>"</string>
     <string name="power_remaining_charging_duration_only" msgid="1421102457410268886">"សល់ <xliff:g id="TIME">%1$s</xliff:g> ទើប​សាកថ្ម​ពេញ"</string>
diff --git a/packages/SettingsLib/res/values-kn/arrays.xml b/packages/SettingsLib/res/values-kn/arrays.xml
index d275f37..810aefe 100644
--- a/packages/SettingsLib/res/values-kn/arrays.xml
+++ b/packages/SettingsLib/res/values-kn/arrays.xml
@@ -50,8 +50,8 @@
   </string-array>
   <string-array name="hdcp_checking_titles">
     <item msgid="441827799230089869">"ಎಂದಿಗೂ ಪರಿಶೀಲಿಸದಿರು"</item>
-    <item msgid="6042769699089883931">"DRM ವಿಷಯಗಳಿಗಾಗಿ ಮಾತ್ರ ಪರಿಶೀಲಿಸಿ"</item>
-    <item msgid="9174900380056846820">"ಯಾವಾಗಲೂ ಪರಿಶೀಲಿಸಿ"</item>
+    <item msgid="6042769699089883931">"DRM ವಿಷಯಗಳನ್ನು ಮಾತ್ರ ಪರಿಶೀಲಿಸು"</item>
+    <item msgid="9174900380056846820">"ಯಾವಾಗಲೂ ಪರಿಶೀಲಿಸು"</item>
   </string-array>
   <string-array name="hdcp_checking_summaries">
     <item msgid="505558545611516707">"HDCP ಪರಿಶೀಲನೆಯನ್ನು ಎಂದಿಗೂ ಬಳಸದಿರು"</item>
diff --git a/packages/SettingsLib/res/values-kn/strings.xml b/packages/SettingsLib/res/values-kn/strings.xml
index 1d5c871..0120658 100644
--- a/packages/SettingsLib/res/values-kn/strings.xml
+++ b/packages/SettingsLib/res/values-kn/strings.xml
@@ -56,10 +56,8 @@
     <string name="bluetooth_profile_pan_nap" msgid="8429049285027482959">"ಇಂಟರ್ನೆಟ್ ಸಂಪರ್ಕ ಹಂಚಿಕೊಳ್ಳುವಿಕೆ"</string>
     <string name="bluetooth_profile_map" msgid="5465271250454324383">"ಸಂದೇಶ ಪ್ರವೇಶಿಸುವಿಕೆ"</string>
     <string name="bluetooth_profile_sap" msgid="5764222021851283125">"ಸಿಮ್ ಪ್ರವೇಶ"</string>
-    <!-- no translation found for bluetooth_profile_a2dp_high_quality (2221025895896419505) -->
-    <skip />
-    <!-- no translation found for bluetooth_profile_a2dp_high_quality_unknown_codec (5860996587596508755) -->
-    <skip />
+    <string name="bluetooth_profile_a2dp_high_quality" msgid="2221025895896419505">"ಉನ್ನತ ಗುಣಮಟ್ಟದ ಆಡಿಯೋ ಬಳಸಿ: <xliff:g id="CODEC_NAME">%1$s</xliff:g>"</string>
+    <string name="bluetooth_profile_a2dp_high_quality_unknown_codec" msgid="5860996587596508755">"ಉನ್ನತ ಗುಣಮಟ್ಟದ ಆಡಿಯೋ ಬಳಸಿ"</string>
     <string name="bluetooth_a2dp_profile_summary_connected" msgid="963376081347721598">"ಮಾಧ್ಯಮ ಆಡಿಯೋಗೆ ಸಂಪರ್ಕಗೊಂಡಿದೆ"</string>
     <string name="bluetooth_headset_profile_summary_connected" msgid="7661070206715520671">"ಫೋನ್ ಆಡಿಯೋಗೆ ಸಂಪರ್ಕಗೊಂಡಿದೆ"</string>
     <string name="bluetooth_opp_profile_summary_connected" msgid="2611913495968309066">"ಫೈಲ್ ವರ್ಗಾವಣೆ ಸರ್ವರ್‌ಗೆ ಸಂಪರ್ಕಗೊಂಡಿದೆ"</string>
@@ -106,7 +104,7 @@
     <string name="launch_defaults_none" msgid="4241129108140034876">"ಡೀಫಾಲ್ಟ್‌ಗಳನ್ನು ಹೊಂದಿಸಲಾಗಿಲ್ಲ"</string>
     <string name="tts_settings" msgid="8186971894801348327">"ಪಠ್ಯದಿಂದ ಧ್ವನಿಗೆ ಸೆಟ್ಟಿಂಗ್‌ಗಳು"</string>
     <string name="tts_settings_title" msgid="1237820681016639683">"ಧ್ವನಿಗೆ-ಪಠ್ಯದ ಔಟ್‌ಪುಟ್‌"</string>
-    <string name="tts_default_rate_title" msgid="6030550998379310088">"ಧ್ವನಿಯ ದರ"</string>
+    <string name="tts_default_rate_title" msgid="6030550998379310088">"ಧ್ವನಿಯ ಪ್ರಮಾಣ"</string>
     <string name="tts_default_rate_summary" msgid="4061815292287182801">"ಪಠ್ಯವನ್ನು ಹೇಳಿದ ವೇಗ"</string>
     <string name="tts_default_pitch_title" msgid="6135942113172488671">"ಪಿಚ್"</string>
     <string name="tts_default_pitch_summary" msgid="1944885882882650009">"ಸಂಯೋಜಿತ ಧ್ವನಿಯ ಟೋನ್ ಮೇಲೆ ಪರಿಣಾಮ ಬೀರುತ್ತದೆ"</string>
@@ -202,8 +200,8 @@
     <string name="select_logpersist_dialog_title" msgid="4003400579973269060">"ಸಾಧನದಲ್ಲಿ ನಿರಂತರವಾಗಿ ಸಂಗ್ರಹಿಸಲು ಲಾಗ್ ಬಫರ್‌ಗಳನ್ನು ಆಯ್ಕೆಮಾಡಿ"</string>
     <string name="select_usb_configuration_title" msgid="2649938511506971843">"USB ಕಾನ್ಫಿಗರೇಶನ್ ಆಯ್ಕೆಮಾಡಿ"</string>
     <string name="select_usb_configuration_dialog_title" msgid="6385564442851599963">"USB ಕಾನ್ಫಿಗರೇಶನ್ ಆಯ್ಕೆಮಾಡಿ"</string>
-    <string name="allow_mock_location" msgid="2787962564578664888">"ಅಣಕು ಸ್ಥಾನಗಳನ್ನು ಅನುಮತಿಸು"</string>
-    <string name="allow_mock_location_summary" msgid="317615105156345626">"ಅಣಕು ಸ್ಥಾನಗಳನ್ನು ಅನುಮತಿಸು"</string>
+    <string name="allow_mock_location" msgid="2787962564578664888">"ಅಣಕು ಸ್ಥಾನಗಳನ್ನು ಅನುಮತಿಸಿ"</string>
+    <string name="allow_mock_location_summary" msgid="317615105156345626">"ಅಣಕು ಸ್ಥಾನಗಳನ್ನು ಅನುಮತಿಸಿ"</string>
     <string name="debug_view_attributes" msgid="6485448367803310384">"ವೀಕ್ಷಣೆ ಆಟ್ರಿಬ್ಯೂಟ್ ಪರಿಶೀಲನೆ"</string>
     <string name="mobile_data_always_on_summary" msgid="8149773901431697910">"ವೈ-ಫೈ ಸಕ್ರಿಯವಾಗಿರುವಾಗಲೂ, ಯಾವಾಗಲೂ ಮೊಬೈಲ್‌ ಡೇಟಾ ಸಕ್ರಿಯವಾಗಿರಿಸಿ (ವೇಗವಾಗಿ ನೆಟ್‌ವರ್ಕ್‌ ಬದಲಾಯಿಸಲು)."</string>
     <string name="adb_warning_title" msgid="6234463310896563253">"USB ಡೀಬಗ್ ಮಾಡುವಿಕೆಯನ್ನು ಅನುಮತಿಸುವುದೇ?"</string>
@@ -236,7 +234,7 @@
     <string name="debug_monitoring_category" msgid="7640508148375798343">"ಪರಿವೀಕ್ಷಣೆ ಮಾಡುವಿಕೆ"</string>
     <string name="strict_mode" msgid="1938795874357830695">"ಸ್ಟ್ರಿಕ್ಟ್‌‌ ಮೋಡ್ ಸಕ್ರಿಯ"</string>
     <string name="strict_mode_summary" msgid="142834318897332338">"ಅಪ್ಲಿಕೇಶನ್‌ಗಳು ಮುಖ್ಯ ಥ್ರೆಡ್‌ನಲ್ಲಿ ದೀರ್ಘ ಕಾರ್ಯಾಚರಣೆ ನಿರ್ವಹಿಸಿದಾಗ ಪರದೆಯನ್ನು ಫ್ಲ್ಯಾಶ್ ಮಾಡು"</string>
-    <string name="pointer_location" msgid="6084434787496938001">"ಪಾಯಿಂಟರ್ ಸ್ಥಾನ"</string>
+    <string name="pointer_location" msgid="6084434787496938001">"ಪಾಯಿಂಟರ್ ಸ್ಥಳ"</string>
     <string name="pointer_location_summary" msgid="840819275172753713">"ಪ್ರಸ್ತುತ ಸ್ಪರ್ಶ ಡೇಟಾ ತೋರಿಸುವ ಪರದೆಯ ಓವರ್‌ಲೇ"</string>
     <string name="show_touches" msgid="2642976305235070316">"ಟ್ಯಾಪ್‌ಗಳನ್ನು ತೋರಿಸು"</string>
     <string name="show_touches_summary" msgid="6101183132903926324">"ಟ್ಯಾಪ್‌ಗಳಿಗೆ ದೃಶ್ಯ ಪ್ರತಿಕ್ರಿಯೆ ತೋರಿಸು"</string>
@@ -301,15 +299,15 @@
     <string name="inactive_app_active_summary" msgid="4174921824958516106">"ಸಕ್ರಿಯ. ಟಾಗಲ್ ಮಾಡಲು ಟ್ಯಾಪ್ ಮಾಡಿ."</string>
     <string name="runningservices_settings_title" msgid="8097287939865165213">"ರನ್‌ ಆಗುತ್ತಿರುವ ಸೇವೆಗಳು"</string>
     <string name="runningservices_settings_summary" msgid="854608995821032748">"ಈಗ ರನ್‌ ಆಗುತ್ತಿರುವ ಸೇವೆಗಳನ್ನು ವೀಕ್ಷಿಸಿ ಮತ್ತು ನಿಯಂತ್ರಿಸಿ"</string>
-    <string name="select_webview_provider_title" msgid="4628592979751918907">"WebView ಅನುಷ್ಠಾನಗೊಳಿಸುವಿಕೆ"</string>
+    <string name="select_webview_provider_title" msgid="4628592979751918907">"WebView ಹೊಂದಿಸಿ"</string>
     <string name="select_webview_provider_dialog_title" msgid="4370551378720004872">"WebView ಅನುಷ್ಠಾನಗೊಳಿಸುವಿಕೆಯನ್ನು ಹೊಂದಿಸಿ"</string>
     <string name="select_webview_provider_toast_text" msgid="5466970498308266359">"ಈ ಆಯ್ಕೆಯು ಇನ್ನು ಮುಂದೆ ಮಾನ್ಯವಾಗಿರುವುದಿಲ್ಲ. ಮತ್ತೊಮ್ಮೆ ಪ್ರಯತ್ನಿಸಿ."</string>
     <string name="convert_to_file_encryption" msgid="3060156730651061223">"ಫೈಲ್ ಎನ್‌ಕ್ರಿಪ್ಶನ್‌ಗೆ ಪರಿವರ್ತಿಸು"</string>
     <string name="convert_to_file_encryption_enabled" msgid="2861258671151428346">"ಪರಿವರ್ತಿಸು…"</string>
     <string name="convert_to_file_encryption_done" msgid="7859766358000523953">"ಫೈಲ್ ಈಗಾಗಲೇ ಎನ್‌ಕ್ರಿಪ್ಟ್ ಮಾಡಲಾಗಿದೆ"</string>
     <string name="title_convert_fbe" msgid="1263622876196444453">"ಫೈಲ್ ಆಧಾರಿತ ಎನ್‌ಕ್ರಿಪ್ಶನ್‌ಗೆ ಪರಿವರ್ತಿಸಲಾಗುತ್ತಿದೆ"</string>
-    <string name="convert_to_fbe_warning" msgid="6139067817148865527">"ಡೇಟಾ ವಿಭಜನೆಯನ್ನು ಫೈಲ್ ಆಧಾರಿತ ಎನ್‌ಕ್ರಿಪ್ಶನ್ ಆಗಿ ಪರಿವರ್ತಿಸಿ.\n !!ಎಚ್ಚರಿಕೆ!! ಇದು ನಿಮ್ಮ ಎಲ್ಲ ಡೇಟಾವನ್ನು ಅಳಿಸುತ್ತದೆ.\n ಈ ವೈಶಿಷ್ಟ್ಯವು ಆಲ್ಫಾ ಆಗಿರುತ್ತದೆ ಮತ್ತು ಸರಿಯಾಗಿ ಕಾರ್ಯನಿರ್ವಹಿಸದೆ ಇರಬಹುದು.\n ಮುಂದುವರಿಸಲು \'ಅಳಿಸು ಮತ್ತು ಪರಿವರ್ತಿಸು…\' ಒತ್ತಿರಿ."</string>
-    <string name="button_convert_fbe" msgid="5152671181309826405">"ಅಳಿಸು ಮತ್ತು ಪರಿವರ್ತಿಸು…"</string>
+    <string name="convert_to_fbe_warning" msgid="6139067817148865527">"ಡೇಟಾ ವಿಭಜನೆಯನ್ನು ಫೈಲ್ ಆಧಾರಿತ ಎನ್‌ಕ್ರಿಪ್ಶನ್ ಆಗಿ ಪರಿವರ್ತಿಸಿ.\n !!ಎಚ್ಚರಿಕೆ!! ಇದು ನಿಮ್ಮ ಎಲ್ಲ ಡೇಟಾವನ್ನು ಅಳಿಸಿತ್ತದೆ.\n ಈ ವೈಶಿಷ್ಟ್ಯವು ಆಲ್ಫಾ ಆಗಿರುತ್ತದೆ ಮತ್ತು ಸರಿಯಾಗಿ ಕಾರ್ಯನಿರ್ವಹಿಸದೆ ಇರಬಹುದು.\n ಮುಂದುವರಿಸಲು \'ಅಳಿಸಿ ಮತ್ತು ಪರಿವರ್ತಿಸು…\' ಒತ್ತಿರಿ."</string>
+    <string name="button_convert_fbe" msgid="5152671181309826405">"ಅಳಿಸಿ ಮತ್ತು ಪರಿವರ್ತಿಸು…"</string>
     <string name="picture_color_mode" msgid="4560755008730283695">"ಚಿತ್ರ ಬಣ್ಣದ ಮೋಡ್"</string>
     <string name="picture_color_mode_desc" msgid="1141891467675548590">"sRGB ಬಳಸಿ"</string>
     <string name="daltonizer_mode_disabled" msgid="7482661936053801862">"ನಿಷ್ಕ್ರಿಯಗೊಳಿಸಲಾಗಿದೆ"</string>
diff --git a/packages/SettingsLib/res/values-ko/strings.xml b/packages/SettingsLib/res/values-ko/strings.xml
index 3458f90..c5f842e 100644
--- a/packages/SettingsLib/res/values-ko/strings.xml
+++ b/packages/SettingsLib/res/values-ko/strings.xml
@@ -56,10 +56,8 @@
     <string name="bluetooth_profile_pan_nap" msgid="8429049285027482959">"인터넷 연결 공유"</string>
     <string name="bluetooth_profile_map" msgid="5465271250454324383">"메시지 액세스"</string>
     <string name="bluetooth_profile_sap" msgid="5764222021851283125">"SIM 액세스"</string>
-    <!-- no translation found for bluetooth_profile_a2dp_high_quality (2221025895896419505) -->
-    <skip />
-    <!-- no translation found for bluetooth_profile_a2dp_high_quality_unknown_codec (5860996587596508755) -->
-    <skip />
+    <string name="bluetooth_profile_a2dp_high_quality" msgid="2221025895896419505">"고품질 오디오 사용: <xliff:g id="CODEC_NAME">%1$s</xliff:g>"</string>
+    <string name="bluetooth_profile_a2dp_high_quality_unknown_codec" msgid="5860996587596508755">"고품질 오디오 사용"</string>
     <string name="bluetooth_a2dp_profile_summary_connected" msgid="963376081347721598">"미디어 오디오에 연결됨"</string>
     <string name="bluetooth_headset_profile_summary_connected" msgid="7661070206715520671">"휴대전화 오디오에 연결됨"</string>
     <string name="bluetooth_opp_profile_summary_connected" msgid="2611913495968309066">"파일 전송 서버에 연결됨"</string>
diff --git a/packages/SettingsLib/res/values-ky/strings.xml b/packages/SettingsLib/res/values-ky/strings.xml
index 6263619..410f80b 100644
--- a/packages/SettingsLib/res/values-ky/strings.xml
+++ b/packages/SettingsLib/res/values-ky/strings.xml
@@ -56,10 +56,8 @@
     <string name="bluetooth_profile_pan_nap" msgid="8429049285027482959">"Интернет байланышын бөлүшүү"</string>
     <string name="bluetooth_profile_map" msgid="5465271250454324383">"Билдирүү алмашуу"</string>
     <string name="bluetooth_profile_sap" msgid="5764222021851283125">"SIM картаны пайдалануу мүмкүнчүлүгү"</string>
-    <!-- no translation found for bluetooth_profile_a2dp_high_quality (2221025895896419505) -->
-    <skip />
-    <!-- no translation found for bluetooth_profile_a2dp_high_quality_unknown_codec (5860996587596508755) -->
-    <skip />
+    <string name="bluetooth_profile_a2dp_high_quality" msgid="2221025895896419505">"Жогорку сапаттагы аудио кодекти колдонуу: <xliff:g id="CODEC_NAME">%1$s</xliff:g>"</string>
+    <string name="bluetooth_profile_a2dp_high_quality_unknown_codec" msgid="5860996587596508755">"Жогорку сапаттагы аудио кодекти колдонуу"</string>
     <string name="bluetooth_a2dp_profile_summary_connected" msgid="963376081347721598">"Медиа аудиого туташты"</string>
     <string name="bluetooth_headset_profile_summary_connected" msgid="7661070206715520671">"Телефон аудиосуна туташты"</string>
     <string name="bluetooth_opp_profile_summary_connected" msgid="2611913495968309066">"Файл өткөрүү серверине туташты"</string>
@@ -78,7 +76,7 @@
     <string name="bluetooth_hid_profile_summary_use_for" msgid="232727040453645139">"Киргизүү үчүн колдонулсун"</string>
     <string name="bluetooth_pairing_accept" msgid="6163520056536604875">"Жупташтыруу"</string>
     <string name="bluetooth_pairing_accept_all_caps" msgid="6061699265220789149">"ЖУПТАШТЫРУУ"</string>
-    <string name="bluetooth_pairing_decline" msgid="4185420413578948140">"Баш тартуу"</string>
+    <string name="bluetooth_pairing_decline" msgid="4185420413578948140">"Жок"</string>
     <string name="bluetooth_pairing_will_share_phonebook" msgid="4982239145676394429">"Жупташканда байланыштарыңыз менен чалуу таржымалыңызды пайдалана аласыз."</string>
     <string name="bluetooth_pairing_error_message" msgid="3748157733635947087">"<xliff:g id="DEVICE_NAME">%1$s</xliff:g> менен жупташуу мүмкүн эмес."</string>
     <string name="bluetooth_pairing_pin_error_message" msgid="8337234855188925274">"PIN же код туура эмес болгондуктан <xliff:g id="DEVICE_NAME">%1$s</xliff:g> туташуу мүмкүн эмес."</string>
@@ -93,9 +91,9 @@
     <string name="process_kernel_label" msgid="3916858646836739323">"Android OS"</string>
     <string name="data_usage_uninstalled_apps" msgid="614263770923231598">"Алынып салынган колдонмолор"</string>
     <string name="data_usage_uninstalled_apps_users" msgid="7986294489899813194">"Өчүрүлгөн колдонмолор жана колдонуучулар"</string>
-    <string name="tether_settings_title_usb" msgid="6688416425801386511">"USB жалгаштыруу"</string>
+    <string name="tether_settings_title_usb" msgid="6688416425801386511">"USB модем"</string>
     <string name="tether_settings_title_wifi" msgid="3277144155960302049">"Ташыма кошулуу чекити"</string>
-    <string name="tether_settings_title_bluetooth" msgid="355855408317564420">"Bluetooth жалгаштыруу"</string>
+    <string name="tether_settings_title_bluetooth" msgid="355855408317564420">"Bluetooth модем"</string>
     <string name="tether_settings_title_usb_bluetooth" msgid="5355828977109785001">"Жалгаштыруу"</string>
     <string name="tether_settings_title_all" msgid="8356136101061143841">"Жалгаштыруу жана ташыма чекит"</string>
     <string name="managed_user_title" msgid="8109605045406748842">"Жумуш профилинин колднмлр"</string>
@@ -113,7 +111,7 @@
     <string name="tts_default_lang_title" msgid="8018087612299820556">"Тил"</string>
     <string name="tts_lang_use_system" msgid="2679252467416513208">"Тутум тилин колдонуу"</string>
     <string name="tts_lang_not_selected" msgid="7395787019276734765">"Тил тандалган жок"</string>
-    <string name="tts_default_lang_summary" msgid="5219362163902707785">"Айтылган текст боюнча тилге тиешелүү үндү коёт"</string>
+    <string name="tts_default_lang_summary" msgid="5219362163902707785">"Текстти окуй турган тилди тандоо"</string>
     <string name="tts_play_example_title" msgid="7094780383253097230">"Үлгүнү угуу"</string>
     <string name="tts_play_example_summary" msgid="8029071615047894486">"Кепти синтездөөнүн кыскача көргөзмөсүн ойнотуу"</string>
     <string name="tts_install_data_title" msgid="4264378440508149986">"Үн дайындарын орнотуу"</string>
@@ -174,7 +172,7 @@
     <string name="wifi_verbose_logging" msgid="4203729756047242344">"Wi‑Fi дайын-даректүү протоколун иштетүү"</string>
     <string name="wifi_aggressive_handover" msgid="5309131983693661320">"Wi‑Fi начар болсо, мобилдик Инт-ке өтсүн"</string>
     <string name="wifi_allow_scan_with_traffic" msgid="3601853081178265786">"Wi-Fi Роуминг Скандоо мүмкүнчүлүгүнө ар дайым уруксат берилсин"</string>
-    <string name="mobile_data_always_on" msgid="8774857027458200434">"Мобилдик дайындар ар дайым иштетилсин"</string>
+    <string name="mobile_data_always_on" msgid="8774857027458200434">"Мобилдик Интернет иштей берсин"</string>
     <string name="bluetooth_disable_absolute_volume" msgid="2660673801947898809">"Үндүн абсолюттук деңгээли өчүрүлсүн"</string>
     <string name="bluetooth_enable_inband_ringing" msgid="3291686366721786740">"Канал аралык чалууну иштетүү"</string>
     <string name="bluetooth_select_avrcp_version_string" msgid="3750059931120293633">"Bluetooth AVRCP версиясы"</string>
@@ -351,7 +349,7 @@
     <string name="screen_zoom_summary_very_large" msgid="7108563375663670067">"Чоңураак"</string>
     <string name="screen_zoom_summary_extremely_large" msgid="7427320168263276227">"Эң чоң"</string>
     <string name="screen_zoom_summary_custom" msgid="5611979864124160447">"Ыңгайлаштырылган (<xliff:g id="DENSITYDPI">%d</xliff:g>)"</string>
-    <string name="help_feedback_label" msgid="6815040660801785649">"Жардам жана жооп пикир"</string>
+    <string name="help_feedback_label" msgid="6815040660801785649">"Жардам жана пикир билдирүү"</string>
     <string name="content_description_menu_button" msgid="8182594799812351266">"Меню"</string>
     <string name="time_zone_gmt" msgid="2587097992671450782">"GMT"</string>
     <string name="retail_demo_reset_message" msgid="118771671364131297">"Демо режиминде демейки жөндөөлөргө кайтаруу үчүн сырсөздү киргизиңиз"</string>
diff --git a/packages/SettingsLib/res/values-lo/strings.xml b/packages/SettingsLib/res/values-lo/strings.xml
index 2540053..5abd2a6 100644
--- a/packages/SettingsLib/res/values-lo/strings.xml
+++ b/packages/SettingsLib/res/values-lo/strings.xml
@@ -56,10 +56,8 @@
     <string name="bluetooth_profile_pan_nap" msgid="8429049285027482959">"ການແບ່ງປັນການເຊື່ອມຕໍ່ອິນເຕີເນັດ"</string>
     <string name="bluetooth_profile_map" msgid="5465271250454324383">"ການ​ເຂົ້າ​ເຖິງ​ຂໍ້​ຄວາມ"</string>
     <string name="bluetooth_profile_sap" msgid="5764222021851283125">"ການ​ເຂົ້າ​ເຖິງ SIM"</string>
-    <!-- no translation found for bluetooth_profile_a2dp_high_quality (2221025895896419505) -->
-    <skip />
-    <!-- no translation found for bluetooth_profile_a2dp_high_quality_unknown_codec (5860996587596508755) -->
-    <skip />
+    <string name="bluetooth_profile_a2dp_high_quality" msgid="2221025895896419505">"ໃຊ້ສຽງຄຸນນະພາບສູງ: <xliff:g id="CODEC_NAME">%1$s</xliff:g>"</string>
+    <string name="bluetooth_profile_a2dp_high_quality_unknown_codec" msgid="5860996587596508755">"ໃຊ້ສຽງຄຸນນະພາບສູງ"</string>
     <string name="bluetooth_a2dp_profile_summary_connected" msgid="963376081347721598">"ເຊື່ອມຕໍ່ກັບສື່ດ້ານສຽງແລ້ວ"</string>
     <string name="bluetooth_headset_profile_summary_connected" msgid="7661070206715520671">"ເຊື່ອມຕໍ່ກັບສຽງໂທລະສັບແລ້ວ"</string>
     <string name="bluetooth_opp_profile_summary_connected" msgid="2611913495968309066">"ເຊື່ອມຕໍ່ກັບເຊີບເວີໂອນຍ້າຍໄຟລ໌ແລ້ວ"</string>
diff --git a/packages/SettingsLib/res/values-lt/strings.xml b/packages/SettingsLib/res/values-lt/strings.xml
index bcc884a..830abf0 100644
--- a/packages/SettingsLib/res/values-lt/strings.xml
+++ b/packages/SettingsLib/res/values-lt/strings.xml
@@ -56,10 +56,8 @@
     <string name="bluetooth_profile_pan_nap" msgid="8429049285027482959">"Interneto ryšio bendrinimas"</string>
     <string name="bluetooth_profile_map" msgid="5465271250454324383">"Prieiga prie pranešimų"</string>
     <string name="bluetooth_profile_sap" msgid="5764222021851283125">"SIM prieiga"</string>
-    <!-- no translation found for bluetooth_profile_a2dp_high_quality (2221025895896419505) -->
-    <skip />
-    <!-- no translation found for bluetooth_profile_a2dp_high_quality_unknown_codec (5860996587596508755) -->
-    <skip />
+    <string name="bluetooth_profile_a2dp_high_quality" msgid="2221025895896419505">"Naudoti aukštos kokybės garsą: <xliff:g id="CODEC_NAME">%1$s</xliff:g>"</string>
+    <string name="bluetooth_profile_a2dp_high_quality_unknown_codec" msgid="5860996587596508755">"Naudoti aukštos kokybės garsą"</string>
     <string name="bluetooth_a2dp_profile_summary_connected" msgid="963376081347721598">"Prijungta prie medijos garso įrašo"</string>
     <string name="bluetooth_headset_profile_summary_connected" msgid="7661070206715520671">"Prijungta prie telefono garso"</string>
     <string name="bluetooth_opp_profile_summary_connected" msgid="2611913495968309066">"Prijungta prie failų perkėlimo serverio"</string>
diff --git a/packages/SettingsLib/res/values-lv/strings.xml b/packages/SettingsLib/res/values-lv/strings.xml
index 80bbee5..5749954 100644
--- a/packages/SettingsLib/res/values-lv/strings.xml
+++ b/packages/SettingsLib/res/values-lv/strings.xml
@@ -56,10 +56,8 @@
     <string name="bluetooth_profile_pan_nap" msgid="8429049285027482959">"Interneta savienojuma koplietošana"</string>
     <string name="bluetooth_profile_map" msgid="5465271250454324383">"Piekļuve ziņojumam"</string>
     <string name="bluetooth_profile_sap" msgid="5764222021851283125">"Piekļuve SIM kartei"</string>
-    <!-- no translation found for bluetooth_profile_a2dp_high_quality (2221025895896419505) -->
-    <skip />
-    <!-- no translation found for bluetooth_profile_a2dp_high_quality_unknown_codec (5860996587596508755) -->
-    <skip />
+    <string name="bluetooth_profile_a2dp_high_quality" msgid="2221025895896419505">"Izmantot augstas kvalitātes audio: <xliff:g id="CODEC_NAME">%1$s</xliff:g>"</string>
+    <string name="bluetooth_profile_a2dp_high_quality_unknown_codec" msgid="5860996587596508755">"Izmantot augstas kvalitātes audio"</string>
     <string name="bluetooth_a2dp_profile_summary_connected" msgid="963376081347721598">"Savienots ar multivides audio"</string>
     <string name="bluetooth_headset_profile_summary_connected" msgid="7661070206715520671">"Savienots ar tālruņa audio"</string>
     <string name="bluetooth_opp_profile_summary_connected" msgid="2611913495968309066">"Savienots ar failu pārsūtīšanas serveri"</string>
diff --git a/packages/SettingsLib/res/values-mk/strings.xml b/packages/SettingsLib/res/values-mk/strings.xml
index 17cff9a..f38ef5d 100644
--- a/packages/SettingsLib/res/values-mk/strings.xml
+++ b/packages/SettingsLib/res/values-mk/strings.xml
@@ -56,10 +56,8 @@
     <string name="bluetooth_profile_pan_nap" msgid="8429049285027482959">"Споделување конекција на интернет"</string>
     <string name="bluetooth_profile_map" msgid="5465271250454324383">"Порака за пристап"</string>
     <string name="bluetooth_profile_sap" msgid="5764222021851283125">"Пристап до СИМ"</string>
-    <!-- no translation found for bluetooth_profile_a2dp_high_quality (2221025895896419505) -->
-    <skip />
-    <!-- no translation found for bluetooth_profile_a2dp_high_quality_unknown_codec (5860996587596508755) -->
-    <skip />
+    <string name="bluetooth_profile_a2dp_high_quality" msgid="2221025895896419505">"Користи висококвалитетно аудио: <xliff:g id="CODEC_NAME">%1$s</xliff:g>"</string>
+    <string name="bluetooth_profile_a2dp_high_quality_unknown_codec" msgid="5860996587596508755">"Користи висококвалитетно аудио"</string>
     <string name="bluetooth_a2dp_profile_summary_connected" msgid="963376081347721598">"Поврзан со аудио на медиуми"</string>
     <string name="bluetooth_headset_profile_summary_connected" msgid="7661070206715520671">"Поврзан со аудио на телефон"</string>
     <string name="bluetooth_opp_profile_summary_connected" msgid="2611913495968309066">"Поврзан со сервер за пренос на датотеки"</string>
diff --git a/packages/SettingsLib/res/values-ml/strings.xml b/packages/SettingsLib/res/values-ml/strings.xml
index 9de75e1..7194505 100644
--- a/packages/SettingsLib/res/values-ml/strings.xml
+++ b/packages/SettingsLib/res/values-ml/strings.xml
@@ -56,10 +56,8 @@
     <string name="bluetooth_profile_pan_nap" msgid="8429049285027482959">"ഇന്റർനെറ്റ് കണക്ഷൻ പങ്കിടൽ"</string>
     <string name="bluetooth_profile_map" msgid="5465271250454324383">"ആക്‌സസ്സ് നിയന്ത്രിക്കുക"</string>
     <string name="bluetooth_profile_sap" msgid="5764222021851283125">"SIM ആക്സസ്"</string>
-    <!-- no translation found for bluetooth_profile_a2dp_high_quality (2221025895896419505) -->
-    <skip />
-    <!-- no translation found for bluetooth_profile_a2dp_high_quality_unknown_codec (5860996587596508755) -->
-    <skip />
+    <string name="bluetooth_profile_a2dp_high_quality" msgid="2221025895896419505">"ഉയർന്ന നിലവാരമുള്ള ഓഡിയോ ഉപയോഗിക്കുക: <xliff:g id="CODEC_NAME">%1$s</xliff:g>"</string>
+    <string name="bluetooth_profile_a2dp_high_quality_unknown_codec" msgid="5860996587596508755">"ഉയർന്ന നിലവാരമുള്ള ഓഡിയോ ഉപയോഗിക്കുക"</string>
     <string name="bluetooth_a2dp_profile_summary_connected" msgid="963376081347721598">"മീഡിയ ഓഡിയോയിലേക്ക് കണ‌ക്റ്റുചെയ്‌തു"</string>
     <string name="bluetooth_headset_profile_summary_connected" msgid="7661070206715520671">"ഫോൺ ഓഡിയോയിൽ കണ‌ക്റ്റുചെ‌യ്‌തു"</string>
     <string name="bluetooth_opp_profile_summary_connected" msgid="2611913495968309066">"ഫയൽ കൈമാറ്റ സെർവറിലേക്ക് കണ‌ക്റ്റുചെ‌യ്‌തു"</string>
diff --git a/packages/SettingsLib/res/values-mn/strings.xml b/packages/SettingsLib/res/values-mn/strings.xml
index 09ce7c0..c11fa9f 100644
--- a/packages/SettingsLib/res/values-mn/strings.xml
+++ b/packages/SettingsLib/res/values-mn/strings.xml
@@ -56,10 +56,8 @@
     <string name="bluetooth_profile_pan_nap" msgid="8429049285027482959">"Интернэт холболтыг хуваалцах"</string>
     <string name="bluetooth_profile_map" msgid="5465271250454324383">"Зурвас хандалт"</string>
     <string name="bluetooth_profile_sap" msgid="5764222021851283125">"SIM Хандалт"</string>
-    <!-- no translation found for bluetooth_profile_a2dp_high_quality (2221025895896419505) -->
-    <skip />
-    <!-- no translation found for bluetooth_profile_a2dp_high_quality_unknown_codec (5860996587596508755) -->
-    <skip />
+    <string name="bluetooth_profile_a2dp_high_quality" msgid="2221025895896419505">"Өндөр чанарын аудио ашиглах: <xliff:g id="CODEC_NAME">%1$s</xliff:g>"</string>
+    <string name="bluetooth_profile_a2dp_high_quality_unknown_codec" msgid="5860996587596508755">"Өндөр чанарын аудио ашиглах"</string>
     <string name="bluetooth_a2dp_profile_summary_connected" msgid="963376081347721598">"Медиа аудиод холбогдсон"</string>
     <string name="bluetooth_headset_profile_summary_connected" msgid="7661070206715520671">"Утасны аудид холбогдсон"</string>
     <string name="bluetooth_opp_profile_summary_connected" msgid="2611913495968309066">"Файл дамжуулах серверт холбогдсон"</string>
diff --git a/packages/SettingsLib/res/values-mr/strings.xml b/packages/SettingsLib/res/values-mr/strings.xml
index e020ca4..a45648e 100644
--- a/packages/SettingsLib/res/values-mr/strings.xml
+++ b/packages/SettingsLib/res/values-mr/strings.xml
@@ -56,10 +56,8 @@
     <string name="bluetooth_profile_pan_nap" msgid="8429049285027482959">"इंटरनेट कनेक्शन सामायिकरण"</string>
     <string name="bluetooth_profile_map" msgid="5465271250454324383">"संदेशात प्रवेश"</string>
     <string name="bluetooth_profile_sap" msgid="5764222021851283125">"सिम प्रवेश"</string>
-    <!-- no translation found for bluetooth_profile_a2dp_high_quality (2221025895896419505) -->
-    <skip />
-    <!-- no translation found for bluetooth_profile_a2dp_high_quality_unknown_codec (5860996587596508755) -->
-    <skip />
+    <string name="bluetooth_profile_a2dp_high_quality" msgid="2221025895896419505">"उच्च दर्जाचा ऑडिओ वापरा: <xliff:g id="CODEC_NAME">%1$s</xliff:g>"</string>
+    <string name="bluetooth_profile_a2dp_high_quality_unknown_codec" msgid="5860996587596508755">"उच्च दर्जाचा ऑडिओ वापरा"</string>
     <string name="bluetooth_a2dp_profile_summary_connected" msgid="963376081347721598">"मीडिया ऑडिओवर कनेक्ट केले"</string>
     <string name="bluetooth_headset_profile_summary_connected" msgid="7661070206715520671">"फोन ऑडिओ वर कनेक्ट केले"</string>
     <string name="bluetooth_opp_profile_summary_connected" msgid="2611913495968309066">"फाईल स्थानांतर सर्व्हरवर कनेक्ट केले"</string>
diff --git a/packages/SettingsLib/res/values-ms/strings.xml b/packages/SettingsLib/res/values-ms/strings.xml
index 3f264c3..6ca514b 100644
--- a/packages/SettingsLib/res/values-ms/strings.xml
+++ b/packages/SettingsLib/res/values-ms/strings.xml
@@ -56,10 +56,8 @@
     <string name="bluetooth_profile_pan_nap" msgid="8429049285027482959">"Perkongsian sambungan Internet"</string>
     <string name="bluetooth_profile_map" msgid="5465271250454324383">"Akses Mesej"</string>
     <string name="bluetooth_profile_sap" msgid="5764222021851283125">"Akses SIM"</string>
-    <!-- no translation found for bluetooth_profile_a2dp_high_quality (2221025895896419505) -->
-    <skip />
-    <!-- no translation found for bluetooth_profile_a2dp_high_quality_unknown_codec (5860996587596508755) -->
-    <skip />
+    <string name="bluetooth_profile_a2dp_high_quality" msgid="2221025895896419505">"Gunakan audio berkualiti tinggi: <xliff:g id="CODEC_NAME">%1$s</xliff:g>"</string>
+    <string name="bluetooth_profile_a2dp_high_quality_unknown_codec" msgid="5860996587596508755">"Gunakan audio berkualiti tinggi"</string>
     <string name="bluetooth_a2dp_profile_summary_connected" msgid="963376081347721598">"Disambungkan ke audio media"</string>
     <string name="bluetooth_headset_profile_summary_connected" msgid="7661070206715520671">"Disambungkan ke audio telefon"</string>
     <string name="bluetooth_opp_profile_summary_connected" msgid="2611913495968309066">"Bersambung ke pelayan pemindahan fail"</string>
diff --git a/packages/SettingsLib/res/values-my/arrays.xml b/packages/SettingsLib/res/values-my/arrays.xml
index 484c95a..85d6002 100644
--- a/packages/SettingsLib/res/values-my/arrays.xml
+++ b/packages/SettingsLib/res/values-my/arrays.xml
@@ -50,7 +50,7 @@
   </string-array>
   <string-array name="hdcp_checking_titles">
     <item msgid="441827799230089869">"ဘယ်တော့မှ မစစ်ဆေးပါနှင့်"</item>
-    <item msgid="6042769699089883931">"DRMအကြောင်းအရာကိုသာ စစ်ဆေးမည်"</item>
+    <item msgid="6042769699089883931">"DRM အကြောင်းအရာကိုသာ စစ်ဆေးရန်"</item>
     <item msgid="9174900380056846820">"အမြဲစစ်ဆေးရန်"</item>
   </string-array>
   <string-array name="hdcp_checking_summaries">
diff --git a/packages/SettingsLib/res/values-my/strings.xml b/packages/SettingsLib/res/values-my/strings.xml
index 6697eb1..21bc2dc 100644
--- a/packages/SettingsLib/res/values-my/strings.xml
+++ b/packages/SettingsLib/res/values-my/strings.xml
@@ -56,10 +56,8 @@
     <string name="bluetooth_profile_pan_nap" msgid="8429049285027482959">"အင်တာနက်ဆက်သွယ်မှု မျှဝေခြင်း"</string>
     <string name="bluetooth_profile_map" msgid="5465271250454324383">"သတင်းရယူမှု"</string>
     <string name="bluetooth_profile_sap" msgid="5764222021851283125">"SIM အသုံးပြုခြင်း"</string>
-    <!-- no translation found for bluetooth_profile_a2dp_high_quality (2221025895896419505) -->
-    <skip />
-    <!-- no translation found for bluetooth_profile_a2dp_high_quality_unknown_codec (5860996587596508755) -->
-    <skip />
+    <string name="bluetooth_profile_a2dp_high_quality" msgid="2221025895896419505">"အရည်အသွေးမြင့် အသံအမျိုးအစားကို သုံးရန်− <xliff:g id="CODEC_NAME">%1$s</xliff:g>"</string>
+    <string name="bluetooth_profile_a2dp_high_quality_unknown_codec" msgid="5860996587596508755">"အရည်အသွေးမြင့် အသံအမျိုးအစားကိုသုံးရန်"</string>
     <string name="bluetooth_a2dp_profile_summary_connected" msgid="963376081347721598">"မီဒီယာအသံအား ချိတ်ဆက်ရန်"</string>
     <string name="bluetooth_headset_profile_summary_connected" msgid="7661070206715520671">"ဖုန်းအသံအား ချိတ်ဆက်ရန်"</string>
     <string name="bluetooth_opp_profile_summary_connected" msgid="2611913495968309066">"ဖိုင်လွှဲပြောင်းမည့်ဆာဗာနှင့် ချိတ်ဆက်ထားပြီး"</string>
@@ -169,7 +167,7 @@
     <string name="mock_location_app" msgid="7966220972812881854">"တည်နေရာအတုပြု အက်ပ်ရွေးရန်"</string>
     <string name="mock_location_app_not_set" msgid="809543285495344223">"တည်နေရာအတုပြ အက်ပ်သတ်မှတ်ထားခြင်းမရှိပါ"</string>
     <string name="mock_location_app_set" msgid="8966420655295102685">"တည်နေရာအတုပြ အက်ပ်- <xliff:g id="APP_NAME">%1$s</xliff:g>"</string>
-    <string name="debug_networking_category" msgid="7044075693643009662">"ကွန်ရက်လုပ်ငန်း"</string>
+    <string name="debug_networking_category" msgid="7044075693643009662">"ချိတ်ဆက်ဆောင်ရွက်ခြင်း"</string>
     <string name="wifi_display_certification" msgid="8611569543791307533">"ကြိုးမဲ့ပြသမှု အသိအမှတ်ပြုလက်မှတ်"</string>
     <string name="wifi_verbose_logging" msgid="4203729756047242344">"Wi‑Fi Verbose မှတ်တမ်းတင်ခြင်းအား ဖွင့်မည်"</string>
     <string name="wifi_aggressive_handover" msgid="5309131983693661320">"Wi‑Fi မှ မိုဘိုင်းသို့ လွှဲပြောင်းရန်"</string>
@@ -218,7 +216,7 @@
     <string name="enable_terminal_title" msgid="95572094356054120">"လိုကယ်တာမီနယ်"</string>
     <string name="enable_terminal_summary" msgid="67667852659359206">"local shell အသုံးပြုခွင့်ကမ်းလှမ်းသော တာမင်နယ်အပလီကေးရှင်းဖွင့်ပါ"</string>
     <string name="hdcp_checking_title" msgid="8605478913544273282">"HDCP စစ်ဆေးမှု"</string>
-    <string name="hdcp_checking_dialog_title" msgid="5141305530923283">"HDCPစစ်ဆေးခြင်းလုပ်ဆောင်မှုကို သတ်မှတ်မည်"</string>
+    <string name="hdcp_checking_dialog_title" msgid="5141305530923283">"HDCP စစ်ဆေးပုံကို သတ်မှတ်မည်"</string>
     <string name="debug_debugging_category" msgid="6781250159513471316">"အမှားရှာဖွေဖယ်ရှားခြင်း"</string>
     <string name="debug_app" msgid="8349591734751384446">"အမှားရှာသည့်အပလီကေးရှင်းရွေးချယ်ရန်"</string>
     <string name="debug_app_not_set" msgid="718752499586403499">"အမှားရှာသည့်အပလီကေးရှင်းတခုမှ မသတ်မှတ်ထားပါ"</string>
@@ -318,7 +316,7 @@
     <string name="daltonizer_mode_protanomaly" msgid="8424148009038666065">"Protanomaly (အနီ-အစိမ်း)"</string>
     <string name="daltonizer_mode_tritanomaly" msgid="481725854987912389">"Tritanomaly (အပြာ-အဝါ)"</string>
     <string name="accessibility_display_daltonizer_preference_title" msgid="5800761362678707872">"အရောင်ပြင်ဆင်မှု"</string>
-    <string name="accessibility_display_daltonizer_preference_subtitle" msgid="3484969015295282911">"ဒီအင်္ဂါရပ်မှာ စမ်းသပ်မှု ဖြစ်၍ လုပ်ကိုင်မှုကို အကျိုးသက်ရောက်နိုင်သည်။"</string>
+    <string name="accessibility_display_daltonizer_preference_subtitle" msgid="3484969015295282911">"ဤဝန်ဆောင်မှုမှာ စမ်းသပ်အဆင့်သာဖြစ်၍ လုပ်ဆောင်မှုအားနည်းနိုင်သည်။"</string>
     <string name="daltonizer_type_overridden" msgid="3116947244410245916">"<xliff:g id="TITLE">%1$s</xliff:g> မှ ကျော်၍ လုပ်ထားသည်။"</string>
     <string name="power_remaining_duration_only" msgid="845431008899029842">"<xliff:g id="TIME">%1$s</xliff:g> ခန့်လိုပါသည်"</string>
     <string name="power_remaining_charging_duration_only" msgid="1421102457410268886">"အားပြည့်ရန် <xliff:g id="TIME">%1$s</xliff:g> လိုပါသည်"</string>
diff --git a/packages/SettingsLib/res/values-nb/arrays.xml b/packages/SettingsLib/res/values-nb/arrays.xml
index e0f7663..287c386 100644
--- a/packages/SettingsLib/res/values-nb/arrays.xml
+++ b/packages/SettingsLib/res/values-nb/arrays.xml
@@ -49,9 +49,9 @@
     <item msgid="1805837518286731242">"Unngår dårlig tilkobling midlertidig"</item>
   </string-array>
   <string-array name="hdcp_checking_titles">
-    <item msgid="441827799230089869">"Aldri kontrollér"</item>
+    <item msgid="441827799230089869">"Kontrollér aldri"</item>
     <item msgid="6042769699089883931">"Kontrollér kun DRM-innhold"</item>
-    <item msgid="9174900380056846820">"Alltid kontrollér"</item>
+    <item msgid="9174900380056846820">"Kontrollér alltid"</item>
   </string-array>
   <string-array name="hdcp_checking_summaries">
     <item msgid="505558545611516707">"Bruk aldri HDCP-kontroll"</item>
diff --git a/packages/SettingsLib/res/values-nb/strings.xml b/packages/SettingsLib/res/values-nb/strings.xml
index 0be93b9..409ccab 100644
--- a/packages/SettingsLib/res/values-nb/strings.xml
+++ b/packages/SettingsLib/res/values-nb/strings.xml
@@ -56,10 +56,8 @@
     <string name="bluetooth_profile_pan_nap" msgid="8429049285027482959">"Deling av Internett-tilkobling"</string>
     <string name="bluetooth_profile_map" msgid="5465271250454324383">"Meldingstilgang"</string>
     <string name="bluetooth_profile_sap" msgid="5764222021851283125">"Tilgang til SIM-kortet"</string>
-    <!-- no translation found for bluetooth_profile_a2dp_high_quality (2221025895896419505) -->
-    <skip />
-    <!-- no translation found for bluetooth_profile_a2dp_high_quality_unknown_codec (5860996587596508755) -->
-    <skip />
+    <string name="bluetooth_profile_a2dp_high_quality" msgid="2221025895896419505">"Bruk lyd av høy kvalitet: <xliff:g id="CODEC_NAME">%1$s</xliff:g>"</string>
+    <string name="bluetooth_profile_a2dp_high_quality_unknown_codec" msgid="5860996587596508755">"Bruk lyd av høy kvalitet"</string>
     <string name="bluetooth_a2dp_profile_summary_connected" msgid="963376081347721598">"Koblet til medielyd"</string>
     <string name="bluetooth_headset_profile_summary_connected" msgid="7661070206715520671">"Koblet til telefonlyd"</string>
     <string name="bluetooth_opp_profile_summary_connected" msgid="2611913495968309066">"Koblet til tjener for filoverføring"</string>
@@ -308,7 +306,7 @@
     <string name="convert_to_file_encryption_enabled" msgid="2861258671151428346">"Konvertér …"</string>
     <string name="convert_to_file_encryption_done" msgid="7859766358000523953">"Allerede kryptert og lagret som fil"</string>
     <string name="title_convert_fbe" msgid="1263622876196444453">"Konvertér til filbasert kryptering"</string>
-    <string name="convert_to_fbe_warning" msgid="6139067817148865527">"Konvertér datapartisjonen til filbasert kryptering.\n !!Advarsel!! Dette sletter alle dataene dine.\n Dette er en alfafunksjon og kommer kanskje ikke til å fungere skikkelig.\n Trykk på «Slett og konvertér …» for å fortsette."</string>
+    <string name="convert_to_fbe_warning" msgid="6139067817148865527">"Konvertér datapartisjonen til filbasert kryptering.\n !!Advarsel!! Dette gjør at alle dataene dine slettes.\n Dette er en alfafunksjon, som kanskje ikke fungerer som forventet.\n Trykk på «Slett og konvertér …» for å fortsette."</string>
     <string name="button_convert_fbe" msgid="5152671181309826405">"Slett og konvertér …"</string>
     <string name="picture_color_mode" msgid="4560755008730283695">"Fargemodus for bilder"</string>
     <string name="picture_color_mode_desc" msgid="1141891467675548590">"Bruk sRGB"</string>
@@ -318,7 +316,7 @@
     <string name="daltonizer_mode_protanomaly" msgid="8424148009038666065">"Protanomali (rød-grønn)"</string>
     <string name="daltonizer_mode_tritanomaly" msgid="481725854987912389">"Tritanomali (blå-gul)"</string>
     <string name="accessibility_display_daltonizer_preference_title" msgid="5800761362678707872">"Fargekorrigering"</string>
-    <string name="accessibility_display_daltonizer_preference_subtitle" msgid="3484969015295282911">"Denne funksjonen er eksperimentell og kan påvirke ytelsen."</string>
+    <string name="accessibility_display_daltonizer_preference_subtitle" msgid="3484969015295282911">"Dette er en eksperimentell funksjon som kan gjøre at telefonen ikke fungerer optimalt."</string>
     <string name="daltonizer_type_overridden" msgid="3116947244410245916">"Overstyres av <xliff:g id="TITLE">%1$s</xliff:g>"</string>
     <string name="power_remaining_duration_only" msgid="845431008899029842">"Omtrent <xliff:g id="TIME">%1$s</xliff:g> gjenstår"</string>
     <string name="power_remaining_charging_duration_only" msgid="1421102457410268886">"<xliff:g id="TIME">%1$s</xliff:g> til det er fulladet"</string>
diff --git a/packages/SettingsLib/res/values-ne/strings.xml b/packages/SettingsLib/res/values-ne/strings.xml
index 45c9d4e..8738e04 100644
--- a/packages/SettingsLib/res/values-ne/strings.xml
+++ b/packages/SettingsLib/res/values-ne/strings.xml
@@ -56,10 +56,8 @@
     <string name="bluetooth_profile_pan_nap" msgid="8429049285027482959">"इन्टरनेट जडान साझेदारी गर्दै"</string>
     <string name="bluetooth_profile_map" msgid="5465271250454324383">"सन्देश पहुँच"</string>
     <string name="bluetooth_profile_sap" msgid="5764222021851283125">"SIM पहुँच"</string>
-    <!-- no translation found for bluetooth_profile_a2dp_high_quality (2221025895896419505) -->
-    <skip />
-    <!-- no translation found for bluetooth_profile_a2dp_high_quality_unknown_codec (5860996587596508755) -->
-    <skip />
+    <string name="bluetooth_profile_a2dp_high_quality" msgid="2221025895896419505">"उच्च गुणस्तरको अडियो प्रयोग गर्नुहोस्‌: <xliff:g id="CODEC_NAME">%1$s</xliff:g>"</string>
+    <string name="bluetooth_profile_a2dp_high_quality_unknown_codec" msgid="5860996587596508755">"उच्च गुणस्तरको अडियो प्रयोग गर्नुहोस्‌"</string>
     <string name="bluetooth_a2dp_profile_summary_connected" msgid="963376081347721598">"मिडिया अडियोसँग जडित"</string>
     <string name="bluetooth_headset_profile_summary_connected" msgid="7661070206715520671">"फोन अडियोमा जडान गरियो"</string>
     <string name="bluetooth_opp_profile_summary_connected" msgid="2611913495968309066">"फाइल ट्रान्सफर सर्भरमा जडान गरियो"</string>
diff --git a/packages/SettingsLib/res/values-nl/strings.xml b/packages/SettingsLib/res/values-nl/strings.xml
index a9c522d..30cd8db 100644
--- a/packages/SettingsLib/res/values-nl/strings.xml
+++ b/packages/SettingsLib/res/values-nl/strings.xml
@@ -56,10 +56,8 @@
     <string name="bluetooth_profile_pan_nap" msgid="8429049285027482959">"Internetverbinding delen"</string>
     <string name="bluetooth_profile_map" msgid="5465271250454324383">"Toegang tot berichten"</string>
     <string name="bluetooth_profile_sap" msgid="5764222021851283125">"Sim-toegang"</string>
-    <!-- no translation found for bluetooth_profile_a2dp_high_quality (2221025895896419505) -->
-    <skip />
-    <!-- no translation found for bluetooth_profile_a2dp_high_quality_unknown_codec (5860996587596508755) -->
-    <skip />
+    <string name="bluetooth_profile_a2dp_high_quality" msgid="2221025895896419505">"Audio van hoge kwaliteit gebruiken: <xliff:g id="CODEC_NAME">%1$s</xliff:g>"</string>
+    <string name="bluetooth_profile_a2dp_high_quality_unknown_codec" msgid="5860996587596508755">"Audio van hoge kwaliteit gebruiken"</string>
     <string name="bluetooth_a2dp_profile_summary_connected" msgid="963376081347721598">"Verbonden met audio van medium"</string>
     <string name="bluetooth_headset_profile_summary_connected" msgid="7661070206715520671">"Verbonden met audio van telefoon"</string>
     <string name="bluetooth_opp_profile_summary_connected" msgid="2611913495968309066">"Verbonden met server voor bestandsoverdracht"</string>
diff --git a/packages/SettingsLib/res/values-pa/strings.xml b/packages/SettingsLib/res/values-pa/strings.xml
index a954105..ac7d7de 100644
--- a/packages/SettingsLib/res/values-pa/strings.xml
+++ b/packages/SettingsLib/res/values-pa/strings.xml
@@ -56,10 +56,8 @@
     <string name="bluetooth_profile_pan_nap" msgid="8429049285027482959">"ਇੰਟਰਨੈਟ ਕਨੈਕਸ਼ਨ ਸ਼ੇਅਰਿੰਗ"</string>
     <string name="bluetooth_profile_map" msgid="5465271250454324383">"ਸੁਨੇਹਾ ਪਹੁੰਚ"</string>
     <string name="bluetooth_profile_sap" msgid="5764222021851283125">"SIM ਪਹੁੰਚ"</string>
-    <!-- no translation found for bluetooth_profile_a2dp_high_quality (2221025895896419505) -->
-    <skip />
-    <!-- no translation found for bluetooth_profile_a2dp_high_quality_unknown_codec (5860996587596508755) -->
-    <skip />
+    <string name="bluetooth_profile_a2dp_high_quality" msgid="2221025895896419505">"ਉੱਚ ਗੁਣਵੱਤਾ ਔਡੀਓ ਵਰਤੋ: <xliff:g id="CODEC_NAME">%1$s</xliff:g>"</string>
+    <string name="bluetooth_profile_a2dp_high_quality_unknown_codec" msgid="5860996587596508755">"ਉੱਚ ਗੁਣਵੱਤਾ ਔਡੀਓ ਵਰਤੋ"</string>
     <string name="bluetooth_a2dp_profile_summary_connected" msgid="963376081347721598">"ਮੀਡੀਆ ਔਡੀਓ ਨਾਲ ਕਨੈਕਟ ਕੀਤਾ"</string>
     <string name="bluetooth_headset_profile_summary_connected" msgid="7661070206715520671">"ਫੋਨ ਔਡੀਓ ਨਾਲ ਕਨੈਕਟ ਕੀਤਾ"</string>
     <string name="bluetooth_opp_profile_summary_connected" msgid="2611913495968309066">"ਫਾਈਲ ਟ੍ਰਾਂਸਫਰ ਸਰਵਰ ਨਾਲ ਕਨੈਕਟ ਕੀਤਾ"</string>
diff --git a/packages/SettingsLib/res/values-pl/strings.xml b/packages/SettingsLib/res/values-pl/strings.xml
index b5edff1..7624042 100644
--- a/packages/SettingsLib/res/values-pl/strings.xml
+++ b/packages/SettingsLib/res/values-pl/strings.xml
@@ -56,10 +56,8 @@
     <string name="bluetooth_profile_pan_nap" msgid="8429049285027482959">"Udostępnianie połączenia internetowego"</string>
     <string name="bluetooth_profile_map" msgid="5465271250454324383">"Dostęp do wiadomości"</string>
     <string name="bluetooth_profile_sap" msgid="5764222021851283125">"Dostęp do karty SIM"</string>
-    <!-- no translation found for bluetooth_profile_a2dp_high_quality (2221025895896419505) -->
-    <skip />
-    <!-- no translation found for bluetooth_profile_a2dp_high_quality_unknown_codec (5860996587596508755) -->
-    <skip />
+    <string name="bluetooth_profile_a2dp_high_quality" msgid="2221025895896419505">"Korzystaj z dźwięku wysokiej jakości: <xliff:g id="CODEC_NAME">%1$s</xliff:g>"</string>
+    <string name="bluetooth_profile_a2dp_high_quality_unknown_codec" msgid="5860996587596508755">"Korzystaj z dźwięku wysokiej jakości"</string>
     <string name="bluetooth_a2dp_profile_summary_connected" msgid="963376081347721598">"Połączono z funkcją audio multimediów"</string>
     <string name="bluetooth_headset_profile_summary_connected" msgid="7661070206715520671">"Połączono z funkcją audio telefonu"</string>
     <string name="bluetooth_opp_profile_summary_connected" msgid="2611913495968309066">"Połączono z serwerem transferu plików"</string>
@@ -304,7 +302,7 @@
     <string name="select_webview_provider_title" msgid="4628592979751918907">"Implementacja WebView"</string>
     <string name="select_webview_provider_dialog_title" msgid="4370551378720004872">"Ustaw implementację WebView"</string>
     <string name="select_webview_provider_toast_text" msgid="5466970498308266359">"Ta opcja nie jest już obsługiwana. Spróbuj ponownie."</string>
-    <string name="convert_to_file_encryption" msgid="3060156730651061223">"Przekształć na szyfrowanie plików"</string>
+    <string name="convert_to_file_encryption" msgid="3060156730651061223">"Szyfrowanie plików"</string>
     <string name="convert_to_file_encryption_enabled" msgid="2861258671151428346">"Przekształć…"</string>
     <string name="convert_to_file_encryption_done" msgid="7859766358000523953">"Pliki są już zaszyfrowane"</string>
     <string name="title_convert_fbe" msgid="1263622876196444453">"Przekształcanie na szyfrowanie plików"</string>
diff --git a/packages/SettingsLib/res/values-pt-rBR/strings.xml b/packages/SettingsLib/res/values-pt-rBR/strings.xml
index 1651384..fead9f0 100644
--- a/packages/SettingsLib/res/values-pt-rBR/strings.xml
+++ b/packages/SettingsLib/res/values-pt-rBR/strings.xml
@@ -56,10 +56,8 @@
     <string name="bluetooth_profile_pan_nap" msgid="8429049285027482959">"Compartilhamento de conexão à Internet"</string>
     <string name="bluetooth_profile_map" msgid="5465271250454324383">"Acesso a mensagens"</string>
     <string name="bluetooth_profile_sap" msgid="5764222021851283125">"Acesso SIM"</string>
-    <!-- no translation found for bluetooth_profile_a2dp_high_quality (2221025895896419505) -->
-    <skip />
-    <!-- no translation found for bluetooth_profile_a2dp_high_quality_unknown_codec (5860996587596508755) -->
-    <skip />
+    <string name="bluetooth_profile_a2dp_high_quality" msgid="2221025895896419505">"Usar áudio de alta qualidade: <xliff:g id="CODEC_NAME">%1$s</xliff:g>"</string>
+    <string name="bluetooth_profile_a2dp_high_quality_unknown_codec" msgid="5860996587596508755">"Usar áudio de alta qualidade"</string>
     <string name="bluetooth_a2dp_profile_summary_connected" msgid="963376081347721598">"Conectado ao áudio da mídia"</string>
     <string name="bluetooth_headset_profile_summary_connected" msgid="7661070206715520671">"Conectado ao áudio do smartphone"</string>
     <string name="bluetooth_opp_profile_summary_connected" msgid="2611913495968309066">"Conectado ao servidor de transferência de arquivo"</string>
diff --git a/packages/SettingsLib/res/values-pt-rPT/strings.xml b/packages/SettingsLib/res/values-pt-rPT/strings.xml
index d69cc74..0059cdd 100644
--- a/packages/SettingsLib/res/values-pt-rPT/strings.xml
+++ b/packages/SettingsLib/res/values-pt-rPT/strings.xml
@@ -56,10 +56,8 @@
     <string name="bluetooth_profile_pan_nap" msgid="8429049285027482959">"Partilha da ligação à internet"</string>
     <string name="bluetooth_profile_map" msgid="5465271250454324383">"Acesso a mensagens"</string>
     <string name="bluetooth_profile_sap" msgid="5764222021851283125">"Acesso ao SIM"</string>
-    <!-- no translation found for bluetooth_profile_a2dp_high_quality (2221025895896419505) -->
-    <skip />
-    <!-- no translation found for bluetooth_profile_a2dp_high_quality_unknown_codec (5860996587596508755) -->
-    <skip />
+    <string name="bluetooth_profile_a2dp_high_quality" msgid="2221025895896419505">"Utilizar áudio de alta qualidade: <xliff:g id="CODEC_NAME">%1$s</xliff:g>"</string>
+    <string name="bluetooth_profile_a2dp_high_quality_unknown_codec" msgid="5860996587596508755">"Utilizar áudio de alta qualidade"</string>
     <string name="bluetooth_a2dp_profile_summary_connected" msgid="963376081347721598">"Ligado ao áudio de multimédia"</string>
     <string name="bluetooth_headset_profile_summary_connected" msgid="7661070206715520671">"Ligado ao áudio do telefone"</string>
     <string name="bluetooth_opp_profile_summary_connected" msgid="2611913495968309066">"Ligado ao servidor de transferência de ficheiros"</string>
diff --git a/packages/SettingsLib/res/values-pt/strings.xml b/packages/SettingsLib/res/values-pt/strings.xml
index 1651384..fead9f0 100644
--- a/packages/SettingsLib/res/values-pt/strings.xml
+++ b/packages/SettingsLib/res/values-pt/strings.xml
@@ -56,10 +56,8 @@
     <string name="bluetooth_profile_pan_nap" msgid="8429049285027482959">"Compartilhamento de conexão à Internet"</string>
     <string name="bluetooth_profile_map" msgid="5465271250454324383">"Acesso a mensagens"</string>
     <string name="bluetooth_profile_sap" msgid="5764222021851283125">"Acesso SIM"</string>
-    <!-- no translation found for bluetooth_profile_a2dp_high_quality (2221025895896419505) -->
-    <skip />
-    <!-- no translation found for bluetooth_profile_a2dp_high_quality_unknown_codec (5860996587596508755) -->
-    <skip />
+    <string name="bluetooth_profile_a2dp_high_quality" msgid="2221025895896419505">"Usar áudio de alta qualidade: <xliff:g id="CODEC_NAME">%1$s</xliff:g>"</string>
+    <string name="bluetooth_profile_a2dp_high_quality_unknown_codec" msgid="5860996587596508755">"Usar áudio de alta qualidade"</string>
     <string name="bluetooth_a2dp_profile_summary_connected" msgid="963376081347721598">"Conectado ao áudio da mídia"</string>
     <string name="bluetooth_headset_profile_summary_connected" msgid="7661070206715520671">"Conectado ao áudio do smartphone"</string>
     <string name="bluetooth_opp_profile_summary_connected" msgid="2611913495968309066">"Conectado ao servidor de transferência de arquivo"</string>
diff --git a/packages/SettingsLib/res/values-ro/strings.xml b/packages/SettingsLib/res/values-ro/strings.xml
index d89858c..9504a73 100644
--- a/packages/SettingsLib/res/values-ro/strings.xml
+++ b/packages/SettingsLib/res/values-ro/strings.xml
@@ -56,10 +56,8 @@
     <string name="bluetooth_profile_pan_nap" msgid="8429049285027482959">"Distribuirea conexiunii la internet"</string>
     <string name="bluetooth_profile_map" msgid="5465271250454324383">"Acces la mesaje"</string>
     <string name="bluetooth_profile_sap" msgid="5764222021851283125">"Acces la SIM"</string>
-    <!-- no translation found for bluetooth_profile_a2dp_high_quality (2221025895896419505) -->
-    <skip />
-    <!-- no translation found for bluetooth_profile_a2dp_high_quality_unknown_codec (5860996587596508755) -->
-    <skip />
+    <string name="bluetooth_profile_a2dp_high_quality" msgid="2221025895896419505">"Utilizați conținut audio de înaltă calitate: <xliff:g id="CODEC_NAME">%1$s</xliff:g>"</string>
+    <string name="bluetooth_profile_a2dp_high_quality_unknown_codec" msgid="5860996587596508755">"Utilizați conținut audio de înaltă calitate"</string>
     <string name="bluetooth_a2dp_profile_summary_connected" msgid="963376081347721598">"Conectat la profilul pentru conținut media audio"</string>
     <string name="bluetooth_headset_profile_summary_connected" msgid="7661070206715520671">"Conectat la componenta audio a telefonului"</string>
     <string name="bluetooth_opp_profile_summary_connected" msgid="2611913495968309066">"Conectat la serverul de transfer de fișiere"</string>
@@ -281,7 +279,7 @@
     <string name="enable_freeform_support" msgid="1461893351278940416">"Activați ferestrele cu formă liberă"</string>
     <string name="enable_freeform_support_summary" msgid="8247310463288834487">"Activați compatibilitatea pentru ferestrele experimentale cu formă liberă."</string>
     <string name="local_backup_password_title" msgid="3860471654439418822">"Parolă copie rez. desktop"</string>
-    <string name="local_backup_password_summary_none" msgid="6951095485537767956">"În prezent, copiile de rezervă complete pe desktop nu sunt protejate"</string>
+    <string name="local_backup_password_summary_none" msgid="6951095485537767956">"În prezent, backupurile complete pe desktop nu sunt protejate"</string>
     <string name="local_backup_password_summary_change" msgid="5376206246809190364">"Atingeți ca să modificați sau să eliminați parola pentru backupurile complete pe desktop"</string>
     <string name="local_backup_password_toast_success" msgid="582016086228434290">"A fost setată o parolă de rezervă nouă"</string>
     <string name="local_backup_password_toast_confirmation_mismatch" msgid="7805892532752708288">"Parola nouă și confirmarea acesteia nu se potrivesc."</string>
@@ -308,7 +306,7 @@
     <string name="convert_to_file_encryption_enabled" msgid="2861258671151428346">"Convertiți…"</string>
     <string name="convert_to_file_encryption_done" msgid="7859766358000523953">"Criptarea bazată pe sistemul de fișiere este finalizată"</string>
     <string name="title_convert_fbe" msgid="1263622876196444453">"Se face conversia la criptarea bazată pe sistemul de fișiere"</string>
-    <string name="convert_to_fbe_warning" msgid="6139067817148865527">"Faceți conversia partiției de date la criptarea bazată pe sistemul de fișiere. \n !!Avertisment!! Astfel, toate datele dvs. vor fi șterse.\n Aceasta este o funcție în versiune alpha și este posibil să nu funcționeze corect.\n Apăsați pe „Ștergeți și convertiți…” pentru a continua."</string>
+    <string name="convert_to_fbe_warning" msgid="6139067817148865527">"Faceți conversia partiției de date la criptarea bazată pe sistemul de fișiere. \n AVERTISMENT! Astfel, toate datele dvs. vor fi șterse.\n Aceasta este o funcție în versiune alpha și este posibil să nu funcționeze corect.\n Apăsați pe „Ștergeți și convertiți…” pentru a continua."</string>
     <string name="button_convert_fbe" msgid="5152671181309826405">"Ștergeți și convertiți…"</string>
     <string name="picture_color_mode" msgid="4560755008730283695">"Modul de culori pentru imagini"</string>
     <string name="picture_color_mode_desc" msgid="1141891467675548590">"Folosiți sRGB"</string>
diff --git a/packages/SettingsLib/res/values-ru/strings.xml b/packages/SettingsLib/res/values-ru/strings.xml
index 451cb0b..cc82236 100644
--- a/packages/SettingsLib/res/values-ru/strings.xml
+++ b/packages/SettingsLib/res/values-ru/strings.xml
@@ -56,10 +56,8 @@
     <string name="bluetooth_profile_pan_nap" msgid="8429049285027482959">"Профиль PAN"</string>
     <string name="bluetooth_profile_map" msgid="5465271250454324383">"Доступ к сообщениям"</string>
     <string name="bluetooth_profile_sap" msgid="5764222021851283125">"Доступ к SIM-карте"</string>
-    <!-- no translation found for bluetooth_profile_a2dp_high_quality (2221025895896419505) -->
-    <skip />
-    <!-- no translation found for bluetooth_profile_a2dp_high_quality_unknown_codec (5860996587596508755) -->
-    <skip />
+    <string name="bluetooth_profile_a2dp_high_quality" msgid="2221025895896419505">"Использовать аудио высокого качества: <xliff:g id="CODEC_NAME">%1$s</xliff:g>"</string>
+    <string name="bluetooth_profile_a2dp_high_quality_unknown_codec" msgid="5860996587596508755">"Использовать аудио высокого качества"</string>
     <string name="bluetooth_a2dp_profile_summary_connected" msgid="963376081347721598">"Подключено к мультимедийному аудиоустройству"</string>
     <string name="bluetooth_headset_profile_summary_connected" msgid="7661070206715520671">"Подключено к аудиоустройству телефона"</string>
     <string name="bluetooth_opp_profile_summary_connected" msgid="2611913495968309066">"Установлено подключение к серверу передачи файлов"</string>
diff --git a/packages/SettingsLib/res/values-si/strings.xml b/packages/SettingsLib/res/values-si/strings.xml
index 03165fe..1623308 100644
--- a/packages/SettingsLib/res/values-si/strings.xml
+++ b/packages/SettingsLib/res/values-si/strings.xml
@@ -56,10 +56,8 @@
     <string name="bluetooth_profile_pan_nap" msgid="8429049285027482959">"අන්තර්ජාල සම්බන්ධතා බෙදාගැනීම"</string>
     <string name="bluetooth_profile_map" msgid="5465271250454324383">"පණිවිඩ ප්‍රවේශය"</string>
     <string name="bluetooth_profile_sap" msgid="5764222021851283125">"SIM ප්‍රවේශය"</string>
-    <!-- no translation found for bluetooth_profile_a2dp_high_quality (2221025895896419505) -->
-    <skip />
-    <!-- no translation found for bluetooth_profile_a2dp_high_quality_unknown_codec (5860996587596508755) -->
-    <skip />
+    <string name="bluetooth_profile_a2dp_high_quality" msgid="2221025895896419505">"ඉහළ ගුණත්වයේ ශ්‍රව්‍ය භාවිත කරන්න: <xliff:g id="CODEC_NAME">%1$s</xliff:g>"</string>
+    <string name="bluetooth_profile_a2dp_high_quality_unknown_codec" msgid="5860996587596508755">"ඉහළ ගුණත්වයේ ශ්‍රව්‍ය භාවිත කරන්න"</string>
     <string name="bluetooth_a2dp_profile_summary_connected" msgid="963376081347721598">"මාධ්‍ය ශ්‍රව්‍යට සම්බන්ධ විය"</string>
     <string name="bluetooth_headset_profile_summary_connected" msgid="7661070206715520671">"දුරකතනයේ ශ්‍රව්‍යට සම්බන්ධ විය"</string>
     <string name="bluetooth_opp_profile_summary_connected" msgid="2611913495968309066">"ගොනු හුවමාරු සේවාදායකය සමග සම්බන්ධ විය"</string>
diff --git a/packages/SettingsLib/res/values-sk/strings.xml b/packages/SettingsLib/res/values-sk/strings.xml
index 8df768c..a8f5566 100644
--- a/packages/SettingsLib/res/values-sk/strings.xml
+++ b/packages/SettingsLib/res/values-sk/strings.xml
@@ -56,10 +56,8 @@
     <string name="bluetooth_profile_pan_nap" msgid="8429049285027482959">"Zdieľanie pripojenia na Internet"</string>
     <string name="bluetooth_profile_map" msgid="5465271250454324383">"Prístup ku správam"</string>
     <string name="bluetooth_profile_sap" msgid="5764222021851283125">"Prístup k SIM karte"</string>
-    <!-- no translation found for bluetooth_profile_a2dp_high_quality (2221025895896419505) -->
-    <skip />
-    <!-- no translation found for bluetooth_profile_a2dp_high_quality_unknown_codec (5860996587596508755) -->
-    <skip />
+    <string name="bluetooth_profile_a2dp_high_quality" msgid="2221025895896419505">"Použiť zvuk s vysokou kvalitou: <xliff:g id="CODEC_NAME">%1$s</xliff:g>"</string>
+    <string name="bluetooth_profile_a2dp_high_quality_unknown_codec" msgid="5860996587596508755">"Použiť zvuk s vysokou kvalitou"</string>
     <string name="bluetooth_a2dp_profile_summary_connected" msgid="963376081347721598">"Pripojené ku zvukovému médiu"</string>
     <string name="bluetooth_headset_profile_summary_connected" msgid="7661070206715520671">"Pripojené ku zvuku telefónu"</string>
     <string name="bluetooth_opp_profile_summary_connected" msgid="2611913495968309066">"Pripojené na server pre prenos údajov"</string>
@@ -105,7 +103,7 @@
     <string name="launch_defaults_some" msgid="313159469856372621">"Predvolená pre niektoré akcie"</string>
     <string name="launch_defaults_none" msgid="4241129108140034876">"Nie je predvolená pre žiadne akcie"</string>
     <string name="tts_settings" msgid="8186971894801348327">"Nastavenia prevodu textu na reč"</string>
-    <string name="tts_settings_title" msgid="1237820681016639683">"Výstup prevodu textu na reč"</string>
+    <string name="tts_settings_title" msgid="1237820681016639683">"Prevod textu na reč"</string>
     <string name="tts_default_rate_title" msgid="6030550998379310088">"Rýchlosť reči"</string>
     <string name="tts_default_rate_summary" msgid="4061815292287182801">"Rýchlosť hovoreného textu"</string>
     <string name="tts_default_pitch_title" msgid="6135942113172488671">"Výška"</string>
@@ -169,7 +167,7 @@
     <string name="mock_location_app" msgid="7966220972812881854">"Vybrať aplikáciu so simulovanou polohou"</string>
     <string name="mock_location_app_not_set" msgid="809543285495344223">"Nemáte žiadnu aplikáciu so simulovanou polohou"</string>
     <string name="mock_location_app_set" msgid="8966420655295102685">"Aplikácia so simulovanou polohou: <xliff:g id="APP_NAME">%1$s</xliff:g>"</string>
-    <string name="debug_networking_category" msgid="7044075693643009662">"Možnosti siete"</string>
+    <string name="debug_networking_category" msgid="7044075693643009662">"Siete"</string>
     <string name="wifi_display_certification" msgid="8611569543791307533">"Certifikácia bezdrôtového zobrazenia"</string>
     <string name="wifi_verbose_logging" msgid="4203729756047242344">"Podrobné denníky Wi-Fi"</string>
     <string name="wifi_aggressive_handover" msgid="5309131983693661320">"Agres. odovzdávať Wi-Fi na mobilnú sieť"</string>
@@ -236,7 +234,7 @@
     <string name="debug_monitoring_category" msgid="7640508148375798343">"Monitorovanie"</string>
     <string name="strict_mode" msgid="1938795874357830695">"Povoliť prísny režim"</string>
     <string name="strict_mode_summary" msgid="142834318897332338">"Blikať pri dlhých operáciách hlavného vlákna"</string>
-    <string name="pointer_location" msgid="6084434787496938001">"Umiestnenie ukazovateľa"</string>
+    <string name="pointer_location" msgid="6084434787496938001">"Umiestnenie kurzora"</string>
     <string name="pointer_location_summary" msgid="840819275172753713">"Zobraziť prekryvnú vrstvu s aktuálnymi údajmi o klepnutiach"</string>
     <string name="show_touches" msgid="2642976305235070316">"Zobrazovať klepnutia"</string>
     <string name="show_touches_summary" msgid="6101183132903926324">"Vizuálne znázorňovať klepnutia"</string>
@@ -301,14 +299,14 @@
     <string name="inactive_app_active_summary" msgid="4174921824958516106">"Aktívne. Prepnite klepnutím."</string>
     <string name="runningservices_settings_title" msgid="8097287939865165213">"Spustené služby"</string>
     <string name="runningservices_settings_summary" msgid="854608995821032748">"Zobrazenie a ovládanie aktuálne spustených služieb"</string>
-    <string name="select_webview_provider_title" msgid="4628592979751918907">"Implementácia komponenta WebView"</string>
-    <string name="select_webview_provider_dialog_title" msgid="4370551378720004872">"Nastavenie implementácie komponenta WebView"</string>
+    <string name="select_webview_provider_title" msgid="4628592979751918907">"Implementácia WebView"</string>
+    <string name="select_webview_provider_dialog_title" msgid="4370551378720004872">"Nastaviť implementáciu WebView"</string>
     <string name="select_webview_provider_toast_text" msgid="5466970498308266359">"Táto voľba už nie je platná. Skúste to znova."</string>
-    <string name="convert_to_file_encryption" msgid="3060156730651061223">"Konvertovať na šifrovanie súborov"</string>
+    <string name="convert_to_file_encryption" msgid="3060156730651061223">"Prejsť na šifrovanie súborov"</string>
     <string name="convert_to_file_encryption_enabled" msgid="2861258671151428346">"Konvertovať…"</string>
     <string name="convert_to_file_encryption_done" msgid="7859766358000523953">"Súbory sú už šifrované"</string>
     <string name="title_convert_fbe" msgid="1263622876196444453">"Konvertovanie na šifrovanie založené na súboroch"</string>
-    <string name="convert_to_fbe_warning" msgid="6139067817148865527">"Chystáte sa konvertovať dátový oddiel na šifrovanie založené na súboroch.\n !!Upozornenie!! Týmto procesom vymažete všetky dáta.\n Táto funkcia je v alfa verzii a nemusí fungovať správne.\n Ak chcete pokračovať, stlačte tlačidlo „Vymazať a konvertovať…“."</string>
+    <string name="convert_to_fbe_warning" msgid="6139067817148865527">"Chystáte sa previesť dátový oddiel na šifrovanie založené na súboroch.\nPozor!!! Všetky vaše dáta budú vymazané.\nTáto funkcia je v alfa verzii a nemusí fungovať správne.\nAk chcete pokračovať, stlačte tlačidlo Vymazať a konvertovať…"</string>
     <string name="button_convert_fbe" msgid="5152671181309826405">"Vymazať a konvertovať…"</string>
     <string name="picture_color_mode" msgid="4560755008730283695">"Farebný režim obrázka"</string>
     <string name="picture_color_mode_desc" msgid="1141891467675548590">"Použije sa sRGB"</string>
diff --git a/packages/SettingsLib/res/values-sl/strings.xml b/packages/SettingsLib/res/values-sl/strings.xml
index 740a92e..085621a 100644
--- a/packages/SettingsLib/res/values-sl/strings.xml
+++ b/packages/SettingsLib/res/values-sl/strings.xml
@@ -56,10 +56,8 @@
     <string name="bluetooth_profile_pan_nap" msgid="8429049285027482959">"Skupna raba internetne povezave"</string>
     <string name="bluetooth_profile_map" msgid="5465271250454324383">"Dostop do sporočil"</string>
     <string name="bluetooth_profile_sap" msgid="5764222021851283125">"Dostop do kartice SIM"</string>
-    <!-- no translation found for bluetooth_profile_a2dp_high_quality (2221025895896419505) -->
-    <skip />
-    <!-- no translation found for bluetooth_profile_a2dp_high_quality_unknown_codec (5860996587596508755) -->
-    <skip />
+    <string name="bluetooth_profile_a2dp_high_quality" msgid="2221025895896419505">"Uporabi zvok visoke kakovosti: <xliff:g id="CODEC_NAME">%1$s</xliff:g>"</string>
+    <string name="bluetooth_profile_a2dp_high_quality_unknown_codec" msgid="5860996587596508755">"Uporabi zvok visoke kakovosti"</string>
     <string name="bluetooth_a2dp_profile_summary_connected" msgid="963376081347721598">"Povezan s profilom za predstavnostni zvok"</string>
     <string name="bluetooth_headset_profile_summary_connected" msgid="7661070206715520671">"Povezava s profilom za zvok telefona vzpostavljena"</string>
     <string name="bluetooth_opp_profile_summary_connected" msgid="2611913495968309066">"Povezava s strežnikom za prenos datotek je vzpostavljena"</string>
diff --git a/packages/SettingsLib/res/values-sq/strings.xml b/packages/SettingsLib/res/values-sq/strings.xml
index e11c418..c9398a5 100644
--- a/packages/SettingsLib/res/values-sq/strings.xml
+++ b/packages/SettingsLib/res/values-sq/strings.xml
@@ -56,10 +56,8 @@
     <string name="bluetooth_profile_pan_nap" msgid="8429049285027482959">"Ndarja e lidhjes së internetit"</string>
     <string name="bluetooth_profile_map" msgid="5465271250454324383">"Qasja në mesazhe"</string>
     <string name="bluetooth_profile_sap" msgid="5764222021851283125">"Qasje në kartën SIM"</string>
-    <!-- no translation found for bluetooth_profile_a2dp_high_quality (2221025895896419505) -->
-    <skip />
-    <!-- no translation found for bluetooth_profile_a2dp_high_quality_unknown_codec (5860996587596508755) -->
-    <skip />
+    <string name="bluetooth_profile_a2dp_high_quality" msgid="2221025895896419505">"Përdor audion me cilësi të lartë: <xliff:g id="CODEC_NAME">%1$s</xliff:g>"</string>
+    <string name="bluetooth_profile_a2dp_high_quality_unknown_codec" msgid="5860996587596508755">"Përdor audion me cilësi të lartë"</string>
     <string name="bluetooth_a2dp_profile_summary_connected" msgid="963376081347721598">"U lidh me audion e medias"</string>
     <string name="bluetooth_headset_profile_summary_connected" msgid="7661070206715520671">"U lidh me audion e telefonit"</string>
     <string name="bluetooth_opp_profile_summary_connected" msgid="2611913495968309066">"U lidh me serverin e transferimit të skedarëve"</string>
diff --git a/packages/SettingsLib/res/values-sr/strings.xml b/packages/SettingsLib/res/values-sr/strings.xml
index 0f02f16..9c08f97 100644
--- a/packages/SettingsLib/res/values-sr/strings.xml
+++ b/packages/SettingsLib/res/values-sr/strings.xml
@@ -56,10 +56,8 @@
     <string name="bluetooth_profile_pan_nap" msgid="8429049285027482959">"Дељење интернет везе"</string>
     <string name="bluetooth_profile_map" msgid="5465271250454324383">"Приступ порукама"</string>
     <string name="bluetooth_profile_sap" msgid="5764222021851283125">"Приступ SIM картици"</string>
-    <!-- no translation found for bluetooth_profile_a2dp_high_quality (2221025895896419505) -->
-    <skip />
-    <!-- no translation found for bluetooth_profile_a2dp_high_quality_unknown_codec (5860996587596508755) -->
-    <skip />
+    <string name="bluetooth_profile_a2dp_high_quality" msgid="2221025895896419505">"Користи звук високог квалитета: <xliff:g id="CODEC_NAME">%1$s</xliff:g>"</string>
+    <string name="bluetooth_profile_a2dp_high_quality_unknown_codec" msgid="5860996587596508755">"Користи звук високог квалитета"</string>
     <string name="bluetooth_a2dp_profile_summary_connected" msgid="963376081347721598">"Повезано са звуком медија"</string>
     <string name="bluetooth_headset_profile_summary_connected" msgid="7661070206715520671">"Повезано са звуком телефона"</string>
     <string name="bluetooth_opp_profile_summary_connected" msgid="2611913495968309066">"Повезано са сервером за пренос датотека"</string>
diff --git a/packages/SettingsLib/res/values-sv/strings.xml b/packages/SettingsLib/res/values-sv/strings.xml
index 1058a75..cfae5ae 100644
--- a/packages/SettingsLib/res/values-sv/strings.xml
+++ b/packages/SettingsLib/res/values-sv/strings.xml
@@ -56,10 +56,8 @@
     <string name="bluetooth_profile_pan_nap" msgid="8429049285027482959">"Delning av Internetanslutning"</string>
     <string name="bluetooth_profile_map" msgid="5465271250454324383">"Meddelandeåtkomst"</string>
     <string name="bluetooth_profile_sap" msgid="5764222021851283125">"SIM-åtkomst"</string>
-    <!-- no translation found for bluetooth_profile_a2dp_high_quality (2221025895896419505) -->
-    <skip />
-    <!-- no translation found for bluetooth_profile_a2dp_high_quality_unknown_codec (5860996587596508755) -->
-    <skip />
+    <string name="bluetooth_profile_a2dp_high_quality" msgid="2221025895896419505">"Använd högkvalitativt ljud: <xliff:g id="CODEC_NAME">%1$s</xliff:g>"</string>
+    <string name="bluetooth_profile_a2dp_high_quality_unknown_codec" msgid="5860996587596508755">"Använd högkvalitativt ljud"</string>
     <string name="bluetooth_a2dp_profile_summary_connected" msgid="963376081347721598">"Ansluten till medialjud"</string>
     <string name="bluetooth_headset_profile_summary_connected" msgid="7661070206715520671">"Ansluten till telefonens ljud"</string>
     <string name="bluetooth_opp_profile_summary_connected" msgid="2611913495968309066">"Ansluten till filöverföringsserver"</string>
diff --git a/packages/SettingsLib/res/values-sw/strings.xml b/packages/SettingsLib/res/values-sw/strings.xml
index fa7d028..8b24ef7 100644
--- a/packages/SettingsLib/res/values-sw/strings.xml
+++ b/packages/SettingsLib/res/values-sw/strings.xml
@@ -56,10 +56,8 @@
     <string name="bluetooth_profile_pan_nap" msgid="8429049285027482959">"Kushiriki muunganisho wa tovuti"</string>
     <string name="bluetooth_profile_map" msgid="5465271250454324383">"Ufikiaji wa Ujumbe"</string>
     <string name="bluetooth_profile_sap" msgid="5764222021851283125">"Ufikiaji wa SIM"</string>
-    <!-- no translation found for bluetooth_profile_a2dp_high_quality (2221025895896419505) -->
-    <skip />
-    <!-- no translation found for bluetooth_profile_a2dp_high_quality_unknown_codec (5860996587596508755) -->
-    <skip />
+    <string name="bluetooth_profile_a2dp_high_quality" msgid="2221025895896419505">"Tumia sauti ya ubora wa juu: <xliff:g id="CODEC_NAME">%1$s</xliff:g>"</string>
+    <string name="bluetooth_profile_a2dp_high_quality_unknown_codec" msgid="5860996587596508755">"Tumia sauti ya ubora wa juu"</string>
     <string name="bluetooth_a2dp_profile_summary_connected" msgid="963376081347721598">"Imeunganishwa kwenye sikika ya njia ya mawasiliano"</string>
     <string name="bluetooth_headset_profile_summary_connected" msgid="7661070206715520671">"Imeunganishwa kwenye sauti ya simu"</string>
     <string name="bluetooth_opp_profile_summary_connected" msgid="2611913495968309066">"Imeunganishwa kwenye seva ya kuhamisha faili"</string>
@@ -106,7 +104,7 @@
     <string name="launch_defaults_none" msgid="4241129108140034876">"Hakuna chaguo-misingi zilizowekwa"</string>
     <string name="tts_settings" msgid="8186971894801348327">"Mipangilio ya maandishi kwa hotuba"</string>
     <string name="tts_settings_title" msgid="1237820681016639683">"Kubadilisha maandishi hadi usemi"</string>
-    <string name="tts_default_rate_title" msgid="6030550998379310088">"Kiwango cha usemaji"</string>
+    <string name="tts_default_rate_title" msgid="6030550998379310088">"Kasi ya kutamka"</string>
     <string name="tts_default_rate_summary" msgid="4061815292287182801">"Kasi ya kutamkwa kwa maneno"</string>
     <string name="tts_default_pitch_title" msgid="6135942113172488671">"Giza"</string>
     <string name="tts_default_pitch_summary" msgid="1944885882882650009">"Huathiri sauti ya matamshi yaliyounganishwa"</string>
@@ -308,7 +306,7 @@
     <string name="convert_to_file_encryption_enabled" msgid="2861258671151428346">"Badilisha..."</string>
     <string name="convert_to_file_encryption_done" msgid="7859766358000523953">"Tayari faili imesimbwa kwa njia fiche"</string>
     <string name="title_convert_fbe" msgid="1263622876196444453">"Inabadilisha kuwa usimbaji fiche unaotegemea faili"</string>
-    <string name="convert_to_fbe_warning" msgid="6139067817148865527">"Badilisha sehemu za data kuwa usimbaji unaotegemea faili.\n!!Onyo!! Hatua hii itafuta data yako yote.\nKipengele hiki ni cha alpha, na huenda kisifanye kazi vizuri.\nBonyeza \'Futa na ubadilishe...\'  ili uendelee."</string>
+    <string name="convert_to_fbe_warning" msgid="6139067817148865527">"Badilisha sehemu za data kuwa usimbaji unaotegemea faili.\n!!Onyo!! Hatua hii itafuta data yako yote.\nKipengele hiki ni cha alpha na huenda kisifanye kazi vizuri.\nBonyeza \'Futa na ubadilishe...\'  ili uendelee."</string>
     <string name="button_convert_fbe" msgid="5152671181309826405">"Futa na uibadilishe..."</string>
     <string name="picture_color_mode" msgid="4560755008730283695">"Hali ya rangi ya picha"</string>
     <string name="picture_color_mode_desc" msgid="1141891467675548590">"Tumia sRGB"</string>
diff --git a/packages/SettingsLib/res/values-ta/strings.xml b/packages/SettingsLib/res/values-ta/strings.xml
index 1a8745f..e09db51 100644
--- a/packages/SettingsLib/res/values-ta/strings.xml
+++ b/packages/SettingsLib/res/values-ta/strings.xml
@@ -56,10 +56,8 @@
     <string name="bluetooth_profile_pan_nap" msgid="8429049285027482959">"இணைய இணைப்பு பகிர்தல்"</string>
     <string name="bluetooth_profile_map" msgid="5465271250454324383">"செய்திக்கான அணுகல்"</string>
     <string name="bluetooth_profile_sap" msgid="5764222021851283125">"சிம் அணுகல்"</string>
-    <!-- no translation found for bluetooth_profile_a2dp_high_quality (2221025895896419505) -->
-    <skip />
-    <!-- no translation found for bluetooth_profile_a2dp_high_quality_unknown_codec (5860996587596508755) -->
-    <skip />
+    <string name="bluetooth_profile_a2dp_high_quality" msgid="2221025895896419505">"உயர்தர ஆடியோவைப் பயன்படுத்து: <xliff:g id="CODEC_NAME">%1$s</xliff:g>"</string>
+    <string name="bluetooth_profile_a2dp_high_quality_unknown_codec" msgid="5860996587596508755">"உயர்தர ஆடியோவைப் பயன்படுத்து"</string>
     <string name="bluetooth_a2dp_profile_summary_connected" msgid="963376081347721598">"மீடியா ஆடியோவுடன் இணைக்கப்பட்டது"</string>
     <string name="bluetooth_headset_profile_summary_connected" msgid="7661070206715520671">"மொபைல் ஆடியோவுடன் இணைக்கப்பட்டது"</string>
     <string name="bluetooth_opp_profile_summary_connected" msgid="2611913495968309066">"கோப்பைப் பரிமாற்றும் சேவையகத்துடன் இணைக்கப்பட்டது"</string>
diff --git a/packages/SettingsLib/res/values-te/strings.xml b/packages/SettingsLib/res/values-te/strings.xml
index 9e97748..dabf7ed 100644
--- a/packages/SettingsLib/res/values-te/strings.xml
+++ b/packages/SettingsLib/res/values-te/strings.xml
@@ -56,10 +56,8 @@
     <string name="bluetooth_profile_pan_nap" msgid="8429049285027482959">"ఇంటర్నెట్ కనెక్షన్ భాగస్వామ్యం"</string>
     <string name="bluetooth_profile_map" msgid="5465271250454324383">"సందేశ ప్రాప్యత"</string>
     <string name="bluetooth_profile_sap" msgid="5764222021851283125">"SIM ప్రాప్యత"</string>
-    <!-- no translation found for bluetooth_profile_a2dp_high_quality (2221025895896419505) -->
-    <skip />
-    <!-- no translation found for bluetooth_profile_a2dp_high_quality_unknown_codec (5860996587596508755) -->
-    <skip />
+    <string name="bluetooth_profile_a2dp_high_quality" msgid="2221025895896419505">"అధిక నాణ్యత ఆడియోను ఉపయోగించండి: <xliff:g id="CODEC_NAME">%1$s</xliff:g>"</string>
+    <string name="bluetooth_profile_a2dp_high_quality_unknown_codec" msgid="5860996587596508755">"అధిక నాణ్యత ఆడియోను ఉపయోగించండి"</string>
     <string name="bluetooth_a2dp_profile_summary_connected" msgid="963376081347721598">"మీడియా ఆడియోకు కనెక్ట్ చేయబడింది"</string>
     <string name="bluetooth_headset_profile_summary_connected" msgid="7661070206715520671">"ఫోన్ ఆడియోకు కనెక్ట్ చేయబడింది"</string>
     <string name="bluetooth_opp_profile_summary_connected" msgid="2611913495968309066">"ఫైల్ బదిలీ సర్వర్‌కు కనెక్ట్ చేయబడింది"</string>
diff --git a/packages/SettingsLib/res/values-th/strings.xml b/packages/SettingsLib/res/values-th/strings.xml
index 91ebc55..9a265f5 100644
--- a/packages/SettingsLib/res/values-th/strings.xml
+++ b/packages/SettingsLib/res/values-th/strings.xml
@@ -56,10 +56,8 @@
     <string name="bluetooth_profile_pan_nap" msgid="8429049285027482959">"การแชร์การเชื่อมต่ออินเทอร์เน็ต"</string>
     <string name="bluetooth_profile_map" msgid="5465271250454324383">"การเข้าถึงข้อความ"</string>
     <string name="bluetooth_profile_sap" msgid="5764222021851283125">"การเข้าถึงซิม"</string>
-    <!-- no translation found for bluetooth_profile_a2dp_high_quality (2221025895896419505) -->
-    <skip />
-    <!-- no translation found for bluetooth_profile_a2dp_high_quality_unknown_codec (5860996587596508755) -->
-    <skip />
+    <string name="bluetooth_profile_a2dp_high_quality" msgid="2221025895896419505">"ใช้เสียงคุณภาพสูง: <xliff:g id="CODEC_NAME">%1$s</xliff:g>"</string>
+    <string name="bluetooth_profile_a2dp_high_quality_unknown_codec" msgid="5860996587596508755">"ใช้เสียงคุณภาพสูง"</string>
     <string name="bluetooth_a2dp_profile_summary_connected" msgid="963376081347721598">"เชื่อมต่อกับระบบเสียงของสื่อแล้ว"</string>
     <string name="bluetooth_headset_profile_summary_connected" msgid="7661070206715520671">"เชื่อมต่อกับระบบเสียงของโทรศัพท์แล้ว"</string>
     <string name="bluetooth_opp_profile_summary_connected" msgid="2611913495968309066">"เชื่อมต่อกับเซิร์ฟเวอร์สำหรับโอนไฟล์แล้ว"</string>
diff --git a/packages/SettingsLib/res/values-tl/strings.xml b/packages/SettingsLib/res/values-tl/strings.xml
index a73fb57..c46ac78 100644
--- a/packages/SettingsLib/res/values-tl/strings.xml
+++ b/packages/SettingsLib/res/values-tl/strings.xml
@@ -56,10 +56,8 @@
     <string name="bluetooth_profile_pan_nap" msgid="8429049285027482959">"Pagbabahagi ng koneksyon sa internet"</string>
     <string name="bluetooth_profile_map" msgid="5465271250454324383">"Access sa Mensahe"</string>
     <string name="bluetooth_profile_sap" msgid="5764222021851283125">"Access sa SIM"</string>
-    <!-- no translation found for bluetooth_profile_a2dp_high_quality (2221025895896419505) -->
-    <skip />
-    <!-- no translation found for bluetooth_profile_a2dp_high_quality_unknown_codec (5860996587596508755) -->
-    <skip />
+    <string name="bluetooth_profile_a2dp_high_quality" msgid="2221025895896419505">"Gumamit ng mataas na kalidad na audio: <xliff:g id="CODEC_NAME">%1$s</xliff:g>"</string>
+    <string name="bluetooth_profile_a2dp_high_quality_unknown_codec" msgid="5860996587596508755">"Gumamit ng mataas na kalidad na audio"</string>
     <string name="bluetooth_a2dp_profile_summary_connected" msgid="963376081347721598">"Konektado sa media audio"</string>
     <string name="bluetooth_headset_profile_summary_connected" msgid="7661070206715520671">"Nakakonekta sa audio ng telepono"</string>
     <string name="bluetooth_opp_profile_summary_connected" msgid="2611913495968309066">"Nakakonekta sa server sa paglilipat ng file"</string>
diff --git a/packages/SettingsLib/res/values-tr/strings.xml b/packages/SettingsLib/res/values-tr/strings.xml
index ae890e4..696b209 100644
--- a/packages/SettingsLib/res/values-tr/strings.xml
+++ b/packages/SettingsLib/res/values-tr/strings.xml
@@ -56,10 +56,8 @@
     <string name="bluetooth_profile_pan_nap" msgid="8429049285027482959">"İnternet bağlantısı paylaşımı"</string>
     <string name="bluetooth_profile_map" msgid="5465271250454324383">"Mesaj Erişimi"</string>
     <string name="bluetooth_profile_sap" msgid="5764222021851283125">"SIM Erişimi"</string>
-    <!-- no translation found for bluetooth_profile_a2dp_high_quality (2221025895896419505) -->
-    <skip />
-    <!-- no translation found for bluetooth_profile_a2dp_high_quality_unknown_codec (5860996587596508755) -->
-    <skip />
+    <string name="bluetooth_profile_a2dp_high_quality" msgid="2221025895896419505">"Yüksek kalite ses kullan: <xliff:g id="CODEC_NAME">%1$s</xliff:g>"</string>
+    <string name="bluetooth_profile_a2dp_high_quality_unknown_codec" msgid="5860996587596508755">"Yüksek kalite ses kullan"</string>
     <string name="bluetooth_a2dp_profile_summary_connected" msgid="963376081347721598">"Medya sesine bağlanıldı"</string>
     <string name="bluetooth_headset_profile_summary_connected" msgid="7661070206715520671">"Telefon sesine bağlandı"</string>
     <string name="bluetooth_opp_profile_summary_connected" msgid="2611913495968309066">"Dosya aktarım sunucusuna bağlandı"</string>
@@ -238,8 +236,8 @@
     <string name="strict_mode_summary" msgid="142834318897332338">"Uyg. ana işlem parçasında uzun işlem yap. ekr. yakıp söndür"</string>
     <string name="pointer_location" msgid="6084434787496938001">"İşaretçi konumu"</string>
     <string name="pointer_location_summary" msgid="840819275172753713">"Mevcut dokunmatik verilerini gösteren yer paylaşımı"</string>
-    <string name="show_touches" msgid="2642976305235070316">"Hafifçe dokunmayı göster"</string>
-    <string name="show_touches_summary" msgid="6101183132903926324">"Hafifçe dokunmalarda görsel geri bildirim göster"</string>
+    <string name="show_touches" msgid="2642976305235070316">"Dokunmayı göster"</string>
+    <string name="show_touches_summary" msgid="6101183132903926324">"Dokunmalarda görsel geri bildirim göster"</string>
     <string name="show_screen_updates" msgid="5470814345876056420">"Yüzey güncellemelerini göster"</string>
     <string name="show_screen_updates_summary" msgid="2569622766672785529">"Güncelleme sırasında tüm pencere yüzeylerini çiz"</string>
     <string name="show_hw_screen_updates" msgid="5036904558145941590">"GPU görünüm güncellemelerini göster"</string>
@@ -282,7 +280,7 @@
     <string name="enable_freeform_support_summary" msgid="8247310463288834487">"Deneysel serbest biçimli pencere desteğini etkinleştir."</string>
     <string name="local_backup_password_title" msgid="3860471654439418822">"Masaüstü yedekleme şifresi"</string>
     <string name="local_backup_password_summary_none" msgid="6951095485537767956">"Masaüstü tam yedeklemeleri şu an korunmuyor"</string>
-    <string name="local_backup_password_summary_change" msgid="5376206246809190364">"Masaüstü tam yedeklemelerinin şifresini değiştirmek veya kaldırmak için hafifçe dokunun"</string>
+    <string name="local_backup_password_summary_change" msgid="5376206246809190364">"Masaüstü tam yedeklemelerinin şifresini değiştirmek veya kaldırmak için dokunun"</string>
     <string name="local_backup_password_toast_success" msgid="582016086228434290">"Yeni yedekleme şifresi ayarlandı"</string>
     <string name="local_backup_password_toast_confirmation_mismatch" msgid="7805892532752708288">"Yeni şifre ve onayı eşleşmiyor."</string>
     <string name="local_backup_password_toast_validation_failure" msgid="5646377234895626531">"Yedekleme şifresi ayarlanamadı"</string>
@@ -297,8 +295,8 @@
     <item msgid="5363960654009010371">"Dijital içerik için optimize edilmiş renkler"</item>
   </string-array>
     <string name="inactive_apps_title" msgid="1317817863508274533">"Devre dışı uygulamalar"</string>
-    <string name="inactive_app_inactive_summary" msgid="5091363706699855725">"Etkin değil. Geçiş yapmak için hafifçe dokunun."</string>
-    <string name="inactive_app_active_summary" msgid="4174921824958516106">"Etkin. Geçiş yapmak için hafifçe dokunun."</string>
+    <string name="inactive_app_inactive_summary" msgid="5091363706699855725">"Etkin değil. Geçiş yapmak için dokunun."</string>
+    <string name="inactive_app_active_summary" msgid="4174921824958516106">"Etkin. Geçiş yapmak için dokunun."</string>
     <string name="runningservices_settings_title" msgid="8097287939865165213">"Çalışan hizmetler"</string>
     <string name="runningservices_settings_summary" msgid="854608995821032748">"Şu anda çalışan hizmetleri görüntüle ve denetle"</string>
     <string name="select_webview_provider_title" msgid="4628592979751918907">"WebView kullanımı"</string>
diff --git a/packages/SettingsLib/res/values-uk/strings.xml b/packages/SettingsLib/res/values-uk/strings.xml
index 63faab2..a217708 100644
--- a/packages/SettingsLib/res/values-uk/strings.xml
+++ b/packages/SettingsLib/res/values-uk/strings.xml
@@ -56,10 +56,8 @@
     <string name="bluetooth_profile_pan_nap" msgid="8429049285027482959">"Надання доступу до Інтернету"</string>
     <string name="bluetooth_profile_map" msgid="5465271250454324383">"Доступ до повідомлень"</string>
     <string name="bluetooth_profile_sap" msgid="5764222021851283125">"Доступ до SIM-карти"</string>
-    <!-- no translation found for bluetooth_profile_a2dp_high_quality (2221025895896419505) -->
-    <skip />
-    <!-- no translation found for bluetooth_profile_a2dp_high_quality_unknown_codec (5860996587596508755) -->
-    <skip />
+    <string name="bluetooth_profile_a2dp_high_quality" msgid="2221025895896419505">"Використовувати аудіо високої якості: <xliff:g id="CODEC_NAME">%1$s</xliff:g>"</string>
+    <string name="bluetooth_profile_a2dp_high_quality_unknown_codec" msgid="5860996587596508755">"Використовувати аудіо високої якості"</string>
     <string name="bluetooth_a2dp_profile_summary_connected" msgid="963376081347721598">"Підключено до аудіоджерела"</string>
     <string name="bluetooth_headset_profile_summary_connected" msgid="7661070206715520671">"Підключено до звуку телеф."</string>
     <string name="bluetooth_opp_profile_summary_connected" msgid="2611913495968309066">"Підключ. до сервера передачі файлів"</string>
@@ -329,7 +327,7 @@
     <string name="power_charging_duration" msgid="4676999980973411875">"<xliff:g id="LEVEL">%1$s</xliff:g> – <xliff:g id="TIME">%2$s</xliff:g> до повного заряду"</string>
     <string name="power_charging_duration_short" msgid="1098603958472207920">"<xliff:g id="LEVEL">%1$s</xliff:g> – <xliff:g id="TIME">%2$s</xliff:g>"</string>
     <string name="battery_info_status_unknown" msgid="196130600938058547">"Невідомо"</string>
-    <string name="battery_info_status_charging" msgid="1705179948350365604">"Зарядж-ся"</string>
+    <string name="battery_info_status_charging" msgid="1705179948350365604">"Заряджається"</string>
     <string name="battery_info_status_charging_lower" msgid="8689770213898117994">"заряджається"</string>
     <string name="battery_info_status_discharging" msgid="310932812698268588">"Не заряджається"</string>
     <string name="battery_info_status_not_charging" msgid="2820070506621483576">"Не заряджається"</string>
diff --git a/packages/SettingsLib/res/values-ur/strings.xml b/packages/SettingsLib/res/values-ur/strings.xml
index 67c3c13..3fceb98 100644
--- a/packages/SettingsLib/res/values-ur/strings.xml
+++ b/packages/SettingsLib/res/values-ur/strings.xml
@@ -56,10 +56,8 @@
     <string name="bluetooth_profile_pan_nap" msgid="8429049285027482959">"انٹرنیٹ کنکشن کا اشتراک کرنا"</string>
     <string name="bluetooth_profile_map" msgid="5465271250454324383">"پیغام تک رسائی"</string>
     <string name="bluetooth_profile_sap" msgid="5764222021851283125">"‏SIM رسائی"</string>
-    <!-- no translation found for bluetooth_profile_a2dp_high_quality (2221025895896419505) -->
-    <skip />
-    <!-- no translation found for bluetooth_profile_a2dp_high_quality_unknown_codec (5860996587596508755) -->
-    <skip />
+    <string name="bluetooth_profile_a2dp_high_quality" msgid="2221025895896419505">"اعلی معیار کی آڈیو استعمال کریں: <xliff:g id="CODEC_NAME">%1$s</xliff:g>"</string>
+    <string name="bluetooth_profile_a2dp_high_quality_unknown_codec" msgid="5860996587596508755">"اعلی معیار کی آڈیو استعمال کریں"</string>
     <string name="bluetooth_a2dp_profile_summary_connected" msgid="963376081347721598">"میڈیا آڈیو سے مربوط"</string>
     <string name="bluetooth_headset_profile_summary_connected" msgid="7661070206715520671">"فون آڈیو سے مربوط"</string>
     <string name="bluetooth_opp_profile_summary_connected" msgid="2611913495968309066">"فائل منتقلی سرور سے مربوط ہو گیا ہے"</string>
@@ -93,11 +91,11 @@
     <string name="process_kernel_label" msgid="3916858646836739323">"Android OS"</string>
     <string name="data_usage_uninstalled_apps" msgid="614263770923231598">"ہٹائی گئی ایپس"</string>
     <string name="data_usage_uninstalled_apps_users" msgid="7986294489899813194">"ہٹائی گئی ایپس اور صارفین"</string>
-    <string name="tether_settings_title_usb" msgid="6688416425801386511">"‏USB مربوط کرنا"</string>
+    <string name="tether_settings_title_usb" msgid="6688416425801386511">"‏USB ٹیتھرنگ"</string>
     <string name="tether_settings_title_wifi" msgid="3277144155960302049">"پورٹیبل ہاٹ اسپاٹ"</string>
-    <string name="tether_settings_title_bluetooth" msgid="355855408317564420">"بلوٹوتھ مربوط کرنا"</string>
-    <string name="tether_settings_title_usb_bluetooth" msgid="5355828977109785001">"مربوط کرنا"</string>
-    <string name="tether_settings_title_all" msgid="8356136101061143841">"مربوط کرنا اور پورٹیبل ہاٹ اسپاٹ"</string>
+    <string name="tether_settings_title_bluetooth" msgid="355855408317564420">"بلوٹوتھ ٹیتھرنگ"</string>
+    <string name="tether_settings_title_usb_bluetooth" msgid="5355828977109785001">"ٹیتھرنگ"</string>
+    <string name="tether_settings_title_all" msgid="8356136101061143841">"ٹیتھرنگ و پورٹیبل ہاٹ اسپاٹ"</string>
     <string name="managed_user_title" msgid="8109605045406748842">"تمام کام کی ایپس"</string>
     <string name="user_guest" msgid="8475274842845401871">"مہمان"</string>
     <string name="unknown" msgid="1592123443519355854">"نامعلوم"</string>
@@ -151,7 +149,7 @@
     <string name="development_settings_summary" msgid="1815795401632854041">"ایپ ڈویلپمنٹ کیلئے اختیارات سیٹ کریں"</string>
     <string name="development_settings_not_available" msgid="4308569041701535607">"اس صارف کیلئے ڈیولپر کے اختیارات دستیاب نہیں ہیں"</string>
     <string name="vpn_settings_not_available" msgid="956841430176985598">"‏VPN ترتیبات اس صارف کیلئے دستیاب نہیں ہیں"</string>
-    <string name="tethering_settings_not_available" msgid="6765770438438291012">"ربط کی ترتیبات اس صارف کیلئے دستیاب نہیں ہیں"</string>
+    <string name="tethering_settings_not_available" msgid="6765770438438291012">"ٹیتھرنگ ترتیبات اس صارف کیلئے دستیاب نہیں ہیں"</string>
     <string name="apn_settings_not_available" msgid="7873729032165324000">"رسائی کی جگہ کے نام کی ترتیبات اس صارف کیلئے دستیاب نہیں ہیں"</string>
     <string name="enable_adb" msgid="7982306934419797485">"‏USB ڈیبگ کرنا"</string>
     <string name="enable_adb_summary" msgid="4881186971746056635">"‏USB مربوط ہونے پر ڈيبگ کرنے کی وضع"</string>
diff --git a/packages/SettingsLib/res/values-uz/strings.xml b/packages/SettingsLib/res/values-uz/strings.xml
index 5d504ff..4e92c46 100644
--- a/packages/SettingsLib/res/values-uz/strings.xml
+++ b/packages/SettingsLib/res/values-uz/strings.xml
@@ -56,10 +56,8 @@
     <string name="bluetooth_profile_pan_nap" msgid="8429049285027482959">"Internet aloqasi ulashmasi"</string>
     <string name="bluetooth_profile_map" msgid="5465271250454324383">"Xabarga kirish"</string>
     <string name="bluetooth_profile_sap" msgid="5764222021851283125">"SIM-kartaga kirish"</string>
-    <!-- no translation found for bluetooth_profile_a2dp_high_quality (2221025895896419505) -->
-    <skip />
-    <!-- no translation found for bluetooth_profile_a2dp_high_quality_unknown_codec (5860996587596508755) -->
-    <skip />
+    <string name="bluetooth_profile_a2dp_high_quality" msgid="2221025895896419505">"Yuqori sifatli audiodan foydalanish: <xliff:g id="CODEC_NAME">%1$s</xliff:g>"</string>
+    <string name="bluetooth_profile_a2dp_high_quality_unknown_codec" msgid="5860996587596508755">"Yuqori sifatli audiodan foydalanish"</string>
     <string name="bluetooth_a2dp_profile_summary_connected" msgid="963376081347721598">"Audio qurilmasiga ulangan"</string>
     <string name="bluetooth_headset_profile_summary_connected" msgid="7661070206715520671">"Telefon karnayiga ulanildi"</string>
     <string name="bluetooth_opp_profile_summary_connected" msgid="2611913495968309066">"Fayl almashinish serveriga ulanildi"</string>
diff --git a/packages/SettingsLib/res/values-vi/strings.xml b/packages/SettingsLib/res/values-vi/strings.xml
index 482d7ca..34dd863 100644
--- a/packages/SettingsLib/res/values-vi/strings.xml
+++ b/packages/SettingsLib/res/values-vi/strings.xml
@@ -56,10 +56,8 @@
     <string name="bluetooth_profile_pan_nap" msgid="8429049285027482959">"Chia sẻ kết nối internet"</string>
     <string name="bluetooth_profile_map" msgid="5465271250454324383">"Truy cập tin nhắn"</string>
     <string name="bluetooth_profile_sap" msgid="5764222021851283125">"Quyền truy cập SIM"</string>
-    <!-- no translation found for bluetooth_profile_a2dp_high_quality (2221025895896419505) -->
-    <skip />
-    <!-- no translation found for bluetooth_profile_a2dp_high_quality_unknown_codec (5860996587596508755) -->
-    <skip />
+    <string name="bluetooth_profile_a2dp_high_quality" msgid="2221025895896419505">"Sử dụng âm thanh chất lượng cao: <xliff:g id="CODEC_NAME">%1$s</xliff:g>"</string>
+    <string name="bluetooth_profile_a2dp_high_quality_unknown_codec" msgid="5860996587596508755">"Sử dụng âm thanh chất lượng cao"</string>
     <string name="bluetooth_a2dp_profile_summary_connected" msgid="963376081347721598">"Đã kết nối với âm thanh phương tiện"</string>
     <string name="bluetooth_headset_profile_summary_connected" msgid="7661070206715520671">"Đã kết nối với âm thanh điện thoại"</string>
     <string name="bluetooth_opp_profile_summary_connected" msgid="2611913495968309066">"Đã kết nối với máy chủ chuyển tệp"</string>
diff --git a/packages/SettingsLib/res/values-zh-rCN/strings.xml b/packages/SettingsLib/res/values-zh-rCN/strings.xml
index 41c6210..43d75b3b 100644
--- a/packages/SettingsLib/res/values-zh-rCN/strings.xml
+++ b/packages/SettingsLib/res/values-zh-rCN/strings.xml
@@ -56,10 +56,8 @@
     <string name="bluetooth_profile_pan_nap" msgid="8429049285027482959">"共享互联网连接"</string>
     <string name="bluetooth_profile_map" msgid="5465271250454324383">"消息权限"</string>
     <string name="bluetooth_profile_sap" msgid="5764222021851283125">"SIM 卡存取权限"</string>
-    <!-- no translation found for bluetooth_profile_a2dp_high_quality (2221025895896419505) -->
-    <skip />
-    <!-- no translation found for bluetooth_profile_a2dp_high_quality_unknown_codec (5860996587596508755) -->
-    <skip />
+    <string name="bluetooth_profile_a2dp_high_quality" msgid="2221025895896419505">"使用高品质音频:<xliff:g id="CODEC_NAME">%1$s</xliff:g>"</string>
+    <string name="bluetooth_profile_a2dp_high_quality_unknown_codec" msgid="5860996587596508755">"使用高品质音频"</string>
     <string name="bluetooth_a2dp_profile_summary_connected" msgid="963376081347721598">"已连接到媒体音频"</string>
     <string name="bluetooth_headset_profile_summary_connected" msgid="7661070206715520671">"已连接到手机音频"</string>
     <string name="bluetooth_opp_profile_summary_connected" msgid="2611913495968309066">"已连接到文件传输服务器"</string>
@@ -314,11 +312,11 @@
     <string name="picture_color_mode_desc" msgid="1141891467675548590">"使用 sRGB"</string>
     <string name="daltonizer_mode_disabled" msgid="7482661936053801862">"已停用"</string>
     <string name="daltonizer_mode_monochromacy" msgid="8485709880666106721">"全色盲"</string>
-    <string name="daltonizer_mode_deuteranomaly" msgid="5475532989673586329">"绿色弱视(红绿色)"</string>
+    <string name="daltonizer_mode_deuteranomaly" msgid="5475532989673586329">"绿色弱视(红绿不分)"</string>
     <string name="daltonizer_mode_protanomaly" msgid="8424148009038666065">"红色弱视(红绿色)"</string>
     <string name="daltonizer_mode_tritanomaly" msgid="481725854987912389">"蓝色弱视(蓝黄色)"</string>
     <string name="accessibility_display_daltonizer_preference_title" msgid="5800761362678707872">"色彩校正"</string>
-    <string name="accessibility_display_daltonizer_preference_subtitle" msgid="3484969015295282911">"此功能为实验性功能,可能会影响性能。"</string>
+    <string name="accessibility_display_daltonizer_preference_subtitle" msgid="3484969015295282911">"这是实验性功能,性能可能不稳定。"</string>
     <string name="daltonizer_type_overridden" msgid="3116947244410245916">"已被“<xliff:g id="TITLE">%1$s</xliff:g>”覆盖"</string>
     <string name="power_remaining_duration_only" msgid="845431008899029842">"还剩大约 <xliff:g id="TIME">%1$s</xliff:g>"</string>
     <string name="power_remaining_charging_duration_only" msgid="1421102457410268886">"还需 <xliff:g id="TIME">%1$s</xliff:g>充满电"</string>
diff --git a/packages/SettingsLib/res/values-zh-rHK/strings.xml b/packages/SettingsLib/res/values-zh-rHK/strings.xml
index ecf7fa8..484f1d3 100644
--- a/packages/SettingsLib/res/values-zh-rHK/strings.xml
+++ b/packages/SettingsLib/res/values-zh-rHK/strings.xml
@@ -56,10 +56,8 @@
     <string name="bluetooth_profile_pan_nap" msgid="8429049285027482959">"互聯網連線分享"</string>
     <string name="bluetooth_profile_map" msgid="5465271250454324383">"訊息存取權"</string>
     <string name="bluetooth_profile_sap" msgid="5764222021851283125">"SIM 卡存取"</string>
-    <!-- no translation found for bluetooth_profile_a2dp_high_quality (2221025895896419505) -->
-    <skip />
-    <!-- no translation found for bluetooth_profile_a2dp_high_quality_unknown_codec (5860996587596508755) -->
-    <skip />
+    <string name="bluetooth_profile_a2dp_high_quality" msgid="2221025895896419505">"使用優質音訊編解碼器:<xliff:g id="CODEC_NAME">%1$s</xliff:g>"</string>
+    <string name="bluetooth_profile_a2dp_high_quality_unknown_codec" msgid="5860996587596508755">"使用優質音訊編解碼器"</string>
     <string name="bluetooth_a2dp_profile_summary_connected" msgid="963376081347721598">"已連接媒體音頻裝置"</string>
     <string name="bluetooth_headset_profile_summary_connected" msgid="7661070206715520671">"已連接手機耳機"</string>
     <string name="bluetooth_opp_profile_summary_connected" msgid="2611913495968309066">"已連線至檔案傳輸伺服器"</string>
@@ -321,12 +319,12 @@
     <string name="accessibility_display_daltonizer_preference_subtitle" msgid="3484969015295282911">"這是一項實驗性功能,可能會影響效能。"</string>
     <string name="daltonizer_type_overridden" msgid="3116947244410245916">"已由「<xliff:g id="TITLE">%1$s</xliff:g>」覆寫"</string>
     <string name="power_remaining_duration_only" msgid="845431008899029842">"剩餘約 <xliff:g id="TIME">%1$s</xliff:g>"</string>
-    <string name="power_remaining_charging_duration_only" msgid="1421102457410268886">"<xliff:g id="TIME">%1$s</xliff:g>後就能完全充電"</string>
+    <string name="power_remaining_charging_duration_only" msgid="1421102457410268886">"<xliff:g id="TIME">%1$s</xliff:g>後就能充滿電"</string>
     <string name="power_remaining_duration_only_short" msgid="5329694252258605547">"尚餘 <xliff:g id="TIME">%1$s</xliff:g>"</string>
     <string name="power_discharging_duration" msgid="2843747179907396142">"<xliff:g id="LEVEL">%1$s</xliff:g> - 剩餘約 <xliff:g id="TIME">%2$s</xliff:g>"</string>
     <string name="power_discharging_duration_short" msgid="4192244429001842403">"<xliff:g id="LEVEL">%1$s</xliff:g> - 尚餘 <xliff:g id="TIME">%2$s</xliff:g>"</string>
     <string name="power_charging" msgid="1779532561355864267">"<xliff:g id="LEVEL">%1$s</xliff:g> - <xliff:g id="STATE">%2$s</xliff:g>"</string>
-    <string name="power_charging_duration" msgid="4676999980973411875">"<xliff:g id="LEVEL">%1$s</xliff:g> - 還需 <xliff:g id="TIME">%2$s</xliff:g>才能完全充電"</string>
+    <string name="power_charging_duration" msgid="4676999980973411875">"<xliff:g id="LEVEL">%1$s</xliff:g> - 還需 <xliff:g id="TIME">%2$s</xliff:g>才能充滿電"</string>
     <string name="power_charging_duration_short" msgid="1098603958472207920">"<xliff:g id="LEVEL">%1$s</xliff:g> - <xliff:g id="TIME">%2$s</xliff:g>"</string>
     <string name="battery_info_status_unknown" msgid="196130600938058547">"未知"</string>
     <string name="battery_info_status_charging" msgid="1705179948350365604">"充電中"</string>
diff --git a/packages/SettingsLib/res/values-zh-rTW/strings.xml b/packages/SettingsLib/res/values-zh-rTW/strings.xml
index 92b5231..050c556 100644
--- a/packages/SettingsLib/res/values-zh-rTW/strings.xml
+++ b/packages/SettingsLib/res/values-zh-rTW/strings.xml
@@ -56,10 +56,8 @@
     <string name="bluetooth_profile_pan_nap" msgid="8429049285027482959">"網際網路連線分享"</string>
     <string name="bluetooth_profile_map" msgid="5465271250454324383">"訊息存取權"</string>
     <string name="bluetooth_profile_sap" msgid="5764222021851283125">"SIM 卡存取權"</string>
-    <!-- no translation found for bluetooth_profile_a2dp_high_quality (2221025895896419505) -->
-    <skip />
-    <!-- no translation found for bluetooth_profile_a2dp_high_quality_unknown_codec (5860996587596508755) -->
-    <skip />
+    <string name="bluetooth_profile_a2dp_high_quality" msgid="2221025895896419505">"使用高品質音訊:<xliff:g id="CODEC_NAME">%1$s</xliff:g>"</string>
+    <string name="bluetooth_profile_a2dp_high_quality_unknown_codec" msgid="5860996587596508755">"使用高品質音訊"</string>
     <string name="bluetooth_a2dp_profile_summary_connected" msgid="963376081347721598">"連接至媒體音訊"</string>
     <string name="bluetooth_headset_profile_summary_connected" msgid="7661070206715520671">"連接至電話音訊"</string>
     <string name="bluetooth_opp_profile_summary_connected" msgid="2611913495968309066">"已連線到檔案傳輸伺服器"</string>
diff --git a/packages/SettingsLib/res/values-zu/strings.xml b/packages/SettingsLib/res/values-zu/strings.xml
index 415ddd9..d2a5743 100644
--- a/packages/SettingsLib/res/values-zu/strings.xml
+++ b/packages/SettingsLib/res/values-zu/strings.xml
@@ -56,10 +56,8 @@
     <string name="bluetooth_profile_pan_nap" msgid="8429049285027482959">"Ukwabelana ngoxhumano lwe-Inthanethi"</string>
     <string name="bluetooth_profile_map" msgid="5465271250454324383">"Ukufinyelela umlayezo"</string>
     <string name="bluetooth_profile_sap" msgid="5764222021851283125">"Ukufinyelela kwe-SIM"</string>
-    <!-- no translation found for bluetooth_profile_a2dp_high_quality (2221025895896419505) -->
-    <skip />
-    <!-- no translation found for bluetooth_profile_a2dp_high_quality_unknown_codec (5860996587596508755) -->
-    <skip />
+    <string name="bluetooth_profile_a2dp_high_quality" msgid="2221025895896419505">"Sebenzisa umsindo wekhwalithi ephezulu: <xliff:g id="CODEC_NAME">%1$s</xliff:g>"</string>
+    <string name="bluetooth_profile_a2dp_high_quality_unknown_codec" msgid="5860996587596508755">"Sebenzisa umsindo wekhwalithi ephezulu"</string>
     <string name="bluetooth_a2dp_profile_summary_connected" msgid="963376081347721598">"Ixhume emsindweni wemidiya"</string>
     <string name="bluetooth_headset_profile_summary_connected" msgid="7661070206715520671">"Ixhunywe kumsindo wefoni"</string>
     <string name="bluetooth_opp_profile_summary_connected" msgid="2611913495968309066">"Ixhunywe kwiseva yokudlulisa ifayela"</string>
diff --git a/packages/SettingsLib/src/com/android/settingslib/RestrictedLockUtils.java b/packages/SettingsLib/src/com/android/settingslib/RestrictedLockUtils.java
index 49fc2ea..32e6389 100644
--- a/packages/SettingsLib/src/com/android/settingslib/RestrictedLockUtils.java
+++ b/packages/SettingsLib/src/com/android/settingslib/RestrictedLockUtils.java
@@ -35,8 +35,8 @@
 import android.os.UserManager;
 import android.provider.Settings;
 import android.support.annotation.VisibleForTesting;
-import android.text.Spanned;
 import android.text.SpannableStringBuilder;
+import android.text.Spanned;
 import android.text.style.ForegroundColorSpan;
 import android.text.style.ImageSpan;
 import android.view.MenuItem;
@@ -75,41 +75,52 @@
      */
     public static EnforcedAdmin checkIfRestrictionEnforced(Context context,
             String userRestriction, int userId) {
-        DevicePolicyManager dpm = (DevicePolicyManager) context.getSystemService(
+        final DevicePolicyManager dpm = (DevicePolicyManager) context.getSystemService(
                 Context.DEVICE_POLICY_SERVICE);
         if (dpm == null) {
             return null;
         }
-        UserManager um = UserManager.get(context);
-        int restrictionSource = um.getUserRestrictionSource(userRestriction,
-                UserHandle.of(userId));
 
-        // If the restriction is not enforced or enforced only by system then return null
-        if (restrictionSource == UserManager.RESTRICTION_NOT_SET
-                || restrictionSource == UserManager.RESTRICTION_SOURCE_SYSTEM) {
+        final UserManager um = UserManager.get(context);
+        final List<UserManager.EnforcingUser> enforcingUsers =
+                um.getUserRestrictionSources(userRestriction, UserHandle.of(userId));
+
+        if (enforcingUsers.isEmpty()) {
+            // Restriction is not enforced.
             return null;
+        } else if (enforcingUsers.size() > 1) {
+            return EnforcedAdmin.MULTIPLE_ENFORCED_ADMIN;
         }
 
-        final boolean enforcedByProfileOwner =
-                (restrictionSource & UserManager.RESTRICTION_SOURCE_PROFILE_OWNER) != 0;
-        final boolean enforcedByDeviceOwner =
-                (restrictionSource & UserManager.RESTRICTION_SOURCE_DEVICE_OWNER) != 0;
-        if (enforcedByProfileOwner) {
-            return getProfileOwner(context, userId);
-        } else if (enforcedByDeviceOwner) {
+        final int restrictionSource = enforcingUsers.get(0).getUserRestrictionSource();
+        final int adminUserId = enforcingUsers.get(0).getUserHandle().getIdentifier();
+
+        if (restrictionSource == UserManager.RESTRICTION_SOURCE_PROFILE_OWNER) {
+            // Check if it is a profile owner of the user under consideration.
+            if (adminUserId == userId) {
+                return getProfileOwner(context, adminUserId);
+            } else {
+                // Check if it is a profile owner of a managed profile of the current user.
+                // Otherwise it is in a separate user and we return a default EnforcedAdmin.
+                final UserInfo parentUser = um.getProfileParent(adminUserId);
+                return (parentUser != null && parentUser.id == userId)
+                        ? getProfileOwner(context, adminUserId)
+                        : EnforcedAdmin.MULTIPLE_ENFORCED_ADMIN;
+            }
+        } else if (restrictionSource == UserManager.RESTRICTION_SOURCE_DEVICE_OWNER) {
             // When the restriction is enforced by device owner, return the device owner admin only
             // if the admin is for the {@param userId} otherwise return a default EnforcedAdmin.
-            final EnforcedAdmin deviceOwner = getDeviceOwner(context);
-            return deviceOwner.userId == userId
-                    ? deviceOwner
-                    : EnforcedAdmin.MULTIPLE_ENFORCED_ADMIN;
+            return adminUserId == userId
+                    ? getDeviceOwner(context) : EnforcedAdmin.MULTIPLE_ENFORCED_ADMIN;
         }
+
+        // If the restriction is enforced by system then return null.
         return null;
     }
 
     public static boolean hasBaseUserRestriction(Context context,
             String userRestriction, int userId) {
-        UserManager um = (UserManager) context.getSystemService(Context.USER_SERVICE);
+        final UserManager um = (UserManager) context.getSystemService(Context.USER_SERVICE);
         return um.hasBaseUserRestriction(userRestriction, UserHandle.of(userId));
     }
 
@@ -424,7 +435,6 @@
         if (dpm == null) {
             return null;
         }
-        LockPatternUtils lockPatternUtils = new LockPatternUtils(context);
         EnforcedAdmin enforcedAdmin = null;
         final int userId = UserHandle.myUserId();
         final UserManager um = UserManager.get(context);
diff --git a/packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java b/packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java
index 48429e8..a6347c6 100644
--- a/packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java
+++ b/packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java
@@ -898,13 +898,14 @@
             Slog.v(LOG_TAG, "getGlobalSetting(" + name + ")");
         }
 
-        // Ensure the caller can access the setting.
-        enforceSettingReadable(name, SETTINGS_TYPE_GLOBAL, UserHandle.getCallingUserId());
-
         // Get the value.
         synchronized (mLock) {
-            return mSettingsRegistry.getSettingLocked(SETTINGS_TYPE_GLOBAL,
+            Setting setting = mSettingsRegistry.getSettingLocked(SETTINGS_TYPE_GLOBAL,
                     UserHandle.USER_SYSTEM, name);
+            // Ensure the caller can access the setting before we return it.
+            enforceSettingReadable(setting, name, SETTINGS_TYPE_GLOBAL,
+                    UserHandle.getCallingUserId());
+            return setting;
         }
     }
 
@@ -1062,9 +1063,6 @@
         // Resolve the userId on whose behalf the call is made.
         final int callingUserId = resolveCallingUserIdEnforcingPermissionsLocked(requestingUserId);
 
-        // Ensure the caller can access the setting.
-        enforceSettingReadable(name, SETTINGS_TYPE_SECURE, UserHandle.getCallingUserId());
-
         // Determine the owning user as some profile settings are cloned from the parent.
         final int owningUserId = resolveOwningUserIdForSecureSettingLocked(callingUserId, name);
 
@@ -1078,6 +1076,7 @@
 
         // As of Android O, the SSAID is read from an app-specific entry in table
         // SETTINGS_FILE_SSAID, unless accessed by a system process.
+        // All apps are allowed to access their SSAID, so we skip the permission check.
         if (isNewSsaidSetting(name)) {
             PackageInfo callingPkg = getCallingPackageInfo(owningUserId);
             synchronized (mLock) {
@@ -1087,8 +1086,12 @@
 
         // Not the SSAID; do a straight lookup
         synchronized (mLock) {
-            return mSettingsRegistry.getSettingLocked(SETTINGS_TYPE_SECURE,
+            Setting setting = mSettingsRegistry.getSettingLocked(SETTINGS_TYPE_SECURE,
                     owningUserId, name);
+            // Ensure the caller can access the setting before we return it.
+            enforceSettingReadable(setting, name, SETTINGS_TYPE_SECURE,
+                    UserHandle.getCallingUserId());
+            return setting;
         }
     }
 
@@ -1289,15 +1292,18 @@
         // Resolve the userId on whose behalf the call is made.
         final int callingUserId = resolveCallingUserIdEnforcingPermissionsLocked(requestingUserId);
 
-        // Ensure the caller can access the setting.
-        enforceSettingReadable(name, SETTINGS_TYPE_SYSTEM, UserHandle.getCallingUserId());
 
         // Determine the owning user as some profile settings are cloned from the parent.
         final int owningUserId = resolveOwningUserIdForSystemSettingLocked(callingUserId, name);
 
         // Get the value.
         synchronized (mLock) {
-            return mSettingsRegistry.getSettingLocked(SETTINGS_TYPE_SYSTEM, owningUserId, name);
+            Setting setting = mSettingsRegistry.getSettingLocked(SETTINGS_TYPE_SYSTEM,
+                    owningUserId, name);
+            // Ensure the caller can access the setting before we return it.
+            enforceSettingReadable(setting, name, SETTINGS_TYPE_SYSTEM,
+                    UserHandle.getCallingUserId());
+            return setting;
         }
     }
 
@@ -1644,14 +1650,22 @@
         }
     }
 
-    private void enforceSettingReadable(String settingName, int settingsType, int userId) {
+    private void enforceSettingReadable(Setting setting, String settingName, int settingsType,
+            int userId) {
         if (UserHandle.getAppId(Binder.getCallingUid()) < Process.FIRST_APPLICATION_UID) {
             return;
         }
         ApplicationInfo ai = getCallingApplicationInfoOrThrow();
+        // Installed apps are allowed to read all settings.
         if (!ai.isInstantApp()) {
             return;
         }
+        // Instant Apps are allowed to read settings defined by applications.
+        // TODO: Replace this with an API that allows the setting application to say if a setting
+        // shoud/shouldn't be accessible.
+        if (!setting.isDefaultFromSystem()) {
+            return;
+        }
         if (!getInstantAppAccessibleSettings(settingsType).contains(settingName)) {
             throw new SecurityException("Setting " + settingName + " is not accessible from"
                     + " ephemeral package " + getCallingPackage());
diff --git a/packages/SystemUI/res-keyguard/values/strings.xml b/packages/SystemUI/res-keyguard/values/strings.xml
index 2f52227..1efa3a8 100644
--- a/packages/SystemUI/res-keyguard/values/strings.xml
+++ b/packages/SystemUI/res-keyguard/values/strings.xml
@@ -102,6 +102,9 @@
     <string name="keyguard_widget_12_hours_format" translatable="false">h\uee01mm</string>
     <!-- Time format strings for fall-back clock widget -->
     <string name="keyguard_widget_24_hours_format" translatable="false">kk\uee01mm</string>
+    <!-- The character used in keyguard_widget_12_hours_format and keyguard_widget_24_hours_format
+         to represent a ":". -->
+    <string name="keyguard_fancy_colon" translatable="false">\uee01</string>
 
     <!-- Accessibility description of the PIN password view. [CHAR_LIMIT=none] -->
     <string name="keyguard_accessibility_pin_area">PIN area</string>
diff --git a/packages/SystemUI/res/drawable/stat_sys_data_fully_connected_1x.xml b/packages/SystemUI/res/drawable/stat_sys_data_fully_connected_1x.xml
index be9a7e2..d7463a4 100644
--- a/packages/SystemUI/res/drawable/stat_sys_data_fully_connected_1x.xml
+++ b/packages/SystemUI/res/drawable/stat_sys_data_fully_connected_1x.xml
@@ -14,10 +14,10 @@
     limitations under the License.
 -->
 <vector xmlns:android="http://schemas.android.com/apk/res/android"
-    android:width="17dp"
-    android:height="17dp"
-    android:viewportWidth="12.0"
-    android:viewportHeight="12.0">
+        android:width="8.5dp"
+        android:height="17dp"
+        android:viewportWidth="12.0"
+        android:viewportHeight="24.0">
     <path
         android:fillColor="#FFFFFFFF"
         android:pathData="M3.500000,11.000000L1.800000,11.000000L1.800000,4.400000L0.200000,5.100000L0.200000,3.700000l3.100000,-1.300000l0.200000,0.000000L3.500000,11.000000z"/>
diff --git a/packages/SystemUI/res/drawable/stat_sys_data_fully_connected_3g.xml b/packages/SystemUI/res/drawable/stat_sys_data_fully_connected_3g.xml
index fd7a658..6309b6d 100644
--- a/packages/SystemUI/res/drawable/stat_sys_data_fully_connected_3g.xml
+++ b/packages/SystemUI/res/drawable/stat_sys_data_fully_connected_3g.xml
@@ -14,10 +14,10 @@
     limitations under the License.
 -->
 <vector xmlns:android="http://schemas.android.com/apk/res/android"
-        android:width="17dp"
+        android:width="9.208dp"
         android:height="17dp"
         android:viewportWidth="13.0"
-        android:viewportHeight="13.0">
+        android:viewportHeight="24.0">
     <path
         android:fillColor="#FFFFFFFF"
         android:pathData="M2.000000,6.000000l0.800000,0.000000c0.300000,0.000000 0.500000,-0.100000 0.700000,-0.300000s0.200000,-0.500000 0.200000,-0.900000c0.000000,-0.300000 -0.100000,-0.600000 -0.200000,-0.800000S3.200000,3.700000 2.900000,3.700000C2.700000,3.700000 2.500000,3.800000 2.300000,4.000000S2.100000,4.400000 2.100000,4.700000L0.500000,4.700000C0.500000,4.000000 0.700000,3.400000 1.100000,3.000000s1.000000,-0.600000 1.700000,-0.600000c0.800000,0.000000 1.400000,0.200000 1.900000,0.600000s0.700000,1.000000 0.700000,1.800000c0.000000,0.400000 -0.100000,0.700000 -0.300000,1.100000S4.600000,6.500000 4.300000,6.600000C4.700000,6.800000 5.000000,7.100000 5.200000,7.400000s0.300000,0.700000 0.300000,1.200000c0.000000,0.800000 -0.200000,1.400000 -0.700000,1.800000s-1.100000,0.700000 -1.900000,0.700000c-0.700000,0.000000 -1.300000,-0.200000 -1.800000,-0.600000s-0.700000,-1.000000 -0.700000,-1.800000L2.000000,8.700000C2.000000,9.000000 2.100000,9.300000 2.300000,9.500000s0.400000,0.300000 0.600000,0.300000c0.300000,0.000000 0.500000,-0.100000 0.700000,-0.300000S3.900000,9.000000 3.900000,8.600000c0.000000,-0.500000 -0.100000,-0.800000 -0.300000,-1.000000S3.200000,7.300000 2.800000,7.300000L2.000000,7.300000L2.000000,6.000000z"/>
diff --git a/packages/SystemUI/res/drawable/stat_sys_data_fully_connected_4g.xml b/packages/SystemUI/res/drawable/stat_sys_data_fully_connected_4g.xml
index 02c4ab6..4067ae5 100644
--- a/packages/SystemUI/res/drawable/stat_sys_data_fully_connected_4g.xml
+++ b/packages/SystemUI/res/drawable/stat_sys_data_fully_connected_4g.xml
@@ -14,10 +14,10 @@
     limitations under the License.
 -->
 <vector xmlns:android="http://schemas.android.com/apk/res/android"
-        android:width="17dp"
+        android:width="8.5dp"
         android:height="17dp"
         android:viewportWidth="12.0"
-        android:viewportHeight="12.0">
+        android:viewportHeight="24.0">
     <path
         android:fillColor="#FFFFFFFF"
         android:pathData="M4.600000,7.800000l0.700000,0.000000l0.000000,1.300000L4.600000,9.100000L4.600000,11.000000L3.000000,11.000000L3.000000,9.200000L0.100000,9.200000L0.000000,8.100000L3.000000,2.500000l1.700000,0.000000L4.700000,7.800000zM1.600000,7.800000L3.000000,7.800000l0.000000,-3.000000L2.900000,5.000000L1.600000,7.800000z"/>
diff --git a/packages/SystemUI/res/drawable/stat_sys_data_fully_connected_4g_plus.xml b/packages/SystemUI/res/drawable/stat_sys_data_fully_connected_4g_plus.xml
index daf4061..3cdd3e1 100644
--- a/packages/SystemUI/res/drawable/stat_sys_data_fully_connected_4g_plus.xml
+++ b/packages/SystemUI/res/drawable/stat_sys_data_fully_connected_4g_plus.xml
@@ -14,10 +14,10 @@
     limitations under the License.
 -->
 <vector xmlns:android="http://schemas.android.com/apk/res/android"
-        android:width="25.5dp"
+        android:width="17.0dp"
         android:height="17.0dp"
-        android:viewportWidth="18.0"
-        android:viewportHeight="12.0">
+        android:viewportWidth="24.0"
+        android:viewportHeight="24.0">
     <path
         android:fillColor="#FFFFFFFF"
         android:pathData="M4.6,7.8l0.7,0.0l0.0,1.3L4.6,9.1L4.6,11.0L3.0,11.0L3.0,9.2L0.1,9.2L0.0,8.2l3.0,-5.7l1.7,0.0L4.6,7.8L4.6,7.8zM1.7,7.8L3.0,7.8l0.0,-3.0L2.9,5.0L1.7,7.8z"/>
diff --git a/packages/SystemUI/res/drawable/stat_sys_data_fully_connected_e.xml b/packages/SystemUI/res/drawable/stat_sys_data_fully_connected_e.xml
index cd0cc65..acaa9b1 100644
--- a/packages/SystemUI/res/drawable/stat_sys_data_fully_connected_e.xml
+++ b/packages/SystemUI/res/drawable/stat_sys_data_fully_connected_e.xml
@@ -14,10 +14,10 @@
     limitations under the License.
 -->
 <vector xmlns:android="http://schemas.android.com/apk/res/android"
-        android:width="7.083dp"
+        android:width="3.541dp"
         android:height="17dp"
         android:viewportWidth="5.0"
-        android:viewportHeight="12.0">
+        android:viewportHeight="24.0">
     <path
         android:fillColor="#FFFFFFFF"
         android:pathData="M4.400000,7.300000L1.700000,7.300000l0.000000,2.400000l3.300000,0.000000L5.000000,11.000000L0.000000,11.000000L0.000000,2.500000l4.900000,0.000000l0.000000,1.300000L1.700000,3.800000l0.000000,2.100000l2.800000,0.000000L4.500000,7.300000z"/>
diff --git a/packages/SystemUI/res/drawable/stat_sys_data_fully_connected_g.xml b/packages/SystemUI/res/drawable/stat_sys_data_fully_connected_g.xml
index 92ed49c..7985237 100644
--- a/packages/SystemUI/res/drawable/stat_sys_data_fully_connected_g.xml
+++ b/packages/SystemUI/res/drawable/stat_sys_data_fully_connected_g.xml
@@ -14,10 +14,10 @@
     limitations under the License.
 -->
 <vector xmlns:android="http://schemas.android.com/apk/res/android"
-        android:width="9.154dp"
+        android:width="4.958dp"
         android:height="17dp"
         android:viewportWidth="7.0"
-        android:viewportHeight="13">
+        android:viewportHeight="24.0">
     <path
         android:fillColor="#FFFFFFFF"
         android:pathData="M6.500000,9.900000c-0.200000,0.400000 -0.600000,0.700000 -1.000000,0.900000s-1.000000,0.400000 -1.800000,0.400000c-0.900000,0.000000 -1.700000,-0.300000 -2.200000,-0.800000S0.700000,9.000000 0.700000,7.900000L0.700000,5.600000c0.000000,-1.100000 0.300000,-1.900000 0.800000,-2.400000s1.200000,-0.800000 2.100000,-0.800000c1.000000,0.000000 1.700000,0.200000 2.100000,0.700000s0.700000,1.200000 0.700000,2.100000L4.700000,5.200000c0.000000,-0.500000 -0.100000,-0.900000 -0.200000,-1.100000S4.000000,3.700000 3.600000,3.700000c-0.400000,0.000000 -0.700000,0.200000 -0.900000,0.500000S2.300000,5.000000 2.300000,5.600000l0.000000,2.300000c0.000000,0.700000 0.100000,1.100000 0.300000,1.400000s0.600000,0.500000 1.000000,0.500000c0.300000,0.000000 0.600000,0.000000 0.700000,-0.100000s0.300000,-0.200000 0.400000,-0.300000L4.700000,7.800000L3.500000,7.800000L3.500000,6.600000l2.900000,0.000000L6.400000,9.900000z"/>
diff --git a/packages/SystemUI/res/drawable/stat_sys_data_fully_connected_h.xml b/packages/SystemUI/res/drawable/stat_sys_data_fully_connected_h.xml
index ca61b6f..fda8761 100644
--- a/packages/SystemUI/res/drawable/stat_sys_data_fully_connected_h.xml
+++ b/packages/SystemUI/res/drawable/stat_sys_data_fully_connected_h.xml
@@ -14,10 +14,10 @@
     limitations under the License.
 -->
 <vector xmlns:android="http://schemas.android.com/apk/res/android"
-        android:width="9.5dp"
+        android:width="4.25dp"
         android:height="17dp"
         android:viewportWidth="6.0"
-        android:viewportHeight="12.0">
+        android:viewportHeight="24.0">
     <path
         android:fillColor="#FFFFFFFF"
         android:pathData="M6.000000,11.000000L4.400000,11.000000L4.400000,7.500000L1.700000,7.500000L1.700000,11.000000L0.000000,11.000000L0.000000,2.500000l1.700000,0.000000l0.000000,3.700000l2.700000,0.000000L4.400000,2.500000L6.000000,2.500000L6.000000,11.000000z"/>
diff --git a/packages/SystemUI/res/drawable/stat_sys_data_fully_connected_lte.xml b/packages/SystemUI/res/drawable/stat_sys_data_fully_connected_lte.xml
index add96b4..c08ff20 100644
--- a/packages/SystemUI/res/drawable/stat_sys_data_fully_connected_lte.xml
+++ b/packages/SystemUI/res/drawable/stat_sys_data_fully_connected_lte.xml
@@ -14,10 +14,10 @@
     limitations under the License.
 -->
 <vector xmlns:android="http://schemas.android.com/apk/res/android"
-        android:width="18.417dp"
+        android:width="9.208dp"
         android:height="17dp"
-        android:viewportWidth="13"
-        android:viewportHeight="12.0">
+        android:viewportWidth="13.0"
+        android:viewportHeight="24.0">
     <path
         android:fillColor="#FFFFFFFF"
         android:pathData="M2.000000,9.700000l2.000000,0.000000L4.000000,11.000000L0.300000,11.000000L0.300000,2.500000L2.000000,2.500000L2.000000,9.700000z"/>
diff --git a/packages/SystemUI/res/drawable/stat_sys_data_fully_connected_lte_plus.xml b/packages/SystemUI/res/drawable/stat_sys_data_fully_connected_lte_plus.xml
index 8811d2f..db18fad 100644
--- a/packages/SystemUI/res/drawable/stat_sys_data_fully_connected_lte_plus.xml
+++ b/packages/SystemUI/res/drawable/stat_sys_data_fully_connected_lte_plus.xml
@@ -14,10 +14,10 @@
     limitations under the License.
 -->
 <vector xmlns:android="http://schemas.android.com/apk/res/android"
-        android:width="25.0dp"
+        android:width="17.0dp"
         android:height="17.0dp"
-        android:viewportWidth="18.0"
-        android:viewportHeight="12.0">
+        android:viewportWidth="24.0"
+        android:viewportHeight="24.0">
     <path
         android:fillColor="#FFFFFFFF"
         android:pathData="M2.0,9.7l2.0,0.0L4.0,11.0L0.4,11.0L0.4,2.5L2.0,2.5L2.0,9.7z"/>
diff --git a/packages/SystemUI/res/drawable/stat_sys_roaming.xml b/packages/SystemUI/res/drawable/stat_sys_roaming.xml
index 363e231..4baa472 100644
--- a/packages/SystemUI/res/drawable/stat_sys_roaming.xml
+++ b/packages/SystemUI/res/drawable/stat_sys_roaming.xml
@@ -14,10 +14,10 @@
     limitations under the License.
 -->
 <vector xmlns:android="http://schemas.android.com/apk/res/android"
-        android:width="4.25dp"
+        android:width="8.5dp"
         android:height="17dp"
         android:viewportWidth="6.0"
-        android:viewportHeight="24.0">
+        android:viewportHeight="12.0">
     <path
         android:fillColor="#FFFFFFFF"
         android:pathData="M2.800000,7.900000l-1.000000,0.000000L1.800000,11.000000L0.200000,11.000000L0.200000,2.500000l2.700000,0.000000c0.900000,0.000000 1.500000,0.200000 2.000000,0.700000s0.700000,1.100000 0.700000,1.900000c0.000000,0.600000 -0.100000,1.100000 -0.300000,1.500000S4.800000,7.200000 4.400000,7.400000l1.500000,3.500000L5.900000,11.000000L4.100000,11.000000L2.800000,7.900000zM1.800000,6.500000l1.100000,0.000000c0.400000,0.000000 0.600000,-0.100000 0.800000,-0.400000S4.000000,5.600000 4.000000,5.200000c0.000000,-0.400000 -0.100000,-0.800000 -0.300000,-1.000000S3.300000,3.800000 2.900000,3.800000L1.800000,3.800000L1.800000,6.500000z"/>
diff --git a/packages/SystemUI/res/drawable/stat_sys_wifi_signal_disconnected.xml b/packages/SystemUI/res/drawable/stat_sys_wifi_signal_disconnected.xml
deleted file mode 100644
index 8e626e9..0000000
--- a/packages/SystemUI/res/drawable/stat_sys_wifi_signal_disconnected.xml
+++ /dev/null
@@ -1,41 +0,0 @@
-<!--
-    Copyright (C) 2016 The Android Open Source Project
-
-    Licensed under the Apache License, Version 2.0 (the "License");
-    you may not use this file except in compliance with the License.
-    You may obtain a copy of the License at
-
-         http://www.apache.org/licenses/LICENSE-2.0
-
-    Unless required by applicable law or agreed to in writing, software
-    distributed under the License is distributed on an "AS IS" BASIS,
-    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-    See the License for the specific language governing permissions and
-    limitations under the License.
--->
-<vector xmlns:android="http://schemas.android.com/apk/res/android"
-        android:width="18.41dp"
-        android:height="17dp"
-        android:viewportWidth="26.0"
-        android:viewportHeight="24.0">
-    <path
-        android:fillColor="?attr/backgroundColor"
-        android:pathData="M21.0,8.5
-        c0.85,0.0 1.6,0.23 2.3,0.62l2.24,-2.79
-        C25.1,5.96 20.26,2.0 13.0,2.0
-        S0.9,5.9 0.42,6.32
-        l12.57,15.6 4.21,-5.17
-        c-0.76,-0.87 -1.22,-2.0 -1.22,-3.25
-        c0.0,-2.76 2.24,-5.0 5.0,-5.0z"/>
-    <path
-        android:fillColor="?attr/backgroundColor"
-        android:pathData="M21.0,10.0
-        c-1.93,0.0 -3.5,1.57 -3.5,3.5l1.75,0.0
-        c0.0,-0.9 0.78,-1.75 1.75,-1.75s1.7,0.78 1.75,1.75
-        c0.0,0.48 -0.2,0.92 -0.51,1.24l-1.09,1.1
-        c-0.6,0.63 -1.02,1.51 -1.02,2.47l0.0,0.44l1.75,0.0
-        c0.0,-1.3 0.39,-1.84 1.03,-2.47l0.78,-0.8
-        c0.5,-0.5 0.82,-1.2 0.82,-1.97
-        C24.5,11.57 22.93,10.0 21.0,10.0z
-        m-0.95,11.95l1.9,0.0l0.0,-1.9l-1.9,0.0l0.0,1.9z"/>
-</vector>
diff --git a/packages/SystemUI/res/drawable/stat_sys_wifi_signal_null.xml b/packages/SystemUI/res/drawable/stat_sys_wifi_signal_null.xml
index c1856fa..5169de4 100644
--- a/packages/SystemUI/res/drawable/stat_sys_wifi_signal_null.xml
+++ b/packages/SystemUI/res/drawable/stat_sys_wifi_signal_null.xml
@@ -20,8 +20,5 @@
         android:viewportHeight="24.0">
     <path
         android:fillColor="?attr/backgroundColor"
-        android:pathData="M17.500000,16.500000L5.800000,3.400000c0.000000,0.000000 0.000000,0.000000 0.000000,0.000000l-2.700000,-3.000000L1.600000,1.800000l2.200000,2.500000c-2.000000,1.000000 -3.200000,2.000000 -3.400000,2.200000L13.000000,22.000000l0.000000,0.000000l0.000000,0.000000l0.000000,0.000000l0.000000,0.000000l3.200000,-3.900000l2.400000,2.700000l1.500000,-1.400000L17.500000,16.500000L17.500000,16.500000z"/>
-    <path
-        android:fillColor="?attr/backgroundColor"
-        android:pathData="M25.600000,6.500000C25.100000,6.100000 20.299999,2.100000 13.000000,2.100000c-1.900000,0.000000 -3.600000,0.300000 -5.200000,0.700000L18.700001,15.000000L25.600000,6.500000z"/>
+        android:pathData="M13.000000,2.000000C7.700000,2.000000 3.700000,3.900000 0.400000,6.400000L13.000000,22.000000L25.600000,6.500000C22.299999,4.000000 18.299999,2.000000 13.000000,2.000000zM13.000000,18.600000L3.300000,7.000000l0.000000,0.000000l0.000000,0.000000C6.000000,5.300000 8.700000,4.000000 13.000000,4.000000s7.000000,1.400000 9.700000,3.000000l0.000000,0.000000l0.000000,0.000000L13.000000,18.600000z"/>
 </vector>
diff --git a/packages/SystemUI/res/layout/mobile_signal_group.xml b/packages/SystemUI/res/layout/mobile_signal_group.xml
index 6d4365c..33effba 100644
--- a/packages/SystemUI/res/layout/mobile_signal_group.xml
+++ b/packages/SystemUI/res/layout/mobile_signal_group.xml
@@ -63,21 +63,20 @@
             systemui:hasOverlappingRendering="false"
             />
         <ImageView
-            android:id="@+id/mobile_roaming"
+            android:id="@+id/mobile_type"
             android:layout_height="wrap_content"
             android:layout_width="wrap_content"
-            android:src="@drawable/stat_sys_roaming"
-            android:contentDescription="@string/accessibility_data_connection_roaming"
-            android:visibility="gone"
             />
         <ImageView
-            android:id="@+id/mobile_type"
+            android:id="@+id/mobile_roaming"
             android:layout_width="wrap_content"
             android:layout_height="17dp"
-            android:paddingStart="19dp"
+            android:paddingStart="22dp"
             android:paddingTop="1.5dp"
             android:paddingBottom="3dp"
             android:scaleType="fitCenter"
+            android:src="@drawable/stat_sys_roaming"
+            android:contentDescription="@string/accessibility_data_connection_roaming"
             android:visibility="gone" />
     </FrameLayout>
 </LinearLayout>
diff --git a/packages/SystemUI/res/layout/notification_info.xml b/packages/SystemUI/res/layout/notification_info.xml
index 0c9858d..6fe00c0 100644
--- a/packages/SystemUI/res/layout/notification_info.xml
+++ b/packages/SystemUI/res/layout/notification_info.xml
@@ -74,8 +74,9 @@
         android:orientation="horizontal">
         <!-- Channel Text -->
         <LinearLayout
-            android:layout_width="wrap_content"
+            android:layout_width="0dp"
             android:layout_height="wrap_content"
+            android:layout_weight="1"
             android:orientation="vertical">
             <!-- Channel Name -->
             <TextView
@@ -113,7 +114,6 @@
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
             android:layout_gravity="end|center_vertical"
-            android:layout_weight="1"
             android:contentDescription="@string/notification_channel_switch_accessibility"
             android:background="@null" />
     </LinearLayout>
diff --git a/packages/SystemUI/res/layout/signal_cluster_view.xml b/packages/SystemUI/res/layout/signal_cluster_view.xml
index 5df50cd..9a97d60 100644
--- a/packages/SystemUI/res/layout/signal_cluster_view.xml
+++ b/packages/SystemUI/res/layout/signal_cluster_view.xml
@@ -53,54 +53,9 @@
             android:alpha="0.0"
             />
     </FrameLayout>
-    <ViewStub
-        android:id="@+id/connected_device_signals_stub"
-        android:layout="@layout/connected_device_signal"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content" />
-    <LinearLayout
-        android:id="@+id/mobile_signal_group"
-        android:layout_height="wrap_content"
-        android:layout_width="wrap_content"
-        >
-    </LinearLayout>
-    <View
-        android:id="@+id/wifi_signal_spacer"
-        android:layout_width="@dimen/status_bar_wifi_signal_spacer_width"
-        android:layout_height="4dp"
-        android:visibility="gone"
-        />
-    <FrameLayout
-        android:id="@+id/no_sims_combo"
-        android:layout_height="wrap_content"
-        android:layout_width="wrap_content"
-        android:contentDescription="@string/accessibility_no_sims">
-        <com.android.systemui.statusbar.AlphaOptimizedImageView
-            android:theme="@style/DualToneLightTheme"
-            android:id="@+id/no_sims"
-            android:layout_height="wrap_content"
-            android:layout_width="wrap_content"
-            android:src="@drawable/stat_sys_no_sims"
-            />
-        <com.android.systemui.statusbar.AlphaOptimizedImageView
-            android:theme="@style/DualToneDarkTheme"
-            android:id="@+id/no_sims_dark"
-            android:layout_height="wrap_content"
-            android:layout_width="wrap_content"
-            android:src="@drawable/stat_sys_no_sims"
-            android:alpha="0.0"
-            />
-    </FrameLayout>
-    <View
-        android:id="@+id/wifi_airplane_spacer"
-        android:layout_width="@dimen/status_bar_airplane_spacer_width"
-        android:layout_height="4dp"
-        android:visibility="gone"
-        />
     <FrameLayout
         android:layout_height="17dp"
-        android:layout_width="wrap_content"
-        android:paddingStart="2dp">
+        android:layout_width="wrap_content">
         <ImageView
             android:id="@+id/wifi_in"
             android:layout_height="wrap_content"
@@ -142,6 +97,50 @@
             android:layout_width="wrap_content"
             />
     </FrameLayout>
+    <View
+        android:id="@+id/wifi_signal_spacer"
+        android:layout_width="@dimen/status_bar_wifi_signal_spacer_width"
+        android:layout_height="4dp"
+        android:visibility="gone"
+        />
+    <ViewStub
+        android:id="@+id/connected_device_signals_stub"
+        android:layout="@layout/connected_device_signal"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content" />
+    <LinearLayout
+        android:id="@+id/mobile_signal_group"
+        android:layout_height="wrap_content"
+        android:layout_width="wrap_content"
+        >
+    </LinearLayout>
+    <FrameLayout
+        android:id="@+id/no_sims_combo"
+        android:layout_height="wrap_content"
+        android:layout_width="wrap_content"
+        android:contentDescription="@string/accessibility_no_sims">
+        <com.android.systemui.statusbar.AlphaOptimizedImageView
+            android:theme="@style/DualToneLightTheme"
+            android:id="@+id/no_sims"
+            android:layout_height="wrap_content"
+            android:layout_width="wrap_content"
+            android:src="@drawable/stat_sys_no_sims"
+            />
+        <com.android.systemui.statusbar.AlphaOptimizedImageView
+            android:theme="@style/DualToneDarkTheme"
+            android:id="@+id/no_sims_dark"
+            android:layout_height="wrap_content"
+            android:layout_width="wrap_content"
+            android:src="@drawable/stat_sys_no_sims"
+            android:alpha="0.0"
+            />
+    </FrameLayout>
+    <View
+        android:id="@+id/wifi_airplane_spacer"
+        android:layout_width="@dimen/status_bar_airplane_spacer_width"
+        android:layout_height="4dp"
+        android:visibility="gone"
+        />
     <ImageView
         android:id="@+id/airplane"
         android:layout_height="wrap_content"
diff --git a/packages/SystemUI/src/com/android/keyguard/KeyguardClockAccessibilityDelegate.java b/packages/SystemUI/src/com/android/keyguard/KeyguardClockAccessibilityDelegate.java
new file mode 100644
index 0000000..80509a6
--- /dev/null
+++ b/packages/SystemUI/src/com/android/keyguard/KeyguardClockAccessibilityDelegate.java
@@ -0,0 +1,67 @@
+/*
+ * Copyright (C) 2017 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.keyguard;
+
+import android.content.Context;
+import android.text.TextUtils;
+import android.view.View;
+import android.view.accessibility.AccessibilityEvent;
+import android.view.accessibility.AccessibilityNodeInfo;
+import android.widget.TextView;
+
+/**
+ * Replaces fancy colons with regular colons. Only works on TextViews.
+ */
+class KeyguardClockAccessibilityDelegate extends View.AccessibilityDelegate {
+    private final String mFancyColon;
+
+    public KeyguardClockAccessibilityDelegate(Context context) {
+        mFancyColon = context.getString(R.string.keyguard_fancy_colon);
+    }
+
+    @Override
+    public void onInitializeAccessibilityEvent(View host, AccessibilityEvent event) {
+        super.onInitializeAccessibilityEvent(host, event);
+        CharSequence text = event.getContentDescription();
+        if (!TextUtils.isEmpty(text)) {
+            event.setContentDescription(replaceFancyColon(text));
+        }
+    }
+
+    @Override
+    public void onPopulateAccessibilityEvent(View host, AccessibilityEvent event) {
+        CharSequence text = ((TextView) host).getText();
+        if (!TextUtils.isEmpty(text)) {
+            event.getText().add(replaceFancyColon(text));
+        }
+    }
+
+    @Override
+    public void onInitializeAccessibilityNodeInfo(View host, AccessibilityNodeInfo info) {
+        super.onInitializeAccessibilityNodeInfo(host, info);
+        if (!TextUtils.isEmpty(info.getText())) {
+            info.setText(replaceFancyColon(info.getText()));
+        }
+        if (!TextUtils.isEmpty(info.getContentDescription())) {
+            info.setContentDescription(replaceFancyColon(info.getContentDescription()));
+        }
+    }
+
+    private CharSequence replaceFancyColon(CharSequence text) {
+        return text.toString().replace(mFancyColon, ":");
+    }
+}
diff --git a/packages/SystemUI/src/com/android/keyguard/KeyguardStatusView.java b/packages/SystemUI/src/com/android/keyguard/KeyguardStatusView.java
index 162faa5..d4d69ff 100644
--- a/packages/SystemUI/src/com/android/keyguard/KeyguardStatusView.java
+++ b/packages/SystemUI/src/com/android/keyguard/KeyguardStatusView.java
@@ -38,7 +38,6 @@
 import com.android.internal.widget.LockPatternUtils;
 import com.android.systemui.ChargingView;
 
-import java.util.Arrays;
 import java.util.Locale;
 
 public class KeyguardStatusView extends GridLayout {
@@ -121,6 +120,7 @@
         mClockView = findViewById(R.id.clock_view);
         mDateView.setShowCurrentUserTime(true);
         mClockView.setShowCurrentUserTime(true);
+        mClockView.setAccessibilityDelegate(new KeyguardClockAccessibilityDelegate(mContext));
         mOwnerInfo = findViewById(R.id.owner_info);
         mBatteryDoze = findViewById(R.id.battery_doze);
         mVisibleInDoze = new View[]{mBatteryDoze, mClockView};
diff --git a/packages/SystemUI/src/com/android/keyguard/KeyguardUpdateMonitor.java b/packages/SystemUI/src/com/android/keyguard/KeyguardUpdateMonitor.java
index 7a6ac57..67a2989 100644
--- a/packages/SystemUI/src/com/android/keyguard/KeyguardUpdateMonitor.java
+++ b/packages/SystemUI/src/com/android/keyguard/KeyguardUpdateMonitor.java
@@ -197,6 +197,11 @@
     private int mFingerprintRunningState = FINGERPRINT_STATE_STOPPED;
     private LockPatternUtils mLockPatternUtils;
 
+    // If FP daemon dies, keyguard should retry after a short delay
+    private int mHardwareUnavailableRetryCount = 0;
+    private static final int HW_UNAVAILABLE_TIMEOUT = 3000; // ms
+    private static final int HW_UNAVAILABLE_RETRY_MAX = 3;
+
     private final Handler mHandler = new Handler() {
         @Override
         public void handleMessage(Message msg) {
@@ -471,6 +476,15 @@
         }
     }
 
+    private Runnable mRetryFingerprintAuthentication = new Runnable() {
+        @Override
+        public void run() {
+            Log.w(TAG, "Retrying fingerprint after HW unavailable, attempt " +
+                    mHardwareUnavailableRetryCount);
+            updateFingerprintListeningState();
+        }
+    };
+
     private void handleFingerprintError(int msgId, String errString) {
         if (msgId == FingerprintManager.FINGERPRINT_ERROR_CANCELED
                 && mFingerprintRunningState == FINGERPRINT_STATE_CANCELLING_RESTARTING) {
@@ -479,6 +493,15 @@
         } else {
             setFingerprintRunningState(FINGERPRINT_STATE_STOPPED);
         }
+
+        if (msgId == FingerprintManager.FINGERPRINT_ERROR_HW_UNAVAILABLE) {
+            if (mHardwareUnavailableRetryCount < HW_UNAVAILABLE_RETRY_MAX) {
+                mHardwareUnavailableRetryCount++;
+                mHandler.removeCallbacks(mRetryFingerprintAuthentication);
+                mHandler.postDelayed(mRetryFingerprintAuthentication, HW_UNAVAILABLE_TIMEOUT);
+            }
+        }
+
         for (int i = 0; i < mCallbacks.size(); i++) {
             KeyguardUpdateMonitorCallback cb = mCallbacks.get(i).get();
             if (cb != null) {
@@ -940,6 +963,7 @@
     }
 
     private void handleScreenTurnedOff() {
+        mHardwareUnavailableRetryCount = 0;
         final int count = mCallbacks.size();
         for (int i = 0; i < count; i++) {
             KeyguardUpdateMonitorCallback cb = mCallbacks.get(i).get();
@@ -1072,6 +1096,7 @@
     }
 
     private void updateFingerprintListeningState() {
+        mHandler.removeCallbacks(mRetryFingerprintAuthentication);
         boolean shouldListenForFingerprint = shouldListenForFingerprint();
         if (mFingerprintRunningState == FINGERPRINT_STATE_RUNNING && !shouldListenForFingerprint) {
             stopListeningForFingerprint();
diff --git a/packages/SystemUI/src/com/android/systemui/SwipeHelper.java b/packages/SystemUI/src/com/android/systemui/SwipeHelper.java
index 8c4159a..9c03ea6 100644
--- a/packages/SystemUI/src/com/android/systemui/SwipeHelper.java
+++ b/packages/SystemUI/src/com/android/systemui/SwipeHelper.java
@@ -51,7 +51,7 @@
     public static final int X = 0;
     public static final int Y = 1;
 
-    private float SWIPE_ESCAPE_VELOCITY = 100f; // dp/sec
+    private float SWIPE_ESCAPE_VELOCITY = 500f; // dp/sec
     private int DEFAULT_ESCAPE_ANIMATION_DURATION = 200; // ms
     private int MAX_ESCAPE_ANIMATION_DURATION = 400; // ms
     private int MAX_DISMISS_VELOCITY = 4000; // dp/sec
@@ -59,6 +59,9 @@
 
     static final float SWIPE_PROGRESS_FADE_END = 0.5f; // fraction of thumbnail width
                                               // beyond which swipe progress->0
+    public static final float SWIPED_FAR_ENOUGH_SIZE_FRACTION = 0.6f;
+    static final float MAX_SCROLL_SIZE_FRACTION = 0.3f;
+
     private float mMinSwipeProgress = 0f;
     private float mMaxSwipeProgress = 1f;
 
@@ -363,9 +366,8 @@
         // if the language is rtl we prefer swiping to the left
         boolean animateLeftForRtl = velocity == 0 && (getTranslation(animView) == 0 || isDismissAll)
                 && isLayoutRtl;
-        boolean animateLeft = velocity < 0
-                || (velocity == 0 && getTranslation(animView) < 0 && !isDismissAll);
-
+        boolean animateLeft = (Math.abs(velocity) > getEscapeVelocity() && velocity < 0) ||
+                (getTranslation(animView) < 0 && !isDismissAll);
         if (animateLeft || animateLeftForRtl || animateUpForMenu) {
             newPos = -getSize(animView);
         } else {
@@ -584,7 +586,7 @@
                     // maxScrollDistance
                     if (CONSTRAIN_SWIPE && !mCallback.canChildBeDismissed(mCurrView)) {
                         float size = getSize(mCurrView);
-                        float maxScrollDistance = 0.25f * size;
+                        float maxScrollDistance = MAX_SCROLL_SIZE_FRACTION * size;
                         if (absDelta >= size) {
                             delta = delta > 0 ? maxScrollDistance : -maxScrollDistance;
                         } else {
@@ -646,7 +648,8 @@
 
     protected boolean swipedFarEnough() {
         float translation = getTranslation(mCurrView);
-        return DISMISS_IF_SWIPED_FAR_ENOUGH && Math.abs(translation) > 0.4 * getSize(mCurrView);
+        return DISMISS_IF_SWIPED_FAR_ENOUGH
+                && Math.abs(translation) > SWIPED_FAR_ENOUGH_SIZE_FRACTION * getSize(mCurrView);
     }
 
     public boolean isDismissGesture(MotionEvent ev) {
diff --git a/packages/SystemUI/src/com/android/systemui/qs/QuickStatusBarHeader.java b/packages/SystemUI/src/com/android/systemui/qs/QuickStatusBarHeader.java
index e457d72..7518527 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/QuickStatusBarHeader.java
+++ b/packages/SystemUI/src/com/android/systemui/qs/QuickStatusBarHeader.java
@@ -77,9 +77,6 @@
 
         BatteryMeterView battery = findViewById(R.id.battery);
         battery.setForceShowPercent(true);
-        // Don't show the Wi-Fi indicator here, because it is shown just below in the tile.
-        SignalClusterView signalCluster = findViewById(R.id.signal_cluster);
-        signalCluster.setForceBlockWifi();
 
         mActivityStarter = Dependency.get(ActivityStarter.class);
     }
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 b5c1bd9..dc9176f 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/external/CustomTile.java
+++ b/packages/SystemUI/src/com/android/systemui/qs/external/CustomTile.java
@@ -240,7 +240,7 @@
         i.setPackage(mComponent.getPackageName());
         i = resolveIntent(i);
         if (i != null) {
-            i.putExtra(TileService.EXTRA_COMPONENT, mComponent);
+            i.putExtra(Intent.EXTRA_COMPONENT_NAME, mComponent);
             i.putExtra(TileService.EXTRA_STATE, mTile.getState());
             return i;
         }
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 d9c3cc3..d2f3bb6 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/external/TileServices.java
+++ b/packages/SystemUI/src/com/android/systemui/qs/external/TileServices.java
@@ -313,7 +313,7 @@
         public void onReceive(Context context, Intent intent) {
             if (TileService.ACTION_REQUEST_LISTENING.equals(intent.getAction())) {
                 requestListening(
-                        (ComponentName) intent.getParcelableExtra(TileService.EXTRA_COMPONENT));
+                        (ComponentName) intent.getParcelableExtra(Intent.EXTRA_COMPONENT_NAME));
             }
         }
     };
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 d74e3ac..92ff17a1 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/tiles/CellularTile.java
+++ b/packages/SystemUI/src/com/android/systemui/qs/tiles/CellularTile.java
@@ -128,7 +128,7 @@
         state.value = mDataController.isMobileDataSupported()
                 && mDataController.isMobileDataEnabled();
         state.icon = ResourceIcon.get(R.drawable.ic_data_unavailable);
-        state.state = cb.airplaneModeEnabled || !cb.enabled || cb.noSim ? Tile.STATE_UNAVAILABLE
+        state.state = cb.airplaneModeEnabled || !cb.enabled ? Tile.STATE_UNAVAILABLE
                 : state.value ? Tile.STATE_ACTIVE : Tile.STATE_INACTIVE;
         if (state.state == Tile.STATE_ACTIVE) {
             state.icon = ResourceIcon.get(R.drawable.ic_data_on);
@@ -161,27 +161,44 @@
 
     private static final class CallbackInfo {
         boolean enabled;
+        boolean wifiEnabled;
         boolean airplaneModeEnabled;
+        String signalContentDescription;
+        int dataTypeIconId;
+        String dataContentDescription;
         boolean activityIn;
         boolean activityOut;
+        String enabledDesc;
         boolean noSim;
+        boolean isDataTypeIconWide;
         boolean roaming;
     }
 
     private final class CellSignalCallback implements SignalCallback {
         private final CallbackInfo mInfo = new CallbackInfo();
+        @Override
+        public void setWifiIndicators(boolean enabled, IconState statusIcon, IconState qsIcon,
+                boolean activityIn, boolean activityOut, String description, boolean isTransient) {
+            mInfo.wifiEnabled = enabled;
+            refreshState(mInfo);
+        }
 
         @Override
-        public void setMobileDataIndicators(IconState statusIcon, int statusType,
-                boolean activityIn, boolean activityOut, String typeContentDescription,
-                int subId, boolean roaming, boolean isEmergency) {
-            if (statusIcon == null) {
+        public void setMobileDataIndicators(IconState statusIcon, IconState qsIcon, int statusType,
+                int qsType, boolean activityIn, boolean activityOut, String typeContentDescription,
+                String description, boolean isWide, int subId, boolean roaming) {
+            if (qsIcon == null) {
                 // Not data sim, don't display.
                 return;
             }
-            mInfo.enabled = statusIcon.visible;
+            mInfo.enabled = qsIcon.visible;
+            mInfo.signalContentDescription = qsIcon.contentDescription;
+            mInfo.dataTypeIconId = qsType;
+            mInfo.dataContentDescription = typeContentDescription;
             mInfo.activityIn = activityIn;
             mInfo.activityOut = activityOut;
+            mInfo.enabledDesc = description;
+            mInfo.isDataTypeIconWide = qsType != 0 && isWide;
             mInfo.roaming = roaming;
             refreshState(mInfo);
         }
@@ -189,6 +206,15 @@
         @Override
         public void setNoSims(boolean show) {
             mInfo.noSim = show;
+            if (mInfo.noSim) {
+                // Make sure signal gets cleared out when no sims.
+                mInfo.dataTypeIconId = 0;
+                // Show a No SIMs description to avoid emergency calls message.
+                mInfo.enabled = true;
+                mInfo.enabledDesc = mContext.getString(
+                        R.string.keyguard_missing_sim_message_short);
+                mInfo.signalContentDescription = mInfo.enabledDesc;
+            }
             refreshState(mInfo);
         }
 
diff --git a/packages/SystemUI/src/com/android/systemui/recents/model/RecentsTaskLoader.java b/packages/SystemUI/src/com/android/systemui/recents/model/RecentsTaskLoader.java
index 0b4498c..802cb831 100644
--- a/packages/SystemUI/src/com/android/systemui/recents/model/RecentsTaskLoader.java
+++ b/packages/SystemUI/src/com/android/systemui/recents/model/RecentsTaskLoader.java
@@ -161,50 +161,7 @@
                 // If we've stopped the loader, then fall through to the above logic to wait on
                 // the load thread
                 if (ssp != null) {
-                    // Load the next item from the queue
-                    final Task t = mLoadQueue.nextTask();
-                    if (t != null) {
-                        Drawable cachedIcon = mIconCache.get(t.key);
-
-                        // Load the icon if it is stale or we haven't cached one yet
-                        if (cachedIcon == null) {
-                            cachedIcon = ssp.getBadgedTaskDescriptionIcon(t.taskDescription,
-                                    t.key.userId, mContext.getResources());
-
-                            if (cachedIcon == null) {
-                                ActivityInfo info = ssp.getActivityInfo(
-                                        t.key.getComponent(), t.key.userId);
-                                if (info != null) {
-                                    if (DEBUG) Log.d(TAG, "Loading icon: " + t.key);
-                                    cachedIcon = ssp.getBadgedActivityIcon(info, t.key.userId);
-                                }
-                            }
-
-                            if (cachedIcon == null) {
-                                cachedIcon = mDefaultIcon;
-                            }
-
-                            // At this point, even if we can't load the icon, we will set the
-                            // default icon.
-                            mIconCache.put(t.key, cachedIcon);
-                        }
-
-                        if (DEBUG) Log.d(TAG, "Loading thumbnail: " + t.key);
-                        ThumbnailData cachedThumbnailData = ssp.getTaskThumbnail(t.key.id,
-                                true /* reducedResolution */);
-
-                        if (cachedThumbnailData.thumbnail == null) {
-                            cachedThumbnailData.thumbnail = mDefaultThumbnail;
-                        }
-
-                        if (!mCancelled) {
-                            // Notify that the task data has changed
-                            final Drawable newIcon = cachedIcon;
-                            final ThumbnailData newThumbnailData = cachedThumbnailData;
-                            mMainThreadHandler.post(
-                                    () -> t.notifyTaskDataLoaded(newThumbnailData, newIcon));
-                        }
-                    }
+                    processLoadQueueItem(ssp);
                 }
 
                 // If there are no other items in the list, then just wait until something is added
@@ -222,6 +179,57 @@
             }
         }
     }
+
+    /**
+     * This needs to be in a separate method to work around an surprising interpreter behavior:
+     * The register will keep the local reference to cachedThumbnailData even if it falls out of
+     * scope. Putting it into a method fixes this issue.
+     */
+    private void processLoadQueueItem(SystemServicesProxy ssp) {
+        // Load the next item from the queue
+        final Task t = mLoadQueue.nextTask();
+        if (t != null) {
+            Drawable cachedIcon = mIconCache.get(t.key);
+
+            // Load the icon if it is stale or we haven't cached one yet
+            if (cachedIcon == null) {
+                cachedIcon = ssp.getBadgedTaskDescriptionIcon(t.taskDescription,
+                        t.key.userId, mContext.getResources());
+
+                if (cachedIcon == null) {
+                    ActivityInfo info = ssp.getActivityInfo(
+                            t.key.getComponent(), t.key.userId);
+                    if (info != null) {
+                        if (DEBUG) Log.d(TAG, "Loading icon: " + t.key);
+                        cachedIcon = ssp.getBadgedActivityIcon(info, t.key.userId);
+                    }
+                }
+
+                if (cachedIcon == null) {
+                    cachedIcon = mDefaultIcon;
+                }
+
+                // At this point, even if we can't load the icon, we will set the
+                // default icon.
+                mIconCache.put(t.key, cachedIcon);
+            }
+
+            if (DEBUG) Log.d(TAG, "Loading thumbnail: " + t.key);
+            final ThumbnailData cachedThumbnailData = ssp.getTaskThumbnail(t.key.id,
+                    true /* reducedResolution */);
+
+            if (cachedThumbnailData.thumbnail == null) {
+                cachedThumbnailData.thumbnail = mDefaultThumbnail;
+            }
+
+            if (!mCancelled) {
+                // Notify that the task data has changed
+                final Drawable finalIcon = cachedIcon;
+                mMainThreadHandler.post(
+                        () -> t.notifyTaskDataLoaded(cachedThumbnailData, finalIcon));
+            }
+        }
+    }
 }
 
 /**
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/ActivatableNotificationView.java b/packages/SystemUI/src/com/android/systemui/statusbar/ActivatableNotificationView.java
index 469f3ad..d7eab97 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/ActivatableNotificationView.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/ActivatableNotificationView.java
@@ -172,6 +172,11 @@
     private int mOverrideTint;
     private float mOverrideAmount;
     private boolean mShadowHidden;
+    private boolean mWasActivatedOnDown;
+    /**
+     * Similar to mDimmed but is also true if it's not dimmable but should be
+     */
+    private boolean mNeedsDimming;
 
     public ActivatableNotificationView(Context context, AttributeSet attrs) {
         super(context, attrs);
@@ -223,7 +228,7 @@
 
     @Override
     public boolean onInterceptTouchEvent(MotionEvent ev) {
-        if (mDimmed && !mActivated && ev.getActionMasked() == MotionEvent.ACTION_DOWN
+        if (mNeedsDimming && !mActivated && ev.getActionMasked() == MotionEvent.ACTION_DOWN
                 && disallowSingleClick(ev) && !isTouchExplorationEnabled()) {
             return true;
         }
@@ -245,7 +250,10 @@
     @Override
     public boolean onTouchEvent(MotionEvent event) {
         boolean result;
-        if (mDimmed && !isTouchExplorationEnabled() && isInteractive()) {
+        if (event.getAction() == MotionEvent.ACTION_DOWN) {
+            mWasActivatedOnDown = mActivated;
+        }
+        if ((mNeedsDimming && !mActivated) && !isTouchExplorationEnabled() && isInteractive()) {
             boolean wasActivated = mActivated;
             result = handleTouchEventDimmed(event);
             if (wasActivated && result && event.getAction() == MotionEvent.ACTION_UP) {
@@ -282,9 +290,21 @@
     }
 
     private boolean handleTouchEventDimmed(MotionEvent event) {
+        if (mNeedsDimming && !mDimmed) {
+            // We're actually dimmed, but our content isn't dimmable, let's ensure we have a ripple
+            super.onTouchEvent(event);
+        }
         return mDoubleTapHelper.onTouchEvent(event, getActualHeight());
     }
 
+    @Override
+    public boolean performClick() {
+        if (mWasActivatedOnDown || !mNeedsDimming) {
+            return super.performClick();
+        }
+        return false;
+    }
+
     private void makeActive() {
         mFalsingManager.onNotificationActive();
         startActivateAnimation(false /* reverse */);
@@ -298,6 +318,9 @@
         if (!isAttachedToWindow()) {
             return;
         }
+        if (!isDimmable()) {
+            return;
+        }
         int widthHalf = mBackgroundNormal.getWidth()/2;
         int heightHalf = mBackgroundNormal.getActualHeight()/2;
         float radius = (float) Math.sqrt(widthHalf*widthHalf + heightHalf*heightHalf);
@@ -371,6 +394,8 @@
     }
 
     public void setDimmed(boolean dimmed, boolean fade) {
+        mNeedsDimming = dimmed;
+        dimmed &= isDimmable();
         if (mDimmed != dimmed) {
             mDimmed = dimmed;
             resetBackgroundAlpha();
@@ -382,6 +407,10 @@
         }
     }
 
+    public boolean isDimmable() {
+        return true;
+    }
+
     public void setDark(boolean dark, boolean fade, long delay) {
         super.setDark(dark, fade, delay);
         if (mDark == dark) {
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/ExpandableNotificationRow.java b/packages/SystemUI/src/com/android/systemui/statusbar/ExpandableNotificationRow.java
index dff09bd..8c1b334 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/ExpandableNotificationRow.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/ExpandableNotificationRow.java
@@ -16,7 +16,7 @@
 
 package com.android.systemui.statusbar;
 
-import static com.android.systemui.statusbar.notification.NotificationInflater.InflationExceptionHandler;
+import static com.android.systemui.statusbar.notification.NotificationInflater.InflationCallback;
 
 import android.animation.Animator;
 import android.animation.AnimatorListenerAdapter;
@@ -47,6 +47,7 @@
 import android.widget.ImageView;
 import android.widget.RemoteViews;
 
+import com.android.internal.annotations.VisibleForTesting;
 import com.android.internal.logging.MetricsLogger;
 import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
 import com.android.internal.util.NotificationColorUtil;
@@ -61,7 +62,6 @@
 import com.android.systemui.plugins.statusbar.NotificationMenuRowPlugin.MenuItem;
 import com.android.systemui.statusbar.NotificationGuts.GutsContent;
 import com.android.systemui.statusbar.notification.HybridNotificationView;
-import com.android.systemui.statusbar.notification.InflationException;
 import com.android.systemui.statusbar.notification.NotificationInflater;
 import com.android.systemui.statusbar.notification.NotificationUtils;
 import com.android.systemui.statusbar.notification.VisualStabilityManager;
@@ -314,14 +314,13 @@
         }
     }
 
-    public void updateNotification(NotificationData.Entry entry) throws InflationException {
+    public void updateNotification(NotificationData.Entry entry) {
         mEntry = entry;
         mStatusBarNotification = entry.notification;
         mNotificationInflater.inflateNotificationViews();
-        onNotificationUpdated();
     }
 
-    private void onNotificationUpdated() {
+    public void onNotificationUpdated() {
         for (NotificationContentView l : mLayouts) {
             l.onNotificationUpdated(mEntry);
         }
@@ -361,6 +360,14 @@
         expandedIcon.setStaticDrawableColor(color);
     }
 
+    @Override
+    public boolean isDimmable() {
+        if (!getShowingLayout().isDimmable()) {
+            return false;
+        }
+        return super.isDimmable();
+    }
+
     private void updateLimits() {
         for (NotificationContentView l : mLayouts) {
             updateLimitsForView(l);
@@ -482,9 +489,7 @@
         boolean childInGroup = StatusBar.ENABLE_CHILD_NOTIFICATIONS && isChildInGroup;
         mNotificationParent = childInGroup ? parent : null;
         mPrivateLayout.setIsChildInGroup(childInGroup);
-        if (mNotificationInflater.setIsChildInGroup(childInGroup)) {
-            onNotificationUpdated();
-        }
+        mNotificationInflater.setIsChildInGroup(childInGroup);
         resetBackgroundAlpha();
         updateBackgroundForGroupState();
         updateClickAndFocus();
@@ -1111,14 +1116,19 @@
         mNotificationInflater.setRemoteViewClickHandler(remoteViewClickHandler);
     }
 
-    public void setInflateExceptionHandler(InflationExceptionHandler inflateExceptionHandler) {
-        mNotificationInflater.setInflateExceptionHandler(inflateExceptionHandler);
+    public void setInflationCallback(InflationCallback callback) {
+        mNotificationInflater.setInflationCallback(callback);
     }
 
     public void setNeedsRedaction(boolean needsRedaction) {
         mNotificationInflater.setRedactAmbient(needsRedaction);
     }
 
+    @VisibleForTesting
+    public NotificationInflater getNotificationInflater() {
+        return mNotificationInflater;
+    }
+
     public interface ExpansionLogger {
         public void logNotificationExpansion(String key, boolean userAction, boolean expanded);
     }
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationContentView.java b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationContentView.java
index 6098565..e7bf983 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationContentView.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationContentView.java
@@ -1363,4 +1363,11 @@
     public void setIsLowPriority(boolean isLowPriority) {
         mIsLowPriority = isLowPriority;
     }
+
+    public boolean isDimmable() {
+        if (!mContractedWrapper.isDimmable()) {
+            return false;
+        }
+        return true;
+    }
 }
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationData.java b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationData.java
index 90e908b..4d47e6b 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationData.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationData.java
@@ -24,6 +24,7 @@
 import android.content.pm.PackageManager;
 import android.content.Context;
 import android.graphics.drawable.Icon;
+import android.os.AsyncTask;
 import android.os.RemoteException;
 import android.os.SystemClock;
 import android.service.notification.NotificationListenerService;
@@ -32,6 +33,7 @@
 import android.service.notification.SnoozeCriterion;
 import android.service.notification.StatusBarNotification;
 import android.util.ArrayMap;
+import android.util.ArraySet;
 import android.view.View;
 import android.widget.ImageView;
 import android.widget.RemoteViews;
@@ -41,6 +43,7 @@
 import com.android.internal.statusbar.StatusBarIcon;
 import com.android.internal.util.NotificationColorUtil;
 import com.android.systemui.statusbar.notification.InflationException;
+import com.android.systemui.statusbar.notification.NotificationInflater;
 import com.android.systemui.statusbar.phone.NotificationGroupManager;
 import com.android.systemui.statusbar.phone.StatusBar;
 import com.android.systemui.statusbar.policy.HeadsUpManager;
@@ -83,6 +86,7 @@
         public List<SnoozeCriterion> snoozeCriteria;
         private int mCachedContrastColor = COLOR_INVALID;
         private int mCachedContrastColorIsFor = COLOR_INVALID;
+        private ArraySet<AsyncTask> mRunningTasks = new ArraySet();
 
         public Entry(StatusBarNotification n) {
             this.key = n.getKey();
@@ -210,6 +214,29 @@
             mCachedContrastColor = contrasted;
             return mCachedContrastColor;
         }
+
+        /**
+         * Abort all existing inflation tasks
+         */
+        public void abortInflation() {
+            for (AsyncTask task : mRunningTasks) {
+                task.cancel(true /* mayInterruptIfRunning */);
+            }
+            mRunningTasks.clear();
+        }
+
+        public void addInflationTask(AsyncTask asyncInflationTask) {
+            mRunningTasks.add(asyncInflationTask);
+        }
+
+        public void onInflationTaskFinished(AsyncTask asyncInflationTask) {
+            mRunningTasks.remove(asyncInflationTask);
+        }
+
+        @VisibleForTesting
+        public ArraySet<AsyncTask> getRunningTasks() {
+            return mRunningTasks;
+        }
     }
 
     private final ArrayMap<String, Entry> mEntries = new ArrayMap<>();
@@ -302,12 +329,12 @@
         return mEntries.get(key);
     }
 
-    public void add(Entry entry, RankingMap ranking) {
+    public void add(Entry entry) {
         synchronized (mEntries) {
             mEntries.put(entry.notification.getKey(), entry);
         }
         mGroupManager.onEntryAdded(entry);
-        updateRankingAndSort(ranking);
+        filterAndSort();
     }
 
     public Entry remove(String key, RankingMap ranking) {
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationMenuRow.java b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationMenuRow.java
index 7563fd1..4305bdef 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationMenuRow.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationMenuRow.java
@@ -16,13 +16,13 @@
 
 package com.android.systemui.statusbar;
 
+import static com.android.systemui.SwipeHelper.SWIPED_FAR_ENOUGH_SIZE_FRACTION;
+
 import java.util.ArrayList;
 
 import com.android.systemui.Interpolators;
 import com.android.systemui.R;
 import com.android.systemui.plugins.statusbar.NotificationMenuRowPlugin;
-import com.android.systemui.plugins.statusbar.NotificationMenuRowPlugin.MenuItem;
-import com.android.systemui.plugins.statusbar.NotificationMenuRowPlugin.OnMenuEventListener;
 import com.android.systemui.plugins.statusbar.NotificationSwipeActionHelper;
 import com.android.systemui.statusbar.NotificationGuts.GutsContent;
 import com.android.systemui.statusbar.stack.NotificationStackScrollLayout;
@@ -46,10 +46,21 @@
 
 public class NotificationMenuRow implements NotificationMenuRowPlugin, View.OnClickListener {
 
+    private static final boolean DEBUG = false;
+    private static final String TAG = "swipe";
+
     private static final int ICON_ALPHA_ANIM_DURATION = 200;
     private static final long SHOW_MENU_DELAY = 60;
     private static final long SWIPE_MENU_TIMING = 200;
 
+    // Notification must be swiped at least this fraction of a single menu item to show menu
+    private static final float SWIPED_FAR_ENOUGH_MENU_FRACTION = 0.25f;
+    private static final float SWIPED_FAR_ENOUGH_MENU_UNCLEARABLE_FRACTION = 0.15f;
+
+    // When the menu is displayed, the notification must be swiped within this fraction of a single
+    // menu item to snap back to menu (else it will cover the menu or it'll be dismissed)
+    private static final float SWIPED_BACK_ENOUGH_TO_COVER_FRACTION = 0.2f;
+
     private ExpandableNotificationRow mParent;
 
     private Context mContext;
@@ -78,6 +89,7 @@
     private int mIconPadding;
 
     private float mAlpha = 0f;
+    private float mPrevX;
 
     private CheckForDrag mCheckForDrag;
     private Handler mHandler;
@@ -203,14 +215,14 @@
                 }
                 mHandler.removeCallbacks(mCheckForDrag);
                 mCheckForDrag = null;
+                mPrevX = ev.getRawX();
                 break;
 
             case MotionEvent.ACTION_MOVE:
                 mSnapping = false;
-                // If the menu is visible and the movement is towards it it's not a location change.
-                boolean locationChange = isTowardsMenu(mTranslation)
-                        ? false : isMenuLocationChange();
-                if (locationChange) {
+                float diffX = ev.getRawX() - mPrevX;
+                mPrevX = ev.getRawX();
+                if (!isTowardsMenu(diffX) && isMenuLocationChange()) {
                     // Don't consider it "snapped" if location has changed.
                     mMenuSnappedTo = false;
 
@@ -262,36 +274,53 @@
         final double timeForGesture = ev.getEventTime() - ev.getDownTime();
         final boolean showMenuForSlowOnGoing = !mParent.canViewBeDismissed()
                 && timeForGesture >= SWIPE_MENU_TIMING;
+        final float menuSnapTarget = mOnLeft ? getSpaceForMenu() : -getSpaceForMenu();
 
-        final float targetLeft = mOnLeft ? getSpaceForMenu() : -getSpaceForMenu();
-        if (mMenuSnappedTo && isMenuVisible()) {
-            if (mMenuSnappedOnLeft == mOnLeft) {
-                boolean coveringMenu = Math.abs(mTranslation) <= getSpaceForMenu() * 0.6f;
-                if (gestureTowardsMenu || coveringMenu) {
-                    // Gesture is towards or covering the menu or a dismiss
-                    snapBack(animView, 0);
-                } else if (mSwipeHelper.isDismissGesture(ev)) {
-                    dismiss(animView, velocity);
-                } else {
-                    // Didn't move enough to dismiss or cover, snap to the menu
-                    showMenu(animView, targetLeft, velocity);
-                }
-            } else if ((!gestureFastEnough && swipedEnoughToShowMenu())
-                    || (gestureTowardsMenu && !gestureFarEnough)) {
-                // The menu has been snapped to previously, however, the menu is now on the
-                // other side. If gesture is towards menu and not too far snap to the menu.
-                showMenu(animView, targetLeft, velocity);
-            } else if (mSwipeHelper.isDismissGesture(ev)) {
+        if (DEBUG) {
+            Log.d(TAG, "mTranslation= " + mTranslation
+                    + " mAlpha= " + mAlpha
+                    + " velocity= " + velocity
+                    + " mMenuSnappedTo= " + mMenuSnappedTo
+                    + " mMenuSnappedOnLeft= " + mMenuSnappedOnLeft
+                    + " mOnLeft= " + mOnLeft
+                    + " minDismissVel= " + mSwipeHelper.getMinDismissVelocity()
+                    + " isDismissGesture= " + mSwipeHelper.isDismissGesture(ev)
+                    + " gestureTowardsMenu= " + gestureTowardsMenu
+                    + " gestureFastEnough= " + gestureFastEnough
+                    + " gestureFarEnough= " + gestureFarEnough);
+        }
+
+        if (mMenuSnappedTo && isMenuVisible() && mMenuSnappedOnLeft == mOnLeft) {
+            // Menu was snapped to previously and we're on the same side, figure out if
+            // we should stick to the menu, snap back into place, or dismiss
+            final float maximumSwipeDistance = mHorizSpaceForIcon
+                    * SWIPED_BACK_ENOUGH_TO_COVER_FRACTION;
+            final float targetLeft = getSpaceForMenu() - maximumSwipeDistance;
+            final float targetRight = mParent.getWidth() * SWIPED_FAR_ENOUGH_SIZE_FRACTION;
+            boolean withinSnapMenuThreshold = mOnLeft
+                    ? mTranslation > targetLeft && mTranslation < targetRight
+                    : mTranslation < -targetLeft && mTranslation > -targetRight;
+            boolean shouldSnapTo = mOnLeft ? mTranslation < targetLeft : mTranslation > -targetLeft;
+            if (DEBUG) {
+                Log.d(TAG, "   withinSnapMenuThreshold= " + withinSnapMenuThreshold
+                        + "   shouldSnapTo= " + shouldSnapTo
+                        + "   targetLeft= " + targetLeft
+                        + "   targetRight= " + targetRight);
+            }
+            if (withinSnapMenuThreshold && !mSwipeHelper.isDismissGesture(ev)) {
+                // Haven't moved enough to unsnap from the menu
+                showMenu(animView, menuSnapTarget, velocity);
+            } else if (mSwipeHelper.isDismissGesture(ev) && !shouldSnapTo) {
+                // Only dismiss if we're not moving towards the menu
                 dismiss(animView, velocity);
             } else {
                 snapBack(animView, velocity);
             }
-        } else if (((!gestureFastEnough || showMenuForSlowOnGoing)
-                && swipedEnoughToShowMenu())
-                || gestureTowardsMenu) {
+        } else if ((swipedEnoughToShowMenu() && (!gestureFastEnough || showMenuForSlowOnGoing))
+                || (gestureTowardsMenu && !mSwipeHelper.isDismissGesture(ev))) {
             // Menu has not been snapped to previously and this is menu revealing gesture
-            showMenu(animView, targetLeft, velocity);
-        } else if (mSwipeHelper.isDismissGesture(ev)) {
+            showMenu(animView, menuSnapTarget, velocity);
+        } else if (mSwipeHelper.isDismissGesture(ev) && !gestureTowardsMenu) {
             dismiss(animView, velocity);
         } else {
             snapBack(animView, velocity);
@@ -326,14 +355,18 @@
         mSwipeHelper.dismiss(animView, velocity);
     }
 
+    /**
+     * @return whether the notification has been translated enough to show the menu and not enough
+     *         to be dismissed.
+     */
     private boolean swipedEnoughToShowMenu() {
-        // If the notification can't be dismissed then how far it can move is
-        // restricted -- reduce the distance it needs to move in this case.
-        final float multiplier = mParent.canViewBeDismissed() ? 0.4f : 0.2f;
-        final float snapBackThreshold = getSpaceForMenu() * multiplier;
-        return !mSwipeHelper.swipedFarEnough(0, 0) && isMenuVisible() && (mOnLeft
-                ? mTranslation > snapBackThreshold
-                : mTranslation < -snapBackThreshold);
+        final float multiplier = mParent.canViewBeDismissed()
+                ? SWIPED_FAR_ENOUGH_MENU_FRACTION
+                : SWIPED_FAR_ENOUGH_MENU_UNCLEARABLE_FRACTION;
+        final float minimumSwipeDistance = mHorizSpaceForIcon * multiplier;
+        return !mSwipeHelper.swipedFarEnough(0, 0) && isMenuVisible()
+                && (mOnLeft ? mTranslation > minimumSwipeDistance
+                        : mTranslation < -minimumSwipeDistance);
     }
 
     /**
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/SignalClusterView.java b/packages/SystemUI/src/com/android/systemui/statusbar/SignalClusterView.java
index b01d9cc..dc254f9 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/SignalClusterView.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/SignalClusterView.java
@@ -24,6 +24,8 @@
 import android.content.res.TypedArray;
 import android.graphics.Color;
 import android.graphics.Rect;
+import android.graphics.drawable.Animatable;
+import android.graphics.drawable.AnimatedVectorDrawable;
 import android.graphics.drawable.Drawable;
 import android.graphics.drawable.LayerDrawable;
 import android.telephony.SubscriptionInfo;
@@ -118,7 +120,6 @@
     private boolean mBlockWifi;
     private boolean mBlockEthernet;
     private boolean mActivityEnabled;
-    private boolean mForceBlockWifi;
 
     public SignalClusterView(Context context) {
         this(context, null);
@@ -150,16 +151,6 @@
         updateActivityEnabled();
     }
 
-    public void setForceBlockWifi() {
-        mForceBlockWifi = true;
-        mBlockWifi = true;
-        if (isAttachedToWindow()) {
-            // Re-register to get new callbacks.
-            mNetworkController.removeCallback(this);
-            mNetworkController.addCallback(this);
-        }
-    }
-
     @Override
     public void onTuningChanged(String key, String newValue) {
         if (!StatusBarIconController.ICON_BLACKLIST.equals(key)) {
@@ -176,7 +167,7 @@
             mBlockAirplane = blockAirplane;
             mBlockMobile = blockMobile;
             mBlockEthernet = blockEthernet;
-            mBlockWifi = blockWifi || mForceBlockWifi;
+            mBlockWifi = blockWifi;
             // Re-register to get new callbacks.
             mNetworkController.removeCallback(this);
             mNetworkController.addCallback(this);
@@ -297,9 +288,9 @@
     }
 
     @Override
-    public void setMobileDataIndicators(IconState statusIcon, int statusType,
-            boolean activityIn, boolean activityOut, String typeContentDescription,
-            int subId, boolean roaming, boolean isEmergency) {
+    public void setMobileDataIndicators(IconState statusIcon, IconState qsIcon, int statusType,
+            int qsType, boolean activityIn, boolean activityOut, String typeContentDescription,
+            String description, boolean isWide, int subId, boolean roaming) {
         PhoneState state = getState(subId);
         if (state == null) {
             return;
@@ -309,6 +300,7 @@
         state.mMobileTypeId = statusType;
         state.mMobileDescription = statusIcon.contentDescription;
         state.mMobileTypeDescription = typeContentDescription;
+        state.mIsMobileTypeIconWide = statusType != 0 && isWide;
         state.mRoaming = roaming;
         state.mActivityIn = activityIn && mActivityEnabled;
         state.mActivityOut = activityOut && mActivityEnabled;
@@ -533,7 +525,7 @@
             mWifiAirplaneSpacer.setVisibility(View.GONE);
         }
 
-        if (((anyMobileVisible && firstMobileTypeId == 0) || mNoSimsVisible) && mWifiVisible) {
+        if (((anyMobileVisible && firstMobileTypeId != 0) || mNoSimsVisible) && mWifiVisible) {
             mWifiSignalSpacer.setVisibility(View.VISIBLE);
         } else {
             mWifiSignalSpacer.setVisibility(View.GONE);
@@ -644,6 +636,7 @@
         private int mMobileStrengthId = 0, mMobileTypeId = 0;
         private int mLastMobileStrengthId = -1;
         private int mLastMobileTypeId = -1;
+        private boolean mIsMobileTypeIconWide;
         private String mMobileDescription, mMobileTypeDescription;
 
         private ViewGroup mMobileGroup;
@@ -699,8 +692,12 @@
             // When this isn't next to wifi, give it some extra padding between the signals.
             mMobileGroup.setPaddingRelative(isSecondaryIcon ? mSecondaryTelephonyPadding : 0,
                     0, 0, 0);
-            mMobile.setPaddingRelative(mMobileDataIconStartPadding, 0, 0, 0);
-            mMobileDark.setPaddingRelative(mMobileDataIconStartPadding, 0, 0, 0);
+            mMobile.setPaddingRelative(
+                    mIsMobileTypeIconWide ? mWideTypeIconStartPadding : mMobileDataIconStartPadding,
+                    0, 0, 0);
+            mMobileDark.setPaddingRelative(
+                    mIsMobileTypeIconWide ? mWideTypeIconStartPadding : mMobileDataIconStartPadding,
+                    0, 0, 0);
 
             if (DEBUG) Log.d(TAG, String.format("mobile: %s sig=%d typ=%d",
                         (mMobileVisible ? "VISIBLE" : "GONE"), mMobileStrengthId, mMobileTypeId));
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/ImageGradientColorizer.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/ImageGradientColorizer.java
new file mode 100644
index 0000000..82910b8
--- /dev/null
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/ImageGradientColorizer.java
@@ -0,0 +1,96 @@
+/*
+ * Copyright (C) 2017 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.systemui.statusbar.notification;
+
+import android.graphics.Bitmap;
+import android.graphics.BitmapShader;
+import android.graphics.Canvas;
+import android.graphics.Color;
+import android.graphics.ColorMatrix;
+import android.graphics.ColorMatrixColorFilter;
+import android.graphics.LinearGradient;
+import android.graphics.Paint;
+import android.graphics.PorterDuff;
+import android.graphics.PorterDuffXfermode;
+import android.graphics.Shader;
+import android.graphics.Xfermode;
+import android.graphics.drawable.Drawable;
+
+/**
+ * A utility class to colorize bitmaps with a color gradient and a special blending mode
+ */
+public class ImageGradientColorizer {
+    public Bitmap colorize(Drawable drawable, int backgroundColor) {
+        int width = drawable.getIntrinsicWidth();
+        int height = drawable.getIntrinsicHeight();
+        int size = Math.min(width, height);
+        int widthInset = (width - size) / 2;
+        int heightInset = (height - size) / 2;
+        drawable = drawable.mutate();
+        drawable.setBounds(- widthInset, - heightInset, width - widthInset, height - heightInset);
+        Bitmap newBitmap = Bitmap.createBitmap(size, size, Bitmap.Config.ARGB_8888);
+        Canvas canvas = new Canvas(newBitmap);
+
+        // Values to calculate the luminance of a color
+        float lr = 0.2126f;
+        float lg = 0.7152f;
+        float lb = 0.0722f;
+
+        // Extract the red, green, blue components of the color extraction color in
+        // float and int form
+        int tri = Color.red(backgroundColor);
+        int tgi = Color.green(backgroundColor);
+        int tbi = Color.blue(backgroundColor);
+
+        float tr = tri / 255f;
+        float tg = tgi / 255f;
+        float tb = tbi / 255f;
+
+        // Calculate the luminance of the color extraction color
+        float cLum = (tr * lr + tg * lg + tb * lb) * 255;
+
+        ColorMatrix m = new ColorMatrix(new float[] {
+                lr, lg, lb, 0, tri - cLum,
+                lr, lg, lb, 0, tgi - cLum,
+                lr, lg, lb, 0, tbi - cLum,
+                0, 0, 0, 1, 0,
+        });
+
+        drawable.setColorFilter(new ColorMatrixColorFilter(m));
+        drawable.draw(canvas);
+        Paint paint = new Paint(Paint.ANTI_ALIAS_FLAG);
+        LinearGradient linearGradient =  new LinearGradient(0, 0, size, 0,
+                new int[] {0, Color.argb(0.5f, 1, 1, 1), Color.BLACK},
+                new float[] {0.0f, 0.4f, 1.0f}, Shader.TileMode.CLAMP);
+        paint.setShader(linearGradient);
+        Bitmap fadeIn = Bitmap.createBitmap(size, size, Bitmap.Config.ARGB_8888);
+        Canvas fadeInCanvas = new Canvas(fadeIn);
+        drawable.clearColorFilter();
+        drawable.draw(fadeInCanvas);
+        paint.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.DST_IN));
+        fadeInCanvas.drawPaint(paint);
+        canvas.drawBitmap(fadeIn, 0, 0, null);
+
+        linearGradient = new LinearGradient(0, 0, size, 0,
+                new int[] {backgroundColor, Color.argb(0.5f, tr, tg, tb), 0},
+                new float[] {0.0f, 0.6f, 1.0f}, Shader.TileMode.CLAMP);
+        paint.setShader(linearGradient);
+        paint.setXfermode(null);
+        canvas.drawPaint(paint);
+        return newBitmap;
+    }
+}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/MediaNotificationProcessor.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/MediaNotificationProcessor.java
new file mode 100644
index 0000000..cef225b
--- /dev/null
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/MediaNotificationProcessor.java
@@ -0,0 +1,259 @@
+/*
+ * Copyright (C) 2017 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.systemui.statusbar.notification;
+
+import android.app.Notification;
+import android.content.Context;
+import android.graphics.Bitmap;
+import android.graphics.Canvas;
+import android.graphics.Color;
+import android.graphics.drawable.Drawable;
+import android.graphics.drawable.Icon;
+import android.support.v4.graphics.ColorUtils;
+import android.support.v7.graphics.Palette;
+
+import com.android.systemui.R;
+
+import java.util.List;
+
+/**
+ * A class the processes media notifications and extracts the right text and background colors.
+ */
+public class MediaNotificationProcessor {
+
+    /**
+     * The fraction below which we select the vibrant instead of the light/dark vibrant color
+     */
+    private static final float POPULATION_FRACTION_FOR_MORE_VIBRANT = 0.75f;
+    private static final float POPULATION_FRACTION_FOR_WHITE_OR_BLACK = 2.5f;
+    private static final float BLACK_MAX_LIGHTNESS = 0.08f;
+    private static final float WHITE_MIN_LIGHTNESS = 0.92f;
+    private static final int RESIZE_BITMAP_AREA = 150 * 150;
+    private final ImageGradientColorizer mColorizer;
+    private final Context mContext;
+    private float[] mFilteredBackgroundHsl = null;
+    private Palette.Filter mBlackWhiteFilter = (rgb, hsl) -> !isWhiteOrBlack(hsl);
+
+    /**
+     * The context of the notification. This is the app context of the package posting the
+     * notification.
+     */
+    private final Context mPackageContext;
+    private boolean mIsLowPriority;
+
+    public MediaNotificationProcessor(Context context, Context packageContext) {
+        mContext = context;
+        mPackageContext = packageContext;
+        mColorizer = new ImageGradientColorizer();
+    }
+
+    /**
+     * Processes a builder of a media notification and calculates the appropriate colors that should
+     * be used.
+     *
+     * @param notification the notification that is being processed
+     * @param builder the recovered builder for the notification. this will be modified
+     */
+    public void processNotification(Notification notification, Notification.Builder builder) {
+        Icon largeIcon = notification.getLargeIcon();
+        Bitmap bitmap = null;
+        Drawable drawable = null;
+        if (largeIcon != null) {
+            drawable = largeIcon.loadDrawable(mPackageContext);
+            int backgroundColor = 0;
+            if (notification.isColorizedMedia()) {
+                int width = drawable.getIntrinsicWidth();
+                int height = drawable.getIntrinsicHeight();
+                int area = width * height;
+                if (area > RESIZE_BITMAP_AREA) {
+                    double factor = Math.sqrt((float) RESIZE_BITMAP_AREA / area);
+                    width = (int) (factor * width);
+                    height = (int) (factor * height);
+                }
+                bitmap = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888);
+                Canvas canvas = new Canvas(bitmap);
+                drawable.setBounds(0, 0, width, height);
+                drawable.draw(canvas);
+
+                // for the background we only take the left side of the image to ensure
+                // a smooth transition
+                Palette.Builder paletteBuilder = Palette.from(bitmap)
+                        .setRegion(0, 0, bitmap.getWidth() / 2, bitmap.getHeight())
+                        .clearFilters() // we want all colors, red / white / black ones too!
+                        .resizeBitmapArea(RESIZE_BITMAP_AREA);
+                Palette palette = paletteBuilder.generate();
+                backgroundColor = findBackgroundColorAndFilter(palette);
+                // we want the full region again
+                paletteBuilder.setRegion(0, 0, bitmap.getWidth(), bitmap.getHeight());
+                if (mFilteredBackgroundHsl != null) {
+                    paletteBuilder.addFilter((rgb, hsl) -> {
+                        // at least 10 degrees hue difference
+                        float diff = Math.abs(hsl[0] - mFilteredBackgroundHsl[0]);
+                        return diff > 10 && diff < 350;
+                    });
+                }
+                paletteBuilder.addFilter(mBlackWhiteFilter);
+                palette = paletteBuilder.generate();
+                int foregroundColor;
+                if (ColorUtils.calculateLuminance(backgroundColor) > 0.5) {
+                    Palette.Swatch first = palette.getDarkVibrantSwatch();
+                    Palette.Swatch second = palette.getVibrantSwatch();
+                    if (first != null && second != null) {
+                        int firstPopulation = first.getPopulation();
+                        int secondPopulation = second.getPopulation();
+                        if (firstPopulation / secondPopulation
+                                < POPULATION_FRACTION_FOR_MORE_VIBRANT) {
+                            foregroundColor = second.getRgb();
+                        } else {
+                            foregroundColor = first.getRgb();
+                        }
+                    } else if (first != null) {
+                        foregroundColor = first.getRgb();
+                    } else if (second != null) {
+                        foregroundColor = second.getRgb();
+                    } else {
+                        first = palette.getMutedSwatch();
+                        second = palette.getDarkMutedSwatch();
+                        if (first != null && second != null) {
+                            float firstSaturation = first.getHsl()[1];
+                            float secondSaturation = second.getHsl()[1];
+                            if (firstSaturation > secondSaturation) {
+                                foregroundColor = first.getRgb();
+                            } else {
+                                foregroundColor = second.getRgb();
+                            }
+                        } else if (first != null) {
+                            foregroundColor = first.getRgb();
+                        } else if (second != null) {
+                            foregroundColor = second.getRgb();
+                        } else {
+                            foregroundColor = Color.BLACK;
+                        }
+                    }
+                } else {
+                    Palette.Swatch first = palette.getLightVibrantSwatch();
+                    Palette.Swatch second = palette.getVibrantSwatch();
+                    if (first != null && second != null) {
+                        int firstPopulation = first.getPopulation();
+                        int secondPopulation = second.getPopulation();
+                        if (firstPopulation / secondPopulation
+                                < POPULATION_FRACTION_FOR_MORE_VIBRANT) {
+                            foregroundColor = second.getRgb();
+                        } else {
+                            foregroundColor = first.getRgb();
+                        }
+                    } else if (first != null) {
+                        foregroundColor = first.getRgb();
+                    } else if (second != null) {
+                        foregroundColor = second.getRgb();
+                    } else {
+                        first = palette.getMutedSwatch();
+                        second = palette.getLightMutedSwatch();
+                        if (first != null && second != null) {
+                            float firstSaturation = first.getHsl()[1];
+                            float secondSaturation = second.getHsl()[1];
+                            if (firstSaturation > secondSaturation) {
+                                foregroundColor = first.getRgb();
+                            } else {
+                                foregroundColor = second.getRgb();
+                            }
+                        } else if (first != null) {
+                            foregroundColor = first.getRgb();
+                        } else if (second != null) {
+                            foregroundColor = second.getRgb();
+                        } else {
+                            foregroundColor = Color.WHITE;
+                        }
+                    }
+                }
+                builder.setColorPalette(backgroundColor, foregroundColor);
+            } else {
+                int id = mIsLowPriority
+                        ? R.color.notification_material_background_low_priority_color
+                        : R.color.notification_material_background_color;
+                backgroundColor = mContext.getColor(id);
+            }
+            Bitmap colorized = mColorizer.colorize(drawable, backgroundColor);
+            builder.setLargeIcon(Icon.createWithBitmap(colorized));
+        }
+    }
+
+    private int findBackgroundColorAndFilter(Palette palette) {
+        // by default we use the dominant palette
+        Palette.Swatch dominantSwatch = palette.getDominantSwatch();
+        if (dominantSwatch == null) {
+            // We're not filtering on white or black
+            mFilteredBackgroundHsl = null;
+            return Color.WHITE;
+        }
+
+        if (!isWhiteOrBlack(dominantSwatch.getHsl())) {
+            mFilteredBackgroundHsl = dominantSwatch.getHsl();
+            return dominantSwatch.getRgb();
+        }
+        // Oh well, we selected black or white. Lets look at the second color!
+        List<Palette.Swatch> swatches = palette.getSwatches();
+        float highestNonWhitePopulation = -1;
+        Palette.Swatch second = null;
+        for (Palette.Swatch swatch: swatches) {
+            if (swatch != dominantSwatch
+                    && swatch.getPopulation() > highestNonWhitePopulation
+                    && !isWhiteOrBlack(swatch.getHsl())) {
+                second = swatch;
+                highestNonWhitePopulation = swatch.getPopulation();
+            }
+        }
+        if (second == null) {
+            // We're not filtering on white or black
+            mFilteredBackgroundHsl = null;
+            return dominantSwatch.getRgb();
+        }
+        if (dominantSwatch.getPopulation() / highestNonWhitePopulation
+                > POPULATION_FRACTION_FOR_WHITE_OR_BLACK) {
+            // The dominant swatch is very dominant, lets take it!
+            // We're not filtering on white or black
+            mFilteredBackgroundHsl = null;
+            return dominantSwatch.getRgb();
+        } else {
+            mFilteredBackgroundHsl = second.getHsl();
+            return second.getRgb();
+        }
+    }
+
+    private boolean isWhiteOrBlack(float[] hsl) {
+        return isBlack(hsl) || isWhite(hsl);
+    }
+
+
+    /**
+     * @return true if the color represents a color which is close to black.
+     */
+    private boolean isBlack(float[] hslColor) {
+        return hslColor[2] <= BLACK_MAX_LIGHTNESS;
+    }
+
+    /**
+     * @return true if the color represents a color which is close to white.
+     */
+    private boolean isWhite(float[] hslColor) {
+        return hslColor[2] >= WHITE_MIN_LIGHTNESS;
+    }
+
+    public void setIsLowPriority(boolean isLowPriority) {
+        mIsLowPriority = isLowPriority;
+    }
+}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/NotificationInflater.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/NotificationInflater.java
index 2e34f24..7cfc767 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/NotificationInflater.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/NotificationInflater.java
@@ -18,11 +18,10 @@
 
 import android.app.Notification;
 import android.content.Context;
+import android.os.AsyncTask;
 import android.service.notification.StatusBarNotification;
 import android.util.Log;
 import android.view.View;
-import android.view.ViewGroup;
-import android.view.ViewParent;
 import android.widget.RemoteViews;
 
 import com.android.internal.annotations.VisibleForTesting;
@@ -39,7 +38,8 @@
     @VisibleForTesting
     static final int FLAG_REINFLATE_ALL = ~0;
     private static final int FLAG_REINFLATE_CONTENT_VIEW = 1<<0;
-    private static final int FLAG_REINFLATE_EXPANDED_VIEW = 1<<1;
+    @VisibleForTesting
+    static final int FLAG_REINFLATE_EXPANDED_VIEW = 1<<1;
     private static final int FLAG_REINFLATE_HEADS_UP_VIEW = 1<<2;
     private static final int FLAG_REINFLATE_PUBLIC_VIEW = 1<<3;
     private static final int FLAG_REINFLATE_AMBIENT_VIEW = 1<<4;
@@ -50,7 +50,7 @@
     private boolean mUsesIncreasedHeadsUpHeight;
     private RemoteViews.OnClickHandler mRemoteViewClickHandler;
     private boolean mIsChildInGroup;
-    private InflationExceptionHandler mInflateExceptionHandler;
+    private InflationCallback mCallback;
     private boolean mRedactAmbient;
 
     public NotificationInflater(ExpandableNotificationRow row) {
@@ -66,21 +66,14 @@
      *
      * @return whether the view was re-inflated
      */
-    public boolean setIsChildInGroup(boolean childInGroup) {
+    public void setIsChildInGroup(boolean childInGroup) {
         if (childInGroup != mIsChildInGroup) {
             mIsChildInGroup = childInGroup;
             if (mIsLowPriority) {
-                try {
-                    int flags = FLAG_REINFLATE_CONTENT_VIEW | FLAG_REINFLATE_EXPANDED_VIEW;
-                    inflateNotificationViews(flags);
-                } catch (InflationException e) {
-                    mInflateExceptionHandler.handleInflationException(
-                            mRow.getStatusBarNotification(), e);
-                }
+                int flags = FLAG_REINFLATE_CONTENT_VIEW | FLAG_REINFLATE_EXPANDED_VIEW;
+                inflateNotificationViews(flags);
             }
-            return true;
-        }
-        return false;
+        } ;
     }
 
     public void setUsesIncreasedHeight(boolean usesIncreasedHeight) {
@@ -101,39 +94,29 @@
             if (mRow.getEntry() == null) {
                 return;
             }
-            try {
-                inflateNotificationViews(FLAG_REINFLATE_AMBIENT_VIEW);
-            } catch (InflationException e) {
-                mInflateExceptionHandler.handleInflationException(
-                        mRow.getStatusBarNotification(), e);
-            }
+            inflateNotificationViews(FLAG_REINFLATE_AMBIENT_VIEW);
         }
     }
 
-    public void inflateNotificationViews() throws InflationException {
+    /**
+     * Inflate all views of this notification on a background thread. This is asynchronous and will
+     * notify the callback once it's finished.
+     */
+    public void inflateNotificationViews() {
         inflateNotificationViews(FLAG_REINFLATE_ALL);
     }
 
     /**
-     * reinflate all views for the specified flags
+     * Reinflate all views for the specified flags on a background thread. This is asynchronous and
+     * will notify the callback once it's finished.
+     *
      * @param reInflateFlags flags which views should be reinflated. Use {@link #FLAG_REINFLATE_ALL}
      *                       to reinflate all of views.
-     * @throws InflationException
      */
-    private void inflateNotificationViews(int reInflateFlags)
-            throws InflationException {
+    @VisibleForTesting
+    void inflateNotificationViews(int reInflateFlags) {
         StatusBarNotification sbn = mRow.getEntry().notification;
-        try {
-            final Notification.Builder recoveredBuilder
-                    = Notification.Builder.recoverBuilder(mRow.getContext(), sbn.getNotification());
-            Context packageContext = sbn.getPackageContext(mRow.getContext());
-            inflateNotificationViews(reInflateFlags, recoveredBuilder, packageContext);
-
-        } catch (RuntimeException e) {
-            final String ident = sbn.getPackageName() + "/0x" + Integer.toHexString(sbn.getId());
-            Log.e(StatusBar.TAG, "couldn't inflate view for notification " + ident, e);
-            throw new InflationException("Couldn't inflate contentViews");
-        }
+        new AsyncInflationTask(mRow.getContext(), sbn, reInflateFlags).execute();
     }
 
     @VisibleForTesting
@@ -284,12 +267,13 @@
                         && a.getLayoutId() == b.getLayoutId());
     }
 
-    public void setInflateExceptionHandler(InflationExceptionHandler inflateExceptionHandler) {
-        mInflateExceptionHandler = inflateExceptionHandler;
+    public void setInflationCallback(InflationCallback callback) {
+        mCallback = callback;
     }
 
-    public interface InflationExceptionHandler {
+    public interface InflationCallback {
         void handleInflationException(StatusBarNotification notification, InflationException e);
+        void onAsyncInflationFinished(NotificationData.Entry entry);
     }
 
     public void onDensityOrFontScaleChanged() {
@@ -299,12 +283,75 @@
         entry.cachedContentView = null;
         entry.cachedHeadsUpContentView = null;
         entry.cachedPublicContentView = null;
-        try {
-            inflateNotificationViews();
-        } catch (InflationException e) {
-            mInflateExceptionHandler.handleInflationException(
-                    mRow.getStatusBarNotification(), e);
+        inflateNotificationViews();
+    }
+
+    private class AsyncInflationTask extends AsyncTask<Void, Void, Notification.Builder> {
+
+        private final StatusBarNotification mSbn;
+        private final Context mContext;
+        private final int mReInflateFlags;
+        private Context mPackageContext = null;
+        private Exception mError;
+
+        private AsyncInflationTask(Context context, StatusBarNotification notification,
+                int reInflateFlags) {
+            mSbn = notification;
+            mContext = context;
+            mReInflateFlags = reInflateFlags;
+            mRow.getEntry().addInflationTask(this);
+        }
+
+        @Override
+        protected Notification.Builder doInBackground(Void... params) {
+            try {
+                final Notification.Builder recoveredBuilder
+                        = Notification.Builder.recoverBuilder(mContext,
+                        mSbn.getNotification());
+                mPackageContext = mSbn.getPackageContext(mContext);
+                Notification notification = mSbn.getNotification();
+                if (notification.isMediaNotification()) {
+                    MediaNotificationProcessor processor = new MediaNotificationProcessor(mContext,
+                            mPackageContext);
+                    processor.setIsLowPriority(mIsLowPriority);
+                    processor.processNotification(notification, recoveredBuilder);
+                }
+                return recoveredBuilder;
+            } catch (Exception e) {
+                mError = e;
+                return null;
+            }
+        }
+
+        @Override
+        protected void onPostExecute(Notification.Builder builder) {
+            mRow.getEntry().onInflationTaskFinished(this);
+            if (mError == null) {
+                finishInflation(mReInflateFlags, builder, mPackageContext);
+            } else {
+                handleError(mError);
+            }
         }
     }
 
+    private void finishInflation(int reinflationFlags, Notification.Builder builder,
+            Context context) {
+        try {
+            inflateNotificationViews(reinflationFlags, builder, context);
+        } catch (RuntimeException e){
+            handleError(e);
+            return;
+        }
+        mRow.onNotificationUpdated();
+        mCallback.onAsyncInflationFinished(mRow.getEntry());
+    }
+
+    private void handleError(Exception e) {
+        StatusBarNotification sbn = mRow.getStatusBarNotification();
+        final String ident = sbn.getPackageName() + "/0x"
+                + Integer.toHexString(sbn.getId());
+        Log.e(StatusBar.TAG, "couldn't inflate view for notification " + ident, e);
+        mCallback.handleInflationException(sbn,
+                new InflationException("Couldn't inflate contentViews" + e));
+    }
 }
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/NotificationMediaTemplateViewWrapper.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/NotificationMediaTemplateViewWrapper.java
index ef5a25c..8596cb3 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/NotificationMediaTemplateViewWrapper.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/NotificationMediaTemplateViewWrapper.java
@@ -56,4 +56,9 @@
                     mActions);
         }
     }
+
+    @Override
+    public boolean isDimmable() {
+        return false;
+    }
 }
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/NotificationViewWrapper.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/NotificationViewWrapper.java
index f4db9a1..5cc39cc 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/NotificationViewWrapper.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/NotificationViewWrapper.java
@@ -178,4 +178,8 @@
 
     public void setIsChildInGroup(boolean isChildInGroup) {
     }
+
+    public boolean isDimmable() {
+        return true;
+    }
 }
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/SignalDrawable.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/SignalDrawable.java
index 6361eb6..a9eb20b 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/SignalDrawable.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/SignalDrawable.java
@@ -57,12 +57,12 @@
     private static final int LEVEL_MASK = 0xff;
     private static final int NUM_LEVEL_SHIFT = 8;
     private static final int NUM_LEVEL_MASK = 0xff << NUM_LEVEL_SHIFT;
-    public static final int STATE_SHIFT = 16;
-    public static final int STATE_MASK = 0xff << STATE_SHIFT;
-    public static final int STATE_NONE = 0;
-    public static final int STATE_EMPTY = 1;
-    public static final int STATE_CUT = 2;
-    public static final int STATE_CARRIER_CHANGE = 3;
+    private static final int STATE_SHIFT = 16;
+    private static final int STATE_MASK = 0xff << STATE_SHIFT;
+    private static final int STATE_NONE = 0;
+    private static final int STATE_EMPTY = 1;
+    private static final int STATE_CUT = 2;
+    private static final int STATE_CARRIER_CHANGE = 3;
 
     private static final long DOT_DELAY = 1000;
 
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java
index 46d6415..c1859fe 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java
@@ -22,7 +22,7 @@
 import static android.app.StatusBarManager.WINDOW_STATE_SHOWING;
 import static android.app.StatusBarManager.windowStateToString;
 
-import static com.android.systemui.statusbar.notification.NotificationInflater.InflationExceptionHandler;
+import static com.android.systemui.statusbar.notification.NotificationInflater.InflationCallback;
 import static com.android.systemui.statusbar.phone.BarTransitions.MODE_LIGHTS_OUT;
 import static com.android.systemui.statusbar.phone.BarTransitions.MODE_LIGHTS_OUT_TRANSPARENT;
 import static com.android.systemui.statusbar.phone.BarTransitions.MODE_OPAQUE;
@@ -257,7 +257,7 @@
         OnHeadsUpChangedListener, VisualStabilityManager.Callback, CommandQueue.Callbacks,
         ActivatableNotificationView.OnActivatedListener,
         ExpandableNotificationRow.ExpansionLogger, NotificationData.Environment,
-        ExpandableNotificationRow.OnExpandClickListener {
+        ExpandableNotificationRow.OnExpandClickListener, InflationCallback {
     public static final boolean MULTIUSER_DEBUG = false;
 
     public static final boolean ENABLE_REMOTE_INPUT =
@@ -713,8 +713,8 @@
     private LockscreenGestureLogger mLockscreenGestureLogger = new LockscreenGestureLogger();
     private NotificationIconAreaController mNotificationIconAreaController;
     private ConfigurationListener mConfigurationListener;
-    private InflationExceptionHandler mInflationExceptionHandler = this::handleInflationException;
     private boolean mReinflateNotificationsOnUserSwitched;
+    private HashMap<String, Entry> mPendingNotifications = new HashMap<>();
 
     private void recycleAllVisibilityObjects(ArraySet<NotificationVisibility> array) {
         final int N = array.size();
@@ -1544,29 +1544,24 @@
         return new UserHandle(mCurrentUserId);
     }
 
-    public void addNotification(StatusBarNotification notification, RankingMap ranking,
-            Entry oldEntry) throws InflationException {
-        if (DEBUG) Log.d(TAG, "addNotification key=" + notification.getKey());
+    public void addNotification(StatusBarNotification notification, RankingMap ranking)
+            throws InflationException {
+        String key = notification.getKey();
+        if (DEBUG) Log.d(TAG, "addNotification key=" + key);
 
         mNotificationData.updateRanking(ranking);
         Entry shadeEntry = createNotificationViews(notification);
         boolean isHeadsUped = shouldPeek(shadeEntry);
-        if (isHeadsUped) {
-            mHeadsUpManager.showNotification(shadeEntry);
-            // Mark as seen immediately
-            setNotificationShown(notification);
-        }
-
         if (!isHeadsUped && notification.getNotification().fullScreenIntent != null) {
-            if (shouldSuppressFullScreenIntent(notification.getKey())) {
+            if (shouldSuppressFullScreenIntent(key)) {
                 if (DEBUG) {
-                    Log.d(TAG, "No Fullscreen intent: suppressed by DND: " + notification.getKey());
+                    Log.d(TAG, "No Fullscreen intent: suppressed by DND: " + key);
                 }
-            } else if (mNotificationData.getImportance(notification.getKey())
+            } else if (mNotificationData.getImportance(key)
                     < NotificationManager.IMPORTANCE_HIGH) {
                 if (DEBUG) {
                     Log.d(TAG, "No Fullscreen intent: not important enough: "
-                            + notification.getKey());
+                            + key);
                 }
             } else {
                 // Stop screensaver if the notification has a full-screen intent.
@@ -1578,7 +1573,7 @@
                     Log.d(TAG, "Notification has fullScreenIntent; sending fullScreenIntent");
                 try {
                     EventLog.writeEvent(EventLogTags.SYSUI_FULLSCREEN_NOTIFICATION,
-                            notification.getKey());
+                            key);
                     notification.getNotification().fullScreenIntent.send();
                     shadeEntry.notifyFullScreenIntentLaunched();
                     mMetricsLogger.count("note_fullscreen", 1);
@@ -1586,15 +1581,47 @@
                 }
             }
         }
-        addNotificationViews(shadeEntry, ranking);
+        abortExistingInflation(key);
+        mPendingNotifications.put(key, shadeEntry);
+    }
+
+    private void abortExistingInflation(String key) {
+        if (mPendingNotifications.containsKey(key)) {
+            Entry entry = mPendingNotifications.get(key);
+            entry.abortInflation();
+            mPendingNotifications.remove(key);
+        }
+        Entry addedEntry = mNotificationData.get(key);
+        if (addedEntry != null) {
+            addedEntry.abortInflation();
+        }
+    }
+
+    private void addEntry(Entry shadeEntry) {
+        boolean isHeadsUped = shouldPeek(shadeEntry);
+        if (isHeadsUped) {
+            mHeadsUpManager.showNotification(shadeEntry);
+            // Mark as seen immediately
+            setNotificationShown(shadeEntry.notification);
+        }
+        addNotificationViews(shadeEntry);
         // Recalculate the position of the sliding windows and the titles.
         setAreThereNotifications();
     }
 
+    @Override
     public void handleInflationException(StatusBarNotification notification, InflationException e) {
         handleNotificationError(notification, e.getMessage());
     }
 
+    @Override
+    public void onAsyncInflationFinished(Entry entry) {
+        mPendingNotifications.remove(entry.key);
+        if (mNotificationData.get(entry.key) == null) {
+            addEntry(entry);
+        }
+    }
+
     private boolean shouldSuppressFullScreenIntent(String key) {
         if (isDeviceInVrMode()) {
             return true;
@@ -1614,6 +1641,7 @@
 
     public void removeNotification(String key, RankingMap ranking) {
         boolean deferRemoval = false;
+        abortExistingInflation(key);
         if (mHeadsUpManager.isHeadsUp(key)) {
             // A cancel() in repsonse to a remote input shouldn't be delayed, as it makes the
             // sending look longer than it takes.
@@ -3295,6 +3323,14 @@
                     + " scroll " + mStackScroller.getScrollX()
                     + "," + mStackScroller.getScrollY());
         }
+        pw.print("  mPendingNotifications=");
+        if (mPendingNotifications.size() == 0) {
+            pw.println("null");
+        } else {
+            for (Entry entry : mPendingNotifications.values()) {
+                pw.println(entry.notification);
+            }
+        }
 
         pw.print("  mInteractingWindows="); pw.println(mInteractingWindows);
         pw.print("  mStatusBarWindowState=");
@@ -5531,7 +5567,7 @@
                 public void run() {
                     for (StatusBarNotification sbn : notifications) {
                         try {
-                            addNotification(sbn, currentRanking, null /* oldEntry */);
+                            addNotification(sbn, currentRanking);
                         } catch (InflationException e) {
                             handleInflationException(sbn, e);
                         }
@@ -5574,7 +5610,7 @@
                             if (isUpdate) {
                                 updateNotification(sbn, rankingMap);
                             } else {
-                                addNotification(sbn, rankingMap, null /* oldEntry */);
+                                addNotification(sbn, rankingMap);
                             }
                         } catch (InflationException e) {
                             handleInflationException(sbn, e);
@@ -6132,8 +6168,7 @@
         }
     }
 
-    protected void inflateViews(Entry entry, ViewGroup parent) throws
-            InflationException {
+    protected void inflateViews(Entry entry, ViewGroup parent) {
         PackageManager pmUser = getPackageManagerForUser(mContext,
                 entry.notification.getUser().getIdentifier());
 
@@ -6154,7 +6189,7 @@
             row.setRemoteInputController(mRemoteInputController);
             row.setOnExpandClickListener(this);
             row.setRemoteViewClickHandler(mOnClickHandler);
-            row.setInflateExceptionHandler(mInflationExceptionHandler);
+            row.setInflationCallback(this);
 
             // Get the app name.
             // Note that Notification.Builder#bindHeaderAppName has similar logic
@@ -6552,12 +6587,12 @@
         return entry;
     }
 
-    protected void addNotificationViews(Entry entry, RankingMap ranking) {
+    protected void addNotificationViews(Entry entry) {
         if (entry == null) {
             return;
         }
         // Add the expanded view and icon.
-        mNotificationData.add(entry, ranking);
+        mNotificationData.add(entry);
         updateNotifications();
     }
 
@@ -6675,6 +6710,7 @@
         if (DEBUG) Log.d(TAG, "updateNotification(" + notification + ")");
 
         final String key = notification.getKey();
+        abortExistingInflation(key);
         Entry entry = mNotificationData.get(key);
         if (entry == null) {
             return;
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/CallbackHandler.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/CallbackHandler.java
index e98dc98..a456786 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/CallbackHandler.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/CallbackHandler.java
@@ -110,24 +110,30 @@
     public void setWifiIndicators(final boolean enabled, final IconState statusIcon,
             final IconState qsIcon, final boolean activityIn, final boolean activityOut,
             final String description, boolean isTransient) {
-        post(() -> {
-            for (SignalCallback callback : mSignalCallbacks) {
-                callback.setWifiIndicators(enabled, statusIcon, qsIcon, activityIn, activityOut,
-                        description, isTransient);
+        post(new Runnable() {
+            @Override
+            public void run() {
+                for (SignalCallback callback : mSignalCallbacks) {
+                    callback.setWifiIndicators(enabled, statusIcon, qsIcon, activityIn, activityOut,
+                            description, isTransient);
+                }
             }
         });
     }
 
     @Override
-    public void setMobileDataIndicators(final IconState statusIcon,
-            final int statusType, final boolean activityIn,
+    public void setMobileDataIndicators(final IconState statusIcon, final IconState qsIcon,
+            final int statusType, final int qsType,final boolean activityIn,
             final boolean activityOut, final String typeContentDescription,
-            final int subId, boolean roaming, boolean isEmergency) {
-        post(() -> {
-            for (SignalCallback signalCluster : mSignalCallbacks) {
-                signalCluster.setMobileDataIndicators(statusIcon, statusType,
-                        activityIn, activityOut, typeContentDescription,
-                        subId, roaming, isEmergency);
+            final String description, final boolean isWide, final int subId, boolean roaming) {
+        post(new Runnable() {
+            @Override
+            public void run() {
+                for (SignalCallback signalCluster : mSignalCallbacks) {
+                    signalCluster.setMobileDataIndicators(statusIcon, qsIcon, statusType, qsType,
+                            activityIn, activityOut, typeContentDescription, description, isWide,
+                            subId, roaming);
+                }
             }
         });
     }
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/MobileSignalController.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/MobileSignalController.java
index 4421a6a..67b5596 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/MobileSignalController.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/MobileSignalController.java
@@ -244,8 +244,7 @@
             return SignalDrawable.getCarrierChangeState(getNumLevels());
         } else if (mCurrentState.connected) {
             return SignalDrawable.getState(mCurrentState.level, getNumLevels(),
-                    mCurrentState.inetCondition == 0 ||
-                            (mCurrentState.dataDisabled && mCurrentState.userSetup));
+                    mCurrentState.inetCondition == 0);
         } else if (mCurrentState.enabled) {
             return SignalDrawable.getEmptyState(getNumLevels());
         } else {
@@ -264,14 +263,24 @@
 
         String contentDescription = getStringIfExists(getContentDescription());
         String dataContentDescription = getStringIfExists(icons.mDataContentDescription);
-        final boolean dataDisabled = mCurrentState.dataDisabled
+        final boolean dataDisabled = mCurrentState.iconGroup == TelephonyIcons.DATA_DISABLED
                 && mCurrentState.userSetup;
 
         // Show icon in QS when we are connected or data is disabled.
-        boolean showDataIcon = mCurrentState.dataConnected;
+        boolean showDataIcon = mCurrentState.dataConnected || dataDisabled;
         IconState statusIcon = new IconState(mCurrentState.enabled && !mCurrentState.airplaneMode,
                 getCurrentIconId(), contentDescription);
 
+        int qsTypeIcon = 0;
+        IconState qsIcon = null;
+        String description = null;
+        // Only send data sim callbacks to QS.
+        if (mCurrentState.dataSim) {
+            qsTypeIcon = showDataIcon ? icons.mQsDataType : 0;
+            qsIcon = new IconState(mCurrentState.enabled
+                    && !mCurrentState.isEmergency, getQsCurrentIconId(), contentDescription);
+            description = mCurrentState.isEmergency ? null : mCurrentState.networkName;
+        }
         boolean activityIn = mCurrentState.dataConnected
                 && !mCurrentState.carrierNetworkChangeMode
                 && mCurrentState.activityIn;
@@ -280,10 +289,9 @@
                 && mCurrentState.activityOut;
         showDataIcon &= mCurrentState.isDefault || dataDisabled;
         int typeIcon = showDataIcon ? icons.mDataType : 0;
-        callback.setMobileDataIndicators(statusIcon, typeIcon,
-                activityIn, activityOut, dataContentDescription,
-                mSubscriptionInfo.getSubscriptionId(), mCurrentState.roaming,
-                mCurrentState.isEmergency);
+        callback.setMobileDataIndicators(statusIcon, qsIcon, typeIcon, qsTypeIcon,
+                activityIn, activityOut, dataContentDescription, description, icons.mIsWide,
+                mSubscriptionInfo.getSubscriptionId(), mCurrentState.roaming);
     }
 
     @Override
@@ -430,14 +438,14 @@
         } else {
             mCurrentState.iconGroup = mDefaultIcons;
         }
-        mCurrentState.dataDisabled = isDataDisabled();
         mCurrentState.dataConnected = mCurrentState.connected
-                && mDataState == TelephonyManager.DATA_CONNECTED
-                && !mCurrentState.dataDisabled;
+                && mDataState == TelephonyManager.DATA_CONNECTED;
 
         mCurrentState.roaming = isRoaming();
         if (isCarrierNetworkChangeActive()) {
             mCurrentState.iconGroup = TelephonyIcons.CARRIER_NETWORK_CHANGE;
+        } else if (isDataDisabled()) {
+            mCurrentState.iconGroup = TelephonyIcons.DATA_DISABLED;
         }
         if (isEmergencyOnly() != mCurrentState.isEmergency) {
             mCurrentState.isEmergency = isEmergencyOnly();
@@ -569,7 +577,6 @@
         boolean isDefault;
         boolean userSetup;
         boolean roaming;
-        boolean dataDisabled;
 
         @Override
         public void copyFrom(State s) {
@@ -585,7 +592,6 @@
             carrierNetworkChangeMode = state.carrierNetworkChangeMode;
             userSetup = state.userSetup;
             roaming = state.roaming;
-            dataDisabled = state.dataDisabled;
         }
 
         @Override
@@ -603,7 +609,6 @@
             builder.append("carrierNetworkChangeMode=").append(carrierNetworkChangeMode)
                     .append(',');
             builder.append("userSetup=").append(userSetup);
-            builder.append("dataDisabled=").append(dataDisabled);
         }
 
         @Override
@@ -618,7 +623,6 @@
                     && ((MobileState) o).carrierNetworkChangeMode == carrierNetworkChangeMode
                     && ((MobileState) o).userSetup == userSetup
                     && ((MobileState) o).isDefault == isDefault
-                    && ((MobileState) o).dataDisabled == dataDisabled
                     && ((MobileState) o).roaming == roaming;
         }
     }
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkController.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkController.java
index ab4a8f2..c02ce0e 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkController.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkController.java
@@ -48,9 +48,9 @@
         default void setWifiIndicators(boolean enabled, IconState statusIcon, IconState qsIcon,
                 boolean activityIn, boolean activityOut, String description, boolean isTransient) {}
 
-        default void setMobileDataIndicators(IconState statusIcon, int statusType,
-                boolean activityIn, boolean activityOut, String typeContentDescription,
-                int subId, boolean roaming, boolean isEmergency) {}
+        default void setMobileDataIndicators(IconState statusIcon, IconState qsIcon, int statusType,
+                int qsType, boolean activityIn, boolean activityOut, String typeContentDescription,
+                String description, boolean isWide, int subId, boolean roaming) {}
         default void setSubs(List<SubscriptionInfo> subs) {}
         default void setNoSims(boolean show) {}
 
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkControllerImpl.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkControllerImpl.java
index 60f4ab8..c21f444 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkControllerImpl.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkControllerImpl.java
@@ -867,6 +867,7 @@
                             datatype.equals("h") ? TelephonyIcons.H :
                             datatype.equals("lte") ? TelephonyIcons.LTE :
                             datatype.equals("lte+") ? TelephonyIcons.LTE_PLUS :
+                            datatype.equals("dis") ? TelephonyIcons.DATA_DISABLED :
                             TelephonyIcons.UNKNOWN;
                 }
                 if (args.containsKey("roam")) {
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/TelephonyIcons.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/TelephonyIcons.java
index ec7e557..aaa0568 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/TelephonyIcons.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/TelephonyIcons.java
@@ -44,6 +44,10 @@
     static final int ICON_4G_PLUS = R.drawable.stat_sys_data_fully_connected_4g_plus;
     static final int ICON_1X = R.drawable.stat_sys_data_fully_connected_1x;
 
+    static final int ICON_DATA_DISABLED = R.drawable.stat_sys_data_disabled;
+
+    static final int QS_ICON_DATA_DISABLED = R.drawable.ic_qs_data_disabled;
+
     static final MobileIconGroup CARRIER_NETWORK_CHANGE = new MobileIconGroup(
             "CARRIER_NETWORK_CHANGE",
             null,
@@ -217,5 +221,20 @@
             true,
             TelephonyIcons.QS_DATA_LTE_PLUS
             );
+
+    static final MobileIconGroup DATA_DISABLED = new MobileIconGroup(
+            "DataDisabled",
+            null,
+            null,
+            AccessibilityContentDescriptions.PHONE_SIGNAL_STRENGTH,
+            0, 0,
+            0,
+            0,
+            AccessibilityContentDescriptions.PHONE_SIGNAL_STRENGTH[0],
+            R.string.accessibility_cell_data_off,
+            TelephonyIcons.ICON_DATA_DISABLED,
+            false,
+            TelephonyIcons.QS_ICON_DATA_DISABLED
+            );
 }
 
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/WifiIcons.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/WifiIcons.java
index dfc3591..374408d 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/WifiIcons.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/WifiIcons.java
@@ -47,7 +47,6 @@
 
     static final int QS_WIFI_NO_NETWORK = R.drawable.ic_qs_wifi_no_network;
     static final int WIFI_NO_NETWORK = R.drawable.stat_sys_wifi_signal_null;
-    static final int WIFI_DISCONNECTED = R.drawable.stat_sys_wifi_signal_disconnected;
 
     static final int WIFI_LEVEL_COUNT = WIFI_SIGNAL_STRENGTH[0].length;
 }
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/WifiSignalController.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/WifiSignalController.java
index a773acf..2104cb1 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/WifiSignalController.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/WifiSignalController.java
@@ -80,7 +80,7 @@
                 AccessibilityContentDescriptions.WIFI_CONNECTION_STRENGTH,
                 WifiIcons.WIFI_NO_NETWORK,
                 WifiIcons.QS_WIFI_NO_NETWORK,
-                WifiIcons.WIFI_DISCONNECTED,
+                WifiIcons.WIFI_NO_NETWORK,
                 WifiIcons.QS_WIFI_NO_NETWORK,
                 AccessibilityContentDescriptions.WIFI_NO_CONNECTION
                 );
@@ -133,7 +133,8 @@
     @Override
     public void notifyListeners(SignalCallback callback) {
         // only show wifi in the cluster if connected or if wifi-only
-        boolean wifiVisible = true;
+        boolean wifiVisible = mCurrentState.enabled
+                && (mCurrentState.connected || !mHasMobileData);
         String wifiDesc = wifiVisible ? mCurrentState.ssid : null;
         boolean ssidPresent = wifiVisible && mCurrentState.ssid != null;
         String contentDescription = getStringIfExists(getContentDescription());
diff --git a/packages/SystemUI/src/com/android/systemui/util/Assert.java b/packages/SystemUI/src/com/android/systemui/util/Assert.java
index af447f3..0f7c9a4 100644
--- a/packages/SystemUI/src/com/android/systemui/util/Assert.java
+++ b/packages/SystemUI/src/com/android/systemui/util/Assert.java
@@ -28,4 +28,10 @@
             throw new IllegalStateException("should be called from the main thread.");
         }
     }
+
+    public static void isNotMainThread() {
+        if (Looper.getMainLooper().isCurrentThread()) {
+            throw new IllegalStateException("should not be called from the main thread.");
+        }
+    }
 }
diff --git a/packages/SystemUI/tests/Android.mk b/packages/SystemUI/tests/Android.mk
index 8eedf31..5e8b3f9 100644
--- a/packages/SystemUI/tests/Android.mk
+++ b/packages/SystemUI/tests/Android.mk
@@ -42,6 +42,7 @@
     android-support-v7-preference \
     android-support-v7-appcompat \
     android-support-v7-mediarouter \
+    android-support-v7-palette \
     android-support-v14-preference \
     android-support-v17-leanback
 
diff --git a/packages/SystemUI/tests/src/com/android/keyguard/KeyguardClockAccessibilityDelegateTest.java b/packages/SystemUI/tests/src/com/android/keyguard/KeyguardClockAccessibilityDelegateTest.java
new file mode 100644
index 0000000..1c9f813
--- /dev/null
+++ b/packages/SystemUI/tests/src/com/android/keyguard/KeyguardClockAccessibilityDelegateTest.java
@@ -0,0 +1,91 @@
+/*
+ * Copyright (C) 2017 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.keyguard;
+
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+
+import android.content.Context;
+import android.support.test.InstrumentationRegistry;
+import android.text.TextUtils;
+import android.view.accessibility.AccessibilityEvent;
+import android.view.accessibility.AccessibilityNodeInfo;
+import android.widget.TextView;
+
+import org.junit.Before;
+import org.junit.Test;
+
+import java.util.List;
+
+public class KeyguardClockAccessibilityDelegateTest {
+
+    private Context mContext;
+    private TextView mView;
+
+    @Before
+    public void setUp() throws Exception {
+        mContext = InstrumentationRegistry.getContext();
+        mView = new TextView(mContext);
+        mView.setText(R.string.keyguard_widget_12_hours_format);
+        mView.setContentDescription(mContext.getString(R.string.keyguard_widget_12_hours_format));
+        mView.setAccessibilityDelegate(new KeyguardClockAccessibilityDelegate(mContext));
+    }
+
+    @Test
+    public void onInitializeAccessibilityEvent_producesNonEmptyAsciiContentDesc() throws Exception {
+        AccessibilityEvent ev = AccessibilityEvent.obtain();
+        mView.onInitializeAccessibilityEvent(ev);
+
+        assertFalse(TextUtils.isEmpty(ev.getContentDescription()));
+        assertTrue(isAscii(ev.getContentDescription()));
+    }
+
+    @Test
+    public void onPopulateAccessibilityEvent_producesNonEmptyAsciiText() throws Exception {
+        AccessibilityEvent ev = AccessibilityEvent.obtain();
+        mView.onPopulateAccessibilityEvent(ev);
+
+        assertFalse(isEmpty(ev.getText()));
+        assertTrue(isAscii(ev.getText()));
+    }
+
+    @Test
+    public void onInitializeAccessibilityNodeInfo_producesNonEmptyAsciiText() throws Exception {
+        AccessibilityNodeInfo info = AccessibilityNodeInfo.obtain();
+        // Usually done in View.onInitializeAccessibilityNodeInfoInternal, but only when attached.
+        info.setContentDescription(mView.getContentDescription());
+        mView.onInitializeAccessibilityNodeInfo(info);
+
+        assertFalse(TextUtils.isEmpty(info.getText()));
+        assertTrue(isAscii(info.getText()));
+
+        assertFalse(TextUtils.isEmpty(info.getContentDescription()));
+        assertTrue(isAscii(info.getContentDescription()));
+    }
+
+    private boolean isAscii(CharSequence text) {
+        return text.chars().allMatch((i) -> i < 128);
+    }
+
+    private boolean isAscii(List<CharSequence> texts) {
+        return texts.stream().allMatch(this::isAscii);
+    }
+
+    private boolean isEmpty(List<CharSequence> texts) {
+        return texts.stream().allMatch(TextUtils::isEmpty);
+    }
+}
\ No newline at end of file
diff --git a/packages/SystemUI/tests/src/com/android/systemui/ExpandHelperTest.java b/packages/SystemUI/tests/src/com/android/systemui/ExpandHelperTest.java
index 1b5d4a4..aa840989 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/ExpandHelperTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/ExpandHelperTest.java
@@ -43,12 +43,13 @@
     private ExpandHelper.Callback mCallback;
 
     @Before
-    @UiThreadTest
-    public void setUp() {
+    public void setUp() throws Exception {
         Context context = getContext();
         mRow = new NotificationTestHelper(context).createRow();
         mCallback = mock(ExpandHelper.Callback.class);
-        mExpandHelper = new ExpandHelper(context, mCallback, 10, 100);
+        InstrumentationRegistry.getInstrumentation().runOnMainSync(
+                () -> mExpandHelper = new ExpandHelper(context, mCallback, 10, 100));
+
     }
 
     @Test
diff --git a/packages/SystemUI/tests/src/com/android/systemui/doze/DozeConfigurationTest.java b/packages/SystemUI/tests/src/com/android/systemui/doze/DozeConfigurationTest.java
index 048936b..bbe324d 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/doze/DozeConfigurationTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/doze/DozeConfigurationTest.java
@@ -47,9 +47,8 @@
             return;
         }
 
-        mContext.getSettingsProvider().acquireOverridesBuilder()
-                .addSetting("secure", Settings.Secure.DOZE_ALWAYS_ON, null)
-                .build();
+        Settings.Secure.putString(mContext.getContentResolver(), Settings.Secure.DOZE_ALWAYS_ON,
+                null);
 
         assertFalse(mDozeConfig.alwaysOnEnabled(UserHandle.USER_CURRENT));
     }
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/ExpandableNotificationRowTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/ExpandableNotificationRowTest.java
index 3db2440..5cd092b 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/ExpandableNotificationRowTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/ExpandableNotificationRowTest.java
@@ -39,8 +39,7 @@
     private NotificationTestHelper mNotificationTestHelper;
 
     @Before
-    @UiThreadTest
-    public void setUp() {
+    public void setUp() throws Exception {
         mContext = InstrumentationRegistry.getTargetContext();
         mNotificationTestHelper = new NotificationTestHelper(mContext);
         mGroup = mNotificationTestHelper.createGroup();
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/NotificationTestHelper.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/NotificationTestHelper.java
index c91b269..cb238dd 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/NotificationTestHelper.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/NotificationTestHelper.java
@@ -17,15 +17,18 @@
 package com.android.systemui.statusbar;
 
 import android.app.ActivityManager;
+import android.app.Instrumentation;
 import android.app.Notification;
 import android.content.Context;
 import android.os.UserHandle;
 import android.service.notification.StatusBarNotification;
+import android.support.test.InstrumentationRegistry;
 import android.view.LayoutInflater;
 import android.widget.RemoteViews;
 
 import com.android.systemui.R;
 import com.android.systemui.statusbar.notification.InflationException;
+import com.android.systemui.statusbar.notification.NotificationInflaterTest;
 import com.android.systemui.statusbar.phone.NotificationGroupManager;
 
 /**
@@ -34,14 +37,18 @@
 public class NotificationTestHelper {
 
     private final Context mContext;
+    private final Instrumentation mInstrumentation;
     private int mId;
     private final NotificationGroupManager mGroupManager = new NotificationGroupManager();
+    private ExpandableNotificationRow mRow;
+    private InflationException mException;
 
     public NotificationTestHelper(Context context) {
         mContext = context;
+        mInstrumentation = InstrumentationRegistry.getInstrumentation();
     }
 
-    public ExpandableNotificationRow createRow() {
+    public ExpandableNotificationRow createRow() throws Exception {
         Notification publicVersion = new Notification.Builder(mContext).setSmallIcon(
                 R.drawable.ic_person)
                 .setCustomContentView(new RemoteViews(mContext.getPackageName(),
@@ -56,12 +63,15 @@
         return createRow(notification);
     }
 
-    public ExpandableNotificationRow createRow(Notification notification) {
+    public ExpandableNotificationRow createRow(Notification notification) throws Exception {
         LayoutInflater inflater = (LayoutInflater) mContext.getSystemService(
                 mContext.LAYOUT_INFLATER_SERVICE);
-        ExpandableNotificationRow row = (ExpandableNotificationRow) inflater.inflate(
-                R.layout.status_bar_notification_row,
-                null, false);
+        mInstrumentation.runOnMainSync(() -> {
+            mRow = (ExpandableNotificationRow) inflater.inflate(
+                    R.layout.status_bar_notification_row,
+                    null, false);
+        });
+        ExpandableNotificationRow row = mRow;
         row.setGroupManager(mGroupManager);
         UserHandle mUser = UserHandle.of(ActivityManager.getCurrentUser());
         StatusBarNotification sbn = new StatusBarNotification("com.android.systemui",
@@ -69,16 +79,13 @@
                 2000, notification, mUser, null, System.currentTimeMillis());
         NotificationData.Entry entry = new NotificationData.Entry(sbn);
         entry.row = row;
-        try {
-            entry.createIcons(mContext, sbn);
-            row.updateNotification(entry);
-        } catch (InflationException e) {
-            throw new RuntimeException(e.getMessage());
-        }
+        entry.createIcons(mContext, sbn);
+        NotificationInflaterTest.runThenWaitForInflation(() -> row.updateNotification(entry),
+                row.getNotificationInflater());
         return row;
     }
 
-    public ExpandableNotificationRow createGroup() {
+    public ExpandableNotificationRow createGroup() throws Exception {
         ExpandableNotificationRow row = createRow();
         row.addChildNotification(createRow());
         row.addChildNotification(createRow());
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/NotificationInflaterTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/NotificationInflaterTest.java
new file mode 100644
index 0000000..fbb25e5
--- /dev/null
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/NotificationInflaterTest.java
@@ -0,0 +1,176 @@
+/*
+ * Copyright (C) 2017 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.systemui.statusbar.notification;
+
+import static com.android.systemui.statusbar.notification.NotificationInflater.FLAG_REINFLATE_ALL;
+
+import static org.mockito.Mockito.spy;
+import static org.mockito.Mockito.times;
+import static org.mockito.Mockito.verify;
+
+import android.app.Notification;
+import android.content.Context;
+import android.service.notification.StatusBarNotification;
+import android.support.test.InstrumentationRegistry;
+import android.support.test.filters.SmallTest;
+import android.support.test.runner.AndroidJUnit4;
+import android.widget.RemoteViews;
+
+import com.android.systemui.R;
+import com.android.systemui.statusbar.ExpandableNotificationRow;
+import com.android.systemui.statusbar.NotificationData;
+import com.android.systemui.statusbar.NotificationTestHelper;
+
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+import java.util.concurrent.CountDownLatch;
+import java.util.function.Function;
+
+@SmallTest
+@RunWith(AndroidJUnit4.class)
+public class NotificationInflaterTest {
+
+    private Context mContext;
+    private NotificationInflater mNotificationInflater;
+    private Notification.Builder mBuilder;
+    private ExpandableNotificationRow mRow;
+
+    @Before
+    public void setUp() throws Exception {
+        mContext = InstrumentationRegistry.getTargetContext();
+        mBuilder = new Notification.Builder(mContext).setSmallIcon(
+                R.drawable.ic_person)
+                .setContentTitle("Title")
+                .setContentText("Text")
+                .setStyle(new Notification.BigTextStyle().bigText("big text"));
+        ExpandableNotificationRow row = new NotificationTestHelper(mContext).createRow(
+                mBuilder.build());
+        mRow = spy(row);
+        mNotificationInflater = new NotificationInflater(mRow);
+        mNotificationInflater.setInflationCallback(new NotificationInflater.InflationCallback() {
+            @Override
+            public void handleInflationException(StatusBarNotification notification,
+                    InflationException e) {
+            }
+
+            @Override
+            public void onAsyncInflationFinished(NotificationData.Entry entry) {
+            }
+        });
+    }
+
+    @Test
+    public void testIncreasedHeadsUpBeingUsed() {
+        mNotificationInflater.setUsesIncreasedHeadsUpHeight(true);
+        Notification.Builder builder = spy(mBuilder);
+        mNotificationInflater.inflateNotificationViews(FLAG_REINFLATE_ALL, builder, mContext);
+        verify(builder).createHeadsUpContentView(true);
+    }
+
+    @Test
+    public void testIncreasedHeightBeingUsed() {
+        mNotificationInflater.setUsesIncreasedHeight(true);
+        Notification.Builder builder = spy(mBuilder);
+        mNotificationInflater.inflateNotificationViews(FLAG_REINFLATE_ALL, builder, mContext);
+        verify(builder).createContentView(true);
+    }
+
+    @Test
+    public void testInflationCallsUpdated() throws Exception {
+        runThenWaitForInflation(() -> mNotificationInflater.inflateNotificationViews(),
+                mNotificationInflater);
+        verify(mRow).onNotificationUpdated();
+    }
+
+    @Test
+    public void testInflationCallsOnlyRightMethod() throws Exception {
+        mRow.getPrivateLayout().removeAllViews();
+        mRow.getEntry().cachedBigContentView = null;
+        runThenWaitForInflation(() -> mNotificationInflater.inflateNotificationViews(
+                NotificationInflater.FLAG_REINFLATE_EXPANDED_VIEW), mNotificationInflater);
+        Assert.assertTrue(mRow.getPrivateLayout().getChildCount() == 1);
+        Assert.assertTrue(mRow.getPrivateLayout().getChildAt(0)
+                == mRow.getPrivateLayout().getExpandedChild());
+        verify(mRow).onNotificationUpdated();
+    }
+
+    @Test
+    public void testInflationThrowsErrorDoesntCallUpdated() throws Exception {
+        mRow.getPrivateLayout().removeAllViews();
+        mRow.getStatusBarNotification().getNotification().contentView
+                = new RemoteViews(mContext.getPackageName(), R.layout.status_bar);
+        runThenWaitForInflation(() -> mNotificationInflater.inflateNotificationViews(),
+                true /* expectingException */, mNotificationInflater);
+        Assert.assertTrue(mRow.getPrivateLayout().getChildCount() == 0);
+        verify(mRow, times(0)).onNotificationUpdated();
+    }
+
+    @Test
+    public void testAsyncTaskRemoved() throws Exception {
+        mRow.getEntry().abortInflation();
+        runThenWaitForInflation(() -> mNotificationInflater.inflateNotificationViews(),
+                mNotificationInflater);
+        Assert.assertTrue(mRow.getEntry().getRunningTasks().size() == 0);
+    }
+
+    public static void runThenWaitForInflation(Runnable block,
+            NotificationInflater inflater) throws Exception {
+        runThenWaitForInflation(block, false /* expectingException */, inflater);
+    }
+
+    private static void runThenWaitForInflation(Runnable block, boolean expectingException,
+            NotificationInflater inflater) throws Exception {
+        com.android.systemui.util.Assert.isNotMainThread();
+        CountDownLatch countDownLatch = new CountDownLatch(1);
+        final ExceptionHolder exceptionHolder = new ExceptionHolder();
+        inflater.setInflationCallback(new NotificationInflater.InflationCallback() {
+            @Override
+            public void handleInflationException(StatusBarNotification notification,
+                    InflationException e) {
+                if (!expectingException) {
+                    exceptionHolder.setException(e);
+                }
+                countDownLatch.countDown();
+            }
+
+            @Override
+            public void onAsyncInflationFinished(NotificationData.Entry entry) {
+                if (expectingException) {
+                    exceptionHolder.setException(new RuntimeException(
+                            "Inflation finished even though there should be an error"));
+                }
+                countDownLatch.countDown();
+            }
+        });
+        block.run();
+        countDownLatch.await(5, java.util.concurrent.TimeUnit.SECONDS);
+        if (exceptionHolder.mException != null) {
+            throw exceptionHolder.mException;
+        }
+    }
+
+    private static class ExceptionHolder {
+        private Exception mException;
+
+        public void setException(Exception exception) {
+            mException = exception;
+        }
+    }
+}
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/NotificationinflaterTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/NotificationinflaterTest.java
deleted file mode 100644
index 0ec9c10..0000000
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/NotificationinflaterTest.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- * Copyright (C) 2017 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.systemui.statusbar.notification;
-
-import static com.android.systemui.statusbar.notification.NotificationInflater.FLAG_REINFLATE_ALL;
-
-import static org.mockito.Mockito.spy;
-import static org.mockito.Mockito.verify;
-
-import android.app.Notification;
-import android.content.Context;
-import android.support.test.InstrumentationRegistry;
-import android.support.test.annotation.UiThreadTest;
-import android.support.test.filters.SmallTest;
-import android.support.test.runner.AndroidJUnit4;
-
-import com.android.systemui.R;
-import com.android.systemui.statusbar.ExpandableNotificationRow;
-import com.android.systemui.statusbar.NotificationTestHelper;
-
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-
-@SmallTest
-@RunWith(AndroidJUnit4.class)
-public class NotificationinflaterTest {
-
-    private Context mContext;
-    private NotificationInflater mNotificationInflater;
-    private Notification.Builder mBuilder;
-
-    @Before
-    @UiThreadTest
-    public void setUp() {
-        mContext = InstrumentationRegistry.getTargetContext();
-        mBuilder = new Notification.Builder(mContext).setSmallIcon(
-                R.drawable.ic_person)
-                .setContentTitle("Title")
-                .setContentText("Text");
-        ExpandableNotificationRow row = new NotificationTestHelper(mContext).createRow(
-                mBuilder.build());
-        mNotificationInflater = new NotificationInflater(row);
-    }
-
-    @Test
-    public void testIncreasedHeadsUpBeingUsed() {
-        mNotificationInflater.setUsesIncreasedHeadsUpHeight(true);
-        Notification.Builder builder = spy(mBuilder);
-        mNotificationInflater.inflateNotificationViews(FLAG_REINFLATE_ALL, builder, mContext);
-        verify(builder).createHeadsUpContentView(true);
-    }
-
-    @Test
-    public void testIncreasedHeightBeingUsed() {
-        mNotificationInflater.setUsesIncreasedHeight(true);
-        Notification.Builder builder = spy(mBuilder);
-        mNotificationInflater.inflateNotificationViews(FLAG_REINFLATE_ALL, builder, mContext);
-        verify(builder).createContentView(true);
-    }
-}
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/CallbackHandlerTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/CallbackHandlerTest.java
index f6c75a8..3ed1681 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/CallbackHandlerTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/CallbackHandlerTest.java
@@ -114,26 +114,33 @@
         boolean wide = true;
         int subId = 5;
         boolean roaming = true;
-        boolean isEmergency = true;
-        mHandler.setMobileDataIndicators(status, type, in, out, typeDescription,
-                subId, roaming, isEmergency);
+        mHandler.setMobileDataIndicators(status, qs, type, qsType, in, out, typeDescription,
+                description, wide, subId, roaming);
         waitForCallbacks();
 
         ArgumentCaptor<IconState> statusArg = ArgumentCaptor.forClass(IconState.class);
+        ArgumentCaptor<IconState> qsArg = ArgumentCaptor.forClass(IconState.class);
         ArgumentCaptor<Integer> typeIconArg = ArgumentCaptor.forClass(Integer.class);
+        ArgumentCaptor<Integer> qsTypeIconArg = ArgumentCaptor.forClass(Integer.class);
         ArgumentCaptor<Boolean> inArg = ArgumentCaptor.forClass(Boolean.class);
         ArgumentCaptor<Boolean> outArg = ArgumentCaptor.forClass(Boolean.class);
         ArgumentCaptor<String> typeContentArg = ArgumentCaptor.forClass(String.class);
+        ArgumentCaptor<String> descArg = ArgumentCaptor.forClass(String.class);
+        ArgumentCaptor<Boolean> wideArg = ArgumentCaptor.forClass(Boolean.class);
         ArgumentCaptor<Integer> subIdArg = ArgumentCaptor.forClass(Integer.class);
         Mockito.verify(mSignalCallback).setMobileDataIndicators(statusArg.capture(),
-                typeIconArg.capture(), inArg.capture(),
-                outArg.capture(), typeContentArg.capture(),
-                subIdArg.capture(), eq(roaming), eq(isEmergency));
+                qsArg.capture(), typeIconArg.capture(), qsTypeIconArg.capture(), inArg.capture(),
+                outArg.capture(), typeContentArg.capture(), descArg.capture(), wideArg.capture(),
+                subIdArg.capture(), eq(roaming));
         assertEquals(status, statusArg.getValue());
+        assertEquals(qs, qsArg.getValue());
         assertEquals(type, (int) typeIconArg.getValue());
+        assertEquals(qsType, (int) qsTypeIconArg.getValue());
         assertEquals(in, (boolean) inArg.getValue());
         assertEquals(out, (boolean) outArg.getValue());
         assertEquals(typeDescription, typeContentArg.getValue());
+        assertEquals(description, descArg.getValue());
+        assertEquals(wide, (boolean) wideArg.getValue());
         assertEquals(subId, (int) subIdArg.getValue());
     }
 
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/NetworkControllerBaseTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/NetworkControllerBaseTest.java
index b39171e..505e1d8 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/NetworkControllerBaseTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/NetworkControllerBaseTest.java
@@ -29,7 +29,6 @@
 import android.telephony.SubscriptionManager;
 import android.telephony.TelephonyManager;
 import android.util.Log;
-
 import com.android.internal.telephony.cdma.EriInfo;
 import com.android.settingslib.net.DataUsageController;
 import com.android.systemui.statusbar.phone.SignalDrawable;
@@ -46,6 +45,8 @@
 import org.junit.runner.Description;
 import org.mockito.ArgumentCaptor;
 import org.mockito.Mockito;
+import org.mockito.invocation.InvocationOnMock;
+import org.mockito.stubbing.Answer;
 
 import java.io.PrintWriter;
 import java.io.StringWriter;
@@ -69,7 +70,7 @@
     protected static final int DEFAULT_SIGNAL_STRENGTH = DEFAULT_LEVEL;
     protected static final int DEFAULT_QS_SIGNAL_STRENGTH = DEFAULT_LEVEL;
     protected static final int DEFAULT_ICON = TelephonyIcons.ICON_3G;
-    protected static final int DEFAULT_QS_ICON = DEFAULT_ICON;
+    protected static final int DEFAULT_QS_ICON = TelephonyIcons.QS_DATA_3G;
 
     protected NetworkControllerImpl mNetworkController;
     protected MobileSignalController mMobileSignalController;
@@ -116,7 +117,7 @@
 
         when(mMockCm.isNetworkSupported(ConnectivityManager.TYPE_MOBILE)).thenReturn(true);
         when(mMockCm.getDefaultNetworkCapabilitiesForUser(0)).thenReturn(
-                new NetworkCapabilities[]{mNetCapabilities});
+                new NetworkCapabilities[] { mNetCapabilities });
 
         mSignalStrength = mock(SignalStrength.class);
         mServiceState = mock(ServiceState.class);
@@ -174,17 +175,17 @@
     }
 
     protected NetworkControllerImpl setUpNoMobileData() {
-        when(mMockCm.isNetworkSupported(ConnectivityManager.TYPE_MOBILE)).thenReturn(false);
-        NetworkControllerImpl networkControllerNoMobile
-                = new NetworkControllerImpl(mContext, mMockCm, mMockNetworkScoreManager, mMockTm,
-                mMockWm, mMockSm, mConfig, mContext.getMainLooper(), mCallbackHandler,
-                mock(AccessPointControllerImpl.class),
-                mock(DataUsageController.class), mMockSubDefaults,
-                mock(DeviceProvisionedController.class));
+      when(mMockCm.isNetworkSupported(ConnectivityManager.TYPE_MOBILE)).thenReturn(false);
+      NetworkControllerImpl networkControllerNoMobile
+              = new NetworkControllerImpl(mContext, mMockCm, mMockNetworkScoreManager, mMockTm,
+                        mMockWm, mMockSm, mConfig, mContext.getMainLooper(), mCallbackHandler,
+                        mock(AccessPointControllerImpl.class),
+                        mock(DataUsageController.class), mMockSubDefaults,
+                        mock(DeviceProvisionedController.class));
 
-        setupNetworkController();
+      setupNetworkController();
 
-        return networkControllerNoMobile;
+      return networkControllerNoMobile;
 
     }
 
@@ -307,10 +308,11 @@
         ArgumentCaptor<Boolean> dataOutArg = ArgumentCaptor.forClass(Boolean.class);
 
         Mockito.verify(mCallbackHandler, Mockito.atLeastOnce()).setMobileDataIndicators(
-                iconArg.capture(),
-                typeIconArg.capture(),
-                dataInArg.capture(), dataOutArg.capture(),
-                anyString(), anyInt(), anyBoolean(), anyBoolean());
+                    any(),
+                    iconArg.capture(),
+                    anyInt(),
+                    typeIconArg.capture(), dataInArg.capture(), dataOutArg.capture(),
+                    anyString(), anyString(), anyBoolean(), anyInt(), anyBoolean());
         IconState iconState = iconArg.getValue();
         int state = SignalDrawable.getState(icon, SignalStrength.NUM_SIGNAL_STRENGTH_BINS,
                 false);
@@ -333,16 +335,17 @@
     }
 
     protected void verifyLastMobileDataIndicators(boolean visible, int icon, int typeIcon,
-            boolean roaming, boolean inet) {
+        boolean roaming, boolean inet) {
         ArgumentCaptor<IconState> iconArg = ArgumentCaptor.forClass(IconState.class);
         ArgumentCaptor<Integer> typeIconArg = ArgumentCaptor.forClass(Integer.class);
 
         // TODO: Verify all fields.
         Mockito.verify(mCallbackHandler, Mockito.atLeastOnce()).setMobileDataIndicators(
                 iconArg.capture(),
+                any(),
                 typeIconArg.capture(),
-                anyBoolean(), anyBoolean(), anyString(),
-                anyInt(), eq(roaming), anyBoolean());
+                anyInt(), anyBoolean(), anyBoolean(), anyString(), anyString(), anyBoolean(),
+                anyInt(), eq(roaming));
         IconState iconState = iconArg.getValue();
 
         int state = icon == -1 ? 0
@@ -353,18 +356,22 @@
     }
 
     protected void verifyLastMobileDataIndicators(boolean visible, int icon, int typeIcon,
-            boolean qsVisible, boolean dataIn, boolean dataOut) {
+            boolean qsVisible, int qsIcon, int qsTypeIcon, boolean dataIn, boolean dataOut) {
         ArgumentCaptor<IconState> iconArg = ArgumentCaptor.forClass(IconState.class);
         ArgumentCaptor<Integer> typeIconArg = ArgumentCaptor.forClass(Integer.class);
+        ArgumentCaptor<IconState> qsIconArg = ArgumentCaptor.forClass(IconState.class);
+        ArgumentCaptor<Integer> qsTypeIconArg = ArgumentCaptor.forClass(Integer.class);
         ArgumentCaptor<Boolean> dataInArg = ArgumentCaptor.forClass(Boolean.class);
         ArgumentCaptor<Boolean> dataOutArg = ArgumentCaptor.forClass(Boolean.class);
 
         Mockito.verify(mCallbackHandler, Mockito.atLeastOnce()).setMobileDataIndicators(
                 iconArg.capture(),
+                qsIconArg.capture(),
                 typeIconArg.capture(),
+                qsTypeIconArg.capture(),
                 dataInArg.capture(),
                 dataOutArg.capture(),
-                anyString(), anyInt(), anyBoolean(), anyBoolean());
+                anyString(), anyString(), anyBoolean(), anyInt(), anyBoolean());
 
         IconState iconState = iconArg.getValue();
 
@@ -374,15 +381,17 @@
         assertEquals("Signal icon in status bar", state, iconState.icon);
         assertEquals("Visibility in status bar", visible, iconState.visible);
 
+        iconState = qsIconArg.getValue();
         assertEquals("Visibility in quick settings", qsVisible, iconState.visible);
         assertEquals("Signal icon in quick settings", state, iconState.icon);
+        assertEquals("Data icon in quick settings", qsTypeIcon, (int) qsTypeIconArg.getValue());
         assertEquals("Data direction in in quick settings", dataIn,
                 (boolean) dataInArg.getValue());
         assertEquals("Data direction out in quick settings", dataOut,
                 (boolean) dataOutArg.getValue());
     }
 
-    protected void assertNetworkNameEquals(String expected) {
-        assertEquals("Network name", expected, mMobileSignalController.getState().networkName);
-    }
+   protected void assertNetworkNameEquals(String expected) {
+       assertEquals("Network name", expected, mMobileSignalController.getState().networkName);
+   }
 }
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/NetworkControllerDataTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/NetworkControllerDataTest.java
index 6470c11..dfe00f9 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/NetworkControllerDataTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/NetworkControllerDataTest.java
@@ -1,9 +1,5 @@
 package com.android.systemui.statusbar.policy;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotEquals;
-import static org.mockito.ArgumentMatchers.any;
-import static org.mockito.ArgumentMatchers.anyBoolean;
 import static org.mockito.Matchers.anyInt;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.when;
@@ -15,14 +11,10 @@
 import android.test.suitebuilder.annotation.SmallTest;
 
 import com.android.settingslib.net.DataUsageController;
-import com.android.systemui.statusbar.phone.SignalDrawable;
-import com.android.systemui.statusbar.policy.NetworkController.IconState;
 
 import org.junit.Ignore;
 import org.junit.Test;
 import org.junit.runner.RunWith;
-import org.mockito.ArgumentCaptor;
-import org.mockito.Mockito;
 
 @SmallTest
 @RunWith(AndroidJUnit4.class)
@@ -124,11 +116,8 @@
         updateDataConnectionState(TelephonyManager.DATA_DISCONNECTED, 0);
         setConnectivity(NetworkCapabilities.TRANSPORT_CELLULAR, false, false);
 
-        ArgumentCaptor<IconState> iconArg = ArgumentCaptor.forClass(IconState.class);
-        Mockito.verify(mCallbackHandler, Mockito.atLeastOnce()).setMobileDataIndicators(
-                iconArg.capture(), anyInt(), anyBoolean(), anyBoolean(), any(), anyInt(),
-                anyBoolean(), anyBoolean());
-        assertEquals(SignalDrawable.STATE_CUT, SignalDrawable.getState(iconArg.getValue().icon));
+        verifyDataIndicators(TelephonyIcons.ICON_DATA_DISABLED,
+                TelephonyIcons.QS_ICON_DATA_DISABLED);
     }
 
     @Test
@@ -140,14 +129,9 @@
         setConnectivity(NetworkCapabilities.TRANSPORT_CELLULAR, false, false);
         when(mMockProvisionController.isUserSetup(anyInt())).thenReturn(false);
         mUserCallback.onUserSetupChanged();
-        waitForIdleSync();
 
         // Don't show the X until the device is setup.
-        ArgumentCaptor<IconState> iconArg = ArgumentCaptor.forClass(IconState.class);
-        Mockito.verify(mCallbackHandler, Mockito.atLeastOnce()).setMobileDataIndicators(
-                iconArg.capture(), anyInt(), anyBoolean(), anyBoolean(), any(), anyInt(),
-                anyBoolean(), anyBoolean());
-        assertNotEquals(SignalDrawable.STATE_CUT, SignalDrawable.getState(iconArg.getValue().icon));
+        verifyDataIndicators(0, 0);
     }
 
     @Test
@@ -197,12 +181,12 @@
         updateDataActivity(direction);
 
         verifyLastMobileDataIndicators(true, DEFAULT_SIGNAL_STRENGTH, DEFAULT_ICON, true,
-                in, out);
+                DEFAULT_QS_SIGNAL_STRENGTH, DEFAULT_QS_ICON, in, out);
     }
 
     private void verifyDataIndicators(int dataIcon, int qsDataIcon) {
         verifyLastMobileDataIndicators(true, DEFAULT_SIGNAL_STRENGTH, dataIcon,
-                true, false,
+                true, DEFAULT_QS_SIGNAL_STRENGTH, qsDataIcon, false,
                 false);
     }
 
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/NetworkControllerSignalTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/NetworkControllerSignalTest.java
index e542c37..1627925 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/NetworkControllerSignalTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/NetworkControllerSignalTest.java
@@ -214,7 +214,7 @@
 
             verifyLastQsMobileDataIndicators(true,
                     testStrength,
-                    TelephonyIcons.ICON_1X, false, false);
+                    TelephonyIcons.QS_DATA_1X, false, false);
         }
     }
 
@@ -434,7 +434,7 @@
 
       verifyLastQsMobileDataIndicators(true /* visible */,
               DEFAULT_LEVEL /* icon */,
-              DEFAULT_ICON /* typeIcon */,
+              DEFAULT_QS_ICON /* typeIcon */,
               false /* dataIn */,
               true /* dataOut */);
     }
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/NetworkControllerWifiTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/NetworkControllerWifiTest.java
index edfa326..dbaa2c5 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/NetworkControllerWifiTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/NetworkControllerWifiTest.java
@@ -18,7 +18,6 @@
 
 import com.android.settingslib.Utils;
 import com.android.systemui.statusbar.policy.NetworkController.IconState;
-import android.testing.TestableSettings.SettingOverrider;
 
 import org.junit.Test;
 import org.junit.runner.RunWith;
@@ -62,7 +61,7 @@
     public void testWifiIcon() {
         String testSsid = "Test SSID";
         setWifiEnabled(true);
-        verifyLastWifiIcon(true, WifiIcons.WIFI_DISCONNECTED);
+        verifyLastWifiIcon(false, WifiIcons.WIFI_NO_NETWORK);
 
         setWifiState(true, testSsid);
         verifyLastWifiIcon(true, WifiIcons.WIFI_SIGNAL_STRENGTH[0][0]);
@@ -92,11 +91,10 @@
                         attr);
 
         // Must set the Settings value before instantiating the NetworkControllerImpl due to bugs in
-        // TestableSettings.
-        SettingOverrider settingsOverrider =
-                mContext.getSettingsProvider().acquireOverridesBuilder()
-                        .addSetting("global", Settings.Global.NETWORK_SCORING_UI_ENABLED, "1")
-                        .build();
+        // TestableSettingsProvider.
+        Settings.Global.putString(mContext.getContentResolver(),
+                Settings.Global.NETWORK_SCORING_UI_ENABLED,
+                "1");
         super.setUp(); // re-instantiate NetworkControllImpl now that setting has been updated
         setupNetworkScoreManager();
 
@@ -131,8 +129,6 @@
         assertEquals("SD Badge is set",
                 Utils.getWifiBadgeResource(NetworkBadging.BADGING_SD),
                 iconState.iconOverlay);
-
-        settingsOverrider.release();
     }
 
     private void setupNetworkScoreManager() {
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/stack/NotificationChildrenContainerTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/stack/NotificationChildrenContainerTest.java
index dbe0de4..f051f30 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/stack/NotificationChildrenContainerTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/stack/NotificationChildrenContainerTest.java
@@ -42,8 +42,7 @@
     private NotificationTestHelper mNotificationTestHelper;
 
     @Before
-    @UiThreadTest
-    public void setUp() {
+    public void setUp() throws Exception {
         mContext = InstrumentationRegistry.getTargetContext();
         mNotificationTestHelper = new NotificationTestHelper(mContext);
         mGroup = mNotificationTestHelper.createGroup();
diff --git a/proto/src/metrics_constants.proto b/proto/src/metrics_constants.proto
index 93a5557..cc6e435 100644
--- a/proto/src/metrics_constants.proto
+++ b/proto/src/metrics_constants.proto
@@ -3636,7 +3636,7 @@
     // OS: N
     ACTION_GET_CONTACT = 864;
 
-    // This values should never appear in log outputs - it is reserved for
+    // This value should never appear in log outputs - it is reserved for
     // internal platform metrics use.
     RESERVED_FOR_LOGBUILDER_PID = 865;
 
@@ -3938,6 +3938,20 @@
     // OS: O
     ENTERPRISE_PRIVACY_DEFAULT_APPS = 940;
 
+    // OPEN: Settings > Notifications > An app > A channel > Importance
+    // CATEGORY: SETTINGS
+    // OS: O
+    NOTIFICATION_CHANNEL_IMPORTANCE = 941;
+
+    // OPEN: Settings > Notifications > An app > A channel > On the lock screen
+    // CATEGORY: SETTINGS
+    // OS: O
+    NOTIFICATION_CHANNEL_LOCK_SCREEN_VIS = 942;
+
+    // This value should never appear in log outputs - it is reserved for
+    // internal platform metrics use.
+    RESERVED_FOR_LOGBUILDER_UID = 943;
+
     // ---- End O Constants, all O constants go above this line ----
 
     // Add new aosp constants above this line.
diff --git a/services/accessibility/java/com/android/server/accessibility/AccessibilityManagerService.java b/services/accessibility/java/com/android/server/accessibility/AccessibilityManagerService.java
index b6dfdd1..fa78f10 100644
--- a/services/accessibility/java/com/android/server/accessibility/AccessibilityManagerService.java
+++ b/services/accessibility/java/com/android/server/accessibility/AccessibilityManagerService.java
@@ -2808,7 +2808,7 @@
             mRetrieveInteractiveWindows = (info.flags
                     & AccessibilityServiceInfo.FLAG_RETRIEVE_INTERACTIVE_WINDOWS) != 0;
             mCaptureFingerprintGestures = (info.flags
-                    & AccessibilityServiceInfo.FLAG_CAPTURE_FINGERPRINT_GESTURES) != 0;
+                    & AccessibilityServiceInfo.FLAG_REQUEST_FINGERPRINT_GESTURES) != 0;
             mRequestAccessibilityButton = (info.flags
                     & AccessibilityServiceInfo.FLAG_REQUEST_ACCESSIBILITY_BUTTON) != 0;
         }
@@ -4721,7 +4721,7 @@
 
         public boolean canCaptureFingerprintGestures(Service service) {
             return (service.mAccessibilityServiceInfo.getCapabilities()
-                    & AccessibilityServiceInfo.CAPABILITY_CAN_CAPTURE_FINGERPRINT_GESTURES) != 0;
+                    & AccessibilityServiceInfo.CAPABILITY_CAN_REQUEST_FINGERPRINT_GESTURES) != 0;
         }
 
         private int resolveProfileParentLocked(int userId) {
diff --git a/services/autofill/java/com/android/server/autofill/AutofillManagerService.java b/services/autofill/java/com/android/server/autofill/AutofillManagerService.java
index f61edc5..2358ec5 100644
--- a/services/autofill/java/com/android/server/autofill/AutofillManagerService.java
+++ b/services/autofill/java/com/android/server/autofill/AutofillManagerService.java
@@ -19,14 +19,14 @@
 import static android.Manifest.permission.MANAGE_AUTO_FILL;
 import static android.content.Context.AUTOFILL_MANAGER_SERVICE;
 
-import static com.android.server.autofill.Helper.DEBUG;
-import static com.android.server.autofill.Helper.VERBOSE;
+import static com.android.server.autofill.Helper.sDebug;
+import static com.android.server.autofill.Helper.sVerbose;
 import static com.android.server.autofill.Helper.bundleToString;
 
 import android.annotation.NonNull;
 import android.annotation.Nullable;
 import android.app.ActivityManager;
-import android.app.ActivityManagerInternal;
+import android.app.ActivityThread;
 import android.content.BroadcastReceiver;
 import android.content.ComponentName;
 import android.content.ContentResolver;
@@ -39,6 +39,7 @@
 import android.graphics.Rect;
 import android.net.Uri;
 import android.os.Binder;
+import android.os.Build;
 import android.os.Bundle;
 import android.os.Handler;
 import android.os.IBinder;
@@ -50,13 +51,12 @@
 import android.os.UserManagerInternal;
 import android.provider.Settings;
 import android.service.autofill.FillEventHistory;
-import android.text.TextUtils;
 import android.util.LocalLog;
-import android.util.Log;
 import android.util.Slog;
 import android.util.SparseArray;
 import android.util.SparseBooleanArray;
 import android.view.autofill.AutofillId;
+import android.view.autofill.AutofillManager;
 import android.view.autofill.AutofillValue;
 import android.view.autofill.IAutoFillManager;
 import android.view.autofill.IAutoFillManagerClient;
@@ -118,10 +118,6 @@
         @Override
         public void onReceive(Context context, Intent intent) {
             if (Intent.ACTION_CLOSE_SYSTEM_DIALOGS.equals(intent.getAction())) {
-                final String reason = intent.getStringExtra("reason");
-                if (VERBOSE) {
-                    Slog.v(TAG, "close system dialogs: " + reason);
-                }
                 mUi.hideAll();
             }
         }
@@ -130,7 +126,11 @@
     public AutofillManagerService(Context context) {
         super(context);
         mContext = context;
-        mUi = new AutoFillUI(mContext);
+        mUi = new AutoFillUI(ActivityThread.currentActivityThread().getSystemUiContext());
+
+        final boolean debug = Build.IS_DEBUGGABLE;
+        Slog.i(TAG, "Setting debug to " + debug);
+        setDebugLocked(debug);
 
         final IntentFilter filter = new IntentFilter();
         filter.addAction(Intent.ACTION_CLOSE_SYSTEM_DIALOGS);
@@ -154,7 +154,7 @@
                 final boolean disabledBefore = mDisabledUsers.get(userId);
                 if (disabledBefore == disabledNow) {
                     // Nothing changed, do nothing.
-                    if (DEBUG) {
+                    if (sDebug) {
                         Slog.d(TAG, "Restriction not changed for user " + userId + ": "
                                 + bundleToString(newRestrictions));
                         return;
@@ -368,6 +368,42 @@
         }
     }
 
+    // Called by Shell command.
+    void setLogLevel(int level) {
+        Slog.i(TAG, "setLogLevel(): " + level);
+        boolean debug = false;
+        boolean verbose = false;
+        if (level == AutofillManager.FLAG_ADD_CLIENT_VERBOSE) {
+            debug = verbose = true;
+        } else if (level == AutofillManager.FLAG_ADD_CLIENT_DEBUG) {
+            debug = true;
+        }
+        synchronized (mLock) {
+            setDebugLocked(debug);
+            setVerboseLocked(verbose);
+        }
+    }
+
+    // Called by Shell command.
+    int getLogLevel() {
+        synchronized (mLock) {
+            if (sVerbose) return AutofillManager.FLAG_ADD_CLIENT_VERBOSE;
+            if (sDebug) return AutofillManager.FLAG_ADD_CLIENT_DEBUG;
+            return 0;
+        }
+    }
+
+    private void setDebugLocked(boolean debug) {
+        com.android.server.autofill.Helper.sDebug = debug;
+        android.view.autofill.Helper.sDebug = debug;
+    }
+
+
+    private void setVerboseLocked(boolean verbose) {
+        com.android.server.autofill.Helper.sVerbose = verbose;
+        android.view.autofill.Helper.sVerbose = verbose;
+    }
+
     /**
      * Removes a cached service for a given user.
      */
@@ -390,7 +426,7 @@
      * Updates a cached service for a given user.
      */
     private void updateCachedServiceLocked(int userId, boolean disabled) {
-        AutofillManagerServiceImpl service = peekServiceForUserLocked(userId);
+        AutofillManagerServiceImpl service = getServiceForUserLocked(userId);
         if (service != null) {
             service.updateLocked(disabled);
             if (!service.isEnabled()) {
@@ -399,24 +435,21 @@
         }
     }
 
-    private IBinder getTopActivityForUser() {
-        final List<IBinder> topActivities = LocalServices
-                .getService(ActivityManagerInternal.class).getTopVisibleActivities();
-        if (VERBOSE) {
-            Slog.v(TAG, "Top activities (" + topActivities.size() + "): " + topActivities);
-        }
-        if (topActivities.isEmpty()) {
-            Slog.w(TAG, "Could not get top activity");
-            return null;
-        }
-        return topActivities.get(0);
-    }
-
     final class AutoFillManagerServiceStub extends IAutoFillManager.Stub {
         @Override
-        public boolean addClient(IAutoFillManagerClient client, int userId) {
+        public int addClient(IAutoFillManagerClient client, int userId) {
             synchronized (mLock) {
-                return getServiceForUserLocked(userId).addClientLocked(client);
+                int flags = 0;
+                if (getServiceForUserLocked(userId).addClientLocked(client)) {
+                    flags |= AutofillManager.FLAG_ADD_CLIENT_ENABLED;
+                }
+                if (sDebug) {
+                    flags |= AutofillManager.FLAG_ADD_CLIENT_DEBUG;
+                }
+                if (sVerbose) {
+                    flags |= AutofillManager.FLAG_ADD_CLIENT_VERBOSE;
+                }
+                return flags;
             }
         }
 
@@ -509,12 +542,12 @@
 
         @Override
         public void updateSession(int sessionId, AutofillId id, Rect bounds,
-                AutofillValue value, int flags, int userId) {
+                AutofillValue value, int action, int flags, int userId) {
             synchronized (mLock) {
                 final AutofillManagerServiceImpl service = peekServiceForUserLocked(userId);
                 if (service != null) {
                     service.updateSessionLocked(sessionId, getCallingUid(), id, bounds, value,
-                            flags);
+                            action, flags);
                 }
             }
         }
@@ -568,24 +601,38 @@
         @Override
         public void dump(FileDescriptor fd, PrintWriter pw, String[] args) {
             if (!DumpUtils.checkDumpPermission(mContext, TAG, pw)) return;
-            synchronized (mLock) {
-                pw.print("Disabled users: "); pw.println(mDisabledUsers);
-                final int size = mServicesCache.size();
-                pw.print("Cached services: ");
-                if (size == 0) {
-                    pw.println("none");
-                } else {
-                    pw.println(size);
-                    for (int i = 0; i < size; i++) {
-                        pw.print("\nService at index "); pw.println(i);
-                        final AutofillManagerServiceImpl impl = mServicesCache.valueAt(i);
-                        impl.dumpLocked("  ", pw);
+
+            boolean oldDebug = sDebug;
+            boolean oldVerbose = sVerbose;
+            try {
+                synchronized (mLock) {
+                    oldDebug = sDebug;
+                    oldVerbose = sVerbose;
+                    setDebugLocked(true);
+                    setVerboseLocked(true);
+                    pw.print("Debug mode: "); pw.println(oldDebug);
+                    pw.print("Verbose mode: "); pw.println(oldVerbose);
+                    pw.print("Disabled users: "); pw.println(mDisabledUsers);
+                    final int size = mServicesCache.size();
+                    pw.print("Cached services: ");
+                    if (size == 0) {
+                        pw.println("none");
+                    } else {
+                        pw.println(size);
+                        for (int i = 0; i < size; i++) {
+                            pw.print("\nService at index "); pw.println(i);
+                            final AutofillManagerServiceImpl impl = mServicesCache.valueAt(i);
+                            impl.dumpLocked("  ", pw);
+                        }
                     }
+                    mUi.dump(pw);
                 }
-                mUi.dump(pw);
+                pw.println("Requests history:");
+                mRequestsHistory.reverseDump(fd, pw, args);
+            } finally {
+                setDebugLocked(oldDebug);
+                setVerboseLocked(oldVerbose);
             }
-            pw.println("Requests history:");
-            mRequestsHistory.reverseDump(fd, pw, args);
         }
 
         @Override
diff --git a/services/autofill/java/com/android/server/autofill/AutofillManagerServiceImpl.java b/services/autofill/java/com/android/server/autofill/AutofillManagerServiceImpl.java
index 44a296e..4507eae 100644
--- a/services/autofill/java/com/android/server/autofill/AutofillManagerServiceImpl.java
+++ b/services/autofill/java/com/android/server/autofill/AutofillManagerServiceImpl.java
@@ -16,11 +16,10 @@
 
 package com.android.server.autofill;
 
-import static android.view.autofill.AutofillManager.FLAG_START_SESSION;
+import static android.view.autofill.AutofillManager.ACTION_START_SESSION;
 import static android.view.autofill.AutofillManager.NO_SESSION;
 
-import static com.android.server.autofill.Helper.DEBUG;
-import static com.android.server.autofill.Helper.VERBOSE;
+import static com.android.server.autofill.Helper.sVerbose;
 
 import android.annotation.NonNull;
 import android.annotation.Nullable;
@@ -48,12 +47,9 @@
 import android.service.autofill.IAutoFillService;
 import android.text.TextUtils;
 import android.util.LocalLog;
-import android.util.Log;
-import android.util.PrintWriterPrinter;
 import android.util.Slog;
 import android.util.SparseArray;
 import android.view.autofill.AutofillId;
-import android.view.autofill.AutofillManager;
 import android.view.autofill.AutofillValue;
 import android.view.autofill.IAutoFillManagerClient;
 
@@ -271,14 +267,14 @@
         }
 
         final String historyItem =
-                "id=" + newSession.getId() + " uid=" + uid + " s=" + mInfo.getServiceInfo().packageName
+                "id=" + newSession.id + " uid=" + uid + " s=" + mInfo.getServiceInfo().packageName
                         + " u=" + mUserId + " i=" + autofillId + " b=" + virtualBounds + " hc=" +
                         hasCallback + " f=" + flags;
         mRequestsHistory.log(historyItem);
 
-        newSession.updateLocked(autofillId, virtualBounds, value, FLAG_START_SESSION);
+        newSession.updateLocked(autofillId, virtualBounds, value, ACTION_START_SESSION, flags);
 
-        return newSession.getId();
+        return newSession.id;
     }
 
     void finishSessionLocked(int sessionId, int uid) {
@@ -288,14 +284,15 @@
 
         final Session session = mSessions.get(sessionId);
         if (session == null || uid != session.uid) {
-            Slog.w(TAG, "finishSessionLocked(): no session for " + sessionId + "(" + uid + ")");
+            if (sVerbose) {
+                Slog.v(TAG, "finishSessionLocked(): no session for " + sessionId + "(" + uid + ")");
+            }
             return;
         }
 
         final boolean finished = session.showSaveLocked();
-        if (DEBUG) {
-            Log.d(TAG, "finishSessionLocked(): session finished on save? " + finished);
-        }
+        if (sVerbose) Slog.v(TAG, "finishSessionLocked(): session finished on save? " + finished);
+
         if (finished) {
             session.removeSelfLocked();
         }
@@ -342,7 +339,7 @@
         do {
             tries++;
             if (tries > MAX_SESSION_ID_CREATE_TRIES) {
-                Log.w(TAG, "Cannot create session in " + MAX_SESSION_ID_CREATE_TRIES + " tries");
+                Slog.w(TAG, "Cannot create session in " + MAX_SESSION_ID_CREATE_TRIES + " tries");
                 return null;
             }
 
@@ -350,9 +347,9 @@
         } while (sessionId == NO_SESSION || mSessions.indexOfKey(sessionId) >= 0);
 
         final Session newSession = new Session(this, mUi, mContext, mHandlerCaller, mUserId, mLock,
-                sessionId, uid, activityToken, windowToken, appCallbackToken, hasCallback, flags,
+                sessionId, uid, activityToken, windowToken, appCallbackToken, hasCallback,
                 mInfo.getServiceInfo().getComponentName(), packageName);
-        mSessions.put(newSession.getId(), newSession);
+        mSessions.put(newSession.id, newSession);
 
         return newSession;
     }
@@ -396,17 +393,17 @@
     }
 
     void updateSessionLocked(int sessionId, int uid, AutofillId autofillId, Rect virtualBounds,
-            AutofillValue value, int flags) {
+            AutofillValue value, int action, int flags) {
         final Session session = mSessions.get(sessionId);
         if (session == null || session.uid != uid) {
-            if (VERBOSE) {
+            if (sVerbose) {
                 Slog.v(TAG, "updateSessionLocked(): session gone for " + sessionId + "(" + uid
                         + ")");
             }
             return;
         }
 
-        session.updateLocked(autofillId, virtualBounds, value, flags);
+        session.updateLocked(autofillId, virtualBounds, value, action, flags);
     }
 
     void removeSessionLocked(int sessionId) {
@@ -426,9 +423,7 @@
     }
 
     void destroyLocked() {
-        if (VERBOSE) {
-            Slog.v(TAG, "destroyLocked()");
-        }
+        if (sVerbose) Slog.v(TAG, "destroyLocked()");
 
         final int numSessions = mSessions.size();
         for (int i = 0; i < numSessions; i++) {
@@ -519,12 +514,6 @@
             pw.println(mContext.getString(R.string.config_defaultAutofillService));
         pw.print(prefix); pw.print("Disabled: "); pw.println(mDisabled);
 
-        if (VERBOSE && mInfo != null) {
-            // ServiceInfo dump is too noisy and redundant (it can be obtained through other dumps)
-            pw.print(prefix); pw.println("ServiceInfo:");
-            mInfo.getServiceInfo().dump(new PrintWriterPrinter(pw), prefix + prefix);
-        }
-
         final int size = mSessions.size();
         if (size == 0) {
             pw.print(prefix); pw.println("No sessions");
diff --git a/services/autofill/java/com/android/server/autofill/AutofillManagerServiceShellCommand.java b/services/autofill/java/com/android/server/autofill/AutofillManagerServiceShellCommand.java
index 62226e3..1b9c86e 100644
--- a/services/autofill/java/com/android/server/autofill/AutofillManagerServiceShellCommand.java
+++ b/services/autofill/java/com/android/server/autofill/AutofillManagerServiceShellCommand.java
@@ -18,10 +18,10 @@
 
 import static com.android.server.autofill.AutofillManagerService.RECEIVER_BUNDLE_EXTRA_SESSIONS;
 
-import android.app.ActivityManager;
 import android.os.Bundle;
 import android.os.ShellCommand;
 import android.os.UserHandle;
+import android.view.autofill.AutofillManager;
 
 import com.android.internal.os.IResultReceiver;
 
@@ -51,6 +51,10 @@
                 return requestDestroy(pw);
             case "reset":
                 return requestReset();
+            case "get":
+                return requestGet(pw);
+            case "set":
+                return requestSet(pw);
             default:
                 return handleDefaultCommands(cmd);
         }
@@ -63,6 +67,12 @@
             pw.println("  help");
             pw.println("    Prints this help text.");
             pw.println("");
+            pw.println("  get log_level ");
+            pw.println("    Gets the Autofill log level (off | debug | verbose).");
+            pw.println("");
+            pw.println("  set log_level [off | debug | verbose]");
+            pw.println("    Sets the Autofill log level.");
+            pw.println("");
             pw.println("  list sessions [--user USER_ID]");
             pw.println("    List all pending sessions.");
             pw.println("");
@@ -75,6 +85,48 @@
         }
     }
 
+    private int requestGet(PrintWriter pw) {
+        if (!isNextArgLogLevel(pw, "get")) {
+            return -1;
+        }
+        final int logLevel = mService.getLogLevel();
+        switch (logLevel) {
+            case AutofillManager.FLAG_ADD_CLIENT_VERBOSE:
+                pw.println("verbose");
+                return 0;
+            case AutofillManager.FLAG_ADD_CLIENT_DEBUG:
+                pw.println("debug");
+                return 0;
+            case 0:
+                pw.println("off");
+                return 0;
+            default:
+                pw.println("unknow (" + logLevel + ")");
+                return 0;
+        }
+    }
+
+    private int requestSet(PrintWriter pw) {
+        if (!isNextArgLogLevel(pw, "set")) {
+            return -1;
+        }
+        final String logLevel = getNextArg();
+        switch (logLevel.toLowerCase()) {
+            case "verbose":
+                mService.setLogLevel(AutofillManager.FLAG_ADD_CLIENT_VERBOSE);
+                return 0;
+            case "debug":
+                mService.setLogLevel(AutofillManager.FLAG_ADD_CLIENT_DEBUG);
+                return 0;
+            case "off":
+                mService.setLogLevel(0);
+                return 0;
+            default:
+                pw.println("Invalid level: " + logLevel);
+                return -1;
+        }
+    }
+
     private int requestDestroy(PrintWriter pw) {
         if (!isNextArgSessions(pw)) {
             return -1;
@@ -121,6 +173,15 @@
         return true;
     }
 
+    private boolean isNextArgLogLevel(PrintWriter pw, String cmd) {
+        final String type = getNextArgRequired();
+        if (!type.equals("log_level")) {
+            pw.println("Error: invalid " + cmd + " type: " + type);
+            return false;
+        }
+        return true;
+    }
+
     private int requestSessionCommon(PrintWriter pw, CountDownLatch latch,
             Runnable command) {
         command.run();
@@ -144,13 +205,6 @@
         return 0;
     }
 
-    private int getUserIdFromArgsOrCurrentUser() {
-        if ("--user".equals(getNextArg())) {
-            return UserHandle.parseUserArg(getNextArgRequired());
-        }
-        return ActivityManager.getCurrentUser();
-    }
-
     private int getUserIdFromArgsOrAllUsers() {
         if ("--user".equals(getNextArg())) {
             return UserHandle.parseUserArg(getNextArgRequired());
diff --git a/services/autofill/java/com/android/server/autofill/Helper.java b/services/autofill/java/com/android/server/autofill/Helper.java
index 5964172..68ade63 100644
--- a/services/autofill/java/com/android/server/autofill/Helper.java
+++ b/services/autofill/java/com/android/server/autofill/Helper.java
@@ -17,7 +17,6 @@
 package com.android.server.autofill;
 
 import android.annotation.NonNull;
-import android.annotation.Nullable;
 import android.app.assist.AssistStructure;
 import android.app.assist.AssistStructure.ViewNode;
 import android.os.Bundle;
@@ -27,14 +26,22 @@
 import java.util.Objects;
 import java.util.Set;
 
-final class Helper {
+public final class Helper {
 
-    // TODO(b/36141126): set to false and remove guard from places that should always be on
-    static final boolean DEBUG = true;
-    static final boolean VERBOSE = false;
+    /**
+     * Defines a logging flag that can be dynamically changed at runtime using
+     * {@code cmd autofill debug [on|off]}.
+     */
+    public static boolean sDebug = false;
+
+    /**
+     * Defines a logging flag that can be dynamically changed at runtime using
+     * {@code cmd autofill verbose [on|off]}.
+     */
+    public static boolean sVerbose = false;
 
     static void append(StringBuilder builder, Bundle bundle) {
-        if (bundle == null || !DEBUG) {
+        if (bundle == null || !sVerbose) {
             builder.append("null");
             return;
         }
diff --git a/services/autofill/java/com/android/server/autofill/RemoteFillService.java b/services/autofill/java/com/android/server/autofill/RemoteFillService.java
index 2aeb07e..a12ebb2 100644
--- a/services/autofill/java/com/android/server/autofill/RemoteFillService.java
+++ b/services/autofill/java/com/android/server/autofill/RemoteFillService.java
@@ -18,7 +18,8 @@
 
 import static android.service.autofill.FillRequest.INVALID_REQUEST_ID;
 
-import static com.android.server.autofill.Helper.DEBUG;
+import static com.android.server.autofill.Helper.sDebug;
+import static com.android.server.autofill.Helper.sVerbose;
 
 import android.annotation.NonNull;
 import android.annotation.Nullable;
@@ -89,7 +90,7 @@
     private PendingRequest mPendingRequest;
 
     public interface FillServiceCallbacks {
-        void onFillRequestSuccess(@Nullable FillResponse response, int serviceUid,
+        void onFillRequestSuccess(int requestFlags, @Nullable FillResponse response, int serviceUid,
                 @NonNull String servicePackageName);
         void onFillRequestFailure(@Nullable CharSequence message,
                 @NonNull String servicePackageName);
@@ -219,9 +220,7 @@
             mPendingRequest = pendingRequest;
             ensureBound();
         } else {
-            if (DEBUG) {
-                Slog.d(LOG_TAG, "[user: " + mUserId + "] handlePendingRequest()");
-            }
+            if (sVerbose) Slog.v(LOG_TAG, "[user: " + mUserId + "] handlePendingRequest()");
             pendingRequest.run();
             if (pendingRequest.isFinal()) {
                 mCompleted = true;
@@ -237,9 +236,7 @@
         if (isBound() || mBinding) {
             return;
         }
-        if (DEBUG) {
-            Slog.d(LOG_TAG, "[user: " + mUserId + "] ensureBound()");
-        }
+        if (sVerbose) Slog.v(LOG_TAG, "[user: " + mUserId + "] ensureBound()");
         mBinding = true;
 
         boolean willBind = mContext.bindServiceAsUser(mIntent, mServiceConnection,
@@ -247,9 +244,7 @@
                 new UserHandle(mUserId));
 
         if (!willBind) {
-            if (DEBUG) {
-                Slog.d(LOG_TAG, "[user: " + mUserId + "] could not bind to " + mIntent);
-            }
+            if (sDebug) Slog.d(LOG_TAG, "[user: " + mUserId + "] could not bind to " + mIntent);
             mBinding = false;
 
             if (!mServiceDied) {
@@ -262,9 +257,7 @@
         if (!isBound() && !mBinding) {
             return;
         }
-        if (DEBUG) {
-            Slog.d(LOG_TAG, "[user: " + mUserId + "] ensureUnbound()");
-        }
+        if (sVerbose) Slog.v(LOG_TAG, "[user: " + mUserId + "] ensureUnbound()");
         mBinding = false;
         if (isBound()) {
             try {
@@ -281,10 +274,10 @@
     }
 
     private void dispatchOnFillRequestSuccess(PendingRequest pendingRequest,
-            int callingUid, FillResponse response) {
+            int callingUid, int requestFlags, FillResponse response) {
         mHandler.getHandler().post(() -> {
             if (handleResponseCallbackCommon(pendingRequest)) {
-                mCallbacks.onFillRequestSuccess(response, callingUid,
+                mCallbacks.onFillRequestSuccess(requestFlags, response, callingUid,
                         mComponentName.getPackageName());
             }
         });
@@ -452,8 +445,8 @@
                 public void onSuccess(FillResponse response) {
                     RemoteFillService remoteService = mWeakService.get();
                     if (remoteService != null) {
-                        remoteService.dispatchOnFillRequestSuccess(
-                                PendingFillRequest.this, getCallingUid(), response);
+                        remoteService.dispatchOnFillRequestSuccess(PendingFillRequest.this,
+                                getCallingUid(), request.getFlags(), response);
                     }
                 }
 
diff --git a/services/autofill/java/com/android/server/autofill/Session.java b/services/autofill/java/com/android/server/autofill/Session.java
index 0687f6d..c85ce43 100644
--- a/services/autofill/java/com/android/server/autofill/Session.java
+++ b/services/autofill/java/com/android/server/autofill/Session.java
@@ -20,13 +20,13 @@
 import static android.service.autofill.FillRequest.INVALID_REQUEST_ID;
 import static android.service.voice.VoiceInteractionSession.KEY_RECEIVER_EXTRAS;
 import static android.service.voice.VoiceInteractionSession.KEY_STRUCTURE;
-import static android.view.autofill.AutofillManager.FLAG_START_SESSION;
-import static android.view.autofill.AutofillManager.FLAG_VALUE_CHANGED;
-import static android.view.autofill.AutofillManager.FLAG_VIEW_ENTERED;
-import static android.view.autofill.AutofillManager.FLAG_VIEW_EXITED;
+import static android.view.autofill.AutofillManager.ACTION_START_SESSION;
+import static android.view.autofill.AutofillManager.ACTION_VALUE_CHANGED;
+import static android.view.autofill.AutofillManager.ACTION_VIEW_ENTERED;
+import static android.view.autofill.AutofillManager.ACTION_VIEW_EXITED;
 
-import static com.android.server.autofill.Helper.DEBUG;
-import static com.android.server.autofill.Helper.VERBOSE;
+import static com.android.server.autofill.Helper.sDebug;
+import static com.android.server.autofill.Helper.sVerbose;
 import static com.android.server.autofill.Helper.findViewNodeById;
 
 import android.annotation.NonNull;
@@ -108,7 +108,7 @@
     private static AtomicInteger sIdCounter = new AtomicInteger();
 
     /** Id of the session */
-    private final int mId;
+    public final int id;
 
     /** uid the session is for */
     public final int uid;
@@ -174,23 +174,14 @@
     private boolean mDestroyed;
 
     /**
-     * Flags used to start the session.
-     */
-    private final int mFlags;
-
-    /**
      * Receiver of assist data from the app's {@link Activity}.
      */
     private final IResultReceiver mAssistReceiver = new IResultReceiver.Stub() {
         @Override
         public void send(int resultCode, Bundle resultData) throws RemoteException {
-            if (VERBOSE) {
-                Slog.v(TAG, "resultCode on mAssistReceiver: " + resultCode);
-            }
-
             final AssistStructure structure = resultData.getParcelable(KEY_STRUCTURE);
             if (structure == null) {
-                Slog.wtf(TAG, "no assist structure for id " + resultCode);
+                Slog.wtf(TAG, "no assist structure");
                 return;
             }
 
@@ -202,8 +193,8 @@
 
             final int requestId = receiverExtras.getInt(EXTRA_REQUEST_ID);
 
-            if (DEBUG) {
-                Slog.d(TAG, "New structure for requestId " + requestId + ": " + structure);
+            if (sVerbose) {
+                Slog.v(TAG, "New structure for requestId " + requestId + ": " + structure);
             }
 
             final FillRequest request;
@@ -218,6 +209,9 @@
                 // Sanitize structure before it's sent to service.
                 structure.sanitizeForParceling(true);
 
+                // Flags used to start the session.
+                final int flags = structure.getFlags();
+
                 if (mContexts == null) {
                     mContexts = new ArrayList<>(1);
                 }
@@ -230,7 +224,7 @@
                     fillStructureWithAllowedValues(mContexts.get(i).getStructure());
                 }
 
-                request = new FillRequest(requestId, mContexts, mClientState, mFlags);
+                request = new FillRequest(requestId, mContexts, mClientState, flags);
             }
 
             mRemoteFillService.onFillRequest(request);
@@ -251,9 +245,7 @@
 
             final ViewNode node = findViewNodeById(structure, viewState.id);
             if (node == null) {
-                if (DEBUG) {
-                    Slog.w(TAG, "fillStructureWithAllowedValues(): no node for " + viewState.id);
-                }
+                Slog.w(TAG, "fillStructureWithAllowedValues(): no node for " + viewState.id);
                 continue;
             }
 
@@ -295,15 +287,15 @@
     /**
      * Reads a new structure and then request a new fill response from the fill service.
      */
-    private void requestNewFillResponseLocked() {
+    private void requestNewFillResponseLocked(int flags) {
         int requestId;
 
         do {
             requestId = sIdCounter.getAndIncrement();
         } while (requestId == INVALID_REQUEST_ID);
 
-        if (DEBUG) {
-            Slog.d(TAG, "Requesting structure for requestId " + requestId);
+        if (sVerbose) {
+            Slog.v(TAG, "Requesting structure for requestId=" + requestId + ", flags=" + flags);
         }
 
         // If the focus changes very quickly before the first request is returned each focus change
@@ -319,7 +311,7 @@
             final long identity = Binder.clearCallingIdentity();
             try {
                 if (!ActivityManager.getService().requestAutofillData(mAssistReceiver,
-                        receiverExtras, mActivityToken)) {
+                        receiverExtras, mActivityToken, flags)) {
                     Slog.w(TAG, "failed to request autofill data for " + mActivityToken);
                 }
             } finally {
@@ -334,8 +326,8 @@
             @NonNull Context context, @NonNull HandlerCaller handlerCaller, int userId,
             @NonNull Object lock, int sessionId, int uid, @NonNull IBinder activityToken,
             @Nullable IBinder windowToken, @NonNull IBinder client, boolean hasCallback,
-            int flags, @NonNull ComponentName componentName, @NonNull String packageName) {
-        mId = sessionId;
+            @NonNull ComponentName componentName, @NonNull String packageName) {
+        id = sessionId;
         this.uid = uid;
         mService = service;
         mLock = lock;
@@ -346,7 +338,6 @@
         mWindowToken = windowToken;
         mHasCallback = hasCallback;
         mPackageName = packageName;
-        mFlags = flags;
         mClient = IAutoFillManagerClient.Stub.asInterface(client);
 
         mMetricsLogger.action(MetricsEvent.AUTOFILL_SESSION_STARTED, mPackageName);
@@ -371,7 +362,7 @@
         synchronized (mLock) {
             if (mDestroyed) {
                 Slog.w(TAG, "Call to Session#switchWindow() rejected - session: "
-                        + mId + " destroyed");
+                        + id + " destroyed");
                 return;
             }
             mWindowToken = newWindow;
@@ -388,7 +379,7 @@
         synchronized (mLock) {
             if (mDestroyed) {
                 Slog.w(TAG, "Call to Session#switchActivity() rejected - session: "
-                        + mId + " destroyed");
+                        + id + " destroyed");
                 return;
             }
             mActivityToken = newActivity;
@@ -401,17 +392,17 @@
 
     // FillServiceCallbacks
     @Override
-    public void onFillRequestSuccess(@Nullable FillResponse response, int serviceUid,
-            @NonNull String servicePackageName) {
+    public void onFillRequestSuccess(int requestFlags, @Nullable FillResponse response,
+            int serviceUid, @NonNull String servicePackageName) {
         synchronized (mLock) {
             if (mDestroyed) {
                 Slog.w(TAG, "Call to Session#onFillRequestSuccess() rejected - session: "
-                        + mId + " destroyed");
+                        + id + " destroyed");
                 return;
             }
         }
         if (response == null) {
-            if ((mFlags & FLAG_MANUAL_REQUEST) != 0) {
+            if ((requestFlags & FLAG_MANUAL_REQUEST) != 0) {
                 getUiForShowing().showError(R.string.autofill_error_cannot_autofill);
             }
             // Nothing to be done, but need to notify client.
@@ -452,7 +443,7 @@
         synchronized (mLock) {
             if (mDestroyed) {
                 Slog.w(TAG, "Call to Session#onFillRequestFailure() rejected - session: "
-                        + mId + " destroyed");
+                        + id + " destroyed");
                 return;
             }
         }
@@ -472,7 +463,7 @@
         synchronized (mLock) {
             if (mDestroyed) {
                 Slog.w(TAG, "Call to Session#onSaveRequestSuccess() rejected - session: "
-                        + mId + " destroyed");
+                        + id + " destroyed");
                 return;
             }
         }
@@ -494,7 +485,7 @@
         synchronized (mLock) {
             if (mDestroyed) {
                 Slog.w(TAG, "Call to Session#onSaveRequestFailure() rejected - session: "
-                        + mId + " destroyed");
+                        + id + " destroyed");
                 return;
             }
         }
@@ -541,7 +532,7 @@
             synchronized (mLock) {
                 if (mDestroyed) {
                     Slog.w(TAG, "Call to Session#authenticate() rejected - session: "
-                            + mId + " destroyed");
+                            + id + " destroyed");
                     return;
                 }
             }
@@ -563,11 +554,10 @@
     // AutoFillUiCallback
     @Override
     public void fill(int requestId, Dataset dataset) {
-        mHandlerCaller.getHandler().post(() -> autoFill(requestId, dataset));
         synchronized (mLock) {
             if (mDestroyed) {
                 Slog.w(TAG, "Call to Session#fill() rejected - session: "
-                        + mId + " destroyed");
+                        + id + " destroyed");
                 return;
             }
         }
@@ -580,12 +570,12 @@
         synchronized (mLock) {
             if (mDestroyed) {
                 Slog.w(TAG, "Call to Session#save() rejected - session: "
-                        + mId + " destroyed");
+                        + id + " destroyed");
                 return;
             }
         }
         mHandlerCaller.getHandler()
-                .obtainMessage(AutofillManagerServiceImpl.MSG_SERVICE_SAVE, mId, 0)
+                .obtainMessage(AutofillManagerServiceImpl.MSG_SERVICE_SAVE, id, 0)
                 .sendToTarget();
     }
 
@@ -595,7 +585,7 @@
         synchronized (mLock) {
             if (mDestroyed) {
                 Slog.w(TAG, "Call to Session#cancelSave() rejected - session: "
-                        + mId + " destroyed");
+                        + id + " destroyed");
                 return;
             }
         }
@@ -609,19 +599,19 @@
         synchronized (mLock) {
             if (mDestroyed) {
                 Slog.w(TAG, "Call to Session#requestShowFillUi() rejected - session: "
-                        + mId + " destroyed");
+                        + id + " destroyed");
                 return;
             }
             if (id.equals(mCurrentViewId)) {
                 try {
                     final ViewState view = mViewStates.get(id);
-                    mClient.requestShowFillUi(mId, mWindowToken, id, width, height,
+                    mClient.requestShowFillUi(this.id, mWindowToken, id, width, height,
                             view.getVirtualBounds(), presenter);
                 } catch (RemoteException e) {
                     Slog.e(TAG, "Error requesting to show fill UI", e);
                 }
             } else {
-                if (DEBUG) {
+                if (sDebug) {
                     Slog.d(TAG, "Do not show full UI on " + id + " as it is not the current view ("
                             + mCurrentViewId + ") anymore");
                 }
@@ -636,7 +626,7 @@
             // NOTE: We allow this call in a destroyed state as the UI is
             // asked to go away after we get destroyed, so let it do that.
             try {
-                mClient.requestHideFillUi(mId, mWindowToken, id);
+                mClient.requestHideFillUi(this.id, mWindowToken, id);
             } catch (RemoteException e) {
                 Slog.e(TAG, "Error requesting to hide fill UI", e);
             }
@@ -649,7 +639,7 @@
         synchronized (mLock) {
             if (mDestroyed) {
                 Slog.w(TAG, "Call to Session#startIntentSender() rejected - session: "
-                        + mId + " destroyed");
+                        + id + " destroyed");
                 return;
             }
             removeSelfLocked();
@@ -668,7 +658,7 @@
     void setAuthenticationResultLocked(Bundle data) {
         if (mDestroyed) {
             Slog.w(TAG, "Call to Session#setAuthenticationResultLocked() rejected - session: "
-                    + mId + " destroyed");
+                    + id + " destroyed");
             return;
         }
         if ((mResponseWaitingAuth == null && mDatasetWaitingAuth == null) || data == null) {
@@ -708,7 +698,7 @@
     void setHasCallbackLocked(boolean hasIt) {
         if (mDestroyed) {
             Slog.w(TAG, "Call to Session#setHasCallbackLocked() rejected - session: "
-                    + mId + " destroyed");
+                    + id + " destroyed");
             return;
         }
         mHasCallback = hasIt;
@@ -722,7 +712,7 @@
     public boolean showSaveLocked() {
         if (mDestroyed) {
             Slog.w(TAG, "Call to Session#showSaveLocked() rejected - session: "
-                    + mId + " destroyed");
+                    + id + " destroyed");
             return false;
         }
         if (mContexts == null) {
@@ -732,23 +722,23 @@
         if (mResponses == null) {
             // Happens when the activity / session was finished before the service replied, or
             // when the service cannot autofill it (and returned a null response).
-            if (DEBUG) {
-                Slog.d(TAG, "showSaveLocked(): no responses on session");
+            if (sVerbose) {
+                Slog.v(TAG, "showSaveLocked(): no responses on session");
             }
             return true;
         }
 
         final int lastResponseIdx = getLastResponseIndex();
         if (lastResponseIdx < 0) {
-            Slog.d(TAG, "showSaveLocked(): mResponses=" + mResponses
+            Slog.w(TAG, "showSaveLocked(): did not get last response. mResponses=" + mResponses
                     + ", mViewStates=" + mViewStates);
             return true;
         }
 
         final FillResponse response = mResponses.valueAt(lastResponseIdx);
         final SaveInfo saveInfo = response.getSaveInfo();
-        if (DEBUG) {
-            Slog.d(TAG, "showSaveLocked(): mResponses=" + mResponses + ", mContexts=" + mContexts
+        if (sVerbose) {
+            Slog.v(TAG, "showSaveLocked(): mResponses=" + mResponses + ", mContexts=" + mContexts
                     + ", mViewStates=" + mViewStates);
         }
 
@@ -783,7 +773,7 @@
 
             final AutofillValue currentValue = viewState.getCurrentValue();
             if (currentValue == null || currentValue.isEmpty()) {
-                if (DEBUG) {
+                if (sDebug) {
                     Slog.d(TAG, "showSaveLocked(): empty value for required " + id );
                 }
                 allRequiredAreNotEmpty = false;
@@ -792,7 +782,7 @@
             final AutofillValue filledValue = viewState.getAutofilledValue();
 
             if (!currentValue.equals(filledValue)) {
-                if (DEBUG) {
+                if (sDebug) {
                     Slog.d(TAG, "showSaveLocked(): found a change on required " + id + ": "
                             + filledValue + " => " + currentValue);
                 }
@@ -815,7 +805,7 @@
                         final AutofillValue currentValue = viewState.getCurrentValue();
                         final AutofillValue filledValue = viewState.getAutofilledValue();
                         if (currentValue != null && !currentValue.equals(filledValue)) {
-                            if (DEBUG) {
+                            if (sDebug) {
                                 Slog.d(TAG, "finishSessionLocked(): found a change on optional "
                                         + id + ": " + filledValue + " => " + currentValue);
                             }
@@ -832,7 +822,7 @@
             }
         }
         // Nothing changed...
-        if (DEBUG) {
+        if (sDebug) {
             Slog.d(TAG, "showSaveLocked(): with no changes, comes no responsibilities."
                     + "allRequiredAreNotNull=" + allRequiredAreNotEmpty
                     + ", atLeastOneChanged=" + atLeastOneChanged);
@@ -846,29 +836,23 @@
     void callSaveLocked() {
         if (mDestroyed) {
             Slog.w(TAG, "Call to Session#callSaveLocked() rejected - session: "
-                    + mId + " destroyed");
+                    + id + " destroyed");
             return;
         }
 
-        if (DEBUG) {
-            Slog.d(TAG, "callSaveLocked(): mViewStates=" + mViewStates);
-        }
+        if (sVerbose) Slog.v(TAG, "callSaveLocked(): mViewStates=" + mViewStates);
 
-        int numContexts = mContexts.size();
+        final int numContexts = mContexts.size();
 
         for (int i = 0; i < numContexts; i++) {
-            FillContext context = mContexts.get(i);
+            final FillContext context = mContexts.get(i);
 
-            if (VERBOSE) {
-                Slog.v(TAG, "callSaveLocked(): updating " + context);
-            }
+            if (sVerbose) Slog.v(TAG, "callSaveLocked(): updating " + context);
 
             for (Entry<AutofillId, ViewState> entry : mViewStates.entrySet()) {
                 final AutofillValue value = entry.getValue().getCurrentValue();
                 if (value == null) {
-                    if (VERBOSE) {
-                        Slog.v(TAG, "callSaveLocked(): skipping " + entry.getKey());
-                    }
+                    if (sVerbose) Slog.v(TAG, "callSaveLocked(): skipping " + entry.getKey());
                     continue;
                 }
                 final AutofillId id = entry.getKey();
@@ -877,9 +861,7 @@
                     Slog.w(TAG, "callSaveLocked(): did not find node with id " + id);
                     continue;
                 }
-                if (VERBOSE) {
-                    Slog.v(TAG, "callSaveLocked(): updating " + id + " to " + value);
-                }
+                if (sVerbose) Slog.v(TAG, "callSaveLocked(): updating " + id + " to " + value);
 
                 node.updateAutofillValue(value);
             }
@@ -887,7 +869,7 @@
             // Sanitize structure before it's sent to service.
             context.getStructure().sanitizeForParceling(false);
 
-            if (VERBOSE) {
+            if (sVerbose) {
                 Slog.v(TAG, "Dumping structure of " + context + " before calling service.save()");
                 context.getStructure().dump();
             }
@@ -933,7 +915,7 @@
                 final int numDatasets = datasets.size();
 
                 for (int dataSetNum = 0; dataSetNum < numDatasets; dataSetNum++) {
-                    final ArrayList fields = datasets.get(dataSetNum).getFieldIds();
+                    final ArrayList<AutofillId> fields = datasets.get(dataSetNum).getFieldIds();
 
                     if (fields != null && fields.contains(id)) {
                         return false;
@@ -945,96 +927,92 @@
         return true;
     }
 
-    void updateLocked(AutofillId id, Rect virtualBounds, AutofillValue value, int flags) {
+    void updateLocked(AutofillId id, Rect virtualBounds, AutofillValue value, int action,
+            int flags) {
         if (mDestroyed) {
             Slog.w(TAG, "Call to Session#updateLocked() rejected - session: "
-                    + mId + " destroyed");
+                    + id + " destroyed");
             return;
         }
         ViewState viewState = mViewStates.get(id);
 
         if (viewState == null) {
-            if ((flags & (FLAG_START_SESSION | FLAG_VALUE_CHANGED | FLAG_VIEW_ENTERED)) != 0) {
-                if (DEBUG) {
-                    Slog.d(TAG, "Creating viewState for " + id + " on " + getFlagAsString(flags));
+            if (action == ACTION_START_SESSION || action == ACTION_VALUE_CHANGED
+                    || action == ACTION_VIEW_ENTERED) {
+                if (sVerbose) {
+                    Slog.v(TAG,
+                            "Creating viewState for " + id + " on " + getActionAsString(action));
                 }
                 viewState = new ViewState(this, id, value, this, ViewState.STATE_INITIAL);
                 mViewStates.put(id, viewState);
             } else {
-                if (VERBOSE) Slog.v(TAG, "Ignored " + getFlagAsString(flags) + " for " + id);
+                if (sVerbose) Slog.v(TAG, "Ignored " + getActionAsString(action) + " for " + id);
                 return;
             }
         }
 
-        if ((flags & FLAG_START_SESSION) != 0) {
-            // View is triggering autofill.
-            mCurrentViewId = viewState.id;
-            viewState.update(value, virtualBounds);
-            viewState.setState(ViewState.STATE_STARTED_SESSION);
-            requestNewFillResponseLocked();
-            return;
-        }
-
-        if ((flags & FLAG_VALUE_CHANGED) != 0) {
-            if (value != null && !value.equals(viewState.getCurrentValue())) {
-                // Always update the internal state.
-                viewState.setCurrentValue(value);
-
-                // Must check if this update was caused by autofilling the view, in which
-                // case we just update the value, but not the UI.
-                final AutofillValue filledValue = viewState.getAutofilledValue();
-                if (value.equals(filledValue)) {
-                    return;
-                }
-                // Update the internal state...
-                viewState.setState(ViewState.STATE_CHANGED);
-
-                //..and the UI
-                if (value.isText()) {
-                    getUiForShowing().filterFillUi(value.getTextValue().toString());
-                } else {
-                    getUiForShowing().filterFillUi(null);
-                }
-            }
-
-            return;
-        }
-
-        if ((flags & FLAG_VIEW_ENTERED) != 0) {
-            if (shouldStartNewPartitionLocked(id)) {
-                // TODO(b/37424539): proper implementation
-                if (mResponseWaitingAuth != null && ((flags & FLAG_START_SESSION) == 0)) {
-                    viewState.setState(ViewState.STATE_WAITING_RESPONSE_AUTH);
-                } else if ((flags & FLAG_START_SESSION) == 0){
-                    if (DEBUG) {
-                        Slog.d(TAG, "Starting partition for view id " + viewState.id);
-                    }
-                    viewState.setState(ViewState.STATE_STARTED_PARTITION);
-                    requestNewFillResponseLocked();
-                }
-            }
-
-            // Remove the UI if the ViewState has changed.
-            if (mCurrentViewId != viewState.id) {
-                mUi.hideFillUi(mCurrentViewId != null ? mCurrentViewId : null);
+        switch(action) {
+            case ACTION_START_SESSION:
+                // View is triggering autofill.
                 mCurrentViewId = viewState.id;
-            }
+                viewState.update(value, virtualBounds);
+                viewState.setState(ViewState.STATE_STARTED_SESSION);
+                requestNewFillResponseLocked(flags);
+                break;
+            case ACTION_VALUE_CHANGED:
+                if (value != null && !value.equals(viewState.getCurrentValue())) {
+                    // Always update the internal state.
+                    viewState.setCurrentValue(value);
 
-            // If the ViewState is ready to be displayed, onReady() will be called.
-            viewState.update(value, virtualBounds);
+                    // Must check if this update was caused by autofilling the view, in which
+                    // case we just update the value, but not the UI.
+                    final AutofillValue filledValue = viewState.getAutofilledValue();
+                    if (value.equals(filledValue)) {
+                        return;
+                    }
+                    // Update the internal state...
+                    viewState.setState(ViewState.STATE_CHANGED);
 
-            return;
+                    //..and the UI
+                    if (value.isText()) {
+                        getUiForShowing().filterFillUi(value.getTextValue().toString());
+                    } else {
+                        getUiForShowing().filterFillUi(null);
+                    }
+                }
+                break;
+            case ACTION_VIEW_ENTERED:
+                if (shouldStartNewPartitionLocked(id)) {
+                    // TODO(b/37424539): proper implementation
+                    if (mResponseWaitingAuth != null) {
+                        viewState.setState(ViewState.STATE_WAITING_RESPONSE_AUTH);
+                    } else {
+                        if (sDebug) {
+                            Slog.d(TAG, "Starting partition for view id " + viewState.id);
+                        }
+                        viewState.setState(ViewState.STATE_STARTED_PARTITION);
+                        requestNewFillResponseLocked(flags);
+                    }
+                }
+
+                // Remove the UI if the ViewState has changed.
+                if (mCurrentViewId != viewState.id) {
+                    mUi.hideFillUi(mCurrentViewId != null ? mCurrentViewId : null);
+                    mCurrentViewId = viewState.id;
+                }
+
+                // If the ViewState is ready to be displayed, onReady() will be called.
+                viewState.update(value, virtualBounds);
+                break;
+            case ACTION_VIEW_EXITED:
+                if (mCurrentViewId == viewState.id) {
+                    mUi.hideFillUi(viewState.id);
+                    mCurrentViewId = null;
+                }
+                break;
+            default:
+                Slog.w(TAG, "updateLocked(): unknown action: " + action);
         }
-
-        if ((flags & FLAG_VIEW_EXITED) != 0) {
-            if (mCurrentViewId == viewState.id) {
-                mUi.hideFillUi(viewState.id);
-                mCurrentViewId = null;
-            }
-            return;
-        }
-
-        Slog.w(TAG, "updateLocked(): unknown flags " + flags + ": " + getFlagAsString(flags));
     }
 
     @Override
@@ -1043,7 +1021,7 @@
         synchronized (mLock) {
             if (mDestroyed) {
                 Slog.w(TAG, "Call to Session#onFillReady() rejected - session: "
-                        + mId + " destroyed");
+                        + id + " destroyed");
                 return;
             }
         }
@@ -1056,12 +1034,8 @@
         getUiForShowing().showFillUi(filledId, response, filterText, mPackageName);
     }
 
-    static String getFlagAsString(int flag) {
-        return DebugUtils.flagsToString(AutofillManager.class, "FLAG_", flag);
-    }
-
-    int getId() {
-        return mId;
+    String getActionAsString(int flag) {
+        return DebugUtils.flagsToString(AutofillManager.class, "ACTION_", flag);
     }
 
     boolean isDestroyed() {
@@ -1080,7 +1054,7 @@
         synchronized (mLock) {
             if (!mHasCallback) return;
             try {
-                mClient.notifyNoFillUi(mId, mWindowToken, mCurrentViewId);
+                mClient.notifyNoFillUi(id, mWindowToken, mCurrentViewId);
             } catch (RemoteException e) {
                 Slog.e(TAG, "Error notifying client no fill UI: windowToken=" + mWindowToken
                         + " id=" + mCurrentViewId, e);
@@ -1115,21 +1089,22 @@
         }
 
         try {
-            mClient.setTrackedViews(mId, trackedViews, saveOnAllViewsInvisible);
+            mClient.setTrackedViews(id, trackedViews, saveOnAllViewsInvisible);
         } catch (RemoteException e) {
             Slog.w(TAG, "Cannot set tracked ids", e);
         }
     }
 
     private void processResponseLocked(@NonNull FillResponse response) {
-        if (DEBUG) {
-            Slog.d(TAG, "processResponseLocked(mCurrentViewId=" + mCurrentViewId + "):" + response);
+        if (sVerbose) {
+            Slog.v(TAG, "processResponseLocked(mCurrentViewId=" + mCurrentViewId + "):" + response);
         }
 
         if (mResponses == null) {
             mResponses = new SparseArray<>(4);
         }
-        mResponses.put(response.getRequestId(), response);
+        final int requestId = response.getRequestId();
+        mResponses.put(requestId, response);
         mClientState = response.getClientState();
 
         setViewStatesLocked(response, ViewState.STATE_FILLABLE);
@@ -1139,13 +1114,18 @@
             return;
         }
 
-        if ((mFlags & FLAG_MANUAL_REQUEST) != 0 && response.getDatasets() != null
-                && response.getDatasets().size() == 1) {
-            Slog.d(TAG, "autofilling manual request directly");
-            autoFill(response.getRequestId(), response.getDatasets().get(0));
-            return;
-        }
+        final ArrayList<Dataset> datasets = response.getDatasets();
 
+        if (datasets != null && datasets.size() == 1) {
+            // Check if it its a single response for a manual request, in which case it should
+            // be automatically filled
+            final FillContext context = getFillContextByRequestIdLocked(requestId);
+            if (context != null && (context.getStructure().getFlags() & FLAG_MANUAL_REQUEST) != 0) {
+                Slog.d(TAG, "autofilling manual request directly");
+                autoFill(requestId, datasets.get(0));
+                return;
+            }
+        }
         // Updates the UI, if necessary.
         final ViewState currentView = mViewStates.get(mCurrentViewId);
         currentView.maybeCallOnFillReady();
@@ -1200,14 +1180,14 @@
         }
     }
 
-    private ViewState createOrUpdateViewStateLocked(AutofillId id, int state,AutofillValue value) {
+    private ViewState createOrUpdateViewStateLocked(AutofillId id, int state, AutofillValue value) {
         ViewState viewState = mViewStates.get(id);
         if (viewState != null)  {
             viewState.setState(state);
         } else {
             viewState = new ViewState(this, id, null, this, state);
-            if (DEBUG) { // TODO(b/33197203): change to VERBOSE once stable
-                Slog.d(TAG, "Adding autofillable view with id " + id + " and state " + state);
+            if (sVerbose) {
+                Slog.v(TAG, "Adding autofillable view with id " + id + " and state " + state);
             }
             mViewStates.put(id, viewState);
         }
@@ -1235,7 +1215,7 @@
         synchronized (mLock) {
             if (mDestroyed) {
                 Slog.w(TAG, "Call to Session#autoFill() rejected - session: "
-                        + mId + " destroyed");
+                        + id + " destroyed");
                 return;
             }
             // Autofill it directly...
@@ -1273,7 +1253,7 @@
         final Intent fillInIntent = new Intent();
         fillInIntent.putExtra(AutofillManager.EXTRA_ASSIST_STRUCTURE, structure);
         if (extras != null) {
-            fillInIntent.putExtra(AutofillManager.EXTRA_DATA_EXTRAS, extras);
+            fillInIntent.putExtra(AutofillManager.EXTRA_CLIENT_STATE, extras);
         }
         return fillInIntent;
     }
@@ -1281,7 +1261,7 @@
     private void startAuthentication(IntentSender intent, Intent fillInIntent) {
         try {
             synchronized (mLock) {
-                mClient.authenticate(mId, intent, fillInIntent);
+                mClient.authenticate(id, intent, fillInIntent);
             }
         } catch (RemoteException e) {
             Slog.e(TAG, "Error launching auth intent", e);
@@ -1289,10 +1269,9 @@
     }
 
     void dumpLocked(String prefix, PrintWriter pw) {
-        pw.print(prefix); pw.print("id: "); pw.println(mId);
+        pw.print(prefix); pw.print("id: "); pw.println(id);
         pw.print(prefix); pw.print("uid: "); pw.println(uid);
         pw.print(prefix); pw.print("mActivityToken: "); pw.println(mActivityToken);
-        pw.print(prefix); pw.print("mFlags: "); pw.println(mFlags);
         pw.print(prefix); pw.print("mResponses: "); pw.println(mResponses);
         pw.print(prefix); pw.print("mResponseWaitingAuth: "); pw.println(mResponseWaitingAuth);
         pw.print(prefix); pw.print("mDatasetWaitingAuth: "); pw.println(mDatasetWaitingAuth);
@@ -1312,7 +1291,7 @@
                 FillContext context = mContexts.get(i);
 
                 pw.print(prefix2); pw.print(context);
-                if (VERBOSE) {
+                if (sVerbose) {
                     pw.println(context.getStructure() + " (look at logcat)");
 
                     // TODO: add method on AssistStructure to dump on pw
@@ -1333,14 +1312,12 @@
         synchronized (mLock) {
             if (mDestroyed) {
                 Slog.w(TAG, "Call to Session#autoFillApp() rejected - session: "
-                        + mId + " destroyed");
+                        + id + " destroyed");
                 return;
             }
             try {
-                if (DEBUG) {
-                    Slog.d(TAG, "autoFillApp(): the buck is on the app: " + dataset);
-                }
-                mClient.autofill(mId, mWindowToken, dataset.getFieldIds(),
+                if (sDebug) Slog.d(TAG, "autoFillApp(): the buck is on the app: " + dataset);
+                mClient.autofill(id, mWindowToken, dataset.getFieldIds(),
                         dataset.getFieldValues());
                 setViewStatesLocked(null, dataset, ViewState.STATE_AUTOFILLED);
             } catch (RemoteException e) {
@@ -1374,16 +1351,14 @@
     }
 
     void removeSelfLocked() {
-        if (VERBOSE) {
-            Slog.v(TAG, "removeSelfLocked()");
-        }
+        if (sVerbose) Slog.v(TAG, "removeSelfLocked()");
         if (mDestroyed) {
             Slog.w(TAG, "Call to Session#removeSelfLocked() rejected - session: "
-                    + mId + " destroyed");
+                    + id + " destroyed");
             return;
         }
         destroyLocked();
-        mService.removeSessionLocked(mId);
+        mService.removeSessionLocked(id);
     }
 
     private int getLastResponseIndex() {
diff --git a/services/autofill/java/com/android/server/autofill/ViewState.java b/services/autofill/java/com/android/server/autofill/ViewState.java
index 3967f59..7ca9435 100644
--- a/services/autofill/java/com/android/server/autofill/ViewState.java
+++ b/services/autofill/java/com/android/server/autofill/ViewState.java
@@ -16,7 +16,7 @@
 
 package com.android.server.autofill;
 
-import static com.android.server.autofill.Helper.DEBUG;
+import static com.android.server.autofill.Helper.sDebug;
 
 import android.annotation.Nullable;
 import android.graphics.Rect;
@@ -65,15 +65,15 @@
     public static final int STATE_WAITING_RESPONSE_AUTH = 0x80;
 
     public final AutofillId id;
+
     private final Listener mListener;
     private final Session mSession;
-    private FillResponse mResponse;
 
+    private FillResponse mResponse;
     private AutofillValue mInitialValue;
     private AutofillValue mCurrentValue;
     private AutofillValue mAutofilledValue;
     private Rect mVirtualBounds;
-
     private int mState;
 
     ViewState(Session session, AutofillId id, AutofillValue value, Listener listener, int state) {
@@ -172,9 +172,7 @@
      */
     void maybeCallOnFillReady() {
         if ((mState & (STATE_AUTOFILLED | STATE_WAITING_DATASET_AUTH)) != 0) {
-            if (DEBUG) {
-                Slog.d(TAG, "Ignoring UI for " + id + " on " + getStateAsString());
-            }
+            if (sDebug) Slog.d(TAG, "Ignoring UI for " + id + " on " + getStateAsString());
             return;
         }
         // First try the current response associated with this View.
diff --git a/services/autofill/java/com/android/server/autofill/ui/AutoFillUI.java b/services/autofill/java/com/android/server/autofill/ui/AutoFillUI.java
index 0556c67..086742e 100644
--- a/services/autofill/java/com/android/server/autofill/ui/AutoFillUI.java
+++ b/services/autofill/java/com/android/server/autofill/ui/AutoFillUI.java
@@ -15,7 +15,7 @@
  */
 package com.android.server.autofill.ui;
 
-import static com.android.server.autofill.ui.Helper.DEBUG;
+import static com.android.server.autofill.Helper.sDebug;
 
 import android.annotation.NonNull;
 import android.annotation.Nullable;
@@ -47,7 +47,7 @@
  * managing saving of user edits.
  */
 public final class AutoFillUI {
-    private static final String TAG = "AutoFillUI";
+    private static final String TAG = "AutofillUI";
 
     private final Handler mHandler = UiThread.getHandler();
     private final @NonNull Context mContext;
@@ -139,7 +139,7 @@
      */
     public void showFillUi(@NonNull AutofillId focusedId, @NonNull FillResponse response,
             @Nullable String filterText, @NonNull String packageName) {
-        if (DEBUG) {
+        if (sDebug) {
             Slog.d(TAG, "showFillUi(): id=" + focusedId + ", filter=" + filterText);
         }
         final LogMaker log = (new LogMaker(MetricsProto.MetricsEvent.AUTOFILL_FILL_UI))
diff --git a/services/autofill/java/com/android/server/autofill/ui/FillUi.java b/services/autofill/java/com/android/server/autofill/ui/FillUi.java
index bb47e5b..fa95e03 100644
--- a/services/autofill/java/com/android/server/autofill/ui/FillUi.java
+++ b/services/autofill/java/com/android/server/autofill/ui/FillUi.java
@@ -15,6 +15,8 @@
  */
 package com.android.server.autofill.ui;
 
+import static com.android.server.autofill.Helper.sDebug;
+
 import android.annotation.NonNull;
 import android.annotation.Nullable;
 import android.app.PendingIntent;
@@ -341,7 +343,7 @@
                     mWm.updateViewLayout(mContentView, params);
                 }
             } catch (WindowManager.BadTokenException e) {
-                Slog.i(TAG, "Filed with with token " + params.token + " gone.");
+                if (sDebug) Slog.d(TAG, "Filed with with token " + params.token + " gone.");
                 mCallback.onDestroy();
             }
         }
diff --git a/services/autofill/java/com/android/server/autofill/ui/Helper.java b/services/autofill/java/com/android/server/autofill/ui/Helper.java
deleted file mode 100644
index 996e421..0000000
--- a/services/autofill/java/com/android/server/autofill/ui/Helper.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * Copyright (C) 2017 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.autofill.ui;
-
-final class Helper {
-
-    static final boolean DEBUG = true; // TODO(b/33197203): set to false when stable
-    static final boolean VERBOSE = false;
-    private Helper() {
-        throw new UnsupportedOperationException("contains static members only");
-    }
-}
diff --git a/services/autofill/java/com/android/server/autofill/ui/SaveUi.java b/services/autofill/java/com/android/server/autofill/ui/SaveUi.java
index cbaaef7..bcdb118 100644
--- a/services/autofill/java/com/android/server/autofill/ui/SaveUi.java
+++ b/services/autofill/java/com/android/server/autofill/ui/SaveUi.java
@@ -16,7 +16,7 @@
 
 package com.android.server.autofill.ui;
 
-import static com.android.server.autofill.ui.Helper.DEBUG;
+import static com.android.server.autofill.Helper.sDebug;
 
 import android.annotation.NonNull;
 import android.app.Dialog;
@@ -42,7 +42,7 @@
  */
 final class SaveUi {
 
-    private static final String TAG = "SaveUi";
+    private static final String TAG = "AutofillSaveUi";
 
     public interface OnSaveListener {
         void onSave();
@@ -61,7 +61,7 @@
 
         @Override
         public void onSave() {
-            if (DEBUG) Slog.d(TAG, "onSave(): " + mDone);
+            if (sDebug) Slog.d(TAG, "onSave(): " + mDone);
             if (mDone) {
                 return;
             }
@@ -71,7 +71,7 @@
 
         @Override
         public void onCancel(IntentSender listener) {
-            if (DEBUG) Slog.d(TAG, "onCancel(): " + mDone);
+            if (sDebug) Slog.d(TAG, "onCancel(): " + mDone);
             if (mDone) {
                 return;
             }
@@ -81,7 +81,7 @@
 
         @Override
         public void onDestroy() {
-            if (DEBUG) Slog.d(TAG, "onDestroy(): " + mDone);
+            if (sDebug) Slog.d(TAG, "onDestroy(): " + mDone);
             if (mDone) {
                 return;
             }
@@ -154,8 +154,9 @@
             subTitleView.setVisibility(View.VISIBLE);
         }
 
-        if (DEBUG) {
-            Slog.d(TAG, "Title: " + title + " SubTitle: " + subTitle);
+        Slog.i(TAG, "Showing save dialog: " + title);
+        if (sDebug) {
+            Slog.d(TAG, "SubTitle: " + subTitle);
         }
 
         final TextView noButton = view.findViewById(R.id.autofill_save_no);
@@ -174,7 +175,7 @@
         closeButton.setOnClickListener((v) -> mListener.onCancel(
                 info.getNegativeActionListener()));
 
-        mDialog = new Dialog(context, R.style.Theme_Material_Panel);
+        mDialog = new Dialog(context, R.style.Theme_DeviceDefault_Light_Panel);
         mDialog.setContentView(view);
 
         final Window window = mDialog.getWindow();
diff --git a/services/companion/java/com/android/server/companion/CompanionDeviceManagerService.java b/services/companion/java/com/android/server/companion/CompanionDeviceManagerService.java
index dc84c45..6093241 100644
--- a/services/companion/java/com/android/server/companion/CompanionDeviceManagerService.java
+++ b/services/companion/java/com/android/server/companion/CompanionDeviceManagerService.java
@@ -414,8 +414,9 @@
 
         Binder.withCleanCallingIdentity(() -> {
             try {
-                if (ArrayUtils.contains(packageInfo.requestedPermissions,
-                        Manifest.permission.RUN_IN_BACKGROUND)) {
+                if (containsEither(packageInfo.requestedPermissions,
+                        Manifest.permission.RUN_IN_BACKGROUND,
+                        Manifest.permission.REQUEST_COMPANION_RUN_IN_BACKGROUND)) {
                     mIdleController.addPowerSaveWhitelistApp(packageInfo.packageName);
                 } else {
                     mIdleController.removePowerSaveWhitelistApp(packageInfo.packageName);
@@ -425,8 +426,9 @@
             }
 
             NetworkPolicyManager networkPolicyManager = NetworkPolicyManager.from(getContext());
-            if (ArrayUtils.contains(packageInfo.requestedPermissions,
-                    Manifest.permission.USE_DATA_IN_BACKGROUND)) {
+            if (containsEither(packageInfo.requestedPermissions,
+                    Manifest.permission.USE_DATA_IN_BACKGROUND,
+                    Manifest.permission.REQUEST_COMPANION_USE_DATA_IN_BACKGROUND)) {
                 networkPolicyManager.addUidPolicy(
                         packageInfo.applicationInfo.uid,
                         NetworkPolicyManager.POLICY_ALLOW_METERED_BACKGROUND);
@@ -438,6 +440,10 @@
         });
     }
 
+    private static <T> boolean containsEither(T[] array, T a, T b) {
+        return ArrayUtils.contains(array, a) || ArrayUtils.contains(array, b);
+    }
+
     @Nullable
     private PackageInfo getPackageInfo(String packageName, int userId) {
         return Binder.withCleanCallingIdentity(() -> {
diff --git a/services/core/java/com/android/server/BluetoothManagerService.java b/services/core/java/com/android/server/BluetoothManagerService.java
index 6c18b26..18b4571 100644
--- a/services/core/java/com/android/server/BluetoothManagerService.java
+++ b/services/core/java/com/android/server/BluetoothManagerService.java
@@ -18,6 +18,7 @@
 
 import android.Manifest;
 import android.app.ActivityManager;
+import android.app.AppGlobals;
 import android.bluetooth.BluetoothAdapter;
 import android.bluetooth.BluetoothProfile;
 import android.bluetooth.IBluetooth;
@@ -37,11 +38,11 @@
 import android.content.IntentFilter;
 import android.content.ServiceConnection;
 import android.content.pm.ApplicationInfo;
+import android.content.pm.IPackageManager;
 import android.content.pm.PackageManager;
 import android.content.pm.UserInfo;
 import android.database.ContentObserver;
 import android.os.Binder;
-import android.os.Build;
 import android.os.Bundle;
 import android.os.Handler;
 import android.os.IBinder;
@@ -50,7 +51,6 @@
 import android.os.Process;
 import android.os.RemoteCallbackList;
 import android.os.RemoteException;
-import android.os.ServiceManager;
 import android.os.SystemClock;
 import android.os.UserHandle;
 import android.os.UserManager;
@@ -61,15 +61,15 @@
 import android.util.Slog;
 
 import com.android.internal.util.DumpUtils;
-import com.android.server.pm.PackageManagerService;
+import com.android.server.pm.UserRestrictionsUtils;
 
 import java.io.FileDescriptor;
 import java.io.PrintWriter;
-import java.util.concurrent.ConcurrentHashMap;
-import java.util.concurrent.locks.ReentrantReadWriteLock;
 import java.util.HashMap;
 import java.util.LinkedList;
 import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.locks.ReentrantReadWriteLock;
 
 
 class BluetoothManagerService extends IBluetoothManager.Stub {
@@ -120,7 +120,6 @@
     private static final int MESSAGE_ADD_PROXY_DELAYED = 400;
     private static final int MESSAGE_BIND_PROFILE_SERVICE = 401;
 
-    private static final int MAX_SAVE_RETRIES = 3;
     private static final int MAX_ERROR_RESTART_RETRIES = 6;
 
     // Bluetooth persisted setting is off
@@ -223,22 +222,25 @@
         @Override
         public void onUserRestrictionsChanged(int userId, Bundle newRestrictions,
                 Bundle prevRestrictions) {
-            if (!newRestrictions.containsKey(UserManager.DISALLOW_BLUETOOTH)
-                    && !prevRestrictions.containsKey(UserManager.DISALLOW_BLUETOOTH)) {
-                // The relevant restriction has not changed - do nothing.
-                return;
+            if (!UserRestrictionsUtils.restrictionsChanged(prevRestrictions, newRestrictions,
+                    UserManager.DISALLOW_BLUETOOTH, UserManager.DISALLOW_BLUETOOTH_SHARING)) {
+                return; // No relevant changes, nothing to do.
             }
-            final boolean bluetoothDisallowed =
-                    newRestrictions.getBoolean(UserManager.DISALLOW_BLUETOOTH);
-            if ((mEnable || mEnableExternal) && bluetoothDisallowed) {
+
+            final boolean disallowed = newRestrictions.getBoolean(UserManager.DISALLOW_BLUETOOTH);
+
+            // DISALLOW_BLUETOOTH is a global restriction that can only be set by DO or PO on the
+            // system user, so we only look at the system user.
+            if (userId == UserHandle.USER_SYSTEM && disallowed && (mEnable || mEnableExternal)) {
                 try {
-                    disable(null, true);
+                    disable(null /* packageName */, true /* persist */);
                 } catch (RemoteException e) {
-                    Slog.w(TAG, "Exception when disabling Bluetooth from UserRestrictionsListener",
-                            e);
+                    Slog.w(TAG, "Exception when disabling Bluetooth", e);
                 }
             }
-            updateOppLauncherComponentState(bluetoothDisallowed);
+            final boolean sharingDisallowed = disallowed
+                    || newRestrictions.getBoolean(UserManager.DISALLOW_BLUETOOTH_SHARING);
+            updateOppLauncherComponentState(userId, sharingDisallowed);
         }
     };
 
@@ -994,11 +996,6 @@
                 LocalServices.getService(UserManagerInternal.class);
         userManagerInternal.addUserRestrictionsListener(mUserRestrictionsListener);
         final boolean isBluetoothDisallowed = isBluetoothDisallowed();
-        PackageManagerService packageManagerService =
-                (PackageManagerService) ServiceManager.getService("package");
-        if (packageManagerService != null && !packageManagerService.isOnlyCoreApps()) {
-            updateOppLauncherComponentState(isBluetoothDisallowed);
-        }
         if (isBluetoothDisallowed) {
             return;
         }
@@ -2074,21 +2071,21 @@
 
     /**
      * Disables BluetoothOppLauncherActivity component, so the Bluetooth sharing option is not
-     * offered to the user if Bluetooth is disallowed. Puts the component to its default state if
-     * Bluetooth is not disallowed.
+     * offered to the user if Bluetooth or sharing is disallowed. Puts the component to its default
+     * state if Bluetooth is not disallowed.
      *
-     * @param bluetoothDisallowed whether the {@link UserManager.DISALLOW_BLUETOOTH} user
-     * restriction was set.
+     * @param userId user to disable bluetooth sharing for.
+     * @param bluetoothSharingDisallowed whether bluetooth sharing is disallowed.
      */
-    private void updateOppLauncherComponentState(boolean bluetoothDisallowed) {
+    private void updateOppLauncherComponentState(int userId, boolean bluetoothSharingDisallowed) {
         final ComponentName oppLauncherComponent = new ComponentName("com.android.bluetooth",
                 "com.android.bluetooth.opp.BluetoothOppLauncherActivity");
-        final int newState = bluetoothDisallowed
+        final int newState = bluetoothSharingDisallowed
                 ? PackageManager.COMPONENT_ENABLED_STATE_DISABLED
                 : PackageManager.COMPONENT_ENABLED_STATE_DEFAULT;
         try {
-            mContext.getPackageManager()
-                    .setComponentEnabledSetting(oppLauncherComponent, newState, 0);
+            final IPackageManager imp = AppGlobals.getPackageManager();
+            imp.setComponentEnabledSetting(oppLauncherComponent, newState, 0 /* flags */, userId);
         } catch (Exception e) {
             // The component was not found, do nothing.
         }
diff --git a/services/core/java/com/android/server/SyntheticPasswordManager.java b/services/core/java/com/android/server/SyntheticPasswordManager.java
index d23584f..6ec74e1 100644
--- a/services/core/java/com/android/server/SyntheticPasswordManager.java
+++ b/services/core/java/com/android/server/SyntheticPasswordManager.java
@@ -82,7 +82,7 @@
     // 256-bit synthetic password
     private static final byte SYNTHETIC_PASSWORD_LENGTH = 256 / 8;
 
-    private static final int PASSWORD_SCRYPT_N = 13;
+    private static final int PASSWORD_SCRYPT_N = 11;
     private static final int PASSWORD_SCRYPT_R = 3;
     private static final int PASSWORD_SCRYPT_P = 1;
     private static final int PASSWORD_SALT_LENGTH = 16;
diff --git a/services/core/java/com/android/server/accounts/AccountManagerService.java b/services/core/java/com/android/server/accounts/AccountManagerService.java
index 018e41b..03da5b2 100644
--- a/services/core/java/com/android/server/accounts/AccountManagerService.java
+++ b/services/core/java/com/android/server/accounts/AccountManagerService.java
@@ -576,6 +576,22 @@
         long identityToken = clearCallingIdentity();
         try {
             UserAccounts accounts = getUserAccounts(userId);
+            if (AccountManager.PACKAGE_NAME_KEY_LEGACY_VISIBLE.equals(packageName)) {
+                int visibility = getAccountVisibilityFromCache(account, packageName, accounts);
+                if (AccountManager.VISIBILITY_UNDEFINED != visibility) {
+                    return visibility;
+                } else {
+                   return AccountManager.VISIBILITY_USER_MANAGED_VISIBLE;
+                }
+            }
+            if (AccountManager.PACKAGE_NAME_KEY_LEGACY_NOT_VISIBLE.equals(packageName)) {
+                int visibility = getAccountVisibilityFromCache(account, packageName, accounts);
+                if (AccountManager.VISIBILITY_UNDEFINED != visibility) {
+                    return visibility;
+                } else {
+                   return AccountManager.VISIBILITY_USER_MANAGED_NOT_VISIBLE;
+                }
+            }
             return resolveAccountVisibility(account, packageName, accounts);
         } finally {
             restoreCallingIdentity(identityToken);
@@ -641,11 +657,6 @@
             return AccountManager.VISIBILITY_VISIBLE; // Authenticator can always see the account
         }
 
-        if (isSpecialPackageKey(packageName)) {
-            Log.d(TAG, "Package name is forbidden: " + packageName);
-            return AccountManager.VISIBILITY_NOT_VISIBLE;
-        }
-
         // Return stored value if it was set.
         int visibility = getAccountVisibilityFromCache(account, packageName, accounts);
 
diff --git a/services/core/java/com/android/server/am/ActiveServices.java b/services/core/java/com/android/server/am/ActiveServices.java
index c6e44e0..d008c5e 100644
--- a/services/core/java/com/android/server/am/ActiveServices.java
+++ b/services/core/java/com/android/server/am/ActiveServices.java
@@ -1868,7 +1868,8 @@
         final boolean newService = app.services.add(r);
         bumpServiceExecutingLocked(r, execInFg, "create");
         mAm.updateLruProcessLocked(app, false, null);
-        updateServiceForegroundLocked(r.app, true);
+        updateServiceForegroundLocked(r.app, /* oomAdj= */ false);
+        mAm.updateOomAdjLocked();
 
         boolean created = false;
         try {
@@ -2150,7 +2151,10 @@
 
         final ServiceMap smap = getServiceMapLocked(r.userId);
         ServiceRecord found = smap.mServicesByName.remove(r.name);
-        if (found != r) {
+
+        // Note when this method is called by bringUpServiceLocked(), the service is not found
+        // in mServicesByName and found will be null.
+        if (found != null && found != r) {
             // This is not actually the service we think is running...  this should not happen,
             // but if it does, fail hard.
             smap.mServicesByName.put(r.name, found);
diff --git a/services/core/java/com/android/server/am/ActivityManagerService.java b/services/core/java/com/android/server/am/ActivityManagerService.java
index 8d1435b..71ef230 100644
--- a/services/core/java/com/android/server/am/ActivityManagerService.java
+++ b/services/core/java/com/android/server/am/ActivityManagerService.java
@@ -12836,7 +12836,7 @@
     public Bundle getAssistContextExtras(int requestType) {
         PendingAssistExtras pae = enqueueAssistContext(requestType, null, null, null,
                 null, null, true /* focused */, true /* newSessionId */,
-                UserHandle.getCallingUserId(), null, PENDING_ASSIST_EXTRAS_TIMEOUT);
+                UserHandle.getCallingUserId(), null, PENDING_ASSIST_EXTRAS_TIMEOUT, 0);
         if (pae == null) {
             return null;
         }
@@ -12906,25 +12906,21 @@
             Bundle receiverExtras, IBinder activityToken, boolean focused, boolean newSessionId) {
         return enqueueAssistContext(requestType, null, null, receiver, receiverExtras,
                 activityToken, focused, newSessionId, UserHandle.getCallingUserId(), null,
-                PENDING_ASSIST_EXTRAS_LONG_TIMEOUT) != null;
+                PENDING_ASSIST_EXTRAS_LONG_TIMEOUT, 0) != null;
     }
 
     @Override
     public boolean requestAutofillData(IResultReceiver receiver, Bundle receiverExtras,
-            IBinder activityToken) {
-        // NOTE: we could always use ActivityManager.ASSIST_CONTEXT_FULL and let ActivityThread
-        // rely on the flags to decide whether the handleRequestAssistContextExtras() is for
-        // autofill, but it's safer to explicitly use new AutoFill types, in case the Assist
-        // requests use flags in the future as well (since their flags value might collide with the
-        // autofill flag values).
+            IBinder activityToken, int flags) {
         return enqueueAssistContext(ActivityManager.ASSIST_CONTEXT_AUTOFILL, null, null,
                 receiver, receiverExtras, activityToken, true, true, UserHandle.getCallingUserId(),
-                null, PENDING_AUTOFILL_ASSIST_STRUCTURE_TIMEOUT) != null;
+                null, PENDING_AUTOFILL_ASSIST_STRUCTURE_TIMEOUT, flags) != null;
     }
 
     private PendingAssistExtras enqueueAssistContext(int requestType, Intent intent, String hint,
             IResultReceiver receiver, Bundle receiverExtras, IBinder activityToken,
-            boolean focused, boolean newSessionId, int userHandle, Bundle args, long timeout) {
+            boolean focused, boolean newSessionId, int userHandle, Bundle args, long timeout,
+            int flags) {
         enforceCallingPermission(android.Manifest.permission.GET_TOP_ACTIVITY_INFO,
                 "enqueueAssistContext()");
 
@@ -12974,7 +12970,7 @@
             }
             try {
                 activity.app.thread.requestAssistContextExtras(activity.appToken, pae, requestType,
-                        mViSessionId);
+                        mViSessionId, flags);
                 mPendingAssistExtras.add(pae);
                 mUiHandler.postDelayed(pae, timeout);
             } catch (RemoteException e) {
@@ -13086,7 +13082,7 @@
             Bundle args) {
         return enqueueAssistContext(requestType, intent, hint, null, null, null,
                 true /* focused */, true /* newSessionId */, userHandle, args,
-                PENDING_ASSIST_EXTRAS_TIMEOUT) != null;
+                PENDING_ASSIST_EXTRAS_TIMEOUT, 0) != null;
     }
 
     public void registerProcessObserver(IProcessObserver observer) {
@@ -14644,8 +14640,10 @@
     }
 
     static int procStateToImportance(int procState, int memAdj,
-            ActivityManager.RunningAppProcessInfo currApp) {
-        int imp = ActivityManager.RunningAppProcessInfo.procStateToImportance(procState);
+            ActivityManager.RunningAppProcessInfo currApp,
+            int clientTargetSdk) {
+        int imp = ActivityManager.RunningAppProcessInfo.procStateToImportanceForTargetSdk(
+                procState, clientTargetSdk);
         if (imp == ActivityManager.RunningAppProcessInfo.IMPORTANCE_BACKGROUND) {
             currApp.lru = memAdj;
         } else {
@@ -14655,7 +14653,8 @@
     }
 
     private void fillInProcMemInfo(ProcessRecord app,
-            ActivityManager.RunningAppProcessInfo outInfo) {
+            ActivityManager.RunningAppProcessInfo outInfo,
+            int clientTargetSdk) {
         outInfo.pid = app.pid;
         outInfo.uid = app.info.uid;
         if (mHeavyWeightProcess == app) {
@@ -14670,7 +14669,7 @@
         outInfo.lastTrimLevel = app.trimMemoryLevel;
         int adj = app.curAdj;
         int procState = app.curProcState;
-        outInfo.importance = procStateToImportance(procState, adj, outInfo);
+        outInfo.importance = procStateToImportance(procState, adj, outInfo, clientTargetSdk);
         outInfo.importanceReasonCode = app.adjTypeCode;
         outInfo.processState = app.curProcState;
     }
@@ -14680,6 +14679,7 @@
         enforceNotIsolatedCaller("getRunningAppProcesses");
 
         final int callingUid = Binder.getCallingUid();
+        final int clientTargetSdk = mPackageManagerInt.getUidTargetSdkVersion(callingUid);
 
         // Lazy instantiation of list
         List<ActivityManager.RunningAppProcessInfo> runList = null;
@@ -14702,7 +14702,7 @@
                     ActivityManager.RunningAppProcessInfo currApp =
                         new ActivityManager.RunningAppProcessInfo(app.processName,
                                 app.pid, app.getPackageList());
-                    fillInProcMemInfo(app, currApp);
+                    fillInProcMemInfo(app, currApp, clientTargetSdk);
                     if (app.adjSource instanceof ProcessRecord) {
                         currApp.importanceReasonPid = ((ProcessRecord)app.adjSource).pid;
                         currApp.importanceReasonImportance =
@@ -14758,12 +14758,16 @@
     @Override
     public void getMyMemoryState(ActivityManager.RunningAppProcessInfo outInfo) {
         enforceNotIsolatedCaller("getMyMemoryState");
+
+        final int callingUid = Binder.getCallingUid();
+        final int clientTargetSdk = mPackageManagerInt.getUidTargetSdkVersion(callingUid);
+
         synchronized (this) {
             ProcessRecord proc;
             synchronized (mPidsSelfLocked) {
                 proc = mPidsSelfLocked.get(Binder.getCallingPid());
             }
-            fillInProcMemInfo(proc, outInfo);
+            fillInProcMemInfo(proc, outInfo, clientTargetSdk);
         }
     }
 
@@ -19715,12 +19719,12 @@
             ActiveInstrumentation activeInstr = new ActiveInstrumentation(this);
             activeInstr.mClass = className;
             String defProcess = ai.processName;;
-            if (ii.targetProcess == null) {
+            if (ii.targetProcesses == null) {
                 activeInstr.mTargetProcesses = new String[]{ai.processName};
-            } else if (ii.targetProcess.equals("*")) {
+            } else if (ii.targetProcesses.equals("*")) {
                 activeInstr.mTargetProcesses = new String[0];
             } else {
-                activeInstr.mTargetProcesses = ii.targetProcess.split(",");
+                activeInstr.mTargetProcesses = ii.targetProcesses.split(",");
                 defProcess = activeInstr.mTargetProcesses[0];
             }
             activeInstr.mTargetInfo = ai;
@@ -21722,9 +21726,11 @@
                         }
                     }
                 } catch (Exception e) {
-                    Slog.w(TAG, "Failed setting process group of " + app.pid
-                            + " to " + app.curSchedGroup);
-                    e.printStackTrace();
+                    if (false) {
+                        Slog.w(TAG, "Failed setting process group of " + app.pid
+                                + " to " + app.curSchedGroup);
+                        Slog.w(TAG, "at location", e);
+                    }
                 } finally {
                     Binder.restoreCallingIdentity(oldId);
                 }
diff --git a/services/core/java/com/android/server/am/ActivityStack.java b/services/core/java/com/android/server/am/ActivityStack.java
index 728a3b9..82e2a3d 100644
--- a/services/core/java/com/android/server/am/ActivityStack.java
+++ b/services/core/java/com/android/server/am/ActivityStack.java
@@ -3301,13 +3301,21 @@
 
         final ActivityRecord next = topRunningActivityLocked();
         final String myReason = reason + " adjustFocus";
+
         if (next != r) {
             if (next != null && StackId.keepFocusInStackIfPossible(mStackId) && isFocusable()) {
                 // For freeform, docked, and pinned stacks we always keep the focus within the
                 // stack as long as there is a running activity.
                 return;
             } else {
+                // Task is not guaranteed to be non-null. For example, destroying the
+                // {@link ActivityRecord} will disassociate the task from the activity.
                 final TaskRecord task = r.getTask();
+
+                if (task == null) {
+                    throw new IllegalStateException("activity no longer associated with task:" + r);
+                }
+
                 final boolean isAssistantOrOverAssistant = task.getStack().isAssistantStack() ||
                         task.isOverAssistantStack();
                 if (r.frontOfTask && isATopFinishingTask(task)
@@ -3373,8 +3381,8 @@
                     if (DEBUG_STATES) Slog.d(TAG_STATES, "no-history finish of " + r);
                     if (requestFinishActivityLocked(r.appToken, Activity.RESULT_CANCELED, null,
                             "stop-no-history", false)) {
-                        // Activity was finished, no need to continue trying to schedule stop.
-                        adjustFocusedActivityStackLocked(r, "stopActivityFinished");
+                        // If {@link requestFinishActivityLocked} returns {@code true},
+                        // {@link adjustFocusedActivityStackLocked} would have been already called.
                         r.resumeKeyDispatchingLocked();
                         return;
                     }
diff --git a/services/core/java/com/android/server/am/ActivityStackSupervisor.java b/services/core/java/com/android/server/am/ActivityStackSupervisor.java
index bff3ce3..dfeff52 100644
--- a/services/core/java/com/android/server/am/ActivityStackSupervisor.java
+++ b/services/core/java/com/android/server/am/ActivityStackSupervisor.java
@@ -110,7 +110,6 @@
 import android.app.ActivityOptions;
 import android.app.AppOpsManager;
 import android.app.IActivityContainerCallback;
-import android.app.ITaskStackListener;
 import android.app.ProfilerInfo;
 import android.app.ResultInfo;
 import android.app.StatusBarManager;
@@ -157,7 +156,6 @@
 import android.provider.Settings;
 import android.provider.Settings.SettingNotFoundException;
 import android.service.voice.IVoiceInteractionSession;
-import android.text.TextUtils;
 import android.util.ArrayMap;
 import android.util.ArraySet;
 import android.util.EventLog;
@@ -1129,7 +1127,7 @@
         mActivitiesWaitingForVisibleActivity.remove(r);
 
         for (int i = mWaitingForActivityVisible.size() - 1; i >= 0; --i) {
-            if (mWaitingForActivityVisible.get(i).matches(r)) {
+            if (mWaitingForActivityVisible.get(i).matches(r.realActivity)) {
                 mWaitingForActivityVisible.remove(i);
             }
         }
@@ -1143,7 +1141,7 @@
         boolean changed = false;
         for (int i = mWaitingForActivityVisible.size() - 1; i >= 0; --i) {
             final WaitInfo w = mWaitingForActivityVisible.get(i);
-            if (w.matches(r)) {
+            if (w.matches(r.realActivity)) {
                 final WaitResult result = w.getResult();
                 changed = true;
                 result.timeout = false;
@@ -3944,10 +3942,11 @@
     }
 
     private StackInfo getStackInfoLocked(ActivityStack stack) {
-        final ActivityDisplay display = mActivityDisplays.get(DEFAULT_DISPLAY);
+        final int displayId = stack.mDisplayId;
+        final ActivityDisplay display = mActivityDisplays.get(displayId);
         StackInfo info = new StackInfo();
         stack.getWindowContainerBounds(info.bounds);
-        info.displayId = DEFAULT_DISPLAY;
+        info.displayId = displayId;
         info.stackId = stack.mStackId;
         info.userId = stack.mCurrentUser;
         info.visible = stack.shouldBeVisible(null) == STACK_VISIBLE;
@@ -5140,10 +5139,8 @@
             this.mResult = result;
         }
 
-        public boolean matches(ActivityRecord record) {
-            return mTargetComponent == null ||
-                    (TextUtils.equals(mTargetComponent.getPackageName(), record.info.packageName)
-                            && TextUtils.equals(mTargetComponent.getClassName(), record.info.name));
+        public boolean matches(ComponentName targetComponent) {
+            return mTargetComponent == null || mTargetComponent.equals(targetComponent);
         }
 
         public WaitResult getResult() {
diff --git a/services/core/java/com/android/server/am/ActivityStarter.java b/services/core/java/com/android/server/am/ActivityStarter.java
index 1f4b21b1..ca842d55 100644
--- a/services/core/java/com/android/server/am/ActivityStarter.java
+++ b/services/core/java/com/android/server/am/ActivityStarter.java
@@ -245,6 +245,9 @@
             ActivityRecord[] outActivity, ActivityStackSupervisor.ActivityContainer container,
             TaskRecord inTask) {
         int err = ActivityManager.START_SUCCESS;
+        // Pull the optional Ephemeral Installer-only bundle out of the options early.
+        final Bundle verificationBundle
+                = options != null ? options.popAppVerificationBundle() : null;
 
         ProcessRecord callerApp = null;
         if (caller != null) {
@@ -466,7 +469,7 @@
         // app [on install success].
         if (rInfo != null && rInfo.auxiliaryInfo != null) {
             intent = createLaunchIntent(rInfo.auxiliaryInfo, ephemeralIntent,
-                    callingPackage, resolvedType, userId);
+                    callingPackage, verificationBundle, resolvedType, userId);
             resolvedType = null;
             callingUid = realCallingUid;
             callingPid = realCallingPid;
@@ -522,14 +525,16 @@
      * Creates a launch intent for the given auxiliary resolution data.
      */
     private @NonNull Intent createLaunchIntent(@NonNull AuxiliaryResolveInfo auxiliaryResponse,
-            Intent originalIntent, String callingPackage, String resolvedType, int userId) {
+            Intent originalIntent, String callingPackage, Bundle verificationBundle,
+            String resolvedType, int userId) {
         if (auxiliaryResponse.needsPhaseTwo) {
             // request phase two resolution
             mService.getPackageManagerInternalLocked().requestInstantAppResolutionPhaseTwo(
-                    auxiliaryResponse, originalIntent, resolvedType, callingPackage, userId);
+                    auxiliaryResponse, originalIntent, resolvedType, callingPackage,
+                    verificationBundle, userId);
         }
         return InstantAppResolver.buildEphemeralInstallerIntent(originalIntent,
-            callingPackage, resolvedType, userId, auxiliaryResponse.packageName,
+            callingPackage, verificationBundle, resolvedType, userId, auxiliaryResponse.packageName,
             auxiliaryResponse.splitName, auxiliaryResponse.versionCode,
             auxiliaryResponse.token, auxiliaryResponse.needsPhaseTwo);
     }
diff --git a/services/core/java/com/android/server/am/AppErrors.java b/services/core/java/com/android/server/am/AppErrors.java
index ba72dcf..d6bfb35 100644
--- a/services/core/java/com/android/server/am/AppErrors.java
+++ b/services/core/java/com/android/server/am/AppErrors.java
@@ -751,6 +751,26 @@
         mAppsNotReportingCrashes.add(proc.info.packageName);
     }
 
+    static boolean isInterestingForBackgroundTraces(ProcessRecord app) {
+        // The system_server is always considered interesting.
+        if (app.pid == MY_PID) {
+            return true;
+        }
+
+        // A package is considered interesting if any of the following is true :
+        //
+        // - It's displaying an activity.
+        // - It's the SystemUI.
+        // - It has an overlay or a top UI visible.
+        //
+        // NOTE: The check whether a given ProcessRecord belongs to the systemui
+        // process is a bit of a kludge, but the same pattern seems repeated at
+        // several places in the system server.
+        return app.isInterestingToUserLocked() ||
+            (app.info != null && "com.android.systemui".equals(app.info.packageName)) ||
+            (app.hasTopUi || app.hasOverlayUi);
+    }
+
     final void appNotResponding(ProcessRecord app, ActivityRecord activity,
             ActivityRecord parent, boolean aboveSystem, final String annotation) {
         ArrayList<Integer> firstPids = new ArrayList<Integer>(5);
@@ -812,7 +832,7 @@
             firstPids.add(app.pid);
 
             // Don't dump other PIDs if it's a background ANR
-            isSilentANR = !showBackground && !app.isInterestingToUserLocked() && app.pid != MY_PID;
+            isSilentANR = !showBackground && !isInterestingForBackgroundTraces(app);
             if (!isSilentANR) {
                 int parentPid = app.pid;
                 if (parent != null && parent.app != null && parent.app.pid > 0) {
diff --git a/services/core/java/com/android/server/am/KeyguardController.java b/services/core/java/com/android/server/am/KeyguardController.java
index dd16e22..144eb11 100644
--- a/services/core/java/com/android/server/am/KeyguardController.java
+++ b/services/core/java/com/android/server/am/KeyguardController.java
@@ -95,6 +95,7 @@
             return;
         }
         mKeyguardShowing = showing;
+        dismissDockedStackIfNeeded();
         if (showing) {
             mKeyguardGoingAway = false;
             mDismissalRequested = false;
diff --git a/services/core/java/com/android/server/am/ProcessRecord.java b/services/core/java/com/android/server/am/ProcessRecord.java
index 3c5c5fd..b025385 100644
--- a/services/core/java/com/android/server/am/ProcessRecord.java
+++ b/services/core/java/com/android/server/am/ProcessRecord.java
@@ -520,6 +520,14 @@
                 return true;
             }
         }
+
+        final int servicesSize = services.size();
+        for (int i = 0; i < servicesSize; i++) {
+            ServiceRecord r = services.valueAt(i);
+            if (r.isForeground) {
+                return true;
+            }
+        }
         return false;
     }
 
diff --git a/services/core/java/com/android/server/am/ServiceRecord.java b/services/core/java/com/android/server/am/ServiceRecord.java
index 42c405f..027dc08 100644
--- a/services/core/java/com/android/server/am/ServiceRecord.java
+++ b/services/core/java/com/android/server/am/ServiceRecord.java
@@ -495,8 +495,9 @@
                                         Settings.ACTION_APPLICATION_DETAILS_SETTINGS);
                                 runningIntent.setData(Uri.fromParts("package",
                                         appInfo.packageName, null));
-                                PendingIntent pi = PendingIntent.getActivity(ams.mContext, 0,
-                                        runningIntent, PendingIntent.FLAG_UPDATE_CURRENT);
+                                PendingIntent pi = PendingIntent.getActivityAsUser(ams.mContext, 0,
+                                        runningIntent, PendingIntent.FLAG_UPDATE_CURRENT, null,
+                                        UserHandle.of(userId));
                                 notiBuilder.setColor(ams.mContext.getColor(
                                         com.android.internal
                                                 .R.color.system_notification_accent_color));
diff --git a/services/core/java/com/android/server/audio/AudioService.java b/services/core/java/com/android/server/audio/AudioService.java
index 742ee35..e2b838f 100644
--- a/services/core/java/com/android/server/audio/AudioService.java
+++ b/services/core/java/com/android/server/audio/AudioService.java
@@ -232,6 +232,7 @@
     private static final int MSG_UNMUTE_STREAM = 24;
     private static final int MSG_DYN_POLICY_MIX_STATE_UPDATE = 25;
     private static final int MSG_INDICATE_SYSTEM_READY = 26;
+    private static final int MSG_ACCESSORY_PLUG_MEDIA_UNMUTE = 27;
     // start of messages handled under wakelock
     //   these messages can only be queued, i.e. sent with queueMsgUnderWakeLock(),
     //   and not with sendMsg(..., ..., SENDMSG_QUEUE, ...)
@@ -3964,6 +3965,33 @@
         }
     }
 
+    private static final int DEVICE_MEDIA_UNMUTED_ON_PLUG =
+            AudioSystem.DEVICE_OUT_WIRED_HEADSET | AudioSystem.DEVICE_OUT_WIRED_HEADPHONE |
+            AudioSystem.DEVICE_OUT_LINE |
+            AudioSystem.DEVICE_OUT_ALL_A2DP |
+            AudioSystem.DEVICE_OUT_ALL_USB |
+            AudioSystem.DEVICE_OUT_HDMI;
+
+    private void onAccessoryPlugMediaUnmute(int newDevice) {
+        if (DEBUG_VOL) {
+            Log.i(TAG, String.format("onAccessoryPlugMediaUnmute newDevice=%d [%s]",
+                    newDevice, AudioSystem.getOutputDeviceName(newDevice)));
+        }
+        synchronized (mConnectedDevices) {
+            if ((newDevice & DEVICE_MEDIA_UNMUTED_ON_PLUG) != 0
+                    && mStreamStates[AudioSystem.STREAM_MUSIC].mIsMuted
+                    && mStreamStates[AudioSystem.STREAM_MUSIC].getIndex(newDevice) != 0
+                    && (newDevice & AudioSystem.getDevicesForStream(AudioSystem.STREAM_MUSIC)) != 0)
+            {
+                if (DEBUG_VOL) {
+                    Log.i(TAG, String.format(" onAccessoryPlugMediaUnmute unmuting device=%d [%s]",
+                            newDevice, AudioSystem.getOutputDeviceName(newDevice)));
+                }
+                mStreamStates[AudioSystem.STREAM_MUSIC].mute(false);
+            }
+        }
+    }
+
     ///////////////////////////////////////////////////////////////////////////
     // Inner classes
     ///////////////////////////////////////////////////////////////////////////
@@ -4854,6 +4882,10 @@
                     onIndicateSystemReady();
                     break;
 
+                case MSG_ACCESSORY_PLUG_MEDIA_UNMUTE:
+                    onAccessoryPlugMediaUnmute(msg.arg1);
+                    break;
+
                 case MSG_PERSIST_MUSIC_ACTIVE_MS:
                     final int musicActiveMs = msg.arg1;
                     Settings.Secure.putIntForUser(mContentResolver,
@@ -4942,7 +4974,7 @@
 
     // must be called synchronized on mConnectedDevices
     private void makeA2dpDeviceAvailable(String address, String name) {
-        // enable A2DP before notifying A2DP connection to avoid unecessary processing in
+        // enable A2DP before notifying A2DP connection to avoid unnecessary processing in
         // audio policy manager
         VolumeStreamState streamState = mStreamStates[AudioSystem.STREAM_MUSIC];
         sendMsg(mAudioHandler, MSG_SET_DEVICE_VOLUME, SENDMSG_QUEUE,
@@ -4956,6 +4988,8 @@
                 makeDeviceListKey(AudioSystem.DEVICE_OUT_BLUETOOTH_A2DP, address),
                 new DeviceListSpec(AudioSystem.DEVICE_OUT_BLUETOOTH_A2DP, name,
                                    address));
+        sendMsg(mAudioHandler, MSG_ACCESSORY_PLUG_MEDIA_UNMUTE, SENDMSG_QUEUE,
+                AudioSystem.DEVICE_OUT_BLUETOOTH_A2DP, 0, null, 0);
     }
 
     private void onSendBecomingNoisyIntent() {
@@ -5115,7 +5149,7 @@
 
     private void onBluetoothA2dpDeviceConfigChange(BluetoothDevice btDevice)
     {
-        if (DEBUG_VOL) {
+        if (DEBUG_DEVICES) {
             Log.d(TAG, "onBluetoothA2dpDeviceConfigChange btDevice=" + btDevice);
         }
         if (btDevice == null) {
@@ -5132,8 +5166,13 @@
             final DeviceListSpec deviceSpec = mConnectedDevices.get(key);
             if (deviceSpec != null) {
                 // Device is connected
-                AudioSystem.handleDeviceConfigChange(device, address,
-                        btDevice.getName());
+               if (AudioSystem.handleDeviceConfigChange(device, address,
+                        btDevice.getName()) != AudioSystem.AUDIO_STATUS_OK) {
+                   // force A2DP device disconnection in case of error so that AudioService state is
+                   // consistent with audio policy manager state
+                   setBluetoothA2dpDeviceConnectionState(
+                           btDevice, BluetoothA2dp.STATE_DISCONNECTED, BluetoothProfile.A2DP_SINK);
+               }
             }
         }
     }
@@ -5176,6 +5215,8 @@
                     return false;
                 }
                 mConnectedDevices.put(deviceKey, new DeviceListSpec(device, deviceName, address));
+                sendMsg(mAudioHandler, MSG_ACCESSORY_PLUG_MEDIA_UNMUTE, SENDMSG_QUEUE,
+                        device, 0, null, 0);
                 return true;
             } else if (!connect && isConnected) {
                 AudioSystem.setDeviceConnectionState(device,
@@ -6182,6 +6223,7 @@
         pw.print("  mCameraSoundForced="); pw.println(mCameraSoundForced);
         pw.print("  mHasVibrator="); pw.println(mHasVibrator);
         pw.print("  mVolumePolicy="); pw.println(mVolumePolicy);
+        pw.print("  mAvrcpAbsVolSupported="); pw.println(mAvrcpAbsVolSupported);
 
         dumpAudioPolicies(pw);
 
diff --git a/services/core/java/com/android/server/connectivity/Tethering.java b/services/core/java/com/android/server/connectivity/Tethering.java
index ac5fb43..b42242e 100644
--- a/services/core/java/com/android/server/connectivity/Tethering.java
+++ b/services/core/java/com/android/server/connectivity/Tethering.java
@@ -218,6 +218,10 @@
         return (ConnectivityManager) mContext.getSystemService(Context.CONNECTIVITY_SERVICE);
     }
 
+    private WifiManager getWifiManager() {
+        return (WifiManager) mContext.getSystemService(Context.WIFI_SERVICE);
+    }
+
     private void updateConfiguration() {
         mConfig = new TetheringConfiguration(mContext);
     }
@@ -396,9 +400,9 @@
     private int setWifiTethering(final boolean enable) {
         synchronized (mPublicSync) {
             mWifiTetherRequested = enable;
-            final WifiManager wifiManager =
-                    (WifiManager) mContext.getSystemService(Context.WIFI_SERVICE);
-            if (wifiManager.setWifiApEnabled(null /* use existing wifi config */, enable)) {
+            final WifiManager wifiManager = getWifiManager();
+            if ((enable && wifiManager.startSoftAp(null /* use existing wifi config */)) ||
+                (!enable && wifiManager.stopSoftAp())) {
                 return ConnectivityManager.TETHER_ERROR_NO_ERROR;
             }
             return ConnectivityManager.TETHER_ERROR_MASTER_ERROR;
@@ -1420,12 +1424,37 @@
             } else {
                 mForwardedDownstreams.remove(who);
             }
+
+            // If this is a Wi-Fi interface, notify WifiManager of the active serving state.
+            if (who.interfaceType() == ConnectivityManager.TETHERING_WIFI) {
+                final WifiManager mgr = getWifiManager();
+                final String iface = who.interfaceName();
+                switch (mode) {
+                    case IControlsTethering.STATE_TETHERED:
+                        mgr.updateInterfaceIpState(iface, WifiManager.IFACE_IP_MODE_TETHERED);
+                        break;
+                    case IControlsTethering.STATE_LOCAL_ONLY:
+                        mgr.updateInterfaceIpState(iface, WifiManager.IFACE_IP_MODE_LOCAL_ONLY);
+                        break;
+                    default:
+                        Log.wtf(TAG, "Unknown active serving mode: " + mode);
+                        break;
+                }
+            }
         }
 
         private void handleInterfaceServingStateInactive(TetherInterfaceStateMachine who) {
             mNotifyList.remove(who);
             mIPv6TetheringCoordinator.removeActiveDownstream(who);
             mForwardedDownstreams.remove(who);
+
+            // If this is a Wi-Fi interface, tell WifiManager of any errors.
+            if (who.interfaceType() == ConnectivityManager.TETHERING_WIFI) {
+                if (who.lastError() != ConnectivityManager.TETHER_ERROR_NO_ERROR) {
+                    getWifiManager().updateInterfaceIpState(
+                            who.interfaceName(), WifiManager.IFACE_IP_MODE_CONFIGURATION_ERROR);
+                }
+            }
         }
 
         class InitialState extends State {
@@ -1742,7 +1771,7 @@
     public void notifyInterfaceStateChange(String iface, TetherInterfaceStateMachine who,
                                            int state, int error) {
         synchronized (mPublicSync) {
-            TetherState tetherState = mTetherStates.get(iface);
+            final TetherState tetherState = mTetherStates.get(iface);
             if (tetherState != null && tetherState.stateMachine.equals(who)) {
                 tetherState.lastState = state;
                 tetherState.lastError = error;
diff --git a/services/core/java/com/android/server/connectivity/tethering/TetherInterfaceStateMachine.java b/services/core/java/com/android/server/connectivity/tethering/TetherInterfaceStateMachine.java
index e21349a..d3cfd87 100644
--- a/services/core/java/com/android/server/connectivity/tethering/TetherInterfaceStateMachine.java
+++ b/services/core/java/com/android/server/connectivity/tethering/TetherInterfaceStateMachine.java
@@ -117,9 +117,11 @@
         setInitialState(mInitialState);
     }
 
-    public int interfaceType() {
-        return mInterfaceType;
-    }
+    public String interfaceName() { return mIfaceName; }
+
+    public int interfaceType() { return mInterfaceType; }
+
+    public int lastError() { return mLastError; }
 
     // configured when we start tethering and unconfig'd on error or conclusion
     private boolean configureIfaceIp(boolean enabled) {
diff --git a/services/core/java/com/android/server/dreams/DreamManagerService.java b/services/core/java/com/android/server/dreams/DreamManagerService.java
index 313abab..dbccc07 100644
--- a/services/core/java/com/android/server/dreams/DreamManagerService.java
+++ b/services/core/java/com/android/server/dreams/DreamManagerService.java
@@ -353,6 +353,7 @@
                 && mCurrentDreamIsTest == isTest
                 && mCurrentDreamCanDoze == canDoze
                 && mCurrentDreamUserId == userId) {
+            Slog.i(TAG, "Already in target dream.");
             return;
         }
 
@@ -388,6 +389,7 @@
             mHandler.post(new Runnable() {
                 @Override
                 public void run() {
+                    Slog.i(TAG, "Performing gentle wake from dream.");
                     mController.stopDream(immediate);
                 }
             });
diff --git a/services/core/java/com/android/server/job/JobSchedulerShellCommand.java b/services/core/java/com/android/server/job/JobSchedulerShellCommand.java
index 848704e..1c31c3e 100644
--- a/services/core/java/com/android/server/job/JobSchedulerShellCommand.java
+++ b/services/core/java/com/android/server/job/JobSchedulerShellCommand.java
@@ -109,44 +109,49 @@
         final String pkgName = getNextArgRequired();
         final int jobId = Integer.parseInt(getNextArgRequired());
 
-        int ret = mInternal.executeRunCommand(pkgName, userId, jobId, force);
-        switch (ret) {
-            case CMD_ERR_NO_PACKAGE:
-                pw.print("Package not found: ");
-                pw.print(pkgName);
-                pw.print(" / user ");
-                pw.println(userId);
-                break;
+        final long ident = Binder.clearCallingIdentity();
+        try {
+            int ret = mInternal.executeRunCommand(pkgName, userId, jobId, force);
+            switch (ret) {
+                case CMD_ERR_NO_PACKAGE:
+                    pw.print("Package not found: ");
+                    pw.print(pkgName);
+                    pw.print(" / user ");
+                    pw.println(userId);
+                    break;
 
-            case CMD_ERR_NO_JOB:
-                pw.print("Could not find job ");
-                pw.print(jobId);
-                pw.print(" in package ");
-                pw.print(pkgName);
-                pw.print(" / user ");
-                pw.println(userId);
-                break;
+                case CMD_ERR_NO_JOB:
+                    pw.print("Could not find job ");
+                    pw.print(jobId);
+                    pw.print(" in package ");
+                    pw.print(pkgName);
+                    pw.print(" / user ");
+                    pw.println(userId);
+                    break;
 
-            case CMD_ERR_CONSTRAINTS:
-                pw.print("Job ");
-                pw.print(jobId);
-                pw.print(" in package ");
-                pw.print(pkgName);
-                pw.print(" / user ");
-                pw.print(userId);
-                pw.println(" has functional constraints but --force not specified");
-                break;
+                case CMD_ERR_CONSTRAINTS:
+                    pw.print("Job ");
+                    pw.print(jobId);
+                    pw.print(" in package ");
+                    pw.print(pkgName);
+                    pw.print(" / user ");
+                    pw.print(userId);
+                    pw.println(" has functional constraints but --force not specified");
+                    break;
 
-            default:
-                // success!
-                pw.print("Running job");
-                if (force) {
-                    pw.print(" [FORCED]");
-                }
-                pw.println();
-                break;
+                default:
+                    // success!
+                    pw.print("Running job");
+                    if (force) {
+                        pw.print(" [FORCED]");
+                    }
+                    pw.println();
+                    break;
+            }
+            return ret;
+        } finally {
+            Binder.restoreCallingIdentity(ident);
         }
-        return ret;
     }
 
     private int runMonitorBattery(PrintWriter pw) throws Exception {
diff --git a/services/core/java/com/android/server/location/GeofenceManager.java b/services/core/java/com/android/server/location/GeofenceManager.java
index e24bf76..2493dfb 100644
--- a/services/core/java/com/android/server/location/GeofenceManager.java
+++ b/services/core/java/com/android/server/location/GeofenceManager.java
@@ -23,8 +23,10 @@
 
 import android.app.AppOpsManager;
 import android.app.PendingIntent;
+import android.content.ContentResolver;
 import android.content.Context;
 import android.content.Intent;
+import android.database.ContentObserver;
 import android.location.Geofence;
 import android.location.Location;
 import android.location.LocationListener;
@@ -35,6 +37,8 @@
 import android.os.Message;
 import android.os.PowerManager;
 import android.os.SystemClock;
+import android.os.UserHandle;
+import android.provider.Settings;
 import android.util.Slog;
 
 import com.android.server.LocationManagerService;
@@ -58,9 +62,9 @@
     private static final long MAX_AGE_NANOS = 5 * 60 * 1000000000L; // five minutes
 
     /**
-     * Most frequent update interval allowed.
+     * The default value of most frequent update interval allowed.
      */
-    private static final long MIN_INTERVAL_MS = 1 * 60 * 1000; // one minute
+    private static final long DEFAULT_MIN_INTERVAL_MS = 30 * 60 * 1000; // 30 minutes
 
     /**
      * Least frequent update interval allowed.
@@ -106,6 +110,12 @@
      */
     private boolean mPendingUpdate;
 
+    /**
+     * The actual value of most frequent update interval allowed.
+     */
+    private long mEffectiveMinIntervalMs;
+    private ContentResolver mResolver;
+
     public GeofenceManager(Context context, LocationBlacklist blacklist) {
         mContext = context;
         mLocationManager = (LocationManager) mContext.getSystemService(Context.LOCATION_SERVICE);
@@ -114,6 +124,28 @@
         mWakeLock = powerManager.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, TAG);
         mHandler = new GeofenceHandler();
         mBlacklist = blacklist;
+        mResolver = mContext.getContentResolver();
+        updateMinInterval();
+        mResolver.registerContentObserver(
+            Settings.Global.getUriFor(
+                    Settings.Global.LOCATION_BACKGROUND_THROTTLE_PROXIMITY_ALERT_INTERVAL_MS),
+            true,
+            new ContentObserver(mHandler) {
+                @Override
+                public void onChange(boolean selfChange) {
+                    synchronized (mLock) {
+                        updateMinInterval();
+                    }
+                }
+            }, UserHandle.USER_ALL);
+    }
+
+    /**
+     * Updates the minimal location request frequency.
+     */
+    private void updateMinInterval() {
+        mEffectiveMinIntervalMs = Settings.Global.getLong(mResolver,
+                Settings.Global.LOCATION_BACKGROUND_THROTTLE_INTERVAL_MS, DEFAULT_MIN_INTERVAL_MS);
     }
 
     public void addFence(LocationRequest request, Geofence geofence, PendingIntent intent,
@@ -301,10 +333,10 @@
                 // Compute a location update interval based on the distance to the nearest fence.
                 long intervalMs;
                 if (location != null && Double.compare(minFenceDistance, Double.MAX_VALUE) != 0) {
-                    intervalMs = (long)Math.min(MAX_INTERVAL_MS, Math.max(MIN_INTERVAL_MS,
+                    intervalMs = (long)Math.min(MAX_INTERVAL_MS, Math.max(mEffectiveMinIntervalMs,
                             minFenceDistance * 1000 / MAX_SPEED_M_S));
                 } else {
-                    intervalMs = MIN_INTERVAL_MS;
+                    intervalMs = mEffectiveMinIntervalMs;
                 }
                 if (!mReceivingLocationUpdates || mLocationUpdateInterval != intervalMs) {
                     mReceivingLocationUpdates = true;
diff --git a/services/core/java/com/android/server/net/NetworkPolicyManagerService.java b/services/core/java/com/android/server/net/NetworkPolicyManagerService.java
index c802179..d9ca00c 100644
--- a/services/core/java/com/android/server/net/NetworkPolicyManagerService.java
+++ b/services/core/java/com/android/server/net/NetworkPolicyManagerService.java
@@ -2879,17 +2879,11 @@
             final List<UserInfo> users = mUserManager.getUsers();
             for (int ui = users.size() - 1; ui >= 0; ui--) {
                 UserInfo user = users.get(ui);
-                for (int i = mPowerSaveTempWhitelistAppIds.size() - 1; i >= 0; i--) {
-                    if (mPowerSaveTempWhitelistAppIds.valueAt(i)) {
-                        int appId = mPowerSaveTempWhitelistAppIds.keyAt(i);
-                        int uid = UserHandle.getUid(user.id, appId);
-                        uidRules.put(uid, FIREWALL_RULE_ALLOW);
-                    }
-                }
-                for (int i = mPowerSaveWhitelistAppIds.size() - 1; i >= 0; i--) {
-                    int appId = mPowerSaveWhitelistAppIds.keyAt(i);
-                    int uid = UserHandle.getUid(user.id, appId);
-                    uidRules.put(uid, FIREWALL_RULE_ALLOW);
+                updateRulesForWhitelistedAppIds(uidRules, mPowerSaveTempWhitelistAppIds, user.id);
+                updateRulesForWhitelistedAppIds(uidRules, mPowerSaveWhitelistAppIds, user.id);
+                if (chain == FIREWALL_CHAIN_POWERSAVE) {
+                    updateRulesForWhitelistedAppIds(uidRules,
+                            mPowerSaveWhitelistExceptIdleAppIds, user.id);
                 }
             }
             for (int i = mUidState.size() - 1; i >= 0; i--) {
@@ -2903,16 +2897,39 @@
         }
     }
 
-    private boolean isWhitelistedBatterySaverUL(int uid) {
+    private void updateRulesForWhitelistedAppIds(final SparseIntArray uidRules,
+            final SparseBooleanArray whitelistedAppIds, int userId) {
+        for (int i = whitelistedAppIds.size() - 1; i >= 0; --i) {
+            if (whitelistedAppIds.valueAt(i)) {
+                final int appId = whitelistedAppIds.keyAt(i);
+                final int uid = UserHandle.getUid(userId, appId);
+                uidRules.put(uid, FIREWALL_RULE_ALLOW);
+            }
+        }
+    }
+
+    /**
+     * @param deviceIdleMode if true then we don't consider
+     *        {@link #mPowerSaveWhitelistExceptIdleAppIds} for checking if the {@param uid} is
+     *        whitelisted.
+     */
+    private boolean isWhitelistedBatterySaverUL(int uid, boolean deviceIdleMode) {
         final int appId = UserHandle.getAppId(uid);
-        return mPowerSaveTempWhitelistAppIds.get(appId) || mPowerSaveWhitelistAppIds.get(appId);
+        boolean isWhitelisted = mPowerSaveTempWhitelistAppIds.get(appId)
+                || mPowerSaveWhitelistAppIds.get(appId);
+        if (!deviceIdleMode) {
+            isWhitelisted = isWhitelisted || mPowerSaveWhitelistExceptIdleAppIds.get(appId);
+        }
+        return isWhitelisted;
     }
 
     // NOTE: since both fw_dozable and fw_powersave uses the same map
     // (mPowerSaveTempWhitelistAppIds) for whitelisting, we can reuse their logic in this method.
     private void updateRulesForWhitelistedPowerSaveUL(int uid, boolean enabled, int chain) {
         if (enabled) {
-            if (isWhitelistedBatterySaverUL(uid) || isUidForegroundOnRestrictPowerUL(uid)) {
+            final boolean isWhitelisted = isWhitelistedBatterySaverUL(uid,
+                    chain == FIREWALL_CHAIN_DOZABLE);
+            if (isWhitelisted || isUidForegroundOnRestrictPowerUL(uid)) {
                 setUidFirewallRule(chain, uid, FIREWALL_RULE_ALLOW);
             } else {
                 setUidFirewallRule(chain, uid, FIREWALL_RULE_DEFAULT);
@@ -3430,7 +3447,7 @@
         final boolean restrictMode = isIdle || mRestrictPower || mDeviceIdleMode;
         final boolean isForeground = isUidForegroundOnRestrictPowerUL(uid);
 
-        final boolean isWhitelisted = isWhitelistedBatterySaverUL(uid);
+        final boolean isWhitelisted = isWhitelistedBatterySaverUL(uid, mDeviceIdleMode);
         final int oldRule = oldUidRules & MASK_ALL_NETWORKS;
         int newRule = RULE_NONE;
 
diff --git a/services/core/java/com/android/server/notification/NotificationManagerService.java b/services/core/java/com/android/server/notification/NotificationManagerService.java
index 51cc391..8b84205 100644
--- a/services/core/java/com/android/server/notification/NotificationManagerService.java
+++ b/services/core/java/com/android/server/notification/NotificationManagerService.java
@@ -56,6 +56,7 @@
 import static org.xmlpull.v1.XmlPullParser.END_DOCUMENT;
 
 import android.Manifest;
+import android.annotation.NonNull;
 import android.annotation.Nullable;
 import android.app.ActivityManager;
 import android.app.ActivityManagerInternal;
@@ -980,6 +981,14 @@
     void addNotification(NotificationRecord r) {
         mNotificationList.add(r);
         mNotificationsByKey.put(r.sbn.getKey(), r);
+        if (r.sbn.isGroup()) {
+            mSummaryByGroupKey.put(r.getGroupKey(), r);
+        }
+    }
+
+    @VisibleForTesting
+    void addEnqueuedNotification(NotificationRecord r) {
+        mEnqueuedNotifications.add(r);
     }
 
     @VisibleForTesting
@@ -1016,7 +1025,7 @@
     @VisibleForTesting
     void init(Looper looper, IPackageManager packageManager, PackageManager packageManagerClient,
             LightsManager lightsManager, NotificationListeners notificationListeners,
-            ICompanionDeviceManager companionManager) {
+            ICompanionDeviceManager companionManager, SnoozeHelper snoozeHelper) {
         Resources resources = getContext().getResources();
         mMaxPackageEnqueueRate = Settings.Global.getFloat(getContext().getContentResolver(),
                 Settings.Global.MAX_NOTIFICATION_ENQUEUE_RATE,
@@ -1071,21 +1080,7 @@
                 sendRegisteredOnlyBroadcast(NotificationManager.ACTION_NOTIFICATION_POLICY_CHANGED);
             }
         });
-        mSnoozeHelper = new SnoozeHelper(getContext(), new SnoozeHelper.Callback() {
-            @Override
-            public void repost(int userId, NotificationRecord r) {
-                try {
-                    if (DBG) {
-                        Slog.d(TAG, "Reposting " + r.getKey());
-                    }
-                    enqueueNotificationInternal(r.sbn.getPackageName(), r.sbn.getOpPkg(),
-                            r.sbn.getUid(), r.sbn.getInitialPid(), r.sbn.getTag(), r.sbn.getId(),
-                            r.sbn.getNotification(), userId);
-                } catch (Exception e) {
-                    Slog.e(TAG, "Cannot un-snooze notification", e);
-                }
-            }
-        }, mUserProfiles);
+        mSnoozeHelper = snoozeHelper;
         mGroupHelper = new GroupHelper(new GroupHelper.Callback() {
             @Override
             public void addAutoGroup(String key) {
@@ -1204,9 +1199,25 @@
 
     @Override
     public void onStart() {
+        SnoozeHelper snoozeHelper = new SnoozeHelper(getContext(), new SnoozeHelper.Callback() {
+            @Override
+            public void repost(int userId, NotificationRecord r) {
+                try {
+                    if (DBG) {
+                        Slog.d(TAG, "Reposting " + r.getKey());
+                    }
+                    enqueueNotificationInternal(r.sbn.getPackageName(), r.sbn.getOpPkg(),
+                            r.sbn.getUid(), r.sbn.getInitialPid(), r.sbn.getTag(), r.sbn.getId(),
+                            r.sbn.getNotification(), userId);
+                } catch (Exception e) {
+                    Slog.e(TAG, "Cannot un-snooze notification", e);
+                }
+            }
+        }, mUserProfiles);
+
         init(Looper.myLooper(), AppGlobals.getPackageManager(), getContext().getPackageManager(),
                 getLocalService(LightsManager.class), new NotificationListeners(),
-                null);
+                null, snoozeHelper);
         publishBinderService(Context.NOTIFICATION_SERVICE, mService);
         publishLocalService(NotificationManagerInternal.class, mInternalService);
     }
@@ -2838,6 +2849,7 @@
                         new Notification.Builder(getContext(), channelId)
                                 .setSmallIcon(adjustedSbn.getNotification().getSmallIcon())
                                 .setGroupSummary(true)
+                                .setGroupAlertBehavior(Notification.GROUP_ALERT_CHILDREN)
                                 .setGroup(GroupHelper.AUTOGROUP_KEY)
                                 .setFlag(Notification.FLAG_AUTOGROUP_SUMMARY, true)
                                 .setFlag(Notification.FLAG_GROUP_SUMMARY, true)
@@ -3304,7 +3316,7 @@
                         return false;
                     }
                 } else if (isCallerInstantApp(pkg)) {
-                    // Ephemeral apps have some special contraints for notifications.
+                    // Ephemeral apps have some special constraints for notifications.
                     // They are not allowed to create new notifications however they are allowed to
                     // update notifications created by the system (e.g. a foreground service
                     // notification).
@@ -3378,6 +3390,76 @@
         return isBlocked;
     }
 
+    protected class SnoozeNotificationRunnable implements Runnable {
+        private final String mKey;
+        private final long mDuration;
+        private final String mSnoozeCriterionId;
+
+        SnoozeNotificationRunnable(String key, long duration, String snoozeCriterionId) {
+            mKey = key;
+            mDuration = duration;
+            mSnoozeCriterionId = snoozeCriterionId;
+        }
+
+        @Override
+        public void run() {
+            synchronized (mNotificationLock) {
+                final NotificationRecord r = findNotificationByKeyLocked(mKey);
+                if (r != null) {
+                    snoozeLocked(r);
+                }
+            }
+        }
+
+        void snoozeLocked(NotificationRecord r) {
+            if (r.sbn.isGroup()) {
+                final List<NotificationRecord> groupNotifications = findGroupNotificationsLocked(
+                        r.sbn.getPackageName(), r.sbn.getGroupKey(), r.sbn.getUserId());
+                if (r.getNotification().isGroupSummary()) {
+                    // snooze summary and all children
+                    for (int i = 0; i < groupNotifications.size(); i++) {
+                        snoozeNotificationLocked(groupNotifications.get(i));
+                    }
+                } else {
+                    // if there is a valid summary for this group, and we are snoozing the only
+                    // child, also snooze the summary
+                    if (mSummaryByGroupKey.containsKey(r.sbn.getGroupKey())) {
+                        if (groupNotifications.size() != 2) {
+                            snoozeNotificationLocked(r);
+                        } else {
+                            // snooze summary and the one child
+                            for (int i = 0; i < groupNotifications.size(); i++) {
+                                snoozeNotificationLocked(groupNotifications.get(i));
+                            }
+                        }
+                    } else {
+                        snoozeNotificationLocked(r);
+                    }
+                }
+            } else {
+                // just snooze the one notification
+                snoozeNotificationLocked(r);
+            }
+        }
+
+        void snoozeNotificationLocked(NotificationRecord r) {
+            MetricsLogger.action(r.getLogMaker()
+                    .setCategory(MetricsEvent.NOTIFICATION_SNOOZED)
+                    .setType(MetricsEvent.TYPE_CLOSE)
+                    .addTaggedData(MetricsEvent.NOTIFICATION_SNOOZED_CRITERIA,
+                            mSnoozeCriterionId == null ? 0 : 1));
+            cancelNotificationLocked(r, false, REASON_SNOOZED);
+            updateLightsLocked();
+            if (mSnoozeCriterionId != null) {
+                mNotificationAssistants.notifyAssistantSnoozedLocked(r.sbn, mSnoozeCriterionId);
+                mSnoozeHelper.snooze(r);
+            } else {
+                mSnoozeHelper.snooze(r, mDuration);
+            }
+            savePolicyFile();
+        }
+    }
+
     protected class EnqueueNotificationRunnable implements Runnable {
         private final NotificationRecord r;
         private final int userId;
@@ -3412,6 +3494,11 @@
                 // can to avoid extracting signals.
                 handleGroupedNotificationLocked(r, old, callingUid, callingPid);
 
+                // if this is a group child, unsnooze parent summary
+                if (n.isGroup() && notification.isGroupChild()) {
+                    mSnoozeHelper.repostGroupSummary(pkg, r.getUserId(), n.getGroupKey());
+                }
+
                 // This conditional is a dirty hack to limit the logging done on
                 //     behalf of the download manager without affecting other apps.
                 if (!pkg.equals("com.android.providers.downloads")
@@ -4394,31 +4481,7 @@
                     snoozeCriterionId, listenerName));
         }
         // Needs to post so that it can cancel notifications not yet enqueued.
-        mHandler.post(new Runnable() {
-            @Override
-            public void run() {
-                synchronized (mNotificationLock) {
-                    final NotificationRecord r = findNotificationByKeyLocked(key);
-                    if (r != null) {
-                        MetricsLogger.action(r.getLogMaker()
-                                .setCategory(MetricsEvent.NOTIFICATION_SNOOZED)
-                                .setType(MetricsEvent.TYPE_CLOSE)
-                                .addTaggedData(MetricsEvent.NOTIFICATION_SNOOZED_CRITERIA,
-                                        snoozeCriterionId == null ? 0 : 1));
-                        cancelNotificationLocked(r, false, REASON_SNOOZED);
-                        updateLightsLocked();
-                        if (snoozeCriterionId != null) {
-                            mNotificationAssistants.notifyAssistantSnoozedLocked(r.sbn,
-                                    snoozeCriterionId);
-                            mSnoozeHelper.snooze(r);
-                        } else {
-                            mSnoozeHelper.snooze(r, duration);
-                        }
-                        savePolicyFile();
-                    }
-                }
-            }
-        });
+        mHandler.post(new SnoozeNotificationRunnable(key, duration, snoozeCriterionId));
     }
 
     void unsnoozeNotificationInt(String key, ManagedServiceInfo listener) {
@@ -4531,6 +4594,30 @@
         }
     }
 
+    @NonNull List<NotificationRecord> findGroupNotificationsLocked(String pkg,
+            String groupKey, int userId) {
+        List<NotificationRecord> records = new ArrayList<>();
+        records.addAll(findGroupNotificationByListLocked(mNotificationList, pkg, groupKey, userId));
+        records.addAll(
+                findGroupNotificationByListLocked(mEnqueuedNotifications, pkg, groupKey, userId));
+        return records;
+    }
+
+
+    private @NonNull List<NotificationRecord> findGroupNotificationByListLocked(
+            ArrayList<NotificationRecord> list, String pkg, String groupKey, int userId) {
+        List<NotificationRecord> records = new ArrayList<>();
+        final int len = list.size();
+        for (int i = 0; i < len; i++) {
+            NotificationRecord r = list.get(i);
+            if (notificationMatchesUserId(r, userId) && r.getGroupKey().equals(groupKey)
+                    && r.sbn.getPackageName().equals(pkg)) {
+                records.add(r);
+            }
+        }
+        return records;
+    }
+
     // Searches both enqueued and posted notifications by key.
     // TODO: need to combine a bunch of these getters with slightly different behavior.
     // TODO: Should enqueuing just add to mNotificationsByKey instead?
@@ -4545,7 +4632,7 @@
         return null;
     }
 
-    private NotificationRecord findNotificationLocked(String pkg, String tag, int id, int userId) {
+    NotificationRecord findNotificationLocked(String pkg, String tag, int id, int userId) {
         NotificationRecord r;
         if ((r = findNotificationByListLocked(mNotificationList, pkg, tag, id, userId)) != null) {
             return r;
diff --git a/services/core/java/com/android/server/notification/SnoozeHelper.java b/services/core/java/com/android/server/notification/SnoozeHelper.java
index 913f636..42b4f57 100644
--- a/services/core/java/com/android/server/notification/SnoozeHelper.java
+++ b/services/core/java/com/android/server/notification/SnoozeHelper.java
@@ -25,6 +25,7 @@
 
 import android.annotation.NonNull;
 import android.app.AlarmManager;
+import android.app.Notification;
 import android.app.PendingIntent;
 import android.content.BroadcastReceiver;
 import android.content.Context;
@@ -61,7 +62,6 @@
     private static final String REPOST_ACTION = SnoozeHelper.class.getSimpleName() + ".EVALUATE";
     private static final int REQUEST_CODE_REPOST = 1;
     private static final String REPOST_SCHEME = "repost";
-    private static final String EXTRA_PKG = "pkg";
     private static final String EXTRA_KEY = "key";
     private static final String EXTRA_USER_ID = "userId";
 
@@ -98,7 +98,7 @@
     protected Collection<NotificationRecord> getSnoozed(int userId, String pkg) {
         if (mSnoozedNotifications.containsKey(userId)
                 && mSnoozedNotifications.get(userId).containsKey(pkg)) {
-            mSnoozedNotifications.get(userId).get(pkg).values();
+            return mSnoozedNotifications.get(userId).get(pkg).values();
         }
         return Collections.EMPTY_LIST;
     }
@@ -106,16 +106,18 @@
     protected @NonNull List<NotificationRecord> getSnoozed() {
         List<NotificationRecord> snoozedForUser = new ArrayList<>();
         int[] userIds = mUserProfiles.getCurrentProfileIds();
-        final int N = userIds.length;
-        for (int i = 0; i < N; i++) {
-            final ArrayMap<String, ArrayMap<String, NotificationRecord>> snoozedPkgs =
-                    mSnoozedNotifications.get(userIds[i]);
-            if (snoozedPkgs != null) {
-                final int M = snoozedPkgs.size();
-                for (int j = 0; j < M; j++) {
-                    final ArrayMap<String, NotificationRecord> records = snoozedPkgs.valueAt(j);
-                    if (records != null) {
-                        snoozedForUser.addAll(records.values());
+        if (userIds != null) {
+            final int N = userIds.length;
+            for (int i = 0; i < N; i++) {
+                final ArrayMap<String, ArrayMap<String, NotificationRecord>> snoozedPkgs =
+                        mSnoozedNotifications.get(userIds[i]);
+                if (snoozedPkgs != null) {
+                    final int M = snoozedPkgs.size();
+                    for (int j = 0; j < M; j++) {
+                        final ArrayMap<String, NotificationRecord> records = snoozedPkgs.valueAt(j);
+                        if (records != null) {
+                            snoozedForUser.addAll(records.values());
+                        }
                     }
                 }
             }
@@ -281,6 +283,42 @@
         }
     }
 
+    protected void repostGroupSummary(String pkg, int userId, String groupKey) {
+        if (mSnoozedNotifications.containsKey(userId)) {
+            ArrayMap<String, ArrayMap<String, NotificationRecord>> keysByPackage
+                    = mSnoozedNotifications.get(userId);
+
+            if (keysByPackage != null && keysByPackage.containsKey(pkg)) {
+                ArrayMap<String, NotificationRecord> recordsByKey = keysByPackage.get(pkg);
+
+                if (recordsByKey != null) {
+                    String groupSummaryKey = null;
+                    int N = recordsByKey.size();
+                    for (int i = 0; i < N; i++) {
+                        final NotificationRecord potentialGroupSummary = recordsByKey.valueAt(i);
+                        if (potentialGroupSummary.sbn.isGroup()
+                                && potentialGroupSummary.getNotification().isGroupSummary()
+                                && groupKey.equals(potentialGroupSummary.getGroupKey())) {
+                            groupSummaryKey = potentialGroupSummary.getKey();
+                            break;
+                        }
+                    }
+
+                    if (groupSummaryKey != null) {
+                        NotificationRecord record = recordsByKey.remove(groupSummaryKey);
+                        mPackages.remove(groupSummaryKey);
+                        mUsers.remove(groupSummaryKey);
+
+                        MetricsLogger.action(record.getLogMaker()
+                                .setCategory(MetricsProto.MetricsEvent.NOTIFICATION_SNOOZED)
+                                .setType(MetricsProto.MetricsEvent.TYPE_OPEN));
+                        mCallback.repost(userId, record);
+                    }
+                }
+            }
+        }
+    }
+
     private PendingIntent createPendingIntent(String pkg, String key, int userId) {
         return PendingIntent.getBroadcast(mContext,
                 REQUEST_CODE_REPOST,
diff --git a/services/core/java/com/android/server/pm/InstantAppRegistry.java b/services/core/java/com/android/server/pm/InstantAppRegistry.java
index fc9e0a3..b165984 100644
--- a/services/core/java/com/android/server/pm/InstantAppRegistry.java
+++ b/services/core/java/com/android/server/pm/InstantAppRegistry.java
@@ -218,6 +218,11 @@
         byte[] randomBytes = new byte[8];
         new SecureRandom().nextBytes(randomBytes);
         String id = ByteStringUtils.toHexString(randomBytes).toLowerCase(Locale.US);
+        File appDir = getInstantApplicationDir(packageName, userId);
+        if (!appDir.exists() && !appDir.mkdirs()) {
+            Slog.e(LOG_TAG, "Cannot create instant app cookie directory");
+            return id;
+        }
         File idFile = new File(getInstantApplicationDir(packageName, userId),
                 INSTANT_APP_ANDROID_ID_FILE);
         try (FileOutputStream fos = new FileOutputStream(idFile)) {
diff --git a/services/core/java/com/android/server/pm/InstantAppResolver.java b/services/core/java/com/android/server/pm/InstantAppResolver.java
index b56db04..624d8c9 100644
--- a/services/core/java/com/android/server/pm/InstantAppResolver.java
+++ b/services/core/java/com/android/server/pm/InstantAppResolver.java
@@ -41,6 +41,7 @@
 import android.metrics.LogMaker;
 import android.os.Binder;
 import android.os.Build;
+import android.os.Bundle;
 import android.os.Handler;
 import android.os.RemoteException;
 import android.util.Log;
@@ -147,6 +148,7 @@
                 final Intent installerIntent = buildEphemeralInstallerIntent(
                         requestObj.origIntent,
                         requestObj.callingPackage,
+                        requestObj.verificationBundle,
                         requestObj.resolvedType,
                         requestObj.userId,
                         packageName,
@@ -172,6 +174,7 @@
      */
     public static Intent buildEphemeralInstallerIntent(@NonNull Intent origIntent,
             @NonNull String callingPackage,
+            @Nullable Bundle verificationBundle,
             @NonNull String resolvedType,
             int userId,
             @NonNull String instantAppPackageName,
@@ -234,6 +237,10 @@
             intent.putExtra(Intent.EXTRA_PACKAGE_NAME, instantAppPackageName);
             intent.putExtra(Intent.EXTRA_SPLIT_NAME, instantAppSplitName);
             intent.putExtra(Intent.EXTRA_VERSION_CODE, versionCode);
+            intent.putExtra(Intent.EXTRA_CALLING_PACKAGE, callingPackage);
+            if (verificationBundle != null) {
+                intent.putExtra(Intent.EXTRA_VERIFICATION_BUNDLE, verificationBundle);
+            }
         }
 
         return intent;
diff --git a/services/core/java/com/android/server/pm/PackageManagerService.java b/services/core/java/com/android/server/pm/PackageManagerService.java
index 7bbb1fe..a56590e 100644
--- a/services/core/java/com/android/server/pm/PackageManagerService.java
+++ b/services/core/java/com/android/server/pm/PackageManagerService.java
@@ -739,12 +739,123 @@
     @GuardedBy("mPackages")
     final SparseArray<Map<String, Integer>> mChangedPackagesSequenceNumbers = new SparseArray<>();
 
-    final PackageParser.Callback mPackageParserCallback = new PackageParser.Callback() {
-        @Override public boolean hasFeature(String feature) {
+    class PackageParserCallback implements PackageParser.Callback {
+        @Override public final boolean hasFeature(String feature) {
             return PackageManagerService.this.hasSystemFeature(feature, 0);
         }
+
+        final List<PackageParser.Package> getStaticOverlayPackagesLocked(
+                Collection<PackageParser.Package> allPackages, String targetPackageName) {
+            List<PackageParser.Package> overlayPackages = null;
+            for (PackageParser.Package p : allPackages) {
+                if (targetPackageName.equals(p.mOverlayTarget) && p.mIsStaticOverlay) {
+                    if (overlayPackages == null) {
+                        overlayPackages = new ArrayList<PackageParser.Package>();
+                    }
+                    overlayPackages.add(p);
+                }
+            }
+            if (overlayPackages != null) {
+                Comparator<PackageParser.Package> cmp = new Comparator<PackageParser.Package>() {
+                    public int compare(PackageParser.Package p1, PackageParser.Package p2) {
+                        return p1.mOverlayPriority - p2.mOverlayPriority;
+                    }
+                };
+                Collections.sort(overlayPackages, cmp);
+            }
+            return overlayPackages;
+        }
+
+        final String[] getStaticOverlayPathsLocked(Collection<PackageParser.Package> allPackages,
+                String targetPackageName, String targetPath) {
+            if ("android".equals(targetPackageName)) {
+                // Static RROs targeting to "android", ie framework-res.apk, are already applied by
+                // native AssetManager.
+                return null;
+            }
+            List<PackageParser.Package> overlayPackages =
+                    getStaticOverlayPackagesLocked(allPackages, targetPackageName);
+            if (overlayPackages == null || overlayPackages.isEmpty()) {
+                return null;
+            }
+            List<String> overlayPathList = null;
+            for (PackageParser.Package overlayPackage : overlayPackages) {
+                if (targetPath == null) {
+                    if (overlayPathList == null) {
+                        overlayPathList = new ArrayList<String>();
+                    }
+                    overlayPathList.add(overlayPackage.baseCodePath);
+                    continue;
+                }
+
+                try {
+                    // Creates idmaps for system to parse correctly the Android manifest of the
+                    // target package.
+                    //
+                    // OverlayManagerService will update each of them with a correct gid from its
+                    // target package app id.
+                    mInstaller.idmap(targetPath, overlayPackage.baseCodePath,
+                            UserHandle.getSharedAppGid(
+                                    UserHandle.getUserGid(UserHandle.USER_SYSTEM)));
+                    if (overlayPathList == null) {
+                        overlayPathList = new ArrayList<String>();
+                    }
+                    overlayPathList.add(overlayPackage.baseCodePath);
+                } catch (InstallerException e) {
+                    Slog.e(TAG, "Failed to generate idmap for " + targetPath + " and " +
+                            overlayPackage.baseCodePath);
+                }
+            }
+            return overlayPathList == null ? null : overlayPathList.toArray(new String[0]);
+        }
+
+        String[] getStaticOverlayPaths(String targetPackageName, String targetPath) {
+            synchronized (mPackages) {
+                return getStaticOverlayPathsLocked(
+                        mPackages.values(), targetPackageName, targetPath);
+            }
+        }
+
+        @Override public final String[] getOverlayApks(String targetPackageName) {
+            return getStaticOverlayPaths(targetPackageName, null);
+        }
+
+        @Override public final String[] getOverlayPaths(String targetPackageName,
+                String targetPath) {
+            return getStaticOverlayPaths(targetPackageName, targetPath);
+        }
     };
 
+    class ParallelPackageParserCallback extends PackageParserCallback {
+        List<PackageParser.Package> mOverlayPackages = null;
+
+        void findStaticOverlayPackages() {
+            synchronized (mPackages) {
+                for (PackageParser.Package p : mPackages.values()) {
+                    if (p.mIsStaticOverlay) {
+                        if (mOverlayPackages == null) {
+                            mOverlayPackages = new ArrayList<PackageParser.Package>();
+                        }
+                        mOverlayPackages.add(p);
+                    }
+                }
+            }
+        }
+
+        @Override
+        synchronized String[] getStaticOverlayPaths(String targetPackageName, String targetPath) {
+            // We can trust mOverlayPackages without holding mPackages because package uninstall
+            // can't happen while running parallel parsing.
+            // Moreover holding mPackages on each parsing thread causes dead-lock.
+            return mOverlayPackages == null ? null :
+                    getStaticOverlayPathsLocked(mOverlayPackages, targetPackageName, targetPath);
+        }
+    }
+
+    final PackageParser.Callback mPackageParserCallback = new PackageParserCallback();
+    final ParallelPackageParserCallback mParallelPackageParserCallback =
+            new ParallelPackageParserCallback();
+
     public static final class SharedLibraryEntry {
         public final String path;
         public final String apk;
@@ -2453,6 +2564,8 @@
                     | PackageParser.PARSE_IS_SYSTEM_DIR
                     | PackageParser.PARSE_TRUSTED_OVERLAY, scanFlags | SCAN_TRUSTED_OVERLAY, 0);
 
+            mParallelPackageParserCallback.findStaticOverlayPackages();
+
             // Find base frameworks (resource packages without code).
             scanDirTracedLI(frameworkDir, mDefParseFlags
                     | PackageParser.PARSE_IS_SYSTEM
@@ -5820,10 +5933,10 @@
 
     private void requestInstantAppResolutionPhaseTwo(AuxiliaryResolveInfo responseObj,
             Intent origIntent, String resolvedType, String callingPackage,
-            int userId) {
+            Bundle verificationBundle, int userId) {
         final Message msg = mHandler.obtainMessage(INSTANT_APP_RESOLUTION_PHASE_TWO,
                 new InstantAppRequest(responseObj, origIntent, resolvedType,
-                        callingPackage, userId));
+                        callingPackage, userId, verificationBundle));
         mHandler.sendMessage(msg);
     }
 
@@ -6372,7 +6485,7 @@
             Trace.traceBegin(TRACE_TAG_PACKAGE_MANAGER, "resolveEphemeral");
             final InstantAppRequest requestObject = new InstantAppRequest(
                     null /*responseObj*/, intent /*origIntent*/, resolvedType,
-                    null /*callingPackage*/, userId);
+                    null /*callingPackage*/, userId, null /*verificationBundle*/);
             final AuxiliaryResolveInfo auxiliaryResponse =
                     InstantAppResolver.doInstantAppResolutionPhaseOne(
                             mContext, mInstantAppResolverConnection, requestObject);
@@ -7856,7 +7969,8 @@
                     + " flags=0x" + Integer.toHexString(parseFlags));
         }
         ParallelPackageParser parallelPackageParser = new ParallelPackageParser(
-                mSeparateProcesses, mOnlyCore, mMetrics, mCacheDir, mPackageParserCallback);
+                mSeparateProcesses, mOnlyCore, mMetrics, mCacheDir,
+                mParallelPackageParserCallback);
 
         // Submit files for parsing in parallel
         int fileCount = 0;
@@ -17075,10 +17189,10 @@
                 PackageParser.Permission perm = pkg.permissions.get(i);
                 BasePermission bp = mSettings.mPermissions.get(perm.info.name);
 
-                // Don't allow anyone but the platform to define ephemeral permissions.
+                // Don't allow anyone but the system to define ephemeral permissions.
                 if ((perm.info.protectionLevel & PermissionInfo.PROTECTION_FLAG_EPHEMERAL) != 0
-                        && !PLATFORM_PACKAGE_NAME.equals(pkg.packageName)) {
-                    Slog.w(TAG, "Package " + pkg.packageName
+                        && !systemApp) {
+                    Slog.w(TAG, "Non-System package " + pkg.packageName
                             + " attempting to delcare ephemeral permission "
                             + perm.info.name + "; Removing ephemeral.");
                     perm.info.protectionLevel &= ~PermissionInfo.PROTECTION_FLAG_EPHEMERAL;
@@ -20570,6 +20684,7 @@
         public static final int DUMP_DEXOPT = 1 << 20;
         public static final int DUMP_COMPILER_STATS = 1 << 21;
         public static final int DUMP_ENABLED_OVERLAYS = 1 << 22;
+        public static final int DUMP_CHANGES = 1 << 23;
 
         public static final int OPTION_SHOW_FILTERS = 1 << 0;
 
@@ -20815,6 +20930,8 @@
                 dumpState.setDump(DumpState.DUMP_COMPILER_STATS);
             } else if ("enabled-overlays".equals(cmd)) {
                 dumpState.setDump(DumpState.DUMP_ENABLED_OVERLAYS);
+            } else if ("changes".equals(cmd)) {
+                dumpState.setDump(DumpState.DUMP_CHANGES);
             } else if ("write".equals(cmd)) {
                 synchronized (mPackages) {
                     mSettings.writeLPr();
@@ -21145,6 +21262,31 @@
                 mSettings.dumpSharedUsersLPr(pw, packageName, permissionNames, dumpState, checkin);
             }
 
+            if (dumpState.isDumping(DumpState.DUMP_CHANGES)) {
+                if (dumpState.onTitlePrinted()) pw.println();
+                pw.println("Package Changes:");
+                pw.print("  Sequence number="); pw.println(mChangedPackagesSequenceNumber);
+                final int K = mChangedPackages.size();
+                for (int i = 0; i < K; i++) {
+                    final SparseArray<String> changes = mChangedPackages.valueAt(i);
+                    pw.print("  User "); pw.print(mChangedPackages.keyAt(i)); pw.println(":");
+                    final int N = changes.size();
+                    if (N == 0) {
+                        pw.print("    "); pw.println("No packages changed");
+                    } else {
+                        for (int j = 0; j < N; j++) {
+                            final String pkgName = changes.valueAt(j);
+                            final int sequenceNumber = changes.keyAt(j);
+                            pw.print("    ");
+                            pw.print("seq=");
+                            pw.print(sequenceNumber);
+                            pw.print(", package=");
+                            pw.println(pkgName);
+                        }
+                    }
+                }
+            }
+
             if (!checkin && dumpState.isDumping(DumpState.DUMP_PERMISSIONS) && packageName == null) {
                 mSettings.dumpRestoredPermissionGrantsLPr(pw, dumpState);
             }
@@ -23423,9 +23565,11 @@
 
         @Override
         public void requestInstantAppResolutionPhaseTwo(AuxiliaryResolveInfo responseObj,
-                Intent origIntent, String resolvedType, String callingPackage, int userId) {
+                Intent origIntent, String resolvedType, String callingPackage,
+                Bundle verificationBundle, int userId) {
             PackageManagerService.this.requestInstantAppResolutionPhaseTwo(
-                    responseObj, origIntent, resolvedType, callingPackage, userId);
+                    responseObj, origIntent, resolvedType, callingPackage, verificationBundle,
+                    userId);
         }
 
         @Override
@@ -23570,6 +23714,13 @@
                 mIsolatedOwners.delete(isolatedUid);
             }
         }
+
+        @Override
+        public int getUidTargetSdkVersion(int uid) {
+            synchronized (mPackages) {
+                return getUidTargetSdkVersionLockedLPr(uid);
+            }
+        }
     }
 
     @Override
diff --git a/services/core/java/com/android/server/pm/UserRestrictionsUtils.java b/services/core/java/com/android/server/pm/UserRestrictionsUtils.java
index 84381fe..c6667a7 100644
--- a/services/core/java/com/android/server/pm/UserRestrictionsUtils.java
+++ b/services/core/java/com/android/server/pm/UserRestrictionsUtils.java
@@ -74,6 +74,7 @@
             UserManager.DISALLOW_INSTALL_UNKNOWN_SOURCES,
             UserManager.DISALLOW_CONFIG_BLUETOOTH,
             UserManager.DISALLOW_BLUETOOTH,
+            UserManager.DISALLOW_BLUETOOTH_SHARING,
             UserManager.DISALLOW_USB_FILE_TRANSFER,
             UserManager.DISALLOW_CONFIG_CREDENTIALS,
             UserManager.DISALLOW_REMOVE_USER,
@@ -155,6 +156,7 @@
      */
     private static final Set<String> GLOBAL_RESTRICTIONS = Sets.newArraySet(
             UserManager.DISALLOW_ADJUST_VOLUME,
+            UserManager.DISALLOW_BLUETOOTH_SHARING,
             UserManager.DISALLOW_RUN_IN_BACKGROUND,
             UserManager.DISALLOW_UNMUTE_MICROPHONE,
             UserManager.DISALLOW_UNMUTE_DEVICE
@@ -167,6 +169,17 @@
             UserManager.DISALLOW_ADD_MANAGED_PROFILE
     );
 
+    /**
+     * User restrictions that default to {@code true} for managed profile owners.
+     *
+     * NB: {@link UserManager#DISALLOW_INSTALL_UNKNOWN_SOURCES} is also set by default but it is
+     * not set to existing profile owners unless they used to have INSTALL_NON_MARKET_APPS disabled
+     * in settings. So it is handled separately.
+     */
+    private static final Set<String> DEFAULT_ENABLED_FOR_MANAGED_PROFILES = Sets.newArraySet(
+            UserManager.DISALLOW_BLUETOOTH_SHARING
+    );
+
     /*
      * Special user restrictions that are always applied to all users no matter who sets them.
      */
@@ -308,6 +321,13 @@
     }
 
     /**
+     * Returns the user restrictions that default to {@code true} for managed profile owners.
+     */
+    public static @NonNull Set<String> getDefaultEnabledForManagedProfiles() {
+        return DEFAULT_ENABLED_FOR_MANAGED_PROFILES;
+    }
+
+    /**
      * Takes restrictions that can be set by device owner, and sort them into what should be applied
      * globally and what should be applied only on the current user.
      */
@@ -544,8 +564,8 @@
     public static void moveRestriction(String restrictionKey, SparseArray<Bundle> srcRestrictions,
             SparseArray<Bundle> destRestrictions) {
         for (int i = 0; i < srcRestrictions.size(); i++) {
-            int key = srcRestrictions.keyAt(i);
-            Bundle from = srcRestrictions.valueAt(i);
+            final int key = srcRestrictions.keyAt(i);
+            final Bundle from = srcRestrictions.valueAt(i);
             if (contains(from, restrictionKey)) {
                 from.remove(restrictionKey);
                 Bundle to = destRestrictions.get(key);
@@ -562,4 +582,24 @@
             }
         }
     }
+
+    /**
+     * Returns whether restrictions differ between two bundles.
+     * @param oldRestrictions old bundle of restrictions.
+     * @param newRestrictions new bundle of restrictions
+     * @param restrictions restrictions of interest, if empty, all restrictions are checked.
+     */
+    public static boolean restrictionsChanged(Bundle oldRestrictions, Bundle newRestrictions,
+            String... restrictions) {
+        if (restrictions.length == 0) {
+            return areEqual(oldRestrictions, newRestrictions);
+        }
+        for (final String restriction : restrictions) {
+            if (oldRestrictions.getBoolean(restriction, false) !=
+                    newRestrictions.getBoolean(restriction, false)) {
+                return true;
+            }
+        }
+        return false;
+    }
 }
diff --git a/services/core/java/com/android/server/wm/AppWindowToken.java b/services/core/java/com/android/server/wm/AppWindowToken.java
index 3c2dfa5..36418be 100644
--- a/services/core/java/com/android/server/wm/AppWindowToken.java
+++ b/services/core/java/com/android/server/wm/AppWindowToken.java
@@ -893,6 +893,7 @@
         if (mPendingRelaunchCount > 0) {
             mPendingRelaunchCount--;
         }
+        updateAllDrawn();
     }
 
     void clearRelaunching() {
@@ -1301,16 +1302,20 @@
         }
     }
 
-    void updateAllDrawn(DisplayContent dc) {
+    void updateAllDrawn() {
         if (!allDrawn) {
+            // Number of drawn windows can be less when a window is being relaunched, wait for
+            // all windows to be launched and drawn for this token be considered all drawn
             final int numInteresting = mNumInterestingWindows;
-            if (numInteresting > 0 && mNumDrawnWindows >= numInteresting) {
+            if (numInteresting > 0 && mNumDrawnWindows >= numInteresting && !isRelaunching()) {
                 if (DEBUG_VISIBILITY) Slog.v(TAG, "allDrawn: " + this
                         + " interesting=" + numInteresting + " drawn=" + mNumDrawnWindows);
                 allDrawn = true;
                 // Force an additional layout pass where
                 // WindowStateAnimator#commitFinishDrawingLocked() will call performShowLocked().
-                dc.setLayoutNeeded();
+                if (mDisplayContent != null) {
+                    mDisplayContent.setLayoutNeeded();
+                }
                 mService.mH.obtainMessage(NOTIFY_ACTIVITY_DRAWN, token).sendToTarget();
 
                 final TaskStack s = getStack();
@@ -1327,7 +1332,9 @@
                         + " interesting=" + numInteresting
                         + " drawn=" + mNumDrawnWindowsExcludingSaved);
                 allDrawnExcludingSaved = true;
-                dc.setLayoutNeeded();
+                if (mDisplayContent != null) {
+                    mDisplayContent.setLayoutNeeded();
+                }
                 if (isAnimatingInvisibleWithSavedSurface()
                         && !mService.mFinishedEarlyAnim.contains(this)) {
                     mService.mFinishedEarlyAnim.add(this);
diff --git a/services/core/java/com/android/server/wm/DisplayContent.java b/services/core/java/com/android/server/wm/DisplayContent.java
index d85552a..05b95e2 100644
--- a/services/core/java/com/android/server/wm/DisplayContent.java
+++ b/services/core/java/com/android/server/wm/DisplayContent.java
@@ -2730,7 +2730,7 @@
             final AppWindowToken atoken = mTmpUpdateAllDrawn.removeLast();
             // See if any windows have been drawn, so they (and others associated with them)
             // can now be shown.
-            atoken.updateAllDrawn(this);
+            atoken.updateAllDrawn();
         }
 
         return mTmpApplySurfaceChangesTransactionState.focusDisplayed;
diff --git a/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java b/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
index ebd749f..87fb8c8 100644
--- a/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
+++ b/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
@@ -1918,7 +1918,7 @@
             setDeviceOwnerSystemPropertyLocked();
             findOwnerComponentIfNecessaryLocked();
             migrateUserRestrictionsIfNecessaryLocked();
-            setDefaultEnabledUserRestrictionsIfNecessaryLocked();
+            maybeSetDefaultDeviceOwnerUserRestrictionsLocked();
 
             // TODO PO may not have a class name either due to b/17652534.  Address that too.
 
@@ -1926,36 +1926,80 @@
         }
     }
 
-    private void setDefaultEnabledUserRestrictionsIfNecessaryLocked() {
+    /** Apply default restrictions that haven't been applied to device owners yet. */
+    private void maybeSetDefaultDeviceOwnerUserRestrictionsLocked() {
         final ActiveAdmin deviceOwner = getDeviceOwnerAdminLocked();
-        if (deviceOwner != null
-                && !UserRestrictionsUtils.getDefaultEnabledForDeviceOwner().equals(
-                        deviceOwner.defaultEnabledRestrictionsAlreadySet)) {
-            Slog.i(LOG_TAG,"New user restrictions need to be set by default for the device owner");
+        if (deviceOwner != null) {
+            maybeSetDefaultRestrictionsForAdminLocked(mOwners.getDeviceOwnerUserId(),
+                    deviceOwner, UserRestrictionsUtils.getDefaultEnabledForDeviceOwner());
+        }
+    }
 
-            if (VERBOSE_LOG) {
-                Slog.d(LOG_TAG,"Default enabled restrictions for DO: "
-                        + UserRestrictionsUtils.getDefaultEnabledForDeviceOwner()
-                        + ". Restrictions already enabled: "
-                        + deviceOwner.defaultEnabledRestrictionsAlreadySet);
-            }
-
-            Set<String> restrictionsToSet = new ArraySet<>(
-                    UserRestrictionsUtils.getDefaultEnabledForDeviceOwner());
-            restrictionsToSet.removeAll(deviceOwner.defaultEnabledRestrictionsAlreadySet);
-            if (!restrictionsToSet.isEmpty()) {
-                for (String restriction : restrictionsToSet) {
-                    deviceOwner.ensureUserRestrictions().putBoolean(restriction, true);
+    /** Apply default restrictions that haven't been applied to profile owners yet. */
+    private void maybeSetDefaultProfileOwnerUserRestrictions() {
+        synchronized (this) {
+            for (final int userId : mOwners.getProfileOwnerKeys()) {
+                final ActiveAdmin profileOwner = getProfileOwnerAdminLocked(userId);
+                // The following restrictions used to be applied to managed profiles by different
+                // means (via Settings or by disabling components). Now they are proper user
+                // restrictions so we apply them to managed profile owners. Non-managed secondary
+                // users didn't have those restrictions so we skip them to keep existing behavior.
+                if (profileOwner == null || !mUserManager.isManagedProfile(userId)) {
+                    continue;
                 }
-                deviceOwner.defaultEnabledRestrictionsAlreadySet.addAll(restrictionsToSet);
-                Slog.i(LOG_TAG,
-                        "Enabled the following restrictions by default: " + restrictionsToSet);
-
-                saveUserRestrictionsLocked(mOwners.getDeviceOwnerUserId());
+                maybeSetDefaultRestrictionsForAdminLocked(userId, profileOwner,
+                        UserRestrictionsUtils.getDefaultEnabledForManagedProfiles());
+                ensureUnknownSourcesRestrictionForProfileOwnerLocked(
+                        userId, profileOwner, false /* newOwner */);
             }
         }
     }
 
+    /**
+     * Checks whether {@link UserManager#DISALLOW_INSTALL_UNKNOWN_SOURCES} should be added to the
+     * set of restrictions for this profile owner.
+     */
+    private void ensureUnknownSourcesRestrictionForProfileOwnerLocked(int userId,
+            ActiveAdmin profileOwner, boolean newOwner) {
+        if (newOwner || mInjector.settingsSecureGetIntForUser(
+                Settings.Secure.UNKNOWN_SOURCES_DEFAULT_REVERSED, 0, userId) != 0) {
+            profileOwner.ensureUserRestrictions().putBoolean(
+                    UserManager.DISALLOW_INSTALL_UNKNOWN_SOURCES, true);
+            saveUserRestrictionsLocked(userId);
+            mInjector.settingsSecurePutIntForUser(
+                    Settings.Secure.UNKNOWN_SOURCES_DEFAULT_REVERSED, 0, userId);
+        }
+    }
+
+    /**
+     * Apply default restrictions that haven't been applied to a given admin yet.
+     */
+    private void maybeSetDefaultRestrictionsForAdminLocked(
+            int userId, ActiveAdmin admin, Set<String> defaultRestrictions) {
+        if (defaultRestrictions.equals(admin.defaultEnabledRestrictionsAlreadySet)) {
+            return; // The same set of default restrictions has been already applied.
+        }
+        Slog.i(LOG_TAG, "New user restrictions need to be set by default for user " + userId);
+
+        if (VERBOSE_LOG) {
+            Slog.d(LOG_TAG,"Default enabled restrictions: "
+                    + defaultRestrictions
+                    + ". Restrictions already enabled: "
+                    + admin.defaultEnabledRestrictionsAlreadySet);
+        }
+
+        final Set<String> restrictionsToSet = new ArraySet<>(defaultRestrictions);
+        restrictionsToSet.removeAll(admin.defaultEnabledRestrictionsAlreadySet);
+        if (!restrictionsToSet.isEmpty()) {
+            for (final String restriction : restrictionsToSet) {
+                admin.ensureUserRestrictions().putBoolean(restriction, true);
+            }
+            admin.defaultEnabledRestrictionsAlreadySet.addAll(restrictionsToSet);
+            Slog.i(LOG_TAG, "Enabled the following restrictions by default: " + restrictionsToSet);
+            saveUserRestrictionsLocked(userId);
+        }
+    }
+
     private void setDeviceOwnerSystemPropertyLocked() {
         final boolean deviceProvisioned =
                 mInjector.settingsGlobalGetInt(Settings.Global.DEVICE_PROVISIONED, 0) != 0;
@@ -2942,41 +2986,11 @@
         }
     }
 
-    private void ensureUnknownSourcesRestrictionForProfileOwners() {
-        synchronized (this) {
-            for (int userId : mOwners.getProfileOwnerKeys()) {
-                if (!mUserManager.isManagedProfile(userId) ||
-                        mInjector.settingsSecureGetIntForUser(
-                        Settings.Secure.UNKNOWN_SOURCES_DEFAULT_REVERSED, 0, userId) == 0) {
-                    continue;
-                }
-                setUserRestrictionOnBehalfOfProfileOwnerLocked(
-                        UserManager.DISALLOW_INSTALL_UNKNOWN_SOURCES, userId);
-                mInjector.settingsSecurePutIntForUser(
-                        Settings.Secure.UNKNOWN_SOURCES_DEFAULT_REVERSED, 0, userId);
-            }
-        }
-    }
-
-    private void setUserRestrictionOnBehalfOfProfileOwnerLocked(String userRestrictionKey,
-            int userId) {
-        if (UserRestrictionsUtils.isValidRestriction(userRestrictionKey) &&
-                UserRestrictionsUtils.canProfileOwnerChange(userRestrictionKey, userId)) {
-            ActiveAdmin profileOwner = getProfileOwnerAdminLocked(userId);
-            if (profileOwner == null) {
-                return;
-            }
-            Bundle restrictions = profileOwner.ensureUserRestrictions();
-            restrictions.putBoolean(userRestrictionKey, true);
-            saveUserRestrictionsLocked(userId);
-        }
-    }
-
     private void onLockSettingsReady() {
         getUserData(UserHandle.USER_SYSTEM);
         loadOwners();
         cleanUpOldUsers();
-        ensureUnknownSourcesRestrictionForProfileOwners();
+        maybeSetDefaultProfileOwnerUserRestrictions();
         handleStartUser(UserHandle.USER_SYSTEM);
 
         // Register an observer for watching for user setup complete and settings changes.
@@ -4652,19 +4666,20 @@
             final long ident = mInjector.binderClearCallingIdentity();
             try {
                 // Evict key
-                if ((flags & DevicePolicyManager.FLAG_EVICT_CE_KEY) != 0) {
-                    enforceManagedProfile(callingUserId, "set FLAG_EVICT_CE_KEY");
+                if ((flags & DevicePolicyManager.FLAG_EVICT_CREDENTIAL_ENCRYPTION_KEY) != 0) {
+                    enforceManagedProfile(
+                            callingUserId, "set FLAG_EVICT_CREDENTIAL_ENCRYPTION_KEY");
                     if (!isProfileOwner(admin.info.getComponent(), callingUserId)) {
-                        throw new SecurityException(
-                               "Only profile owner admins can set FLAG_EVICT_CE_KEY");
+                        throw new SecurityException("Only profile owner admins can set "
+                                + "FLAG_EVICT_CREDENTIAL_ENCRYPTION_KEY");
                     }
                     if (parent) {
                         throw new IllegalArgumentException(
-                                "Cannot set FLAG_EVICT_CE_KEY for the parent");
+                                "Cannot set FLAG_EVICT_CREDENTIAL_ENCRYPTION_KEY for the parent");
                     }
                     if (!mInjector.storageManagerIsFileBasedEncryptionEnabled()) {
                         throw new UnsupportedOperationException(
-                                "FLAG_EVICT_CE_KEY only applies to FBE devices");
+                                "FLAG_EVICT_CREDENTIAL_ENCRYPTION_KEY only applies to FBE devices");
                     }
                     mUserManager.evictCredentialEncryptionKey(callingUserId);
                 }
@@ -6728,8 +6743,8 @@
         synchronized (this) {
             enforceCanSetProfileOwnerLocked(who, userHandle, hasIncompatibleAccountsOrNonAdb);
 
-            if (getActiveAdminUncheckedLocked(who, userHandle) == null
-                    || getUserData(userHandle).mRemovingAdmins.contains(who)) {
+            final ActiveAdmin admin = getActiveAdminUncheckedLocked(who, userHandle);
+            if (admin == null || getUserData(userHandle).mRemovingAdmins.contains(who)) {
                 throw new IllegalArgumentException("Not active admin: " + who);
             }
 
@@ -6745,10 +6760,10 @@
             final long id = mInjector.binderClearCallingIdentity();
             try {
                 if (mUserManager.isManagedProfile(userHandle)) {
-                    setUserRestrictionOnBehalfOfProfileOwnerLocked(
-                            UserManager.DISALLOW_INSTALL_UNKNOWN_SOURCES, userHandle);
-                    mInjector.settingsSecurePutIntForUser(
-                            Settings.Secure.UNKNOWN_SOURCES_DEFAULT_REVERSED, 0, userHandle);
+                    maybeSetDefaultRestrictionsForAdminLocked(userHandle, admin,
+                            UserRestrictionsUtils.getDefaultEnabledForManagedProfiles());
+                    ensureUnknownSourcesRestrictionForProfileOwnerLocked(userHandle, admin,
+                            true /* newOwner */);
                 }
             } finally {
                 mInjector.binderRestoreCallingIdentity(id);
diff --git a/services/tests/notification/src/com/android/server/notification/NotificationManagerServiceTest.java b/services/tests/notification/src/com/android/server/notification/NotificationManagerServiceTest.java
index d402d10..f41a99f 100644
--- a/services/tests/notification/src/com/android/server/notification/NotificationManagerServiceTest.java
+++ b/services/tests/notification/src/com/android/server/notification/NotificationManagerServiceTest.java
@@ -24,6 +24,7 @@
 import static junit.framework.Assert.fail;
 
 import static org.mockito.Matchers.anyBoolean;
+import static org.mockito.Matchers.anyLong;
 import static org.mockito.Matchers.anyString;
 import static org.mockito.Matchers.eq;
 import static org.mockito.Mockito.any;
@@ -96,6 +97,7 @@
     private NotificationManagerService.NotificationListeners mNotificationListeners;
     private ManagedServices.ManagedServiceInfo mListener;
     @Mock private ICompanionDeviceManager mCompanionMgr;
+    @Mock SnoozeHelper mSnoozeHelper;
 
     // Use a Testable subclass so we can simulate calls from the system without failing.
     private static class TestableNotificationManagerService extends NotificationManagerService {
@@ -133,7 +135,8 @@
                 null, new ComponentName(PKG, "test_class"), uid, true, null, 0);
         when(mNotificationListeners.checkServiceTokenLocked(any())).thenReturn(mListener);
         mNotificationManagerService.init(mTestableLooper.getLooper(), mPackageManager,
-                mPackageManagerClient, mockLightsManager, mNotificationListeners, mCompanionMgr);
+                mPackageManagerClient, mockLightsManager, mNotificationListeners, mCompanionMgr,
+                mSnoozeHelper);
 
         // Tests call directly into the Binder.
         mBinderService = mNotificationManagerService.getBinderService();
@@ -147,6 +150,18 @@
         mTestableLooper.processAllMessages();
     }
 
+    private NotificationRecord generateNotificationRecord(NotificationChannel channel, int id,
+            String groupKey, boolean isSummary) {
+        Notification.Builder nb = new Notification.Builder(mContext, channel.getId())
+                .setContentTitle("foo")
+                .setSmallIcon(android.R.drawable.sym_def_app_icon)
+                .setGroup(groupKey)
+                .setGroupSummary(isSummary);
+
+        StatusBarNotification sbn = new StatusBarNotification(PKG, PKG, id, "tag", uid, 0,
+                nb.build(), new UserHandle(uid), null, 0);
+        return new NotificationRecord(mContext, sbn, channel);
+    }
     private NotificationRecord generateNotificationRecord(NotificationChannel channel) {
         return generateNotificationRecord(channel, null);
     }
@@ -396,6 +411,46 @@
     }
 
     @Test
+    public void testFindGroupNotificationsLocked() throws Exception {
+        // make sure the same notification can be found in both lists and returned
+        final NotificationRecord group1 = generateNotificationRecord(
+                mTestNotificationChannel, 1, "group1", true);
+        mNotificationManagerService.addEnqueuedNotification(group1);
+        mNotificationManagerService.addNotification(group1);
+
+        // should not be returned
+        final NotificationRecord group2 = generateNotificationRecord(
+                mTestNotificationChannel, 2, "group2", true);
+        mBinderService.enqueueNotificationWithTag(PKG, "opPkg", null,
+                group2.sbn.getId(), group2.sbn.getNotification(), group2.sbn.getUserId());
+        waitForIdle();
+
+        // should not be returned
+        final NotificationRecord nonGroup = generateNotificationRecord(
+                mTestNotificationChannel, 3, null, false);
+        mBinderService.enqueueNotificationWithTag(PKG, "opPkg", null,
+                nonGroup.sbn.getId(), nonGroup.sbn.getNotification(), nonGroup.sbn.getUserId());
+        waitForIdle();
+
+        // same group, child, should be returned
+        final NotificationRecord group1Child = generateNotificationRecord(
+                mTestNotificationChannel, 4, "group1", false);
+        mBinderService.enqueueNotificationWithTag(PKG, "opPkg", null, group1Child.sbn.getId(),
+                group1Child.sbn.getNotification(), group1Child.sbn.getUserId());
+        waitForIdle();
+
+        List<NotificationRecord> inGroup1 =
+                mNotificationManagerService.findGroupNotificationsLocked(PKG, group1.getGroupKey(),
+                        group1.sbn.getUserId());
+        assertEquals(3, inGroup1.size());
+        for (NotificationRecord record : inGroup1) {
+            assertTrue(record.getGroupKey().equals(group1.getGroupKey()));
+            assertTrue(record.sbn.getId() == 1 || record.sbn.getId() == 4);
+        }
+    }
+
+
+    @Test
     public void testTvExtenderChannelOverride_onTv() throws Exception {
         mNotificationManagerService.setIsTelevision(true);
         mNotificationManagerService.setRankingHelper(mRankingHelper);
@@ -701,4 +756,134 @@
         assertFalse(mNotificationManagerService.hasCompanionDevice(mListener));
     }
 
+    @Test
+    public void testSnoozeRunnable_snoozeNonGrouped() throws Exception {
+        final NotificationRecord nonGrouped = generateNotificationRecord(
+                mTestNotificationChannel, 1, null, false);
+        final NotificationRecord grouped = generateNotificationRecord(
+                mTestNotificationChannel, 2, "group", false);
+        mNotificationManagerService.addNotification(grouped);
+        mNotificationManagerService.addNotification(nonGrouped);
+
+        NotificationManagerService.SnoozeNotificationRunnable snoozeNotificationRunnable =
+                mNotificationManagerService.new SnoozeNotificationRunnable(
+                        nonGrouped.getKey(), 100, null);
+        snoozeNotificationRunnable.run();
+
+        // only snooze the one notification
+        verify(mSnoozeHelper, times(1)).snooze(any(NotificationRecord.class), anyLong());
+    }
+
+    @Test
+    public void testSnoozeRunnable_snoozeSummary_withChildren() throws Exception {
+        final NotificationRecord parent = generateNotificationRecord(
+                mTestNotificationChannel, 1, "group", true);
+        final NotificationRecord child = generateNotificationRecord(
+                mTestNotificationChannel, 2, "group", false);
+        final NotificationRecord child2 = generateNotificationRecord(
+                mTestNotificationChannel, 3, "group", false);
+        mNotificationManagerService.addNotification(parent);
+        mNotificationManagerService.addNotification(child);
+        mNotificationManagerService.addNotification(child2);
+
+        NotificationManagerService.SnoozeNotificationRunnable snoozeNotificationRunnable =
+                mNotificationManagerService.new SnoozeNotificationRunnable(
+                        parent.getKey(), 100, null);
+        snoozeNotificationRunnable.run();
+
+        // snooze parent and children
+        verify(mSnoozeHelper, times(3)).snooze(any(NotificationRecord.class), anyLong());
+    }
+
+    @Test
+    public void testSnoozeRunnable_snoozeGroupChild_fellowChildren() throws Exception {
+        final NotificationRecord parent = generateNotificationRecord(
+                mTestNotificationChannel, 1, "group", true);
+        final NotificationRecord child = generateNotificationRecord(
+                mTestNotificationChannel, 2, "group", false);
+        final NotificationRecord child2 = generateNotificationRecord(
+                mTestNotificationChannel, 3, "group", false);
+        mNotificationManagerService.addNotification(parent);
+        mNotificationManagerService.addNotification(child);
+        mNotificationManagerService.addNotification(child2);
+
+        NotificationManagerService.SnoozeNotificationRunnable snoozeNotificationRunnable =
+                mNotificationManagerService.new SnoozeNotificationRunnable(
+                        child2.getKey(), 100, null);
+        snoozeNotificationRunnable.run();
+
+        // only snooze the one child
+        verify(mSnoozeHelper, times(1)).snooze(any(NotificationRecord.class), anyLong());
+    }
+
+    @Test
+    public void testSnoozeRunnable_snoozeGroupChild_onlyChildOfSummary() throws Exception {
+        final NotificationRecord parent = generateNotificationRecord(
+                mTestNotificationChannel, 1, "group", true);
+        assertTrue(parent.sbn.getNotification().isGroupSummary());
+        final NotificationRecord child = generateNotificationRecord(
+                mTestNotificationChannel, 2, "group", false);
+        mNotificationManagerService.addNotification(parent);
+        mNotificationManagerService.addNotification(child);
+
+        NotificationManagerService.SnoozeNotificationRunnable snoozeNotificationRunnable =
+                mNotificationManagerService.new SnoozeNotificationRunnable(
+                        child.getKey(), 100, null);
+        snoozeNotificationRunnable.run();
+
+        // snooze child and summary
+        verify(mSnoozeHelper, times(2)).snooze(any(NotificationRecord.class), anyLong());
+    }
+
+    @Test
+    public void testSnoozeRunnable_snoozeGroupChild_noOthersInGroup() throws Exception {
+        final NotificationRecord child = generateNotificationRecord(
+                mTestNotificationChannel, 2, "group", false);
+        mNotificationManagerService.addNotification(child);
+
+        NotificationManagerService.SnoozeNotificationRunnable snoozeNotificationRunnable =
+                mNotificationManagerService.new SnoozeNotificationRunnable(
+                        child.getKey(), 100, null);
+        snoozeNotificationRunnable.run();
+
+        // snooze child only
+        verify(mSnoozeHelper, times(1)).snooze(any(NotificationRecord.class), anyLong());
+    }
+
+    @Test
+    public void testPostGroupChild_unsnoozeParent() throws Exception {
+        final NotificationRecord child = generateNotificationRecord(
+                mTestNotificationChannel, 2, "group", false);
+
+        mBinderService.enqueueNotificationWithTag(PKG, "opPkg", null,
+                child.sbn.getId(), child.sbn.getNotification(), child.sbn.getUserId());
+        waitForIdle();
+
+        verify(mSnoozeHelper, times(1)).repostGroupSummary(
+                anyString(), anyInt(), eq(child.getGroupKey()));
+    }
+
+    @Test
+    public void testPostNonGroup_noUnsnoozing() throws Exception {
+        final NotificationRecord record = generateNotificationRecord(
+                mTestNotificationChannel, 2, null, false);
+
+        mBinderService.enqueueNotificationWithTag(PKG, "opPkg", null,
+                record.sbn.getId(), record.sbn.getNotification(), record.sbn.getUserId());
+        waitForIdle();
+
+        verify(mSnoozeHelper, never()).repostGroupSummary(anyString(), anyInt(), anyString());
+    }
+
+    @Test
+    public void testPostGroupSummary_noUnsnoozing() throws Exception {
+        final NotificationRecord parent = generateNotificationRecord(
+                mTestNotificationChannel, 2, "group", true);
+
+        mBinderService.enqueueNotificationWithTag(PKG, "opPkg", null,
+                parent.sbn.getId(), parent.sbn.getNotification(), parent.sbn.getUserId());
+        waitForIdle();
+
+        verify(mSnoozeHelper, never()).repostGroupSummary(anyString(), anyInt(), anyString());
+    }
 }
diff --git a/services/tests/notification/src/com/android/server/notification/SnoozeHelperTest.java b/services/tests/notification/src/com/android/server/notification/SnoozeHelperTest.java
index 9575d32..51ec05c 100644
--- a/services/tests/notification/src/com/android/server/notification/SnoozeHelperTest.java
+++ b/services/tests/notification/src/com/android/server/notification/SnoozeHelperTest.java
@@ -34,6 +34,7 @@
 import android.support.test.InstrumentationRegistry;
 import android.support.test.runner.AndroidJUnit4;
 import android.test.suitebuilder.annotation.SmallTest;
+import android.util.Slog;
 
 import static junit.framework.Assert.assertEquals;
 import static junit.framework.Assert.assertFalse;
@@ -232,13 +233,50 @@
         assertEquals(4, mSnoozeHelper.getSnoozed().size());
     }
 
+    @Test
+    public void repostGroupSummary_onlyFellowGroupChildren() throws Exception {
+        NotificationRecord r = getNotificationRecord(
+                "pkg", 1, "one", UserHandle.SYSTEM, "group1", false);
+        NotificationRecord r2 = getNotificationRecord(
+                "pkg", 2, "two", UserHandle.SYSTEM, "group1", false);
+        mSnoozeHelper.snooze(r, 1000);
+        mSnoozeHelper.snooze(r2, 1000);
+        mSnoozeHelper.repostGroupSummary("pkg", UserHandle.USER_SYSTEM, "group1");
+
+        verify(mCallback, never()).repost(UserHandle.USER_SYSTEM, r);
+    }
+
+    @Test
+    public void repostGroupSummary_repostsSummary() throws Exception {
+        when(mUserProfiles.getCurrentProfileIds()).thenReturn(
+                new int[] {UserHandle.USER_SYSTEM});
+        NotificationRecord r = getNotificationRecord(
+                "pkg", 1, "one", UserHandle.SYSTEM, "group1", true);
+        NotificationRecord r2 = getNotificationRecord(
+                "pkg", 2, "two", UserHandle.SYSTEM, "group1", false);
+        mSnoozeHelper.snooze(r, 1000);
+        mSnoozeHelper.snooze(r2, 1000);
+        assertEquals(2, mSnoozeHelper.getSnoozed().size());
+        assertEquals(2, mSnoozeHelper.getSnoozed(UserHandle.USER_SYSTEM, "pkg").size());
+
+        mSnoozeHelper.repostGroupSummary("pkg", UserHandle.USER_SYSTEM, r.getGroupKey());
+
+        verify(mCallback, times(1)).repost(UserHandle.USER_SYSTEM, r);
+        verify(mCallback, never()).repost(UserHandle.USER_SYSTEM, r2);
+
+        assertEquals(1, mSnoozeHelper.getSnoozed().size());
+        assertEquals(1, mSnoozeHelper.getSnoozed(UserHandle.USER_SYSTEM, "pkg").size());
+    }
+
     private NotificationRecord getNotificationRecord(String pkg, int id, String tag,
-            UserHandle user) {
+            UserHandle user, String groupKey, boolean groupSummary) {
         Notification n = new Notification.Builder(getContext(), TEST_CHANNEL_ID)
                 .setContentTitle("A")
                 .setGroup("G")
                 .setSortKey("A")
                 .setWhen(1205)
+                .setGroup(groupKey)
+                .setGroupSummary(groupSummary)
                 .build();
         final NotificationChannel notificationChannel = new NotificationChannel(
                 TEST_CHANNEL_ID, "name", NotificationManager.IMPORTANCE_LOW);
@@ -246,4 +284,9 @@
                 pkg, pkg, id, tag, 0, 0, n, user, null,
                 System.currentTimeMillis()), notificationChannel);
     }
+
+    private NotificationRecord getNotificationRecord(String pkg, int id, String tag,
+            UserHandle user) {
+        return getNotificationRecord(pkg, id, tag, user, null, false);
+    }
 }
diff --git a/services/tests/servicestests/assets/DevicePolicyManagerServiceMigrationTest3/profile_device_policies.xml b/services/tests/servicestests/assets/DevicePolicyManagerServiceMigrationTest3/profile_device_policies.xml
new file mode 100644
index 0000000..b162785
--- /dev/null
+++ b/services/tests/servicestests/assets/DevicePolicyManagerServiceMigrationTest3/profile_device_policies.xml
@@ -0,0 +1,8 @@
+<?xml version='1.0' encoding='utf-8' standalone='yes' ?>
+<policies setup-complete="true" provisioning-state="3">
+<admin name="com.android.frameworks.servicestests/com.android.server.devicepolicy.DummyDeviceAdmins$Admin1">
+    <policies flags="991" />
+    <strong-auth-unlock-timeout value="0" />
+    <organization-color value="-16738680" />
+</admin>
+</policies>
diff --git a/services/tests/servicestests/assets/DevicePolicyManagerServiceMigrationTest3/profile_owner.xml b/services/tests/servicestests/assets/DevicePolicyManagerServiceMigrationTest3/profile_owner.xml
new file mode 100644
index 0000000..7440424
--- /dev/null
+++ b/services/tests/servicestests/assets/DevicePolicyManagerServiceMigrationTest3/profile_owner.xml
@@ -0,0 +1,8 @@
+<?xml version='1.0' encoding='utf-8' standalone='yes' ?>
+<root>
+    <profile-owner
+        package="com.android.frameworks.servicestests"
+        name="com.android.frameworks.servicestests"
+        component="com.android.frameworks.servicestests/com.android.server.devicepolicy.DummyDeviceAdmins$Admin1"
+        userRestrictionsMigrated="true" />
+</root>
diff --git a/services/tests/servicestests/assets/DevicePolicyManagerServiceMigrationTest3/system_device_policies.xml b/services/tests/servicestests/assets/DevicePolicyManagerServiceMigrationTest3/system_device_policies.xml
new file mode 100644
index 0000000..5f9a871
--- /dev/null
+++ b/services/tests/servicestests/assets/DevicePolicyManagerServiceMigrationTest3/system_device_policies.xml
@@ -0,0 +1,3 @@
+<?xml version='1.0' encoding='utf-8' standalone='yes' ?>
+<policies setup-complete="true" provisioning-state="3">
+</policies>
diff --git a/services/tests/servicestests/src/com/android/server/accessibility/AccessibilityGestureDetectorTest.java b/services/tests/servicestests/src/com/android/server/accessibility/AccessibilityGestureDetectorTest.java
index d0c2b52..14abb8a1 100644
--- a/services/tests/servicestests/src/com/android/server/accessibility/AccessibilityGestureDetectorTest.java
+++ b/services/tests/servicestests/src/com/android/server/accessibility/AccessibilityGestureDetectorTest.java
@@ -16,7 +16,6 @@
 
 package com.android.server.accessibility;
 
-import static junit.framework.TestCase.assertEquals;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.reset;
 import static org.mockito.Mockito.when;
diff --git a/services/tests/servicestests/src/com/android/server/accessibility/FingerprintGestureControllerTest.java b/services/tests/servicestests/src/com/android/server/accessibility/FingerprintGestureControllerTest.java
index cf477f2..360ccbf 100644
--- a/services/tests/servicestests/src/com/android/server/accessibility/FingerprintGestureControllerTest.java
+++ b/services/tests/servicestests/src/com/android/server/accessibility/FingerprintGestureControllerTest.java
@@ -131,7 +131,8 @@
         mFingerprintGestureController.registerFingerprintGestureCallback(
                 mMockFingerprintGestureCallback, null);
         mFingerprintGestureController.onGesture(FINGERPRINT_GESTURE_SWIPE_DOWN);
-        verify(mMockFingerprintGestureCallback, times(1)).onGesture(FINGERPRINT_GESTURE_SWIPE_DOWN);
+        verify(mMockFingerprintGestureCallback, times(1))
+                .onGestureDetected(FINGERPRINT_GESTURE_SWIPE_DOWN);
 
         reset(mMockFingerprintGestureCallback);
         mFingerprintGestureController.unregisterFingerprintGestureCallback(
@@ -150,9 +151,11 @@
         mFingerprintGestureController.registerFingerprintGestureCallback(
                 mMockFingerprintGestureCallback, messageCapturingHandler);
         mFingerprintGestureController.onGesture(FINGERPRINT_GESTURE_SWIPE_DOWN);
-        verify(mMockFingerprintGestureCallback, times(0)).onGesture(FINGERPRINT_GESTURE_SWIPE_DOWN);
+        verify(mMockFingerprintGestureCallback, times(0))
+                .onGestureDetected(FINGERPRINT_GESTURE_SWIPE_DOWN);
         messageCapturingHandler.sendLastMessage();
-        verify(mMockFingerprintGestureCallback, times(1)).onGesture(FINGERPRINT_GESTURE_SWIPE_DOWN);
+        verify(mMockFingerprintGestureCallback, times(1))
+                .onGestureDetected(FINGERPRINT_GESTURE_SWIPE_DOWN);
 
         reset(mMockFingerprintGestureCallback);
         mFingerprintGestureController.unregisterFingerprintGestureCallback(
diff --git a/services/tests/servicestests/src/com/android/server/accessibility/GestureDescriptionTest.java b/services/tests/servicestests/src/com/android/server/accessibility/GestureDescriptionTest.java
index b876a5f..8d389a2 100644
--- a/services/tests/servicestests/src/com/android/server/accessibility/GestureDescriptionTest.java
+++ b/services/tests/servicestests/src/com/android/server/accessibility/GestureDescriptionTest.java
@@ -16,7 +16,6 @@
 
 package com.android.server.accessibility;
 
-import static android.accessibilityservice.GestureDescription.StrokeDescription.INVALID_STROKE_ID;
 import static org.hamcrest.CoreMatchers.allOf;
 import static org.hamcrest.CoreMatchers.everyItem;
 import static org.hamcrest.MatcherAssert.assertThat;
@@ -246,7 +245,7 @@
         swipePath.moveTo(10, 20);
         swipePath.lineTo(30, 40);
         StrokeDescription stroke1 =
-                new StrokeDescription(swipePath, 0, 100, 0, true);
+                new StrokeDescription(swipePath, 0, 100, true);
         GestureDescription gesture = new GestureDescription.Builder().addStroke(stroke1).build();
         List<GestureStep> steps = MotionEventGenerator
                 .getGestureStepsFromGestureDescription(gesture, 10);
@@ -260,9 +259,8 @@
         swipePath.moveTo(10, 20);
         swipePath.lineTo(30, 40);
         StrokeDescription stroke1 =
-                new StrokeDescription(swipePath, 0, 100, INVALID_STROKE_ID, true);
-        StrokeDescription stroke2 =
-                new StrokeDescription(swipePath, 0, 100, stroke1.getId(), false);
+                new StrokeDescription(swipePath, 0, 100, true);
+        StrokeDescription stroke2 = stroke1.continueStroke(swipePath, 0, 100, false);
         GestureDescription gesture = new GestureDescription.Builder().addStroke(stroke2).build();
         List<GestureStep> steps = MotionEventGenerator
                 .getGestureStepsFromGestureDescription(gesture, 10);
diff --git a/services/tests/servicestests/src/com/android/server/am/ActivityStackTests.java b/services/tests/servicestests/src/com/android/server/am/ActivityStackTests.java
index 58166b6..c87eaed 100644
--- a/services/tests/servicestests/src/com/android/server/am/ActivityStackTests.java
+++ b/services/tests/servicestests/src/com/android/server/am/ActivityStackTests.java
@@ -22,6 +22,7 @@
 import static org.junit.Assert.assertTrue;
 
 import android.content.ComponentName;
+import android.content.pm.ActivityInfo;
 import android.platform.test.annotations.Presubmit;
 import android.support.test.filters.SmallTest;
 import android.support.test.runner.AndroidJUnit4;
@@ -84,4 +85,16 @@
         // Make sure the resumed activity is untouched.
         assertEquals(testStack.mResumedActivity, activityRecord);
     }
+
+    @Test
+    public void testStopActivityWhenActivityDestroyed() throws Exception {
+        final ActivityManagerService service = createActivityManagerService();
+        final TaskRecord task = createTask(service, testActivityComponent, TEST_STACK_ID);
+        final ActivityRecord activityRecord = createActivity(service, testActivityComponent, task);
+        activityRecord.info.flags |= ActivityInfo.FLAG_NO_HISTORY;
+        final ActivityStack testStack = service.mStackSupervisor.getStack(TEST_STACK_ID);
+        service.mStackSupervisor.setFocusStackUnchecked("testStopActivityWithDestroy", testStack);
+
+        testStack.stopActivityLocked(activityRecord);
+    }
 }
diff --git a/services/tests/servicestests/src/com/android/server/am/ActivityTestsBase.java b/services/tests/servicestests/src/com/android/server/am/ActivityTestsBase.java
index 0827084..3fc2c12 100644
--- a/services/tests/servicestests/src/com/android/server/am/ActivityTestsBase.java
+++ b/services/tests/servicestests/src/com/android/server/am/ActivityTestsBase.java
@@ -161,6 +161,11 @@
         void moveHomeStackToFront(String reason) {
         }
 
+        @Override
+        boolean moveHomeStackTaskToTop(String reason) {
+            return true;
+        }
+
         // Invoked during {@link ActivityStack} creation.
         @Override
         void updateUIDsPresentOnDisplay() {
diff --git a/services/tests/servicestests/src/com/android/server/devicepolicy/DevicePolicyManagerServiceMigrationTest.java b/services/tests/servicestests/src/com/android/server/devicepolicy/DevicePolicyManagerServiceMigrationTest.java
index b440095..be1d07b 100644
--- a/services/tests/servicestests/src/com/android/server/devicepolicy/DevicePolicyManagerServiceMigrationTest.java
+++ b/services/tests/servicestests/src/com/android/server/devicepolicy/DevicePolicyManagerServiceMigrationTest.java
@@ -15,31 +15,28 @@
  */
 package com.android.server.devicepolicy;
 
-import com.android.server.LocalServices;
-import com.android.server.SystemService;
-import com.android.server.devicepolicy.DevicePolicyManagerServiceTestable.OwnersTestable;
+import static org.mockito.Matchers.any;
+import static org.mockito.Matchers.anyInt;
+import static org.mockito.Matchers.eq;
+import static org.mockito.Mockito.doAnswer;
+import static org.mockito.Mockito.when;
 
-import android.app.admin.DevicePolicyManager;
 import android.app.admin.DevicePolicyManagerInternal;
 import android.content.pm.PackageManager;
 import android.content.pm.UserInfo;
 import android.os.Bundle;
 import android.os.UserHandle;
 import android.os.UserManager;
-import android.util.Pair;
+import android.provider.Settings;
 
-import org.mockito.invocation.InvocationOnMock;
-import org.mockito.stubbing.Answer;
+import com.android.server.LocalServices;
+import com.android.server.SystemService;
+import com.android.server.devicepolicy.DevicePolicyManagerServiceTestable.OwnersTestable;
 
 import java.io.File;
 import java.util.HashMap;
 import java.util.Map;
-
-import static org.mockito.Matchers.any;
-import static org.mockito.Matchers.anyInt;
-import static org.mockito.Matchers.eq;
-import static org.mockito.Mockito.doAnswer;
-import static org.mockito.Mockito.when;
+import java.util.Set;
 
 public class DevicePolicyManagerServiceMigrationTest extends DpmTestBase {
     private DpmMockContext mContext;
@@ -57,7 +54,7 @@
     public void testMigration() throws Exception {
         final File user10dir = mMockContext.addUser(10, 0);
         final File user11dir = mMockContext.addUser(11, UserInfo.FLAG_MANAGED_PROFILE);
-        final File user12dir = mMockContext.addUser(12, 0);
+        mMockContext.addUser(12, 0);
 
         setUpPackageManagerForAdmin(admin1, DpmMockContext.CALLER_SYSTEM_USER_UID);
         setUpPackageManagerForAdmin(admin2, UserHandle.getUid(10, 123));
@@ -109,16 +106,13 @@
 
         final Map<Integer, Bundle> newBaseRestrictions = new HashMap<>();
 
-        doAnswer(new Answer<Void>() {
-            @Override
-            public Void answer(InvocationOnMock invocation) throws Throwable {
-                Integer userId = (Integer) invocation.getArguments()[0];
-                Bundle bundle = (Bundle) invocation.getArguments()[1];
+        doAnswer(invocation -> {
+            Integer userId = (Integer) invocation.getArguments()[0];
+            Bundle bundle = (Bundle) invocation.getArguments()[1];
 
-                newBaseRestrictions.put(userId, bundle);
+            newBaseRestrictions.put(userId, bundle);
 
-                return null;
-            }
+            return null;
         }).when(mContext.userManagerInternal).setBaseUserRestrictionsByDpmsForMigration(
                 anyInt(), any(Bundle.class));
 
@@ -225,16 +219,13 @@
 
         final Map<Integer, Bundle> newBaseRestrictions = new HashMap<>();
 
-        doAnswer(new Answer<Void>() {
-            @Override
-            public Void answer(InvocationOnMock invocation) throws Throwable {
-                Integer userId = (Integer) invocation.getArguments()[0];
-                Bundle bundle = (Bundle) invocation.getArguments()[1];
+        doAnswer(invocation -> {
+            Integer userId = (Integer) invocation.getArguments()[0];
+            Bundle bundle = (Bundle) invocation.getArguments()[1];
 
-                newBaseRestrictions.put(userId, bundle);
+            newBaseRestrictions.put(userId, bundle);
 
-                return null;
-            }
+            return null;
         }).when(mContext.userManagerInternal).setBaseUserRestrictionsByDpmsForMigration(
                 anyInt(), any(Bundle.class));
 
@@ -278,4 +269,63 @@
                 ),
                 dpms.getProfileOwnerAdminLocked(UserHandle.USER_SYSTEM).ensureUserRestrictions());
     }
+
+    // Test setting default restrictions for managed profile.
+    public void testMigration3_managedProfileOwner() throws Exception {
+        // Create a managed profile user.
+        final File user10dir = mMockContext.addUser(10, UserInfo.FLAG_MANAGED_PROFILE);
+        // Profile owner package for managed profile user.
+        setUpPackageManagerForAdmin(admin1, UserHandle.getUid(10, 123));
+        // Set up fake UserManager to make it look like a managed profile.
+        when(mMockContext.userManager.isManagedProfile(eq(10))).thenReturn(true);
+        // Set up fake Settings to make it look like INSTALL_NON_MARKET_APPS was reversed.
+        when(mMockContext.settings.settingsSecureGetIntForUser(
+                eq(Settings.Secure.UNKNOWN_SOURCES_DEFAULT_REVERSED),
+                eq(0), eq(10))).thenReturn(1);
+        // Write policy and owners files.
+        DpmTestUtils.writeToFile(
+                (new File(mContext.systemUserDataDir, "device_policies.xml")).getAbsoluteFile(),
+                DpmTestUtils.readAsset(mRealTestContext,
+                        "DevicePolicyManagerServiceMigrationTest3/system_device_policies.xml"));
+        DpmTestUtils.writeToFile(
+                (new File(user10dir, "device_policies.xml")).getAbsoluteFile(),
+                DpmTestUtils.readAsset(mRealTestContext,
+                        "DevicePolicyManagerServiceMigrationTest3/profile_device_policies.xml"));
+        DpmTestUtils.writeToFile(
+                (new File(user10dir, "profile_owner.xml")).getAbsoluteFile(),
+                DpmTestUtils.readAsset(mRealTestContext,
+                        "DevicePolicyManagerServiceMigrationTest3/profile_owner.xml"));
+
+        final DevicePolicyManagerServiceTestable dpms;
+
+        // Initialize DPM/DPMS and let it migrate the persisted information.
+        // (Need clearCallingIdentity() to pass permission checks.)
+        final long ident = mContext.binder.clearCallingIdentity();
+        try {
+            LocalServices.removeServiceForTest(DevicePolicyManagerInternal.class);
+
+            dpms = new DevicePolicyManagerServiceTestable(mContext, dataDir);
+
+            dpms.systemReady(SystemService.PHASE_LOCK_SETTINGS_READY);
+            dpms.systemReady(SystemService.PHASE_BOOT_COMPLETED);
+        } finally {
+            mContext.binder.restoreCallingIdentity(ident);
+        }
+
+        assertFalse(dpms.mOwners.hasDeviceOwner());
+        assertTrue(dpms.mOwners.hasProfileOwner(10));
+
+        // Check that default restrictions were applied.
+        DpmTestUtils.assertRestrictions(
+                DpmTestUtils.newRestrictions(
+                        UserManager.DISALLOW_INSTALL_UNKNOWN_SOURCES,
+                        UserManager.DISALLOW_BLUETOOTH_SHARING
+                ),
+                dpms.getProfileOwnerAdminLocked(10).ensureUserRestrictions());
+
+        final Set<String> alreadySet =
+                dpms.getProfileOwnerAdminLocked(10).defaultEnabledRestrictionsAlreadySet;
+        assertEquals(alreadySet.size(), 1);
+        assertTrue(alreadySet.contains(UserManager.DISALLOW_BLUETOOTH_SHARING));
+    }
 }
diff --git a/services/tests/servicestests/src/com/android/server/devicepolicy/DevicePolicyManagerServiceTestable.java b/services/tests/servicestests/src/com/android/server/devicepolicy/DevicePolicyManagerServiceTestable.java
index a6ce1d5..46da3de 100644
--- a/services/tests/servicestests/src/com/android/server/devicepolicy/DevicePolicyManagerServiceTestable.java
+++ b/services/tests/servicestests/src/com/android/server/devicepolicy/DevicePolicyManagerServiceTestable.java
@@ -21,7 +21,6 @@
 import android.app.backup.IBackupManager;
 import android.content.Context;
 import android.content.Intent;
-import android.content.IntentFilter;
 import android.content.pm.IPackageManager;
 import android.content.pm.PackageManagerInternal;
 import android.database.ContentObserver;
@@ -56,17 +55,17 @@
     public static class OwnersTestable extends Owners {
         public static final String LEGACY_FILE = "legacy.xml";
         public static final String DEVICE_OWNER_FILE = "device_owner2.xml";
-        public static final String PROFILE_OWNER_FILE_BASE = "profile_owner.xml";
+        public static final String PROFILE_OWNER_FILE = "profile_owner.xml";
 
         private final File mLegacyFile;
         private final File mDeviceOwnerFile;
-        private final File mProfileOwnerBase;
+        private final File mUsersDataDir;
 
         public OwnersTestable(DpmMockContext context) {
             super(context.userManager, context.userManagerInternal, context.packageManagerInternal);
             mLegacyFile = new File(context.dataDir, LEGACY_FILE);
             mDeviceOwnerFile = new File(context.dataDir, DEVICE_OWNER_FILE);
-            mProfileOwnerBase = new File(context.dataDir, PROFILE_OWNER_FILE_BASE);
+            mUsersDataDir = new File(context.dataDir, "users");
         }
 
         @Override
@@ -81,7 +80,8 @@
 
         @Override
         File getProfileOwnerFileWithTestOverride(int userId) {
-            return new File(mDeviceOwnerFile.getAbsoluteFile() + "-" + userId);
+            final File userDir = new File(mUsersDataDir, String.valueOf(userId));
+            return new File(userDir, PROFILE_OWNER_FILE);
         }
     }
 
diff --git a/services/tests/servicestests/src/com/android/server/devicepolicy/DpmMockContext.java b/services/tests/servicestests/src/com/android/server/devicepolicy/DpmMockContext.java
index 1ea12d8..23fada4 100644
--- a/services/tests/servicestests/src/com/android/server/devicepolicy/DpmMockContext.java
+++ b/services/tests/servicestests/src/com/android/server/devicepolicy/DpmMockContext.java
@@ -468,7 +468,7 @@
         when(accountManager.getAccountsAsUser(anyInt())).thenReturn(new Account[0]);
 
         // Create a data directory.
-        final File dir = new File(dataDir, "user" + userId);
+        final File dir = new File(dataDir, "users/" + userId);
         DpmTestUtils.clearDir(dir);
 
         when(environment.getUserSystemDirectory(eq(userId))).thenReturn(dir);
diff --git a/services/tests/servicestests/src/com/android/server/devicepolicy/NetworkEventTest.java b/services/tests/servicestests/src/com/android/server/devicepolicy/NetworkEventTest.java
index 315d37c..db317a0 100644
--- a/services/tests/servicestests/src/com/android/server/devicepolicy/NetworkEventTest.java
+++ b/services/tests/servicestests/src/com/android/server/devicepolicy/NetworkEventTest.java
@@ -35,7 +35,7 @@
         p.setDataPosition(0);
         ConnectEvent unparceledEvent = p.readParcelable(NetworkEventTest.class.getClassLoader());
         p.recycle();
-        assertEquals(event.getIpAddress(), unparceledEvent.getIpAddress());
+        assertEquals(event.getInetAddress(), unparceledEvent.getInetAddress());
         assertEquals(event.getPort(), unparceledEvent.getPort());
         assertEquals(event.getPackageName(), unparceledEvent.getPackageName());
         assertEquals(event.getTimestamp(), unparceledEvent.getTimestamp());
@@ -53,9 +53,10 @@
         DnsEvent unparceledEvent = p.readParcelable(NetworkEventTest.class.getClassLoader());
         p.recycle();
         assertEquals(event.getHostname(), unparceledEvent.getHostname());
-        assertEquals(event.getIpAddresses()[0], unparceledEvent.getIpAddresses()[0]);
-        assertEquals(event.getIpAddresses()[1], unparceledEvent.getIpAddresses()[1]);
-        assertEquals(event.getIpAddressesCount(), unparceledEvent.getIpAddressesCount());
+        assertEquals(event.getInetAddresses().get(0), unparceledEvent.getInetAddresses().get(0));
+        assertEquals(event.getInetAddresses().get(1), unparceledEvent.getInetAddresses().get(1));
+        assertEquals(event.getTotalResolvedAddressCount(),
+                unparceledEvent.getTotalResolvedAddressCount());
         assertEquals(event.getPackageName(), unparceledEvent.getPackageName());
         assertEquals(event.getTimestamp(), unparceledEvent.getTimestamp());
     }
diff --git a/services/tests/servicestests/src/com/android/server/pm/PackageParserTest.java b/services/tests/servicestests/src/com/android/server/pm/PackageParserTest.java
index d8db331..1284b1b 100644
--- a/services/tests/servicestests/src/com/android/server/pm/PackageParserTest.java
+++ b/services/tests/servicestests/src/com/android/server/pm/PackageParserTest.java
@@ -15,7 +15,6 @@
  */
 package com.android.server.pm;
 
-import android.annotation.TestApi;
 import android.content.pm.ActivityInfo;
 import android.content.pm.ApplicationInfo;
 import android.content.pm.ConfigurationInfo;
@@ -338,7 +337,7 @@
 
         // Sanity check for InstrumentationInfo.
         assertEquals(a.info.targetPackage, b.info.targetPackage);
-        assertEquals(a.info.targetProcess, b.info.targetProcess);
+        assertEquals(a.info.targetProcesses, b.info.targetProcesses);
         assertEquals(a.info.sourceDir, b.info.sourceDir);
         assertEquals(a.info.publicSourceDir, b.info.publicSourceDir);
     }
diff --git a/services/tests/servicestests/src/com/android/server/wm/TaskSnapshotPersisterLoaderTest.java b/services/tests/servicestests/src/com/android/server/wm/TaskSnapshotPersisterLoaderTest.java
index 4121447..8108909 100644
--- a/services/tests/servicestests/src/com/android/server/wm/TaskSnapshotPersisterLoaderTest.java
+++ b/services/tests/servicestests/src/com/android/server/wm/TaskSnapshotPersisterLoaderTest.java
@@ -24,9 +24,7 @@
 
 import android.app.ActivityManager.TaskSnapshot;
 import android.content.res.Configuration;
-import android.graphics.Bitmap;
 import android.graphics.Rect;
-import android.os.Debug;
 import android.os.SystemClock;
 import android.platform.test.annotations.Presubmit;
 import android.support.test.filters.MediumTest;
@@ -55,13 +53,13 @@
 
     @Test
     public void testPersistAndLoadSnapshot() {
-        mPersister.persistSnapshot(1 , sTestUserId, createSnapshot());
+        mPersister.persistSnapshot(1 , mTestUserId, createSnapshot());
         mPersister.waitForQueueEmpty();
         final File[] files = new File[] { new File(sFilesDir.getPath() + "/snapshots/1.proto"),
                 new File(sFilesDir.getPath() + "/snapshots/1.jpg"),
                 new File(sFilesDir.getPath() + "/snapshots/1_reduced.jpg")};
         assertTrueForFiles(files, File::exists, " must exist");
-        final TaskSnapshot snapshot = mLoader.loadTask(1, sTestUserId, false /* reduced */);
+        final TaskSnapshot snapshot = mLoader.loadTask(1, mTestUserId, false /* reduced */);
         assertNotNull(snapshot);
         assertEquals(TEST_INSETS, snapshot.getContentInsets());
         assertNotNull(snapshot.getSnapshot());
@@ -76,8 +74,8 @@
 
     @Test
     public void testTaskRemovedFromRecents() {
-        mPersister.persistSnapshot(1, sTestUserId, createSnapshot());
-        mPersister.onTaskRemovedFromRecents(1, sTestUserId);
+        mPersister.persistSnapshot(1, mTestUserId, createSnapshot());
+        mPersister.onTaskRemovedFromRecents(1, mTestUserId);
         mPersister.waitForQueueEmpty();
         assertFalse(new File(sFilesDir.getPath() + "/snapshots/1.proto").exists());
         assertFalse(new File(sFilesDir.getPath() + "/snapshots/1.jpg").exists());
@@ -90,12 +88,12 @@
     @Test
     public void testThrottling() {
         long ms = SystemClock.elapsedRealtime();
-        mPersister.persistSnapshot(1, sTestUserId, createSnapshot());
-        mPersister.persistSnapshot(2, sTestUserId, createSnapshot());
-        mPersister.persistSnapshot(3, sTestUserId, createSnapshot());
-        mPersister.persistSnapshot(4, sTestUserId, createSnapshot());
-        mPersister.persistSnapshot(5, sTestUserId, createSnapshot());
-        mPersister.persistSnapshot(6, sTestUserId, createSnapshot());
+        mPersister.persistSnapshot(1, mTestUserId, createSnapshot());
+        mPersister.persistSnapshot(2, mTestUserId, createSnapshot());
+        mPersister.persistSnapshot(3, mTestUserId, createSnapshot());
+        mPersister.persistSnapshot(4, mTestUserId, createSnapshot());
+        mPersister.persistSnapshot(5, mTestUserId, createSnapshot());
+        mPersister.persistSnapshot(6, mTestUserId, createSnapshot());
         mPersister.waitForQueueEmpty();
         assertTrue(SystemClock.elapsedRealtime() - ms > 500);
     }
@@ -115,11 +113,11 @@
 
     @Test
     public void testRemoveObsoleteFiles() {
-        mPersister.persistSnapshot(1, sTestUserId, createSnapshot());
-        mPersister.persistSnapshot(2, sTestUserId, createSnapshot());
+        mPersister.persistSnapshot(1, mTestUserId, createSnapshot());
+        mPersister.persistSnapshot(2, mTestUserId, createSnapshot());
         final ArraySet<Integer> taskIds = new ArraySet<>();
         taskIds.add(1);
-        mPersister.removeObsoleteFiles(taskIds, new int[] { sTestUserId });
+        mPersister.removeObsoleteFiles(taskIds, new int[] { mTestUserId });
         mPersister.waitForQueueEmpty();
         final File[] existsFiles = new File[] {
                 new File(sFilesDir.getPath() + "/snapshots/1.proto"),
@@ -135,11 +133,11 @@
 
     @Test
     public void testRemoveObsoleteFiles_addedOneInTheMeantime() {
-        mPersister.persistSnapshot(1, sTestUserId, createSnapshot());
+        mPersister.persistSnapshot(1, mTestUserId, createSnapshot());
         final ArraySet<Integer> taskIds = new ArraySet<>();
         taskIds.add(1);
-        mPersister.removeObsoleteFiles(taskIds, new int[] { sTestUserId });
-        mPersister.persistSnapshot(2, sTestUserId, createSnapshot());
+        mPersister.removeObsoleteFiles(taskIds, new int[] { mTestUserId });
+        mPersister.persistSnapshot(2, mTestUserId, createSnapshot());
         mPersister.waitForQueueEmpty();
         final File[] existsFiles = new File[] {
                 new File(sFilesDir.getPath() + "/snapshots/1.proto"),
diff --git a/services/tests/servicestests/src/com/android/server/wm/TaskSnapshotPersisterTestBase.java b/services/tests/servicestests/src/com/android/server/wm/TaskSnapshotPersisterTestBase.java
index 5e7389d..18d0c32 100644
--- a/services/tests/servicestests/src/com/android/server/wm/TaskSnapshotPersisterTestBase.java
+++ b/services/tests/servicestests/src/com/android/server/wm/TaskSnapshotPersisterTestBase.java
@@ -21,7 +21,6 @@
 import static android.graphics.GraphicBuffer.USAGE_SW_READ_RARELY;
 
 import android.app.ActivityManager.TaskSnapshot;
-import android.content.pm.UserInfo;
 import android.graphics.Canvas;
 import android.graphics.Color;
 import android.graphics.GraphicBuffer;
@@ -31,8 +30,6 @@
 import android.support.test.InstrumentationRegistry;
 
 import org.junit.After;
-import org.junit.AfterClass;
-import org.junit.Assert;
 import org.junit.Before;
 import org.junit.BeforeClass;
 
@@ -43,32 +40,24 @@
  */
 class TaskSnapshotPersisterTestBase extends WindowTestsBase {
 
-    private static final String TEST_USER_NAME = "TaskSnapshotPersisterTest User";
     private static final Rect TEST_INSETS = new Rect(10, 20, 30, 40);
 
     TaskSnapshotPersister mPersister;
     TaskSnapshotLoader mLoader;
-    static int sTestUserId;
+    int mTestUserId;
     static File sFilesDir;
-    private static UserManager sUserManager;
 
     @BeforeClass
     public static void setUpUser() {
-        sUserManager = UserManager.get(InstrumentationRegistry.getContext());
-        sTestUserId = createUser(TEST_USER_NAME, 0);
         sFilesDir = InstrumentationRegistry.getContext().getFilesDir();
     }
 
-    @AfterClass
-    public static void tearDownUser() {
-        removeUser(sTestUserId);
-    }
-
     @Before
     public void setUp() throws Exception {
         super.setUp();
-        mPersister = new TaskSnapshotPersister(
-                userId -> sFilesDir);
+        final UserManager um = UserManager.get(InstrumentationRegistry.getContext());
+        mTestUserId = um.getUserHandle();
+        mPersister = new TaskSnapshotPersister(userId -> sFilesDir);
         mLoader = new TaskSnapshotLoader(mPersister);
         mPersister.start();
     }
@@ -78,20 +67,6 @@
         cleanDirectory();
     }
 
-    private static int createUser(String name, int flags) {
-        UserInfo user = sUserManager.createUser(name, flags);
-        if (user == null) {
-            Assert.fail("Error while creating the test user: " + TEST_USER_NAME);
-        }
-        return user.id;
-    }
-
-    private static void removeUser(int userId) {
-        if (!sUserManager.removeUser(userId)) {
-            Assert.fail("Error while removing the test user: " + TEST_USER_NAME);
-        }
-    }
-
     private void cleanDirectory() {
         for (File file : new File(sFilesDir, "snapshots").listFiles()) {
             if (!file.isDirectory()) {
@@ -101,7 +76,7 @@
     }
 
     TaskSnapshot createSnapshot() {
-        GraphicBuffer buffer = GraphicBuffer.create(100, 100, PixelFormat.RGBA_8888,
+        final GraphicBuffer buffer = GraphicBuffer.create(100, 100, PixelFormat.RGBA_8888,
                 USAGE_HW_TEXTURE | USAGE_SW_READ_RARELY | USAGE_SW_READ_RARELY);
         Canvas c = buffer.lockCanvas();
         c.drawColor(Color.RED);
diff --git a/services/usage/java/com/android/server/usage/StorageStatsService.java b/services/usage/java/com/android/server/usage/StorageStatsService.java
index 2ebf5fc..e13665b 100644
--- a/services/usage/java/com/android/server/usage/StorageStatsService.java
+++ b/services/usage/java/com/android/server/usage/StorageStatsService.java
@@ -157,7 +157,7 @@
 
     @Override
     public long getTotalBytes(String volumeUuid, String callingPackage) {
-        enforcePermission(Binder.getCallingUid(), callingPackage);
+        // NOTE: No permissions required
 
         if (volumeUuid == StorageManager.UUID_PRIVATE_INTERNAL) {
             return FileUtils.roundStorageSize(mStorage.getPrimaryStorageSize());
@@ -173,7 +173,7 @@
 
     @Override
     public long getFreeBytes(String volumeUuid, String callingPackage) {
-        enforcePermission(Binder.getCallingUid(), callingPackage);
+        // NOTE: No permissions required
 
         long cacheBytes = 0;
         final long token = Binder.clearCallingIdentity();
@@ -187,14 +187,14 @@
         }
 
         if (volumeUuid == StorageManager.UUID_PRIVATE_INTERNAL) {
-            return Environment.getDataDirectory().getUsableSpace() + cacheBytes;
+            return Environment.getDataDirectory().getFreeSpace() + cacheBytes;
         } else {
             final VolumeInfo vol = mStorage.findVolumeByUuid(volumeUuid);
             if (vol == null) {
                 throw new ParcelableException(
                         new IOException("Failed to find storage device for UUID " + volumeUuid));
             }
-            return vol.getPath().getUsableSpace() + cacheBytes;
+            return vol.getPath().getFreeSpace() + cacheBytes;
         }
     }
 
@@ -213,7 +213,6 @@
     @Override
     public StorageStats queryStatsForPackage(String volumeUuid, String packageName, int userId,
             String callingPackage) {
-        enforcePermission(Binder.getCallingUid(), callingPackage);
         if (userId != UserHandle.getCallingUserId()) {
             mContext.enforceCallingOrSelfPermission(
                     android.Manifest.permission.INTERACT_ACROSS_USERS, TAG);
@@ -227,6 +226,12 @@
             throw new ParcelableException(e);
         }
 
+        if (Binder.getCallingUid() == appInfo.uid) {
+            // No permissions required when asking about themselves
+        } else {
+            enforcePermission(Binder.getCallingUid(), callingPackage);
+        }
+
         if (mPackage.getPackagesForUid(appInfo.uid).length == 1) {
             // Only one package inside UID means we can fast-path
             return queryStatsForUid(volumeUuid, appInfo.uid, callingPackage);
@@ -257,14 +262,19 @@
 
     @Override
     public StorageStats queryStatsForUid(String volumeUuid, int uid, String callingPackage) {
-        enforcePermission(Binder.getCallingUid(), callingPackage);
-        if (UserHandle.getUserId(uid) != UserHandle.getCallingUserId()) {
+        final int userId = UserHandle.getUserId(uid);
+        final int appId = UserHandle.getAppId(uid);
+
+        if (userId != UserHandle.getCallingUserId()) {
             mContext.enforceCallingOrSelfPermission(
                     android.Manifest.permission.INTERACT_ACROSS_USERS, TAG);
         }
 
-        final int userId = UserHandle.getUserId(uid);
-        final int appId = UserHandle.getAppId(uid);
+        if (Binder.getCallingUid() == uid) {
+            // No permissions required when asking about themselves
+        } else {
+            enforcePermission(Binder.getCallingUid(), callingPackage);
+        }
 
         final String[] packageNames = mPackage.getPackagesForUid(uid);
         final long[] ceDataInodes = new long[packageNames.length];
@@ -304,12 +314,14 @@
 
     @Override
     public StorageStats queryStatsForUser(String volumeUuid, int userId, String callingPackage) {
-        enforcePermission(Binder.getCallingUid(), callingPackage);
         if (userId != UserHandle.getCallingUserId()) {
             mContext.enforceCallingOrSelfPermission(
                     android.Manifest.permission.INTERACT_ACROSS_USERS, TAG);
         }
 
+        // Always require permission to see user-level stats
+        enforcePermission(Binder.getCallingUid(), callingPackage);
+
         final int[] appIds = getAppIds(userId);
         final PackageStats stats = new PackageStats(TAG);
         try {
@@ -329,12 +341,14 @@
     @Override
     public ExternalStorageStats queryExternalStatsForUser(String volumeUuid, int userId,
             String callingPackage) {
-        enforcePermission(Binder.getCallingUid(), callingPackage);
         if (userId != UserHandle.getCallingUserId()) {
             mContext.enforceCallingOrSelfPermission(
                     android.Manifest.permission.INTERACT_ACROSS_USERS, TAG);
         }
 
+        // Always require permission to see user-level stats
+        enforcePermission(Binder.getCallingUid(), callingPackage);
+
         final int[] appIds = getAppIds(userId);
         final long[] stats;
         try {
diff --git a/services/voiceinteraction/java/com/android/server/voiceinteraction/VoiceInteractionManagerService.java b/services/voiceinteraction/java/com/android/server/voiceinteraction/VoiceInteractionManagerService.java
index 6c4ced4..4ffacfd 100644
--- a/services/voiceinteraction/java/com/android/server/voiceinteraction/VoiceInteractionManagerService.java
+++ b/services/voiceinteraction/java/com/android/server/voiceinteraction/VoiceInteractionManagerService.java
@@ -1203,6 +1203,50 @@
             }
 
             @Override
+            public void onPackageModified(String pkgName) {
+                // If the package modified is not in the current user, then don't bother making
+                // any changes as we are going to do any initialization needed when we switch users.
+                if (mCurUser != getChangingUserId()) {
+                    return;
+                }
+                // Package getting updated will be handled by {@link #onSomePackagesChanged}.
+                if (isPackageAppearing(pkgName) != PACKAGE_UNCHANGED) {
+                    return;
+                }
+                final ComponentName curInteractor = getCurInteractor(mCurUser);
+                if (curInteractor == null) {
+                    final VoiceInteractionServiceInfo availInteractorInfo
+                            = findAvailInteractor(mCurUser, pkgName);
+                    if (availInteractorInfo != null) {
+                        final ComponentName availInteractor = new ComponentName(
+                                availInteractorInfo.getServiceInfo().packageName,
+                                availInteractorInfo.getServiceInfo().name);
+                        setCurInteractor(availInteractor, mCurUser);
+                        if (getCurRecognizer(mCurUser) == null &&
+                                availInteractorInfo.getRecognitionService() != null) {
+                            setCurRecognizer(new ComponentName(
+                                    availInteractorInfo.getServiceInfo().packageName,
+                                    availInteractorInfo.getRecognitionService()), mCurUser);
+                        }
+                    }
+                } else {
+                    if (didSomePackagesChange()) {
+                        // Package is changed
+                        if (curInteractor != null && pkgName.equals(
+                                curInteractor.getPackageName())) {
+                            switchImplementationIfNeeded(true);
+                        }
+                    } else {
+                        // Only some components are changed
+                        if (curInteractor != null
+                                && isComponentModified(curInteractor.getClassName())) {
+                            switchImplementationIfNeeded(true);
+                        }
+                    }
+                }
+            }
+
+            @Override
             public void onSomePackagesChanged() {
                 int userHandle = getChangingUserId();
                 if (DEBUG) Slog.d(TAG, "onSomePackagesChanged user=" + userHandle);
diff --git a/telephony/java/android/telephony/CarrierConfigManager.java b/telephony/java/android/telephony/CarrierConfigManager.java
index 0b4a3e8..7174a70 100644
--- a/telephony/java/android/telephony/CarrierConfigManager.java
+++ b/telephony/java/android/telephony/CarrierConfigManager.java
@@ -993,6 +993,20 @@
             "carrier_default_actions_on_dcfailure_string_array";
 
     /**
+     * Defines carrier-specific actions which act upon
+     * com.android.internal.telephony.CARRIER_SIGNAL_RESET, used for customization of the
+     * default carrier app
+     * Format: "CARRIER_ACTION_IDX, ..."
+     * Where {@code CARRIER_ACTION_IDX} is an integer defined in
+     * {@link com.android.carrierdefaultapp.CarrierActionUtils CarrierActionUtils}
+     * Example:
+     * {@link com.android.carrierdefaultapp.CarrierActionUtils
+     * #CARRIER_ACTION_CANCEL_ALL_NOTIFICATIONS clear all notifications on reset}
+     * @hide
+     */
+    public static final String KEY_CARRIER_DEFAULT_ACTIONS_ON_RESET =
+            "carrier_default_actions_on_reset_string_array";
+    /**
      * Defines a list of acceptable redirection url for default carrier app
      * @hides
      */
@@ -1594,7 +1608,8 @@
         sDefaults.putStringArray(KEY_CARRIER_APP_WAKE_SIGNAL_CONFIG_STRING_ARRAY,
                 new String[]{
                         "com.android.carrierdefaultapp/.CarrierDefaultBroadcastReceiver:" +
-                                "com.android.internal.telephony.CARRIER_SIGNAL_REDIRECTED"
+                                "com.android.internal.telephony.CARRIER_SIGNAL_REDIRECTED," +
+                                "com.android.internal.telephony.CARRIER_SIGNAL_RESET"
                 });
         sDefaults.putStringArray(KEY_CARRIER_APP_NO_WAKE_SIGNAL_CONFIG_STRING_ARRAY, null);
 
@@ -1606,6 +1621,9 @@
                         //4: CARRIER_ACTION_DISABLE_METERED_APNS
                         //1: CARRIER_ACTION_SHOW_PORTAL_NOTIFICATION
                 });
+        sDefaults.putStringArray(KEY_CARRIER_DEFAULT_ACTIONS_ON_RESET, new String[]{
+                "6" //6: CARRIER_ACTION_CANCEL_ALL_NOTIFICATIONS
+                });
         sDefaults.putStringArray(KEY_CARRIER_DEFAULT_REDIRECTION_URL_STRING_ARRAY, null);
 
         sDefaults.putInt(KEY_MONTHLY_DATA_CYCLE_DAY_INT, DATA_CYCLE_USE_PLATFORM_DEFAULT);
diff --git a/telephony/java/com/android/internal/telephony/TelephonyIntents.java b/telephony/java/com/android/internal/telephony/TelephonyIntents.java
index f9875c5..ec9ca1d 100644
--- a/telephony/java/com/android/internal/telephony/TelephonyIntents.java
+++ b/telephony/java/com/android/internal/telephony/TelephonyIntents.java
@@ -402,7 +402,7 @@
      * <ul>
      *   <li>apnType</li><dd>A string with the apn type.</dd>
      *   <li>redirectionUrl</li><dd>redirection url string</dd>
-     *   <li>subId</dt><li>Sub Id which associated the data connection failure.</dd>
+     *   <li>subId</li><dd>Sub Id which associated the data connection failure.</dd>
      * </ul>
      * <p class="note">This is a protected intent that can only be sent by the system.</p>
      */
@@ -415,7 +415,7 @@
      * <ul>
      *   <li>apnType</li><dd>A string with the apn type.</dd>
      *   <li>errorCode</li><dd>A integer with dataFailCause.</dd>
-     *   <li>subId</dt><li>Sub Id which associated the data connection failure.</dd>
+     *   <li>subId</li><dd>Sub Id which associated the data connection failure.</dd>
      * </ul>
      * <p class="note">This is a protected intent that can only be sent by the system. </p>
      */
@@ -432,13 +432,25 @@
      *                        IPV4V6)</dd>
      *   <li>pcoId</li><dd>An integer indicating the pco id for the data.</dd>
      *   <li>pcoValue</li><dd>A byte array of pco data read from modem.</dd>
-     *   <li>subId</dt><li>Sub Id which associated the data connection.</dd>
+     *   <li>subId</li><dd>Sub Id which associated the data connection.</dd>
      * </ul>
      * <p class="note">This is a protected intent that can only be sent by the system. </p>
      */
     public static final String ACTION_CARRIER_SIGNAL_PCO_VALUE =
             "com.android.internal.telephony.CARRIER_SIGNAL_PCO_VALUE";
 
+    /**
+     * <p>Broadcast Action: when framework reset all carrier actions on sim load or absent.
+     * intended for carrier apps clean up (clear UI e.g.) and only sent to the specified carrier app
+     * The intent will have the following extra values:</p>
+     * <ul>
+     *   <li>subId</li><dd>Sub Id which associated the data connection failure.</dd>
+     * </ul>
+     * <p class="note">This is a protected intent that can only be sent by the system.</p>
+     */
+    public static final String ACTION_CARRIER_SIGNAL_RESET =
+            "com.android.internal.telephony.CARRIER_SIGNAL_RESET";
+
     // CARRIER_SIGNAL_ACTION extra keys
     public static final String EXTRA_REDIRECTION_URL_KEY = "redirectionUrl";
     public static final String EXTRA_ERROR_CODE_KEY = "errorCode";
diff --git a/tests/FeatureSplit/feature1/AndroidManifest.xml b/tests/FeatureSplit/feature1/AndroidManifest.xml
index 42619b6..b87361f 100644
--- a/tests/FeatureSplit/feature1/AndroidManifest.xml
+++ b/tests/FeatureSplit/feature1/AndroidManifest.xml
@@ -16,7 +16,7 @@
 
 <manifest xmlns:android="http://schemas.android.com/apk/res/android"
     package="com.android.test.split.feature"
-    featureName="feature1">
+    featureSplit="feature1">
 
     <uses-sdk android:minSdkVersion="21" />
 
diff --git a/tests/FeatureSplit/feature1/res/layout/included.xml b/tests/FeatureSplit/feature1/res/layout/included.xml
new file mode 100644
index 0000000..c64bdb7
--- /dev/null
+++ b/tests/FeatureSplit/feature1/res/layout/included.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<TextView xmlns:android="http://schemas.android.com/apk/res/android"
+    android:id="@+id/text"
+    android:layout_width="wrap_content"
+    android:layout_height="wrap_content" />
diff --git a/tests/FeatureSplit/feature1/res/layout/main.xml b/tests/FeatureSplit/feature1/res/layout/main.xml
new file mode 100644
index 0000000..dbea42a
--- /dev/null
+++ b/tests/FeatureSplit/feature1/res/layout/main.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="utf-8"?>
+<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent">
+    <include layout="@layout/included"
+        android:layout_width="match_parent"
+        android:layout_height="match_parent" />
+</FrameLayout>
diff --git a/tests/FeatureSplit/feature1/src/com/android/test/split/feature/one/One.java b/tests/FeatureSplit/feature1/src/com/android/test/split/feature/one/One.java
index def1339..61ac9df 100644
--- a/tests/FeatureSplit/feature1/src/com/android/test/split/feature/one/One.java
+++ b/tests/FeatureSplit/feature1/src/com/android/test/split/feature/one/One.java
@@ -15,17 +15,16 @@
  */
 package com.android.test.split.feature.one;
 
-import com.android.test.split.feature.ActivityMain;
-
+import android.app.Activity;
 import android.widget.TextView;
 import android.os.Bundle;
 
-public class One extends ActivityMain {
+public class One extends Activity {
 
     @Override
     public void onCreate(Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);
-        ((TextView) findViewById(com.android.test.split.feature.R.id.text))
-                .setText(R.string.feature_string);
+        setContentView(R.layout.main);
+        ((TextView) findViewById(R.id.text)).setText(R.string.feature_string);
     }
 }
diff --git a/tests/FeatureSplit/feature2/AndroidManifest.xml b/tests/FeatureSplit/feature2/AndroidManifest.xml
index b50044a..abd0b5e 100644
--- a/tests/FeatureSplit/feature2/AndroidManifest.xml
+++ b/tests/FeatureSplit/feature2/AndroidManifest.xml
@@ -16,7 +16,7 @@
 
 <manifest xmlns:android="http://schemas.android.com/apk/res/android"
     package="com.android.test.split.feature"
-    featureName="feature2">
+    featureSplit="feature2">
 
     <uses-sdk android:minSdkVersion="21" />
 
diff --git a/tests/net/java/com/android/server/connectivity/TetheringTest.java b/tests/net/java/com/android/server/connectivity/TetheringTest.java
index 47630e2..7a1c239 100644
--- a/tests/net/java/com/android/server/connectivity/TetheringTest.java
+++ b/tests/net/java/com/android/server/connectivity/TetheringTest.java
@@ -223,8 +223,6 @@
     @Test
     public void workingLocalOnlyHotspot() throws Exception {
         when(mConnectivityManager.isTetheringSupported()).thenReturn(true);
-        when(mWifiManager.setWifiApEnabled(any(WifiConfiguration.class), anyBoolean()))
-                .thenReturn(true);
 
         // Emulate externally-visible WifiManager effects, causing the
         // per-interface state machine to start up, and telling us that
@@ -238,6 +236,9 @@
         verify(mNMService, times(1)).setIpForwardingEnabled(true);
         verify(mNMService, times(1)).startTethering(any(String[].class));
         verifyNoMoreInteractions(mNMService);
+        verify(mWifiManager).updateInterfaceIpState(
+                mTestIfname, WifiManager.IFACE_IP_MODE_LOCAL_ONLY);
+        verifyNoMoreInteractions(mWifiManager);
         verifyTetheringBroadcast(mTestIfname, ConnectivityManager.EXTRA_ACTIVE_LOCAL_ONLY);
         // UpstreamNetworkMonitor will be started, and will register two callbacks:
         // a "listen all" and a "track default".
@@ -263,6 +264,7 @@
         verify(mNMService, times(1)).stopTethering();
         verify(mNMService, times(1)).setIpForwardingEnabled(false);
         verifyNoMoreInteractions(mNMService);
+        verifyNoMoreInteractions(mWifiManager);
         // Asking for the last error after the per-interface state machine
         // has been reaped yields an unknown interface error.
         assertEquals(ConnectivityManager.TETHER_ERROR_UNKNOWN_IFACE,
@@ -272,13 +274,12 @@
     @Test
     public void workingWifiTethering() throws Exception {
         when(mConnectivityManager.isTetheringSupported()).thenReturn(true);
-        when(mWifiManager.setWifiApEnabled(any(WifiConfiguration.class), anyBoolean()))
-                .thenReturn(true);
+        when(mWifiManager.startSoftAp(any(WifiConfiguration.class))).thenReturn(true);
 
         // Emulate pressing the WiFi tethering button.
         mTethering.startTethering(ConnectivityManager.TETHERING_WIFI, null, false);
         mLooper.dispatchAll();
-        verify(mWifiManager, times(1)).setWifiApEnabled(null, true);
+        verify(mWifiManager, times(1)).startSoftAp(null);
         verifyNoMoreInteractions(mWifiManager);
         verifyNoMoreInteractions(mConnectivityManager);
         verifyNoMoreInteractions(mNMService);
@@ -295,6 +296,9 @@
         verify(mNMService, times(1)).setIpForwardingEnabled(true);
         verify(mNMService, times(1)).startTethering(any(String[].class));
         verifyNoMoreInteractions(mNMService);
+        verify(mWifiManager).updateInterfaceIpState(
+                mTestIfname, WifiManager.IFACE_IP_MODE_TETHERED);
+        verifyNoMoreInteractions(mWifiManager);
         verifyTetheringBroadcast(mTestIfname, ConnectivityManager.EXTRA_ACTIVE_TETHER);
         // UpstreamNetworkMonitor will be started, and will register two callbacks:
         // a "listen all" and a "track default".
@@ -322,7 +326,7 @@
         // Emulate pressing the WiFi tethering button.
         mTethering.stopTethering(ConnectivityManager.TETHERING_WIFI);
         mLooper.dispatchAll();
-        verify(mWifiManager, times(1)).setWifiApEnabled(null, false);
+        verify(mWifiManager, times(1)).stopSoftAp();
         verifyNoMoreInteractions(mWifiManager);
         verifyNoMoreInteractions(mConnectivityManager);
         verifyNoMoreInteractions(mNMService);
@@ -341,6 +345,7 @@
         verify(mNMService, times(1)).stopTethering();
         verify(mNMService, times(1)).setIpForwardingEnabled(false);
         verifyNoMoreInteractions(mNMService);
+        verifyNoMoreInteractions(mWifiManager);
         // Asking for the last error after the per-interface state machine
         // has been reaped yields an unknown interface error.
         assertEquals(ConnectivityManager.TETHER_ERROR_UNKNOWN_IFACE,
diff --git a/tests/testables/src/android/testing/TestableContext.java b/tests/testables/src/android/testing/TestableContext.java
index cb5d4cb..630a287 100644
--- a/tests/testables/src/android/testing/TestableContext.java
+++ b/tests/testables/src/android/testing/TestableContext.java
@@ -43,7 +43,7 @@
  * <ul>
  * <li>System services can be mocked out with {@link #addMockSystemService}</li>
  * <li>Service binding can be mocked out with {@link #addMockService}</li>
- * <li>Settings support {@link TestableSettings}</li>
+ * <li>Settings support {@link TestableSettingsProvider}</li>
  * <li>Has support for {@link LeakCheck} for services and receivers</li>
  * </ul>
  *
@@ -59,7 +59,7 @@
 public class TestableContext extends ContextWrapper implements TestRule {
 
     private final TestableContentResolver mTestableContentResolver;
-    private final TestableSettings mSettingsProvider;
+    private final TestableSettingsProvider mSettingsProvider;
 
     private ArrayMap<String, Object> mMockSystemServices;
     private ArrayMap<ComponentName, IBinder> mMockServices;
@@ -79,9 +79,8 @@
         mTestableContentResolver = new TestableContentResolver(base);
         ContentProviderClient settings = base.getContentResolver()
                 .acquireContentProviderClient(Settings.AUTHORITY);
-        mSettingsProvider = TestableSettings.getFakeSettingsProvider(settings,
-                mTestableContentResolver);
-        mTestableContentResolver.addProvider(Settings.AUTHORITY, mSettingsProvider.getProvider());
+        mSettingsProvider = TestableSettingsProvider.getFakeSettingsProvider(settings);
+        mTestableContentResolver.addProvider(Settings.AUTHORITY, mSettingsProvider);
         mReceiver = check != null ? check.getTracker("receiver") : null;
         mService = check != null ? check.getTracker("service") : null;
         mComponent = check != null ? check.getTracker("component") : null;
@@ -129,7 +128,7 @@
         return super.getSystemService(name);
     }
 
-    public TestableSettings getSettingsProvider() {
+    TestableSettingsProvider getSettingsProvider() {
         return mSettingsProvider;
     }
 
@@ -236,12 +235,12 @@
         return new TestWatcher() {
             @Override
             protected void succeeded(Description description) {
-                mSettingsProvider.clearOverrides();
+                mSettingsProvider.clearValuesAndCheck(TestableContext.this);
             }
 
             @Override
             protected void failed(Throwable e, Description description) {
-                mSettingsProvider.clearOverrides();
+                mSettingsProvider.clearValuesAndCheck(TestableContext.this);
             }
         }.apply(base, description);
     }
diff --git a/tests/testables/src/android/testing/TestableSettings.java b/tests/testables/src/android/testing/TestableSettings.java
deleted file mode 100644
index d19f1ef..0000000
--- a/tests/testables/src/android/testing/TestableSettings.java
+++ /dev/null
@@ -1,318 +0,0 @@
-/*
- * Copyright (C) 2017 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file
- * except in compliance with the License. You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software distributed under the
- * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-package android.testing;
-
-import android.content.ContentProvider;
-import android.content.ContentProviderClient;
-import android.content.ContentResolver;
-import android.os.Bundle;
-import android.os.RemoteException;
-import android.provider.Settings;
-import android.support.annotation.VisibleForTesting;
-import android.test.mock.MockContentProvider;
-import android.testing.TestableSettings.SettingOverrider.Builder;
-import android.util.ArrayMap;
-import android.util.ArraySet;
-import android.util.Log;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-/**
- * Allows calls to android.provider.Settings to be tested easier.  A SettingOverride
- * can be acquired and a set of specific settings can be set to a value (and not changed
- * in the system when set), so that they can be tested without breaking the test device.
- * <p>
- * To use, in the before method acquire the override add all settings that will affect if
- * your test passes or not.
- *
- * <pre class="prettyprint">
- * {@literal
- * mSettingOverride = mTestableContext.getSettingsProvider().acquireOverridesBuilder()
- * .addSetting("secure", Secure.USER_SETUP_COMPLETE, "0")
- * .build();
- * }
- * </pre>
- *
- * Then in the after free up the settings.
- *
- * <pre class="prettyprint">
- * {@literal
- * mSettingOverride.release();
- * }
- * </pre>
- */
-public class TestableSettings {
-
-    private static final String TAG = "TestableSettings";
-    private static final boolean DEBUG = false;
-
-    // Number of times to try to acquire a setting if in use.
-    private static final int MAX_TRIES = 10;
-    // Time to wait for each setting.  WAIT_TIMEOUT * MAX_TRIES will be the maximum wait time
-    // for a setting.
-    private static final long WAIT_TIMEOUT = 1000;
-
-    private static TestableSettingsProvider sInstance;
-
-    private final TestableSettingsProvider mProvider;
-
-    private TestableSettings(TestableSettingsProvider provider) {
-        mProvider = provider;
-    }
-
-    public Builder acquireOverridesBuilder() {
-        return new Builder(this);
-    }
-
-    public void clearOverrides() {
-        List<SettingOverrider> overrides = mProvider.mOwners.remove(this);
-        if (overrides != null) {
-            overrides.forEach(override -> override.ensureReleased());
-        }
-    }
-
-    private void acquireSettings(SettingOverrider overridder, Set<String> keys)
-            throws AcquireTimeoutException {
-        mProvider.acquireSettings(overridder, keys, this);
-    }
-
-    ContentProvider getProvider() {
-        return mProvider;
-    }
-
-    @VisibleForTesting
-    Object getLock() {
-        return mProvider.mOverrideMap;
-    }
-
-    public static class SettingOverrider {
-        private final Set<String> mValidKeys;
-        private final Map<String, String> mValueMap = new ArrayMap<>();
-        private final TestableSettings mSettings;
-        private boolean mReleased;
-        public Throwable mObtain;
-
-        private SettingOverrider(Set<String> keys, TestableSettings provider) {
-            mValidKeys = new ArraySet<>(keys);
-            mSettings = provider;
-        }
-
-        private void ensureReleased() {
-            if (!mReleased) {
-                release();
-            }
-        }
-
-        public void release() {
-            mSettings.mProvider.releaseSettings(mValidKeys);
-            mReleased = true;
-        }
-
-        private void putDirect(String key, String value) {
-            mValueMap.put(key, value);
-        }
-
-        public void put(String table, String key, String value) {
-            if (!mValidKeys.contains(key(table, key))) {
-                throw new IllegalArgumentException("Key " + table + " " + key
-                        + " not acquired for this overrider");
-            }
-            mValueMap.put(key(table, key), value);
-        }
-
-        public void remove(String table, String key) {
-            if (!mValidKeys.contains(key(table, key))) {
-                throw new IllegalArgumentException("Key " + table + " " + key
-                        + " not acquired for this overrider");
-            }
-            mValueMap.remove(key(table, key));
-        }
-
-        public String get(String table, String key) {
-            if (!mValidKeys.contains(key(table, key))) {
-                throw new IllegalArgumentException("Key " + table + " " + key
-                        + " not acquired for this overrider");
-            }
-            Log.d(TAG, "Get " + table + " " + key + " " + mValueMap.get(key(table, key)));
-            return mValueMap.get(key(table, key));
-        }
-
-        public static class Builder {
-            private final TestableSettings mProvider;
-            private Set<String> mKeys = new ArraySet<>();
-            private Map<String, String> mValues = new ArrayMap<>();
-
-            private Builder(TestableSettings provider) {
-                mProvider = provider;
-            }
-
-            public Builder addSetting(String table, String key) {
-                mKeys.add(key(table, key));
-                return this;
-            }
-
-            public Builder addSetting(String table, String key, String value) {
-                addSetting(table, key);
-                mValues.put(key(table, key), value);
-                return this;
-            }
-
-            public SettingOverrider build() throws AcquireTimeoutException {
-                SettingOverrider overrider = new SettingOverrider(mKeys, mProvider);
-                mProvider.acquireSettings(overrider, mKeys);
-                mValues.forEach((key, value) -> overrider.putDirect(key, value));
-                return overrider;
-            }
-        }
-    }
-
-    private static class TestableSettingsProvider extends MockContentProvider {
-
-        private final Map<String, SettingOverrider> mOverrideMap = new ArrayMap<>();
-        private final Map<Object, List<SettingOverrider>> mOwners = new ArrayMap<>();
-
-        private final ContentProviderClient mSettings;
-        private final ContentResolver mResolver;
-
-        public TestableSettingsProvider(ContentProviderClient settings, ContentResolver resolver) {
-            mSettings = settings;
-            mResolver = resolver;
-        }
-
-        private void releaseSettings(Set<String> keys) {
-            synchronized (mOverrideMap) {
-                for (String key : keys) {
-                    if (DEBUG) Log.d(TAG, "Releasing " + key);
-                    mOverrideMap.remove(key);
-                }
-                if (DEBUG) Log.d(TAG, "Notifying");
-                mOverrideMap.notify();
-            }
-        }
-
-        private boolean checkKeysLocked(Set<String> keys, boolean shouldThrow)
-                throws AcquireTimeoutException {
-            for (String key : keys) {
-                if (mOverrideMap.containsKey(key)) {
-                    if (shouldThrow) {
-                        if (DEBUG) Log.e(TAG, "Lock obtained at",
-                                mOverrideMap.get(key).mObtain);
-                        throw new AcquireTimeoutException("Could not acquire " + key,
-                                mOverrideMap.get(key).mObtain);
-                    }
-                    return false;
-                }
-            }
-            return true;
-        }
-
-        private void acquireSettings(SettingOverrider overridder, Set<String> keys,
-                Object owner) throws AcquireTimeoutException {
-            synchronized (mOwners) {
-                List<SettingOverrider> list = mOwners.get(owner);
-                if (list == null) {
-                    list = new ArrayList<>();
-                    mOwners.put(owner, list);
-                }
-                list.add(overridder);
-            }
-            synchronized (mOverrideMap) {
-                for (int i = 0; i < MAX_TRIES; i++) {
-                    if (checkKeysLocked(keys, false)) break;
-                    try {
-                        if (DEBUG) Log.d(TAG, "Waiting for contention to finish");
-                        mOverrideMap.wait(WAIT_TIMEOUT);
-                    } catch (InterruptedException e) {
-                    }
-                }
-                overridder.mObtain = new Throwable();
-                checkKeysLocked(keys, true);
-                for (String key : keys) {
-                    if (DEBUG) Log.d(TAG, "Acquiring " + key);
-                    mOverrideMap.put(key, overridder);
-                }
-            }
-        }
-
-        public Bundle call(String method, String arg, Bundle extras) {
-            // Methods are "GET_system", "GET_global", "PUT_secure", etc.
-            final String[] commands = method.split("_", 2);
-            final String op = commands[0];
-            final String table = commands[1];
-
-            synchronized (mOverrideMap) {
-                SettingOverrider overrider = mOverrideMap.get(key(table, arg));
-                if (overrider == null) {
-                    // Fall through to real settings.
-                    try {
-                        if (DEBUG) Log.d(TAG, "Falling through to real settings " + method);
-                        // TODO: Add our own version of caching to handle this.
-                        Bundle call = mSettings.call(method, arg, extras);
-                        call.remove(Settings.CALL_METHOD_TRACK_GENERATION_KEY);
-                        return call;
-                    } catch (RemoteException e) {
-                        throw new RuntimeException(e);
-                    }
-                }
-                String value;
-                Bundle out = new Bundle();
-                switch (op) {
-                    case "GET":
-                        value = overrider.get(table, arg);
-                        if (value != null) {
-                            out.putString(Settings.NameValueTable.VALUE, value);
-                        }
-                        break;
-                    case "PUT":
-                        value = extras.getString(Settings.NameValueTable.VALUE, null);
-                        if (value != null) {
-                            overrider.put(table, arg, value);
-                        } else {
-                            overrider.remove(table, arg);
-                        }
-                        break;
-                    default:
-                        throw new UnsupportedOperationException("Unknown command " + method);
-                }
-                return out;
-            }
-        }
-    }
-
-    public static class AcquireTimeoutException extends Exception {
-        public AcquireTimeoutException(String str, Throwable cause) {
-            super(str, cause);
-        }
-    }
-
-    private static String key(String table, String key) {
-        return table + "_" + key;
-    }
-
-    /**
-     * Since the settings provider is cached inside android.provider.Settings, this must
-     * be gotten statically to ensure there is only one instance referenced.
-     */
-    public static TestableSettings getFakeSettingsProvider(ContentProviderClient settings,
-            ContentResolver resolver) {
-        if (sInstance == null) {
-            sInstance = new TestableSettingsProvider(settings, resolver);
-        }
-        return new TestableSettings(sInstance);
-    }
-}
diff --git a/tests/testables/src/android/testing/TestableSettingsProvider.java b/tests/testables/src/android/testing/TestableSettingsProvider.java
new file mode 100644
index 0000000..13056cf
--- /dev/null
+++ b/tests/testables/src/android/testing/TestableSettingsProvider.java
@@ -0,0 +1,120 @@
+/*
+ * Copyright (C) 2017 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software distributed under the
+ * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+
+package android.testing;
+
+import android.content.ContentProviderClient;
+import android.content.Context;
+import android.os.Bundle;
+import android.os.RemoteException;
+import android.provider.Settings;
+import android.test.mock.MockContentProvider;
+import android.util.Log;
+
+import java.util.HashMap;
+
+import static org.junit.Assert.*;
+
+/**
+ * Allows calls to android.provider.Settings to be tested easier.
+ *
+ * This provides a simple copy-on-write implementation of settings that gets cleared
+ * at the end of each test.
+ */
+public class TestableSettingsProvider extends MockContentProvider {
+
+    private static final String TAG = "TestableSettingsProvider";
+    private static final boolean DEBUG = false;
+    private static final String MY_UNIQUE_KEY = "Key_" + TestableSettingsProvider.class.getName();
+    private static TestableSettingsProvider sInstance;
+
+    private final ContentProviderClient mSettings;
+
+    private final HashMap<String, String> mValues = new HashMap<>();
+
+    private TestableSettingsProvider(ContentProviderClient settings) {
+        mSettings = settings;
+    }
+
+    void clearValuesAndCheck(Context context) {
+        mValues.put(key("global", MY_UNIQUE_KEY), MY_UNIQUE_KEY);
+        mValues.put(key("secure", MY_UNIQUE_KEY), MY_UNIQUE_KEY);
+        mValues.put(key("system", MY_UNIQUE_KEY), MY_UNIQUE_KEY);
+
+        // Verify that if any test is using TestableContext, they all have the correct settings
+        // provider.
+        assertEquals("Incorrect settings provider, test using incorrect Context?", MY_UNIQUE_KEY,
+                Settings.Global.getString(context.getContentResolver(), MY_UNIQUE_KEY));
+        assertEquals("Incorrect settings provider, test using incorrect Context?", MY_UNIQUE_KEY,
+                Settings.Secure.getString(context.getContentResolver(), MY_UNIQUE_KEY));
+        assertEquals("Incorrect settings provider, test using incorrect Context?", MY_UNIQUE_KEY,
+                Settings.System.getString(context.getContentResolver(), MY_UNIQUE_KEY));
+
+        mValues.clear();
+    }
+
+    public Bundle call(String method, String arg, Bundle extras) {
+        // Methods are "GET_system", "GET_global", "PUT_secure", etc.
+        final String[] commands = method.split("_", 2);
+        final String op = commands[0];
+        final String table = commands[1];
+
+            String k = key(table, arg);
+            String value;
+            Bundle out = new Bundle();
+            switch (op) {
+                case "GET":
+                    if (mValues.containsKey(k)) {
+                        value = mValues.get(k);
+                        if (value != null) {
+                            out.putString(Settings.NameValueTable.VALUE, value);
+                        }
+                    } else {
+                        // Fall through to real settings.
+                        try {
+                            if (DEBUG) Log.d(TAG, "Falling through to real settings " + method);
+                            // TODO: Add our own version of caching to handle this.
+                            Bundle call = mSettings.call(method, arg, extras);
+                            call.remove(Settings.CALL_METHOD_TRACK_GENERATION_KEY);
+                            return call;
+                        } catch (RemoteException e) {
+                            throw new RuntimeException(e);
+                        }
+                    }
+                    break;
+                case "PUT":
+                    value = extras.getString(Settings.NameValueTable.VALUE, null);
+                    mValues.put(k, value);
+                    break;
+                default:
+                    throw new UnsupportedOperationException("Unknown command " + method);
+            }
+            return out;
+    }
+
+    private static String key(String table, String key) {
+        return table + "_" + key;
+    }
+
+    /**
+     * Since the settings provider is cached inside android.provider.Settings, this must
+     * be gotten statically to ensure there is only one instance referenced.
+     */
+    static TestableSettingsProvider getFakeSettingsProvider(ContentProviderClient settings) {
+        if (sInstance == null) {
+            sInstance = new TestableSettingsProvider(settings);
+        }
+        return sInstance;
+    }
+}
diff --git a/tests/testables/tests/src/android/testing/TestableSettingsProviderTest.java b/tests/testables/tests/src/android/testing/TestableSettingsProviderTest.java
new file mode 100644
index 0000000..1f71867
--- /dev/null
+++ b/tests/testables/tests/src/android/testing/TestableSettingsProviderTest.java
@@ -0,0 +1,89 @@
+/*
+ * Copyright (C) 2017 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software distributed under the
+ * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+
+package android.testing;
+
+import android.content.ContentResolver;
+import android.provider.Settings;
+import android.provider.Settings.Global;
+import android.provider.Settings.Secure;
+import android.support.test.InstrumentationRegistry;
+import android.support.test.runner.AndroidJUnit4;
+import org.junit.Before;
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+import static org.junit.Assert.*;
+
+@RunWith(AndroidJUnit4.class)
+public class TestableSettingsProviderTest {
+
+    public static final String NONEXISTENT_SETTING = "nonexistent_setting";
+    private static final String TAG = "TestableSettingsProviderTest";
+    private ContentResolver mContentResolver;
+    @Rule
+    public final TestableContext mContext =
+            new TestableContext(InstrumentationRegistry.getContext());
+
+    @Before
+    public void setup() {
+        mContentResolver = mContext.getContentResolver();
+        Settings.Secure.putString(mContentResolver, NONEXISTENT_SETTING, null);
+        Settings.Global.putString(mContentResolver, NONEXISTENT_SETTING, "initial value");
+        Settings.Global.putString(mContentResolver, Global.DEVICE_PROVISIONED, null);
+    }
+
+    @Test
+    public void testInitialValueSecure() {
+        String value = Secure.getString(mContentResolver, NONEXISTENT_SETTING);
+        assertNull(value);
+    }
+
+    @Test
+    public void testInitialValueGlobal() {
+        String value = Global.getString(mContentResolver, NONEXISTENT_SETTING);
+        assertEquals("initial value", value);
+    }
+
+    @Test
+    public void testSeparateTables() {
+        Secure.putString(mContentResolver, NONEXISTENT_SETTING, "something");
+        Global.putString(mContentResolver, NONEXISTENT_SETTING, "else");
+        assertEquals("something", Secure.getString(mContentResolver, NONEXISTENT_SETTING));
+        assertEquals("else", Global.getString(mContentResolver, NONEXISTENT_SETTING));
+    }
+
+    @Test
+    public void testPassThrough() {
+        // Grab the value of a setting that is not overridden.
+        assertTrue(Secure.getInt(mContentResolver, Secure.USER_SETUP_COMPLETE, 0) != 0);
+    }
+
+    @Test
+    public void testOverrideExisting() {
+        // Grab the value of a setting that is overridden and will be different than the actual
+        // value.
+        assertNull(Global.getString(mContentResolver, Global.DEVICE_PROVISIONED));
+    }
+
+    @Test
+    public void testRelease() {
+        // Verify different value.
+        assertNull(Global.getString(mContentResolver, Global.DEVICE_PROVISIONED));
+        mContext.getSettingsProvider().clearValuesAndCheck(mContext);
+        // Verify actual value after release.
+        assertEquals("1", Global.getString(mContentResolver, Global.DEVICE_PROVISIONED));
+    }
+}
diff --git a/tests/testables/tests/src/android/testing/TestableSettingsTest.java b/tests/testables/tests/src/android/testing/TestableSettingsTest.java
deleted file mode 100644
index 1b01542..0000000
--- a/tests/testables/tests/src/android/testing/TestableSettingsTest.java
+++ /dev/null
@@ -1,172 +0,0 @@
-/*
- * Copyright (C) 2017 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file
- * except in compliance with the License. You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software distributed under the
- * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-package android.testing;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
-
-import android.content.ContentResolver;
-import android.os.Handler;
-import android.os.HandlerThread;
-import android.provider.Settings;
-import android.provider.Settings.Global;
-import android.provider.Settings.Secure;
-import android.support.test.InstrumentationRegistry;
-import android.support.test.runner.AndroidJUnit4;
-import android.testing.TestableSettings.AcquireTimeoutException;
-import android.testing.TestableSettings.SettingOverrider;
-import android.util.Log;
-
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Rule;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-
-@RunWith(AndroidJUnit4.class)
-public class TestableSettingsTest {
-
-    public static final String NONEXISTENT_SETTING = "nonexistent_setting";
-    private static final String TAG = "TestableSettingsTest";
-    private SettingOverrider mOverrider;
-    private ContentResolver mContentResolver;
-    @Rule
-    public final TestableContext mContext =
-            new TestableContext(InstrumentationRegistry.getContext());
-
-    @Before
-    public void setup() throws AcquireTimeoutException {
-        mOverrider = mContext.getSettingsProvider().acquireOverridesBuilder()
-                .addSetting("secure", NONEXISTENT_SETTING)
-                .addSetting("global", NONEXISTENT_SETTING, "initial value")
-                .addSetting("global", Global.DEVICE_PROVISIONED)
-                .build();
-        mContentResolver = mContext.getContentResolver();
-    }
-
-    @Test
-    public void testInitialValueSecure() {
-        String value = Secure.getString(mContentResolver, NONEXISTENT_SETTING);
-        assertNull(value);
-    }
-
-    @Test
-    public void testInitialValueGlobal() {
-        String value = Global.getString(mContentResolver, NONEXISTENT_SETTING);
-        assertEquals("initial value", value);
-    }
-
-    @Test
-    public void testSeparateTables() {
-        Secure.putString(mContentResolver, NONEXISTENT_SETTING, "something");
-        Global.putString(mContentResolver, NONEXISTENT_SETTING, "else");
-        assertEquals("something", Secure.getString(mContentResolver, NONEXISTENT_SETTING));
-        assertEquals("something", mOverrider.get("secure", NONEXISTENT_SETTING));
-        assertEquals("else", Global.getString(mContentResolver, NONEXISTENT_SETTING));
-        assertEquals("else", mOverrider.get("global", NONEXISTENT_SETTING));
-    }
-
-    @Test
-    public void testPassThrough() {
-        // Grab the value of a setting that is not overridden.
-        assertTrue(Secure.getInt(mContentResolver, Secure.USER_SETUP_COMPLETE, 0) != 0);
-    }
-
-    @Test
-    public void testOverrideExisting() {
-        // Grab the value of a setting that is overridden and will be different than the actual
-        // value.
-        assertNull(Global.getString(mContentResolver, Global.DEVICE_PROVISIONED));
-    }
-
-    @Test
-    public void testRelease() {
-        // Verify different value.
-        assertNull(Global.getString(mContentResolver, Global.DEVICE_PROVISIONED));
-        mOverrider.release();
-        mOverrider = null;
-        // Verify actual value after release.
-        assertEquals("1", Global.getString(mContentResolver, Global.DEVICE_PROVISIONED));
-    }
-
-    @Test
-    public void testAutoRelease() throws Exception {
-        mOverrider.release();
-        mOverrider = null;
-        mContext.getSettingsProvider().acquireOverridesBuilder()
-                .addSetting("global", Global.DEVICE_PROVISIONED)
-                .build();
-    }
-
-    @Test
-    public void testContention() throws AcquireTimeoutException, InterruptedException {
-        SettingOverrider[] overriders = new SettingOverrider[2];
-        Object lock = new Object();
-        String secure = "secure";
-        String key = "something shared";
-        String[] result = new String[1];
-        overriders[0] = mContext.getSettingsProvider().acquireOverridesBuilder()
-                .addSetting(secure, key, "Some craziness")
-                .build();
-        synchronized (lock) {
-            HandlerThread t = runOnHandler(() -> {
-                try {
-                    // Grab the lock that will be used for the settings ownership to ensure
-                    // we have some contention going on.
-                    synchronized (mContext.getSettingsProvider().getLock()) {
-                        synchronized (lock) {
-                            // Let the other thread know to release the settings, but it won't
-                            // be able to until this thread waits in the build() method.
-                            lock.notify();
-                        }
-                        overriders[1] = mContext.getSettingsProvider()
-                                .acquireOverridesBuilder()
-                                .addSetting(secure, key, "default value")
-                                .build();
-                        // Ensure that the default is the one we set, and not left over from
-                        // the other setting override.
-                        result[0] = Settings.Secure.getString(mContentResolver, key);
-                        synchronized (lock) {
-                            // Let the main thread know we are done.
-                            lock.notify();
-                        }
-                    }
-                } catch (AcquireTimeoutException e) {
-                    Log.e(TAG, "Couldn't acquire setting", e);
-                }
-            });
-            // Wait for the thread to hold the acquire lock, then release the settings.
-            lock.wait();
-            overriders[0].release();
-            // Wait for the thread to be done getting the value.
-            lock.wait();
-            // Quit and cleanup.
-            t.quitSafely();
-            assertNotNull(overriders[1]);
-            overriders[1].release();
-        }
-        // Verify the value was the expected one from the thread's SettingOverride.
-        assertEquals("default value", result[0]);
-    }
-
-    private HandlerThread runOnHandler(Runnable r) {
-        HandlerThread t = new HandlerThread("Test Thread");
-        t.start();
-        new Handler(t.getLooper()).post(r);
-        return t;
-    }
-}
diff --git a/tools/aapt2/Debug.cpp b/tools/aapt2/Debug.cpp
index 60b01e3..b872ebb 100644
--- a/tools/aapt2/Debug.cpp
+++ b/tools/aapt2/Debug.cpp
@@ -274,7 +274,13 @@
       if (!attr.namespace_uri.empty()) {
         std::cerr << attr.namespace_uri << ":";
       }
-      std::cerr << attr.name << "=" << attr.value << "\n";
+      std::cerr << attr.name;
+
+      if (attr.compiled_attribute) {
+        std::cerr << "(" << attr.compiled_attribute.value().id.value_or_default(ResourceId(0x0))
+                  << ")";
+      }
+      std::cerr << "=" << attr.value << "\n";
     }
 
     const size_t previous_size = prefix_.size();
diff --git a/tools/aapt2/Main.cpp b/tools/aapt2/Main.cpp
index 87fda16..1965ad9 100644
--- a/tools/aapt2/Main.cpp
+++ b/tools/aapt2/Main.cpp
@@ -19,6 +19,8 @@
 
 #include "androidfw/StringPiece.h"
 
+#include "Diagnostics.h"
+
 namespace aapt {
 
 // DO NOT UPDATE, this is more of a marketing version.
@@ -33,8 +35,8 @@
   return 0;
 }
 
-extern int Compile(const std::vector<android::StringPiece>& args);
-extern int Link(const std::vector<android::StringPiece>& args);
+extern int Compile(const std::vector<android::StringPiece>& args, IDiagnostics* diagnostics);
+extern int Link(const std::vector<android::StringPiece>& args, IDiagnostics* diagnostics);
 extern int Dump(const std::vector<android::StringPiece>& args);
 extern int Diff(const std::vector<android::StringPiece>& args);
 extern int Optimize(const std::vector<android::StringPiece>& args);
@@ -53,9 +55,11 @@
 
     android::StringPiece command(argv[0]);
     if (command == "compile" || command == "c") {
-      return aapt::Compile(args);
+      aapt::StdErrDiagnostics diagnostics;
+      return aapt::Compile(args, &diagnostics);
     } else if (command == "link" || command == "l") {
-      return aapt::Link(args);
+      aapt::StdErrDiagnostics diagnostics;
+      return aapt::Link(args, &diagnostics);
     } else if (command == "dump" || command == "d") {
       return aapt::Dump(args);
     } else if (command == "diff") {
diff --git a/tools/aapt2/cmd/Compile.cpp b/tools/aapt2/cmd/Compile.cpp
index b93c6ec..5413b33 100644
--- a/tools/aapt2/cmd/Compile.cpp
+++ b/tools/aapt2/cmd/Compile.cpp
@@ -598,6 +598,9 @@
 
 class CompileContext : public IAaptContext {
  public:
+  CompileContext(IDiagnostics* diagnostics) : diagnostics_(diagnostics) {
+  }
+
   PackageType GetPackageType() override {
     // Every compilation unit starts as an app and then gets linked as potentially something else.
     return PackageType::kApp;
@@ -612,7 +615,7 @@
   }
 
   IDiagnostics* GetDiagnostics() override {
-    return &diagnostics_;
+    return diagnostics_;
   }
 
   NameMangler* GetNameMangler() override {
@@ -639,7 +642,7 @@
   }
 
  private:
-  StdErrDiagnostics diagnostics_;
+  IDiagnostics* diagnostics_;
   bool verbose_ = false;
 };
 
@@ -647,8 +650,8 @@
  * Entry point for compilation phase. Parses arguments and dispatches to the
  * correct steps.
  */
-int Compile(const std::vector<StringPiece>& args) {
-  CompileContext context;
+int Compile(const std::vector<StringPiece>& args, IDiagnostics* diagnostics) {
+  CompileContext context(diagnostics);
   CompileOptions options;
 
   bool verbose = false;
diff --git a/tools/aapt2/cmd/Link.cpp b/tools/aapt2/cmd/Link.cpp
index 258516d..93748d3 100644
--- a/tools/aapt2/cmd/Link.cpp
+++ b/tools/aapt2/cmd/Link.cpp
@@ -118,7 +118,8 @@
 
 class LinkContext : public IAaptContext {
  public:
-  LinkContext() : name_mangler_({}), symbols_(&name_mangler_) {
+  LinkContext(IDiagnostics* diagnostics)
+      : diagnostics_(diagnostics), name_mangler_({}), symbols_(&name_mangler_) {
   }
 
   PackageType GetPackageType() override {
@@ -130,7 +131,7 @@
   }
 
   IDiagnostics* GetDiagnostics() override {
-    return &diagnostics_;
+    return diagnostics_;
   }
 
   NameMangler* GetNameMangler() override {
@@ -181,7 +182,7 @@
   DISALLOW_COPY_AND_ASSIGN(LinkContext);
 
   PackageType package_type_ = PackageType::kApp;
-  StdErrDiagnostics diagnostics_;
+  IDiagnostics* diagnostics_;
   NameMangler name_mangler_;
   std::string compilation_package_;
   uint8_t package_id_ = 0x0;
@@ -1736,8 +1737,8 @@
   std::map<size_t, std::string> shared_libs_;
 };
 
-int Link(const std::vector<StringPiece>& args) {
-  LinkContext context;
+int Link(const std::vector<StringPiece>& args, IDiagnostics* diagnostics) {
+  LinkContext context(diagnostics);
   LinkOptions options;
   std::vector<std::string> overlay_arg_list;
   std::vector<std::string> extra_java_packages;
diff --git a/tools/aapt2/flatten/TableFlattener.cpp b/tools/aapt2/flatten/TableFlattener.cpp
index d44b3e0..f4d0226 100644
--- a/tools/aapt2/flatten/TableFlattener.cpp
+++ b/tools/aapt2/flatten/TableFlattener.cpp
@@ -573,10 +573,17 @@
 
   // Write the ResTable header.
   ChunkWriter table_writer(buffer_);
-  ResTable_header* table_header =
-      table_writer.StartChunk<ResTable_header>(RES_TABLE_TYPE);
+  ResTable_header* table_header = table_writer.StartChunk<ResTable_header>(RES_TABLE_TYPE);
   table_header->packageCount = util::HostToDevice32(table->packages.size());
 
+  // Write a self mapping entry for this package if the ID is non-standard (0x7f).
+  if (context->GetPackageType() == PackageType::kApp) {
+    const uint8_t package_id = context->GetPackageId();
+    if (package_id != kFrameworkPackageId && package_id != kAppPackageId) {
+      table->included_packages_[package_id] = context->GetCompilationPackage();
+    }
+  }
+
   // Flatten the values string pool.
   StringPool::FlattenUtf8(table_writer.buffer(), table->string_pool);
 
diff --git a/tools/aapt2/flatten/TableFlattener_test.cpp b/tools/aapt2/flatten/TableFlattener_test.cpp
index 8dff3a2..6d1350d 100644
--- a/tools/aapt2/flatten/TableFlattener_test.cpp
+++ b/tools/aapt2/flatten/TableFlattener_test.cpp
@@ -400,7 +400,7 @@
   const DynamicRefTable* dynamic_ref_table = result.getDynamicRefTableForCookie(1);
   ASSERT_NE(nullptr, dynamic_ref_table);
 
-  const KeyedVector<String16, uint8_t> entries = dynamic_ref_table->entries();
+  const KeyedVector<String16, uint8_t>& entries = dynamic_ref_table->entries();
 
   ssize_t idx = entries.indexOfKey(android::String16("lib_one"));
   ASSERT_GE(idx, 0);
@@ -411,6 +411,26 @@
   EXPECT_EQ(0x03u, entries.valueAt(idx));
 }
 
+TEST_F(TableFlattenerTest, PackageWithNonStandardIdHasDynamicRefTable) {
+  std::unique_ptr<IAaptContext> context =
+      test::ContextBuilder().SetCompilationPackage("app").SetPackageId(0x80).Build();
+  std::unique_ptr<ResourceTable> table = test::ResourceTableBuilder()
+                                             .SetPackageId("app", 0x80)
+                                             .AddSimple("app:id/foo", ResourceId(0x80010000))
+                                             .Build();
+
+  ResTable result;
+  ASSERT_TRUE(Flatten(context.get(), {}, table.get(), &result));
+
+  const DynamicRefTable* dynamic_ref_table = result.getDynamicRefTableForCookie(1);
+  ASSERT_NE(nullptr, dynamic_ref_table);
+
+  const KeyedVector<String16, uint8_t>& entries = dynamic_ref_table->entries();
+  ssize_t idx = entries.indexOfKey(android::String16("app"));
+  ASSERT_GE(idx, 0);
+  EXPECT_EQ(0x80u, entries.valueAt(idx));
+}
+
 TEST_F(TableFlattenerTest, LongPackageNameIsTruncated) {
   std::string kPackageName(256, 'F');
 
diff --git a/tools/aapt2/flatten/XmlFlattener_test.cpp b/tools/aapt2/flatten/XmlFlattener_test.cpp
index 494d9d2..f0613e7 100644
--- a/tools/aapt2/flatten/XmlFlattener_test.cpp
+++ b/tools/aapt2/flatten/XmlFlattener_test.cpp
@@ -35,13 +35,16 @@
                    .SetNameManglerPolicy(NameManglerPolicy{"com.app.test"})
                    .AddSymbolSource(
                        test::StaticSymbolSourceBuilder()
-                           .AddSymbol("android:attr/id", ResourceId(0x010100d0),
-                                      test::AttributeBuilder().Build())
+                           .AddPublicSymbol("android:attr/id", ResourceId(0x010100d0),
+                                            test::AttributeBuilder().Build())
                            .AddSymbol("com.app.test:id/id", ResourceId(0x7f020000))
                            .AddPublicSymbol("android:attr/paddingStart", ResourceId(0x010103b3),
                                             test::AttributeBuilder().Build())
                            .AddPublicSymbol("android:attr/colorAccent", ResourceId(0x01010435),
                                             test::AttributeBuilder().Build())
+                           .AddSymbol("com.app.test.feature:id/foo", ResourceId(0x80020000))
+                           .AddSymbol("com.app.test.feature:attr/foo", ResourceId(0x80010000),
+                                      test::AttributeBuilder().Build())
                            .Build())
                    .Build();
   }
@@ -65,7 +68,7 @@
   }
 
  protected:
-  std::unique_ptr<IAaptContext> context_;
+  std::unique_ptr<test::Context> context_;
 };
 
 TEST_F(XmlFlattenerTest, FlattenXmlWithNoCompiledAttributes) {
@@ -218,14 +221,10 @@
   EXPECT_EQ(tree.indexOfStyle(), 1);
 }
 
-/*
- * The device ResXMLParser in libandroidfw differentiates between empty
- * namespace and null
- * namespace.
- */
+// The device ResXMLParser in libandroidfw differentiates between empty namespace and null
+// namespace.
 TEST_F(XmlFlattenerTest, NoNamespaceIsNotTheSameAsEmptyNamespace) {
-  std::unique_ptr<xml::XmlResource> doc =
-      test::BuildXmlDom("<View package=\"android\"/>");
+  std::unique_ptr<xml::XmlResource> doc = test::BuildXmlDom("<View package=\"android\"/>");
 
   android::ResXMLTree tree;
   ASSERT_TRUE(Flatten(doc.get(), &tree));
@@ -261,4 +260,44 @@
   EXPECT_NE(nullptr, tree.getAttributeStringValue(idx, &len));
 }
 
+TEST_F(XmlFlattenerTest, FlattenNonStandardPackageId) {
+  context_->SetCompilationPackage("com.app.test.feature");
+  context_->SetPackageId(0x80);
+  context_->SetNameManglerPolicy({"com.app.test.feature"});
+
+  std::unique_ptr<xml::XmlResource> doc = test::BuildXmlDomForPackageName(context_.get(), R"EOF(
+      <View xmlns:android="http://schemas.android.com/apk/res/android"
+            xmlns:app="http://schemas.android.com/apk/res-auto"
+            android:id="@id/foo"
+            app:foo="@id/foo" />)EOF");
+
+  XmlReferenceLinker linker;
+  ASSERT_TRUE(linker.Consume(context_.get(), doc.get()));
+
+  // The tree needs a custom DynamicRefTable since it is not using a standard app ID (0x7f).
+  android::DynamicRefTable dynamic_ref_table;
+  dynamic_ref_table.addMapping(0x80, 0x80);
+
+  android::ResXMLTree tree(&dynamic_ref_table);
+  ASSERT_TRUE(Flatten(doc.get(), &tree));
+
+  while (tree.next() != android::ResXMLTree::START_TAG) {
+    ASSERT_NE(android::ResXMLTree::BAD_DOCUMENT, tree.getEventType());
+    ASSERT_NE(android::ResXMLTree::END_DOCUMENT, tree.getEventType());
+  }
+
+  ssize_t idx;
+
+  idx = tree.indexOfAttribute(xml::kSchemaAndroid, "id");
+  ASSERT_GE(idx, 0);
+  EXPECT_EQ(idx, tree.indexOfID());
+  EXPECT_EQ(ResourceId(0x010100d0), ResourceId(tree.getAttributeNameResID(idx)));
+
+  idx = tree.indexOfAttribute(xml::kSchemaAuto, "foo");
+  ASSERT_GE(idx, 0);
+  EXPECT_EQ(ResourceId(0x80010000), ResourceId(tree.getAttributeNameResID(idx)));
+  EXPECT_EQ(android::Res_value::TYPE_REFERENCE, tree.getAttributeDataType(idx));
+  EXPECT_EQ(ResourceId(0x80020000), tree.getAttributeData(idx));
+}
+
 }  // namespace aapt
diff --git a/tools/aapt2/jni/aapt2_jni.cpp b/tools/aapt2/jni/aapt2_jni.cpp
index ce3d282..ad5ad4c 100644
--- a/tools/aapt2/jni/aapt2_jni.cpp
+++ b/tools/aapt2/jni/aapt2_jni.cpp
@@ -24,13 +24,14 @@
 #include "android-base/logging.h"
 #include "ScopedUtfChars.h"
 
+#include "Diagnostics.h"
 #include "util/Util.h"
 
 using android::StringPiece;
 
 namespace aapt {
-extern int Compile(const std::vector<StringPiece> &args);
-extern int Link(const std::vector<StringPiece> &args);
+extern int Compile(const std::vector<StringPiece>& args, IDiagnostics* iDiagnostics);
+extern int Link(const std::vector<StringPiece>& args, IDiagnostics* iDiagnostics);
 }
 
 /*
@@ -77,20 +78,66 @@
   return pieces;
 }
 
+class JniDiagnostics : public aapt::IDiagnostics {
+ public:
+  JniDiagnostics(JNIEnv* env, jobject diagnostics_obj)
+      : env_(env), diagnostics_obj_(diagnostics_obj) {
+    mid_ = NULL;
+  }
+
+  void Log(Level level, aapt::DiagMessageActual& actual_msg) override {
+    jint level_value;
+    switch (level) {
+      case Level::Error:
+        level_value = 3;
+        break;
+
+      case Level::Warn:
+        level_value = 2;
+        break;
+
+      case Level::Note:
+        level_value = 1;
+        break;
+    }
+    jstring message = env_->NewStringUTF(actual_msg.message.c_str());
+    jstring path = env_->NewStringUTF(actual_msg.source.path.c_str());
+    jlong line = -1;
+    if (actual_msg.source.line) {
+      line = actual_msg.source.line.value();
+    }
+    if (!mid_) {
+      jclass diagnostics_cls = env_->GetObjectClass(diagnostics_obj_);
+      mid_ = env_->GetMethodID(diagnostics_cls, "log", "(ILjava/lang/String;JLjava/lang/String;)V");
+    }
+    env_->CallVoidMethod(diagnostics_obj_, mid_, level_value, path, line, message);
+  }
+
+ private:
+  JNIEnv* env_;
+  jobject diagnostics_obj_;
+  jmethodID mid_;
+  DISALLOW_COPY_AND_ASSIGN(JniDiagnostics);
+};
+
 JNIEXPORT jint JNICALL Java_com_android_tools_aapt2_Aapt2Jni_nativeCompile(
-    JNIEnv *env, jclass aapt_obj, jobject arguments_obj) {
+    JNIEnv* env, jclass aapt_obj, jobject arguments_obj, jobject diagnostics_obj) {
   std::vector<ScopedUtfChars> compile_args_jni =
       list_to_utfchars(env, arguments_obj);
   std::vector<StringPiece> compile_args = extract_pieces(compile_args_jni);
-  return aapt::Compile(compile_args);
+  JniDiagnostics diagnostics(env, diagnostics_obj);
+  return aapt::Compile(compile_args, &diagnostics);
 }
 
-JNIEXPORT jint JNICALL Java_com_android_tools_aapt2_Aapt2Jni_nativeLink(
-    JNIEnv *env, jclass aapt_obj, jobject arguments_obj) {
+JNIEXPORT jint JNICALL Java_com_android_tools_aapt2_Aapt2Jni_nativeLink(JNIEnv* env,
+                                                                        jclass aapt_obj,
+                                                                        jobject arguments_obj,
+                                                                        jobject diagnostics_obj) {
   std::vector<ScopedUtfChars> link_args_jni =
       list_to_utfchars(env, arguments_obj);
   std::vector<StringPiece> link_args = extract_pieces(link_args_jni);
-  return aapt::Link(link_args);
+  JniDiagnostics diagnostics(env, diagnostics_obj);
+  return aapt::Link(link_args, &diagnostics);
 }
 
 JNIEXPORT void JNICALL Java_com_android_tools_aapt2_Aapt2Jni_ping(
diff --git a/tools/aapt2/jni/com_android_tools_aapt2_Aapt2Jni.h b/tools/aapt2/jni/com_android_tools_aapt2_Aapt2Jni.h
index 90150b4..3cd9865 100644
--- a/tools/aapt2/jni/com_android_tools_aapt2_Aapt2Jni.h
+++ b/tools/aapt2/jni/com_android_tools_aapt2_Aapt2Jni.h
@@ -18,18 +18,18 @@
 /*
  * Class:     com_android_tools_aapt2_Aapt2Jni
  * Method:    nativeCompile
- * Signature: (Ljava/util/List;)I
+ * Signature: (Ljava/util/List;Lcom/android/tools/aapt2/Aapt2JniDiagnostics;)I
  */
-JNIEXPORT jint JNICALL Java_com_android_tools_aapt2_Aapt2Jni_nativeCompile
-  (JNIEnv *, jclass, jobject);
+JNIEXPORT jint JNICALL Java_com_android_tools_aapt2_Aapt2Jni_nativeCompile(JNIEnv*, jclass, jobject,
+                                                                           jobject);
 
 /*
  * Class:     com_android_tools_aapt2_Aapt2Jni
  * Method:    nativeLink
- * Signature: (Ljava/util/List;)I
+ * Signature: (Ljava/util/List;Lcom/android/tools/aapt2/Aapt2JniDiagnostics;)I
  */
-JNIEXPORT jint JNICALL Java_com_android_tools_aapt2_Aapt2Jni_nativeLink
-  (JNIEnv *, jclass, jobject);
+JNIEXPORT jint JNICALL Java_com_android_tools_aapt2_Aapt2Jni_nativeLink(JNIEnv*, jclass, jobject,
+                                                                        jobject);
 
 #ifdef __cplusplus
 }
diff --git a/tools/aapt2/test/Context.h b/tools/aapt2/test/Context.h
index 29d1838..0564db0 100644
--- a/tools/aapt2/test/Context.h
+++ b/tools/aapt2/test/Context.h
@@ -52,15 +52,27 @@
     return compilation_package_.value();
   }
 
+  void SetCompilationPackage(const android::StringPiece& package) {
+    compilation_package_ = package.to_string();
+  }
+
   uint8_t GetPackageId() override {
     CHECK(bool(package_id_)) << "package ID not set";
     return package_id_.value();
   }
 
+  void SetPackageId(uint8_t package_id) {
+    package_id_ = package_id;
+  }
+
   NameMangler* GetNameMangler() override {
     return &name_mangler_;
   }
 
+  void SetNameManglerPolicy(const NameManglerPolicy& policy) {
+    name_mangler_ = NameMangler(policy);
+  }
+
   bool IsVerbose() override {
     return false;
   }
diff --git a/wifi/java/android/net/wifi/IWifiManager.aidl b/wifi/java/android/net/wifi/IWifiManager.aidl
index 229aa97..a7b4544 100644
--- a/wifi/java/android/net/wifi/IWifiManager.aidl
+++ b/wifi/java/android/net/wifi/IWifiManager.aidl
@@ -81,7 +81,7 @@
 
     boolean disableNetwork(int netId);
 
-    void startScan(in ScanSettings requested, in WorkSource ws);
+    void startScan(in ScanSettings requested, in WorkSource ws, in String packageName);
 
     List<ScanResult> getScanResults(String callingPackage);
 
@@ -125,6 +125,8 @@
 
     void setWifiApEnabled(in WifiConfiguration wifiConfig, boolean enable);
 
+    void updateInterfaceIpState(String ifaceName, int mode);
+
     boolean startSoftAp(in WifiConfiguration wifiConfig);
 
     boolean stopSoftAp();
diff --git a/wifi/java/android/net/wifi/WifiConfiguration.java b/wifi/java/android/net/wifi/WifiConfiguration.java
index 7defa7c..e31a74b 100644
--- a/wifi/java/android/net/wifi/WifiConfiguration.java
+++ b/wifi/java/android/net/wifi/WifiConfiguration.java
@@ -228,9 +228,9 @@
      */
     public int networkId;
 
+    // Fixme We need remove this field to use only Quality network selection status only
     /**
      * The current status of this network configuration entry.
-     * Fixme We need remove this field to use only Quality network selection status only
      * @see Status
      */
     public int status;
@@ -238,8 +238,8 @@
     /**
      * The network's SSID. Can either be an ASCII string,
      * which must be enclosed in double quotation marks
-     * (e.g., {@code "MyNetwork"}, or a string of
-     * hex digits,which are not enclosed in quotes
+     * (e.g., {@code "MyNetwork"}), or a string of
+     * hex digits, which are not enclosed in quotes
      * (e.g., {@code 01a243f405}).
      */
     public String SSID;
@@ -290,9 +290,10 @@
      * string otherwise.
      */
     public String preSharedKey;
+
     /**
      * Up to four WEP keys. Either an ASCII string enclosed in double
-     * quotation marks (e.g., {@code "abcdef"} or a string
+     * quotation marks (e.g., {@code "abcdef"}) or a string
      * of hex digits (e.g., {@code 0102030405}).
      * <p/>
      * When the value of one of these keys is read, the actual key is
diff --git a/wifi/java/android/net/wifi/WifiManager.java b/wifi/java/android/net/wifi/WifiManager.java
index ed54c3b..ab069f2 100644
--- a/wifi/java/android/net/wifi/WifiManager.java
+++ b/wifi/java/android/net/wifi/WifiManager.java
@@ -20,7 +20,6 @@
 import android.annotation.SdkConstant;
 import android.annotation.SdkConstant.SdkConstantType;
 import android.annotation.SystemApi;
-import android.bluetooth.BluetoothAdapter;
 import android.content.Context;
 import android.content.pm.ParceledListSlice;
 import android.net.ConnectivityManager;
@@ -46,9 +45,9 @@
 import com.android.server.net.NetworkPinner;
 
 import java.net.InetAddress;
+import java.util.Collections;
 import java.util.List;
 import java.util.concurrent.CountDownLatch;
-import java.util.Collections;
 
 /**
  * This class provides the primary API for managing all aspects of Wi-Fi
@@ -446,6 +445,35 @@
      *  @hide
      */
     public static final int SAP_START_FAILURE_NO_CHANNEL = 1;
+
+    /**
+     * Interface IP mode for configuration error.
+     *
+     * @see updateInterfaceIpState(String, int)
+     *
+     * @hide
+     */
+    public static final int IFACE_IP_MODE_CONFIGURATION_ERROR = 0;
+
+    /**
+     * Interface IP mode for tethering.
+     *
+     * @see updateInterfaceIpState(String, int)
+     *
+     * @hide
+     */
+    public static final int IFACE_IP_MODE_TETHERED = 1;
+
+    /**
+     * Interface IP mode for Local Only Hotspot.
+     *
+     * @see updateInterfaceIpState(String, int)
+     *
+     * @hide
+     */
+    public static final int IFACE_IP_MODE_LOCAL_ONLY = 2;
+
+
     /**
      * Broadcast intent action indicating that a connection to the supplicant has
      * been established (and it is now possible
@@ -1429,19 +1457,15 @@
      * @return {@code true} if the operation succeeded, i.e., the scan was initiated
      */
     public boolean startScan() {
-        try {
-            mService.startScan(null, null);
-            return true;
-        } catch (RemoteException e) {
-            throw e.rethrowFromSystemServer();
-        }
+        return startScan(null);
     }
 
     /** @hide */
     @SystemApi
     public boolean startScan(WorkSource workSource) {
         try {
-            mService.startScan(null, workSource);
+            String packageName = mContext.getOpPackageName();
+            mService.startScan(null, workSource, packageName);
             return true;
         } catch (RemoteException e) {
             throw e.rethrowFromSystemServer();
@@ -1732,6 +1756,26 @@
     }
 
     /**
+     * Call allowing ConnectivityService to update WifiService with interface mode changes.
+     *
+     * The possible modes include: {@link IFACE_IP_MODE_TETHERED},
+     *                             {@link IFACE_IP_MODE_LOCAL_ONLY},
+     *                             {@link IFACE_IP_MODE_CONFIGURATION_ERROR}
+     *
+     * @param ifaceName String name of the updated interface
+     * @param mode int representing the new mode
+     *
+     * @hide
+     */
+    public void updateInterfaceIpState(String ifaceName, int mode) {
+        try {
+            mService.updateInterfaceIpState(ifaceName, mode);
+        } catch (RemoteException e) {
+            throw e.rethrowFromSystemServer();
+        }
+    }
+
+    /**
      * Start SoftAp mode with the specified configuration.
      * Note that starting in access point mode disables station
      * mode operation