From eef72d8b706886f6ea5cbf926679ed669a18753b Mon Sep 17 00:00:00 2001 From: Saif Shaikh Date: Wed, 14 Jan 2026 03:37:00 -0800 Subject: [PATCH] fix: Brightness issue #299 --- src/components/player/android/hooks/usePlayerSetup.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/components/player/android/hooks/usePlayerSetup.ts b/src/components/player/android/hooks/usePlayerSetup.ts index a9a396e9..05630a8d 100644 --- a/src/components/player/android/hooks/usePlayerSetup.ts +++ b/src/components/player/android/hooks/usePlayerSetup.ts @@ -111,11 +111,12 @@ export const usePlayerSetup = ( return () => { subscription?.remove(); disableImmersiveMode(); - - // Restore brightness on unmount - if (Platform.OS === 'android' && originalSystemBrightnessRef.current !== null) { - // restoration logic normally happens here or in a separate effect + async function restoreBrightness() { + await Brightness.setBrightnessAsync(originalSystemBrightnessRef.current!); + setBrightness(originalSystemBrightnessRef.current!); } + if (Platform.OS === 'android' && originalSystemBrightnessRef.current !== null) + restoreBrightness(); }; }, []);