Skip to content

An open-source cross-platform alternative to AirDrop

fix(android): avoid display flashes when opening/closing the app on some Android TVs (#3496)

Shlomo672220672005
diff --git a/app/lib/config/init.dart b/app/lib/config/init.dart
index 00091dcf..02c6c690 100644
--- a/app/lib/config/init.dart
+++ b/app/lib/config/init.dart
@@ -199,10 +199,14 @@ Future<void> postInit(BuildContext context, Ref ref, bool appStart) async {
await updateSystemOverlayStyle(context);
if (checkPlatform([TargetPlatform.android])) {
- try {
- await FlutterDisplayMode.setHighRefreshRate();
- } catch (e) {
- _logger.warning('Setting high refresh rate failed', e);
+ // On some TVs, requesting a high refresh rate can trigger HDMI resync and blank the display when entering or leaving the app.
+ // https://github.com/localsend/localsend/issues/3452
+ if (!ref.read(tvProvider)) {
+ try {
+ await FlutterDisplayMode.setHighRefreshRate();
+ } catch (e) {
+ _logger.warning('Setting high refresh rate failed', e);
+ }
}
// Android 17+ blocks multicast discovery and LAN connections until this permission is granted,