package com.google.android.gms.measurement;

import G3.b;
import J.m;
import P2.C0253j;
import P2.w;
import android.annotation.TargetApi;
import android.app.Service;
import android.app.job.JobParameters;
import android.app.job.JobService;
import android.content.Intent;
import android.os.Parcelable;
import android.util.Log;
import com.google.android.gms.internal.measurement.C0662l0;
import com.google.android.gms.internal.measurement.X;
import d3.I;
import d3.InterfaceC0833w1;
import d3.Q1;
import d3.V0;
import d3.Z;
import java.util.Objects;

/* JADX INFO: loaded from: classes.dex */
@TargetApi(24)
public final class AppMeasurementJobService extends JobService implements InterfaceC0833w1 {

    /* JADX INFO: renamed from: q, reason: collision with root package name */
    public V0 f10090q;

    @Override // d3.InterfaceC0833w1
    public final void a(Intent intent) {
    }

    @Override // d3.InterfaceC0833w1
    public final boolean b(int i) {
        throw new UnsupportedOperationException();
    }

    @Override // d3.InterfaceC0833w1
    public final void c(JobParameters jobParameters) {
        jobFinished(jobParameters, false);
    }

    public final V0 d() {
        if (this.f10090q == null) {
            this.f10090q = new V0(1, this);
        }
        return this.f10090q;
    }

    @Override // android.app.Service
    public final void onCreate() {
        super.onCreate();
        Log.v("FA", ((Service) d().f11784r).getClass().getSimpleName().concat(" is starting up."));
    }

    @Override // android.app.Service
    public final void onDestroy() {
        Log.v("FA", ((Service) d().f11784r).getClass().getSimpleName().concat(" is shutting down."));
        super.onDestroy();
    }

    @Override // android.app.Service
    public final void onRebind(Intent intent) {
        d();
        if (intent == null) {
            Log.e("FA", "onRebind called with null intent");
        } else {
            Log.v("FA", "onRebind called. action: ".concat(String.valueOf(intent.getAction())));
        }
    }

    @Override // android.app.job.JobService
    public final boolean onStartJob(JobParameters jobParameters) {
        V0 v0D = d();
        v0D.getClass();
        String string = jobParameters.getExtras().getString("action");
        Log.v("FA", "onStartJob received action: ".concat(String.valueOf(string)));
        boolean zEquals = Objects.equals(string, "com.google.android.gms.measurement.UPLOAD");
        Service service = (Service) v0D.f11784r;
        if (zEquals) {
            w.f(string);
            Q1 q1O0 = Q1.o0(service);
            Z zE = q1O0.e();
            C0253j c0253j = q1O0.f11659B.f12147v;
            zE.D.c(string, "Local AppMeasurementJobService called. action");
            q1O0.c().O(new b(q1O0, 21, new m((Object) v0D, (Object) zE, (Parcelable) jobParameters, 9)));
        }
        if (!Objects.equals(string, "com.google.android.gms.measurement.SCION_UPLOAD")) {
            return true;
        }
        w.f(string);
        C0662l0 c0662l0D = C0662l0.d(service, null);
        if (!((Boolean) I.f11525U0.a(null)).booleanValue()) {
            return true;
        }
        b bVar = new b(v0D, 20, jobParameters);
        c0662l0D.getClass();
        c0662l0D.b(new X(c0662l0D, bVar, 1));
        return true;
    }

    @Override // android.app.job.JobService
    public final boolean onStopJob(JobParameters jobParameters) {
        return false;
    }

    @Override // android.app.Service
    public final boolean onUnbind(Intent intent) {
        d();
        if (intent == null) {
            Log.e("FA", "onUnbind called with null intent");
            return true;
        }
        Log.v("FA", "onUnbind called for intent. action: ".concat(String.valueOf(intent.getAction())));
        return true;
    }
}
