package org.iotivity.bridge.homeserver;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.os.Build;
import android.util.Log;

public class AlarmReceiver extends BroadcastReceiver {

    final static String TAG = AlarmReceiver.class.getName();

    @Override
    public void onReceive(Context context, Intent intent) {

        Log.w(TAG, "AlarmReceiver onReceive() called");
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
            Intent in = new Intent(context, BridgeService.class);
            context.startForegroundService(in);
        } else {
            Intent in = new Intent(context, BridgeService.class);
            context.startService(in);
        }
    }
}
