package androidx.preference;

import android.R;
import android.content.Context;
import android.content.res.TypedArray;
import android.util.AttributeSet;
import android.view.View;
import android.view.accessibility.AccessibilityManager;
import android.widget.Checkable;
import android.widget.CompoundButton;
import p037.p041.p042.LayoutInflaterFactory2C1494;
import p037.p106.C2293;
import p037.p106.C2294;
import p037.p106.C2300;

/* JADX INFO: loaded from: classes.dex */
public class CheckBoxPreference extends TwoStatePreference {

    /* JADX INFO: renamed from: ࢫ, reason: contains not printable characters */
    public final C0148 f979;

    /* JADX INFO: renamed from: androidx.preference.CheckBoxPreference$֏, reason: contains not printable characters */
    public class C0148 implements CompoundButton.OnCheckedChangeListener {
        public C0148() {
        }

        @Override // android.widget.CompoundButton.OnCheckedChangeListener
        public void onCheckedChanged(CompoundButton compoundButton, boolean z) {
            if (CheckBoxPreference.this == null) {
                throw null;
            }
            CheckBoxPreference.this.m426(z);
        }
    }

    /* JADX WARN: Illegal instructions before constructor call */
    public CheckBoxPreference(Context context, AttributeSet attributeSet) {
        int iM2871 = LayoutInflaterFactory2C1494.C1505.m2871(context, C2294.checkBoxPreferenceStyle, R.attr.checkBoxPreferenceStyle);
        super(context, attributeSet, iM2871, 0);
        this.f979 = new C0148();
        TypedArray typedArrayObtainStyledAttributes = context.obtainStyledAttributes(attributeSet, C2300.CheckBoxPreference, iM2871, 0);
        m425(LayoutInflaterFactory2C1494.C1505.m2912(typedArrayObtainStyledAttributes, C2300.CheckBoxPreference_summaryOn, C2300.CheckBoxPreference_android_summaryOn));
        int i = C2300.CheckBoxPreference_summaryOff;
        int i2 = C2300.CheckBoxPreference_android_summaryOff;
        String string = typedArrayObtainStyledAttributes.getString(i);
        m424((CharSequence) (string == null ? typedArrayObtainStyledAttributes.getString(i2) : string));
        this.f1090 = typedArrayObtainStyledAttributes.getBoolean(C2300.CheckBoxPreference_disableDependentsState, typedArrayObtainStyledAttributes.getBoolean(C2300.CheckBoxPreference_android_disableDependentsState, false));
        typedArrayObtainStyledAttributes.recycle();
    }

    @Override // androidx.preference.Preference
    /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
    public void mo359(View view) {
        super.mo359(view);
        if (((AccessibilityManager) this.f1006.getSystemService("accessibility")).isEnabled()) {
            m361(view.findViewById(R.id.checkbox));
            m422(view.findViewById(R.id.summary));
        }
    }

    @Override // androidx.preference.Preference
    /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
    public void mo360(C2293 c2293) {
        super.mo360(c2293);
        m361(c2293.m4338(R.id.checkbox));
        m423(c2293);
    }

    /* JADX WARN: Multi-variable type inference failed */
    /* JADX INFO: renamed from: ހ, reason: contains not printable characters */
    public final void m361(View view) {
        boolean z = view instanceof CompoundButton;
        if (z) {
            ((CompoundButton) view).setOnCheckedChangeListener(null);
        }
        if (view instanceof Checkable) {
            ((Checkable) view).setChecked(this.f1086);
        }
        if (z) {
            ((CompoundButton) view).setOnCheckedChangeListener(this.f979);
        }
    }
}
