导航菜单

页面标题

页面副标题

Online Loans v421.2.42 - MobileMessagingJobService.java 源代码

正在查看: Online Loans v421.2.42 应用的 MobileMessagingJobService.java JAVA 源代码文件

本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。


package org.infobip.mobile.messaging.platform;

import android.annotation.TargetApi;
import android.app.job.JobInfo;
import android.app.job.JobParameters;
import android.app.job.JobScheduler;
import android.app.job.JobService;
import android.content.ComponentName;
import android.content.Context;
import android.text.TextUtils;
import org.infobip.mobile.messaging.MobileMessagingCore;
import org.infobip.mobile.messaging.logging.MobileMessagingLogger;

@TargetApi(24)
public class MobileMessagingJobService extends JobService {
    public static final String b = "MobileMessagingJobService";
    public MobileMessagingCore a;

    public MobileMessagingJobService() {
    }

    public static void b(Context context) {
        JobScheduler jobScheduler = (JobScheduler) context.getSystemService("jobscheduler");
        if (jobScheduler == null) {
            return;
        }
        int scheduleId = MobileMessagingJob.getScheduleId(context, 1);
        jobScheduler.cancel(scheduleId);
        if (jobScheduler.schedule(new JobInfo.Builder(scheduleId, new ComponentName(context, (Class<?>) MobileMessagingJobService.class)).setRequiredNetworkType(1).build()) == 1) {
            MobileMessagingLogger.d(b, "Registered job for connectivity updates");
        } else {
            MobileMessagingLogger.e(b, "Failed to register job for connectivity updates");
        }
    }

    public static void registerJobForConnectivityUpdates(Context context) {
        b(context);
    }

    public final MobileMessagingCore a() {
        if (this.a == null) {
            this.a = MobileMessagingCore.getInstance(getApplicationContext());
        }
        return this.a;
    }

    @Override
    public boolean onStartJob(JobParameters jobParameters) {
        if (jobParameters.getJobId() != MobileMessagingJob.getScheduleId(this, 1) || TextUtils.isEmpty(a().getApplicationCode())) {
            return false;
        }
        MobileMessagingLogger.d(b, "Network available");
        a().retrySyncOnNetworkAvailable();
        return false;
    }

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

    public MobileMessagingJobService(MobileMessagingCore mobileMessagingCore) {
        this.a = mobileMessagingCore;
    }
}