Revise: add manifest file for SMACK label setting. And add process start/end log. 61/14161/1 accepted/tizen/ivi accepted/tizen/ivi/20140129.180655 accepted/tizen/ivi/release/20140312.124735 submit/tizen/20140129.084811 submit/tizen_ivi_release/20140312.071455
authorMasayuki Sasaki <masayuki.sasaki@mail.toyota-td.jp>
Thu, 26 Dec 2013 05:51:29 +0000 (14:51 +0900)
committerMasayuki Sasaki <masayuki.sasaki@mail.toyota-td.jp>
Thu, 26 Dec 2013 05:55:03 +0000 (14:55 +0900)
Change-Id: Idfd45a0fc0fb7ab003c2d33c8c2d383e094720eb
Signed-off-by: Masayuki Sasaki <masayuki.sasaki@mail.toyota-td.jp>
gtforce/ico_dic-gtforce.c
gtforce/ico_dic-gtforce.h
gtforce/ico_dic-wayland.c
ico-uxf-device-input-controller.manifest [new file with mode: 0644]
packaging/ico-uxf-device-input-controller.changes
packaging/ico-uxf-device-input-controller.spec
settings/ico-device-input-controller.service
tests/input-controller-test
tests/input-controller-test.G25
tests/weston.ini [new file with mode: 0644]

index 3af1256..48a75fc 100644 (file)
@@ -255,6 +255,7 @@ ico_dic_read_conf(const char *file)
     gIco_Dic_JS_Input = (Ico_Dic_JS_Input *)malloc(sizeof(Ico_Dic_JS_Input) * length);
     if (! gIco_Dic_JS_Input)  {
         ICO_ERR("joystick_gtforce: No Memory");
+        ICO_INF("END_MODULE GtForce device input controller(Error: No Memory)");
         exit(1);
     }
     memset((char *)gIco_Dic_JS_Input, 0, sizeof(Ico_Dic_JS_Input) * length);
@@ -347,6 +348,10 @@ ico_dic_read_conf(const char *file)
                             iMng->code[kk].appid[ll] = *p;
                             p++;
                         }
+                        if ((ll == 0) || (iMng->code[kk].appid[0] == '@'))  {
+                            iMng->code[kk].appid[0] = ' ';
+                            iMng->code[kk].appid[1] = 0;
+                        }
                         if (*p) {
                             p ++;
                             if (strncasecmp(p, "key=", 4) == 0) p += 4;
@@ -371,6 +376,10 @@ ico_dic_read_conf(const char *file)
                                     iMng->code[0].appid[ll] = *p;
                                     p++;
                                 }
+                                if ((ll == 0) || (iMng->code[kk].appid[0] == '@'))  {
+                                    iMng->code[kk].appid[0] = ' ';
+                                    iMng->code[kk].appid[1] = 0;
+                                }
                                 if (*p) {
                                     p ++;
                                     if (strncasecmp(p, "key=", 4) == 0) p += 4;
@@ -432,7 +441,8 @@ ico_dic_js_open(const char *dicDevName, char **confpath)
     char                devName[64];
     int                 ii, jj, kk;
 
-    ICO_TRA("ico_dic_js_open: Enter(device=%s, conf=%s)", dicDevName,
+    ICO_TRA("ico_dic_js_open: Enter(device=%s, conf=%s)",
+            dicDevName ? dicDevName : "(null)",
             *confpath ? *confpath : "(null)");
 
     char *pdev = getenv(ICO_DIC_INPUT_DEV);
@@ -491,6 +501,9 @@ ico_dic_js_open(const char *dicDevName, char **confpath)
                 if (conf_fd < 0)    continue;
                 close(conf_fd);
             }
+            else    {
+                strncpy(fixconfpath, *confpath, sizeof(fixconfpath));
+            }
             break;
         }
         /* not match, close */
@@ -559,6 +572,7 @@ ico_dic_js_read(int fd)
             return;
         }
         ICO_ERR("ico_dic_js_read: read error[%d]", ii)
+        ICO_INF("END_MODULE GtForce device input controller(Error: Device Read Error)");
         exit(9);
     }
     for (ii = 0; ii < (rSize / (int)sizeof(struct js_event)); ii++) {
@@ -745,6 +759,15 @@ int main(int argc, char *argv[])
             /* event input log  */
             mEventLog = 1;
         }
+        else if (strcasecmp( argv[ii], "--user") == 0) {
+            ii ++;
+            if (ii < argc)  {
+                if (strcmp(argv[ii], cuserid(NULL)) != 0)    {
+                    printf("ico_dic-gtforce: abort(cannot run in a '%s')\n", cuserid(NULL));
+                    exit(9);
+                }
+            }
+        }
         else {
             dicDevName = argv[ii];
         }
@@ -760,6 +783,7 @@ int main(int argc, char *argv[])
 
     /* set log name     */
     ico_log_open(mDebug != 3 ? "ico_dic-gtforce" : NULL);
+    ICO_INF("START_MODULE GtForce device input controller");
 
     /* read conf file   */
     confpath = getenv(ICO_DIC_CONF_ENV);
