Fix for N_SE-53496 N_SE-53436 N_SE-53451
authorAmith Kumar Mahale <amith.m@samsung.com>
Fri, 27 Sep 2013 14:08:43 +0000 (19:38 +0530)
committerAmith Kumar Mahale <amith.m@samsung.com>
Fri, 27 Sep 2013 15:06:48 +0000 (20:36 +0530)
Change-Id: Ifba328906965d4cbd068e5be86b5df23d033cb55
Signed-off-by: Amith Kumar Mahale <amith.m@samsung.com>
13 files changed:
inc/CallActiveCallForm.h
inc/CallConfCallerListForm.h
inc/CallTypes.h
res/eng-GB.xml
src/CallActiveCallForm.cpp
src/CallBaseForm.cpp
src/CallConfCallerListForm.cpp
src/CallErrorMsgPopup.cpp
src/CallIncomingCallForm.cpp
src/CallPresentationModel.cpp
src/CallSoundManager.cpp
src/CallTelephonyManager.cpp
src/CallTypes.cpp

index b3c0002..270811c 100644 (file)
@@ -48,6 +48,7 @@ class ActiveCallForm
        , public Tizen::Ui::IOrientationEventListener
        , public Tizen::Social::IAddressbookChangeEventListener
        , public Tizen::Ui::IPropagatedKeyEventListener
