Fixed recursive appcontrol issue. Fixed Call reject from event injector during answer...
[apps/osp/Call.git] / src / CallBaseForm.cpp
index 0f1ab33..8122a03 100644 (file)
@@ -19,6 +19,7 @@
  * @brief      Base class for all Call forms
  */
 #include "CallActiveCallForm.h"
+#include "CallIncomingCallForm.h"
 #include "CallBaseForm.h"
 #include "CallInfo.h"
 #include "CallPresentationModel.h"
@@ -65,6 +66,29 @@ BaseForm::OnActionPerformed(const Control& source, int actionId)
 void
 BaseForm::HandleCallConnected(IListT<AppCallInfo>& pCallList)
 {
+       if(__pCallPresentor->IsIncomingorDialingCallPresent() == true)
+       {
+               //This scenario will come, if 1 call is disconnected from conf. call having 2 participants.
+               //In this case, if there is any dialing call exists, then ignore.
+               //Else, if there is any incoming call exists, then update call option popup.
+               switch (__formType)
+               {
+               case FORMTYPE_INCOMINGCALL:
+               {
+                       IncomingCallForm* pIncomingCallForm = dynamic_cast<IncomingCallForm*>(this);
+                       if (pIncomingCallForm != null)
+                       {
+                               pIncomingCallForm->CallDisconnected();
+                       }
+               }
+                       break;
+
+               default:
+                       break;
+               }
+               return;
+       }
+
        SceneManager* pSceneManager = SceneManager::GetInstance();
 
        switch (__formType)
@@ -160,12 +184,35 @@ BaseForm::HandleCallConnected(IListT<AppCallInfo>& pCallList)
 }
 
 void
-BaseForm::HandleCallDisconnected(bool isLastCall, IListT<AppCallInfo>& pCallList)
+BaseForm::HandleCallDisconnected(bool isLastCall, IListT<AppCallInfo>& pCurrentActiveCallList)
 {
+       if(__pCallPresentor->IsIncomingorDialingCallPresent() == true)
+       {
+               //This scenario will come, if this disconnected call is neither incoming nor dialing call.
+               //In this case, if there is any dialing call exists, then ignore.
+               //Else, if there is any incoming call exists, then update call option popup.
+               switch (__formType)
+               {
+               case FORMTYPE_INCOMINGCALL:
+               {
+                       IncomingCallForm* pIncomingCallForm = dynamic_cast<IncomingCallForm*>(this);
+                       if (pIncomingCallForm != null)
+                       {
+                               pIncomingCallForm->CallDisconnected();
+                       }
+               }
+                       break;
+
+               default:
+                       break;
+               }
+               return;
+       }
+
        SceneManager* pSceneManager = SceneManager::GetInstance();
        CallApp* pPhoneApp = static_cast<CallApp*>(UiApp::GetInstance());
 
-       int callCount = pCallList.GetCount();
+       int callCount = pCurrentActiveCallList.GetCount();
        if (callCount > 0)
        {
                //Ownership - To be deleted in 'OnSceneActivatedN' of next form
@@ -175,7 +222,7 @@ BaseForm::HandleCallDisconnected(bool isLastCall, IListT<AppCallInfo>& pCallList
                {
                        //fetch call info and add to list
                        AppCallInfo callInfo;
-                       result r = pCallList.GetAt(index, callInfo);
+                       result r = pCurrentActiveCallList.GetAt(index, callInfo);
                        if (r == E_SUCCESS)
                        {
                                //copy call information to new instance
@@ -188,7 +235,7 @@ BaseForm::HandleCallDisconnected(bool isLastCall, IListT<AppCallInfo>& pCallList
                {
                        //fetch call info and add to list
                        AppCallInfo callInfo;
-                       result r = pCallList.GetAt(0, callInfo);
+                       result r = pCurrentActiveCallList.GetAt(0, callInfo);
                        if (r == E_SUCCESS)
                        {
                                //copy call information to new instance
@@ -211,7 +258,7 @@ BaseForm::HandleCallDisconnected(bool isLastCall, IListT<AppCallInfo>& pCallList
                        }
                        else
                        {
-                               if (pCallList.GetCount() == 1)
+                               if (pCurrentActiveCallList.GetCount() == 1)
                                {
                                        if (callInfo.IsConferenceCall() == true)
                                        {
@@ -291,6 +338,29 @@ BaseForm::HandleCallSwapOccured(IListT<AppCallInfo>& pCallList)
 void
 BaseForm::HandleConferenceChange(void)
 {
+       if(__pCallPresentor->IsIncomingorDialingCallPresent() == true)
+       {
+               //This scenario will come, if 1 call is disconnected from conf. call having more than 2 participants.
+               //In this case, if there is any dialing call exists, then ignore.
+               //Else, if there is any incoming call exists, then update call option popup.
+               switch (__formType)
+               {
+               case FORMTYPE_INCOMINGCALL:
+               {
+                       IncomingCallForm* pIncomingCallForm = dynamic_cast<IncomingCallForm*>(this);
+                       if (pIncomingCallForm != null)
+                       {
+                               pIncomingCallForm->CallDisconnected();
+                       }
+               }
+                       break;
+
+               default:
+                       break;
+               }
+               return;
+       }
+
        switch (__formType)
        {
        case FORMTYPE_CONFCALLLIST: