From 03dfd7fc7b7c380abf72569c6ed977deedce4974 Mon Sep 17 00:00:00 2001 From: Guillaume BIENKOWSKI Date: Mon, 18 Nov 2013 10:58:05 +0100 Subject: [PATCH] Solve the PR #1004, Can't answer call from lock screen if app is in background and we slide the bottom of the lockscreen (not the push) What was happening: we would land into the dialer view, but with an incoming call in BG, which would confuse the UI. --- Classes/LinphoneAppDelegate.m | 12 +++++++----- Classes/PhoneMainView.h | 1 + 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/Classes/LinphoneAppDelegate.m b/Classes/LinphoneAppDelegate.m index 299bdedd3..2029ed228 100644 --- a/Classes/LinphoneAppDelegate.m +++ b/Classes/LinphoneAppDelegate.m @@ -92,15 +92,15 @@ - (void)applicationDidBecomeActive:(UIApplication *)application { [LinphoneLogger logc:LinphoneLoggerLog format:"applicationDidBecomeActive"]; [self startApplication]; - - [[LinphoneManager instance] becomeActive]; + LinphoneManager* instance = [LinphoneManager instance]; + + [instance becomeActive]; LinphoneCore* lc = [LinphoneManager getLc]; LinphoneCall* call = linphone_core_get_current_call(lc); if (call){ - LinphoneManager* instance = [LinphoneManager instance]; if (call == instance->currentCallContextBeforeGoingBackground.call) { const LinphoneCallParams* params = linphone_call_get_current_params(call); if (linphone_call_params_video_enabled(params)) { @@ -109,7 +109,9 @@ instance->currentCallContextBeforeGoingBackground.cameraIsEnabled); } instance->currentCallContextBeforeGoingBackground.call = 0; - } + } else { + [[PhoneMainView instance ] displayIncomingCall:call]; + } } } @@ -175,7 +177,7 @@ [self startApplication]; if([LinphoneManager isLcReady]) { if([[url scheme] isEqualToString:@"sip"]) { - // Go to ChatRoom view + // Go to Dialer view DialerViewController *controller = DYNAMIC_CAST([[PhoneMainView instance] changeCurrentView:[DialerViewController compositeViewDescription]], DialerViewController); if(controller != nil) { [controller setAddress:[url absoluteString]]; diff --git a/Classes/PhoneMainView.h b/Classes/PhoneMainView.h index 6aba46f83..42549d289 100644 --- a/Classes/PhoneMainView.h +++ b/Classes/PhoneMainView.h @@ -65,6 +65,7 @@ - (void)fullScreen:(BOOL)enabled; - (void)updateStatusBar:(UICompositeViewDescription*)to_view; - (void)startUp; +- (void)displayIncomingCall:(LinphoneCall*) call; - (void)addInhibitedEvent:(id)event; - (BOOL)removeInhibitedEvent:(id)event;