public synchronized void scan() { if (scanMeister == null) { scanMeister = new ScanMeister(); } else { scanMeister.stop(); } // TODO expand this list scanMeister .setName("Lefun") .setName("F3") .setName("W3") .addCallBack(this, TAG).scan(); }
public synchronized void scan() { if (scanMeister == null) { scanMeister = new ScanMeister(); } else { scanMeister.stop(); } // TODO expand this list scanMeister .setName("Lefun") .setName("F3") .setName("W3") .addCallBack(this, TAG).scan(); }
@Override public void onCreate() { if (scanMeister == null) { scanMeister = new ScanMeister() .addCallBack(this, TAG); } foregroundServiceStarter = new ForegroundServiceStarter(getApplicationContext(), this); foregroundServiceStarter.start(); //mContext = getApplicationContext(); dexCollectionService = this; prefs = PreferenceManager.getDefaultSharedPreferences(getApplicationContext()); listenForChangeInSettings(); //bgToSpeech = BgToSpeech.setupTTS(mContext); //keep reference to not being garbage collected if (CollectionServiceStarter.isDexBridgeOrWifiandDexBridge()) { Log.i(TAG, "onCreate: resetting bridge_battery preference to 0"); prefs.edit().putInt("bridge_battery", 0).apply(); //if (Home.get_master()) GcmActivity.sendBridgeBattery(prefs.getInt("bridge_battery",-1)); } cloner.dontClone( android.bluetooth.BluetoothDevice.class, android.bluetooth.BluetoothGattService.class ); final IntentFilter pairingRequestFilter = new IntentFilter(BluetoothDevice.ACTION_PAIRING_REQUEST); pairingRequestFilter.setPriority(IntentFilter.SYSTEM_HIGH_PRIORITY - 1); registerReceiver(mPairingRequestRecevier, pairingRequestFilter); Log.i(TAG, "onCreate: STARTING SERVICE: pin code: " + DEFAULT_BT_PIN); Blukon.unBondIfBlukonAtInit(); }
@Override public void onCreate() { if (scanMeister == null) { scanMeister = new ScanMeister() .addCallBack(this, TAG); } foregroundServiceStarter = new ForegroundServiceStarter(getApplicationContext(), this); foregroundServiceStarter.start(); //mContext = getApplicationContext(); dexCollectionService = this; prefs = PreferenceManager.getDefaultSharedPreferences(getApplicationContext()); listenForChangeInSettings(); //bgToSpeech = BgToSpeech.setupTTS(mContext); //keep reference to not being garbage collected if (CollectionServiceStarter.isDexBridgeOrWifiandDexBridge()) { Log.i(TAG, "onCreate: resetting bridge_battery preference to 0"); prefs.edit().putInt("bridge_battery", 0).apply(); //if (Home.get_master()) GcmActivity.sendBridgeBattery(prefs.getInt("bridge_battery",-1)); } cloner.dontClone( android.bluetooth.BluetoothDevice.class, android.bluetooth.BluetoothGattService.class ); final IntentFilter pairingRequestFilter = new IntentFilter(BluetoothDevice.ACTION_PAIRING_REQUEST); pairingRequestFilter.setPriority(IntentFilter.SYSTEM_HIGH_PRIORITY - 1); registerReceiver(mPairingRequestRecevier, pairingRequestFilter); Log.i(TAG, "onCreate: STARTING SERVICE: pin code: " + DEFAULT_BT_PIN); Blukon.unBondIfBlukonAtInit(); }
@Override public void onCreate() { if (scanMeister == null) { scanMeister = new ScanMeister() .addCallBack(this, TAG); } foregroundServiceStarter = new ForegroundServiceStarter(getApplicationContext(), this); foregroundServiceStarter.start(); //mContext = getApplicationContext(); dexCollectionService = this; prefs = PreferenceManager.getDefaultSharedPreferences(getApplicationContext()); listenForChangeInSettings(); //bgToSpeech = BgToSpeech.setupTTS(mContext); //keep reference to not being garbage collected if (CollectionServiceStarter.isDexBridgeOrWifiandDexBridge()) { Log.i(TAG, "onCreate: resetting bridge_battery preference to 0"); prefs.edit().putInt("bridge_battery", 0).apply(); //if (Home.get_master()) GcmActivity.sendBridgeBattery(prefs.getInt("bridge_battery",-1)); } cloner.dontClone( android.bluetooth.BluetoothDevice.class, android.bluetooth.BluetoothGattService.class ); final IntentFilter pairingRequestFilter = new IntentFilter(BluetoothDevice.ACTION_PAIRING_REQUEST); pairingRequestFilter.setPriority(IntentFilter.SYSTEM_HIGH_PRIORITY - 1); registerReceiver(mPairingRequestRecevier, pairingRequestFilter); Log.i(TAG, "onCreate: STARTING SERVICE: pin code: " + DEFAULT_BT_PIN); Blukon.unBondIfBlukonAtInit(); }