updatePairingFailure method

void updatePairingFailure(
  1. String deviceId
)

A failed bond is an event, not a state: it reports isPaired: false regardless of what was cached before, so it must not go through updatePairingState's dedup — otherwise every failure after the first is swallowed (#325). The cached value is still refreshed so later genuine transitions dedup as usual.

Implementation

void updatePairingFailure(String deviceId) {
  final canonicalId = _deviceId(deviceId).canonical;
  _lastPairStateMap[canonicalId] = false;
  _emitPairingState(canonicalId, false);
}