private boolean initialzeScanHelper() {
        mScanHelper = new ScanHelper(this);
        mScanState = ScanState.restore(ScanJob.this);
        mScanState.setLastScanStartTimeMillis(System.currentTimeMillis());
        mScanHelper.setMonitoringStatus(mScanState.getMonitoringStatus());
        mScanHelper.setRangedRegionState(mScanState.getRangedRegionState());
        mScanHelper.setBeaconParsers(mScanState.getBeaconParsers());
        mScanHelper.setExtraDataBeaconTracker(mScanState.getExtraBeaconDataTracker());
        if (mScanHelper.getCycledScanner() == null) {
            try {
                mScanHelper.createCycledLeScanner(mScanState.getBackgroundMode(), null);
            }
            catch (OutOfMemoryError e) {
                LogManager.w(TAG, "Failed to create CycledLeScanner thread.");
                return false;
            }
        }
        return true;
    }
private boolean initialzeScanHelper ( ) { mScanHelper = new ScanHelper ( this ) ; mScanState = ScanState . restore ( ScanJob . this ) ; mScanState . setLastScanStartTimeMillis ( System . currentTimeMillis ( ) ) ; mScanHelper . setMonitoringStatus ( mScanState . getMonitoringStatus ( ) ) ; mScanHelper . setRangedRegionState ( mScanState . getRangedRegionState ( ) ) ; mScanHelper . setBeaconParsers ( mScanState . getBeaconParsers ( ) ) ; mScanHelper . setExtraDataBeaconTracker ( mScanState . getExtraBeaconDataTracker ( ) ) ; if ( mScanHelper . getCycledScanner ( ) == null ) { try { mScanHelper . createCycledLeScanner ( mScanState . getBackgroundMode ( ) , null ) ; } catch ( OutOfMemoryError e ) { LogManager . w ( TAG , "Failed to create CycledLeScanner thread." ) ; return false ; } } return true ; }
Returns false if cycle thread cannot be allocated