1
0
mirror of https://codeberg.org/Freeyourgadget/Gadgetbridge synced 2024-06-09 06:38:01 +02:00

ZeTime: Fix could not synchronize calendar on connect

Fixes #1188
This commit is contained in:
Andreas Shimokawa 2020-05-05 14:11:46 +02:00
parent 1be42a4d84
commit 80fb05e44a
3 changed files with 12 additions and 6 deletions

View File

@ -10,6 +10,7 @@
* ZeTime: Support setting the watch language
* ZeTime: Support rejecting calls
* ZeTime: Try to fix weather conditions on newer firmwares
* ZeTime: Fix could not synchronize calendar on connect
#### Version 0.43.3
* Fossil Hybrid HR: Initial support for activity tracking (no sleep yet)

View File

@ -101,7 +101,7 @@ public class CalendarReceiver extends BroadcastReceiver {
DaoSession session = dbHandler.getDaoSession();
syncCalendar(eventList, session);
} catch (Exception e1) {
GB.toast("Database Error while syncing Calendar", Toast.LENGTH_SHORT, GB.ERROR);
GB.toast("Database Error while syncing Calendar", Toast.LENGTH_SHORT, GB.ERROR, e1);
}
}

View File

@ -71,9 +71,6 @@ import nodomain.freeyourgadget.gadgetbridge.util.GB;
import nodomain.freeyourgadget.gadgetbridge.util.GBPrefs;
import nodomain.freeyourgadget.gadgetbridge.util.Prefs;
/**
* Created by Kranz on 08.02.2018.
*/
public class ZeTimeDeviceSupport extends AbstractBTLEDeviceSupport {
private static final Logger LOG = LoggerFactory.getLogger(ZeTimeDeviceSupport.class);
@ -141,8 +138,6 @@ public class ZeTimeDeviceSupport extends AbstractBTLEDeviceSupport {
initMusicVolume(builder);
onReadReminders(builder);
builder.add(new SetDeviceStateAction(getDevice(), GBDevice.State.INITIALIZED, getContext()));
LOG.info("Initialization Done");
return builder;
}
@ -1038,6 +1033,16 @@ public class ZeTimeDeviceSupport extends AbstractBTLEDeviceSupport {
versionCmd.hwVersion = new String(string);
}
evaluateGBDeviceEvent(versionCmd);
TransactionBuilder builder = new TransactionBuilder("setDeviceInitialized");
builder.add(new SetDeviceStateAction(getDevice(), GBDevice.State.INITIALIZED, getContext()));
try {
performConnected(builder.getTransaction());
} catch (IOException e) {
LOG.error("could not set device to initzialized: ", e);
}
LOG.info("Initialization Done");
}
private void handleActivityFetching(byte[] msg) {