From b3d83c1580e358d55a02a14fa8abba922576b654 Mon Sep 17 00:00:00 2001 From: QuentinArguillere Date: Mon, 13 Jan 2025 14:36:45 +0100 Subject: [PATCH] Do not trigger onEnterBackground // onEnterForeground corecontext event when there is a call in progress. This avoids a UI deadlock from iOS video filters when entering foreground with video capture active --- Linphone/LinphoneApp.swift | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/Linphone/LinphoneApp.swift b/Linphone/LinphoneApp.swift index 0991472b9..f4cecd826 100644 --- a/Linphone/LinphoneApp.swift +++ b/Linphone/LinphoneApp.swift @@ -237,13 +237,15 @@ struct LinphoneApp: App { } } }.onChange(of: scenePhase) { newPhase in - if newPhase == .active { - Log.info("Entering foreground") - coreContext.onEnterForeground() - } else if newPhase == .inactive { - } else if newPhase == .background { - Log.info("Entering background") - coreContext.onEnterBackground() + if !TelecomManager.shared.callInProgress { + if newPhase == .active { + Log.info("Entering foreground") + coreContext.onEnterForeground() + } else if newPhase == .inactive { + } else if newPhase == .background { + Log.info("Entering background") + coreContext.onEnterBackground() + } } } }