Merge "Fix crash." into qt-dev
diff --git a/api/current.txt b/api/current.txt
index b434776..dc249eb 100644
--- a/api/current.txt
+++ b/api/current.txt
@@ -13791,7 +13791,7 @@
     method public void drawCircle(float, float, float, @NonNull android.graphics.Paint);
     method public void drawColor(@ColorInt int);
     method public void drawColor(@ColorLong long);
-    method @Deprecated public void drawColor(@ColorInt int, @NonNull android.graphics.PorterDuff.Mode);
+    method public void drawColor(@ColorInt int, @NonNull android.graphics.PorterDuff.Mode);
     method public void drawColor(@ColorInt int, @NonNull android.graphics.BlendMode);
     method public void drawColor(@ColorLong long, @NonNull android.graphics.BlendMode);
     method public void drawDoubleRoundRect(@NonNull android.graphics.RectF, float, float, @NonNull android.graphics.RectF, float, float, @NonNull android.graphics.Paint);
@@ -14108,7 +14108,7 @@
 
   public class ComposeShader extends android.graphics.Shader {
     ctor @Deprecated public ComposeShader(@NonNull android.graphics.Shader, @NonNull android.graphics.Shader, @NonNull android.graphics.Xfermode);
-    ctor @Deprecated public ComposeShader(@NonNull android.graphics.Shader, @NonNull android.graphics.Shader, @NonNull android.graphics.PorterDuff.Mode);
+    ctor public ComposeShader(@NonNull android.graphics.Shader, @NonNull android.graphics.Shader, @NonNull android.graphics.PorterDuff.Mode);
     ctor public ComposeShader(@NonNull android.graphics.Shader, @NonNull android.graphics.Shader, @NonNull android.graphics.BlendMode);
   }
 
@@ -14497,7 +14497,7 @@
     method @Px public float getUnderlinePosition();
     method @Px public float getUnderlineThickness();
     method @Px public float getWordSpacing();
-    method @Deprecated public android.graphics.Xfermode getXfermode();
+    method public android.graphics.Xfermode getXfermode();
     method public boolean hasGlyph(String);
     method public final boolean isAntiAlias();
     method public final boolean isDither();
@@ -14554,7 +14554,7 @@
     method public android.graphics.Typeface setTypeface(android.graphics.Typeface);
     method public void setUnderlineText(boolean);
     method public void setWordSpacing(@Px float);
-    method @Deprecated public android.graphics.Xfermode setXfermode(android.graphics.Xfermode);
+    method public android.graphics.Xfermode setXfermode(android.graphics.Xfermode);
     field public static final int ANTI_ALIAS_FLAG = 1; // 0x1
     field public static final int CURSOR_AFTER = 0; // 0x0
     field public static final int CURSOR_AT = 4; // 0x4
@@ -14803,37 +14803,37 @@
     field public float y;
   }
 
-  @Deprecated public class PorterDuff {
-    ctor @Deprecated public PorterDuff();
+  public class PorterDuff {
+    ctor public PorterDuff();
   }
 
-  @Deprecated public enum PorterDuff.Mode {
-    enum_constant @Deprecated public static final android.graphics.PorterDuff.Mode ADD;
-    enum_constant @Deprecated public static final android.graphics.PorterDuff.Mode CLEAR;
-    enum_constant @Deprecated public static final android.graphics.PorterDuff.Mode DARKEN;
-    enum_constant @Deprecated public static final android.graphics.PorterDuff.Mode DST;
-    enum_constant @Deprecated public static final android.graphics.PorterDuff.Mode DST_ATOP;
-    enum_constant @Deprecated public static final android.graphics.PorterDuff.Mode DST_IN;
-    enum_constant @Deprecated public static final android.graphics.PorterDuff.Mode DST_OUT;
-    enum_constant @Deprecated public static final android.graphics.PorterDuff.Mode DST_OVER;
-    enum_constant @Deprecated public static final android.graphics.PorterDuff.Mode LIGHTEN;
-    enum_constant @Deprecated public static final android.graphics.PorterDuff.Mode MULTIPLY;
-    enum_constant @Deprecated public static final android.graphics.PorterDuff.Mode OVERLAY;
-    enum_constant @Deprecated public static final android.graphics.PorterDuff.Mode SCREEN;
-    enum_constant @Deprecated public static final android.graphics.PorterDuff.Mode SRC;
-    enum_constant @Deprecated public static final android.graphics.PorterDuff.Mode SRC_ATOP;
-    enum_constant @Deprecated public static final android.graphics.PorterDuff.Mode SRC_IN;
-    enum_constant @Deprecated public static final android.graphics.PorterDuff.Mode SRC_OUT;
-    enum_constant @Deprecated public static final android.graphics.PorterDuff.Mode SRC_OVER;
-    enum_constant @Deprecated public static final android.graphics.PorterDuff.Mode XOR;
+  public enum PorterDuff.Mode {
+    enum_constant public static final android.graphics.PorterDuff.Mode ADD;
+    enum_constant public static final android.graphics.PorterDuff.Mode CLEAR;
+    enum_constant public static final android.graphics.PorterDuff.Mode DARKEN;
+    enum_constant public static final android.graphics.PorterDuff.Mode DST;
+    enum_constant public static final android.graphics.PorterDuff.Mode DST_ATOP;
+    enum_constant public static final android.graphics.PorterDuff.Mode DST_IN;
+    enum_constant public static final android.graphics.PorterDuff.Mode DST_OUT;
+    enum_constant public static final android.graphics.PorterDuff.Mode DST_OVER;
+    enum_constant public static final android.graphics.PorterDuff.Mode LIGHTEN;
+    enum_constant public static final android.graphics.PorterDuff.Mode MULTIPLY;
+    enum_constant public static final android.graphics.PorterDuff.Mode OVERLAY;
+    enum_constant public static final android.graphics.PorterDuff.Mode SCREEN;
+    enum_constant public static final android.graphics.PorterDuff.Mode SRC;
+    enum_constant public static final android.graphics.PorterDuff.Mode SRC_ATOP;
+    enum_constant public static final android.graphics.PorterDuff.Mode SRC_IN;
+    enum_constant public static final android.graphics.PorterDuff.Mode SRC_OUT;
+    enum_constant public static final android.graphics.PorterDuff.Mode SRC_OVER;
+    enum_constant public static final android.graphics.PorterDuff.Mode XOR;
   }
 
-  @Deprecated public class PorterDuffColorFilter extends android.graphics.ColorFilter {
-    ctor @Deprecated public PorterDuffColorFilter(@ColorInt int, @NonNull android.graphics.PorterDuff.Mode);
+  public class PorterDuffColorFilter extends android.graphics.ColorFilter {
+    ctor public PorterDuffColorFilter(@ColorInt int, @NonNull android.graphics.PorterDuff.Mode);
   }
 
-  @Deprecated public class PorterDuffXfermode extends android.graphics.Xfermode {
-    ctor @Deprecated public PorterDuffXfermode(android.graphics.PorterDuff.Mode);
+  public class PorterDuffXfermode extends android.graphics.Xfermode {
+    ctor public PorterDuffXfermode(android.graphics.PorterDuff.Mode);
   }
 
   public interface PostProcessor {
@@ -15394,9 +15394,9 @@
     method public final boolean setLevel(@IntRange(from=0, to=10000) int);
     method public boolean setState(@NonNull int[]);
     method public void setTint(@ColorInt int);
+    method public void setTintBlendMode(@Nullable android.graphics.BlendMode);
     method public void setTintList(@Nullable android.content.res.ColorStateList);
-    method @Deprecated public void setTintMode(@Nullable android.graphics.PorterDuff.Mode);
-    method public void setTintMode(@Nullable android.graphics.BlendMode);
+    method public void setTintMode(@Nullable android.graphics.PorterDuff.Mode);
     method public boolean setVisible(boolean, boolean);
     method public void unscheduleSelf(@NonNull Runnable);
   }
@@ -15553,9 +15553,9 @@
     method public void loadDrawableAsync(android.content.Context, android.os.Message);
     method public void loadDrawableAsync(android.content.Context, android.graphics.drawable.Icon.OnDrawableLoadedListener, android.os.Handler);
     method public android.graphics.drawable.Icon setTint(@ColorInt int);
+    method @NonNull public android.graphics.drawable.Icon setTintBlendMode(@NonNull android.graphics.BlendMode);
     method public android.graphics.drawable.Icon setTintList(android.content.res.ColorStateList);
-    method @Deprecated @NonNull public android.graphics.drawable.Icon setTintMode(@NonNull android.graphics.PorterDuff.Mode);
-    method @NonNull public android.graphics.drawable.Icon setTintMode(@NonNull android.graphics.BlendMode);
+    method @NonNull public android.graphics.drawable.Icon setTintMode(@NonNull android.graphics.PorterDuff.Mode);
     method public void writeToParcel(android.os.Parcel, int);
     field @NonNull public static final android.os.Parcelable.Creator<android.graphics.drawable.Icon> CREATOR;
     field public static final int TYPE_ADAPTIVE_BITMAP = 5; // 0x5
@@ -49453,7 +49453,7 @@
     method public android.graphics.drawable.Drawable getIcon();
     method @Nullable public default android.graphics.BlendMode getIconTintBlendMode();
     method @Nullable public default android.content.res.ColorStateList getIconTintList();
-    method @Deprecated @Nullable public default android.graphics.PorterDuff.Mode getIconTintMode();
+    method @Nullable public default android.graphics.PorterDuff.Mode getIconTintMode();
     method public android.content.Intent getIntent();
     method public int getItemId();
     method public android.view.ContextMenu.ContextMenuInfo getMenuInfo();
@@ -49481,9 +49481,9 @@
     method public android.view.MenuItem setEnabled(boolean);
     method public android.view.MenuItem setIcon(android.graphics.drawable.Drawable);
     method public android.view.MenuItem setIcon(@DrawableRes int);
+    method @NonNull public default android.view.MenuItem setIconTintBlendMode(@Nullable android.graphics.BlendMode);
     method public default android.view.MenuItem setIconTintList(@Nullable android.content.res.ColorStateList);
-    method @Deprecated @NonNull public default android.view.MenuItem setIconTintMode(@Nullable android.graphics.PorterDuff.Mode);
-    method @NonNull public default android.view.MenuItem setIconTintMode(@Nullable android.graphics.BlendMode);
+    method @NonNull public default android.view.MenuItem setIconTintMode(@Nullable android.graphics.PorterDuff.Mode);
     method public android.view.MenuItem setIntent(android.content.Intent);
     method public android.view.MenuItem setNumericShortcut(char);
     method public default android.view.MenuItem setNumericShortcut(char, int);
@@ -50136,9 +50136,9 @@
     method public int getAutofillType();
     method @Nullable public android.view.autofill.AutofillValue getAutofillValue();
     method public android.graphics.drawable.Drawable getBackground();
-    method @Nullable public android.graphics.BlendMode getBackgroundBlendMode();
+    method @Nullable public android.graphics.BlendMode getBackgroundTintBlendMode();
     method @Nullable public android.content.res.ColorStateList getBackgroundTintList();
-    method @Deprecated @Nullable public android.graphics.PorterDuff.Mode getBackgroundTintMode();
+    method @Nullable public android.graphics.PorterDuff.Mode getBackgroundTintMode();
     method @android.view.ViewDebug.ExportedProperty(category="layout") public int getBaseline();
     method @android.view.ViewDebug.CapturedViewProperty public final int getBottom();
     method protected float getBottomFadingEdgeStrength();
@@ -50169,10 +50169,10 @@
     method public java.util.ArrayList<android.view.View> getFocusables(int);
     method public void getFocusedRect(android.graphics.Rect);
     method public android.graphics.drawable.Drawable getForeground();
-    method @Nullable public android.graphics.BlendMode getForegroundBlendMode();
     method public int getForegroundGravity();
+    method @Nullable public android.graphics.BlendMode getForegroundTintBlendMode();
     method @Nullable public android.content.res.ColorStateList getForegroundTintList();
-    method @Deprecated @Nullable public android.graphics.PorterDuff.Mode getForegroundTintMode();
+    method @Nullable public android.graphics.PorterDuff.Mode getForegroundTintMode();
     method public boolean getGlobalVisibleRect(android.graphics.Rect, android.graphics.Point);
     method public final boolean getGlobalVisibleRect(android.graphics.Rect);
     method public android.os.Handler getHandler();
@@ -50484,9 +50484,9 @@
     method public void setBackgroundColor(@ColorInt int);
     method @Deprecated public void setBackgroundDrawable(android.graphics.drawable.Drawable);
     method public void setBackgroundResource(@DrawableRes int);
+    method public void setBackgroundTintBlendMode(@Nullable android.graphics.BlendMode);
     method public void setBackgroundTintList(@Nullable android.content.res.ColorStateList);
-    method @Deprecated public void setBackgroundTintMode(@Nullable android.graphics.PorterDuff.Mode);
-    method public void setBackgroundTintMode(@Nullable android.graphics.BlendMode);
+    method public void setBackgroundTintMode(@Nullable android.graphics.PorterDuff.Mode);
     method public final void setBottom(int);
     method public void setCameraDistance(float);
     method public void setClickable(boolean);
@@ -50512,9 +50512,9 @@
     method public void setForceDarkAllowed(boolean);
     method public void setForeground(android.graphics.drawable.Drawable);
     method public void setForegroundGravity(int);
+    method public void setForegroundTintBlendMode(@Nullable android.graphics.BlendMode);
     method public void setForegroundTintList(@Nullable android.content.res.ColorStateList);
-    method @Deprecated public void setForegroundTintMode(@Nullable android.graphics.PorterDuff.Mode);
-    method public void setForegroundTintMode(@Nullable android.graphics.BlendMode);
+    method public void setForegroundTintMode(@Nullable android.graphics.PorterDuff.Mode);
     method public void setHapticFeedbackEnabled(boolean);
     method public void setHasTransientState(boolean);
     method public void setHorizontalFadingEdgeEnabled(boolean);
@@ -54850,18 +54850,22 @@
     method public boolean getSplitTrack();
     method public android.graphics.drawable.Drawable getThumb();
     method public int getThumbOffset();
+    method @Nullable public android.graphics.BlendMode getThumbTintBlendMode();
     method @Nullable public android.content.res.ColorStateList getThumbTintList();
     method @Nullable public android.graphics.PorterDuff.Mode getThumbTintMode();
     method public android.graphics.drawable.Drawable getTickMark();
+    method @Nullable public android.graphics.BlendMode getTickMarkTintBlendMode();
     method @Nullable public android.content.res.ColorStateList getTickMarkTintList();
     method @Nullable public android.graphics.PorterDuff.Mode getTickMarkTintMode();
     method public void setKeyProgressIncrement(int);
     method public void setSplitTrack(boolean);
     method public void setThumb(android.graphics.drawable.Drawable);
     method public void setThumbOffset(int);
+    method public void setThumbTintBlendMode(@Nullable android.graphics.BlendMode);
     method public void setThumbTintList(@Nullable android.content.res.ColorStateList);
     method public void setThumbTintMode(@Nullable android.graphics.PorterDuff.Mode);
     method public void setTickMark(android.graphics.drawable.Drawable);
+    method public void setTickMarkTintBlendMode(@Nullable android.graphics.BlendMode);
     method public void setTickMarkTintList(@Nullable android.content.res.ColorStateList);
     method public void setTickMarkTintMode(@Nullable android.graphics.PorterDuff.Mode);
   }
@@ -55260,11 +55264,13 @@
     ctor public CheckedTextView(android.content.Context, android.util.AttributeSet, int);
     ctor public CheckedTextView(android.content.Context, android.util.AttributeSet, int, int);
     method public android.graphics.drawable.Drawable getCheckMarkDrawable();
+    method @Nullable public android.graphics.BlendMode getCheckMarkTintBlendMode();
     method @Nullable public android.content.res.ColorStateList getCheckMarkTintList();
     method @Nullable public android.graphics.PorterDuff.Mode getCheckMarkTintMode();
     method @android.view.ViewDebug.ExportedProperty public boolean isChecked();
     method public void setCheckMarkDrawable(@DrawableRes int);
     method public void setCheckMarkDrawable(@Nullable android.graphics.drawable.Drawable);
+    method public void setCheckMarkTintBlendMode(@Nullable android.graphics.BlendMode);
     method public void setCheckMarkTintList(@Nullable android.content.res.ColorStateList);
     method public void setCheckMarkTintMode(@Nullable android.graphics.PorterDuff.Mode);
     method public void setChecked(boolean);
@@ -55299,11 +55305,13 @@
     ctor public CompoundButton(android.content.Context, android.util.AttributeSet, int);
     ctor public CompoundButton(android.content.Context, android.util.AttributeSet, int, int);
     method @Nullable public android.graphics.drawable.Drawable getButtonDrawable();
+    method @Nullable public android.graphics.BlendMode getButtonTintBlendMode();
     method @Nullable public android.content.res.ColorStateList getButtonTintList();
     method @Nullable public android.graphics.PorterDuff.Mode getButtonTintMode();
     method @android.view.ViewDebug.ExportedProperty public boolean isChecked();
     method public void setButtonDrawable(@DrawableRes int);
     method public void setButtonDrawable(@Nullable android.graphics.drawable.Drawable);
+    method public void setButtonTintBlendMode(@Nullable android.graphics.BlendMode);
     method public void setButtonTintList(@Nullable android.content.res.ColorStateList);
     method public void setButtonTintMode(@Nullable android.graphics.PorterDuff.Mode);
     method public void setChecked(boolean);
@@ -55792,6 +55800,7 @@
     method public android.graphics.drawable.Drawable getDrawable();
     method public int getImageAlpha();
     method public android.graphics.Matrix getImageMatrix();
+    method @Nullable public android.graphics.BlendMode getImageTintBlendMode();
     method @Nullable public android.content.res.ColorStateList getImageTintList();
     method @Nullable public android.graphics.PorterDuff.Mode getImageTintMode();
     method public int getMaxHeight();
@@ -55815,6 +55824,7 @@
     method public void setImageMatrix(android.graphics.Matrix);
     method public void setImageResource(@DrawableRes int);
     method public void setImageState(int[], boolean);
+    method public void setImageTintBlendMode(@Nullable android.graphics.BlendMode);
     method public void setImageTintList(@Nullable android.content.res.ColorStateList);
     method public void setImageTintMode(@Nullable android.graphics.PorterDuff.Mode);
     method public void setImageURI(@Nullable android.net.Uri);
@@ -56268,6 +56278,7 @@
     ctor public ProgressBar(android.content.Context, android.util.AttributeSet, int, int);
     method @Nullable public android.graphics.drawable.Drawable getCurrentDrawable();
     method public android.graphics.drawable.Drawable getIndeterminateDrawable();
+    method @Nullable public android.graphics.BlendMode getIndeterminateTintBlendMode();
     method @Nullable public android.content.res.ColorStateList getIndeterminateTintList();
     method @Nullable public android.graphics.PorterDuff.Mode getIndeterminateTintMode();
     method public android.view.animation.Interpolator getInterpolator();
@@ -56278,12 +56289,15 @@
     method @Px public int getMinHeight();
     method @Px public int getMinWidth();
     method @android.view.ViewDebug.ExportedProperty(category="progress") public int getProgress();
+    method @Nullable public android.graphics.BlendMode getProgressBackgroundTintBlendMode();
     method @Nullable public android.content.res.ColorStateList getProgressBackgroundTintList();
     method @Nullable public android.graphics.PorterDuff.Mode getProgressBackgroundTintMode();
     method public android.graphics.drawable.Drawable getProgressDrawable();
+    method @Nullable public android.graphics.BlendMode getProgressTintBlendMode();
     method @Nullable public android.content.res.ColorStateList getProgressTintList();
     method @Nullable public android.graphics.PorterDuff.Mode getProgressTintMode();
     method @android.view.ViewDebug.ExportedProperty(category="progress") public int getSecondaryProgress();
+    method @Nullable public android.graphics.BlendMode getSecondaryProgressTintBlendMode();
     method @Nullable public android.content.res.ColorStateList getSecondaryProgressTintList();
     method @Nullable public android.graphics.PorterDuff.Mode getSecondaryProgressTintMode();
     method public final void incrementProgressBy(int);
@@ -56295,6 +56309,7 @@
     method public void setIndeterminate(boolean);
     method public void setIndeterminateDrawable(android.graphics.drawable.Drawable);
     method public void setIndeterminateDrawableTiled(android.graphics.drawable.Drawable);
+    method public void setIndeterminateTintBlendMode(@Nullable android.graphics.BlendMode);
     method public void setIndeterminateTintList(@Nullable android.content.res.ColorStateList);
     method public void setIndeterminateTintMode(@Nullable android.graphics.PorterDuff.Mode);
     method public void setInterpolator(android.content.Context, @InterpolatorRes int);
@@ -56307,13 +56322,16 @@
     method public void setMinWidth(@Px int);
     method public void setProgress(int);
     method public void setProgress(int, boolean);
+    method public void setProgressBackgroundTintBlendMode(@Nullable android.graphics.BlendMode);
     method public void setProgressBackgroundTintList(@Nullable android.content.res.ColorStateList);
     method public void setProgressBackgroundTintMode(@Nullable android.graphics.PorterDuff.Mode);
     method public void setProgressDrawable(android.graphics.drawable.Drawable);
     method public void setProgressDrawableTiled(android.graphics.drawable.Drawable);
+    method public void setProgressTintBlendMode(@Nullable android.graphics.BlendMode);
     method public void setProgressTintList(@Nullable android.content.res.ColorStateList);
     method public void setProgressTintMode(@Nullable android.graphics.PorterDuff.Mode);
     method public void setSecondaryProgress(int);
+    method public void setSecondaryProgressTintBlendMode(@Nullable android.graphics.BlendMode);
     method public void setSecondaryProgressTintList(@Nullable android.content.res.ColorStateList);
     method public void setSecondaryProgressTintMode(@Nullable android.graphics.PorterDuff.Mode);
   }
@@ -56862,9 +56880,11 @@
     method public CharSequence getTextOn();
     method public android.graphics.drawable.Drawable getThumbDrawable();
     method public int getThumbTextPadding();
+    method @Nullable public android.graphics.BlendMode getThumbTintBlendMode();
     method @Nullable public android.content.res.ColorStateList getThumbTintList();
     method @Nullable public android.graphics.PorterDuff.Mode getThumbTintMode();
     method public android.graphics.drawable.Drawable getTrackDrawable();
+    method @Nullable public android.graphics.BlendMode getTrackTintBlendMode();
     method @Nullable public android.content.res.ColorStateList getTrackTintList();
     method @Nullable public android.graphics.PorterDuff.Mode getTrackTintMode();
     method public void onMeasure(int, int);
@@ -56880,10 +56900,12 @@
     method public void setThumbDrawable(android.graphics.drawable.Drawable);
     method public void setThumbResource(@DrawableRes int);
     method public void setThumbTextPadding(int);
+    method public void setThumbTintBlendMode(@Nullable android.graphics.BlendMode);
     method public void setThumbTintList(@Nullable android.content.res.ColorStateList);
     method public void setThumbTintMode(@Nullable android.graphics.PorterDuff.Mode);
     method public void setTrackDrawable(android.graphics.drawable.Drawable);
     method public void setTrackResource(@DrawableRes int);
+    method public void setTrackTintBlendMode(@Nullable android.graphics.BlendMode);
     method public void setTrackTintList(@Nullable android.content.res.ColorStateList);
     method public void setTrackTintMode(@Nullable android.graphics.PorterDuff.Mode);
   }
@@ -57041,6 +57063,7 @@
     method public int getAutoSizeTextType();
     method public int getBreakStrategy();
     method public int getCompoundDrawablePadding();
+    method @Nullable public android.graphics.BlendMode getCompoundDrawableTintBlendMode();
     method public android.content.res.ColorStateList getCompoundDrawableTintList();
     method public android.graphics.PorterDuff.Mode getCompoundDrawableTintMode();
     method @NonNull public android.graphics.drawable.Drawable[] getCompoundDrawables();
@@ -57166,6 +57189,7 @@
     method public void setAutoSizeTextTypeWithDefaults(int);
     method public void setBreakStrategy(int);
     method public void setCompoundDrawablePadding(int);
+    method public void setCompoundDrawableTintBlendMode(@Nullable android.graphics.BlendMode);
     method public void setCompoundDrawableTintList(@Nullable android.content.res.ColorStateList);
     method public void setCompoundDrawableTintMode(@Nullable android.graphics.PorterDuff.Mode);
     method public void setCompoundDrawables(@Nullable android.graphics.drawable.Drawable, @Nullable android.graphics.drawable.Drawable, @Nullable android.graphics.drawable.Drawable, @Nullable android.graphics.drawable.Drawable);
diff --git a/api/test-current.txt b/api/test-current.txt
index 13e999b..49fa558 100644
--- a/api/test-current.txt
+++ b/api/test-current.txt
@@ -346,6 +346,20 @@
     method public android.graphics.Rect getSourceRectHint();
   }
 
