1
0
mirror of https://codeberg.org/Freeyourgadget/Gadgetbridge synced 2024-11-28 12:56:49 +01:00

display connection state in notification area

This commit is contained in:
cpfeiffer 2015-04-27 21:18:51 +02:00
parent 462f9f028f
commit 8e25c03350

View File

@ -1,5 +1,9 @@
package nodomain.freeyourgadget.gadgetbridge; package nodomain.freeyourgadget.gadgetbridge;
import nodomain.freeyourgadget.gadgetbridge.GBDevice.State;
import nodomain.freeyourgadget.gadgetbridge.miband.MiBandSupport;
import nodomain.freeyourgadget.gadgetbridge.pebble.PebbleIoThread;
import nodomain.freeyourgadget.gadgetbridge.pebble.PebbleSupport;
import android.app.NotificationManager; import android.app.NotificationManager;
import android.app.Service; import android.app.Service;
import android.bluetooth.BluetoothAdapter; import android.bluetooth.BluetoothAdapter;
@ -19,11 +23,6 @@ import android.support.v4.content.LocalBroadcastManager;
import android.util.Log; import android.util.Log;
import android.widget.Toast; import android.widget.Toast;
import nodomain.freeyourgadget.gadgetbridge.GBDevice.State;
import nodomain.freeyourgadget.gadgetbridge.miband.MiBandSupport;
import nodomain.freeyourgadget.gadgetbridge.pebble.PebbleIoThread;
import nodomain.freeyourgadget.gadgetbridge.pebble.PebbleSupport;
public class BluetoothCommunicationService extends Service { public class BluetoothCommunicationService extends Service {
public static final String ACTION_START public static final String ACTION_START
= "nodomain.freeyourgadget.gadgetbride.bluetoothcommunicationservice.action.start"; = "nodomain.freeyourgadget.gadgetbride.bluetoothcommunicationservice.action.start";
@ -68,6 +67,7 @@ public class BluetoothCommunicationService extends Service {
if (mGBDevice.equals(device)) { if (mGBDevice.equals(device)) {
mGBDevice = device; mGBDevice = device;
GB.setReceiversEnableState(mDeviceSupport.useAutoConnect() || mGBDevice.isConnected(), context); GB.setReceiversEnableState(mDeviceSupport.useAutoConnect() || mGBDevice.isConnected(), context);
GB.updateNotification(mGBDevice.getName() + " " + mGBDevice.getStateString(), context);
} }
} }
} }