layout and remote fix
🏗️ Build and Test JellyTau / Run Tests (push) Successful in 4m31s
Traceability Validation / Check Requirement Traces (push) Successful in 20s
Build & Release / Run Tests (push) Successful in 5m24s
🏗️ Build and Test JellyTau / Android Compile Check (push) Successful in 4m29s
Build & Release / Build Linux (push) Successful in 17m27s
Build & Release / Build Android (push) Successful in 22m14s
Build & Release / Create Release (push) Successful in 12s

This commit is contained in:
2026-07-16 22:53:03 +02:00
parent 532ffa661a
commit 1992a8187d
10 changed files with 272 additions and 192 deletions
+27 -8
View File
@@ -113,6 +113,26 @@ impl PlaybackModeManager {
}
}
/// Start the Android playback service and hand it remote-volume control.
///
/// Must run on EVERY transition into remote mode, because it is what starts
/// the foreground service. Without a running service there is no media
/// notification (the lockscreen card is missing) AND system volume buttons
/// aren't intercepted for the remote session (remote volume control dead).
/// Both symptoms share this one cause, so this must not be skipped on any
/// remote-entry path (notably the empty-queue early return in
/// `transfer_to_remote_inner`). No-op / non-Android builds do nothing.
#[allow(unused_variables)]
fn enable_remote_control(&self) {
#[cfg(target_os = "android")]
{
if let Err(e) = crate::player::enable_remote_volume(50) {
log::warn!("[PlaybackMode] Failed to enable remote volume/service: {}", e);
// Non-fatal - continue; the next poll tick will retry metadata.
}
}
}
/// Check if currently transferring
pub fn is_transferring(&self) -> bool {
self.is_transferring.load(Ordering::Relaxed)
@@ -334,6 +354,10 @@ impl PlaybackModeManager {
self.set_mode(PlaybackMode::Remote {
session_id: session_id.to_string(),
});
// Start the service + remote-volume control here too — otherwise this
// early return leaves remote mode with no media notification and no
// volume interception (lockscreen card missing + remote volume dead).
self.enable_remote_control();
return Ok(());
}
@@ -589,14 +613,9 @@ impl PlaybackModeManager {
session_id: session_id.to_string(),
});
// Enable remote volume control on Android (intercepts volume buttons)
#[cfg(target_os = "android")]
{
if let Err(e) = crate::player::enable_remote_volume(50) {
log::warn!("[PlaybackMode] Failed to enable remote volume: {}", e);
// Non-fatal - continue with transfer
}
}
// Start the service + remote-volume control (intercepts volume buttons,
// and starts the foreground service that renders the lockscreen card).
self.enable_remote_control();
log::info!("[PlaybackMode] Successfully transferred to remote");
Ok(())