package com.mytatvarnsdk.receiver;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;

import java.util.Objects;

import cgmblelib.ble.BleService;

/**
 * 开机自启动程序
 *
 * @author minyuchun
 */
public class BootCompleteReceiver extends BroadcastReceiver {
  @Override
  public void onReceive(Context context, Intent intent) {
    if (intent != null) {
      switch (Objects.requireNonNull(intent.getAction())) {
        case Intent.ACTION_LOCKED_BOOT_COMPLETED:
        case Intent.ACTION_BOOT_COMPLETED:
          BleService.startService(context);
          break;
        default:
          break;
      }
    }
  }

}
