Here is the solution I came up with if this can help someone else. My application is still restarting even with START_NOT_STICKY . So, instead, I check if null makes sense, which means the service has been restarted by the system.
 @Override public int onStartCommand(@Nullable Intent intent, int flags, int startId) {