From d208373b3a21ed7971923dfd3b50193af4017da7 Mon Sep 17 00:00:00 2001 From: Gleidson Daniel Silva Date: Mon, 9 Jan 2023 10:29:58 -0300 Subject: [PATCH] Regression: Prevent screen from sleeping on Jitsi on Android (#4791) --- app/views/JitsiMeetView.android.tsx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/views/JitsiMeetView.android.tsx b/app/views/JitsiMeetView.android.tsx index 344a656a..ce54691c 100644 --- a/app/views/JitsiMeetView.android.tsx +++ b/app/views/JitsiMeetView.android.tsx @@ -4,6 +4,7 @@ import BackgroundTimer from 'react-native-background-timer'; import { isAppInstalled, openAppWithUri } from 'react-native-send-intent'; import WebView from 'react-native-webview'; import { WebViewMessage, WebViewNavigation } from 'react-native-webview/lib/WebViewTypes'; +import { activateKeepAwake, deactivateKeepAwake } from 'expo-keep-awake'; import { IBaseScreen } from '../definitions'; import { events, logEvent } from '../lib/methods/helpers/log'; @@ -44,6 +45,7 @@ class JitsiMeetView extends React.Component { .catch(() => {}); this.onConferenceJoined(); this.backHandler = BackHandler.addEventListener('hardwareBackPress', () => true); + activateKeepAwake(); } componentWillUnmount() { @@ -54,6 +56,7 @@ class JitsiMeetView extends React.Component { BackgroundTimer.stopBackgroundTimer(); } this.backHandler.remove(); + deactivateKeepAwake(); } // Jitsi Update Timeout needs to be called every 10 seconds to make sure