mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge
synced 2024-12-25 18:15:49 +01:00
Core: added device update reason DEVICE_STATE
This commit is contained in:
parent
dfc1f164b4
commit
ec161be66e
@ -103,7 +103,8 @@ public class GBDevice implements Parcelable {
|
||||
public static enum DeviceUbdateSubject {
|
||||
UNKNOWN,
|
||||
NOTHING,
|
||||
CONNECTION_STATE
|
||||
CONNECTION_STATE,
|
||||
DEVICE_STATE,
|
||||
}
|
||||
|
||||
public GBDevice(String address, String name, String alias, String parentFolder, DeviceType deviceType) {
|
||||
|
@ -439,7 +439,8 @@ public class DeviceCommunicationService extends Service implements SharedPrefere
|
||||
|
||||
GBDevice.DeviceUbdateSubject subject = (GBDevice.DeviceUbdateSubject) intent.getSerializableExtra(GBDevice.EXTRA_UPDATE_SUBJECT);
|
||||
|
||||
if(subject == GBDevice.DeviceUbdateSubject.CONNECTION_STATE && device.isInitialized()){
|
||||
if(subject == GBDevice.DeviceUbdateSubject.DEVICE_STATE && device.isInitialized()){
|
||||
LOG.debug("device state update reason");
|
||||
sendDeviceConnectedBroadcast(device.getAddress());
|
||||
}
|
||||
}
|
||||
|
@ -37,7 +37,7 @@ public class SetDeviceStateAction extends PlainAction {
|
||||
@Override
|
||||
public boolean run(BluetoothGatt gatt) {
|
||||
device.setState(deviceState);
|
||||
device.sendDeviceUpdateIntent(getContext());
|
||||
device.sendDeviceUpdateIntent(getContext(), GBDevice.DeviceUbdateSubject.DEVICE_STATE);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -828,7 +828,7 @@ public class FossilWatchAdapter extends WatchAdapter {
|
||||
|
||||
private void setDeviceState(GBDevice.State state) {
|
||||
getDeviceSupport().getDevice().setState(state);
|
||||
getDeviceSupport().getDevice().sendDeviceUpdateIntent(getContext());
|
||||
getDeviceSupport().getDevice().sendDeviceUpdateIntent(getContext(), GBDevice.DeviceUbdateSubject.DEVICE_STATE);
|
||||
}
|
||||
|
||||
public void queueWrite(FossilRequest request, boolean priorise) {
|
||||
|
Loading…
Reference in New Issue
Block a user