+  public class StatusBarManager {
+    method @NonNull @RequiresPermission(android.Manifest.permission.STATUS_BAR) public android.app.StatusBarManager.DisableInfo getDisableInfo();
+    method @RequiresPermission(android.Manifest.permission.STATUS_BAR) public void setDisabledForSetup(boolean);
+  }
+
+  public static final class StatusBarManager.DisableInfo {
+    method public boolean areAllComponentsEnabled();
+    method public boolean isNavigateToHomeDisabled();
+    method public boolean isNotificationPeekingDisabled();
+    method public boolean isRecentsDisabled();
+    method public boolean isSearchDisabled();
+    method public boolean isStatusBarExpansionDisabled();
+  }
+
   public class TimePickerDialog extends android.app.AlertDialog implements android.content.DialogInterface.OnClickListener android.widget.TimePicker.OnTimeChangedListener {
     method public android.widget.TimePicker getTimePicker();
   }
@@ -632,6 +646,7 @@
     method public void setContentCaptureOptions(@Nullable android.content.ContentCaptureOptions);
     field public static final String BUGREPORT_SERVICE = "bugreport";
     field public static final String ROLLBACK_SERVICE = "rollback";
+    field public static final String STATUS_BAR_SERVICE = "statusbar";
     field public static final String TEST_NETWORK_SERVICE = "test_network";
   }
 
diff --git a/core/java/android/app/StatusBarManager.java b/core/java/android/app/StatusBarManager.java
index 9ff363d..af2d774 100644
--- a/core/java/android/app/StatusBarManager.java
+++ b/core/java/android/app/StatusBarManager.java
@@ -22,6 +22,7 @@
 import android.annotation.RequiresPermission;
 import android.annotation.SystemApi;
 import android.annotation.SystemService;
+import android.annotation.TestApi;
 import android.annotation.UnsupportedAppUsage;
 import android.content.Context;
 import android.os.Binder;
@@ -366,6 +367,7 @@
      * @hide
      */
     @SystemApi