+       , public Tizen::System::ISettingEventListener
 {
 public:
        ActiveCallForm(FormType formType);
@@ -87,6 +88,8 @@ public:
        virtual void OnForeground(void);
        virtual void OnBackground(void){};
        virtual void OnScreenOff(void){};
+       //ISettings Event Listener
+       virtual void OnSettingChanged(Tizen::Base::String& key);
 
 private:
        // Create the call buttons panel and add to form
index e5587eb..939945e 100644 (file)
@@ -44,6 +44,7 @@ class ConfCallerListForm
        , public Tizen::Ui::Controls::ITableViewItemProvider
        , public Tizen::Ui::IOrientationEventListener
        , public Tizen::Social::IAddressbookChangeEventListener
+       , public Tizen::System::ISettingEventListener
 {
 public:
        ConfCallerListForm(void);
@@ -87,6 +88,8 @@ public:
        virtual void UpdateItem(int itemIndex, Tizen::Ui::Controls::TableViewItem* pItem);
        virtual int GetDefaultItemHeight(void);
 
+       virtual void OnSettingChanged(Tizen::Base::String& key);
+
 private:
        // Add the action listener for the buttons
        void AddActionListener(const Tizen::Base::String& keyName, CommandIds cmdId);
index 3ecfcbb..b3137a4 100644 (file)
@@ -187,6 +187,8 @@ extern const wchar_t* IDS_CALL_REJECTED_TITLE_STRING;
 extern const wchar_t* IDS_MESSAGE_SENDING_FAILED;
 extern const wchar_t* IDS_LOW_MEMORY_MSG;
 extern const wchar_t* IDS_LOW_MEMORY_MSG_TITLE;
+extern const wchar_t* IDS_SERVICE_UNAVAILABLE;
+extern const wchar_t* IDS_CALL_BARRED;
 //Panel
 extern const wchar_t* PANEL_DIALER;
 extern const wchar_t* PANEL_LOGS;
@@ -447,7 +449,9 @@ enum ErrorCodes
        ERROR_BARRING_PWD_TOO_LONG,
        ERROR_FLIGHT_MODE_SET,
        ERROR_GENERAL,
+       ERROR_SERVICE_UNAVAILABLE,
        ERROR_USSD_NUMBER,
+       ERROR_CALL_BARRED
 };
 
 enum DialerRequestType
index a3623f6..7d0aed1 100644 (file)
        <text id="IDS_MESSAGE_SENDING_FAILED">Message Sending failed</text>
        <text id="IDS_LOW_MEMORY_MSG_TITLE">Low Memory</text>
     <text id="IDS_LOW_MEMORY_MSG">Memory Low, Delete some data</text>
+    <text id="IDS_SERVICE_UNAVAILABLE">Network Unavailable</text>
+    <text id="IDS_CALL_BARRED">Call Barred</text> 
 </string_table>
index a6e9236..35b25c8 100644 (file)
@@ -1147,6 +1147,7 @@ ActiveCallForm::OnSceneActivatedN(const SceneId& previousSceneId, const SceneId&
        //set itself as listener
        __pCallPresentor->SetTelEventListener(this);
        AddOrientationEventListener(*this);
+       Tizen::System::SettingInfo::AddSettingEventListener(*this);
 
        CallApp* pPhoneApp = static_cast<CallApp*>(CallApp::GetInstance());
        pPhoneApp->AddAppStateChangeListener(*this);
@@ -1394,6 +1395,8 @@ ActiveCallForm::OnSceneDeactivated(const SceneId& currentSceneId, const SceneId&
        {
                __pAddressbook->SetAddressbookChangeEventListener(null);
        }
+
+       Tizen::System::SettingInfo::RemoveSettingEventListener(*this);
 }
 
 void
@@ -2362,6 +2365,67 @@ ActiveCallForm::OnForeground(void)
        __pCallPresentor->OnAppForeground();
 }
 
+void
+ActiveCallForm::OnSettingChanged(Tizen::Base::String& key)
+{
+       if(key == L"http://tizen.org/setting/contacts.order.firstname")
+       {
+               IListT<AppCallInfo>* pCallsList = __pCallPresentor->GetCallListN();
+               if(pCallsList != null)
+               {
+                       int listCount = pCallsList->GetCount();
+                       for(int index = 0; index < listCount; index++)
+                       {
+                               AppCallInfo callInfo;
+                               Contact* pContact;
+                               pCallsList->GetAt(index, callInfo);
+                               if(__pActiveCallInfo == null)
+                               {
+                                       __pActiveCallInfo = new (std::nothrow) AppCallInfo();
+                               }
+                               *__pActiveCallInfo =  callInfo;
+                               String contactNumber;
+                               contactNumber.Append(__pActiveCallInfo->GetContactNumber());
+                               pContact = __pCallPresentor->GetContactN(__pActiveCallInfo->GetContactNumber());
+                               if(pContact == null)
+                               {
+                                       __pActiveCallInfo->ResetContactNumber(null);
+                                       __pActiveCallInfo->ResetContactInfo(null);
+
+                               }
+                               else
+                               {
+                                       __pActiveCallInfo->SetContactNumber(contactNumber);
+                                       __pActiveCallInfo->SetContactInfo(*pContact);
+                               }
+                               if(pContact != null)
+                               {
+                                       delete pContact;
+                                       pContact = null;
+                               }
+                               if(callInfo.IsConferenceCall() == true)
+                               {
+                                       continue;
+                               }
+                               if(callInfo.IsOnHold() == false)
+                               {
+                                       ShowPersonDetails(contactNumber, IDC_NUMBER1_LABEL, IDC_CALLER1_LABEL, false,__pActiveCallInfo);
+                               }
+                               else
+                               {
+                                       ShowPersonDetails(contactNumber, IDC_NUMBER2_LABEL, IDC_CALLER2_LABEL, true,__pActiveCallInfo);
+                               }
+
+                       }
+
+                       delete pCallsList;
+                       pCallsList = null;
+               }
+       }
+
+}
+
+
 bool
 ActiveCallForm::OnKeyPressed(Control& source, const KeyEventInfo& keyEventInfo)
 {
index 2734083..c92e90d 100644 (file)
@@ -203,9 +203,21 @@ BaseForm::HandleCallHeld(bool isHeld)
 {
        AppLogDebug("Enter");
        ActiveCallForm* pActiveCallForm = dynamic_cast<ActiveCallForm*>(this);
-       if(pActiveCallForm != null)
+       switch (__formType)
+       {
+       case(FORMTYPE_ACTIVECALL):
+       case(FORMTYPE_ACTIVECONFCALL):
+       case(FORMTYPE_MULTIPLECALLS):
        {
-               pActiveCallForm->OnHoldTelephonyCallback(isHeld);
+               if(pActiveCallForm != null)
+               {
+                       pActiveCallForm->OnHoldTelephonyCallback(isHeld);
+               }
+       }
+       break;
+
+       default:
+               break;
        }
 }
 
index 673139f..3dac607 100644 (file)
@@ -294,7 +294,7 @@ ConfCallerListForm::OnSceneActivatedN(const SceneId& previousSceneId, const Scen
        //set itself as listener
        __pCallPresentor->SetTelEventListener(this);
        __isCallSplit = false;
-
+       Tizen::System::SettingInfo::AddSettingEventListener(*this);
        AppLogDebug("Enter");
 
        //DisableAllControls();
@@ -355,6 +355,8 @@ ConfCallerListForm::OnSceneDeactivated(const SceneId& currentSceneId, const Scen
        {
                __pAddressbook->SetAddressbookChangeEventListener(null);
        }
+
+       Tizen::System::SettingInfo::RemoveSettingEventListener(*this);
 }
 
 result
@@ -887,6 +889,15 @@ ConfCallerListForm::UpdateItem(int itemIndex, TableViewItem* pItem)
        return ;
 }
 
+void
+ConfCallerListForm::OnSettingChanged(Tizen::Base::String& key)
+{
+       if(key == L"http://tizen.org/setting/contacts.order.firstname")
+       {
+               __pList->UpdateTableView();
+       }
+}
+
 int
 ConfCallerListForm::GetDefaultItemHeight(void)
 {
index 9746c73..e5c0257 100644 (file)
@@ -241,6 +241,18 @@ ErrorMsgPopup::FetchErrorMessage(int errorCode)
        }
        break;
 
+       case ERROR_SERVICE_UNAVAILABLE:
+       {
+               msg.Append(AppUtility::GetResourceString(IDS_SERVICE_UNAVAILABLE));
+       }
+       break;
+
+       case ERROR_CALL_BARRED:
+       {
+               msg.Append(AppUtility::GetResourceString(IDS_SERVICE_UNAVAILABLE));
+       }
+       break;
+
        case ERROR_GENERAL:
        default:
        {
index f1c831b..e9c11cb 100644 (file)
@@ -649,12 +649,12 @@ IncomingCallForm::OnActionPerformed(const Control& source, int actionId)
                if(__pCallPresentor->IsAppControlRunning() == false)
                {
                        __pCallPresentor->RejectCall(__incomingCallHandle, true,*__pActiveContactNo);
-                       ArrayListT<AppCallInfo>* pCallList  = static_cast<ArrayListT<AppCallInfo>*>(__pCallPresentor->GetCallListN());
+                       /*ArrayListT<AppCallInfo>* pCallList  = static_cast<ArrayListT<AppCallInfo>*>(__pCallPresentor->GetCallListN());
                        if(pCallList != null && pCallList->GetCount() > 0)
                        {
                                __pCallPresentor->HandleCallConnected(*pCallList);
                        }
-                       pCallList = null;
+                       pCallList = null;*/
                }
        }
        break;
index 1310042..9c31a46 100644 (file)
@@ -207,7 +207,7 @@ CallPresentationModel::DialCall(String& contactNumber, bool isEmergency)
 
        if (isCallServiceAvailable == false)
        {
-               __pTelEventListener->HandleTelephonyError(ERROR_DIAL_FAILED);
+               __pTelEventListener->HandleTelephonyError(ERROR_SERVICE_UNAVAILABLE);
                return ;
        }
        // check if GPRS number
index 26733a4..e2680b5 100644 (file)
@@ -534,6 +534,7 @@ SoundManager::SetWaitTone(void)
 void
 SoundManager::ResumeAlert(String& contactRingTone)
 {
+       AppLogDebug("Enter");
        result res = E_FAILURE;
        IntensityDurationVibrationPattern vibration;
        vibration.duration = 3000;
index a0fda67..45abdc7 100644 (file)
@@ -344,6 +344,10 @@ TelephonyManager::SetupMoCall(String& contactNumber, bool isEmergency)
        {
                return ERROR_NONE;
        }
+       else if (res == TAPI_CAUSE_CALL_BARRED)
+       {
+               return ERROR_CALL_BARRED;
+       }
        else
        {
                return ERROR_TAPI_ERROR;
@@ -1072,7 +1076,8 @@ TelephonyManager::DialOutgoingCall(String& contactNumber, bool isEmergency)
        }
        else
        {
-               return E_FAILURE;
+               AppLogDebug("%d",res);
+               return res;
        }
 }
 
index 886e650..061fdbb 100644 (file)
@@ -184,6 +184,8 @@ const wchar_t* IDS_CALL_REJECTED_TITLE_STRING = L"IDS_CALL_REJECTED_TITLE_STRING
 const wchar_t* IDS_MESSAGE_SENDING_FAILED = L"IDS_MESSAGE_SENDING_FAILED";
 const wchar_t* IDS_LOW_MEMORY_MSG = L"IDS_LOW_MEMORY_MSG";
 const wchar_t* IDS_LOW_MEMORY_MSG_TITLE = L"IDS_LOW_MEMORY_MSG_TITLE";
+const wchar_t* IDS_SERVICE_UNAVAILABLE = L"IDS_SERVICE_UNAVAILABLE";
+const wchar_t* IDS_CALL_BARRED = L"IDS_CALL_BARRED";
 //Panel
 const wchar_t* PANEL_DIALER = L"PanelDialer";
 const wchar_t* PANEL_LOGS = L"PanelLogs";