Fix TC crash.
authorJaemin Ahn <j.m.ahn@samsung.com>
Fri, 22 Mar 2013 08:52:01 +0000 (17:52 +0900)
committerJaemin Ahn <j.m.ahn@samsung.com>
Fri, 22 Mar 2013 08:52:01 +0000 (17:52 +0900)
Change-Id: I3005a8ecb2461280af8ca8a546261a49c0c979b8
Signed-off-by: Jaemin Ahn <j.m.ahn@samsung.com>
src/FTel_CallManagerImpl.cpp
src/FTel_NetworkManagerImpl.cpp
src/FTel_TelephonyIpcProxy.cpp
src/FTel_TelephonyIpcProxy.h

index 2ddd45c..606775e 100644 (file)
@@ -135,10 +135,6 @@ _CallManagerImpl::Construct(ITelephonyCallEventListener* pListener)
     {
         SysLog(NID_TEL, "Creating an IPC instance to connect with the Connectivity service daemon has failed.");
     }
-    else
-    {
-        __pTelephonyServiceProxy->SetCallManagerImpl(*this);
-    }
 
        return r;
 
@@ -234,7 +230,7 @@ _CallManagerImpl::RequestCallForward(const String& phoneNumber)
        SysTryReturnResult(NID_TEL, !phoneNumber.IsEmpty(), E_INVALID_FORMAT, "The phone number is empty string.");
        SysTryReturnResult(NID_TEL, IsPhoneNumberValid(phoneNumber), E_INVALID_FORMAT, "The phone number is invalid format");
 
-       r = __pTelephonyServiceProxy->RequestCallForward(phoneNumber);
+       r = __pTelephonyServiceProxy->RequestCallForward(this, phoneNumber);
        SysTryReturnResult(NID_TEL, r == E_SUCCESS, r, "Propagating.");
 
        __curCallFwdState = _CALL_FORWARD_REQUESTING;
@@ -266,7 +262,7 @@ _CallManagerImpl::StopCallForward(void)
        SysTryReturnResult(NID_TEL, _NetworkManagerImpl::IsServiceAvailable(), E_SERVICE_UNAVAILABLE,
                          "The operation failed because the device is out of the coverage area or in the emergency mode.");
 
-       result r = __pTelephonyServiceProxy->StopCallForward();
+       result r = __pTelephonyServiceProxy->StopCallForward(this);
        SysTryReturnResult(NID_TEL, r == E_SUCCESS, r, "Propagating.");
 
        __curCallFwdState = _CALL_FORWARD_STOPPING;
@@ -285,7 +281,7 @@ _CallManagerImpl::GetCallForwardNumber(void)
        SysTryReturnResult(NID_TEL, _NetworkManagerImpl::IsServiceAvailable(), E_SERVICE_UNAVAILABLE,
                                          "The operation failed because the device is out of the coverage area or in the emergency mode.");
 
-       result r = __pTelephonyServiceProxy->GetCallForwardNumber();
+       result r = __pTelephonyServiceProxy->GetCallForwardNumber(this);
        SysTryReturnResult(NID_TEL, r == E_SUCCESS, r, "Propagating.");
 
        __isReqCallFwdNumInProgress = true;
index 5d3a534..45b596a 100755 (executable)
@@ -118,10 +118,6 @@ _NetworkManagerImpl::Construct(ITelephonyNetworkEventListener* pListener)
     {
         SysLog(NID_TEL, "Creating an IPC instance to connect with the Connectivity service daemon has failed.");
     }
-    else
-    {
-        __pTelephonyServiceProxy->SetNetworkManagerImpl(*this);
-    }
 
     __pConnectionHandle = move(pConnectionHandle);
 
