mirror of
https://gitlab.com/comunic/comunicmobile
synced 2025-06-19 08:15:16 +00:00
Lock device awake during calls
This commit is contained in:
@ -10,6 +10,7 @@ import 'package:comunic/models/conversation.dart';
|
||||
import 'package:comunic/ui/routes/main_route.dart';
|
||||
import 'package:comunic/ui/widgets/safe_state.dart';
|
||||
import 'package:comunic/utils/account_utils.dart';
|
||||
import 'package:comunic/utils/device_utils.dart';
|
||||
import 'package:comunic/utils/intl_utils.dart';
|
||||
import 'package:comunic/utils/ui_utils.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
@ -147,6 +148,9 @@ class _CallScreenState extends SafeState<CallScreen> {
|
||||
await this._memberReady(peer.userID);
|
||||
|
||||
setState(() {});
|
||||
|
||||
// Lock device await
|
||||
await setWakeLock(true);
|
||||
} catch (e, stack) {
|
||||
print("Could not initialize call! $e\n$stack");
|
||||
setState(() => _error = true);
|
||||
@ -156,6 +160,8 @@ class _CallScreenState extends SafeState<CallScreen> {
|
||||
/// Do clean up operations when call screen is destroyed
|
||||
void _endCall() async {
|
||||
try {
|
||||
await setWakeLock(false);
|
||||
|
||||
// Close all ready members
|
||||
for (final member in _membersList.readyPeers)
|
||||
await _removeMember(member.userID);
|
||||
|
Reference in New Issue
Block a user