Search in sources :

Example 1 with SetDeviceStateRequest

use of nodomain.freeyourgadget.gadgetbridge.service.devices.qhybrid.requests.fossil.SetDeviceStateRequest in project Gadgetbridge by Freeyourgadget.

the class FossilHRWatchAdapter method initializeAfterWatchConfirmation.

private void initializeAfterWatchConfirmation(boolean authenticated) {
    setNotificationConfigurations();
    setQuickRepliesConfiguration();
    if (authenticated) {
        setVibrationStrength();
        setUnitsConfig();
        syncSettings();
        setTime();
    }
    overwriteButtons(null);
    loadBackground();
    loadWidgets();
    // renderWidgets();
    // dunno if there is any point in doing this at start since when no watch is connected the QHybridSupport will not receive any intents anyway
    queueWrite(new SetDeviceStateRequest(GBDevice.State.INITIALIZED));
}
Also used : SetDeviceStateRequest(nodomain.freeyourgadget.gadgetbridge.service.devices.qhybrid.requests.fossil.SetDeviceStateRequest)

Example 2 with SetDeviceStateRequest

use of nodomain.freeyourgadget.gadgetbridge.service.devices.qhybrid.requests.fossil.SetDeviceStateRequest in project Gadgetbridge by Freeyourgadget.

the class FossilHRWatchAdapter method initializeAfterAuthentication.

private void initializeAfterAuthentication(boolean authenticated) {
    queueWrite(new SetDeviceStateRequest(GBDevice.State.INITIALIZING));
    if (!authenticated) {
        GB.toast(getContext().getString(R.string.fossil_hr_auth_failed), Toast.LENGTH_LONG, GB.ERROR);
        initializeAfterWatchConfirmation(false);
        return;
    }
    boolean versionSupportsConfirmation = getCleanFWVersion().compareTo(new Version("1.0.2.22")) != -1;
    if (!versionSupportsConfirmation) {
        initializeAfterWatchConfirmation(true);
        return;
    }
    boolean shouldAuthenticateOnWatch = getDeviceSpecificPreferences().getBoolean("enable_on_device_confirmation", true);
    if (!shouldAuthenticateOnWatch) {
        GB.toast("Skipping on-device confirmation", Toast.LENGTH_SHORT, GB.INFO);
        initializeAfterWatchConfirmation(false);
        return;
    }
    confirmOnWatch();
}
Also used : Version(nodomain.freeyourgadget.gadgetbridge.util.Version) SetDeviceStateRequest(nodomain.freeyourgadget.gadgetbridge.service.devices.qhybrid.requests.fossil.SetDeviceStateRequest)

Example 3 with SetDeviceStateRequest

use of nodomain.freeyourgadget.gadgetbridge.service.devices.qhybrid.requests.fossil.SetDeviceStateRequest in project Gadgetbridge by Freeyourgadget.

the class FossilWatchAdapter method initializeWithSupportedFileVersions.

protected void initializeWithSupportedFileVersions() {
    syncConfiguration();
    syncNotificationSettings();
    syncButtonSettings();
    queueWrite(new SetDeviceStateRequest(GBDevice.State.INITIALIZED), false);
}
Also used : SetDeviceStateRequest(nodomain.freeyourgadget.gadgetbridge.service.devices.qhybrid.requests.fossil.SetDeviceStateRequest)

Example 4 with SetDeviceStateRequest

use of nodomain.freeyourgadget.gadgetbridge.service.devices.qhybrid.requests.fossil.SetDeviceStateRequest in project Gadgetbridge by Freeyourgadget.

the class FossilHRWatchAdapter method initializeWithSupportedFileVersions.

@Override
protected void initializeWithSupportedFileVersions() {
    if (getDeviceSupport().getDevice().getFirmwareVersion().contains("prod")) {
        GB.toast("Dummy FW, skipping initialization", Toast.LENGTH_LONG, GB.INFO);
        queueWrite(new SetDeviceStateRequest(GBDevice.State.INITIALIZED), false);
        return;
    }
    queueWrite(new SetDeviceStateRequest(GBDevice.State.AUTHENTICATING));
    negotiateSymmetricKey();
}
Also used : SetDeviceStateRequest(nodomain.freeyourgadget.gadgetbridge.service.devices.qhybrid.requests.fossil.SetDeviceStateRequest)

Aggregations

SetDeviceStateRequest (nodomain.freeyourgadget.gadgetbridge.service.devices.qhybrid.requests.fossil.SetDeviceStateRequest)4 Version (nodomain.freeyourgadget.gadgetbridge.util.Version)1