package me.jaxbot.wear.preconditioningleaf;

import android.app.Notification;
import android.app.NotificationManager;
import android.app.Service;
import android.content.Intent;
import android.os.IBinder;
import android.util.Log;

public class StartACService extends Service {
    private final static String TAG = "StartACService";
    public StartACService() {
    }

    @Override
    public IBinder onBind(Intent intent) {
        // TODO: Return the communication channel to the service.
        throw new UnsupportedOperationException("Not yet implemented");
    }

    @Override
    public int onStartCommand(Intent intent, int flags, int startId) {
        Log.i(TAG, "Started service.");

        String eventName;
        eventName = intent.getStringExtra("eventName");

        Notification.Builder mBuilder =
                new Notification.Builder(this)
                        .setSmallIcon(R.drawable.ic_leaf_notification)
                        .setContentTitle("Starting AC for " + eventName);

        NotificationManager mNotificationManager = (NotificationManager)
                getSystemService(NOTIFICATION_SERVICE);
        mNotificationManager.notify(2, mBuilder.build());
        return super.onStartCommand(intent, flags, startId);
    }
}

@@ -686,24 +686,182 @@
 ervice.%22);%0A%0A
+        // Start_Sticky command, or other action without intent%0A        if (intent == null)%0A            return super.onStartCommand(intent, flags, startId);%0A%0A
         Stri
@@ -1351,16 +1351,17 @@
 ild());%0A
+%0A
         

Fix crashing when starting service