1
0
mirror of https://codeberg.org/Freeyourgadget/Gadgetbridge synced 2025-02-04 14:07:32 +01:00

Ensure battery states are kept in their correct battery indices

Seems to have missed adding the index here, causing devices with multiple batteries (like that of wireless earbuds) to have incorrect states despite being set properly from their respective device support code.

Signed-off-by: John Vincent Corcega <git@tenseventyseven.xyz>
This commit is contained in:
John Vincent Corcega 2025-02-02 19:16:59 +08:00 committed by José Rebelo
parent 6a397b9119
commit 7409349154

View File

@ -550,7 +550,7 @@ public abstract class AbstractDeviceSupport implements DeviceSupport {
Context context = getContext();
LOG.info("Got BATTERY_INFO device event");
gbDevice.setBatteryLevel(deviceEvent.level, deviceEvent.batteryIndex);
gbDevice.setBatteryState(deviceEvent.state);
gbDevice.setBatteryState(deviceEvent.state, deviceEvent.batteryIndex);
gbDevice.setBatteryVoltage(deviceEvent.voltage, deviceEvent.batteryIndex);
final DevicePrefs devicePrefs = GBApplication.getDevicePrefs(gbDevice);