package com.ss.android.ugc.aweme.core;

import X.7lW;
import X.C4018EaE;
import android.app.job.JobParameters;
import android.app.job.JobService;
import android.content.Context;
import android.content.Intent;
import android.os.Message;
import android.os.PersistableBundle;
import com.bytedance.covode.number.Covode;
import com.bytedance.helios.sdk.utils.ServiceLifecycle;
import kotlin.h.b.n;

public final class AppWidgetSchedulerService extends JobService {
    public C4018EaE LIZ;

    static {
        Covode.recordClassIndex(62285);
    }

    public final int onStartCommand(Intent intent, int i, int i2) {
        ServiceLifecycle.onStartCommand(this, intent, i, i2);
        return super.onStartCommand(intent, i, i2);
    }

    public final boolean onStopJob(JobParameters jobParameters) {
        return false;
    }

    public final boolean onStartJob(JobParameters jobParameters) {
        int i;
        PersistableBundle extras;
        if (this.LIZ == null) {
            Context applicationContext = getApplicationContext();
            if (7lW.LIZJ && applicationContext == null) {
                applicationContext = 7lW.LIZ;
            }
            n.LIZIZ(applicationContext, "");
            this.LIZ = new C4018EaE(applicationContext, this);
        }
        Message message = new Message();
        if (jobParameters == null || (extras = jobParameters.getExtras()) == null) {
            i = -1;
        } else {
            i = extras.getInt("app_widget_action_type");
        }
        message.what = i;
        message.obj = jobParameters;
        C4018EaE eaE = this.LIZ;
        if (eaE == null) {
            return true;
        }
        eaE.sendMessage(message);
        return true;
    }
}
