diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/deviceevents/GBDeviceEventSleepMonitorResult.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/deviceevents/GBDeviceEventSleepMonitorResult.java
deleted file mode 100644
index 5721c39a1..000000000
--- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/deviceevents/GBDeviceEventSleepMonitorResult.java
+++ /dev/null
@@ -1,25 +0,0 @@
-/* Copyright (C) 2015-2019 Andreas Shimokawa
-
- This file is part of Gadgetbridge.
-
- Gadgetbridge is free software: you can redistribute it and/or modify
- it under the terms of the GNU Affero General Public License as published
- by the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- Gadgetbridge is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU Affero General Public License for more details.
-
- You should have received a copy of the GNU Affero General Public License
- along with this program. If not, see . */
-package nodomain.freeyourgadget.gadgetbridge.deviceevents;
-
-public class GBDeviceEventSleepMonitorResult extends GBDeviceEvent {
- // FIXME: this is just the low-level data from Morpheuz, we need something generic
- public int smartalarm_from = -1; // time in minutes relative from 0:00 for smart alarm (earliest)
- public int smartalarm_to = -1;// time in minutes relative from 0:00 for smart alarm (latest)
- public int recording_base_timestamp = -1; // timestamp for the first "point", all folowing are +10 minutes offset each
- public int alarm_gone_off = -1; // time in minutes relative from 0:00 when alarm gone off
-}
diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/AbstractDeviceSupport.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/AbstractDeviceSupport.java
index 0aba18fbf..2bdf62878 100644
--- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/AbstractDeviceSupport.java
+++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/AbstractDeviceSupport.java
@@ -58,7 +58,6 @@ import nodomain.freeyourgadget.gadgetbridge.deviceevents.GBDeviceEventLEDColor;
import nodomain.freeyourgadget.gadgetbridge.deviceevents.GBDeviceEventMusicControl;
import nodomain.freeyourgadget.gadgetbridge.deviceevents.GBDeviceEventNotificationControl;
import nodomain.freeyourgadget.gadgetbridge.deviceevents.GBDeviceEventScreenshot;
-import nodomain.freeyourgadget.gadgetbridge.deviceevents.GBDeviceEventSleepMonitorResult;
import nodomain.freeyourgadget.gadgetbridge.deviceevents.GBDeviceEventVersionInfo;
import nodomain.freeyourgadget.gadgetbridge.externalevents.NotificationListener;
import nodomain.freeyourgadget.gadgetbridge.impl.GBDevice;
@@ -151,8 +150,6 @@ public abstract class AbstractDeviceSupport implements DeviceSupport {
handleGBDeviceEvent((GBDeviceEventVersionInfo) deviceEvent);
} else if (deviceEvent instanceof GBDeviceEventAppInfo) {
handleGBDeviceEvent((GBDeviceEventAppInfo) deviceEvent);
- } else if (deviceEvent instanceof GBDeviceEventSleepMonitorResult) {
- handleGBDeviceEvent((GBDeviceEventSleepMonitorResult) deviceEvent);
} else if (deviceEvent instanceof GBDeviceEventScreenshot) {
handleGBDeviceEvent((GBDeviceEventScreenshot) deviceEvent);
} else if (deviceEvent instanceof GBDeviceEventNotificationControl) {
@@ -258,18 +255,6 @@ public abstract class AbstractDeviceSupport implements DeviceSupport {
LocalBroadcastManager.getInstance(context).sendBroadcast(appInfoIntent);
}
- private void handleGBDeviceEvent(GBDeviceEventSleepMonitorResult sleepMonitorResult) {
- Context context = getContext();
- LOG.info("Got event for SLEEP_MONIOR_RES");
- Intent sleepMonitorIntent = new Intent(ChartsHost.REFRESH);
- sleepMonitorIntent.putExtra("smartalarm_from", sleepMonitorResult.smartalarm_from);
- sleepMonitorIntent.putExtra("smartalarm_to", sleepMonitorResult.smartalarm_to);
- sleepMonitorIntent.putExtra("recording_base_timestamp", sleepMonitorResult.recording_base_timestamp);
- sleepMonitorIntent.putExtra("alarm_gone_off", sleepMonitorResult.alarm_gone_off);
-
- LocalBroadcastManager.getInstance(context).sendBroadcast(sleepMonitorIntent);
- }
-
private void handleGBDeviceEvent(GBDeviceEventScreenshot screenshot) {
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMdd-hhmmss", Locale.US);
String filename = "screenshot_" + dateFormat.format(new Date()) + ".bmp";
diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/pebble/AppMessageHandlerMisfit.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/pebble/AppMessageHandlerMisfit.java
index 4c7e15836..165c9059d 100644
--- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/pebble/AppMessageHandlerMisfit.java
+++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/pebble/AppMessageHandlerMisfit.java
@@ -36,6 +36,7 @@ import nodomain.freeyourgadget.gadgetbridge.deviceevents.GBDeviceEventSendBytes;
import nodomain.freeyourgadget.gadgetbridge.devices.pebble.PebbleMisfitSampleProvider;
import nodomain.freeyourgadget.gadgetbridge.entities.PebbleMisfitSample;
import nodomain.freeyourgadget.gadgetbridge.impl.GBDevice;
+import nodomain.freeyourgadget.gadgetbridge.util.GB;
import nodomain.freeyourgadget.gadgetbridge.util.Prefs;
class AppMessageHandlerMisfit extends AppMessageHandler {
@@ -71,6 +72,7 @@ class AppMessageHandlerMisfit extends AppMessageHandler {
LOG.info("incoming data start");
break;
case KEY_INCOMING_DATA_END:
+ GB.signalActivityDataFinish();
LOG.info("incoming data end");
break;
case KEY_INCOMING_DATA:
diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/pebble/AppMessageHandlerMorpheuz.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/pebble/AppMessageHandlerMorpheuz.java
index 7dfa84a47..e0625712a 100644
--- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/pebble/AppMessageHandlerMorpheuz.java
+++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/pebble/AppMessageHandlerMorpheuz.java
@@ -35,7 +35,6 @@ import nodomain.freeyourgadget.gadgetbridge.database.DBHandler;
import nodomain.freeyourgadget.gadgetbridge.database.DBHelper;
import nodomain.freeyourgadget.gadgetbridge.deviceevents.GBDeviceEvent;
import nodomain.freeyourgadget.gadgetbridge.deviceevents.GBDeviceEventSendBytes;
-import nodomain.freeyourgadget.gadgetbridge.deviceevents.GBDeviceEventSleepMonitorResult;
import nodomain.freeyourgadget.gadgetbridge.devices.pebble.PebbleMorpheuzSampleProvider;
import nodomain.freeyourgadget.gadgetbridge.entities.PebbleMorpheuzSample;
import nodomain.freeyourgadget.gadgetbridge.util.GB;
@@ -70,7 +69,7 @@ class AppMessageHandlerMorpheuz extends AppMessageHandler {
private static final Logger LOG = LoggerFactory.getLogger(AppMessageHandlerMorpheuz.class);
- public AppMessageHandlerMorpheuz(UUID uuid, PebbleProtocol pebbleProtocol) {
+ AppMessageHandlerMorpheuz(UUID uuid, PebbleProtocol pebbleProtocol) {
super(uuid, pebbleProtocol);
try {
@@ -108,16 +107,11 @@ class AppMessageHandlerMorpheuz extends AppMessageHandler {
@Override
public GBDeviceEvent[] handleMessage(ArrayList> pairs) {
int ctrl_message = 0;
- GBDeviceEventSleepMonitorResult sleepMonitorResult = null;
for (Pair pair : pairs) {
if (Objects.equals(pair.first, keyTransmit)) {
- sleepMonitorResult = new GBDeviceEventSleepMonitorResult();
- sleepMonitorResult.smartalarm_from = smartalarm_from;
- sleepMonitorResult.smartalarm_to = smartalarm_to;
- sleepMonitorResult.alarm_gone_off = alarm_gone_off;
- sleepMonitorResult.recording_base_timestamp = recording_base_timestamp;
ctrl_message |= CTRL_TRANSMIT_DONE;
+ GB.signalActivityDataFinish();
} else if (pair.first.equals(keyGoneoff)) {
alarm_gone_off = (int) pair.second;
LOG.info("got gone off: " + alarm_gone_off / 60 + ":" + alarm_gone_off % 60);
@@ -187,7 +181,7 @@ class AppMessageHandlerMorpheuz extends AppMessageHandler {
sendBytesCtrl.encodedBytes = encodeMorpheuzMessage(keyCtrl, ctrl_message);
}
- // ctrl and sleep monitor might be null, thats okay
- return new GBDeviceEvent[]{sendBytesAck, sendBytesCtrl, sleepMonitorResult};
+ // ctrl might be null, thats okay
+ return new GBDeviceEvent[]{sendBytesAck, sendBytesCtrl};
}
}