code: public void enableForegroundServiceScanning(Notification notification, int notificationId)
              throws IllegalStateException {
          if (isAnyConsumerBound()) {
              throw new IllegalStateException("May not be called after consumers are already bound.");
          }
          if (notification == null) {
              throw new NullPointerException("Notification cannot be null");
          }
          setEnableScheduledScanJobs(false);
          mForegroundServiceNotification = notification;
          mForegroundServiceNotificationId = notificationId;
      }
docs: Configures the library to use a foreground service for bacon scanning.  This allows nearly
  constant scanning on most Android versions to get around background limits, and displays an
  icon to the user to indicate that the app is doing something in the background, even on
  Android 8+.  This will disable the user of the JobScheduler on Android 8 to do scans.  Note
  that this method does not by itself enable constant scanning.  The scan intervals will work
  as normal and must be configurd to specific values depending on how often you wish to scan.
  
  @see #setForegroundScanPeriod(long)
  @see #setForegroundBetweenScanPeriod(long)
  
  This method requires a notification to display a message to the user about why the app is
  scanning in the background.  The notification must include an icon that will be displayed
  in the top bar whenever the scanning service is running.
  
  If the BeaconService is configured to run in a different process, this call will have no
  effect.
  
  @param notification - the notification that will be displayed when beacon scanning is active,
  along with the icon that shows up in the status bar.
  
  @throws IllegalStateException if called after consumers are already bound to the scanning
  service