@@ -768,6 +792,7 @@ int main(int argc, char *argv[])
     JSfd = ico_dic_js_open(dicDevName, &confpath);
     if (JSfd < 0) {
         ICO_ERR("main: Leave(Error device open)");
+        ICO_INF("END_MODULE GtForce device input controller(Error: Device Open Error)");
         exit(1);
     }
     gIco_Dic_JS.fd = JSfd;
@@ -775,12 +800,14 @@ int main(int argc, char *argv[])
     /* read conf file   */
     if (ico_dic_read_conf(confpath) == ICO_DIC_ERR) {
         ICO_ERR("main: Leave(Error can not read configfile(%s))", confpath);
+        ICO_INF("END_MODULE GtForce device input controller(Error: config file Read Error");
         exit(1);
     }
 
     /* initialize wayland   */
     if (ico_dic_wayland_init(NULL, NULL) == ICO_DIC_ERR)    {
         ICO_ERR("main: Leave(Error can not connect to wayland)");
+        ICO_INF("END_MODULE GtForce device input controller(Error: Can not connect to wayland)");
         exit(1);
     }
     ico_dic_add_fd(JSfd);
@@ -819,6 +846,8 @@ int main(int argc, char *argv[])
         }
     }
     ico_dic_wayland_finish();
+
+    ICO_INF("END_MODULE GtForce device input controller");
     ico_log_close();
 
     exit(0);
@@ -830,4 +859,3 @@ static void PrintUsage(const char *pName)
     fprintf( stderr, "       ex)\n");
     fprintf( stderr, "          %s \"Driving Force GT\"\n", pName);
 }
-
index 87c0bd7..5f24255 100644 (file)
@@ -89,4 +89,3 @@ int ico_dic_add_fd(int fd);                     /* add file descriptor
 }
 #endif
 #endif  /* _ICO_DIC_GTFORCE_H_ */
-
index 4938821..dbf9480 100644 (file)
@@ -177,6 +177,8 @@ ico_dic_wayland_iterate(struct epoll_event *ev_ret, int timeout)
                     errcount ++;
                     if (errcount > 50)  {
                         ICO_ERR("ico_dic_wayland_iterate: Error wayland disconnect");
+                        ICO_INF("END_MODULE GtForce device input controller"
+                                "(Error: wayland disconnect)");
                         exit(9);
                     }
                     if ((errcount % 5) == 0)    {
@@ -249,4 +251,3 @@ ico_dic_wayland_finish(void)
 
     ICO_DBG("ico_dic_wayland_finish: Leave");
 }
-
diff --git a/ico-uxf-device-input-controller.manifest b/ico-uxf-device-input-controller.manifest
new file mode 100644 (file)
index 0000000..017d22d
--- /dev/null
@@ -0,0 +1,5 @@
+<manifest>
+ <request>
+    <domain name="_"/>
+ </request>
+</manifest>
index 79a74fc..8f550e3 100644 (file)
@@ -1,3 +1,8 @@
+* Thu Dec 26 2013 Shibata Makoto <shibata@mac.tec.toyota.co.jp> submit/tizen/20131219.041510@b8c013a
+- 0.9.05 release
+-- revise: add manifest file for SMACK label setting
+-- revise: add process start/end log
+
 * Fri Nov 29 2013 Shibata Makoto <shibata@mac.tec.toyota.co.jp> accepted/tizen_ivi_stable/20131119.040206@f02120b
 - 0.9.04 release
 -- bug fix: A package test script(tests/input-controller-test) becomes the error by a timing
index 067ff83..5d78b12 100644 (file)
@@ -1,6 +1,6 @@
 Name:       ico-uxf-device-input-controller
 Summary:    Device Input Controller
-Version:    0.9.04
+Version:    0.9.05
 Release:    1.1
 Group:      System/GUI
 License:    Apache License, Version 2.0
@@ -44,6 +44,7 @@ install -m 0755 settings/set_daynight.sh %{buildroot}%{ictl_conf}
 install -m 644 settings/ico-device-input-controller.service %{buildroot}%{_unitdir_user}/ico-device-input-controller.service
 
 %files
+%manifest %{name}.manifest
 %defattr(-,root,root,-)
 %{_bindir}/ico_dic-gtforce
 %{ictl_conf}/drivingforcegt.conf
index 1d58280..37bfbf9 100644 (file)
@@ -4,4 +4,5 @@ Requires=weston.service
 After=weston.service
 
 [Service]
