Search in sources :

Example 1 with FileGetRawRequest

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

the class FossilHRWatchAdapter method downloadFile.

@Override
public void downloadFile(final FileHandle handle, boolean fileIsEncrypted) {
    if (fileIsEncrypted) {
        queueWrite((FileEncryptedInterface) new FileEncryptedGetRequest(handle, this) {

            @Override
            public void handleFileData(byte[] fileData) {
                LOG.debug("downloaded encrypted file");
                handleFileDownload(handle, fileData);
            }
        });
    } else {
        queueWrite(new FileGetRawRequest(handle, this) {

            @Override
            public void handleFileRawData(byte[] fileData) {
                LOG.debug("downloaded regular file");
                handleFileDownload(handle, fileData);
            }
        });
    }
}
Also used : FileEncryptedGetRequest(nodomain.freeyourgadget.gadgetbridge.service.devices.qhybrid.requests.fossil_hr.file.FileEncryptedGetRequest) FileGetRawRequest(nodomain.freeyourgadget.gadgetbridge.service.devices.qhybrid.requests.fossil.file.FileGetRawRequest)

Aggregations

FileGetRawRequest (nodomain.freeyourgadget.gadgetbridge.service.devices.qhybrid.requests.fossil.file.FileGetRawRequest)1 FileEncryptedGetRequest (nodomain.freeyourgadget.gadgetbridge.service.devices.qhybrid.requests.fossil_hr.file.FileEncryptedGetRequest)1