content: package androidx.core.graphics.drawable;
  
  import android.content.res.ColorStateList;
  import android.content.res.Resources;
  import android.graphics.Canvas;
  import android.graphics.ColorFilter;
  import android.graphics.PorterDuff;
  import android.graphics.Rect;
  import android.graphics.Region;
  import android.graphics.drawable.Drawable;
  
  class WrappedDrawableApi14 extends Drawable implements Drawable.Callback, WrappedDrawable, TintAwareDrawable {
      static final PorterDuff.Mode DEFAULT_TINT_MODE = PorterDuff.Mode.SRC_IN;
      private boolean mColorFilterSet;
      private int mCurrentColor;
      private PorterDuff.Mode mCurrentMode;
      Drawable mDrawable;
      private boolean mMutated;
      WrappedDrawableState mState;
  
      WrappedDrawableApi14(Drawable dr) {
          this.mState = mutateConstantState();
          setWrappedDrawable(dr);
      }
  
      WrappedDrawableApi14(WrappedDrawableState state, Resources res) {
          this.mState = state;
          updateLocalState(res);
      }
  
      private WrappedDrawableState mutateConstantState() {
          return new WrappedDrawableState(this.mState);
      }
  
      private void updateLocalState(Resources res) {
          WrappedDrawableState wrappedDrawableState = this.mState;
          if (wrappedDrawableState != null && wrappedDrawableState.mDrawableState != null) {
              setWrappedDrawable(this.mState.mDrawableState.newDrawable(res));
          }
      }
  
      private boolean updateTint(int[] state) {
          if (!isCompatTintEnabled()) {
              return false;
          }
          ColorStateList colorStateList = this.mState.mTint;
          PorterDuff.Mode mode = this.mState.mTintMode;
          if (colorStateList == null || mode == null) {
              this.mColorFilterSet = false;
              clearColorFilter();
          } else {
              int colorForState = colorStateList.getColorForState(state, colorStateList.getDefaultColor());
              if (!(this.mColorFilterSet && colorForState == this.mCurrentColor && mode == this.mCurrentMode)) {
                  setColorFilter(colorForState, mode);
                  this.mCurrentColor = colorForState;
                  this.mCurrentMode = mode;
                  this.mColorFilterSet = true;
                  return true;
              }
          }
          return false;
      }
  
      public void draw(Canvas canvas) {
          this.mDrawable.draw(canvas);
      }
  
      public int getChangingConfigurations() {
          int changingConfigurations = super.getChangingConfigurations();
          WrappedDrawableState wrappedDrawableState = this.mState;
          return changingConfigurations | (wrappedDrawableState != null ? wrappedDrawableState.getChangingConfigurations() : 0) | this.mDrawable.getChangingConfigurations();
      }
  
      public Drawable.ConstantState getConstantState() {
          WrappedDrawableState wrappedDrawableState = this.mState;
          if (wrappedDrawableState == null || !wrappedDrawableState.canConstantState()) {
              return null;
          }
          this.mState.mChangingConfigurations = getChangingConfigurations();
          return this.mState;
      }
  
      public Drawable getCurrent() {
          return this.mDrawable.getCurrent();
      }
  
      public int getIntrinsicHeight() {
          return this.mDrawable.getIntrinsicHeight();
      }
  
      public int getIntrinsicWidth() {
          return this.mDrawable.getIntrinsicWidth();
      }
  
      public int getLayoutDirection() {
          return DrawableCompat.getLayoutDirection(this.mDrawable);
      }
  
      public int getMinimumHeight() {
          return this.mDrawable.getMinimumHeight();
      }
  
      public int getMinimumWidth() {
          return this.mDrawable.getMinimumWidth();
      }
  
      public int getOpacity() {
          return this.mDrawable.getOpacity();
      }
  
      public boolean getPadding(Rect padding) {
          return this.mDrawable.getPadding(padding);
      }
  
      public int[] getState() {
          return this.mDrawable.getState();
      }
  
      public Region getTransparentRegion() {
          return this.mDrawable.getTransparentRegion();
      }
  
      public final Drawable getWrappedDrawable() {
          return this.mDrawable;
      }
  
      public void invalidateDrawable(Drawable who) {
          invalidateSelf();
      }
  
      public boolean isAutoMirrored() {
          return DrawableCompat.isAutoMirrored(this.mDrawable);
      }
  
      /* access modifiers changed from: protected */
      public boolean isCompatTintEnabled() {
          return true;
      }
  
      /* JADX WARNING: Code restructure failed: missing block: B:2:0x0006, code lost:
          r0 = r2.mState;
       */
      /* Code decompiled incorrectly, please refer to instructions dump. */
      public boolean isStateful() {
          /*
              r2 = this;
              boolean r0 = r2.isCompatTintEnabled()
              if (r0 == 0) goto L_0x000d
              androidx.core.graphics.drawable.WrappedDrawableState r0 = r2.mState
              if (r0 == 0) goto L_0x000d
              android.content.res.ColorStateList r0 = r0.mTint
              goto L_0x000e
          L_0x000d:
              r0 = 0
          L_0x000e:
              if (r0 == 0) goto L_0x0017
              boolean r1 = r0.isStateful()
              if (r1 != 0) goto L_0x001f
          L_0x0017:
              android.graphics.drawable.Drawable r1 = r2.mDrawable
              boolean r1 = r1.isStateful()
              if (r1 == 0) goto L_0x0021
          L_0x001f:
              r1 = 1
              goto L_0x0022
          L_0x0021:
              r1 = 0
          L_0x0022:
              return r1
          */
          throw new UnsupportedOperationException("Method not decompiled: androidx.core.graphics.drawable.WrappedDrawableApi14.isStateful():boolean");
      }
  
      public void jumpToCurrentState() {
          this.mDrawable.jumpToCurrentState();
      }
  
      public Drawable mutate() {
          if (!this.mMutated && super.mutate() == this) {
              this.mState = mutateConstantState();
              Drawable drawable = this.mDrawable;
              if (drawable != null) {
                  drawable.mutate();
              }
              WrappedDrawableState wrappedDrawableState = this.mState;
              if (wrappedDrawableState != null) {
                  Drawable drawable2 = this.mDrawable;
                  wrappedDrawableState.mDrawableState = drawable2 != null ? drawable2.getConstantState() : null;
              }
              this.mMutated = true;
          }
          return this;
      }
  
      /* access modifiers changed from: protected */
      public void onBoundsChange(Rect bounds) {
          Drawable drawable = this.mDrawable;
          if (drawable != null) {
              drawable.setBounds(bounds);
          }
      }
  
      public boolean onLayoutDirectionChanged(int layoutDirection) {
          return DrawableCompat.setLayoutDirection(this.mDrawable, layoutDirection);
      }
  
      /* access modifiers changed from: protected */
      public boolean onLevelChange(int level) {
          return this.mDrawable.setLevel(level);
      }
  
      public void scheduleDrawable(Drawable who, Runnable what, long when) {
          scheduleSelf(what, when);
      }
  
      public void setAlpha(int alpha) {
          this.mDrawable.setAlpha(alpha);
      }
  
      public void setAutoMirrored(boolean mirrored) {
          DrawableCompat.setAutoMirrored(this.mDrawable, mirrored);
      }
  
      public void setChangingConfigurations(int configs) {
          this.mDrawable.setChangingConfigurations(configs);
      }
  
      public void setColorFilter(ColorFilter cf) {
          this.mDrawable.setColorFilter(cf);
      }
  
      public void setDither(boolean dither) {
          this.mDrawable.setDither(dither);
      }
  
      public void setFilterBitmap(boolean filter) {
          this.mDrawable.setFilterBitmap(filter);
      }
  
      public boolean setState(int[] stateSet) {
          return updateTint(stateSet) || this.mDrawable.setState(stateSet);
      }
  
      public void setTint(int tint) {
          setTintList(ColorStateList.valueOf(tint));
      }
  
      public void setTintList(ColorStateList tint) {
          this.mState.mTint = tint;
          updateTint(getState());
      }
  
      public void setTintMode(PorterDuff.Mode tintMode) {
          this.mState.mTintMode = tintMode;
          updateTint(getState());
      }
  
      public boolean setVisible(boolean visible, boolean restart) {
          return super.setVisible(visible, restart) || this.mDrawable.setVisible(visible, restart);
      }
  
      public final void setWrappedDrawable(Drawable dr) {
          Drawable drawable = this.mDrawable;
          if (drawable != null) {
              drawable.setCallback((Drawable.Callback) null);
          }
          this.mDrawable = dr;
          if (dr != null) {
              dr.setCallback(this);
              setVisible(dr.isVisible(), true);
              setState(dr.getState());
              setLevel(dr.getLevel());
              setBounds(dr.getBounds());
              WrappedDrawableState wrappedDrawableState = this.mState;
              if (wrappedDrawableState != null) {
                  wrappedDrawableState.mDrawableState = dr.getConstantState();
              }
          }
          invalidateSelf();
      }
  
      public void unscheduleDrawable(Drawable who, Runnable what) {
          unscheduleSelf(what);
      }
  }
  