use of nodomain.freeyourgadget.gadgetbridge.service.devices.qhybrid.requests.fossil_hr.authentication.ConfirmOnDeviceRequest in project Gadgetbridge by Freeyourgadget.
the class FossilHRWatchAdapter method confirmOnWatch.
private void confirmOnWatch() {
queueWrite(new CheckDeviceNeedsConfirmationRequest() {
@Override
public void onResult(boolean needsConfirmation) {
GB.log("needs confirmation: " + needsConfirmation, GB.INFO, null);
if (needsConfirmation) {
final Timer timer = new Timer();
GB.toast("please confirm on device.", Toast.LENGTH_SHORT, GB.INFO);
queueWrite(new ConfirmOnDeviceRequest() {
@Override
public void onResult(boolean confirmationSuccess) {
isFinished = true;
timer.cancel();
if (!confirmationSuccess) {
GB.toast("connection unconfirmed on watch, unauthenticated mode", Toast.LENGTH_LONG, GB.ERROR);
}
initializeAfterWatchConfirmation(confirmationSuccess);
}
}, true);
timer.schedule(confirmTimeoutRunnable, 30000);
} else {
initializeAfterWatchConfirmation(true);
}
}
});
}
use of nodomain.freeyourgadget.gadgetbridge.service.devices.qhybrid.requests.fossil_hr.authentication.ConfirmOnDeviceRequest in project Gadgetbridge by Freeyourgadget.
the class FossilHRWatchAdapter method onFindDevice.
@Override
public void onFindDevice(boolean start) {
super.onFindDevice(start);
boolean versionSupportsConfirmation = getCleanFWVersion().compareTo(new Version("1.0.2.22")) != -1;
if (!versionSupportsConfirmation) {
GB.toast("not supported in this version", Toast.LENGTH_SHORT, GB.ERROR);
return;
}
if (start) {
queueWrite(new ConfirmOnDeviceRequest());
}
}
Aggregations