Regression: Prevent screen from sleeping on Jitsi on Android (#4791)

This commit is contained in:
Gleidson Daniel Silva 2023-01-09 10:29:58 -03:00 committed by GitHub
parent 24ad69346a
commit d208373b3a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 0 deletions

View File

@ -4,6 +4,7 @@ import BackgroundTimer from 'react-native-background-timer';
import { isAppInstalled, openAppWithUri } from 'react-native-send-intent'; import { isAppInstalled, openAppWithUri } from 'react-native-send-intent';
import WebView from 'react-native-webview'; import WebView from 'react-native-webview';
import { WebViewMessage, WebViewNavigation } from 'react-native-webview/lib/WebViewTypes'; import { WebViewMessage, WebViewNavigation } from 'react-native-webview/lib/WebViewTypes';
import { activateKeepAwake, deactivateKeepAwake } from 'expo-keep-awake';
import { IBaseScreen } from '../definitions'; import { IBaseScreen } from '../definitions';
import { events, logEvent } from '../lib/methods/helpers/log'; import { events, logEvent } from '../lib/methods/helpers/log';
@ -44,6 +45,7 @@ class JitsiMeetView extends React.Component<TJitsiMeetViewProps> {
.catch(() => {}); .catch(() => {});
this.onConferenceJoined(); this.onConferenceJoined();
this.backHandler = BackHandler.addEventListener('hardwareBackPress', () => true); this.backHandler = BackHandler.addEventListener('hardwareBackPress', () => true);
activateKeepAwake();
} }
componentWillUnmount() { componentWillUnmount() {
@ -54,6 +56,7 @@ class JitsiMeetView extends React.Component<TJitsiMeetViewProps> {
BackgroundTimer.stopBackgroundTimer(); BackgroundTimer.stopBackgroundTimer();
} }
this.backHandler.remove(); this.backHandler.remove();
deactivateKeepAwake();
} }
// Jitsi Update Timeout needs to be called every 10 seconds to make sure // Jitsi Update Timeout needs to be called every 10 seconds to make sure