Fix for 38025 37983
[apps/osp/Call.git] / src / CallPresentationModel.cpp
index 468f732..3da9eed 100644 (file)
@@ -474,6 +474,7 @@ CallPresentationModel::RejectCall(int callHandle, bool sendMsg, const String& co
 
 void CallPresentationModel::OnAppForeground(void)
 {
+       AppLogDebug("Enter %d %d",__isDialAppControlRunning ,__isMessageAppControlRunning);
        if (__isDialAppControlRunning == true)
        {
                //This comes here, when Dialer AppControl is finished working.
@@ -487,10 +488,10 @@ void CallPresentationModel::OnAppForeground(void)
                __pAppControlMgr->AppControlRequestCompleted();
                //Check if this was the last call, then terminate application.
                //And if any calls are active, then those cases are already handled from Other places.
-               if( GetCurrentCallCount() == 0)
+               if( GetCurrentCallCount() == 0 && IsIncomingorDialingCallPresent() == false)
                {
-                       CallApp* pPhoneApp = static_cast<CallApp*>(UiApp::GetInstance());
-                       pPhoneApp->Terminate();
+                       CallApp* pCallApp = static_cast<CallApp*>(UiApp::GetInstance());
+                       pCallApp->Terminate();
                }
        }
 }
@@ -713,6 +714,7 @@ CallPresentationModel::LaunchDialAppControl()
 
        if(__isDialAppControlRunning == true)
        {
+               AppLogDebug("__isDialAppControlRunning == true");
                //Do not allow another app control if already running
                return;
        }