Nabi fixes for RC25
authorAmith Kumar Mahale <amith.m@samsung.com>
Sun, 5 May 2013 10:28:47 +0000 (15:58 +0530)
committerAmith Kumar Mahale <amith.m@samsung.com>
Sun, 5 May 2013 10:28:47 +0000 (15:58 +0530)
Change-Id: I1aadb234f1cc3b543b2c62bc5027d0b519c7c85f
Signed-off-by: Amith Kumar Mahale <amith.m@samsung.com>
src/CallActiveCallForm.cpp
src/CallApp.cpp
src/CallEndCallForm.cpp
src/CallIncomingCallForm.cpp

index b00089d..4c378c5 100644 (file)
@@ -1622,9 +1622,15 @@ void
 ActiveCallForm::SetHoldButtonShowState(bool showState)
 {
        Label* pLblControl = static_cast<Label*>(GetControl(IDC_HOLD_LABEL));
-       pLblControl->SetShowState(showState);
+       if(pLblControl != null)
+       {
+               pLblControl->SetShowState(showState);
+       }
        Button* pButtonControl = static_cast<Button*>(GetControl(IDC_HOLD_BUTTON));
-       pButtonControl->SetShowState(showState);
+       if(pButtonControl != null)
+       {
+               pButtonControl->SetShowState(showState);
+       }
 }
 
 void
index 31f7f52..540f193 100644 (file)
@@ -538,6 +538,7 @@ void
 CallApp::SetTopMostWindow(bool bTopMost)
 {
        AppLogDebug("bTopMost = %d",bTopMost);
+       result res = E_FAILURE;
        //ToDO: Need to see if there is better way to handle
        //this case
 
@@ -545,6 +546,12 @@ CallApp::SetTopMostWindow(bool bTopMost)
        {
                GetAppFrame()->GetFrame()->SetZOrderGroup(WINDOW_Z_ORDER_GROUP_HIGHEST);
                AppManager::GetInstance()->AddActiveAppEventListener(*this);
+               if(PowerManager::IsScreenOn() == false)
+               {
+                       AppLogDebug("TurnScreenOn");
+                       res = PowerManager::TurnScreenOn();
+                       AppLogDebug("TurnScreenOn %d",res);
+               }
 
        }
        else
@@ -554,25 +561,22 @@ CallApp::SetTopMostWindow(bool bTopMost)
                AppManager::GetInstance()->RemoveActiveAppEventListener(*this);
        }
 
+       if(LockManager::GetInstance()->IsLocked())
+       {
+               AppLogDebug("Phone Locked");
+               LockManager::GetInstance()->Unlock();
+       }
 
 }
 void
 CallApp::OnActiveAppChanged(const String& appId)
 {
-       result res = E_FAILURE;
        AppLogDebug("Enter %ls",appId.GetPointer());
        if(GetAppId().Equals(appId) == true)
        {
-               if(PowerManager::IsScreenOn() == false)
-               {
-                       AppLogDebug("TurnScreenOn");
-                       res = PowerManager::TurnScreenOn();
-                       AppLogDebug("TurnScreenOn %d",res);
-               }
                result res = PowerManager::KeepScreenOnState(true,false);
                AppLogDebug("KeepScreenOnState %d",res);
 
-
        }
 
 }
index 41f5852..8917b4a 100644 (file)
@@ -53,6 +53,10 @@ static const wchar_t* IDC_CALLER1_LABEL = L"IDC_CALLER1_LABEL";
 static const wchar_t* IDC_KEY_BG_LABEL = L"IDC_KEY_BG_LABEL";
 static const wchar_t* IDC_CALLER1_BIGPHOTO_LABEL = L"IDC_CALLER1_BIGPHOTO_LABEL";
 static const wchar_t* IDB_END_CALL_DEFAULT_ICON = L"C01-1_call_default_caller ID_720x720.png";
+static const wchar_t* IDC_VOICECALL_BUTTON = L"IDC_VOICECALL_BUTTON";
+static const wchar_t* IDC_VIDEOCALL_BUTTON = L"IDC_VIDEOCALL_BUTTON";
+static const wchar_t* IDC_ADD_TO_CONTACT_BUTTON = L"IDC_ADD_TO_CONTACT_BUTTON";
+static const wchar_t* IDC_MSG_BUTTON = L"IDC_MSG_BUTTON";
 
 
 EndCallForm::EndCallForm(void)
