Skip to content

Device: Fix "Last Seen" getting stuck while AirPods are connected#493

Merged
d4rken merged 1 commit into
mainfrom
fix/last-seen-aap-stale
Apr 8, 2026
Merged

Device: Fix "Last Seen" getting stuck while AirPods are connected#493
d4rken merged 1 commit into
mainfrom
fix/last-seen-aap-stale

Conversation

@d4rken

@d4rken d4rken commented Apr 8, 2026

Copy link
Copy Markdown
Member

What changed

Fixed the "Last Seen" time on the device settings screen showing values like "110 minutes ago" even while the AirPods are actively connected. It now stays in sync with what the phone is actually hearing from the AirPods, so while they're connected it reads as seconds — not hours — ago.

Technical Context

  • Root cause: once AAP is connected, iOS cuts down how often the AirPods send BLE advertisements. The BLE monitor evicts stale BLE snapshots after 20s, and "Last Seen" only consulted BLE (or a cached copy of that BLE timestamp), so the value froze to whatever the last BLE ad was and then decayed forever.
  • Fix: the getter now picks the most recent timestamp across BLE, AAP message traffic, and cache, so any incoming AAP message (battery, settings, ANC toggle, etc.) refreshes "Last Seen" too. Falls back to the old behavior when AAP has no messages yet.
  • Chose max(...) over a precedence chain so the three cases (BLE-only, AAP-only, both present) all collapse correctly without extra branching.
  • Known limitation kept out of scope: if AAP is connected but silent (e.g. user listening to music with no state changes), the timestamp will still drift. Matches the existing rssiQuality stance ("a quiet channel is not a weak channel") — a separate "connected now" indicator is a UX decision for later.

@d4rken d4rken added bug Something isn't working coms/AAP Uses Apples AirPod Protocol. Requires Android ROM with fixed L2CAP support on the Bluetooth sockets. labels Apr 8, 2026
@d4rken d4rken merged commit f2bf39b into main Apr 8, 2026
10 checks passed
@d4rken d4rken deleted the fix/last-seen-aap-stale branch April 8, 2026 17:21
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/AAP Uses Apples AirPod Protocol. Requires Android ROM with fixed L2CAP support on the Bluetooth sockets.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant