Skip to content

fix(calls): self-healing phone reconnect (tincan-c7b8g)#176

Merged
quad341 merged 2 commits into
mainfrom
fix/tincan-c7b8g-phone-reconnect-selfheal
Jul 5, 2026
Merged

fix(calls): self-healing phone reconnect (tincan-c7b8g)#176
quad341 merged 2 commits into
mainfrom
fix/tincan-c7b8g-phone-reconnect-selfheal

Conversation

@quad341

@quad341 quad341 commented Jul 5, 2026

Copy link
Copy Markdown
Owner

What this changes

When the phone drops off tincand's Bluetooth connection — out of range, asleep overnight, whatever — call features currently stay broken until someone manually reconnects the device and restarts the daemon. This closes three related gaps so a reconnect self-heals:

  • tincand no longer gives up watching for the phone's call service after the first 30 seconds of retries; it keeps polling at a slower, steady cadence indefinitely until the phone comes back.
  • Calling Connect() on a paired-but-disconnected phone now actually drives the Bluetooth connection (Device1.Connect()), instead of only flipping tincand's internal state while the link itself stayed down.
  • Daemon status exposes a new call_link_ready field reflecting whether calling is actually possible right now (a live call service is bound). The existing call_setup_ready is intentionally left alone — it tracks system-level readiness (e.g. the SELinux module), not per-connection state — so this is additive, not a redefinition.

Review notes

  • The Bluetooth connect call is dispatched asynchronously (reply_handler/error_handler), not synchronously. tincand runs a single event loop, and this call can block for the whole connection-attempt window — a synchronous version would freeze all daemon activity (messages, notifications, everything) until it returns or times out. If this ever regresses back to a blocking call, that's the daemon-wide freeze to watch for; it's easy to miss outside a live/integration run.
  • GUI is not wired to the new call_link_ready field in this change — natural follow-up, out of scope here.
  • Dedicated unit tests for the three new decision paths (steady-state retry, async connect, call_link_ready wiring) are tracked separately and in progress; the existing full suite passes unmodified against this change.

Test plan

quad341 added 2 commits July 5, 2026 08:38
…e modem re-arm, honest call readiness (tincan-c7b8g)

Three gaps found in live testing after a phone drop overnight:
- CallController gave up modem discovery permanently after a 30s fast
  backoff; now falls back to indefinite steady polling so a later
  reconnect self-heals without a daemon restart.
- Daemon.Connect() only flipped internal state without touching BlueZ;
  now drives org.bluez Device1.Connect() (async — a sync call was found
  to block the daemon's single main loop for the whole connection
  attempt, verified live against a real device).
- GetStatus() had no way to distinguish "SELinux module present" from
  "HFP link actually bound" — added a distinct call_link_ready
  capability reflecting CallController's live VoiceCallManager state,
  without repurposing the existing SELinux-scoped call_setup_ready.

Filed tincan-cq5c7 (needs-tests) for coverage of the new decision paths.
@quad341
quad341 merged commit 3faf6b4 into main Jul 5, 2026
1 check passed
@quad341
quad341 deleted the fix/tincan-c7b8g-phone-reconnect-selfheal branch July 5, 2026 16:11
quad341 added a commit that referenced this pull request Jul 5, 2026
Test coverage companion to #176 (tincan-c7b8g self-heal fix). The fix landed in #176; this squash adds only the new tests (call_controller/dbus_service/hfp_capability).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant