@ MainThread public void startRangingBeaconsInRegion ( Region region , Callback callback ) { synchronized ( mScanHelper . getRangedRegionState ( ) ) { if ( mScanHelper . getRangedRegionState ( ) . containsKey ( region ) ) { LogManager . i ( TAG , "Already ranging that region -- will replace existing region." ) ; mScanHelper . getRangedRegionState ( ) . remove ( region ) ; // need to remove it, otherwise the old object will be retained because they are .equal //FIXME That is not true } mScanHelper . getRangedRegionState ( ) . put ( region , new RangeState ( callback ) ) ; LogManager . d ( TAG , "Currently ranging %s regions." , mScanHelper . getRangedRegionState ( ) . size ( ) ) ; } if ( mScanHelper . getCycledScanner ( ) != null ) { mScanHelper . getCycledScanner ( ) . start ( ) ; } }
methods for clients