package androidx.preference;

import a3.i;
import android.app.AlertDialog;
import android.content.DialogInterface;
import android.os.Bundle;
import androidx.annotation.Nullable;

/* JADX INFO: loaded from: classes.dex */
@Deprecated
public class ListPreferenceDialogFragment extends PreferenceDialogFragment {

    /* JADX INFO: renamed from: i, reason: collision with root package name */
    public int f3556i;

    /* JADX INFO: renamed from: j, reason: collision with root package name */
    public CharSequence[] f3557j;

    /* JADX INFO: renamed from: k, reason: collision with root package name */
    public CharSequence[] f3558k;

    @Deprecated
    public ListPreferenceDialogFragment() {
    }

    @Override // androidx.preference.PreferenceDialogFragment
    public final void c(boolean z10) {
        int i10;
        ListPreference listPreference = (ListPreference) a();
        if (!z10 || (i10 = this.f3556i) < 0) {
            return;
        }
        String string = this.f3558k[i10].toString();
        listPreference.getClass();
        listPreference.C(string);
    }

    @Override // androidx.preference.PreferenceDialogFragment
    public final void d(AlertDialog.Builder builder) {
        builder.setSingleChoiceItems(this.f3557j, this.f3556i, new i(this, 0));
        builder.setPositiveButton((CharSequence) null, (DialogInterface.OnClickListener) null);
    }

    @Override // androidx.preference.PreferenceDialogFragment, android.app.DialogFragment, android.app.Fragment
    public void onCreate(@Nullable Bundle bundle) {
        CharSequence[] charSequenceArr;
        super.onCreate(bundle);
        if (bundle != null) {
            this.f3556i = bundle.getInt("ListPreferenceDialogFragment.index", 0);
            this.f3557j = bundle.getCharSequenceArray("ListPreferenceDialogFragment.entries");
            this.f3558k = bundle.getCharSequenceArray("ListPreferenceDialogFragment.entryValues");
            return;
        }
        ListPreference listPreference = (ListPreference) a();
        if (listPreference.f3551u0 == null || (charSequenceArr = listPreference.f3552v0) == null) {
            throw new IllegalStateException("ListPreference requires an entries array and an entryValues array.");
        }
        this.f3556i = listPreference.B(listPreference.f3553w0);
        this.f3557j = listPreference.f3551u0;
        this.f3558k = charSequenceArr;
    }

    @Override // androidx.preference.PreferenceDialogFragment, android.app.DialogFragment, android.app.Fragment
    public final void onSaveInstanceState(Bundle bundle) {
        super.onSaveInstanceState(bundle);
        bundle.putInt("ListPreferenceDialogFragment.index", this.f3556i);
        bundle.putCharSequenceArray("ListPreferenceDialogFragment.entries", this.f3557j);
        bundle.putCharSequenceArray("ListPreferenceDialogFragment.entryValues", this.f3558k);
    }
}
