Skip to content

Commit c456d6c

Browse files
malysclaude
andcommitted
fix(radio): stop tuning from taking over the audio source
SaicRadio.tune called srcPlayRadio right after setting the frequency, so every tune made the radio the current source. A caller that wanted the station preset while something else kept playing had no way to ask for it, and EVTasker's "enable radio" switch could not turn playback off. Tuning and playing are now two calls: tune sets the frequency, play switches the source. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
1 parent 77215a0 commit c456d6c

3 files changed

Lines changed: 19 additions & 6 deletions

File tree

‎CHANGELOG.md‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,16 @@ All notable changes to this project are documented here. Format follows
44
[Keep a Changelog](https://keepachangelog.com/en/1.1.0/); versions follow
55
[Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

7+
## [1.1.0] - 2026-08-22
8+
9+
### Changed
10+
11+
- `SaicRadio.tune` no longer starts playback. It used to call `srcPlayRadio` after setting
12+
the frequency, which made the radio the current audio source every time a station was
13+
tuned, so a caller that wanted the station changed silently had no way to ask for it.
14+
Tuning and playing are now two calls: `tune` sets the frequency, `play` switches the
15+
source. Callers that relied on the combined behaviour must call `play` themselves.
16+
717
## [1.0.1] - 2026-08-21
818

919
### Fixed

‎lib/src/main/java/com/evsuite/hardware/catalog/ActionType.kt‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,7 @@ enum class ActionType(
312312
),
313313

314314
/**
315-
* Tunes a station and makes the radio the current source.
315+
* Tunes a station, leaving the audio source alone — [PLAY_RADIO] is what starts playback.
316316
*
317317
* A free-text frequency rather than a band picker plus a slider: the driver knows their
318318
* station as "103.5", and an FM slider covering 87.5–108.0 in 50 kHz steps is 410

‎lib/src/main/java/com/evsuite/hardware/saic/SaicMedia.kt‎

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,14 @@ object SaicRadio {
4242
fun openScreen(): Boolean =
4343
SaicAidl.callBoolean(service.binder(), DESCRIPTOR, TX_START_ACTIVITY) ?: false
4444

45-
/** Tunes a frequency in kHz (FM 87500–108000) and makes radio the source. */
46-
fun tune(band: Int, frequencyKhz: Int): Boolean {
47-
if (!SaicAidl.callVoid(service.binder(), DESCRIPTOR, TX_TUNE, band, frequencyKhz)) return false
48-
return play()
49-
}
45+
/**
46+
* Tunes a frequency in kHz (FM 87500–108000), without touching the audio source.
47+
*
48+
* Tuning and playing are kept apart because a caller may want the station set without
49+
* the radio taking over what is currently playing; [play] is the explicit second step.
50+
*/
51+
fun tune(band: Int, frequencyKhz: Int): Boolean =
52+
SaicAidl.callVoid(service.binder(), DESCRIPTOR, TX_TUNE, band, frequencyKhz)
5053
}
5154

5255
/**

0 commit comments

Comments
 (0)