package L1;

import android.app.job.JobInfo;
import android.app.job.JobScheduler;
import android.content.ComponentName;
import android.os.PersistableBundle;
import p0.AbstractC0928a;

/* JADX INFO: renamed from: L1.h1, reason: case insensitive filesystem */
/* JADX INFO: loaded from: classes.dex */
public final class C0103h1 extends H {

    /* JADX INFO: renamed from: m, reason: collision with root package name */
    public JobScheduler f1837m;

    @Override // L1.H
    public final boolean n() {
        return true;
    }

    public final void o(long j5) {
        l();
        k();
        JobScheduler jobScheduler = this.f1837m;
        C0146w0 c0146w0 = (C0146w0) this.f29k;
        if (jobScheduler != null && jobScheduler.getPendingJob("measurement-client".concat(String.valueOf(c0146w0.f2032k.getPackageName())).hashCode()) != null) {
            X x5 = c0146w0.p;
            C0146w0.l(x5);
            x5.f1631x.b("[sgtm] There's an existing pending job, skip this schedule.");
            return;
        }
        int iP = p();
        if (iP != 2) {
            X x6 = c0146w0.p;
            C0146w0.l(x6);
            x6.f1631x.c("[sgtm] Not eligible for Scion upload", AbstractC0928a.x(iP));
            return;
        }
        X x7 = c0146w0.p;
        C0146w0.l(x7);
        x7.f1631x.c("[sgtm] Scheduling Scion upload, millis", Long.valueOf(j5));
        PersistableBundle persistableBundle = new PersistableBundle();
        persistableBundle.putString("action", "com.google.android.gms.measurement.SCION_UPLOAD");
        JobInfo jobInfoBuild = new JobInfo.Builder("measurement-client".concat(String.valueOf(c0146w0.f2032k.getPackageName())).hashCode(), new ComponentName(c0146w0.f2032k, "com.google.android.gms.measurement.AppMeasurementJobService")).setRequiredNetworkType(1).setMinimumLatency(j5).setOverrideDeadline(j5 + j5).setExtras(persistableBundle).build();
        JobScheduler jobScheduler2 = this.f1837m;
        s1.z.g(jobScheduler2);
        int iSchedule = jobScheduler2.schedule(jobInfoBuild);
        X x8 = c0146w0.p;
        C0146w0.l(x8);
        x8.f1631x.c("[sgtm] Scion upload job scheduled with result", iSchedule == 1 ? "SUCCESS" : "FAILURE");
    }

    public final int p() {
        l();
        k();
        if (this.f1837m == null) {
            return 7;
        }
        C0146w0 c0146w0 = (C0146w0) this.f29k;
        Boolean boolW = c0146w0.f2035n.w("google_analytics_sgtm_upload_enabled");
        if (!(boolW == null ? false : boolW.booleanValue())) {
            return 8;
        }
        if (c0146w0.q().f1507t < 119000) {
            return 6;
        }
        if (c2.D(c0146w0.f2032k)) {
            return !c0146w0.o().r() ? 5 : 2;
        }
        return 3;
    }
}
