code: private boolean restartScanning() {
          if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
              mScanHelper.stopAndroidOBackgroundScan();
          }
          long scanPeriod = mScanState.getBackgroundMode() ? mScanState.getBackgroundScanPeriod() : mScanState.getForegroundScanPeriod();
          long betweenScanPeriod = mScanState.getBackgroundMode() ? mScanState.getBackgroundBetweenScanPeriod() : mScanState.getForegroundBetweenScanPeriod();
          if (mScanHelper.getCycledScanner() != null) {
              mScanHelper.getCycledScanner().setScanPeriods(scanPeriod,
                      betweenScanPeriod,
                      mScanState.getBackgroundMode());
          }
          mInitialized = true;
          if (scanPeriod <= 0) {
              LogManager.w(TAG, "Starting scan with scan period of zero.  Exiting ScanJob.");
              if (mScanHelper.getCycledScanner() != null) {
                  mScanHelper.getCycledScanner().stop();
              }
              return false;
          }
  
          if (mScanHelper.getRangedRegionState().size() > 0 || mScanHelper.getMonitoringStatus().regions().size() > 0) {
              if (mScanHelper.getCycledScanner() != null) {
                  mScanHelper.getCycledScanner().start();
              }
              return true;
          }
          else {
              if (mScanHelper.getCycledScanner() != null) {
                  mScanHelper.getCycledScanner().stop();
              }
              return false;
          }
      }
docs: Returns true of scanning actually was started, false if it did not need to be