skip tapi ready re-check when pwlock run with emulator
authorsunyeop.hwnag <sunyeop.hwang@samsung.com>
Wed, 22 Aug 2012 11:14:13 +0000 (20:14 +0900)
committersunyeop.hwnag <sunyeop.hwang@samsung.com>
Wed, 22 Aug 2012 11:14:13 +0000 (20:14 +0900)
Change-Id: Ia272bbc1e7754014e52e90a135d0fb100c72351e

CMakeLists.txt
packaging/org.tizen.pwlock.spec
src/pwlock.c

index b2211e8..0e3f62c 100755 (executable)
@@ -57,6 +57,7 @@ pkg_check_modules(pkgs REQUIRED
        accounts-svc
        appsvc
        iniparser
+       capi-system-info
 )
 
 FOREACH(flag ${pkgs_CFLAGS})
index d5439cd..3d06bb7 100755 (executable)
@@ -23,6 +23,7 @@ BuildRequires: pkgconfig(appsvc)
 BuildRequires: pkgconfig(sysman)
 BuildRequires: pkgconfig(capi-base-common)
 BuildRequires: pkgconfig(iniparser)
+BuildRequires: pkgconfig(capi-system-info)
 BuildRequires: gettext
 BuildRequires: cmake
 BuildRequires: edje-tools
index 4358b56..ac662ed 100755 (executable)
@@ -24,6 +24,7 @@
 #include <vconf.h>
 #include <utilX.h>
 #include <ui-gadget.h>
+#include <system_info.h>
 
 #include "pwlock.h"
 #include "util.h"
@@ -448,9 +449,20 @@ Eina_Bool vconf_tapi_ready_expire_cb(void *pData)
 static int do_ST_TAPI_INIT(struct appdata *ad)
 {
        int r;
+       int is_emul;
+       char *model = NULL;
 
        _DBG("%s", __func__);
 
+       system_info_get_value_string(SYSTEM_INFO_KEY_MODEL, &model);
+       _DBG("SYSTEM_INFO_KEY_MODEL=%s\n", model);
+       if (!strncmp("Emulator", model, sizeof(model)))
+               is_emul = 1;
+       else
+               is_emul = 0;
+
+       PWLOCK_MEMFREE(model);
+
        ad->t = pwlock_tapi_init(pwlock_tapi_cb, ad);
        if (ad->t == NULL) {
                _ERR("TAPI init error");
@@ -472,7 +484,7 @@ static int do_ST_TAPI_INIT(struct appdata *ad)
        r = pwlock_tapi_ready_check();
        _DBG("tapi_ready_check : %d", r);
 
-       if (r == 0) {
+       if (r == 0 && is_emul == 0) {
                /* SHOULD MANAGE TIMER FROM NOW - START PART */
                ad->pTimerId =
                    ecore_timer_add(20, vconf_tapi_ready_expire_cb, ad);