Fix Installation issue
authorJoohyun Kim <joohyune.kim@samsung.com>
Thu, 4 Apr 2013 12:42:31 +0000 (21:42 +0900)
committerJoohyun Kim <joohyune.kim@samsung.com>
Thu, 4 Apr 2013 12:42:31 +0000 (21:42 +0900)
Change-Id: I1d157391a38c2f13c3e0cf7b98293a869bd09f79
Signed-off-by: Joohyun Kim <joohyune.kim@samsung.com>
src/system/FSys_CommunicationDispatcherClient.cpp
src/system/FSys_PowerManagerImpl.cpp
src/system/FSys_SystemClient.cpp
src/system/FSys_SystemInfoImpl.cpp

index 3d47a9d..bc7d8e6 100644 (file)
@@ -33,6 +33,7 @@ using namespace Tizen::Io;
 namespace Tizen { namespace System
 {
 
+bool ipcReady = false;
 static const wchar_t* _COMMUNICATION_DISPATCHER_IPC_ID = L"osp.app.ipcserver.communicationdispatcher";
 
 _CommunicationDispatcherClient* _CommunicationDispatcherClient::__pCommunicationDispatcherClient = null;
@@ -47,6 +48,10 @@ _CommunicationDispatcherClient::_CommunicationDispatcherClient()
        SysTryCatch(NID_SYS, __pIpcClient != null, , r, "It is failed to create IPC client");
 
        r = __pIpcClient->Construct(_COMMUNICATION_DISPATCHER_IPC_ID, this);
+       if(r != E_SUCCESS)
+               ipcReady = false;
+       else
+               ipcReady = true;
        SysTryCatch(NID_SYS, r == E_SUCCESS, , r, "Propagated. [%s]", GetErrorMessage(r));
 
 CATCH:
@@ -75,6 +80,9 @@ _CommunicationDispatcherClient::GetInstance()
 _IpcClient*
 _CommunicationDispatcherClient::GetIpcClient()
 {
+       if(ipcReady == false)
+               return null;
+
        return __pIpcClient;
 }
 
index e32b94f..209d466 100644 (file)
@@ -240,9 +240,9 @@ PowerChangedCallback(power_state_e state, void* userData)
                                }
                        }
                }