@@ -291,7 +287,7 @@ _NetworkManagerImpl::GetNetworkSelectionMode(void)
 {
     SysTryReturnResult(NID_TEL, __pTelephonyServiceProxy != null, E_SYSTEM, "A system error has occurred. IPC instance has not been constructed yet.");
 
-    result r = __pTelephonyServiceProxy->GetNetworkSelectionMode();
+    result r = __pTelephonyServiceProxy->GetNetworkSelectionMode(this);
     SysTryReturnResult(NID_TEL, r != E_OUT_OF_MEMORY, r, "Propagating.");
     SysTryReturnResult(NID_TEL, r != E_PRIVILEGE_DENIED, r, "Propagating.");
     SysTryReturnResult(NID_TEL, r == E_SUCCESS, E_OPERATION_FAILED, "Failed to get selection mode.");
@@ -307,7 +303,7 @@ _NetworkManagerImpl::SelectNetwork(const NetworkInfo & networkInfo)
     const _NetworkInfoImpl* pNetworkInfoImpl = _NetworkInfoImpl::GetInstance(networkInfo);
     TelNetworkSystemType_t networkSystemType = _TelephonyUtility::ConvertNetworkType(pNetworkInfoImpl->GetNetworkType());
 
-    result r = __pTelephonyServiceProxy->SelectNetwork(pNetworkInfoImpl->GetPlmn(), (int)networkSystemType);
+    result r = __pTelephonyServiceProxy->SelectNetwork(this, pNetworkInfoImpl->GetPlmn(), (int)networkSystemType);
     SysTryReturnResult(NID_TEL, r != E_OUT_OF_MEMORY, r, "Propagating.");
     SysTryReturnResult(NID_TEL, r != E_PRIVILEGE_DENIED, r, "Propagating.");
     SysTryReturnResult(NID_TEL, r == E_SUCCESS, E_OPERATION_FAILED, "Failed to select network manually.");
@@ -320,7 +316,7 @@ _NetworkManagerImpl::SelectNetwork(void)
 {
     SysTryReturnResult(NID_TEL, __pTelephonyServiceProxy != null, E_SYSTEM, "A system error has occurred. IPC instance has not been constructed yet.");
 
-    result r = __pTelephonyServiceProxy->SelectNetwork();
+    result r = __pTelephonyServiceProxy->SelectNetwork(this);
     SysTryReturnResult(NID_TEL, r != E_OUT_OF_MEMORY, r, "Propagating.");
     SysTryReturnResult(NID_TEL, r != E_PRIVILEGE_DENIED, r, "Propagating.");
     SysTryReturnResult(NID_TEL, r == E_SUCCESS, E_OPERATION_FAILED, "Failed to select network automatically.");
@@ -333,7 +329,7 @@ _NetworkManagerImpl::SearchNetwork(void)
 {
     SysTryReturnResult(NID_TEL, __pTelephonyServiceProxy != null, E_SYSTEM, "A system error has occurred. IPC instance has not been constructed yet.");
 
-    result r = __pTelephonyServiceProxy->SearchNetwork();
+    result r = __pTelephonyServiceProxy->SearchNetwork(this);
     SysTryReturnResult(NID_TEL, r != E_OUT_OF_MEMORY, r, "Propagating.");
     SysTryReturnResult(NID_TEL, r != E_PRIVILEGE_DENIED, r, "Propagating.");
     SysTryReturnResult(NID_TEL, r == E_SUCCESS, E_OPERATION_FAILED, "Failed to search network automatic.");
index 9af93b5..68104ab 100644 (file)
@@ -41,8 +41,12 @@ _TelephonyIpcProxy* _TelephonyIpcProxy::__pInstance = null;
 
 _TelephonyIpcProxy::_TelephonyIpcProxy(void)
        : __pIpcClient(null)
-    , __pNetworkManagerImpl(null)
-    , __pCallManagerImpl(null)
+    , __pNetworkManagerImplForGet(null)
+       , __pNetworkManagerImplForSelect(null)
+       , __pNetworkManagerImplForSearch(null)
+    , __pCallManagerImplForGet(null)
+       , __pCallManagerImplForStart(null)
+       , __pCallManagerImplForStop(null)
 {
 }
 
@@ -139,7 +143,7 @@ _TelephonyIpcProxy::HasSystemPrivilege(void)
 }
 
 result
-_TelephonyIpcProxy::GetNetworkSelectionMode(void)
+_TelephonyIpcProxy::GetNetworkSelectionMode(_NetworkManagerImpl* pNetworkManagerImpl)
 {
     result r = E_SUCCESS;
     unsigned long ret = 0;
@@ -151,11 +155,13 @@ _TelephonyIpcProxy::GetNetworkSelectionMode(void)
     SysTryReturnResult(NID_TEL, r == E_SUCCESS, E_SYSTEM, "A system error has been occurred. Failed to send a request.");
     SysTryReturnResult(NID_TEL, ret == E_SUCCESS, ret, "Propagating.");
 
+    __pNetworkManagerImplForGet = pNetworkManagerImpl;
+
     return E_SUCCESS;
 }
 
 result
-_TelephonyIpcProxy::SelectNetwork(const Tizen::Base::String& plmn, const int netwokrType)
+_TelephonyIpcProxy::SelectNetwork(_NetworkManagerImpl* pNetworkManagerImpl, const Tizen::Base::String& plmn, const int netwokrType)
 {
     result r = E_SUCCESS;
     unsigned long ret = 0;
@@ -167,11 +173,13 @@ _TelephonyIpcProxy::SelectNetwork(const Tizen::Base::String& plmn, const int net
     SysTryReturnResult(NID_TEL, r == E_SUCCESS, E_SYSTEM, "A system error has been occurred. Failed to send a request.");
     SysTryReturnResult(NID_TEL, ret == E_SUCCESS, ret, "Propagating.");
 
+    __pNetworkManagerImplForSelect = pNetworkManagerImpl;
+
     return E_SUCCESS;
 }
 
 result
-_TelephonyIpcProxy::SelectNetwork(void)
+_TelephonyIpcProxy::SelectNetwork(_NetworkManagerImpl* pNetworkManagerImpl)
 {
     result r = E_SUCCESS;
     unsigned long ret = 0;
@@ -183,12 +191,14 @@ _TelephonyIpcProxy::SelectNetwork(void)
     SysTryReturnResult(NID_TEL, r == E_SUCCESS, E_SYSTEM, "A system error has been occurred. Failed to send a request.");
     SysTryReturnResult(NID_TEL, ret == E_SUCCESS, ret, "Propagating.");
 
+    __pNetworkManagerImplForSelect = pNetworkManagerImpl;
+
     return E_SUCCESS;
 
 }
 
 result
-_TelephonyIpcProxy::SearchNetwork(void)
+_TelephonyIpcProxy::SearchNetwork(_NetworkManagerImpl* pNetworkManagerImpl)
 {
     result r = E_SUCCESS;
     unsigned long ret = 0;
@@ -200,6 +210,8 @@ _TelephonyIpcProxy::SearchNetwork(void)
     SysTryReturnResult(NID_TEL, r == E_SUCCESS, E_SYSTEM, "A system error has been occurred. Failed to send a request.");
     SysTryReturnResult(NID_TEL, ret == E_SUCCESS, ret, "Propagating.");
 
+    __pNetworkManagerImplForSearch = pNetworkManagerImpl;
+
     return E_SUCCESS;
 }
 
@@ -221,7 +233,7 @@ _TelephonyIpcProxy::HasCallForwardPrivilege(void)
 }
 
 result
-_TelephonyIpcProxy::RequestCallForward(const String& phoneNumber)
+_TelephonyIpcProxy::RequestCallForward(_CallManagerImpl* pCallManagerImpl, const String& phoneNumber)
 {
     result r = E_SUCCESS;
     unsigned long ret = 0;
@@ -233,11 +245,13 @@ _TelephonyIpcProxy::RequestCallForward(const String& phoneNumber)
     SysTryReturnResult(NID_TEL, r == E_SUCCESS, E_SYSTEM, "A system error has been occurred. Failed to send a request.");
     SysTryReturnResult(NID_TEL, ret == E_SUCCESS, ret, "Propagating.");
 
+    __pCallManagerImplForStart = pCallManagerImpl;
+
     return E_SUCCESS;
 }
 
 result
-_TelephonyIpcProxy::StopCallForward(void)
+_TelephonyIpcProxy::StopCallForward(_CallManagerImpl* pCallManagerImpl)
 {
     result r = E_SUCCESS;
     unsigned long ret = 0;
@@ -249,11 +263,13 @@ _TelephonyIpcProxy::StopCallForward(void)
     SysTryReturnResult(NID_TEL, r == E_SUCCESS, E_SYSTEM, "A system error has been occurred. Failed to send a request.");
     SysTryReturnResult(NID_TEL, ret == E_SUCCESS, ret, "Propagating.");
 
+    __pCallManagerImplForStop = pCallManagerImpl;
+
     return E_SUCCESS;
 }
 
 result
-_TelephonyIpcProxy::GetCallForwardNumber(void)
+_TelephonyIpcProxy::GetCallForwardNumber(_CallManagerImpl* pCallManagerImpl)
 {
     result r = E_SUCCESS;
     unsigned long ret = 0;
@@ -265,19 +281,9 @@ _TelephonyIpcProxy::GetCallForwardNumber(void)
     SysTryReturnResult(NID_TEL, r == E_SUCCESS, E_SYSTEM, "A system error has been occurred. Failed to send a request.");
     SysTryReturnResult(NID_TEL, ret == E_SUCCESS, ret, "Propagating.");
 
-    return E_SUCCESS;
-}
+    __pCallManagerImplForGet = pCallManagerImpl;
 
-void
-_TelephonyIpcProxy::SetNetworkManagerImpl(_NetworkManagerImpl& impl)
-{
-    __pNetworkManagerImpl = &impl;
-}
-
-void
-_TelephonyIpcProxy::SetCallManagerImpl(_CallManagerImpl& impl)
-{
-    __pCallManagerImpl = &impl;
+    return E_SUCCESS;
 }
 
 void
@@ -302,7 +308,7 @@ _TelephonyIpcProxy::OnNetworkSelectionModeReceived(bool isManual, unsigned long
 
     SysAssertf(__pIpcClient != null, "Not yet constructed. Construct() should be called before use.");
 
-    __pNetworkManagerImpl->OnTelephonyNetworkSelectionModeReceived(isManual, res);
+    __pNetworkManagerImplForGet->OnTelephonyNetworkSelectionModeReceived(isManual, res);
 }
 
 void
@@ -312,7 +318,7 @@ _TelephonyIpcProxy::OnNetworkSelectionCompleted(unsigned long res)
 
     SysAssertf(__pIpcClient != null, "Not yet constructed. Construct() should be called before use.");
 
-    __pNetworkManagerImpl->OnTelephonyNetworkSelectionCompleted(res);
+    __pNetworkManagerImplForSelect->OnTelephonyNetworkSelectionCompleted(res);
 }
 
 void
@@ -322,7 +328,7 @@ _TelephonyIpcProxy::OnNetworkSearchCompleted(Tizen::Base::String message, unsign
 
     SysAssertf(__pIpcClient != null, "Not yet constructed. Construct() should be called before use.");
 
-    __pNetworkManagerImpl->OnTelephonyNetworkSearchCompleted(message, res);
+    __pNetworkManagerImplForSearch->OnTelephonyNetworkSearchCompleted(message, res);
 }
 
 void
@@ -332,7 +338,7 @@ _TelephonyIpcProxy::OnTelephonyCallForwardNumberReceived(Tizen::Base::String pho
 
     SysAssertf(__pIpcClient != null, "Not yet constructed. Construct() should be called before use.");
 
-    __pCallManagerImpl->OnTelephonyCallForwardNumberReceived(phoneNumber, res);
+    __pCallManagerImplForGet->OnTelephonyCallForwardNumberReceived(phoneNumber, res);
 }
 
 void
@@ -342,7 +348,7 @@ _TelephonyIpcProxy::OnTelephonyCallForwardResponseReceived(Tizen::Base::String p
 
     SysAssertf(__pIpcClient != null, "Not yet constructed. Construct() should be called before use.");
 
-    __pCallManagerImpl->OnTelephonyCallForwardResponseReceived(phoneNumber, res);
+    __pCallManagerImplForStart->OnTelephonyCallForwardResponseReceived(phoneNumber, res);
 }
 
 void
@@ -352,7 +358,7 @@ _TelephonyIpcProxy::OnTelephonyCallForwardStopped(Tizen::Base::String phoneNumbe
 
     SysAssertf(__pIpcClient != null, "Not yet constructed. Construct() should be called before use.");
 
-    __pCallManagerImpl->OnTelephonyCallForwardStopped(phoneNumber, res);
+    __pCallManagerImplForStop->OnTelephonyCallForwardStopped(phoneNumber, res);
 }
 
 }} // Tizen::Telephony
