fix pwlock launch for emulator
authorSeungtaek Chung <seungtaek.chung@samsung.com>
Thu, 7 Mar 2013 13:27:57 +0000 (22:27 +0900)
committerSeungtaek Chung <seungtaek.chung@samsung.com>
Thu, 7 Mar 2013 13:27:57 +0000 (22:27 +0900)
CMakeLists.txt
packaging/starter.spec
src/starter.c

index d03f51b..fec3928 100755 (executable)
@@ -39,6 +39,7 @@ pkg_check_modules(pkgs REQUIRED
        ui-gadget-1
        bundle
        capi-appfw-application
+       capi-system-info
 )
 
 FOREACH(flag ${pkgs_CFLAGS})
index 8fa0551..ebc804a 100755 (executable)
@@ -1,6 +1,6 @@
 Name:       starter
 Summary:    starter
-Version: 0.4.56
+Version: 0.4.57
 Release:    2
 Group:      TO_BE/FILLED_IN
 License:    TO_BE/FILLED_IN
@@ -33,6 +33,7 @@ BuildRequires:  pkgconfig(vconf)
 BuildRequires:  pkgconfig(x11)
 BuildRequires:  pkgconfig(xcomposite)
 BuildRequires:  pkgconfig(xext)
+BuildRequires:  pkgconfig(capi-system-info)
 BuildRequires:  cmake
 BuildRequires:  edje-bin
 BuildRequires: gettext-tools
index c90601c..e76f0e9 100755 (executable)
@@ -30,6 +30,7 @@
 #include <vconf.h>
 #include <heynoti.h>
 #include <signal.h>
+#include <system_info.h>
 
 #include "starter.h"
 #include "starter-util.h"
@@ -45,6 +46,7 @@
 #define DEFAULT_THEME "tizen"
 #define PWLOCK_PATH "/usr/apps/org.tizen.pwlock/bin/pwlock"
 #define PWLOCK_PKG_NAME "org.tizen.pwlock"
+#define QP_EMUL_STR      "Emulator"
 
 static void lock_menu_screen(void)
 {
@@ -82,12 +84,35 @@ static void _set_elm_theme(void)
                free(vstr);
 }
 
+static int _check_emul()
+{
+       int is_emul = 0;
+       char *info = NULL;
+
+       if (system_info_get_value_string(SYSTEM_INFO_KEY_MODEL, &info) == 0) {
+               if (info == NULL) return 0;
+               if (!strncmp(QP_EMUL_STR, info, strlen(info))) {
+                       is_emul = 1;
+               }
+       }
+
+       if (info != NULL) free(info);
+
+       return is_emul;
+}
+
 static int _launch_pwlock(void)
 {
        int r;
 
        _DBG("%s", __func__);
 
+       if(_check_emul()) {
+               _DBG("Emulator => skip pwlock");
+               vconf_set_int(VCONFKEY_STARTER_SEQUENCE, 1);
+               return 0;
+       }
+
        r = aul_launch_app(PWLOCK_PKG_NAME, NULL);
        if (r < 0) {
                _ERR("PWLock launch error: error(%d)", r);