fix: companion remote acts as remote instead of host on Android TV

This commit is contained in:
edde746
2026-04-01 16:23:31 +02:00
parent 87da5b400e
commit b16a6a6bd5
4 changed files with 10 additions and 4 deletions
+1 -1
View File
@@ -894,7 +894,7 @@ class _DiscoverScreenState extends State<DiscoverScreen>
const Spacer(),
Consumer2<WatchTogetherProvider, CompanionRemoteProvider>(
builder: (context, watchTogether, companionRemote, _) {
final isDesktop = PlatformDetector.isDesktop(context);
final isDesktop = PlatformDetector.shouldActAsRemoteHost(context);
final userProvider = context.watch<UserProfileProvider>();
return FocusableActionBar(
+2 -2
View File
@@ -419,8 +419,8 @@ class _MainScreenState extends State<MainScreen> with RouteAware, WindowListener
_multiServerProvider!.addListener(_handleLiveTvChanged);
}
// Wire up Companion Remote command routing (desktop only, once)
if (!_companionRemoteSetup && PlatformDetector.isDesktop(context)) {
// Wire up Companion Remote command routing (host devices only, once)
if (!_companionRemoteSetup && PlatformDetector.shouldActAsRemoteHost(context)) {
_companionRemoteSetup = true;
_setupCompanionRemote();
}
+1 -1
View File
@@ -1160,7 +1160,7 @@ class _SettingsScreenState extends State<SettingsScreen> with FocusableTab {
style: Theme.of(context).textTheme.titleMedium?.copyWith(fontWeight: FontWeight.bold),
),
),
if (PlatformDetector.isDesktop(context))
if (PlatformDetector.shouldActAsRemoteHost(context))
ListTile(
leading: const AppIcon(Symbols.phone_android_rounded, fill: 1),
title: Text(t.companionRemote.hostRemoteSession),
+6
View File
@@ -51,6 +51,12 @@ class PlatformDetector {
return isDesktop(context) || isTV();
}
/// Whether this device should act as a companion remote host (receiver).
/// Desktop platforms and Android TV are hosts; phones/tablets are controllers.
static bool shouldActAsRemoteHost(BuildContext context) {
return isDesktop(context) || isTV();
}
/// Detects if running on a mobile platform (iOS or Android)
/// Uses Theme for consistent platform detection across the app
static bool isMobile(BuildContext context) {