index a7d3249..bafb1b7 100644 (file)
@@ -62,18 +62,15 @@ public:
        result Construct(void);
        result GetImsi(Tizen::Base::String& imsi) const;
        result HasSystemPrivilege(void);
-       result GetNetworkSelectionMode(void);
-       result SelectNetwork(const Tizen::Base::String& plmn, const int netwokrType);
-    result SelectNetwork(void);
-    result SearchNetwork(void);
+       result GetNetworkSelectionMode(_NetworkManagerImpl* pNetworkManagerImpl);
+       result SelectNetwork(_NetworkManagerImpl* pNetworkManagerImpl, const Tizen::Base::String& plmn, const int netwokrType);
+    result SelectNetwork(_NetworkManagerImpl* pNetworkManagerImpl);
+    result SearchNetwork(_NetworkManagerImpl* pNetworkManagerImpl);
 
        result HasCallForwardPrivilege(void);
-    result RequestCallForward(const Tizen::Base::String& phoneNumber);
-    result StopCallForward(void);
-    result GetCallForwardNumber(void);
-
-    void SetNetworkManagerImpl(_NetworkManagerImpl& impl);
-    void SetCallManagerImpl(_CallManagerImpl& impl);
+    result RequestCallForward(_CallManagerImpl* pCallManagerImpl, const Tizen::Base::String& phoneNumber);
+    result StopCallForward(_CallManagerImpl* pCallManagerImpl);
+    result GetCallForwardNumber(_CallManagerImpl* pCallManagerImpl);
 
     static _TelephonyIpcProxy* GetInstance(void);
 
@@ -97,8 +94,12 @@ private:
        
 private:
        Tizen::Io::_IpcClient* __pIpcClient;
-       _NetworkManagerImpl* __pNetworkManagerImpl;
-       _CallManagerImpl* __pCallManagerImpl;
+       _NetworkManagerImpl* __pNetworkManagerImplForGet;
+       _NetworkManagerImpl* __pNetworkManagerImplForSelect;
+       _NetworkManagerImpl* __pNetworkManagerImplForSearch;
+       _CallManagerImpl* __pCallManagerImplForGet;
+       _CallManagerImpl* __pCallManagerImplForStart;
+       _CallManagerImpl* __pCallManagerImplForStop;
        static _TelephonyIpcProxy* __pInstance;
 
 }; // _TelephonyIpcProxy