package androidx.preference;

import android.content.Context;
import android.content.SharedPreferences;
import android.content.res.TypedArray;
import android.os.Parcelable;
import android.text.TextUtils;
import android.util.AttributeSet;
import android.view.AbsSavedState;
import android.view.View;
import android.widget.TextView;
import defpackage.C2870;
import defpackage.C4468;

/* JADX INFO: loaded from: classes3.dex */
public abstract class TwoStatePreference extends Preference {

    /* JADX INFO: renamed from: ˆʤᵳ, reason: contains not printable characters */
    public boolean f809;

    /* JADX INFO: renamed from: ˏʜᵪ, reason: contains not printable characters */
    public CharSequence f810;

    /* JADX INFO: renamed from: ᵘᵝ, reason: contains not printable characters */
    public CharSequence f811;

    /* JADX INFO: renamed from: ᵬᵦˋ, reason: contains not printable characters */
    public boolean f812;

    /* JADX INFO: renamed from: ᵹʾᵢᵯ, reason: contains not printable characters */
    public boolean f813;

    public TwoStatePreference(Context context, AttributeSet attributeSet) {
        super(context, attributeSet, 0, 0);
    }

    @Override // androidx.preference.Preference
    /* JADX INFO: renamed from: ʿٴˇ */
    public final boolean mo429() {
        boolean z = this.f813;
        boolean z2 = this.f812;
        if (!z) {
            z2 = !z2;
        }
        return z2 || super.mo429();
    }

    /* JADX WARN: Removed duplicated region for block: B:18:0x0030  */
    /* JADX WARN: Removed duplicated region for block: B:23:0x0041  */
    /* JADX WARN: Removed duplicated region for block: B:26:0x0049  */
    /* JADX WARN: Removed duplicated region for block: B:28:? A[RETURN, SYNTHETIC] */
    /* JADX INFO: renamed from: ˀᵭ, reason: contains not printable characters */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public final void m471(View view) {
        boolean z;
        int i;
        if (!(view instanceof TextView)) {
            return;
        }
        TextView textView = (TextView) view;
        if (this.f812 && !TextUtils.isEmpty(this.f810)) {
            textView.setText(this.f810);
        } else {
            if (this.f812 || TextUtils.isEmpty(this.f811)) {
                z = true;
                if (z) {
                    CharSequence charSequenceMo438 = mo438();
                    if (!TextUtils.isEmpty(charSequenceMo438)) {
                        textView.setText(charSequenceMo438);
                        z = false;
                    }
                }
                i = z ? 8 : 0;
                if (i == textView.getVisibility()) {
                    textView.setVisibility(i);
                    return;
                }
                return;
            }
            textView.setText(this.f811);
        }
        z = false;
        if (z) {
        }
        if (z) {
        }
        if (i == textView.getVisibility()) {
        }
    }

    /* JADX INFO: renamed from: ˁˌᵩ, reason: contains not printable characters */
    public void m472(boolean z) {
        boolean z2 = this.f812 != z;
        if (z2 || !this.f809) {
            this.f812 = z;
            this.f809 = true;
            if (m450()) {
                boolean z3 = !z;
                if (m450() && m444() == null) {
                    z3 = this.f769.m4485().getBoolean(this.f752, z3);
                }
                if (z != z3) {
                    if (m444() != null) {
                        C4468.m9515("Not implemented on this data store");
                        return;
                    }
                    SharedPreferences.Editor editorM4482 = this.f769.m4482();
                    editorM4482.putBoolean(this.f752, z);
                    if (!this.f769.f6503) {
                        editorM4482.apply();
                    }
                }
            }
            if (z2) {
                mo453(mo429());
                mo428();
            }
        }
    }

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

    @Override // androidx.preference.Preference
    /* JADX INFO: renamed from: ˊᵙᵾᵲ */
    public final Object mo432(TypedArray typedArray, int i) {
        return Boolean.valueOf(typedArray.getBoolean(i, false));
    }

    @Override // androidx.preference.Preference
    /* JADX INFO: renamed from: ˊᵨᵧ */
    public void mo433(Object obj) {
        if (obj == null) {
            obj = Boolean.FALSE;
        }
        boolean zBooleanValue = ((Boolean) obj).booleanValue();
        if (m450() && m444() == null) {
            zBooleanValue = this.f769.m4485().getBoolean(this.f752, zBooleanValue);
        }
        m472(zBooleanValue);
    }

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

    @Override // androidx.preference.Preference
    /* JADX INFO: renamed from: ᵟᵹᵙ */
    public final void mo427() {
        boolean z = !this.f812;
        m457(Boolean.valueOf(z));
        m472(z);
    }
}
