Java Code Examples for com.eveningoutpost.dexdrip.UtilityModels.CollectionServiceStarter#isDexBridgeOrWifiandDexBridge()

The following examples show how to use com.eveningoutpost.dexdrip.UtilityModels.CollectionServiceStarter#isDexBridgeOrWifiandDexBridge() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: DexCollectionService.java    From xDrip with GNU General Public License v3.0 5 votes vote down vote up
@Override
public void onCreate() {

    if (scanMeister == null) {
        scanMeister = new ScanMeister()
                .applyKnownWorkarounds()
                .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();

}
 
Example 2
Source File: DexCollectionService.java    From xDrip with GNU General Public License v3.0 5 votes vote down vote up
@Override
public void onCreate() {

    if (scanMeister == null) {
        scanMeister = new ScanMeister()
                .applyKnownWorkarounds()
                .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();

}
 
Example 3
Source File: DexCollectionService.java    From xDrip-plus with GNU General Public License v3.0 5 votes vote down vote up
@Override
public void onCreate() {

    if (scanMeister == null) {
        scanMeister = new ScanMeister()
                .applyKnownWorkarounds()
                .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();

}
 
Example 4
Source File: DexCollectionService.java    From xDrip-plus with GNU General Public License v3.0 5 votes vote down vote up
@Override
public void onCreate() {

    if (scanMeister == null) {
        scanMeister = new ScanMeister()
                .applyKnownWorkarounds()
                .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();

}