From cc71423121b14e9a86c93b3a0b7f191049cb1dd6 Mon Sep 17 00:00:00 2001 From: Guillaume Zajac Date: Tue, 9 Apr 2013 15:08:22 +0200 Subject: [PATCH] Check VCONFKEY_TELEPHONY_TAPI_STATE to be sure DBus interfaces are ready --- plugin/sms_plugin/SmsPluginMain.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/plugin/sms_plugin/SmsPluginMain.cpp b/plugin/sms_plugin/SmsPluginMain.cpp index 059a2c9..8b38f63 100755 --- a/plugin/sms_plugin/SmsPluginMain.cpp +++ b/plugin/sms_plugin/SmsPluginMain.cpp @@ -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(); -- 2.7.4