package com.tcl.ah.tvcontrol.service;

import android.app.job.JobInfo;
import android.app.job.JobScheduler;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.os.Build;

import androidx.annotation.RequiresApi;

public class ServiceHelper {


    public static ComponentName startService(Context context, Intent intent) {


        try {
            if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
                return context.startForegroundService(intent);
            } else {
                return context.startService(intent);
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
        return null;
    }


}
