[UI]Add emulator check
authorJinjin Shi <jinjin.shi@samsung.com>
Fri, 21 Dec 2012 12:56:14 +0000 (20:56 +0800)
committerJinjin Shi <jinjin.shi@samsung.com>
Fri, 21 Dec 2012 12:56:14 +0000 (20:56 +0800)
Change-Id: Ia525a4d72fcb9a61f3bace4243455b07f212c71e

CMakeLists.txt
org.tizen.lockscreen.xml.in
packaging/org.tizen.lockscreen.spec
src/lockscreen.c

index c89235d..a884672 100755 (executable)
@@ -45,6 +45,7 @@ pkg_check_modules(pkgs REQUIRED
        notification
        security-server
        ui-gadget-1
+       capi-system-info
 )
 
 FOREACH(flag ${pkgs_CFLAGS})
index 540553c..bff7e54 100755 (executable)
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
-<manifest xmlns="http://tizen.org/ns/packages" package="@PKGNAME@" version="0.1.3" install-location="internal-only">\r
+<manifest xmlns="http://tizen.org/ns/packages" package="@PKGNAME@" version="0.1.4" install-location="internal-only">\r
        <label>@PROJECT_NAME@</label>\r
        <author email="yjoo93.park@samsung.com" href="www.samsung.com">Youngjoo Park</author>\r
        <author email="seungtaek.chung@samsung.com" href="www.samsung.com">seungtaek chung</author>\r
index c8a402a..f7ef660 100755 (executable)
@@ -2,7 +2,7 @@
 
 Name:       org.tizen.lockscreen
 Summary:    lockscreen application
-Version: 0.1.3
+Version: 0.1.4
 Release:    1
 Group:      TBD
 License:    Apache
@@ -15,6 +15,7 @@ BuildRequires: pkgconfig(ail)
 BuildRequires: pkgconfig(notification)
 BuildRequires: pkgconfig(security-server)
 BuildRequires: pkgconfig(ui-gadget-1)
+BuildRequires: pkgconfig(capi-system-info)
 
 BuildRequires: cmake
 BuildRequires: gettext
index 18449d1..0d33823 100755 (executable)
 #include <app.h>
 #include <vconf.h>
 #include <Ecore_X.h>
+#include <system_info.h>
 
 #include "lockscreen.h"
 #include "util.h"
 
+#define QP_EMUL_STR      "Emulator"
+
 static void win_del(void *data, Evas_Object * obj, void *event)
 {
        elm_exit();
@@ -59,6 +62,23 @@ static void resize_cb(void *data, Evas *e, Evas_Object *obj, void *event_info)
        evas_object_geometry_get(obj, NULL, NULL, &w, &h);
 }
 
+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 bool app_create(void *data)
 {
        struct appdata *ad = data;
@@ -163,7 +183,9 @@ int main(int argc, char *argv[])
 
        memset(&ad, 0x0, sizeof(struct appdata));
 
-       setenv("ELM_ENGINE", "gl", 1);
+       if(!_check_emul()) {
+               setenv("ELM_ENGINE", "gl", 1);
+       }
 
        return app_efl_main(&argc, &argv, &event_callback, &ad);
 }