summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rwxr-xr-xsrc/pwlock.c65
1 files changed, 49 insertions, 16 deletions
diff --git a/src/pwlock.c b/src/pwlock.c
index ac662ed..c48551f 100755
--- a/src/pwlock.c
+++ b/src/pwlock.c
@@ -446,14 +446,61 @@ Eina_Bool vconf_tapi_ready_expire_cb(void *pData)
return ECORE_CALLBACK_CANCEL;
}
+void vconf_tapi_init_ready_changed_cb(keynode_t * node, void *data)
+{
+ int api_ret = 0;
+ int isReady = 0;
+ struct appdata *ad = data;
+
+ _DBG("vconf_tapi_init_ready_changed_cb..!!");
+
+ api_ret = vconf_get_bool(VCONFKEY_TELEPHONY_READY, &isReady);
+ if (api_ret != 0) {
+ _DBG("fail to get vconf key value");
+ } else {
+ if (!isReady) {
+ _DBG("telephony init is not ready");
+ } else {
+ _DBG("telephony init is ready");
+ vconf_ignore_key_changed
+ (VCONFKEY_TELEPHONY_READY, vconf_tapi_init_ready_changed_cb);
+
+ _trans(ad, _ST_TAPI_INIT);
+ do_state(ad);
+ }
+ }
+ return;
+}
+
+void register_vconf_tapi_init_ready_changed(struct appdata *ad)
+{
+ _DBG("%s", __func__);
+ if (vconf_notify_key_changed
+ (VCONFKEY_TELEPHONY_READY, vconf_tapi_init_ready_changed_cb,
+ ad) != 0) {
+ _DBG("Fail to register");
+ }
+}
static int do_ST_TAPI_INIT(struct appdata *ad)
{
int r;
int is_emul;
char *model = NULL;
+ int bReady = 0;
_DBG("%s", __func__);
+ vconf_get_bool(VCONFKEY_TELEPHONY_READY, &bReady);
+
+ if (!bReady) {
+ _DBG("telephony is not ready");
+ register_vconf_tapi_init_ready_changed(ad);
+
+ return ECORE_CALLBACK_CANCEL;
+ }
+
+ _DBG("telephony is ready for init");
+
system_info_get_value_string(SYSTEM_INFO_KEY_MODEL, &model);
_DBG("SYSTEM_INFO_KEY_MODEL=%s\n", model);
if (!strncmp("Emulator", model, sizeof(model)))
@@ -466,21 +513,10 @@ static int do_ST_TAPI_INIT(struct appdata *ad)
ad->t = pwlock_tapi_init(pwlock_tapi_cb, ad);
if (ad->t == NULL) {
_ERR("TAPI init error");
-
- ad->tapi_init_retry_cnt++;
- _DBG("Retry count of tapi init : %d\n", ad->tapi_init_retry_cnt);
- if (ad->tapi_init_retry_cnt < 4) {
- ecore_timer_add(1, timer_do, ad);
- return ECORE_CALLBACK_CANCEL;
- } else {
- ad->tapi_init_retry_cnt = 0;
- _trans(ad, _ST_EXIT);
- return ECORE_CALLBACK_RENEW;
- }
+ _trans(ad, _ST_EXIT);
+ return ECORE_CALLBACK_RENEW;
}
- ad->tapi_init_retry_cnt = 0;
-
r = pwlock_tapi_ready_check();
_DBG("tapi_ready_check : %d", r);
@@ -1005,9 +1041,6 @@ static int app_create(void *data)
ad->is_no_sim = 0;
- // set 0 to retry count of tapi init
- ad->tapi_init_retry_cnt = 0;
-
ad->state = _ST_FIRST;
do_state(ad);