code: @TargetApi(18)
      public void updateScanPeriods() throws RemoteException {
          if (!isBleAvailableOrSimulated()) {
              LogManager.w(TAG, "Method invocation will be ignored.");
              return;
          }
          if (determineIfCalledFromSeparateScannerProcess()) {
              return;
          }
          LogManager.d(TAG, "updating background flag to %s", mBackgroundMode);
          LogManager.d(TAG, "updating scan period to %s, %s", this.getScanPeriod(), this.getBetweenScanPeriod());
          applyChangesToServices(BeaconService.MSG_SET_SCAN_PERIODS, null);
      }
docs: Updates an already running scan with scanPeriod/betweenScanPeriod according to Background/Foreground state.
  Change will take effect on the start of the next scan cycle.
  
  @throws RemoteException - If the BeaconManager is not bound to the service.