package androidx.preference;

import android.content.Context;
import android.content.SharedPreferences;
import android.content.res.TypedArray;
import android.os.Parcelable;
import android.util.AttributeSet;
import android.view.AbsSavedState;
import ar.tvplayer.tv.R;
import defpackage.AbstractC5234;
import defpackage.C1980;
import defpackage.C4468;
import java.util.HashSet;
import java.util.Set;

/* JADX INFO: loaded from: classes3.dex */
public class MultiSelectListPreference extends DialogPreference {

    /* JADX INFO: renamed from: ˏʽˊᵰ, reason: contains not printable characters */
    public final CharSequence[] f738;

    /* JADX INFO: renamed from: ᵧᵢᵴᵸ, reason: contains not printable characters */
    public final HashSet f739;

    /* JADX INFO: renamed from: ᵯˇ, reason: contains not printable characters */
    public final CharSequence[] f740;

    /* JADX WARN: Illegal instructions before constructor call */
    public MultiSelectListPreference(Context context, AttributeSet attributeSet) {
        int i = ᵫﾞˌ.ˊᵫᵗ(context, R.attr.h, android.R.attr.dialogPreferenceStyle);
        super(context, attributeSet, i);
        this.f739 = new HashSet();
        TypedArray typedArrayObtainStyledAttributes = context.obtainStyledAttributes(attributeSet, AbstractC5234.f19734, i, 0);
        CharSequence[] textArray = typedArrayObtainStyledAttributes.getTextArray(2);
        this.f738 = textArray == null ? typedArrayObtainStyledAttributes.getTextArray(0) : textArray;
        CharSequence[] textArray2 = typedArrayObtainStyledAttributes.getTextArray(3);
        this.f740 = textArray2 == null ? typedArrayObtainStyledAttributes.getTextArray(1) : textArray2;
        typedArrayObtainStyledAttributes.recycle();
    }

    /* JADX INFO: renamed from: ˁˌᵩ, reason: contains not printable characters */
    public final void m439(Set set) {
        HashSet hashSet = this.f739;
        hashSet.clear();
        hashSet.addAll(set);
        if (m450()) {
            Set<String> stringSet = null;
            if (m450() && m444() == null) {
                stringSet = this.f769.m4485().getStringSet(this.f752, null);
            }
            if (!set.equals(stringSet)) {
                if (m444() != null) {
                    C4468.m9515("Not implemented on this data store");
                    return;
                }
                SharedPreferences.Editor editorM4482 = this.f769.m4482();
                editorM4482.putStringSet(this.f752, set);
                if (!this.f769.f6503) {
                    editorM4482.apply();
                }
            }
        }
        mo428();
    }

    @Override // androidx.preference.Preference
    /* JADX INFO: renamed from: ˉᵲ */
    public final void mo431(Parcelable parcelable) {
        if (!parcelable.getClass().equals(C1980.class)) {
            super.mo431(parcelable);
            return;
        }
        C1980 c1980 = (C1980) parcelable;
        super.mo431(c1980.getSuperState());
        m439(c1980.f7851);
    }

    @Override // androidx.preference.Preference
    /* JADX INFO: renamed from: ˊᵙᵾᵲ */
    public final Object mo432(TypedArray typedArray, int i) {
        CharSequence[] textArray = typedArray.getTextArray(i);
        HashSet hashSet = new HashSet();
        for (CharSequence charSequence : textArray) {
            hashSet.add(charSequence.toString());
        }
        return hashSet;
    }

    @Override // androidx.preference.Preference
    /* JADX INFO: renamed from: ˊᵨᵧ */
    public final void mo433(Object obj) {
        Set<String> stringSet = (Set) obj;
        if (m450() && m444() == null) {
            stringSet = this.f769.m4485().getStringSet(this.f752, stringSet);
        }
        m439(stringSet);
    }

    @Override // androidx.preference.Preference
    /* JADX INFO: renamed from: ˏːˆ */
    public final Parcelable mo434() {
        super.mo434();
        AbsSavedState absSavedState = AbsSavedState.EMPTY_STATE;
        if (this.f762) {
            return absSavedState;
        }
        C1980 c1980 = new C1980();
        c1980.f7851 = this.f739;
        return c1980;
    }
}