-ExecStart=/usr/bin/ico_dic-gtforce -d
+Environment=XDG_RUNTIME_DIR=/run/user/5000
+ExecStart=/usr/bin/ico_dic-gtforce -d --user app
index ed74a64..08e7867 100755 (executable)
@@ -10,6 +10,7 @@ rm -fr ../tests/testlog/* 2> /dev/null
 
 # 2 set weston environment
 export XDG_RUNTIME_DIR=/run/user/5000
+export XDG_CONFIG_HOME="../tests"
 
 # 3 Start Device Input Controllers
 export DIC_GTFORCE_CONF="./testdata/g27racingwheel.conf"
@@ -17,7 +18,7 @@ export DIC_GTFORCE_CONF="./testdata/g27racingwheel.conf"
 sleep 0.5
 
 # 4 Start Weston
-/usr/bin/weston --tty=1 --idle-time=0 $WESTON_BACKEND --log=../tests/testlog/weston.log &
+/usr/bin/weston --tty=2 --idle-time=0 $WESTON_BACKEND --log=../tests/testlog/weston.log &
 sleep 180
 
 # 5 End of Test
@@ -43,9 +44,9 @@ fi
 if [ "$?" != "1" ] ; then
        FOUND_ERR=1
 fi
-/bin/grep "error" testlog/*
+/bin/grep "error" testlog/* | /bin/grep -v "error_but_no_problem_for_test" | /bin/grep -v "failed to restore kb mode:" | /bin/grep -v "failed to set KD_TEXT mode on tty:"
 if [ "$?" != "1" ] ; then
-       FOUND_ERR=1
+    FOUND_ERR=1
 fi
 /bin/grep "Fail" testlog/* | /bin/grep -v "error_but_no_problem_for_test" | /bin/grep -v "initialize backlight" | /bin/grep -v "disconnect"
 if [ "$?" != "1" ] ; then
index 88b2920..49d4e26 100755 (executable)
@@ -10,6 +10,7 @@ rm -fr ../tests/testlog/* 2> /dev/null
 
 # 2 set weston environment
 export XDG_RUNTIME_DIR=/run/user/5000
+export XDG_CONFIG_HOME="../tests"
 
 # 3 Start Device Input Controllers
 export DIC_GTFORCE_CONF="./testdata/drivingforcegt.conf"
@@ -17,7 +18,7 @@ export DIC_GTFORCE_CONF="./testdata/drivingforcegt.conf"
 sleep 0.5
 
 # 4 Start Weston
-/usr/bin/weston --tty=1 --idle-time=0 $WESTON_BACKEND --log=../tests/testlog/weston.log &
+/usr/bin/weston --tty=2 --idle-time=0 $WESTON_BACKEND --log=../tests/testlog/weston.log &
 sleep 180
 
 # 5 End of Test
@@ -43,9 +44,9 @@ fi
 if [ "$?" != "1" ] ; then
        FOUND_ERR=1
 fi
-/bin/grep "error" testlog/*
+/bin/grep "error" testlog/* | /bin/grep -v "error_but_no_problem_for_test" | /bin/grep -v "failed to restore kb mode:" | /bin/grep -v "failed to set KD_TEXT mode on tty:"
 if [ "$?" != "1" ] ; then
-       FOUND_ERR=1
+    FOUND_ERR=1
 fi
 /bin/grep "Fail" testlog/* | /bin/grep -v "error_but_no_problem_for_test" | /bin/grep -v "initialize backlight" | /bin/grep -v "disconnect"
 if [ "$?" != "1" ] ; then
diff --git a/tests/weston.ini b/tests/weston.ini
new file mode 100644 (file)
index 0000000..0ba17f9
--- /dev/null
@@ -0,0 +1,71 @@
+[core]
+shell=
+modules=ico_plugin_loader.so
+# This is Error for Test(No Problem)
+
+[shell]
+num-workspaces=1
+shell-exe=
+locking=false
+animation=zoom
+startup-animation=fade
+
+[input-method]
+#path=/bin/weekeyboard
+path=
+
+#[output]
+#name=HDMI1
+#transform=90
+
+#[output]
+#name=HDMI3
+#transform=90
+
+#[output]
+#name=VGA1
+#mode=off
+
+[ivi-plugin]
+modules=ico_ivi_shell.so,ico_window_mgr.so,ico_window_animation.so,ico_input_mgr.so
+
+[ivi-display]
+# logical display number list
+displayno=1,0
+# default input panel display
+inputpanel=0
+
+[ivi-layer]
+# background layer id
+background=0
+# default(panel) layer id
+default=1
+# touch panel layer id
+touch=101
+# cursor layer id
+cursor=102
+# layer id at the time of the system startup
+startup=103
+# input panel layer decoration (magnification rate(%);difference from the bottom)
+inputpaneldeco=120;132
+
+[ivi-animation]
+# default animation name;time;rate(frame/sec)
+default=fade;500;30
+# input panel surface animation(name;time)
+inputpanel=fade;200
+
+[ivi-option]
+# option flags
+#  0x0001 1=show surface at screen create if HomeScreen exist/0=not show surface at create
+#  0x0002 1=1=show if display not exist/0=not show if display not exist
+#  0x0004 1=show input panel automatically/0=not show automaticaly
+#  0x0080 1=surface fixed aspect rate/0=not fixed aspect rate
+#  0x8000 1=no use GPU dependent acceleration
+#  0x1000 1=force use Intel Sandybridge Mobile GPU dependent acceleration
+flag=0x0004
+
+# debug log output level and debug flag
+#  lower 16 bit: log level(0=no/1=err/2=warn/3=info/4=trace/5=debug)
+#  upper 16 bit: debug flag(0x00010000: performance log)
+log=0x00010005