package defpackage;

import android.content.SharedPreferences;
import java.util.Date;
import java.util.HashMap;
import java.util.Iterator;
import org.json.JSONException;
import org.json.JSONObject;

/* renamed from: ᵭʨ, reason: contains not printable characters */
/* loaded from: classes3.dex */
public final class C4093 {

    /* renamed from: ᵥᵯˎ, reason: contains not printable characters */
    public final SharedPreferences f15298;

    /* renamed from: ˏˋٴ, reason: contains not printable characters */
    public static final Date f15295 = new Date(-1);

    /* renamed from: ˎˏʜʾ, reason: contains not printable characters */
    public static final Date f15294 = new Date(-1);

    /* renamed from: ᵴᵳ, reason: contains not printable characters */
    public final Object f15299 = new Object();

    /* renamed from: ˏᵙ, reason: contains not printable characters */
    public final Object f15297 = new Object();

    /* renamed from: ᵻᵢﹳᵰ, reason: contains not printable characters */
    public final Object f15300 = new Object();

    /* renamed from: ˇʼʤˎ, reason: contains not printable characters */
    public final Object f15296 = new Object();

    public C4093(SharedPreferences sharedPreferences) {
        this.f15298 = sharedPreferences;
    }

    /* renamed from: ˇʼʤˎ, reason: contains not printable characters */
    public final void m8969(String str) {
        synchronized (this.f15299) {
            this.f15298.edit().putString("last_fetch_etag", str).apply();
        }
    }

    /* renamed from: ˎˏʜʾ, reason: contains not printable characters */
    public final void m8970(int i, Date date) {
        synchronized (this.f15300) {
            this.f15298.edit().putInt("num_failed_realtime_streams", i).putLong("realtime_backoff_end_time_in_millis", date.getTime()).apply();
        }
    }

    /* renamed from: ˏˋٴ, reason: contains not printable characters */
    public final void m8971(Date date) {
        synchronized (this.f15300) {
            this.f15298.edit().putLong("realtime_backoff_end_time_in_millis", date.getTime()).apply();
        }
    }

    /* renamed from: ˏᵙ, reason: contains not printable characters */
    public final C4182 m8972() {
        C4182 c4182;
        synchronized (this.f15300) {
            int i = this.f15298.getInt("num_failed_realtime_streams", 0);
            Date date = new Date(this.f15298.getLong("realtime_backoff_end_time_in_millis", -1L));
            c4182 = new C4182();
            c4182.f15648 = i;
            c4182.f15649 = date;
        }
        return c4182;
    }

    /* renamed from: ᵝᵵᵺ, reason: contains not printable characters */
    public final void m8973() {
        synchronized (this.f15299) {
            this.f15298.edit().putInt("last_fetch_status", 2).apply();
        }
    }

    /* renamed from: ᵥᵯˎ, reason: contains not printable characters */
    public final C4182 m8974() {
        C4182 c4182;
        synchronized (this.f15297) {
            int i = this.f15298.getInt("num_failed_fetches", 0);
            Date date = new Date(this.f15298.getLong("backoff_end_time_in_millis", -1L));
            c4182 = new C4182();
            c4182.f15648 = i;
            c4182.f15649 = date;
        }
        return c4182;
    }

    /* renamed from: ᵴᵳ, reason: contains not printable characters */
    public final HashMap m8975() {
        try {
            JSONObject jSONObject = new JSONObject(this.f15298.getString("customSignals", "{}"));
            HashMap map = new HashMap();
            Iterator<String> itKeys = jSONObject.keys();
            while (itKeys.hasNext()) {
                String next = itKeys.next();
                map.put(next, jSONObject.optString(next));
            }
            return map;
        } catch (JSONException unused) {
            return new HashMap();
        }
    }

    /* renamed from: ᵹᵝᵶ, reason: contains not printable characters */
    public final void m8976() {
        synchronized (this.f15299) {
            this.f15298.edit().putInt("last_fetch_status", 1).apply();
        }
    }

    /* renamed from: ᵻᵢﹳᵰ, reason: contains not printable characters */
    public final void m8977(int i, Date date) {
        synchronized (this.f15297) {
            this.f15298.edit().putInt("num_failed_fetches", i).putLong("backoff_end_time_in_millis", date.getTime()).apply();
        }
    }
}
