From 0aaaabcc110f40c66a4fba52fd987c0fc3484833 Mon Sep 17 00:00:00 2001 From: dakhnod Date: Tue, 31 Dec 2019 03:35:11 +0100 Subject: [PATCH] code cleanup --- .../fossil_hr/configuration/ConfigurationPutRequest.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/qhybrid/requests/fossil_hr/configuration/ConfigurationPutRequest.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/qhybrid/requests/fossil_hr/configuration/ConfigurationPutRequest.java index e9b3f2ef7..2c4f06c76 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/qhybrid/requests/fossil_hr/configuration/ConfigurationPutRequest.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/qhybrid/requests/fossil_hr/configuration/ConfigurationPutRequest.java @@ -29,8 +29,6 @@ import nodomain.freeyourgadget.gadgetbridge.util.GB; import nodomain.freeyourgadget.gadgetbridge.service.devices.qhybrid.requests.fossil.configuration.ConfigurationPutRequest.ConfigItem; public class ConfigurationPutRequest extends FileEncryptedPutRequest { - private static HashMap> itemsById = new HashMap<>(); - public ConfigurationPutRequest(ConfigItem item, FossilHRWatchAdapter adapter) { super((short) 0x0800, createFileContent(new ConfigItem[]{item}), adapter); } @@ -40,9 +38,9 @@ public class ConfigurationPutRequest extends FileEncryptedPutRequest { } private static byte[] createFileContent(ConfigItem[] items) { - int overallSize = 0; + int overallSize = items.length * 3; for(ConfigItem item : items){ - overallSize += item.getItemSize() + 3; + overallSize += item.getItemSize(); } ByteBuffer buffer = ByteBuffer.allocate(overallSize); buffer.order(ByteOrder.LITTLE_ENDIAN);