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 defpackage.C0190;
import defpackage.C4873;

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

    /* renamed from: ʽᵢˊ, reason: contains not printable characters */
    public boolean f809;

    /* renamed from: ᵣᵟᵔ, reason: contains not printable characters */
    public boolean f810;

    /* renamed from: ᵥʩᵩˑ, reason: contains not printable characters */
    public CharSequence f811;

    /* renamed from: ᵨٴ, reason: contains not printable characters */
    public boolean f812;

    /* renamed from: ᵲᵟ, reason: contains not printable characters */
    public CharSequence f813;

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

    @Override // androidx.preference.Preference
    /* renamed from: ˌʾˀ */
    public final void mo427() {
        boolean z = !this.f810;
        m453(Boolean.valueOf(z));
        m471(z);
    }

    @Override // androidx.preference.Preference
    /* renamed from: ˑᵱ */
    public void mo429(Object obj) {
        if (obj == null) {
            obj = Boolean.FALSE;
        }
        boolean zBooleanValue = ((Boolean) obj).booleanValue();
        if (m454() && m459() == null) {
            zBooleanValue = this.f765.m10458().getBoolean(this.f775, zBooleanValue);
        }
        m471(zBooleanValue);
    }

    /* renamed from: ᐧﾞ, reason: contains not printable characters */
    public void m471(boolean z) {
        boolean z2 = this.f810 != z;
        if (z2 || !this.f812) {
            this.f810 = z;
            this.f812 = true;
            if (m454()) {
                boolean z3 = !z;
                if (m454() && m459() == null) {
                    z3 = this.f765.m10458().getBoolean(this.f775, z3);
                }
                if (z != z3) {
                    if (m459() != null) {
                        C0190.m1432("Not implemented on this data store");
                        return;
                    }
                    SharedPreferences.Editor editorM10457 = this.f765.m10457();
                    editorM10457.putBoolean(this.f775, z);
                    if (!this.f765.f18589) {
                        editorM10457.apply();
                    }
                }
            }
            if (z2) {
                mo443(mo433());
                mo428();
            }
        }
    }

    @Override // androidx.preference.Preference
    /* renamed from: ᵞʡ */
    public final void mo431(Parcelable parcelable) {
        if (!parcelable.getClass().equals(C4873.class)) {
            super.mo431(parcelable);
            return;
        }
        C4873 c4873 = (C4873) parcelable;
        super.mo431(c4873.getSuperState());
        m471(c4873.f18141);
    }

    @Override // androidx.preference.Preference
    /* renamed from: ᵨᵳʝ */
    public final Parcelable mo432() {
        super.mo432();
        AbsSavedState absSavedState = AbsSavedState.EMPTY_STATE;
        if (this.f755) {
            return absSavedState;
        }
        C4873 c4873 = new C4873();
        c4873.f18141 = this.f810;
        return c4873;
    }

    @Override // androidx.preference.Preference
    /* renamed from: ᵮᵠـˌ */
    public final boolean mo433() {
        boolean z = this.f809;
        boolean z2 = this.f810;
        if (!z) {
            z2 = !z2;
        }
        return z2 || super.mo433();
    }

    /* 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] */
    /* renamed from: ᵶʔᵢˊ, reason: contains not printable characters */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
        To view partially-correct add '--show-bad-code' argument
    */
    public final void m472(android.view.View r4) {
        /*
            r3 = this;
            boolean r0 = r4 instanceof android.widget.TextView
            if (r0 != 0) goto L5
            goto L4c
        L5:
            android.widget.TextView r4 = (android.widget.TextView) r4
            boolean r0 = r3.f810
            r1 = 0
            if (r0 == 0) goto L1b
            java.lang.CharSequence r0 = r3.f811
            boolean r0 = android.text.TextUtils.isEmpty(r0)
            if (r0 != 0) goto L1b
            java.lang.CharSequence r0 = r3.f811
            r4.setText(r0)
        L19:
            r0 = r1
            goto L2e
        L1b:
            boolean r0 = r3.f810
            if (r0 != 0) goto L2d
            java.lang.CharSequence r0 = r3.f813
            boolean r0 = android.text.TextUtils.isEmpty(r0)
            if (r0 != 0) goto L2d
            java.lang.CharSequence r0 = r3.f813
            r4.setText(r0)
            goto L19
        L2d:
            r0 = 1
        L2e:
            if (r0 == 0) goto L3e
            java.lang.CharSequence r3 = r3.mo436()
            boolean r2 = android.text.TextUtils.isEmpty(r3)
            if (r2 != 0) goto L3e
            r4.setText(r3)
            r0 = r1
        L3e:
            if (r0 != 0) goto L41
            goto L43
        L41:
            r1 = 8
        L43:
            int r3 = r4.getVisibility()
            if (r1 == r3) goto L4c
            r4.setVisibility(r1)
        L4c:
            return
        */
        throw new UnsupportedOperationException("Method not decompiled: androidx.preference.TwoStatePreference.m472(android.view.View):void");
    }

    @Override // androidx.preference.Preference
    /* renamed from: ᵸʓᵠ */
    public final Object mo434(TypedArray typedArray, int i) {
        return Boolean.valueOf(typedArray.getBoolean(i, false));
    }
}
