package a3;

import android.content.Context;
import android.content.SharedPreferences;
import android.view.ContextThemeWrapper;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.annotation.RestrictTo;
import androidx.preference.Preference;
import androidx.preference.PreferenceScreen;

/* JADX INFO: loaded from: classes.dex */
public final class f0 {

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    public final Context f249a;

    /* JADX INFO: renamed from: c, reason: collision with root package name */
    public boolean f251c;

    /* JADX INFO: renamed from: d, reason: collision with root package name */
    public final String f252d;

    /* JADX INFO: renamed from: e, reason: collision with root package name */
    public PreferenceScreen f253e;

    /* JADX INFO: renamed from: f, reason: collision with root package name */
    public d0 f254f;

    /* JADX INFO: renamed from: g, reason: collision with root package name */
    public b0 f255g;

    /* JADX INFO: renamed from: h, reason: collision with root package name */
    public c0 f256h;

    @Nullable
    private SharedPreferences.Editor mEditor;

    @Nullable
    private s mPreferenceDataStore;

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public long f250b = 0;

    @Nullable
    private SharedPreferences mSharedPreferences = null;

    public f0(ContextThemeWrapper contextThemeWrapper) {
        this.f249a = contextThemeWrapper;
        this.f252d = contextThemeWrapper.getPackageName() + "_preferences";
    }

    @Nullable
    public <T extends Preference> T findPreference(@NonNull CharSequence charSequence) {
        PreferenceScreen preferenceScreen = this.f253e;
        if (preferenceScreen == null) {
            return null;
        }
        return (T) preferenceScreen.findPreference(charSequence);
    }

    @Nullable
    public SharedPreferences.Editor getEditor() {
        if (!this.f251c) {
            return getSharedPreferences().edit();
        }
        if (this.mEditor == null) {
            this.mEditor = getSharedPreferences().edit();
        }
        return this.mEditor;
    }

    @Nullable
    public b0 getOnDisplayPreferenceDialogListener() {
        return this.f255g;
    }

    @Nullable
    public c0 getOnNavigateToScreenListener() {
        return this.f256h;
    }

    @Nullable
    public d0 getOnPreferenceTreeClickListener() {
        return this.f254f;
    }

    @Nullable
    public e0 getPreferenceComparisonCallback() {
        return null;
    }

    @Nullable
    public s getPreferenceDataStore() {
        return null;
    }

    @Nullable
    public SharedPreferences getSharedPreferences() {
        getPreferenceDataStore();
        if (this.mSharedPreferences == null) {
            this.mSharedPreferences = this.f249a.getSharedPreferences(this.f252d, 0);
        }
        return this.mSharedPreferences;
    }

    @NonNull
    @RestrictTo({RestrictTo.Scope.f557c})
    public PreferenceScreen inflateFromResource(@NonNull Context context, int i10, @Nullable PreferenceScreen preferenceScreen) {
        this.f251c = true;
        PreferenceScreen preferenceScreen2 = (PreferenceScreen) new a0(context, this).inflate(i10, preferenceScreen);
        preferenceScreen2.m(this);
        SharedPreferences.Editor editor = this.mEditor;
        if (editor != null) {
            editor.apply();
        }
        this.f251c = false;
        return preferenceScreen2;
    }

    public void setOnDisplayPreferenceDialogListener(@Nullable b0 b0Var) {
        this.f255g = b0Var;
    }

    public void setOnNavigateToScreenListener(@Nullable c0 c0Var) {
        this.f256h = c0Var;
    }

    public void setOnPreferenceTreeClickListener(@Nullable d0 d0Var) {
        this.f254f = d0Var;
    }

    public void setPreferenceComparisonCallback(@Nullable e0 e0Var) {
    }

    public void setPreferenceDataStore(@Nullable s sVar) {
    }
}