+    @TestApi
     @RequiresPermission(android.Manifest.permission.STATUS_BAR)
     public void setDisabledForSetup(boolean disabled) {
         try {
@@ -390,6 +392,7 @@
      * @hide
      */
     @SystemApi
+    @TestApi
     @RequiresPermission(android.Manifest.permission.STATUS_BAR)
     @NonNull
     public DisableInfo getDisableInfo() {
@@ -422,6 +425,7 @@
      * @hide
      */
     @SystemApi
+    @TestApi
     public static final class DisableInfo {
 
         private boolean mStatusBarExpansion;
@@ -448,6 +452,7 @@
          * @hide
          */
         @SystemApi
+        @TestApi
         public boolean isStatusBarExpansionDisabled() {
             return mStatusBarExpansion;
         }
@@ -463,6 +468,7 @@
          * @hide
          */
         @SystemApi
+        @TestApi
         public boolean isNavigateToHomeDisabled() {
             return mNavigateHome;
         }
@@ -478,6 +484,7 @@
          * @hide
          */
         @SystemApi
+        @TestApi
         public boolean isNotificationPeekingDisabled() {
             return mNotificationPeeking;
         }
@@ -493,6 +500,7 @@
          * @hide
          */
         @SystemApi
+        @TestApi
         public boolean isRecentsDisabled() {
             return mRecents;
         }
@@ -508,6 +516,7 @@
          * @hide
          */
         @SystemApi
+        @TestApi
         public boolean isSearchDisabled() {
             return mSearch;
         }
@@ -523,6 +532,7 @@
          * @hide
          */
         @SystemApi
+        @TestApi
         public boolean areAllComponentsEnabled() {
             return !mStatusBarExpansion && !mNavigateHome && !mNotificationPeeking && !mRecents
                     && !mSearch;
diff --git a/core/java/android/app/role/RoleControllerManager.java b/core/java/android/app/role/RoleControllerManager.java
index 394a0d6..9186b3d 100644
--- a/core/java/android/app/role/RoleControllerManager.java
+++ b/core/java/android/app/role/RoleControllerManager.java
@@ -275,6 +275,11 @@
                 Log.e(LOG_TAG, "Error calling grantDefaultRoles()", e);
             }
         }
+
+        @Override
+        protected void onFailed() {
+            mRemoteCallback.sendResult(null);
+        }
     }
 
     /**
diff --git a/core/java/android/content/Context.java b/core/java/android/content/Context.java
index 0ba457e..de04829 100644
--- a/core/java/android/content/Context.java
+++ b/core/java/android/content/Context.java
@@ -3678,6 +3678,7 @@
      * @hide
      */
     @SystemApi
+    @TestApi
     public static final String STATUS_BAR_SERVICE = "statusbar";
 
     /**
diff --git a/core/java/android/os/GraphicsEnvironment.java b/core/java/android/os/GraphicsEnvironment.java
index 779790c..a51a871 100644
--- a/core/java/android/os/GraphicsEnvironment.java
+++ b/core/java/android/os/GraphicsEnvironment.java
@@ -164,6 +164,43 @@
     }
 
     /**
+     * Query to determine if ANGLE should be used
+     */
+    public static boolean shouldUseAngle(Context context, Bundle coreSettings,
+            String packageName) {
+        if (packageName.isEmpty()) {
+            Log.v(TAG, "No package name available yet, ANGLE should not be used");
+            return false;
+        }
+
+        final String devOptIn = getDriverForPkg(context, coreSettings, packageName);
+        if (DEBUG) {
+            Log.v(TAG, "ANGLE Developer option for '" + packageName + "' "
+                    + "set to: '" + devOptIn + "'");
+        }
+
+        // We only want to use ANGLE if the app is whitelisted or the developer has
+        // explicitly chosen something other than default driver.
+        // The whitelist will be generated by the ANGLE APK at both boot time and
+        // ANGLE update time. It will only include apps mentioned in the rules file.
+        final boolean whitelisted = checkAngleWhitelist(context, coreSettings, packageName);
+        final boolean requested = devOptIn.equals(sDriverMap.get(OpenGlDriverChoice.ANGLE));
+        final boolean useAngle = (whitelisted || requested);
+        if (!useAngle) {
+            return false;
+        }
+
+        if (whitelisted) {
+            Log.v(TAG, "ANGLE whitelist includes " + packageName);
+        }
+        if (requested) {
+            Log.v(TAG, "ANGLE developer option for " + packageName + ": " + devOptIn);
+        }
+
+        return true;
+    }
+
+    /**
      * Check whether application is debuggable
      */
     private static boolean isDebuggable(Context context) {
@@ -535,6 +572,8 @@
                 getGlobalSettingsString(contentResolver, bundle,
                     Settings.Global.GLOBAL_SETTINGS_ANGLE_WHITELIST);
 
+        if (DEBUG) Log.v(TAG, "ANGLE whitelist: " + angleWhitelist);
+
         return angleWhitelist.contains(packageName);
     }
 
@@ -549,43 +588,11 @@
      */
     public boolean setupAngle(Context context, Bundle bundle, PackageManager pm,
             String packageName) {
-        if (packageName.isEmpty()) {
-            Log.v(TAG, "No package name available yet, skipping ANGLE setup");
+
+        if (!shouldUseAngle(context, bundle, packageName)) {
             return false;
         }
 
-        final String devOptIn = getDriverForPkg(context, bundle, packageName);
-        if (DEBUG) {
-            Log.v(TAG, "ANGLE Developer option for '" + packageName + "' "
-                    + "set to: '" + devOptIn + "'");
-        }
-
-        // We only need to check rules if the app is whitelisted or the developer has
-        // explicitly chosen something other than default driver.
-        //
-        // The whitelist will be generated by the ANGLE APK at both boot time and
-        // ANGLE update time. It will only include apps mentioned in the rules file.
-        //
-        // If the user has set the developer option to something other than default,
-        // we need to call setupAngleRulesApk() with the package name and the developer
-        // option value (native/angle/other). Then later when we are actually trying to
-        // load a driver, GraphicsEnv::shouldUseAngle() has seen the package name before
-        // and can confidently answer yes/no based on the previously set developer
-        // option value.
-        final boolean whitelisted = checkAngleWhitelist(context, bundle, packageName);
-        final boolean defaulted = devOptIn.equals(sDriverMap.get(OpenGlDriverChoice.DEFAULT));
-        final boolean rulesCheck = (whitelisted || !defaulted);
-        if (!rulesCheck) {
-            return false;
-        }
-
-        if (whitelisted) {
-            Log.v(TAG, "ANGLE whitelist includes " + packageName);
-        }
-        if (!defaulted) {
-            Log.v(TAG, "ANGLE developer option for " + packageName + ": " + devOptIn);
-        }
-
         final String anglePkgName = getAnglePackageName(pm);
         if (anglePkgName.isEmpty()) {
             Log.e(TAG, "Failed to find ANGLE package.");
@@ -623,6 +630,14 @@
 
         if (DEBUG) Log.v(TAG, "ANGLE package libs: " + paths);
 
+        // If the user has set the developer option to something other than default,
+        // we need to call setupAngleRulesApk() with the package name and the developer
+        // option value (native/angle/other). Then later when we are actually trying to
+        // load a driver, GraphicsEnv::getShouldUseAngle() has seen the package name before
+        // and can confidently answer yes/no based on the previously set developer
+        // option value.
+        final String devOptIn = getDriverForPkg(context, bundle, packageName);
+
         if (setupAngleWithTempRulesFile(context, packageName, paths, devOptIn)) {
             // We setup ANGLE with a temp rules file, so we're done here.
             return true;
@@ -655,9 +670,9 @@
     }
 
     /**
-     * Determine if ANGLE should be used.
+     * Determine if ANGLE will be used and setup the environment
      */
-    private boolean shouldUseAngle(Context context, String packageName) {
+    private boolean setupAndUseAngle(Context context, String packageName) {
         // Need to make sure we are evaluating ANGLE usage for the correct circumstances
         if (!setupAngle(context, null, context.getPackageManager(), packageName)) {
             Log.v(TAG, "Package '" + packageName + "' should use not ANGLE");
@@ -677,7 +692,7 @@
     public void showAngleInUseDialogBox(Context context) {
         final String packageName = context.getPackageName();
 
-        if (shouldShowAngleInUseDialogBox(context) && shouldUseAngle(context, packageName)) {
+        if (shouldShowAngleInUseDialogBox(context) && setupAndUseAngle(context, packageName)) {
             final Intent intent = new Intent(ACTION_ANGLE_FOR_ANDROID_TOAST_MESSAGE);
             String anglePkg = getAnglePackageName(context.getPackageManager());
             intent.setPackage(anglePkg);
diff --git a/core/java/android/view/MenuInflater.java b/core/java/android/view/MenuInflater.java
index 8b3b10f..b6b11ab 100644
--- a/core/java/android/view/MenuInflater.java
+++ b/core/java/android/view/MenuInflater.java
@@ -488,7 +488,7 @@
             }
 
             if (mItemIconBlendMode != null) {
-                item.setIconTintMode(mItemIconBlendMode);
+                item.setIconTintBlendMode(mItemIconBlendMode);
             }
 
             if (itemIconTintList != null) {
diff --git a/core/java/android/view/MenuItem.java b/core/java/android/view/MenuItem.java
index 3785310..a2fb596 100644
--- a/core/java/android/view/MenuItem.java
+++ b/core/java/android/view/MenuItem.java
@@ -270,11 +270,8 @@
      * @attr ref android.R.styleable#MenuItem_iconTintMode
      * @see #setIconTintList(ColorStateList)
      * @see Drawable#setTintMode(PorterDuff.Mode)
-     * @see Drawable#setTintMode(BlendMode)
-     *
-     * @deprecated use {@link #setIconTintMode(BlendMode)} instead
+     * @see Drawable#setTintBlendMode(BlendMode)
      */
-    @Deprecated
     default @NonNull MenuItem setIconTintMode(@Nullable PorterDuff.Mode tintMode) {
         return this;
     }
@@ -289,7 +286,7 @@
      * @attr ref android.R.styleable#MenuItem_iconTintMode
      * @see #setIconTintList(ColorStateList)
      */
-    default @NonNull MenuItem setIconTintMode(@Nullable BlendMode blendMode) {
+    default @NonNull MenuItem setIconTintBlendMode(@Nullable BlendMode blendMode) {
         PorterDuff.Mode mode = BlendMode.blendModeToPorterDuffMode(blendMode);
         if (mode != null) {
             return setIconTintMode(mode);
@@ -304,11 +301,9 @@
      * @return the blending mode used to apply the tint to this item's icon
      * @attr ref android.R.styleable#MenuItem_iconTintMode
      * @see #setIconTintMode(PorterDuff.Mode)
-     * @see #setIconTintMode(BlendMode)
+     * @see #setIconTintBlendMode(BlendMode)
      *
-     * @deprecated Use {@link #getIconTintBlendMode()} instead
      */
-    @Deprecated
     @Nullable
     public default PorterDuff.Mode getIconTintMode() { return null; }
 
@@ -317,7 +312,7 @@
      *
      * @return the blending mode used to apply the tint to this item's icon
      * @attr ref android.R.styleable#MenuItem_iconTintMode
-     * @see #setIconTintMode(BlendMode)
+     * @see #setIconTintBlendMode(BlendMode)
      *
      */
     @Nullable
diff --git a/core/java/android/view/View.java b/core/java/android/view/View.java
index 096c988..10f9d38 100644
--- a/core/java/android/view/View.java
+++ b/core/java/android/view/View.java
@@ -5608,7 +5608,9 @@
                     break;
                 case R.styleable.View_foregroundTintMode:
                     if (targetSdkVersion >= Build.VERSION_CODES.M || this instanceof FrameLayout) {
-                        setForegroundTintMode(Drawable.parseBlendMode(a.getInt(attr, -1), null));
+                        setForegroundTintBlendMode(
+                                Drawable.parseBlendMode(a.getInt(attr, -1),
+                                        null));
                     }
                     break;
                 case R.styleable.View_foregroundTint:
@@ -22873,17 +22875,14 @@
      * @attr ref android.R.styleable#View_backgroundTintMode
      * @see #getBackgroundTintMode()
      * @see Drawable#setTintMode(PorterDuff.Mode)
-     *
-     * @deprecated use @setBackgroundTintMode(BlendMode) instead
      */
-    @Deprecated
     public void setBackgroundTintMode(@Nullable PorterDuff.Mode tintMode) {
         BlendMode mode = null;
         if (tintMode != null) {
             mode = BlendMode.fromValue(tintMode.nativeInt);
         }
 
-        setBackgroundTintMode(mode);
+        setBackgroundTintBlendMode(mode);
     }
 
     /**
@@ -22895,9 +22894,9 @@
      *                 {@code null} to clear tint
      * @attr ref android.R.styleable#View_backgroundTintMode
      * @see #getBackgroundTintMode()
-     * @see Drawable#setTintMode(BlendMode)
+     * @see Drawable#setTintBlendMode(BlendMode)
      */
-    public void setBackgroundTintMode(@Nullable BlendMode blendMode) {
+    public void setBackgroundTintBlendMode(@Nullable BlendMode blendMode) {
         if (mBackgroundTint == null) {
             mBackgroundTint = new TintInfo();
         }
@@ -22915,13 +22914,11 @@
      * @return the blending mode used to apply the tint to the background
      *         drawable
      * @attr ref android.R.styleable#View_backgroundTintMode
-     * @see #setBackgroundTintMode(BlendMode)
+     * @see #setBackgroundTintBlendMode(BlendMode)
      *
-     * @deprecated use #getBackgroundBlendMode() instead
      */
     @Nullable
     @InspectableProperty
-    @Deprecated
     public PorterDuff.Mode getBackgroundTintMode() {
         PorterDuff.Mode porterDuffMode;
         if (mBackgroundTint != null && mBackgroundTint.mBlendMode != null) {
@@ -22939,9 +22936,9 @@
      * @return the blending mode used to apply the tint to the background
      *         drawable, null if no blend has previously been configured
      * @attr ref android.R.styleable#View_backgroundTintMode
-     * @see #setBackgroundTintMode(BlendMode)
+     * @see #setBackgroundTintBlendMode(BlendMode)
      */
-    public @Nullable BlendMode getBackgroundBlendMode() {
+    public @Nullable BlendMode getBackgroundTintBlendMode() {
         return mBackgroundTint != null ? mBackgroundTint.mBlendMode : null;
     }
 
@@ -22956,7 +22953,7 @@
                 }
 
                 if (tintInfo.mHasTintMode) {
-                    mBackground.setTintMode(tintInfo.mBlendMode);
+                    mBackground.setTintBlendMode(tintInfo.mBlendMode);
                 }
 
                 // The drawable (or one of its children) may not have been
@@ -23141,15 +23138,13 @@
      * @see #getForegroundTintMode()
      * @see Drawable#setTintMode(PorterDuff.Mode)
      *
-     * @deprecated use #setForegroundTintMode(BlendMode)
      */
-    @Deprecated
     public void setForegroundTintMode(@Nullable PorterDuff.Mode tintMode) {
         BlendMode mode = null;
         if (tintMode != null) {
             mode = BlendMode.fromValue(tintMode.nativeInt);
         }
-        setForegroundTintMode(mode);
+        setForegroundTintBlendMode(mode);
     }
 
     /**
@@ -23161,9 +23156,9 @@
      *                 {@code null} to clear tint
      * @attr ref android.R.styleable#View_foregroundTintMode
      * @see #getForegroundTintMode()
-     * @see Drawable#setTintMode(BlendMode)
+     * @see Drawable#setTintBlendMode(BlendMode)
      */
-    public void setForegroundTintMode(@Nullable BlendMode blendMode) {
+    public void setForegroundTintBlendMode(@Nullable BlendMode blendMode) {
         if (mForegroundInfo == null) {
             mForegroundInfo = new ForegroundInfo();
         }
@@ -23184,12 +23179,9 @@
      *         drawable
      * @attr ref android.R.styleable#View_foregroundTintMode
      * @see #setForegroundTintMode(PorterDuff.Mode)
-     *
-     * @deprecated use #getForegroundBlendMode() instead
      */
     @InspectableProperty
     @Nullable
-    @Deprecated
     public PorterDuff.Mode getForegroundTintMode() {
         BlendMode blendMode = mForegroundInfo != null && mForegroundInfo.mTintInfo != null
                 ? mForegroundInfo.mTintInfo.mBlendMode : null;
@@ -23207,10 +23199,10 @@
      * @return the blending mode used to apply the tint to the foreground
      *         drawable
      * @attr ref android.R.styleable#View_foregroundTintMode
-     * @see #setForegroundTintMode(BlendMode)
+     * @see #setForegroundTintBlendMode(BlendMode)
      *
      */
-    public @Nullable BlendMode getForegroundBlendMode() {
+    public @Nullable BlendMode getForegroundTintBlendMode() {
         return mForegroundInfo != null && mForegroundInfo.mTintInfo != null
                 ? mForegroundInfo.mTintInfo.mBlendMode : null;
     }
@@ -23227,7 +23219,7 @@
                 }
 
                 if (tintInfo.mHasTintMode) {
-                    mForegroundInfo.mDrawable.setTintMode(tintInfo.mBlendMode);
+                    mForegroundInfo.mDrawable.setTintBlendMode(tintInfo.mBlendMode);
                 }
 
                 // The drawable (or one of its children) may not have been
diff --git a/core/java/android/widget/AbsSeekBar.java b/core/java/android/widget/AbsSeekBar.java
index cd5f2e2..18c6abb 100644
--- a/core/java/android/widget/AbsSeekBar.java
+++ b/core/java/android/widget/AbsSeekBar.java
@@ -22,6 +22,7 @@
 import android.content.Context;
 import android.content.res.ColorStateList;
 import android.content.res.TypedArray;
+import android.graphics.BlendMode;
 import android.graphics.Canvas;
 import android.graphics.Insets;
 import android.graphics.PorterDuff;
@@ -48,15 +49,15 @@
     @UnsupportedAppUsage
     private Drawable mThumb;
     private ColorStateList mThumbTintList = null;
-    private PorterDuff.Mode mThumbTintMode = null;
+    private BlendMode mThumbBlendMode = null;
     private boolean mHasThumbTint = false;
-    private boolean mHasThumbTintMode = false;
+    private boolean mHasThumbBlendMode = false;
 
     private Drawable mTickMark;
     private ColorStateList mTickMarkTintList = null;
-    private PorterDuff.Mode mTickMarkTintMode = null;
+    private BlendMode mTickMarkBlendMode = null;
     private boolean mHasTickMarkTint = false;
-    private boolean mHasTickMarkTintMode = false;
+    private boolean mHasTickMarkBlendMode = false;
 
     private int mThumbOffset;
     @UnsupportedAppUsage
@@ -114,9 +115,9 @@
         setThumb(thumb);
 
         if (a.hasValue(R.styleable.SeekBar_thumbTintMode)) {
-            mThumbTintMode = Drawable.parseTintMode(a.getInt(
-                    R.styleable.SeekBar_thumbTintMode, -1), mThumbTintMode);
-            mHasThumbTintMode = true;
+            mThumbBlendMode = Drawable.parseBlendMode(a.getInt(
+                    R.styleable.SeekBar_thumbTintMode, -1), mThumbBlendMode);
+            mHasThumbBlendMode = true;
         }
 
         if (a.hasValue(R.styleable.SeekBar_thumbTint)) {
@@ -128,9 +129,9 @@
         setTickMark(tickMark);
 
         if (a.hasValue(R.styleable.SeekBar_tickMarkTintMode)) {
-            mTickMarkTintMode = Drawable.parseTintMode(a.getInt(
-                    R.styleable.SeekBar_tickMarkTintMode, -1), mTickMarkTintMode);
-            mHasTickMarkTintMode = true;
+            mTickMarkBlendMode = Drawable.parseBlendMode(a.getInt(
+                    R.styleable.SeekBar_tickMarkTintMode, -1), mTickMarkBlendMode);
+            mHasTickMarkBlendMode = true;
         }
 
         if (a.hasValue(R.styleable.SeekBar_tickMarkTint)) {
@@ -274,9 +275,25 @@
      * @see Drawable#setTintMode(PorterDuff.Mode)
      */
     public void setThumbTintMode(@Nullable PorterDuff.Mode tintMode) {
-        mThumbTintMode = tintMode;
-        mHasThumbTintMode = true;
+        setThumbTintBlendMode(tintMode != null ? BlendMode.fromValue(tintMode.nativeInt) :
+                null);
+    }
 
+    /**
+     * Specifies the blending mode used to apply the tint specified by
+     * {@link #setThumbTintList(ColorStateList)}} to the thumb drawable. The
+     * default mode is {@link BlendMode#SRC_IN}.
+     *
+     * @param blendMode the blending mode used to apply the tint, may be
+     *                 {@code null} to clear tint
+     *
+     * @attr ref android.R.styleable#SeekBar_thumbTintMode
+     * @see #getThumbTintMode()
+     * @see Drawable#setTintBlendMode(BlendMode)
+     */
+    public void setThumbTintBlendMode(@Nullable BlendMode blendMode) {
+        mThumbBlendMode = blendMode;
+        mHasThumbBlendMode = true;
         applyThumbTint();
     }
 
@@ -291,19 +308,33 @@
     @InspectableProperty
     @Nullable
     public PorterDuff.Mode getThumbTintMode() {
-        return mThumbTintMode;
+        return mThumbBlendMode != null
+                ? BlendMode.blendModeToPorterDuffMode(mThumbBlendMode) : null;
+    }
+
+    /**
+     * Returns the blending mode used to apply the tint to the thumb drawable,
+     * if specified.
+     *
+     * @return the blending mode used to apply the tint to the thumb drawable
+     * @attr ref android.R.styleable#SeekBar_thumbTintMode
+     * @see #setThumbTintBlendMode(BlendMode)
+     */
+    @Nullable
+    public BlendMode getThumbTintBlendMode() {
+        return mThumbBlendMode;
     }
 
     private void applyThumbTint() {
-        if (mThumb != null && (mHasThumbTint || mHasThumbTintMode)) {
+        if (mThumb != null && (mHasThumbTint || mHasThumbBlendMode)) {
             mThumb = mThumb.mutate();
 
             if (mHasThumbTint) {
                 mThumb.setTintList(mThumbTintList);
             }
 
-            if (mHasThumbTintMode) {
-                mThumb.setTintMode(mThumbTintMode);
+            if (mHasThumbBlendMode) {
+                mThumb.setTintBlendMode(mThumbBlendMode);
             }
 
             // The drawable (or one of its children) may not have been
@@ -430,8 +461,24 @@
      * @see Drawable#setTintMode(PorterDuff.Mode)
      */
     public void setTickMarkTintMode(@Nullable PorterDuff.Mode tintMode) {
-        mTickMarkTintMode = tintMode;
-        mHasTickMarkTintMode = true;
+        setTickMarkTintBlendMode(tintMode != null ? BlendMode.fromValue(tintMode.nativeInt) : null);
+    }
+
+    /**
+     * Specifies the blending mode used to apply the tint specified by
+     * {@link #setTickMarkTintList(ColorStateList)}} to the tick mark drawable. The
+     * default mode is {@link BlendMode#SRC_IN}.
+     *
+     * @param blendMode the blending mode used to apply the tint, may be
+     *                 {@code null} to clear tint
+     *
+     * @attr ref android.R.styleable#SeekBar_tickMarkTintMode
+     * @see #getTickMarkTintMode()
+     * @see Drawable#setTintBlendMode(BlendMode)
+     */
+    public void setTickMarkTintBlendMode(@Nullable BlendMode blendMode) {
+        mTickMarkBlendMode = blendMode;
+        mHasTickMarkBlendMode = true;
 
         applyTickMarkTint();
     }
@@ -447,19 +494,34 @@
     @InspectableProperty
     @Nullable
     public PorterDuff.Mode getTickMarkTintMode() {
-        return mTickMarkTintMode;
+        return mTickMarkBlendMode != null
+                ? BlendMode.blendModeToPorterDuffMode(mTickMarkBlendMode) : null;
+    }
+
+    /**
+     * Returns the blending mode used to apply the tint to the tick mark drawable,
+     * if specified.
+     *
+     * @return the blending mode used to apply the tint to the tick mark drawable
+     * @attr ref android.R.styleable#SeekBar_tickMarkTintMode
+     * @see #setTickMarkTintMode(PorterDuff.Mode)
+     */
+    @InspectableProperty(attributeId = android.R.styleable.SeekBar_tickMarkTintMode)
+    @Nullable
+    public BlendMode getTickMarkTintBlendMode() {
+        return mTickMarkBlendMode;
     }
 
     private void applyTickMarkTint() {
-        if (mTickMark != null && (mHasTickMarkTint || mHasTickMarkTintMode)) {
+        if (mTickMark != null && (mHasTickMarkTint || mHasTickMarkBlendMode)) {
             mTickMark = mTickMark.mutate();
 
             if (mHasTickMarkTint) {
                 mTickMark.setTintList(mTickMarkTintList);
             }
 
-            if (mHasTickMarkTintMode) {
-                mTickMark.setTintMode(mTickMarkTintMode);
+            if (mHasTickMarkBlendMode) {
+                mTickMark.setTintBlendMode(mTickMarkBlendMode);
             }
 
             // The drawable (or one of its children) may not have been
diff --git a/core/java/android/widget/CheckedTextView.java b/core/java/android/widget/CheckedTextView.java
index a211b46..8b70f41 100644
--- a/core/java/android/widget/CheckedTextView.java
+++ b/core/java/android/widget/CheckedTextView.java
@@ -23,6 +23,7 @@
 import android.content.Context;
 import android.content.res.ColorStateList;
 import android.content.res.TypedArray;
+import android.graphics.BlendMode;
 import android.graphics.Canvas;
 import android.graphics.PorterDuff;
 import android.graphics.drawable.Drawable;
@@ -58,7 +59,7 @@
     @UnsupportedAppUsage
     private Drawable mCheckMarkDrawable;
     private ColorStateList mCheckMarkTintList = null;
-    private PorterDuff.Mode mCheckMarkTintMode = null;
+    private BlendMode mCheckMarkBlendMode = null;
     private boolean mHasCheckMarkTint = false;
     private boolean mHasCheckMarkTintMode = false;
 
@@ -99,8 +100,9 @@
         }
 
         if (a.hasValue(R.styleable.CheckedTextView_checkMarkTintMode)) {
-            mCheckMarkTintMode = Drawable.parseTintMode(a.getInt(
-                    R.styleable.CheckedTextView_checkMarkTintMode, -1), mCheckMarkTintMode);
+            mCheckMarkBlendMode = Drawable.parseBlendMode(a.getInt(
+                    R.styleable.CheckedTextView_checkMarkTintMode, -1),
+                    mCheckMarkBlendMode);
             mHasCheckMarkTintMode = true;
         }
 
@@ -259,7 +261,23 @@
      * @see Drawable#setTintMode(PorterDuff.Mode)
      */
     public void setCheckMarkTintMode(@Nullable PorterDuff.Mode tintMode) {
-        mCheckMarkTintMode = tintMode;
+        setCheckMarkTintBlendMode(tintMode != null
+                ? BlendMode.fromValue(tintMode.nativeInt) : null);
+    }
+
+    /**
+     * Specifies the blending mode used to apply the tint specified by
+     * {@link #setCheckMarkTintList(ColorStateList)} to the check mark
+     * drawable. The default mode is {@link PorterDuff.Mode#SRC_IN}.
+     *
+     * @param tintMode the blending mode used to apply the tint, may be
+     *                 {@code null} to clear tint
+     * @attr ref android.R.styleable#CheckedTextView_checkMarkTintMode
+     * @see #setCheckMarkTintList(ColorStateList)
+     * @see Drawable#setTintBlendMode(BlendMode)
+     */
+    public void setCheckMarkTintBlendMode(@Nullable BlendMode tintMode) {
+        mCheckMarkBlendMode = tintMode;
         mHasCheckMarkTintMode = true;
 
         applyCheckMarkTint();
@@ -277,7 +295,23 @@
     @InspectableProperty
     @Nullable
     public PorterDuff.Mode getCheckMarkTintMode() {
-        return mCheckMarkTintMode;
+        return mCheckMarkBlendMode != null
+                ? BlendMode.blendModeToPorterDuffMode(mCheckMarkBlendMode) : null;
+    }
+
+    /**
+     * Returns the blending mode used to apply the tint to the check mark
+     * drawable, if specified.
+     *
+     * @return the blending mode used to apply the tint to the check mark
+     *         drawable
+     * @attr ref android.R.styleable#CheckedTextView_checkMarkTintMode
+     * @see #setCheckMarkTintMode(PorterDuff.Mode)
+     */
+    @InspectableProperty(attributeId = android.R.styleable.CheckedTextView_checkMarkTintMode)
+    @Nullable
+    public BlendMode getCheckMarkTintBlendMode() {
+        return mCheckMarkBlendMode;
     }
 
     private void applyCheckMarkTint() {
@@ -289,7 +323,7 @@
             }
 
             if (mHasCheckMarkTintMode) {
-                mCheckMarkDrawable.setTintMode(mCheckMarkTintMode);
+                mCheckMarkDrawable.setTintBlendMode(mCheckMarkBlendMode);
             }
 
             // The drawable (or one of its children) may not have been
diff --git a/core/java/android/widget/CompoundButton.java b/core/java/android/widget/CompoundButton.java
index 80ec1c6..2674ca4 100644
--- a/core/java/android/widget/CompoundButton.java
+++ b/core/java/android/widget/CompoundButton.java
@@ -23,6 +23,7 @@
 import android.content.Context;
 import android.content.res.ColorStateList;
 import android.content.res.TypedArray;
+import android.graphics.BlendMode;
 import android.graphics.Canvas;
 import android.graphics.PorterDuff;
 import android.graphics.drawable.Drawable;
@@ -67,9 +68,9 @@
     @UnsupportedAppUsage
     private Drawable mButtonDrawable;
     private ColorStateList mButtonTintList = null;
-    private PorterDuff.Mode mButtonTintMode = null;
+    private BlendMode mButtonBlendMode = null;
     private boolean mHasButtonTint = false;
-    private boolean mHasButtonTintMode = false;
+    private boolean mHasButtonBlendMode = false;
 
     @UnsupportedAppUsage
     private OnCheckedChangeListener mOnCheckedChangeListener;
@@ -109,9 +110,9 @@
         }
 
         if (a.hasValue(R.styleable.CompoundButton_buttonTintMode)) {
-            mButtonTintMode = Drawable.parseTintMode(a.getInt(
-                    R.styleable.CompoundButton_buttonTintMode, -1), mButtonTintMode);
-            mHasButtonTintMode = true;
+            mButtonBlendMode = Drawable.parseBlendMode(a.getInt(
+                    R.styleable.CompoundButton_buttonTintMode, -1), mButtonBlendMode);
+            mHasButtonBlendMode = true;
         }
 
         if (a.hasValue(R.styleable.CompoundButton_buttonTint)) {
@@ -337,8 +338,23 @@
      * @see Drawable#setTintMode(PorterDuff.Mode)
      */
     public void setButtonTintMode(@Nullable PorterDuff.Mode tintMode) {
-        mButtonTintMode = tintMode;
-        mHasButtonTintMode = true;
+        setButtonTintBlendMode(tintMode != null ? BlendMode.fromValue(tintMode.nativeInt) : null);
+    }
+
+    /**
+     * Specifies the blending mode used to apply the tint specified by
+     * {@link #setButtonTintList(ColorStateList)}} to the button drawable. The
+     * default mode is {@link PorterDuff.Mode#SRC_IN}.
+     *
+     * @param tintMode the blending mode used to apply the tint, may be
+     *                 {@code null} to clear tint
+     * @attr ref android.R.styleable#CompoundButton_buttonTintMode
+     * @see #getButtonTintMode()
+     * @see Drawable#setTintBlendMode(BlendMode)
+     */
+    public void setButtonTintBlendMode(@Nullable BlendMode tintMode) {
+        mButtonBlendMode = tintMode;
+        mHasButtonBlendMode = true;
 
         applyButtonTint();
     }
@@ -348,22 +364,35 @@
      * @attr ref android.R.styleable#CompoundButton_buttonTintMode
      * @see #setButtonTintMode(PorterDuff.Mode)
      */
-    @InspectableProperty
+    @InspectableProperty(name = "buttonTintMode")
     @Nullable
     public PorterDuff.Mode getButtonTintMode() {
-        return mButtonTintMode;
+        return mButtonBlendMode != null ? BlendMode.blendModeToPorterDuffMode(mButtonBlendMode) :
+                null;
+    }
+
+    /**
+     * @return the blending mode used to apply the tint to the button drawable
+     * @attr ref android.R.styleable#CompoundButton_buttonTintMode
+     * @see #setButtonTintBlendMode(BlendMode)
+     */
+    @InspectableProperty(name = "buttonBlendMode",
+            attributeId = R.styleable.CompoundButton_buttonTintMode)
+    @Nullable
+    public BlendMode getButtonTintBlendMode() {
+        return mButtonBlendMode;
     }
 
     private void applyButtonTint() {
-        if (mButtonDrawable != null && (mHasButtonTint || mHasButtonTintMode)) {
+        if (mButtonDrawable != null && (mHasButtonTint || mHasButtonBlendMode)) {
             mButtonDrawable = mButtonDrawable.mutate();
 
             if (mHasButtonTint) {
                 mButtonDrawable.setTintList(mButtonTintList);
             }
 
-            if (mHasButtonTintMode) {
-                mButtonDrawable.setTintMode(mButtonTintMode);
+            if (mHasButtonBlendMode) {
+                mButtonDrawable.setTintBlendMode(mButtonBlendMode);
             }
 
             // The drawable (or one of its children) may not have been
diff --git a/core/java/android/widget/ImageView.java b/core/java/android/widget/ImageView.java
index 9ae62ef..be5d221 100644
--- a/core/java/android/widget/ImageView.java
+++ b/core/java/android/widget/ImageView.java
@@ -27,6 +27,7 @@
 import android.content.res.Resources;
 import android.content.res.TypedArray;
 import android.graphics.Bitmap;
+import android.graphics.BlendMode;
 import android.graphics.Canvas;
 import android.graphics.ColorFilter;
 import android.graphics.ImageDecoder;
@@ -127,9 +128,9 @@
     @UnsupportedAppUsage
     private BitmapDrawable mRecycleableBitmapDrawable = null;
     private ColorStateList mDrawableTintList = null;
-    private PorterDuff.Mode mDrawableTintMode = null;
+    private BlendMode mDrawableBlendMode = null;
     private boolean mHasDrawableTint = false;
-    private boolean mHasDrawableTintMode = false;
+    private boolean mHasDrawableBlendMode = false;
 
     private int[] mState = null;
     private boolean mMergeState = false;
@@ -226,14 +227,14 @@
 
             // Prior to L, this attribute would always set a color filter with
             // blending mode SRC_ATOP. Preserve that default behavior.
-            mDrawableTintMode = PorterDuff.Mode.SRC_ATOP;
-            mHasDrawableTintMode = true;
+            mDrawableBlendMode = BlendMode.SRC_ATOP;
+            mHasDrawableBlendMode = true;
         }
 
         if (a.hasValue(R.styleable.ImageView_tintMode)) {
-            mDrawableTintMode = Drawable.parseTintMode(a.getInt(
-                    R.styleable.ImageView_tintMode, -1), mDrawableTintMode);
-            mHasDrawableTintMode = true;
+            mDrawableBlendMode = Drawable.parseBlendMode(a.getInt(
+                    R.styleable.ImageView_tintMode, -1), mDrawableBlendMode);
+            mHasDrawableBlendMode = true;
         }
 
         applyImageTint();
@@ -674,8 +675,23 @@
      * @see Drawable#setTintMode(PorterDuff.Mode)
      */
     public void setImageTintMode(@Nullable PorterDuff.Mode tintMode) {
-        mDrawableTintMode = tintMode;
-        mHasDrawableTintMode = true;
+        setImageTintBlendMode(tintMode != null ? BlendMode.fromValue(tintMode.nativeInt) : null);
+    }
+
+    /**
+     * Specifies the blending mode used to apply the tint specified by
+     * {@link #setImageTintList(ColorStateList)}} to the image drawable. The default
+     * mode is {@link BlendMode#SRC_IN}.
+     *
+     * @param blendMode the blending mode used to apply the tint, may be
+     *                 {@code null} to clear tint
+     * @attr ref android.R.styleable#ImageView_tintMode
+     * @see #getImageTintMode()
+     * @see Drawable#setTintBlendMode(BlendMode)
+     */
+    public void setImageTintBlendMode(@Nullable BlendMode blendMode) {
+        mDrawableBlendMode = blendMode;
+        mHasDrawableBlendMode = true;
 
         applyImageTint();
     }
@@ -689,19 +705,32 @@
     @Nullable
     @InspectableProperty(name = "tintMode")
     public PorterDuff.Mode getImageTintMode() {
-        return mDrawableTintMode;
+        return mDrawableBlendMode != null
+                ? BlendMode.blendModeToPorterDuffMode(mDrawableBlendMode) : null;
+    }
+
+    /**
+     * Gets the blending mode used to apply the tint to the image Drawable
+     * @return the blending mode used to apply the tint to the image Drawable
+     * @attr ref android.R.styleable#ImageView_tintMode
+     * @see #setImageTintBlendMode(BlendMode)
+     */
+    @Nullable
+    @InspectableProperty(name = "blendMode", attributeId = android.R.styleable.ImageView_tintMode)
+    public BlendMode getImageTintBlendMode() {
+        return mDrawableBlendMode;
     }
 
     private void applyImageTint() {
-        if (mDrawable != null && (mHasDrawableTint || mHasDrawableTintMode)) {
+        if (mDrawable != null && (mHasDrawableTint || mHasDrawableBlendMode)) {
             mDrawable = mDrawable.mutate();
 
             if (mHasDrawableTint) {
                 mDrawable.setTintList(mDrawableTintList);
             }
 
-            if (mHasDrawableTintMode) {
-                mDrawable.setTintMode(mDrawableTintMode);
+            if (mHasDrawableBlendMode) {
+                mDrawable.setTintBlendMode(mDrawableBlendMode);
             }
 
             // The drawable (or one of its children) may not have been
diff --git a/core/java/android/widget/ProgressBar.java b/core/java/android/widget/ProgressBar.java
index 0b433b1..2e95743 100644
--- a/core/java/android/widget/ProgressBar.java
+++ b/core/java/android/widget/ProgressBar.java
@@ -25,6 +25,7 @@
 import android.content.Context;
 import android.content.res.ColorStateList;
 import android.content.res.TypedArray;
+import android.graphics.BlendMode;
 import android.graphics.Canvas;
 import android.graphics.PorterDuff;
 import android.graphics.Rect;
@@ -334,7 +335,7 @@
             if (mProgressTintInfo == null) {
                 mProgressTintInfo = new ProgressTintInfo();
             }
-            mProgressTintInfo.mProgressTintMode = Drawable.parseTintMode(a.getInt(
+            mProgressTintInfo.mProgressBlendMode = Drawable.parseBlendMode(a.getInt(
                     R.styleable.ProgressBar_progressTintMode, -1), null);
             mProgressTintInfo.mHasProgressTintMode = true;
         }
@@ -352,7 +353,7 @@
             if (mProgressTintInfo == null) {
                 mProgressTintInfo = new ProgressTintInfo();
             }
-            mProgressTintInfo.mProgressBackgroundTintMode = Drawable.parseTintMode(a.getInt(
+            mProgressTintInfo.mProgressBackgroundBlendMode = Drawable.parseBlendMode(a.getInt(
                     R.styleable.ProgressBar_progressBackgroundTintMode, -1), null);
             mProgressTintInfo.mHasProgressBackgroundTintMode = true;
         }
@@ -370,7 +371,7 @@
             if (mProgressTintInfo == null) {
                 mProgressTintInfo = new ProgressTintInfo();
             }
-            mProgressTintInfo.mSecondaryProgressTintMode = Drawable.parseTintMode(
+            mProgressTintInfo.mSecondaryProgressBlendMode = Drawable.parseBlendMode(
                     a.getInt(R.styleable.ProgressBar_secondaryProgressTintMode, -1), null);
             mProgressTintInfo.mHasSecondaryProgressTintMode = true;
         }
@@ -388,7 +389,7 @@
             if (mProgressTintInfo == null) {
                 mProgressTintInfo = new ProgressTintInfo();
             }
-            mProgressTintInfo.mIndeterminateTintMode = Drawable.parseTintMode(a.getInt(
+            mProgressTintInfo.mIndeterminateBlendMode = Drawable.parseBlendMode(a.getInt(
                     R.styleable.ProgressBar_indeterminateTintMode, -1), null);
             mProgressTintInfo.mHasIndeterminateTintMode = true;
         }
@@ -796,12 +797,29 @@
      * @attr ref android.R.styleable#ProgressBar_indeterminateTintMode
      * @see #setIndeterminateTintList(ColorStateList)
      * @see Drawable#setTintMode(PorterDuff.Mode)
+     *
      */
     public void setIndeterminateTintMode(@Nullable PorterDuff.Mode tintMode) {
+        setIndeterminateTintBlendMode(tintMode != null
+                ? BlendMode.fromValue(tintMode.nativeInt) : null);
+    }
+
+    /**
+     * Specifies the blending mode used to apply the tint specified by
+     * {@link #setIndeterminateTintList(ColorStateList)} to the indeterminate
+     * drawable. The default mode is {@link PorterDuff.Mode#SRC_IN}.
+     *
+     * @param blendMode the blending mode used to apply the tint, may be
+     *                 {@code null} to clear tint
+     * @attr ref android.R.styleable#ProgressBar_indeterminateTintMode
+     * @see #setIndeterminateTintList(ColorStateList)
+     * @see Drawable#setTintBlendMode(BlendMode)
+     */
+    public void setIndeterminateTintBlendMode(@Nullable BlendMode blendMode) {
         if (mProgressTintInfo == null) {
             mProgressTintInfo = new ProgressTintInfo();
         }
-        mProgressTintInfo.mIndeterminateTintMode = tintMode;
+        mProgressTintInfo.mIndeterminateBlendMode = blendMode;
         mProgressTintInfo.mHasIndeterminateTintMode = true;
 
         applyIndeterminateTint();
@@ -819,7 +837,23 @@
     @InspectableProperty
     @Nullable
     public PorterDuff.Mode getIndeterminateTintMode() {
-        return mProgressTintInfo != null ? mProgressTintInfo.mIndeterminateTintMode : null;
+        BlendMode mode = getIndeterminateTintBlendMode();
+        return mode != null ? BlendMode.blendModeToPorterDuffMode(mode) : null;
+    }
+
+    /**
+     * Returns the blending mode used to apply the tint to the indeterminate
+     * drawable, if specified.
+     *
+     * @return the blending mode used to apply the tint to the indeterminate
+     *         drawable
+     * @attr ref android.R.styleable#ProgressBar_indeterminateTintMode
+     * @see #setIndeterminateTintBlendMode(BlendMode)
+     */
+    @InspectableProperty(attributeId = R.styleable.ProgressBar_indeterminateTintMode)
+    @Nullable
+    public BlendMode getIndeterminateTintBlendMode() {
+        return mProgressTintInfo != null ? mProgressTintInfo.mIndeterminateBlendMode : null;
     }
 
     private void applyIndeterminateTint() {
@@ -833,7 +867,7 @@
                 }
 
                 if (tintInfo.mHasIndeterminateTintMode) {
-                    mIndeterminateDrawable.setTintMode(tintInfo.mIndeterminateTintMode);
+                    mIndeterminateDrawable.setTintBlendMode(tintInfo.mIndeterminateBlendMode);
                 }
 
                 // The drawable (or one of its children) may not have been
@@ -956,7 +990,7 @@
                     target.setTintList(mProgressTintInfo.mProgressTintList);
                 }
                 if (mProgressTintInfo.mHasProgressTintMode) {
-                    target.setTintMode(mProgressTintInfo.mProgressTintMode);
+                    target.setTintBlendMode(mProgressTintInfo.mProgressBlendMode);
                 }
 
                 // The drawable (or one of its children) may not have been
@@ -981,7 +1015,7 @@
                     target.setTintList(mProgressTintInfo.mProgressBackgroundTintList);
                 }
                 if (mProgressTintInfo.mHasProgressBackgroundTintMode) {
-                    target.setTintMode(mProgressTintInfo.mProgressBackgroundTintMode);
+                    target.setTintBlendMode(mProgressTintInfo.mProgressBackgroundBlendMode);
                 }
 
                 // The drawable (or one of its children) may not have been
@@ -1006,7 +1040,7 @@
                     target.setTintList(mProgressTintInfo.mSecondaryProgressTintList);
                 }
                 if (mProgressTintInfo.mHasSecondaryProgressTintMode) {
-                    target.setTintMode(mProgressTintInfo.mSecondaryProgressTintMode);
+                    target.setTintBlendMode(mProgressTintInfo.mSecondaryProgressBlendMode);
                 }
 
                 // The drawable (or one of its children) may not have been
@@ -1076,10 +1110,25 @@
      * @see Drawable#setTintMode(PorterDuff.Mode)
      */
     public void setProgressTintMode(@Nullable PorterDuff.Mode tintMode) {
+        setProgressTintBlendMode(tintMode != null ? BlendMode.fromValue(tintMode.nativeInt) : null);
+    }
+
+    /**
+     * Specifies the blending mode used to apply the tint specified by
+     * {@link #setProgressTintList(ColorStateList)}} to the progress
+     * indicator. The default mode is {@link PorterDuff.Mode#SRC_IN}.
+     *
+     * @param blendMode the blending mode used to apply the tint, may be
+     *                 {@code null} to clear tint
+     * @attr ref android.R.styleable#ProgressBar_progressTintMode
+     * @see #getProgressTintMode()
+     * @see Drawable#setTintBlendMode(BlendMode)
+     */
+    public void setProgressTintBlendMode(@Nullable BlendMode blendMode) {
         if (mProgressTintInfo == null) {
             mProgressTintInfo = new ProgressTintInfo();
         }
-        mProgressTintInfo.mProgressTintMode = tintMode;
+        mProgressTintInfo.mProgressBlendMode = blendMode;
         mProgressTintInfo.mHasProgressTintMode = true;
 
         if (mProgressDrawable != null) {
@@ -1099,7 +1148,23 @@
     @InspectableProperty
     @Nullable
     public PorterDuff.Mode getProgressTintMode() {
-        return mProgressTintInfo != null ? mProgressTintInfo.mProgressTintMode : null;
+        BlendMode mode = getProgressTintBlendMode();
+        return mode != null ? BlendMode.blendModeToPorterDuffMode(mode) : null;
+    }
+
+    /**
+     * Returns the blending mode used to apply the tint to the progress
+     * drawable, if specified.
+     *
+     * @return the blending mode used to apply the tint to the progress
+     *         drawable
+     * @attr ref android.R.styleable#ProgressBar_progressTintMode
+     * @see #setProgressTintBlendMode(BlendMode)
+     */
+    @InspectableProperty(attributeId = android.R.styleable.ProgressBar_progressTintMode)
+    @Nullable
+    public BlendMode getProgressTintBlendMode() {
+        return mProgressTintInfo != null ? mProgressTintInfo.mProgressBlendMode : null;
     }
 
     /**
@@ -1160,10 +1225,26 @@
      * @see Drawable#setTintMode(PorterDuff.Mode)
      */
     public void setProgressBackgroundTintMode(@Nullable PorterDuff.Mode tintMode) {
+        setProgressBackgroundTintBlendMode(tintMode != null
+                ? BlendMode.fromValue(tintMode.nativeInt) : null);
+    }
+
+    /**
+     * Specifies the blending mode used to apply the tint specified by
+     * {@link #setProgressBackgroundTintList(ColorStateList)}} to the progress
+     * background. The default mode is {@link BlendMode#SRC_IN}.
+     *
+     * @param blendMode the blending mode used to apply the tint, may be
+     *                 {@code null} to clear tint
+     * @attr ref android.R.styleable#ProgressBar_progressBackgroundTintMode
+     * @see #setProgressBackgroundTintList(ColorStateList)
+     * @see Drawable#setTintBlendMode(BlendMode)
+     */
+    public void setProgressBackgroundTintBlendMode(@Nullable BlendMode blendMode) {
         if (mProgressTintInfo == null) {
             mProgressTintInfo = new ProgressTintInfo();
         }
-        mProgressTintInfo.mProgressBackgroundTintMode = tintMode;
+        mProgressTintInfo.mProgressBackgroundBlendMode = blendMode;
         mProgressTintInfo.mHasProgressBackgroundTintMode = true;
 
         if (mProgressDrawable != null) {
@@ -1180,7 +1261,20 @@
     @InspectableProperty
     @Nullable
     public PorterDuff.Mode getProgressBackgroundTintMode() {
-        return mProgressTintInfo != null ? mProgressTintInfo.mProgressBackgroundTintMode : null;
+        BlendMode mode = getProgressBackgroundTintBlendMode();
+        return mode != null ? BlendMode.blendModeToPorterDuffMode(mode) : null;
+    }
+
+    /**
+     * @return the blending mode used to apply the tint to the progress
+     *         background
+     * @attr ref android.R.styleable#ProgressBar_progressBackgroundTintMode
+     * @see #setProgressBackgroundTintBlendMode(BlendMode)
+     */
+    @InspectableProperty(attributeId = R.styleable.ProgressBar_progressBackgroundTintMode)
+    @Nullable
+    public BlendMode getProgressBackgroundTintBlendMode() {
+        return mProgressTintInfo != null ? mProgressTintInfo.mProgressBackgroundBlendMode : null;
     }
 
     /**
@@ -1242,10 +1336,27 @@
      * @see Drawable#setTintMode(PorterDuff.Mode)
      */
     public void setSecondaryProgressTintMode(@Nullable PorterDuff.Mode tintMode) {
+        setSecondaryProgressTintBlendMode(tintMode != null
+                ? BlendMode.fromValue(tintMode.nativeInt) : null);
+    }
+
+    /**
+     * Specifies the blending mode used to apply the tint specified by
+     * {@link #setSecondaryProgressTintList(ColorStateList)}} to the secondary
+     * progress indicator. The default mode is
+     * {@link PorterDuff.Mode#SRC_ATOP}.
+     *
+     * @param blendMode the blending mode used to apply the tint, may be
+     *                 {@code null} to clear tint
+     * @attr ref android.R.styleable#ProgressBar_secondaryProgressTintMode
+     * @see #setSecondaryProgressTintList(ColorStateList)
+     * @see Drawable#setTintBlendMode(BlendMode)
+     */
+    public void setSecondaryProgressTintBlendMode(@Nullable BlendMode blendMode) {
         if (mProgressTintInfo == null) {
             mProgressTintInfo = new ProgressTintInfo();
         }
-        mProgressTintInfo.mSecondaryProgressTintMode = tintMode;
+        mProgressTintInfo.mSecondaryProgressBlendMode = blendMode;
         mProgressTintInfo.mHasSecondaryProgressTintMode = true;
 
         if (mProgressDrawable != null) {
@@ -1265,7 +1376,23 @@
     @InspectableProperty
     @Nullable
     public PorterDuff.Mode getSecondaryProgressTintMode() {
-        return mProgressTintInfo != null ? mProgressTintInfo.mSecondaryProgressTintMode : null;
+        BlendMode mode = getSecondaryProgressTintBlendMode();
+        return mode != null ? BlendMode.blendModeToPorterDuffMode(mode) : null;
+    }
+
+        /**
+     * Returns the blending mode used to apply the tint to the secondary
+     * progress drawable, if specified.
+     *
+     * @return the blending mode used to apply the tint to the secondary
+     *         progress drawable
+     * @attr ref android.R.styleable#ProgressBar_secondaryProgressTintMode
+     * @see #setSecondaryProgressTintBlendMode(BlendMode)
+     */
+    @InspectableProperty(attributeId = android.R.styleable.ProgressBar_secondaryProgressTintMode)
+    @Nullable
+    public BlendMode getSecondaryProgressTintBlendMode() {
+        return mProgressTintInfo != null ? mProgressTintInfo.mSecondaryProgressBlendMode : null;
     }
 
     /**
@@ -2208,22 +2335,22 @@
 
     private static class ProgressTintInfo {
         ColorStateList mIndeterminateTintList;
-        PorterDuff.Mode mIndeterminateTintMode;
+        BlendMode mIndeterminateBlendMode;
         boolean mHasIndeterminateTint;
         boolean mHasIndeterminateTintMode;
 
         ColorStateList mProgressTintList;
-        PorterDuff.Mode mProgressTintMode;
+        BlendMode mProgressBlendMode;
         boolean mHasProgressTint;
         boolean mHasProgressTintMode;
 
         ColorStateList mProgressBackgroundTintList;
-        PorterDuff.Mode mProgressBackgroundTintMode;
+        BlendMode mProgressBackgroundBlendMode;
         boolean mHasProgressBackgroundTint;
         boolean mHasProgressBackgroundTintMode;
 
         ColorStateList mSecondaryProgressTintList;
-        PorterDuff.Mode mSecondaryProgressTintMode;
+        BlendMode mSecondaryProgressBlendMode;
         boolean mHasSecondaryProgressTint;
         boolean mHasSecondaryProgressTintMode;
     }
diff --git a/core/java/android/widget/Switch.java b/core/java/android/widget/Switch.java
index ea9cd42..d57b3bc 100644
--- a/core/java/android/widget/Switch.java
+++ b/core/java/android/widget/Switch.java
@@ -26,6 +26,7 @@
 import android.content.res.ColorStateList;
 import android.content.res.Resources;
 import android.content.res.TypedArray;
+import android.graphics.BlendMode;
 import android.graphics.Canvas;
 import android.graphics.Insets;
 import android.graphics.Paint;
@@ -98,14 +99,14 @@
     @UnsupportedAppUsage
     private Drawable mThumbDrawable;
     private ColorStateList mThumbTintList = null;
-    private PorterDuff.Mode mThumbTintMode = null;
+    private BlendMode mThumbBlendMode = null;
     private boolean mHasThumbTint = false;
     private boolean mHasThumbTintMode = false;
 
     @UnsupportedAppUsage
     private Drawable mTrackDrawable;
     private ColorStateList mTrackTintList = null;
-    private PorterDuff.Mode mTrackTintMode = null;
+    private BlendMode mTrackBlendMode = null;
     private boolean mHasTrackTint = false;
     private boolean mHasTrackTintMode = false;
 
@@ -268,10 +269,11 @@
             mThumbTintList = thumbTintList;
             mHasThumbTint = true;
         }
-        PorterDuff.Mode thumbTintMode = Drawable.parseTintMode(
-                a.getInt(com.android.internal.R.styleable.Switch_thumbTintMode, -1), null);
-        if (mThumbTintMode != thumbTintMode) {
-            mThumbTintMode = thumbTintMode;
+        BlendMode thumbTintMode = Drawable.parseBlendMode(
+                a.getInt(com.android.internal.R.styleable.Switch_thumbTintMode, -1),
+                null);
+        if (mThumbBlendMode != thumbTintMode) {
+            mThumbBlendMode = thumbTintMode;
             mHasThumbTintMode = true;
         }
         if (mHasThumbTint || mHasThumbTintMode) {
@@ -284,10 +286,11 @@
             mTrackTintList = trackTintList;
             mHasTrackTint = true;
         }
-        PorterDuff.Mode trackTintMode = Drawable.parseTintMode(
-                a.getInt(com.android.internal.R.styleable.Switch_trackTintMode, -1), null);
-        if (mTrackTintMode != trackTintMode) {
-            mTrackTintMode = trackTintMode;
+        BlendMode trackTintMode = Drawable.parseBlendMode(
+                a.getInt(com.android.internal.R.styleable.Switch_trackTintMode, -1),
+                null);
+        if (mTrackBlendMode != trackTintMode) {
+            mTrackBlendMode = trackTintMode;
             mHasTrackTintMode = true;
         }
         if (mHasTrackTint || mHasTrackTintMode) {
@@ -587,7 +590,22 @@
      * @see Drawable#setTintMode(PorterDuff.Mode)
      */
     public void setTrackTintMode(@Nullable PorterDuff.Mode tintMode) {
-        mTrackTintMode = tintMode;
+        setTrackTintBlendMode(tintMode != null ? BlendMode.fromValue(tintMode.nativeInt) : null);
+    }
+
+    /**
+     * Specifies the blending mode used to apply the tint specified by
+     * {@link #setTrackTintList(ColorStateList)}} to the track drawable.
+     * The default mode is {@link BlendMode#SRC_IN}.
+     *
+     * @param blendMode the blending mode used to apply the tint, may be
+     *                 {@code null} to clear tint
+     * @attr ref android.R.styleable#Switch_trackTintMode
+     * @see #getTrackTintMode()
+     * @see Drawable#setTintBlendMode(BlendMode)
+     */
+    public void setTrackTintBlendMode(@Nullable BlendMode blendMode) {
+        mTrackBlendMode = blendMode;
         mHasTrackTintMode = true;
 
         applyTrackTint();
@@ -602,7 +620,20 @@
     @InspectableProperty
     @Nullable
     public PorterDuff.Mode getTrackTintMode() {
-        return mTrackTintMode;
+        BlendMode mode = getTrackTintBlendMode();
+        return mode != null ? BlendMode.blendModeToPorterDuffMode(mode) : null;
+    }
+
+    /**
+     * @return the blending mode used to apply the tint to the track
+     *         drawable
+     * @attr ref android.R.styleable#Switch_trackTintMode
+     * @see #setTrackTintBlendMode(BlendMode)
+     */
+    @InspectableProperty(attributeId = com.android.internal.R.styleable.Switch_trackTintMode)
+    @Nullable
+    public BlendMode getTrackTintBlendMode() {
+        return mTrackBlendMode;
     }
 
     private void applyTrackTint() {
@@ -614,7 +645,7 @@
             }
 
             if (mHasTrackTintMode) {
-                mTrackDrawable.setTintMode(mTrackTintMode);
+                mTrackDrawable.setTintBlendMode(mTrackBlendMode);
             }
 
             // The drawable (or one of its children) may not have been
@@ -713,7 +744,22 @@
      * @see Drawable#setTintMode(PorterDuff.Mode)
      */
     public void setThumbTintMode(@Nullable PorterDuff.Mode tintMode) {
-        mThumbTintMode = tintMode;
+        setThumbTintBlendMode(tintMode != null ? BlendMode.fromValue(tintMode.nativeInt) : null);
+    }
+
+    /**
+     * Specifies the blending mode used to apply the tint specified by
+     * {@link #setThumbTintList(ColorStateList)}} to the thumb drawable.
+     * The default mode is {@link PorterDuff.Mode#SRC_IN}.
+     *
+     * @param blendMode the blending mode used to apply the tint, may be
+     *                 {@code null} to clear tint
+     * @attr ref android.R.styleable#Switch_thumbTintMode
+     * @see #getThumbTintMode()
+     * @see Drawable#setTintBlendMode(BlendMode)
+     */
+    public void setThumbTintBlendMode(@Nullable BlendMode blendMode) {
+        mThumbBlendMode = blendMode;
         mHasThumbTintMode = true;
 
         applyThumbTint();
@@ -728,7 +774,20 @@
     @InspectableProperty
     @Nullable
     public PorterDuff.Mode getThumbTintMode() {
-        return mThumbTintMode;
+        BlendMode mode = getThumbTintBlendMode();
+        return mode != null ? BlendMode.blendModeToPorterDuffMode(mode) : null;
+    }
+
+    /**
+     * @return the blending mode used to apply the tint to the thumb
+     *         drawable
+     * @attr ref android.R.styleable#Switch_thumbTintMode
+     * @see #setThumbTintBlendMode(BlendMode)
+     */
+    @InspectableProperty(attributeId = com.android.internal.R.styleable.Switch_thumbTintMode)
+    @Nullable
+    public BlendMode getThumbTintBlendMode() {
+        return mThumbBlendMode;
     }
 
     private void applyThumbTint() {
@@ -740,7 +799,7 @@
             }
 
             if (mHasThumbTintMode) {
-                mThumbDrawable.setTintMode(mThumbTintMode);
+                mThumbDrawable.setTintBlendMode(mThumbBlendMode);
             }
 
             // The drawable (or one of its children) may not have been
diff --git a/core/java/android/widget/TextView.java b/core/java/android/widget/TextView.java
index 618b05f..17c56c3 100644
--- a/core/java/android/widget/TextView.java
+++ b/core/java/android/widget/TextView.java
@@ -55,6 +55,7 @@
 import android.content.res.TypedArray;
 import android.content.res.XmlResourceParser;
 import android.graphics.BaseCanvas;
+import android.graphics.BlendMode;
 import android.graphics.Canvas;
 import android.graphics.Insets;
 import android.graphics.Paint;
@@ -489,7 +490,7 @@
         final Drawable[] mShowing = new Drawable[4];
 
         ColorStateList mTintList;
-        PorterDuff.Mode mTintMode;
+        BlendMode mBlendMode;
         boolean mHasTint;
         boolean mHasTintMode;
 
@@ -1036,7 +1037,7 @@
         Drawable drawableLeft = null, drawableTop = null, drawableRight = null,
                 drawableBottom = null, drawableStart = null, drawableEnd = null;
         ColorStateList drawableTint = null;
-        PorterDuff.Mode drawableTintMode = null;
+        BlendMode drawableTintMode = null;
         int drawablePadding = 0;
         int ellipsize = ELLIPSIZE_NOT_SET;
         boolean singleLine = false;
@@ -1139,7 +1140,8 @@
                     break;
 
                 case com.android.internal.R.styleable.TextView_drawableTintMode:
-                    drawableTintMode = Drawable.parseTintMode(a.getInt(attr, -1), drawableTintMode);
+                    drawableTintMode = Drawable.parseBlendMode(a.getInt(attr, -1),
+                            drawableTintMode);
                     break;
 
                 case com.android.internal.R.styleable.TextView_drawablePadding:
@@ -1543,7 +1545,7 @@
                 mDrawables.mHasTint = true;
             }
             if (drawableTintMode != null) {
-                mDrawables.mTintMode = drawableTintMode;
+                mDrawables.mBlendMode = drawableTintMode;
                 mDrawables.mHasTintMode = true;
             }
         }
@@ -3299,10 +3301,26 @@
      * @see Drawable#setTintMode(PorterDuff.Mode)
      */
     public void setCompoundDrawableTintMode(@Nullable PorterDuff.Mode tintMode) {
+        setCompoundDrawableTintBlendMode(tintMode != null
+                ? BlendMode.fromValue(tintMode.nativeInt) : null);
+    }
+
+    /**
+     * Specifies the blending mode used to apply the tint specified by
+     * {@link #setCompoundDrawableTintList(ColorStateList)} to the compound
+     * drawables. The default mode is {@link PorterDuff.Mode#SRC_IN}.
+     *
+     * @param blendMode the blending mode used to apply the tint, may be
+     *                 {@code null} to clear tint
+     * @attr ref android.R.styleable#TextView_drawableTintMode
+     * @see #setCompoundDrawableTintList(ColorStateList)
+     * @see Drawable#setTintBlendMode(BlendMode)
+     */
+    public void setCompoundDrawableTintBlendMode(@Nullable BlendMode blendMode) {
         if (mDrawables == null) {
             mDrawables = new Drawables(getContext());
         }
-        mDrawables.mTintMode = tintMode;
+        mDrawables.mBlendMode = blendMode;
         mDrawables.mHasTintMode = true;
 
         applyCompoundDrawableTint();
@@ -3316,10 +3334,27 @@
      *         drawables
      * @attr ref android.R.styleable#TextView_drawableTintMode
      * @see #setCompoundDrawableTintMode(PorterDuff.Mode)
+     *
      */
     @InspectableProperty(name = "drawableTintMode")
     public PorterDuff.Mode getCompoundDrawableTintMode() {
-        return mDrawables != null ? mDrawables.mTintMode : null;
+        BlendMode mode = getCompoundDrawableTintBlendMode();
+        return mode != null ? BlendMode.blendModeToPorterDuffMode(mode) : null;
+    }
+
+    /**
+     * Returns the blending mode used to apply the tint to the compound
+     * drawables, if specified.
+     *
+     * @return the blending mode used to apply the tint to the compound
+     *         drawables
+     * @attr ref android.R.styleable#TextView_drawableTintMode
+     * @see #setCompoundDrawableTintBlendMode(BlendMode)
+     */
+    @InspectableProperty(name = "drawableBlendMode",
+            attributeId = com.android.internal.R.styleable.TextView_drawableTintMode)
+    public @Nullable BlendMode getCompoundDrawableTintBlendMode() {
+        return mDrawables != null ? mDrawables.mBlendMode : null;
     }
 
     private void applyCompoundDrawableTint() {
@@ -3329,7 +3364,7 @@
 
         if (mDrawables.mHasTint || mDrawables.mHasTintMode) {
             final ColorStateList tintList = mDrawables.mTintList;
-            final PorterDuff.Mode tintMode = mDrawables.mTintMode;
+            final BlendMode blendMode = mDrawables.mBlendMode;
             final boolean hasTint = mDrawables.mHasTint;
             final boolean hasTintMode = mDrawables.mHasTintMode;
             final int[] state = getDrawableState();
@@ -3353,7 +3388,7 @@
                 }
 
                 if (hasTintMode) {
-                    dr.setTintMode(tintMode);
+                    dr.setTintBlendMode(blendMode);
                 }
 
                 // The drawable (or one of its children) may not have been
diff --git a/core/java/com/android/internal/infra/AbstractMultiplePendingRequestsRemoteService.java b/core/java/com/android/internal/infra/AbstractMultiplePendingRequestsRemoteService.java
index c3aa847..f1398bf 100644
--- a/core/java/com/android/internal/infra/AbstractMultiplePendingRequestsRemoteService.java
+++ b/core/java/com/android/internal/infra/AbstractMultiplePendingRequestsRemoteService.java
@@ -75,6 +75,20 @@
     }
 
     @Override // from AbstractRemoteService
+    final void handleBindFailure() {
+        if (mPendingRequests != null) {
+            final int size = mPendingRequests.size();
+            if (mVerbose) Slog.v(mTag, "Sending failure to " + size + " pending requests");
+            for (int i = 0; i < size; i++) {
+                final BasePendingRequest<S, I> request = mPendingRequests.get(i);
+                request.onFailed();
+                request.finish();
+            }
+            mPendingRequests = null;
+        }
+    }
+
+    @Override // from AbstractRemoteService
     public void dump(@NonNull String prefix, @NonNull PrintWriter pw) {
         super.dump(prefix, pw);
 
diff --git a/core/java/com/android/internal/infra/AbstractRemoteService.java b/core/java/com/android/internal/infra/AbstractRemoteService.java
index 65a63a0..64f8857 100644
--- a/core/java/com/android/internal/infra/AbstractRemoteService.java
+++ b/core/java/com/android/internal/infra/AbstractRemoteService.java
@@ -405,6 +405,11 @@
     abstract void handlePendingRequestWhileUnBound(
             @NonNull BasePendingRequest<S, I> pendingRequest);
 
+    /**
+     * Called if {@link Context#bindServiceAsUser} returns {@code false}.
+     */
+    abstract void handleBindFailure();
+
     private boolean handleIsBound() {
         return mService != null;
     }
@@ -426,6 +431,8 @@
             mBinding = false;
 
             if (!mServiceDied) {
+                // TODO(b/126266412): merge these 2 calls?
+                handleBindFailure();
                 handleBinderDied();
             }
         }
@@ -562,6 +569,12 @@
         void onFinished() { }
 
         /**
+         * Called when request fails due to reasons internal to {@link AbstractRemoteService},
+         * e.g. failure to bind to service.
+         */
+        protected void onFailed() { }
+
+        /**
          * Checks whether this request was cancelled.
          */
         @GuardedBy("mLock")
diff --git a/core/java/com/android/internal/infra/AbstractSinglePendingRequestRemoteService.java b/core/java/com/android/internal/infra/AbstractSinglePendingRequestRemoteService.java
index 66bee95..2ebf2fd 100644
--- a/core/java/com/android/internal/infra/AbstractSinglePendingRequestRemoteService.java
+++ b/core/java/com/android/internal/infra/AbstractSinglePendingRequestRemoteService.java
@@ -67,6 +67,15 @@
     }
 
     @Override // from AbstractRemoteService
+    void handleBindFailure() {
+        if (mPendingRequest != null) {
+            if (mVerbose) Slog.v(mTag, "Sending failure to " + mPendingRequest);
+            mPendingRequest.onFailed();
+            mPendingRequest = null;
+        }
+    }
+
+    @Override // from AbstractRemoteService
     public void dump(@NonNull String prefix, @NonNull PrintWriter pw) {
         super.dump(prefix, pw);
         pw.append(prefix).append("hasPendingRequest=")
diff --git a/graphics/java/android/graphics/BaseCanvas.java b/graphics/java/android/graphics/BaseCanvas.java
index c9431e3..6e7f286 100644
--- a/graphics/java/android/graphics/BaseCanvas.java
+++ b/graphics/java/android/graphics/BaseCanvas.java
@@ -243,10 +243,6 @@
         nDrawColor(mNativeCanvasWrapper, color, BlendMode.SRC_OVER.getXfermode().porterDuffMode);
     }
 
-    /**
-     * @deprecated use {@link Canvas#drawColor(int, BlendMode)}
-     */
-    @Deprecated
     public void drawColor(@ColorInt int color, @NonNull PorterDuff.Mode mode) {
         nDrawColor(mNativeCanvasWrapper, color, mode.nativeInt);
     }
diff --git a/graphics/java/android/graphics/BaseRecordingCanvas.java b/graphics/java/android/graphics/BaseRecordingCanvas.java
index 028b784..2f5214cb1 100644
--- a/graphics/java/android/graphics/BaseRecordingCanvas.java
+++ b/graphics/java/android/graphics/BaseRecordingCanvas.java
@@ -203,10 +203,6 @@
         nDrawColor(mNativeCanvasWrapper, color, BlendMode.SRC_OVER.getXfermode().porterDuffMode);
     }
 
-    /**
-     * @deprecated use {@link #drawColor(int, BlendMode)} instead
-     */
-    @Deprecated
     @Override
     public final void drawColor(@ColorInt int color, @NonNull PorterDuff.Mode mode) {
         nDrawColor(mNativeCanvasWrapper, color, mode.nativeInt);
diff --git a/graphics/java/android/graphics/Canvas.java b/graphics/java/android/graphics/Canvas.java
index 6f00fc9..d4d5ae7 100644
--- a/graphics/java/android/graphics/Canvas.java
+++ b/graphics/java/android/graphics/Canvas.java
@@ -1700,10 +1700,7 @@
      *
      * @param color the color to draw onto the canvas
      * @param mode the porter-duff mode to apply to the color
-     *
-     * @deprecated use {@link #drawColor(int, BlendMode)} instead
      */
-    @Deprecated
     public void drawColor(@ColorInt int color, @NonNull PorterDuff.Mode mode) {
         super.drawColor(color, mode);
     }
diff --git a/graphics/java/android/graphics/ComposeShader.java b/graphics/java/android/graphics/ComposeShader.java
index 93ddb10..64ee6bf 100644
--- a/graphics/java/android/graphics/ComposeShader.java
+++ b/graphics/java/android/graphics/ComposeShader.java
@@ -39,9 +39,7 @@
      * @param shaderB  The colors from this shader are seen as the "src" by the mode
      * @param mode     The mode that combines the colors from the two shaders. If mode
      *                 is null, then SRC_OVER is assumed.
-     *
-     * @deprecated use {@link #ComposeShader(Shader, Shader, BlendMode)} instead
-    */
+     */
     @Deprecated
     public ComposeShader(@NonNull Shader shaderA, @NonNull Shader shaderB, @NonNull Xfermode mode) {
         this(shaderA, shaderB, mode.porterDuffMode);
@@ -56,9 +54,7 @@
      * @param shaderB  The colors from this shader are seen as the "src" by the mode
      * @param mode     The PorterDuff mode that combines the colors from the two shaders.
      *
-     * @deprecated use {@link #ComposeShader(Shader, Shader, BlendMode)} instead
      */
-    @Deprecated
     public ComposeShader(@NonNull Shader shaderA, @NonNull Shader shaderB,
             @NonNull PorterDuff.Mode mode) {
         this(shaderA, shaderB, mode.nativeInt);
diff --git a/graphics/java/android/graphics/Paint.java b/graphics/java/android/graphics/Paint.java
index db5f065..b7316ab 100644
--- a/graphics/java/android/graphics/Paint.java
+++ b/graphics/java/android/graphics/Paint.java
@@ -1274,10 +1274,7 @@
      * Get the paint's transfer mode object.
      *
      * @return the paint's transfer mode (or null)
-     *
-     * @deprecated use {@link #getBlendMode()} instead
      */
-    @Deprecated
     public Xfermode getXfermode() {
         return mXfermode;
     }
@@ -1308,11 +1305,7 @@
      *
      * @param xfermode May be null. The xfermode to be installed in the paint
      * @return         xfermode
-     *
-     * @deprecated Use {@link #setBlendMode} to apply a Xfermode directly
-     * through usage of {@link BlendMode}
      */
-    @Deprecated
     public Xfermode setXfermode(Xfermode xfermode) {
         return installXfermode(xfermode);
     }
diff --git a/graphics/java/android/graphics/PorterDuff.java b/graphics/java/android/graphics/PorterDuff.java
index 459291b..bc1f66f 100644
--- a/graphics/java/android/graphics/PorterDuff.java
+++ b/graphics/java/android/graphics/PorterDuff.java
@@ -24,9 +24,8 @@
  * of {@link Paint}'s {@link Paint#setXfermode(Xfermode) transfer mode}.
  * All the available modes can be found in the {@link Mode} enum.</p>
  *
- * @deprecated Use {@link BlendMode} with {@link Paint#setBlendMode(BlendMode)} instead
+ * Consider using {@link BlendMode} instead as it provides a wider variety of tinting options
  */
-@Deprecated
 public class PorterDuff {
     /**
      * {@usesMathJax}
diff --git a/graphics/java/android/graphics/PorterDuffColorFilter.java b/graphics/java/android/graphics/PorterDuffColorFilter.java
index c2a8eb7..cc2d3a8 100644
--- a/graphics/java/android/graphics/PorterDuffColorFilter.java
+++ b/graphics/java/android/graphics/PorterDuffColorFilter.java
@@ -23,11 +23,7 @@
 /**
  * A color filter that can be used to tint the source pixels using a single
  * color and a specific {@link PorterDuff Porter-Duff composite mode}.
- *
- * @deprecated Consider using {@link BlendModeColorFilter} instead as it supports a wider
- * set of blend modes than those defined in {@link PorterDuff.Mode}
  */
-@Deprecated
 public class PorterDuffColorFilter extends ColorFilter {
     @ColorInt
     private int mColor;
diff --git a/graphics/java/android/graphics/PorterDuffXfermode.java b/graphics/java/android/graphics/PorterDuffXfermode.java
index 5b933c4..ff9ff8b 100644
--- a/graphics/java/android/graphics/PorterDuffXfermode.java
+++ b/graphics/java/android/graphics/PorterDuffXfermode.java
@@ -22,10 +22,6 @@
  * documentation of the {@link PorterDuff.Mode} enum for more
  * information on the available alpha compositing and blending modes.</p>
  *
- *  @deprecated Consider using {@link BlendMode} instead as it supports a wider
- * set of blend modes than those defined in {@link PorterDuff.Mode}
- *
- * @see Paint#setBlendMode(BlendMode)
  */
 public class PorterDuffXfermode extends Xfermode {
     /**
diff --git a/graphics/java/android/graphics/drawable/AdaptiveIconDrawable.java b/graphics/java/android/graphics/drawable/AdaptiveIconDrawable.java
index 7def322..fab96a1 100644
--- a/graphics/java/android/graphics/drawable/AdaptiveIconDrawable.java
+++ b/graphics/java/android/graphics/drawable/AdaptiveIconDrawable.java
@@ -701,13 +701,13 @@
     }
 
     @Override
-    public void setTintMode(@NonNull BlendMode blendMode) {
+    public void setTintBlendMode(@NonNull BlendMode blendMode) {
         final ChildDrawable[] array = mLayerState.mChildren;
         final int N = mLayerState.N_CHILDREN;
         for (int i = 0; i < N; i++) {
             final Drawable dr = array[i].mDrawable;
             if (dr != null) {
-                dr.setTintMode(blendMode);
+                dr.setTintBlendMode(blendMode);
             }
         }
     }
diff --git a/graphics/java/android/graphics/drawable/AnimatedVectorDrawable.java b/graphics/java/android/graphics/drawable/AnimatedVectorDrawable.java
index f45bf9b..66947da 100644
--- a/graphics/java/android/graphics/drawable/AnimatedVectorDrawable.java
+++ b/graphics/java/android/graphics/drawable/AnimatedVectorDrawable.java
@@ -477,8 +477,8 @@
     }
 
     @Override
-    public void setTintMode(@NonNull BlendMode blendMode) {
-        mAnimatedVectorState.mVectorDrawable.setTintMode(blendMode);
+    public void setTintBlendMode(@NonNull BlendMode blendMode) {
+        mAnimatedVectorState.mVectorDrawable.setTintBlendMode(blendMode);
     }
 
     @Override
diff --git a/graphics/java/android/graphics/drawable/BitmapDrawable.java b/graphics/java/android/graphics/drawable/BitmapDrawable.java
index 6b30158..e4aa774 100644
--- a/graphics/java/android/graphics/drawable/BitmapDrawable.java
+++ b/graphics/java/android/graphics/drawable/BitmapDrawable.java
@@ -685,7 +685,7 @@
     }
 
     @Override
-    public void setTintMode(@NonNull BlendMode blendMode) {
+    public void setTintBlendMode(@NonNull BlendMode blendMode) {
         final BitmapState state = mBitmapState;
         if (state.mBlendMode != blendMode) {
             state.mBlendMode = blendMode;
diff --git a/graphics/java/android/graphics/drawable/ColorDrawable.java b/graphics/java/android/graphics/drawable/ColorDrawable.java
index efa806a..f5fa8c5 100644
--- a/graphics/java/android/graphics/drawable/ColorDrawable.java
+++ b/graphics/java/android/graphics/drawable/ColorDrawable.java
@@ -215,7 +215,7 @@
     }
 
     @Override
-    public void setTintMode(@NonNull BlendMode blendMode) {
+    public void setTintBlendMode(@NonNull BlendMode blendMode) {
         mColorState.mBlendMode = blendMode;
         mBlendModeColorFilter = updateBlendModeFilter(mBlendModeColorFilter, mColorState.mTint,
                 blendMode);
diff --git a/graphics/java/android/graphics/drawable/ColorStateListDrawable.java b/graphics/java/android/graphics/drawable/ColorStateListDrawable.java
index b94b114..35021a6 100644
--- a/graphics/java/android/graphics/drawable/ColorStateListDrawable.java
+++ b/graphics/java/android/graphics/drawable/ColorStateListDrawable.java
@@ -114,9 +114,9 @@
     }
 
     @Override
-    public void setTintMode(@NonNull BlendMode blendMode) {
+    public void setTintBlendMode(@NonNull BlendMode blendMode) {
         mState.mBlendMode = blendMode;
-        mColorDrawable.setTintMode(blendMode);
+        mColorDrawable.setTintBlendMode(blendMode);
         onStateChange(getState());
     }
 
@@ -293,7 +293,7 @@
         }
 
         if (mState.mBlendMode != DEFAULT_BLEND_MODE) {
-            mColorDrawable.setTintMode(mState.mBlendMode);
+            mColorDrawable.setTintBlendMode(mState.mBlendMode);
         }
     }
 }
diff --git a/graphics/java/android/graphics/drawable/Drawable.java b/graphics/java/android/graphics/drawable/Drawable.java
index adc04fb..0840986 100644
--- a/graphics/java/android/graphics/drawable/Drawable.java
+++ b/graphics/java/android/graphics/drawable/Drawable.java
@@ -213,17 +213,17 @@
     protected int mSrcDensityOverride = 0;
 
     /**
-     * Flag used to break the recursive loop between setTintMode(PorterDuff.Mode) and
-     * setTintMode(BlendMode) as each default implementation invokes the other in order to
+     * Flag used to break the recursive loop between setTintBlendMode(PorterDuff.Mode) and
+     * setTintBlendMode(BlendMode) as each default implementation invokes the other in order to
      * support new use cases that utilize the new blending modes as well as support the legacy
-     * use cases. This flag tracks that {@link #setTintMode(BlendMode)} is only invoked once
+     * use cases. This flag tracks that {@link #setTintBlendMode(BlendMode)} is only invoked once
      * per invocation.
      */
     private boolean mSetBlendModeInvoked = false;
 
     /**
-     * Flag used to break the recursive loop between setTintMode(PorterDuff.Mode) and
-     * setTintMode(BlendMode) as each default implementation invokes the other in order to
+     * Flag used to break the recursive loop between setTintBlendMode(PorterDuff.Mode) and
+     * setTintBlendMode(BlendMode) as each default implementation invokes the other in order to
      * support new use cases that utilize the new blending modes as well as support the legacy
      * use cases. This flag tracks that {@link #setTintMode(Mode)} is only invoked once
      * per invocation;
@@ -651,7 +651,7 @@
      * @param tintColor Color to use for tinting this drawable
      * @see #setTintList(ColorStateList)
      * @see #setTintMode(PorterDuff.Mode)
-     * @see #setTintMode(BlendMode)
+     * @see #setTintBlendMode(BlendMode)
      */
     public void setTint(@ColorInt int tintColor) {
         setTintList(ColorStateList.valueOf(tintColor));
@@ -673,7 +673,7 @@
      *            {@code null} to clear the tint
      * @see #setTint(int)
      * @see #setTintMode(PorterDuff.Mode)
-     * @see #setTintMode(BlendMode)
+     * @see #setTintBlendMode(BlendMode)
      */
     public void setTintList(@Nullable ColorStateList tint) {}
 
@@ -693,15 +693,12 @@
      *                 of {@link PorterDuff.Mode#SRC_IN}
      * @see #setTint(int)
      * @see #setTintList(ColorStateList)
-     *
-     * @deprecated use {@link #setTintMode(BlendMode)} instead
      */
-    @Deprecated
     public void setTintMode(@Nullable PorterDuff.Mode tintMode) {
         if (!mSetTintModeInvoked) {
             mSetTintModeInvoked = true;
             BlendMode mode = tintMode != null ? BlendMode.fromValue(tintMode.nativeInt) : null;
-            setTintMode(mode != null ? mode : Drawable.DEFAULT_BLEND_MODE);
+            setTintBlendMode(mode != null ? mode : Drawable.DEFAULT_BLEND_MODE);
             mSetTintModeInvoked = false;
         }
     }
@@ -721,7 +718,7 @@
      * @see #setTint(int)
      * @see #setTintList(ColorStateList)
      */
-    public void setTintMode(@Nullable BlendMode blendMode) {
+    public void setTintBlendMode(@Nullable BlendMode blendMode) {
         if (!mSetBlendModeInvoked) {
             mSetBlendModeInvoked = true;
             PorterDuff.Mode mode = BlendMode.blendModeToPorterDuffMode(blendMode);
diff --git a/graphics/java/android/graphics/drawable/DrawableContainer.java b/graphics/java/android/graphics/drawable/DrawableContainer.java
index 3e0881a..090d915 100644
--- a/graphics/java/android/graphics/drawable/DrawableContainer.java
+++ b/graphics/java/android/graphics/drawable/DrawableContainer.java
@@ -196,14 +196,14 @@
     }
 
     @Override
-    public void setTintMode(@NonNull BlendMode blendMode) {
+    public void setTintBlendMode(@NonNull BlendMode blendMode) {
         mDrawableContainerState.mHasTintMode = true;
 
         if (mDrawableContainerState.mBlendMode != blendMode) {
             mDrawableContainerState.mBlendMode = blendMode;
 
             if (mCurrDrawable != null) {
-                mCurrDrawable.setTintMode(blendMode);
+                mCurrDrawable.setTintBlendMode(blendMode);
             }
         }
     }
@@ -544,7 +544,7 @@
                     d.setTintList(mDrawableContainerState.mTintList);
                 }
                 if (mDrawableContainerState.mHasTintMode) {
-                    d.setTintMode(mDrawableContainerState.mBlendMode);
+                    d.setTintBlendMode(mDrawableContainerState.mBlendMode);
                 }
             }
 
diff --git a/graphics/java/android/graphics/drawable/DrawableWrapper.java b/graphics/java/android/graphics/drawable/DrawableWrapper.java
index d81401d..64fc704 100644
--- a/graphics/java/android/graphics/drawable/DrawableWrapper.java
+++ b/graphics/java/android/graphics/drawable/DrawableWrapper.java
@@ -324,9 +324,9 @@
     }
 
     @Override
-    public void setTintMode(@NonNull BlendMode blendMode) {
+    public void setTintBlendMode(@NonNull BlendMode blendMode) {
         if (mDrawable != null) {
-            mDrawable.setTintMode(blendMode);
+            mDrawable.setTintBlendMode(blendMode);
         }
     }
 
diff --git a/graphics/java/android/graphics/drawable/GradientDrawable.java b/graphics/java/android/graphics/drawable/GradientDrawable.java
index 6948bc4..816d1fd 100644
--- a/graphics/java/android/graphics/drawable/GradientDrawable.java
+++ b/graphics/java/android/graphics/drawable/GradientDrawable.java
@@ -1211,7 +1211,7 @@
     }
 
     @Override
-    public void setTintMode(@NonNull BlendMode blendMode) {
+    public void setTintBlendMode(@NonNull BlendMode blendMode) {
         mGradientState.mBlendMode = blendMode;
         mBlendModeColorFilter = updateBlendModeFilter(mBlendModeColorFilter, mGradientState.mTint,
                 blendMode);
diff --git a/graphics/java/android/graphics/drawable/Icon.java b/graphics/java/android/graphics/drawable/Icon.java
index 5fd18a1..3658f89 100644
--- a/graphics/java/android/graphics/drawable/Icon.java
+++ b/graphics/java/android/graphics/drawable/Icon.java
@@ -324,7 +324,7 @@
         if (result != null && (mTintList != null || mBlendMode != DEFAULT_BLEND_MODE)) {
             result.mutate();
             result.setTintList(mTintList);
-            result.setTintMode(mBlendMode);
+            result.setTintBlendMode(mBlendMode);
         }
         return result;
     }
@@ -696,10 +696,7 @@
      *
      * @param mode a blending mode, as in {@link Drawable#setTintMode(PorterDuff.Mode)}, may be null
      * @return this same object, for use in chained construction
-     *
-     * @deprecated use {@link #setTintMode(BlendMode)} instead
      */
-    @Deprecated
     public @NonNull Icon setTintMode(@NonNull PorterDuff.Mode mode) {
         mBlendMode = BlendMode.fromValue(mode.nativeInt);
         return this;
@@ -711,7 +708,7 @@
      * @param mode a blending mode, as in {@link Drawable#setTintMode(PorterDuff.Mode)}, may be null
      * @return this same object, for use in chained construction
      */
-    public @NonNull Icon setTintMode(@NonNull BlendMode mode) {
+    public @NonNull Icon setTintBlendMode(@NonNull BlendMode mode) {
         mBlendMode = mode;
         return this;
     }
diff --git a/graphics/java/android/graphics/drawable/LayerDrawable.java b/graphics/java/android/graphics/drawable/LayerDrawable.java
index e2c8492..f3a1b0e 100644
--- a/graphics/java/android/graphics/drawable/LayerDrawable.java
+++ b/graphics/java/android/graphics/drawable/LayerDrawable.java
@@ -1397,13 +1397,13 @@
     }
 
     @Override
-    public void setTintMode(@NonNull BlendMode blendMode) {
+    public void setTintBlendMode(@NonNull BlendMode blendMode) {
         final ChildDrawable[] array = mLayerState.mChildren;
         final int N = mLayerState.mNumChildren;
         for (int i = 0; i < N; i++) {
             final Drawable dr = array[i].mDrawable;
             if (dr != null) {
-                dr.setTintMode(blendMode);
+                dr.setTintBlendMode(blendMode);
             }
         }
     }
diff --git a/graphics/java/android/graphics/drawable/NinePatchDrawable.java b/graphics/java/android/graphics/drawable/NinePatchDrawable.java
index 4972e6a..8561d95 100644
--- a/graphics/java/android/graphics/drawable/NinePatchDrawable.java
+++ b/graphics/java/android/graphics/drawable/NinePatchDrawable.java
@@ -349,7 +349,7 @@
     }
 
     @Override
-    public void setTintMode(@Nullable BlendMode blendMode) {
+    public void setTintBlendMode(@Nullable BlendMode blendMode) {
         mNinePatchState.mBlendMode = blendMode;
         mBlendModeFilter = updateBlendModeFilter(mBlendModeFilter, mNinePatchState.mTint,
                 blendMode);
diff --git a/graphics/java/android/graphics/drawable/ShapeDrawable.java b/graphics/java/android/graphics/drawable/ShapeDrawable.java
index b5fe7f9..9774b59 100644
--- a/graphics/java/android/graphics/drawable/ShapeDrawable.java
+++ b/graphics/java/android/graphics/drawable/ShapeDrawable.java
@@ -297,7 +297,7 @@
     }
 
     @Override
-    public void setTintMode(@NonNull BlendMode blendMode) {
+    public void setTintBlendMode(@NonNull BlendMode blendMode) {
         mShapeState.mBlendMode = blendMode;
         mBlendModeColorFilter = updateBlendModeFilter(mBlendModeColorFilter, mShapeState.mTint,
                 blendMode);
diff --git a/graphics/java/android/graphics/drawable/VectorDrawable.java b/graphics/java/android/graphics/drawable/VectorDrawable.java
index 43772ec..aa19b2a 100644
--- a/graphics/java/android/graphics/drawable/VectorDrawable.java
+++ b/graphics/java/android/graphics/drawable/VectorDrawable.java
@@ -487,7 +487,7 @@
     }
 
     @Override
-    public void setTintMode(@NonNull BlendMode blendMode) {
+    public void setTintBlendMode(@NonNull BlendMode blendMode) {
         final VectorDrawableState state = mVectorState;
         if (state.mBlendMode != blendMode) {
             state.mBlendMode = blendMode;
diff --git a/packages/SystemUI/src/com/android/systemui/globalactions/GlobalActionsDialog.java b/packages/SystemUI/src/com/android/systemui/globalactions/GlobalActionsDialog.java
index 411536c..505957a 100644
--- a/packages/SystemUI/src/com/android/systemui/globalactions/GlobalActionsDialog.java
+++ b/packages/SystemUI/src/com/android/systemui/globalactions/GlobalActionsDialog.java
@@ -438,7 +438,7 @@
     @Override
     public void onUiModeChanged() {
         mContext.getTheme().applyStyle(mContext.getThemeResId(), true);
-        if (mDialog.isShowing()) {
+        if (mDialog != null && mDialog.isShowing()) {
             mDialog.refreshDialog();
         }
     }
diff --git a/services/core/java/com/android/server/am/ProcessList.java b/services/core/java/com/android/server/am/ProcessList.java
index b85c452..1bcc4c8 100644
--- a/services/core/java/com/android/server/am/ProcessList.java
+++ b/services/core/java/com/android/server/am/ProcessList.java
@@ -709,7 +709,10 @@
             ApplicationInfo applicationInfo) {
         final boolean shouldUseGameDriver =
                 GraphicsEnvironment.shouldUseGameDriver(context, coreSettings, applicationInfo);
-        return !shouldUseGameDriver;
+        final boolean shouldUseAngle =
+                GraphicsEnvironment.shouldUseAngle(context, coreSettings,
+                    applicationInfo.packageName);
+        return !shouldUseGameDriver && !shouldUseAngle;
     }
 
     public static String makeOomAdjString(int setAdj, boolean compact) {
diff --git a/telephony/java/android/telephony/CarrierConfigManager.java b/telephony/java/android/telephony/CarrierConfigManager.java
index d2f88bb..33d5c04 100755
--- a/telephony/java/android/telephony/CarrierConfigManager.java
+++ b/telephony/java/android/telephony/CarrierConfigManager.java
@@ -3280,17 +3280,21 @@
     /**
      * Overrides the carrier config of the provided subscription ID with the provided values.
      *
-     * Any further queries to carrier config from any process will return
-     * the overriden values after this method returns. The overrides are effective for the lifetime
-     * of the phone process.
+     * Any further queries to carrier config from any process will return the overridden values
+     * after this method returns. The overrides are effective for the lifetime of the phone process
+     * until the user passes in {@code null} for {@code overrideValues}. This removes all previous
+     * overrides and sets the carrier config back to production values.
      *
      * May throw an {@link IllegalArgumentException} if {@code overrideValues} contains invalid
      * values for the specified config keys.
      *
+     * NOTE: This API is meant for testing purposes only and may only be accessed from the shell UID
+     * during instrumentation testing.
+     *
      * @param subscriptionId The subscription ID for which the override should be done.
-     * @param overrideValues Key-value pairs of the values that are to be overriden. If null,
-     *                       all previous overrides will be disabled and the config reset back to
-     *                       its initial state.
+     * @param overrideValues Key-value pairs of the values that are to be overridden. If set to
+     *                       {@code null}, this will remove all previous overrides and set the
+     *                       carrier configuration back to production values.
      * @hide
      */
     @RequiresPermission(Manifest.permission.MODIFY_PHONE_STATE)