Skip to content

fix(android): show the Mac's Streaming Mode and Custom frame rate - #288

Merged
raiseCatError merged 1 commit into
devfrom
fix/142-receiver-request-restarts
Nov 16, 2026
Merged

raiseCatError merged 1 commit into
devfrom
fix/142-receiver-request-restarts

Conversation

@raiseCatError

Copy link
Copy Markdown
Owner

Summary

Android parity for the receiver Streaming Profile fix. iOS, iPadOS and the Mac Receiver already read the Mac's Streaming Mode (#153); Android didn't.

Before this change, Android parsed only profile from streamingProfileState:

  • With the Mac in Automatic, the Streaming Profile, Frame Rate and Priority choices stayed editable, and a pick snapped back after the Mac declined it.
  • With the Mac in Custom, picking the Custom profile sent a local frame rate that was never synced, so it could overwrite the Mac's stored rate.

Now Android:

  • parses the optional mode and customFrameRate keys, as the Swift receivers do; each state carries the mode afresh;
  • in Automatic, shows the choices disabled with the same note as iOS, and doesn't send a request the Mac would decline;
  • in Custom, takes the Mac's frame rate, so picking Custom keeps it;
  • reads the current frame rate under the session lock (it was a default argument, evaluated before @Synchronized took the lock).

Related issue: #142 (stays open for the physical checks).

Scope and compatibility

  • Platforms/components affected: Android receiver (core settings model, Settings screen). RECEIVER_CONTROLS.md.
  • User-visible behavior: Android Streaming choices are read-only while the Mac is in Automatic, with an explanation.
  • Compatibility: no protocol version or feature change; both keys were already optional. A Mac that doesn't send mode leaves the choices as before.

Verification

Check Result and evidence
Automated tests / lint / build Local, JDK 17: :core:test --tests '*StreamSettingsTest*' 16/16 pass (4 new: parsing, Automatic lock, Custom rate sync, older Mac). Full :core:test: 1,012 run, 1,009 pass, 2 skipped, 1 fails only on macOS (MediaListenerTest.oneHostCannotTakeEveryHandshakeSlot binds 127.0.0.2; unrelated, passes on Linux CI). :app:compileDebugKotlin passes.
Physical devices tested (models and OS versions) None.
Simulator or emulator (if used) None.
Not tested / known limitations Android device check with the Mac in Automatic and in Custom; two receivers.

Safety and review checklist

  • This is a focused change with no unrelated refactors.
  • Relevant automated checks ran; failures or skipped tests are documented.
  • I distinguished real-device verification from simulator/emulator or unit tests.
  • Existing pairing, security and consent behavior is preserved, or changes are explained.
  • Public screenshots, logs and test data contain no personal data, private endpoints, identifiers, secrets or pairing codes.
  • Documentation, user-facing terminology and accessibility were updated if relevant.
  • No signing material, credentials, provisioning profiles or local build artifacts are included.
  • This PR does not tag, release, publish, or alter protected release workflows without explicit maintainer coordination.

Notes for reviewers

An independent review found the default-argument race; it is fixed in this commit. CI path classification: android and release-tooling jobs only.

Android parsed only `profile` from `streamingProfileState`. Under the Mac's
Automatic mode its Streaming Profile and Priority pickers stayed editable,
so a pick snapped back after the Mac declined it. In Custom, picking the
Custom profile sent a local frame rate that had never been synced, which
could overwrite the Mac's stored rate.

- Parse the optional `mode` and `customFrameRate` keys, as iOS and the Mac
  Receiver already do. Each state carries the mode afresh; a Mac that
  doesn't send it leaves the pickers as before.
- In Automatic, show the pickers disabled with the iOS note, and refuse to
  send a profile or priority request the Mac would decline.
- In Custom, take the Mac's frame rate, so picking Custom keeps it. The
  current rate is now read under the session lock, not in a default
  argument evaluated before the lock is taken.

No protocol change: the keys were already optional on the wire.
@raiseCatError
raiseCatError marked this pull request as ready for review November 16, 2026 06:59
@raiseCatError
raiseCatError merged commit 9ac96a2 into dev Nov 16, 2026
9 checks passed
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