mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge.git
synced 2025-01-11 01:21:56 +01:00
Log connection attempt when BT is turned on
This commit is contained in:
parent
2ae4497261
commit
b157f84b83
@ -6,11 +6,17 @@ import android.content.Context;
|
|||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.support.v4.content.LocalBroadcastManager;
|
import android.support.v4.content.LocalBroadcastManager;
|
||||||
|
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
import nodomain.freeyourgadget.gadgetbridge.GBApplication;
|
import nodomain.freeyourgadget.gadgetbridge.GBApplication;
|
||||||
import nodomain.freeyourgadget.gadgetbridge.devices.DeviceManager;
|
import nodomain.freeyourgadget.gadgetbridge.devices.DeviceManager;
|
||||||
|
import nodomain.freeyourgadget.gadgetbridge.service.devices.pebble.PebbleIoThread;
|
||||||
import nodomain.freeyourgadget.gadgetbridge.util.Prefs;
|
import nodomain.freeyourgadget.gadgetbridge.util.Prefs;
|
||||||
|
|
||||||
public class BluetoothStateChangeReceiver extends BroadcastReceiver {
|
public class BluetoothStateChangeReceiver extends BroadcastReceiver {
|
||||||
|
private static final Logger LOG = LoggerFactory.getLogger(BluetoothStateChangeReceiver.class);
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onReceive(Context context, Intent intent) {
|
public void onReceive(Context context, Intent intent) {
|
||||||
String action = intent.getAction();
|
String action = intent.getAction();
|
||||||
@ -26,6 +32,7 @@ public class BluetoothStateChangeReceiver extends BroadcastReceiver {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
LOG.info("Bluetooth turned on => connecting...");
|
||||||
GBApplication.deviceService().connect();
|
GBApplication.deviceService().connect();
|
||||||
} else if (intent.getIntExtra(BluetoothAdapter.EXTRA_STATE, -1) == BluetoothAdapter.STATE_OFF) {
|
} else if (intent.getIntExtra(BluetoothAdapter.EXTRA_STATE, -1) == BluetoothAdapter.STATE_OFF) {
|
||||||
GBApplication.quit();
|
GBApplication.quit();
|
||||||
|
Loading…
Reference in New Issue
Block a user