From 69165aa3ed8642dd821ede2d3efd378f9385b4cd Mon Sep 17 00:00:00 2001 From: Benoit Martins Date: Mon, 6 May 2024 16:27:17 +0200 Subject: [PATCH] Prevent screen lock during a call --- Linphone/UI/Main/ContentView.swift | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Linphone/UI/Main/ContentView.swift b/Linphone/UI/Main/ContentView.swift index ad6d718ec..1bac741d9 100644 --- a/Linphone/UI/Main/ContentView.swift +++ b/Linphone/UI/Main/ContentView.swift @@ -962,6 +962,7 @@ struct ContentView: View { .zIndex(5) .transition(.scale.combined(with: .move(edge: .top))) .onAppear { + UIApplication.shared.isIdleTimerDisabled = true callViewModel.resetCallView() if callViewModel.calls.count >= 1 { DispatchQueue.main.asyncAfter(deadline: .now() + 1) { @@ -969,6 +970,9 @@ struct ContentView: View { } } } + .onDisappear { + UIApplication.shared.isIdleTimerDisabled = false + } } ToastView()