Prevent issue fix. Nabi issues fixed
[apps/osp/Call.git] / src / CallEndCallForm.cpp
index 785e929..33fbefa 100644 (file)
@@ -312,6 +312,11 @@ EndCallForm::HandleAddToContacts(void)
                __isContactAppControlLaunched = false;
        }
        extraData.RemoveAll(true);
+       if(pContact != null)
+       {
+               delete pContact;
+               pContact = null;
+       }
 }
 
 void
@@ -349,7 +354,18 @@ EndCallForm::OnSceneActivatedN(const SceneId& previousSceneId, const SceneId& cu
                //or if call is from known number(i.e present in contacts db), Then do NOT show "Add to Contact" button.
                if (pEndCall->GetContactInfo() != null || pEndCall->GetContactNumber().IsEmpty() == true)
                {
-                       SetContactButtonState(false);
+                       Contact* pContact = __pCallPresentor->GetContactN(pEndCall->GetContactNumber());
+                       //before setting check if the contact is deleted
+                       if(pContact != null)
+                       {
+                               SetContactButtonState(false);
+                               delete pContact;
+                               pContact = null;
+                       }
+                       else
+                       {
+                               SetContactButtonState(true);
+                       }
                }
                else
                {
@@ -384,6 +400,7 @@ EndCallForm::OnSceneActivatedN(const SceneId& previousSceneId, const SceneId& cu
                delete pArgs;
                pArgs = null;
        }
+       AddOrientationEventListener(*this);
 }
 
 void
@@ -405,6 +422,7 @@ EndCallForm::OnSceneDeactivated(const SceneId& currentSceneId, const SceneId& ne
        //remove itself as listener
        CallApp* pPhoneApp = static_cast<CallApp*>(CallApp::GetInstance());
        pPhoneApp->RemoveAppStateChangeListener(*this);
+       RemoveOrientationEventListener(*this);
 }
 
 result
@@ -600,16 +618,24 @@ EndCallForm::OnForeground(void)
        //as we do not know if it success or failed.
        if(__isContactAppControlLaunched == true)
        {
-               CallApp* pPhoneApp = (static_cast<CallApp*>(UiApp::GetInstance()));
-               pPhoneApp->Terminate();
+               //CallApp* pPhoneApp = (static_cast<CallApp*>(UiApp::GetInstance()));
+               //pPhoneApp->Terminate();
+               if(__pEndCallEventTimer != null)
+               {
+                       __pEndCallEventTimer->Start(2000);
+               }
        }
        __isContactAppControlLaunched = false;
 
        if (__isMsgAppControlLaunched == true)
        {
                //Message AppControl request completed.
-               CallApp* pPhoneApp = (static_cast<CallApp*>(UiApp::GetInstance()));
-               pPhoneApp->Terminate();
+               //CallApp* pPhoneApp = (static_cast<CallApp*>(UiApp::GetInstance()));
+               //pPhoneApp->Terminate();
+               if(__pEndCallEventTimer != null)
+               {
+                       __pEndCallEventTimer->Start(2000);
+               }
                __isMsgAppControlLaunched = false;
        }
        AppLogDebug("Exit");
@@ -624,6 +650,7 @@ EndCallForm::OnBackground(void)
 void
 EndCallForm::OnOrientationChanged(const Tizen::Ui::Control& source, Tizen::Ui::OrientationStatus orientationStatus)
 {
+       AppLogDebug("Enter");
        if (__pCallButtonsPanel != null)
        {
                //update position of call buttons panel
@@ -634,7 +661,7 @@ EndCallForm::OnOrientationChanged(const Tizen::Ui::Control& source, Tizen::Ui::O
                RelativeLayout* pRelativeLayout = dynamic_cast<RelativeLayout*>(GetPortraitLayoutN());
                if (pRelativeLayout != null)
                {
-                       pRelativeLayout->SetRelation(*__pCallButtonsPanel, *pKeysBgLbl, RECT_EDGE_RELATION_TOP_TO_TOP);
+                       //pRelativeLayout->SetRelation(*__pCallButtonsPanel, *pKeysBgLbl, RECT_EDGE_RELATION_TOP_TO_TOP);
                }
                pRelativeLayout = dynamic_cast<RelativeLayout*>(GetLandscapeLayoutN());
                if (pRelativeLayout != null)