@@ -164,6 +168,11 @@ EndCallForm::OnActionPerformed(const Control& source, int actionId)
        {
        case IDA_VOICE_CALL:
        {
+               if (__isMsgAppControlLaunched == true)
+               {
+                       //AppControl already launched.
+                       return;
+               }
                //check if EndCallTimer is running, then cancel it
                if(__pEndCallEventTimer != null)
                {
@@ -180,6 +189,22 @@ EndCallForm::OnActionPerformed(const Control& source, int actionId)
                bool isSimInitialized = __pCallPresentor->CheckSimInitializationIsCompleted();
                if (isSimInitialized)
                {
+                       //Disable all buttons
+                       Button* pButton = static_cast<Button*>(GetControl(IDC_VIDEOCALL_BUTTON,true));
+                       pButton->SetEnabled(false);
+                       pButton->Invalidate(true);
+                       pButton = static_cast<Button*>(GetControl(IDC_VOICECALL_BUTTON,true));
+                       pButton->SetEnabled(false);
+                       pButton->Invalidate(true);
+                       pButton = static_cast<Button*>(GetControl(IDC_ADD_TO_CONTACT_BUTTON,true));
+                       if(pButton->GetShowState() == true)
+                       {
+                               pButton->SetEnabled(false);
+                               pButton->Invalidate(true);
+                       }
+                       pButton = static_cast<Button*>(GetControl(IDC_MSG_BUTTON,true));
+                       pButton->SetEnabled(false);
+                       pButton->Invalidate(true);
                        //Check if dialing an emergency call
                        bool isEmergencyCall = __pCallPresentor->IsEmergencyNumber(*contactTxt, true);
                        if (isEmergencyCall)
@@ -216,6 +241,19 @@ EndCallForm::OnActionPerformed(const Control& source, int actionId)
                {
                        //cancel EndCallTimer, if AppControl request was successful.
                        __pEndCallEventTimer->Cancel();
+                       //Disable the call buttons
+                       Button* pButton = static_cast<Button*>(GetControl(IDC_VIDEOCALL_BUTTON,true));
+                       pButton->SetEnabled(false);
+                       pButton->Invalidate(true);
+                       pButton = static_cast<Button*>(GetControl(IDC_VOICECALL_BUTTON,true));
+                       pButton->SetEnabled(false);
+                       pButton->Invalidate(true);
+                       pButton = static_cast<Button*>(GetControl(IDC_ADD_TO_CONTACT_BUTTON,true));
+                       if(pButton->GetShowState() == true)
+                       {
+                               pButton->SetEnabled(false);
+                               pButton->Invalidate(true);
+                       }
                }
        }
        break;
@@ -229,6 +267,21 @@ EndCallForm::OnActionPerformed(const Control& source, int actionId)
                        return;
                }
                HandleAddToContacts();
+               Button* pButton = static_cast<Button*>(GetControl(IDC_VIDEOCALL_BUTTON,true));
+               pButton->SetEnabled(false);
+               pButton->Invalidate(true);
+               pButton = static_cast<Button*>(GetControl(IDC_VOICECALL_BUTTON,true));
+               pButton->SetEnabled(false);
+               pButton->Invalidate(true);
+               pButton = static_cast<Button*>(GetControl(IDC_ADD_TO_CONTACT_BUTTON,true));
+               if(pButton->GetShowState() == true)
+               {
+                       pButton->SetEnabled(false);
+                       pButton->Invalidate(true);
+               }
+               pButton = static_cast<Button*>(GetControl(IDC_MSG_BUTTON,true));
+               pButton->SetEnabled(false);
+               pButton->Invalidate(true);
        }
        break;
 
@@ -635,6 +688,22 @@ EndCallForm::OnForeground(void)
                }
                __pCallPresentor->AppControlRequestCompleted();
        }
+       //Enable all buttons
+       Button* pButton = static_cast<Button*>(GetControl(IDC_VIDEOCALL_BUTTON,true));
+       pButton->SetEnabled(true);
+       pButton->Invalidate(true);
+       pButton = static_cast<Button*>(GetControl(IDC_VOICECALL_BUTTON,true));
+       pButton->SetEnabled(true);
+       pButton->Invalidate(true);
+       pButton = static_cast<Button*>(GetControl(IDC_ADD_TO_CONTACT_BUTTON,true));
+       if(pButton->GetShowState() == true)
+       {
+               pButton->SetEnabled(true);
+               pButton->Invalidate(true);
+       }
+       pButton = static_cast<Button*>(GetControl(IDC_MSG_BUTTON,true));
+       pButton->SetEnabled(true);
+       pButton->Invalidate(true);
        AppLogDebug("Exit");
 }
 
index 2adcc58..7b4a2c7 100644 (file)
@@ -218,14 +218,7 @@ IncomingCallForm::OnInitializing(void)
        }
        HideRejectPanel();
 
-       //Get Reject list from Settings Manager
-       IMapT<int,String>* pMsgMap = SettingsManager::GetInstance()->GetRejectMessageListN();
-       if(pMsgMap != null)
-       {
-               __pRejectMessageList = pMsgMap->GetValuesN();
-               delete pMsgMap;
-               pMsgMap = null;
-       }
+
        InitializeTableView();
 
        __pAcceptCircle = AppUtility::GetBitmapFromResourcesN(IDB_ACCEPT_CIRCLE_ICON, W_DIAL_LABEL, H_DIAL_LABEL);
@@ -721,6 +714,28 @@ void
 IncomingCallForm::OnSceneActivatedN(const SceneId& previousSceneId,    const SceneId& currentSceneId, IList* pArgs)
 {
        AddOrientationEventListener(*this);
+       //Get Reject list from Settings Manager
+       IMapT<int,String>* pMsgMap = SettingsManager::GetInstance()->GetRejectMessageListN();
+       if(pMsgMap != null)
+       {
+               if (__pRejectMessageList != null)
+               {
+                       delete __pRejectMessageList;
+                       __pRejectMessageList = null;
+               }
+               __pRejectMessageList = pMsgMap->GetValuesN();
+               delete pMsgMap;
+               pMsgMap = null;
+       }
+       //No reject messages
+       else
+       {
+               if (__pRejectMessageList != null)
+               {
+                       delete __pRejectMessageList;
+                       __pRejectMessageList = null;
+               }
+       }
        //listen to Foreground events
        CallApp* pPhoneApp = static_cast<CallApp*>(CallApp::GetInstance());
        pPhoneApp->AddAppStateChangeListener(*this);