package com.bytedance.push.frontier.setting;

import X.C34848tf;
import X.C34858tg;
import X.C34878ti;
import X.C34918tm;
import X.C34948tp;
import X.C35108u5;
import android.content.Context;
import android.content.SharedPreferences;
import com.bytedance.covode.number.Covode;

public class FrontierLocalSetting$$SettingImpl implements FrontierLocalSetting {
    public Context LIZ;
    public C34848tf LIZIZ;
    public final C34918tm LIZJ = new C34918tm() {
        static {
            Covode.recordClassIndex(36782);
        }

        public final <T> T LIZ(Class<T> cls) {
            if (cls == C34878ti.class) {
                return new C34878ti();
            }
            return null;
        }
    };

    static {
        Covode.recordClassIndex(36781);
    }

    public final long LIZ() {
        C34848tf r0 = this.LIZIZ;
        if (r0 == null || !r0.LJFF("last_request_setting_time_mil")) {
            return 0;
        }
        return this.LIZIZ.LIZJ("last_request_setting_time_mil");
    }

    public final C35108u5 LIZIZ() {
        C34848tf r0 = this.LIZIZ;
        if (r0 == null || !r0.LJFF("frontier_setting")) {
            C34858tg.LIZ(C34878ti.class, this.LIZJ);
            return new C35108u5();
        }
        return ((C34878ti) C34858tg.LIZ(C34878ti.class, this.LIZJ)).LIZ(this.LIZIZ.LIZ("frontier_setting"));
    }

    public void unregisterValChanged(C34948tp r2) {
        C34848tf r0 = this.LIZIZ;
        if (r0 != null) {
            r0.LIZ(r2);
        }
    }

    public final void LIZ(long j) {
        C34848tf r0 = this.LIZIZ;
        if (r0 != null) {
            SharedPreferences.Editor LIZ2 = r0.LIZ();
            LIZ2.putLong("last_request_setting_time_mil", j);
            LIZ2.apply();
        }
    }

    public final void LIZ(C35108u5 r4) {
        C34848tf r0 = this.LIZIZ;
        if (r0 != null) {
            SharedPreferences.Editor LIZ2 = r0.LIZ();
            C34858tg.LIZ(C34878ti.class, this.LIZJ);
            LIZ2.putString("frontier_setting", r4.LIZ().toString());
            LIZ2.apply();
        }
    }

    public FrontierLocalSetting$$SettingImpl(Context context, C34848tf r3) {
        this.LIZ = context;
        this.LIZIZ = r3;
    }

    public void registerValChanged(Context context, String str, String str2, C34948tp r5) {
        C34848tf r0 = this.LIZIZ;
        if (r0 != null) {
            r0.LIZ(context, str, str2, r5);
        }
    }
}
