code: private void startForegroundIfConfigured() {
          BeaconManager beaconManager = BeaconManager.getInstanceForApplication(
                  this.getApplicationContext());
          Notification notification = beaconManager
                  .getForegroundServiceNotification();
          int notificationId = beaconManager
                  .getForegroundServiceNotificationId();
          if (notification != null &&
                  Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {
              this.startForeground(notificationId, notification);
          }
      }
docs: /*
  This starts the scanning service as a foreground service if it is so configured in the
  manifest