mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge
synced 2025-01-15 12:17:33 +01:00
A few fixes to the init sequence
This commit is contained in:
parent
8fd0e1f13f
commit
6f18a1dd73
@ -51,7 +51,7 @@ public class GetConfigurationOperation extends AbstractBTLEOperation<CasioGBX100
|
|||||||
operationStatus = OperationStatus.FINISHED;
|
operationStatus = OperationStatus.FINISHED;
|
||||||
if (getDevice() != null) {
|
if (getDevice() != null) {
|
||||||
try {
|
try {
|
||||||
TransactionBuilder builder = performInitialized("finishe operation");
|
TransactionBuilder builder = performInitialized("finished operation");
|
||||||
builder.wait(0);
|
builder.wait(0);
|
||||||
builder.setGattCallback(null); // unset ourselves from being the queue's gatt callback
|
builder.setGattCallback(null); // unset ourselves from being the queue's gatt callback
|
||||||
builder.queue(getQueue());
|
builder.queue(getQueue());
|
||||||
|
@ -110,7 +110,16 @@ public class SetConfigurationOperation extends AbstractBTLEOperation<CasioGBX10
|
|||||||
data[i] = (byte)~data[i];
|
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");
|
LOG.info("No configuration update required");
|
||||||
requestTargetSettings();
|
requestTargetSettings();
|
||||||
} else {
|
} else {
|
||||||
@ -179,9 +188,8 @@ public class SetConfigurationOperation extends AbstractBTLEOperation<CasioGBX10
|
|||||||
|
|
||||||
operationStatus = OperationStatus.FINISHED;
|
operationStatus = OperationStatus.FINISHED;
|
||||||
if (getDevice() != null) {
|
if (getDevice() != null) {
|
||||||
unsetBusy();
|
|
||||||
try {
|
try {
|
||||||
TransactionBuilder builder = performInitialized("finishe operation");
|
TransactionBuilder builder = performInitialized("finished operation");
|
||||||
builder.setGattCallback(null); // unset ourselves from being the queue's gatt callback
|
builder.setGattCallback(null); // unset ourselves from being the queue's gatt callback
|
||||||
builder.wait(0);
|
builder.wait(0);
|
||||||
builder.queue(getQueue());
|
builder.queue(getQueue());
|
||||||
|
Loading…
x
Reference in New Issue
Block a user