code: private boolean mustStopScanToPreventAndroidNScanTimeout() {
          long timeOfNextScanCycleEnd = SystemClock.elapsedRealtime() +  mBetweenScanPeriod +
                  mScanPeriod;
          boolean timeoutAtRisk = android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.N &&
                  mCurrentScanStartTime > 0 &&
                  (timeOfNextScanCycleEnd - mCurrentScanStartTime > ANDROID_N_MAX_SCAN_DURATION_MILLIS);
  
          if (timeoutAtRisk) {
              LogManager.d(TAG, "The next scan cycle would go over the Android N max duration.");
              if  (mLongScanForcingEnabled) {
                  LogManager.d(TAG, "Stopping scan to prevent Android N scan timeout.");
                  return true;
              }
              else {
                  LogManager.w(TAG, "Allowing a long running scan to be stopped by the OS.  To " +
                          "prevent this, set longScanForcingEnabled in the AndroidBeaconLibrary.");
              }
          }
          return false;
      }
docs: On Android N and later, a scan that runs for more than 30 minutes will be automatically
  stopped by the OS and converted to an "opportunistic" scan, meaning that they will only yield
  detections if another app is scanning.  This is inteneded to save battery.  This can be
  prevented by stopping scanning and restarting.  This method returns true if:
  * this is Android N or later
  * we are close to the 30 minute boundary since the last scan started
  * The app developer has explicitly enabled long-running scans
  @return true if we must stop scanning to prevent