use of nodomain.freeyourgadget.gadgetbridge.service.devices.qhybrid.requests.fossil_hr.authentication.CheckDeviceNeedsConfirmationRequest 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);
}
}
});
}
Aggregations