1
0
mirror of https://codeberg.org/Freeyourgadget/Gadgetbridge synced 2024-09-27 08:47:03 +02:00

A few fixes to the init sequence

This commit is contained in:
Andreas Böhler 2020-11-20 22:27:41 +01:00 committed by Gitea
parent 8fd0e1f13f
commit 6f18a1dd73
2 changed files with 12 additions and 4 deletions

View File

@ -51,7 +51,7 @@ public class GetConfigurationOperation extends AbstractBTLEOperation<CasioGBX100
operationStatus = OperationStatus.FINISHED;
if (getDevice() != null) {
try {
TransactionBuilder builder = performInitialized("finishe operation");
TransactionBuilder builder = performInitialized("finished operation");
builder.wait(0);
builder.setGattCallback(null); // unset ourselves from being the queue's gatt callback
builder.queue(getQueue());

View File

@ -110,7 +110,16 @@ public class SetConfigurationOperation extends AbstractBTLEOperation<CasioGBX10
data[i] = (byte)~data[i];
}
if(Arrays.equals(oldData, data)) {
// This allows changing month and day of birth on the watch
// without having it overwritten on every sync
boolean match = true;
for(int i=0; i<8; i++) {
if(data[i] != oldData[i]) {
match = false;
break;
}
}
if(match) {
LOG.info("No configuration update required");
requestTargetSettings();
} else {
@ -179,9 +188,8 @@ public class SetConfigurationOperation extends AbstractBTLEOperation<CasioGBX10
operationStatus = OperationStatus.FINISHED;
if (getDevice() != null) {
unsetBusy();
try {
TransactionBuilder builder = performInitialized("finishe operation");
TransactionBuilder builder = performInitialized("finished operation");
builder.setGattCallback(null); // unset ourselves from being the queue's gatt callback
builder.wait(0);
builder.queue(getQueue());