Update DrawableWrapper to DrawableWrapperCompat
Api changed in aosp/2120177
Bug: 235727273
Test: TAP
Change-Id: I1645dab6000dc760b4de2bb625e0af8df014c8c8
diff --git a/src/com/android/messaging/util/SwitchCompatUtils.java b/src/com/android/messaging/util/SwitchCompatUtils.java
index 8cfe2bc..9c920f6 100644
--- a/src/com/android/messaging/util/SwitchCompatUtils.java
+++ b/src/com/android/messaging/util/SwitchCompatUtils.java
@@ -21,7 +21,7 @@
import android.graphics.Color;
import android.graphics.PorterDuff;
import android.graphics.drawable.Drawable;
-import androidx.appcompat.graphics.drawable.DrawableWrapper;
+import androidx.appcompat.graphics.drawable.DrawableWrapperCompat;
import androidx.appcompat.widget.SwitchCompat;
import android.util.TypedValue;
@@ -53,8 +53,8 @@
private static Drawable getColorTintedDrawable(Drawable oldDrawable,
final ColorStateList colorStateList, final PorterDuff.Mode mode) {
final int[] thumbState = oldDrawable.isStateful() ? oldDrawable.getState() : null;
- if (oldDrawable instanceof DrawableWrapper) {
- oldDrawable = ((DrawableWrapper) oldDrawable).getWrappedDrawable();
+ if (oldDrawable instanceof DrawableWrapperCompat) {
+ oldDrawable = ((DrawableWrapperCompat) oldDrawable).getDrawable();
}
final Drawable newDrawable = new TintDrawableWrapper(oldDrawable, colorStateList, mode);
if (thumbState != null) {
diff --git a/src/com/android/messaging/util/TintDrawableWrapper.java b/src/com/android/messaging/util/TintDrawableWrapper.java
index 06ee7d4..b426f8c 100644
--- a/src/com/android/messaging/util/TintDrawableWrapper.java
+++ b/src/com/android/messaging/util/TintDrawableWrapper.java
@@ -20,16 +20,16 @@
import android.graphics.Color;
import android.graphics.PorterDuff;
import android.graphics.drawable.Drawable;
-import androidx.appcompat.graphics.drawable.DrawableWrapper;
+import androidx.appcompat.graphics.drawable.DrawableWrapperCompat;
/*
* This is directly copied from v7/appcompat/src/androidx.appcompat.internal/widget/TintManager.java
*/
/**
- * A {@link DrawableWrapper} which updates it's color filter using a {@link ColorStateList}.
+ * A {@link DrawableWrapperCompat} which updates it's color filter using a {@link ColorStateList}.
*/
-class TintDrawableWrapper extends DrawableWrapper {
+class TintDrawableWrapper extends DrawableWrapperCompat {
private final ColorStateList mTintStateList;
private final PorterDuff.Mode mTintMode;
private int mCurrentColor;