Check VCONFKEY_TELEPHONY_TAPI_STATE to be sure DBus interfaces are ready
authorGuillaume Zajac <guillaume.zajac@linux.intel.com>
Tue, 9 Apr 2013 13:08:22 +0000 (15:08 +0200)
committerGuillaume Zajac <guillaume.zajac@linux.intel.com>
Tue, 9 Apr 2013 13:12:02 +0000 (15:12 +0200)
plugin/sms_plugin/SmsPluginMain.cpp

index 059a2c9..8b38f63 100755 (executable)
@@ -51,12 +51,12 @@ static void MsgTapiInitCB(keynode_t *key, void* data)
 {
        MSG_DEBUG("MsgTapiInitCB is called.");
 
-       bool bTelRdy = false;
-       bTelRdy = vconf_keynode_get_bool(key);
+       int tapi_state;
+       tapi_state = vconf_keynode_get_int(key);
 
-       MSG_DEBUG("bTelRdy [%d]", bTelRdy);
+       MSG_DEBUG("tapi_state [%d]", tapi_state);
 
-       if (bTelRdy) {
+       if (tapi_state == VCONFKEY_TELEPHONY_TAPI_STATE_READY) {
                mx.lock();
                cv.signal();
                mx.unlock();
@@ -119,14 +119,14 @@ msg_error_t SmsPlgInitialize()
        if (MsgSettingSetInt(MSG_SIM_CHANGED, MSG_SIM_STATUS_NOT_FOUND) != MSG_SUCCESS)
                MSG_DEBUG("MsgSettingSetInt is failed!!");
 
-       bool bReady = false;
-       MsgSettingGetBool(VCONFKEY_TELEPHONY_READY, &bReady);
-       MSG_DEBUG("Get VCONFKEY_TELEPHONY_READY [%d].", bReady);
+       int tapi_state;
+       tapi_state = MsgSettingGetInt(VCONFKEY_TELEPHONY_TAPI_STATE);
+       MSG_DEBUG("Get VCONFKEY_TELEPHONY_TAPI_STATE [%d].", tapi_state);
 
        int ret = 0;
 
-       if(!bReady) {
-               MsgSettingRegVconfCBCommon(VCONFKEY_TELEPHONY_READY, MsgTapiInitCB);
+       if(tapi_state != VCONFKEY_TELEPHONY_TAPI_STATE_READY) {
+               MsgSettingRegVconfCBCommon(VCONFKEY_TELEPHONY_TAPI_STATE, MsgTapiInitCB);
                mx.lock();
                ret = cv.timedwait(mx.pMutex(), 90);
                mx.unlock();