-               else
+               else if(state == POWER_STATE_NORMAL)
                {
-                        for (int i = 0; i < __pSceenEventList->GetCount(); i++)
+                       for (int i = 0; i < __pSceenEventList->GetCount(); i++)
                         {
                                 IScreenEventListener* pIScreenEventListener = null;
                                 result r = E_SUCCESS;
index 54c506c..acc905f 100644 (file)
@@ -98,8 +98,10 @@ _SystemClient::GetValue(const String& key, bool& value)
        String commandId(_SYSTEM_COMMAND_GET_BOOL);
 
        _CommunicationDispatcherClient* pCommunicationDispatcherClient = _CommunicationDispatcherClient::GetInstance();
+       SysTryReturnResult(NID_SYS, pCommunicationDispatcherClient != null, E_SYSTEM, "It is failed to get Communication Dispatcher.");
 
        __pIpcClient = pCommunicationDispatcherClient->GetIpcClient();
+       SysTryReturnResult(NID_SYS, __pIpcClient != null, E_SYSTEM, "It is failed to get IPC client.");
 
        ArrayList requestMessages;
        ArrayList responseMessages;
@@ -146,8 +148,10 @@ _SystemClient::GetValue(const String& key, int& value)
        String commandId(_SYSTEM_COMMAND_GET_INT);
 
        _CommunicationDispatcherClient* pCommunicationDispatcherClient = _CommunicationDispatcherClient::GetInstance();
+       SysTryReturnResult(NID_SYS, pCommunicationDispatcherClient != null, E_SYSTEM, "It is failed to get Communication Dispatcher.");
 
        __pIpcClient = pCommunicationDispatcherClient->GetIpcClient();
+       SysTryReturnResult(NID_SYS, __pIpcClient != null, E_SYSTEM, "It is failed to get IPC client.");
 
        ArrayList requestMessages;
        ArrayList responseMessages;
@@ -177,6 +181,7 @@ _SystemClient::GetValue(const String& key, int& value)
        SysTryReturnResult(NID_SYS, r == E_SUCCESS, r, "Result value[%ls] convert is failed.", pValue->GetPointer());
 
        responseMessages.RemoveAll(true);
+
        return r;
 }
 
@@ -189,8 +194,10 @@ _SystemClient::GetValue(const String& key, String& value)
        String commandId(_SYSTEM_COMMAND_GET_STRING);
 
        _CommunicationDispatcherClient* pCommunicationDispatcherClient = _CommunicationDispatcherClient::GetInstance();
+       SysTryReturnResult(NID_SYS, pCommunicationDispatcherClient != null, E_SYSTEM, "It is failed to get Communication Dispatcher.");
 
        __pIpcClient = pCommunicationDispatcherClient->GetIpcClient();
+       SysTryReturnResult(NID_SYS, __pIpcClient != null, E_SYSTEM, "It is failed to get IPC client.");
 
        ArrayList requestMessages;
        ArrayList responseMessages;
index 701b2f0..86eaf5d 100644 (file)
@@ -655,10 +655,10 @@ _SystemInfoImpl::GetFromRegistry(const String& key, String& value)
        String valStr;
 
        r = _reg.Construct(_REGISTRY_PATH, REG_OPEN_READ_ONLY, null);
-       SysTryReturnResult(NID_SYS, r == E_SUCCESS , r, " RegistryImpl construct It is failed");
+       SysTryReturnResult(NID_SYS, r == E_SUCCESS , r, " RegistryImpl construct is failed");
 
        r = _reg.GetValue(_SYSTEM_INFO_SESSION, key, valStr);
-       SysTryReturnResult(NID_SYS, r == E_SUCCESS , r, " Registry GetValue  It is failed");
+       SysTryReturnResult(NID_SYS, r == E_SUCCESS , r, " Registry GetValue is failed");
 
        if(valStr == L"true" || valStr == L"false")
        {
@@ -679,13 +679,13 @@ _SystemInfoImpl::GetFromRegistry(const String& key, int& value)
        _RegistryImpl _reg;
        String valStr;
        r = _reg.Construct(_REGISTRY_PATH, REG_OPEN_READ_ONLY, null);
-       SysTryReturnResult(NID_SYS, r == E_SUCCESS, r, " RegistryImpl construct It is failed");
+       SysTryReturnResult(NID_SYS, r == E_SUCCESS, r, " RegistryImpl construct is failed");
 
        r = _reg.GetValue(_SYSTEM_INFO_SESSION, key, valStr);
-       SysTryReturnResult(NID_SYS, r == E_SUCCESS, r, " Registry GetValue  It is failed");
-       SysTryReturnResult(NID_SYS, r == E_SUCCESS, E_SYSTEM, " Registry GetValue  It is failed");
+       SysTryReturnResult(NID_SYS, r == E_SUCCESS, r, " Registry GetValue is failed");
+       SysTryReturnResult(NID_SYS, r == E_SUCCESS, E_SYSTEM, " Registry GetValue is failed");
        r = Integer::Parse(valStr, value);
-       SysTryReturnResult(NID_SYS, r == E_SUCCESS, E_OBJ_NOT_FOUND, " Integer::Parse()  It is failed");
+       SysTryReturnResult(NID_SYS, r == E_SUCCESS, E_OBJ_NOT_FOUND, " Integer::Parse() is failed");
        return E_SUCCESS;
 }
 
@@ -696,11 +696,11 @@ _SystemInfoImpl::GetFromRegistry(const String& key, bool& value)
        _RegistryImpl _reg;
        String valStr;
        r = _reg.Construct(_REGISTRY_PATH, REG_OPEN_READ_ONLY, null);
-       SysTryReturnResult(NID_SYS, r == E_SUCCESS, r, " RegistryImpl construct It is failed");
+       SysTryReturnResult(NID_SYS, r == E_SUCCESS, r, " RegistryImpl construct is failed");
 
        r = _reg.GetValue(_SYSTEM_INFO_SESSION, key, valStr);
-       SysTryReturnResult(NID_SYS, r == E_SUCCESS, r, " Registry GetValue It is failed");
-       SysTryReturnResult(NID_SYS, r == E_SUCCESS, E_SYSTEM, " Registry GetValue  It is failed");
+       SysTryReturnResult(NID_SYS, r == E_SUCCESS, r, " Registry GetValue is failed");
+       SysTryReturnResult(NID_SYS, r == E_SUCCESS, E_SYSTEM, " Registry GetValue is failed");
        if(valStr == L"true")
        {
                value = true;