Skip to content

Fix: Accurate signal bars and stable connection icons#491

Merged
d4rken merged 1 commit into
mainfrom
fix/signal-bars-and-connection-icons
Apr 8, 2026
Merged

Fix: Accurate signal bars and stable connection icons#491
d4rken merged 1 commit into
mainfrom
fix/signal-bars-and-connection-icons

Conversation

@d4rken

@d4rken d4rken commented Apr 8, 2026

Copy link
Copy Markdown
Member

What changed

  • Signal bars are accurate again. AirPods right next to the phone show 4 bars immediately instead of being stuck at 2–3 bars while a counter ramped up.
  • Individual connection icons are back. The badge shows up to four indicators (BLE scan, identity verification, encryption, active Bluetooth) instead of collapsing to a single Bluetooth icon.
  • Badge and bars stay stable during audio playback. Previously they'd disappear ~20 seconds after the card appeared while AirPods were actively connected.

Technical Context

  • Signal bars: The RSSI-to-quality formula capped even -30 dBm at 0.70. Split into rssiQuality (pure linear, display only) and signalQuality (composite with reliability + age, used for profile matching and sorting). The 0.15 filter still rejects -100 dBm noise.
  • Badge collapse: Earlier refactor in a102b032 accidentally reduced the badge to two icons. New DeviceConnectionBadge renders four conditional icons and gives ENC its own lock glyph (previously shared the key icon).
  • Disappearing icons during audio: The Android device holding the classic Bluetooth audio connection stops seeing that peer's BLE advertisements ~20s in (verified against a second phone that still sees them fine). Stabilized two ways: profileKeyState on PodDevice drives key/lock icons from the stable AppleDeviceProfile so a lost scan batch doesn't lose them; rssiQuality falls back to 1.0 when AAP is READY, since a healthy audio connection is proof the signal is fine. Rejected alternative: graduating off AAP message age — the channel is event-driven, so a quiet audio session can go minutes without a message. The BLE antenna icon stays honest — only shown when a live advertisement actually arrived.

Review checklist

  • rssiQuality (display) vs signalQuality (matching) split — AppleFactory.kt:104 (filter), TroubleShooterViewModel.kt:219 (sorting), and BlePodMonitor.kt:114 (sorting) must keep using the composite value
  • bleKeyState prefers profileKeyState while the device is live, falls back to live isIRKMatch for anonymous BLE pods with no profile entry
  • rssiQuality AAP fallback only triggers on READY, not during CONNECTING / HANDSHAKING
  • Cached-only card path returns NONE for bleKeyState even when profileKeyState is set — intentional, nothing is actively verifying the keys

@d4rken d4rken added bug Something isn't working coms/BLE Uses Apple's Proximity Payloads, based on BLE broadcasted advertisements. labels Apr 8, 2026
@d4rken d4rken merged commit ed37e14 into main Apr 8, 2026
10 checks passed
@d4rken d4rken deleted the fix/signal-bars-and-connection-icons branch April 8, 2026 16:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working coms/BLE Uses Apple's Proximity Payloads, based on BLE broadcasted advertisements.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant