content: package androidx.appcompat.widget;
  
  import android.content.Context;
  import android.content.res.ColorStateList;
  import android.graphics.PorterDuff;
  import android.graphics.drawable.Drawable;
  import android.text.method.KeyListener;
  import android.util.AttributeSet;
  import android.view.ActionMode;
  import android.view.inputmethod.EditorInfo;
  import android.view.inputmethod.InputConnection;
  import android.widget.AutoCompleteTextView;
  import androidx.appcompat.R;
  import androidx.appcompat.content.res.AppCompatResources;
  import androidx.core.view.TintableBackgroundView;
  import androidx.core.widget.TextViewCompat;
  import androidx.core.widget.TintableCompoundDrawablesView;
  
  public class AppCompatAutoCompleteTextView extends AutoCompleteTextView implements TintableBackgroundView, EmojiCompatConfigurationView, TintableCompoundDrawablesView {
      private static final int[] TINT_ATTRS = {16843126};
      private final AppCompatEmojiEditTextHelper mAppCompatEmojiEditTextHelper;
      private final AppCompatBackgroundHelper mBackgroundTintHelper;
      private final AppCompatTextHelper mTextHelper;
  
      public AppCompatAutoCompleteTextView(Context context) {
          this(context, (AttributeSet) null);
      }
  
      public AppCompatAutoCompleteTextView(Context context, AttributeSet attrs) {
          this(context, attrs, R.attr.autoCompleteTextViewStyle);
      }
  
      public AppCompatAutoCompleteTextView(Context context, AttributeSet attrs, int defStyleAttr) {
          super(TintContextWrapper.wrap(context), attrs, defStyleAttr);
          ThemeUtils.checkAppCompatTheme(this, getContext());
          TintTypedArray obtainStyledAttributes = TintTypedArray.obtainStyledAttributes(getContext(), attrs, TINT_ATTRS, defStyleAttr, 0);
          if (obtainStyledAttributes.hasValue(0)) {
              setDropDownBackgroundDrawable(obtainStyledAttributes.getDrawable(0));
          }
          obtainStyledAttributes.recycle();
          AppCompatBackgroundHelper appCompatBackgroundHelper = new AppCompatBackgroundHelper(this);
          this.mBackgroundTintHelper = appCompatBackgroundHelper;
          appCompatBackgroundHelper.loadFromAttributes(attrs, defStyleAttr);
          AppCompatTextHelper appCompatTextHelper = new AppCompatTextHelper(this);
          this.mTextHelper = appCompatTextHelper;
          appCompatTextHelper.loadFromAttributes(attrs, defStyleAttr);
          appCompatTextHelper.applyCompoundDrawablesTints();
          AppCompatEmojiEditTextHelper appCompatEmojiEditTextHelper = new AppCompatEmojiEditTextHelper(this);
          this.mAppCompatEmojiEditTextHelper = appCompatEmojiEditTextHelper;
          appCompatEmojiEditTextHelper.loadFromAttributes(attrs, defStyleAttr);
          initEmojiKeyListener(appCompatEmojiEditTextHelper);
      }
  
      /* access modifiers changed from: protected */
      public void drawableStateChanged() {
          super.drawableStateChanged();
          AppCompatBackgroundHelper appCompatBackgroundHelper = this.mBackgroundTintHelper;
          if (appCompatBackgroundHelper != null) {
              appCompatBackgroundHelper.applySupportBackgroundTint();
          }
          AppCompatTextHelper appCompatTextHelper = this.mTextHelper;
          if (appCompatTextHelper != null) {
              appCompatTextHelper.applyCompoundDrawablesTints();
          }
      }
  
      public ActionMode.Callback getCustomSelectionActionModeCallback() {
          return TextViewCompat.unwrapCustomSelectionActionModeCallback(super.getCustomSelectionActionModeCallback());
      }
  
      public ColorStateList getSupportBackgroundTintList() {
          AppCompatBackgroundHelper appCompatBackgroundHelper = this.mBackgroundTintHelper;
          if (appCompatBackgroundHelper != null) {
              return appCompatBackgroundHelper.getSupportBackgroundTintList();
          }
          return null;
      }
  
      public PorterDuff.Mode getSupportBackgroundTintMode() {
          AppCompatBackgroundHelper appCompatBackgroundHelper = this.mBackgroundTintHelper;
          if (appCompatBackgroundHelper != null) {
              return appCompatBackgroundHelper.getSupportBackgroundTintMode();
          }
          return null;
      }
  
      public ColorStateList getSupportCompoundDrawablesTintList() {
          return this.mTextHelper.getCompoundDrawableTintList();
      }
  
      public PorterDuff.Mode getSupportCompoundDrawablesTintMode() {
          return this.mTextHelper.getCompoundDrawableTintMode();
      }
  
      /* access modifiers changed from: package-private */
      public void initEmojiKeyListener(AppCompatEmojiEditTextHelper appCompatEmojiEditTextHelper) {
          KeyListener keyListener = getKeyListener();
          if (appCompatEmojiEditTextHelper.isEmojiCapableKeyListener(keyListener)) {
              boolean isFocusable = super.isFocusable();
              boolean isClickable = super.isClickable();
              boolean isLongClickable = super.isLongClickable();
              int inputType = super.getInputType();
              KeyListener keyListener2 = appCompatEmojiEditTextHelper.getKeyListener(keyListener);
              if (keyListener2 != keyListener) {
                  super.setKeyListener(keyListener2);
                  super.setRawInputType(inputType);
                  super.setFocusable(isFocusable);
                  super.setClickable(isClickable);
                  super.setLongClickable(isLongClickable);
              }
          }
      }
  
      public boolean isEmojiCompatEnabled() {
          return this.mAppCompatEmojiEditTextHelper.isEnabled();
      }
  
      public InputConnection onCreateInputConnection(EditorInfo outAttrs) {
          return this.mAppCompatEmojiEditTextHelper.onCreateInputConnection(AppCompatHintHelper.onCreateInputConnection(super.onCreateInputConnection(outAttrs), outAttrs, this), outAttrs);
      }
  
      public void setBackgroundDrawable(Drawable background) {
          super.setBackgroundDrawable(background);
          AppCompatBackgroundHelper appCompatBackgroundHelper = this.mBackgroundTintHelper;
          if (appCompatBackgroundHelper != null) {
              appCompatBackgroundHelper.onSetBackgroundDrawable(background);
          }
      }
  
      public void setBackgroundResource(int resId) {
          super.setBackgroundResource(resId);
          AppCompatBackgroundHelper appCompatBackgroundHelper = this.mBackgroundTintHelper;
          if (appCompatBackgroundHelper != null) {
              appCompatBackgroundHelper.onSetBackgroundResource(resId);
          }
      }
  
      public void setCompoundDrawables(Drawable left, Drawable top, Drawable right, Drawable bottom) {
          super.setCompoundDrawables(left, top, right, bottom);
          AppCompatTextHelper appCompatTextHelper = this.mTextHelper;
          if (appCompatTextHelper != null) {
              appCompatTextHelper.onSetCompoundDrawables();
          }
      }
  
      public void setCompoundDrawablesRelative(Drawable start, Drawable top, Drawable end, Drawable bottom) {
          super.setCompoundDrawablesRelative(start, top, end, bottom);
          AppCompatTextHelper appCompatTextHelper = this.mTextHelper;
          if (appCompatTextHelper != null) {
              appCompatTextHelper.onSetCompoundDrawables();
          }
      }
  
      public void setCustomSelectionActionModeCallback(ActionMode.Callback actionModeCallback) {
          super.setCustomSelectionActionModeCallback(TextViewCompat.wrapCustomSelectionActionModeCallback(this, actionModeCallback));
      }
  
      public void setDropDownBackgroundResource(int resId) {
          setDropDownBackgroundDrawable(AppCompatResources.getDrawable(getContext(), resId));
      }
  
      public void setEmojiCompatEnabled(boolean enabled) {
          this.mAppCompatEmojiEditTextHelper.setEnabled(enabled);
      }
  
      public void setKeyListener(KeyListener keyListener) {
          super.setKeyListener(this.mAppCompatEmojiEditTextHelper.getKeyListener(keyListener));
      }
  
      public void setSupportBackgroundTintList(ColorStateList tint) {
          AppCompatBackgroundHelper appCompatBackgroundHelper = this.mBackgroundTintHelper;
          if (appCompatBackgroundHelper != null) {
              appCompatBackgroundHelper.setSupportBackgroundTintList(tint);
          }
      }
  
      public void setSupportBackgroundTintMode(PorterDuff.Mode tintMode) {
          AppCompatBackgroundHelper appCompatBackgroundHelper = this.mBackgroundTintHelper;
          if (appCompatBackgroundHelper != null) {
              appCompatBackgroundHelper.setSupportBackgroundTintMode(tintMode);
          }
      }
  
      public void setSupportCompoundDrawablesTintList(ColorStateList tintList) {
          this.mTextHelper.setCompoundDrawableTintList(tintList);
          this.mTextHelper.applyCompoundDrawablesTints();
      }
  
      public void setSupportCompoundDrawablesTintMode(PorterDuff.Mode tintMode) {
          this.mTextHelper.setCompoundDrawableTintMode(tintMode);
          this.mTextHelper.applyCompoundDrawablesTints();
      }
  
      public void setTextAppearance(Context context, int resId) {
          super.setTextAppearance(context, resId);
          AppCompatTextHelper appCompatTextHelper = this.mTextHelper;
          if (appCompatTextHelper != null) {
              appCompatTextHelper.onSetTextAppearance(context, resId);
          }
      }
  }
  