@Override
 public int onStartCommand(Intent intent, int flags, int startId) {
   if (startId != 1) {
     Log.e(tag, "Trying to start " + this.getClass().getSimpleName() + " more than once!");
     return START_NOT_STICKY;
   }
   bluetoothPermitted = intent.getBooleanExtra("bluetooth", false);
   Log.i(tag, "starting SSM  thread");
   if (Config.sendMails) {
     LogsRecorder.startRecording();
   }
   wrapper.start(new ComponentLauncher(this), Config.useAuthentication);
   startForeground(1, NotificationHandler.createMainNotification(this));
   return START_NOT_STICKY; // is set as a foreground service anyway
 }