Pebble: Ensure that we always try to install on the inactive firmware slot for dual slot firmware watches

This commit is contained in:
Benjamin Temple
2026-05-17 08:06:17 -07:00
parent 309dffbe61
commit 1f36e541e3
@@ -678,7 +678,9 @@ class PebbleIoThread extends GBDeviceIoThread {
if (mPBWReader.isFirmware()) {
LOG.info("starting firmware installation");
mIsInstalling = true;
mInstallSlot = 0;
// For dual-slot watches, mInstallSlot is the PUTBYTES bank number (0 or 1).
// It must match the inactive slot so we don't write into the running firmware.
mInstallSlot = (targetSlot != null) ? targetSlot : 0;
int totalFirmwareBytes = 0;
for (PebbleInstallable pi : mPebbleInstallables) {
totalFirmwareBytes += pi.getFileSize();