tizen beta release
authorKibum Kim <kb0929.kim@samsung.com>
Mon, 27 Feb 2012 04:32:57 +0000 (13:32 +0900)
committerKibum Kim <kb0929.kim@samsung.com>
Mon, 27 Feb 2012 04:32:57 +0000 (13:32 +0900)
debian/changelog
launchpad_run
launchpad_src/launchpad.c
src/launch.c
test/ac_daemon.c
test/app_test.c
test/aul_dbus.c
test/aul_dbus.h
test/aul_test.c
test/dbusapp_test.c
test/launch_app.c

index 8ab59c9..cb67e43 100644 (file)
@@ -1,3 +1,11 @@
+aul-1 (0.0.154-4) unstable; urgency=low
+
+  * Updated Code
+  * Git: pkgs/a/aul-1
+  * Tag: aul-1_0.0.154-4
+
+ -- Sewook Park <sewook7.park@samsung.com>  Sat, 25 Feb 2012 17:41:50 +0900
+
 aul-1 (0.0.154-3) unstable; urgency=low
 
   * Initial release
index 47c3090..c5ccbf5 100755 (executable)
@@ -1,5 +1,14 @@
 #!/bin/sh
 mkdir /tmp/alaunch
 chmod 1777 /tmp/alaunch
+
+j=0
+while [ ! -f /opt/etc/.profile_ready ];
+do
+        let j++
+        echo -ne "Waiting profile_ready $j\r"
+        sleep 0.1
+done
+
 /usr/bin/launchpad_preloading_preinitializing_daemon "                                                                                                                                                                                                         " &
 /usr/bin/ac_daemon &
index ee845b9..48aab9f 100755 (executable)
 #define PATH_APP_ROOT "/opt/apps"
 #define PATH_DATA "/data"
 #define SDK_CODE_COVERAGE "CODE_COVERAGE"
+#define SDK_DYNAMIC_ANALYSIS "DYNAMIC_ANALYSIS"
+#define PATH_DA_SO "/home/developer/sdk_tools/da/da_probe.so"
+
 
 static double root_width;
 static double root_height;
-static int scale_factor_init = 0;
 static char *launchpad_cmdline;
 static int initialized = 0;
 
@@ -78,8 +80,9 @@ static int initialized = 0;
 
 _static_ void __set_oom();
 _static_ void __set_env(app_info_from_db * menu_info, bundle * kb);
-_static_ int __prepare_exec(const char *pkg_name, 
-       const char *app_path, app_info_from_db * menu_info, bundle * kb);
+_static_ int __prepare_exec(const char *pkg_name,
+                           const char *app_path, app_info_from_db * menu_info,
+                           bundle * kb);
 _static_ int __fake_launch_app(int cmd, int pid, bundle * kb);
 static void __fill_argv(const char *key, const char *value, void *data);
 _static_ char **__create_argc_argv(bundle * kb, int *margc);
@@ -121,34 +124,35 @@ _static_ void __set_oom()
        fclose(fp);
 }
 
-_static_ void __set_env(app_info_from_db * menu_info, bundle * kb)
-{
+_static_ void __set_sdk_env(app_info_from_db* menu_info, char* str) {
        char buf[MAX_LOCAL_BUFSZ];
-       const char *str;
        int ret;
 
-       if (scale_factor_init) {
-               if (_is_app_scalable_with_height(menu_info)) {
-                       if (_get_app_height(menu_info) == 0)
-                               snprintf(buf, MAX_LOCAL_BUFSZ, "%lf", 1.0);
-                       else
-                               snprintf(buf, MAX_LOCAL_BUFSZ, "%lf",
-                                        root_height /
-                                        _get_app_height(menu_info));
-               } else {
-                       if (_get_app_width(menu_info) == 0)
-                               snprintf(buf, MAX_LOCAL_BUFSZ, "%lf", 1.0);
-                       else
-                               snprintf(buf, MAX_LOCAL_BUFSZ, "%lf",
-                                        root_width /
-                                        _get_app_width(menu_info));
-               }
+       _D("key : %s / value : %s", AUL_K_SDK, str);
+       /* http://gcc.gnu.org/onlinedocs/gcc/Cross_002dprofiling.html*/
+       /* GCOV_PREFIX contains the prefix to add to the absolute paths in the object file. */
+       /*              Prefix can be absolute, or relative. The default is no prefix.  */
+       /* GCOV_PREFIX_STRIP indicates the how many initial directory names */
+       /*              to stripoff the hardwired absolute paths. Default value is 0. */
+       if (strncmp(str, SDK_CODE_COVERAGE, strlen(str)) == 0) {
+               snprintf(buf, MAX_LOCAL_BUFSZ, PATH_APP_ROOT"/%s"PATH_DATA, _get_pkgname(menu_info));
+               ret = setenv("GCOV_PREFIX", buf, 1);
+               _D("GCOV_PREFIX : %d", ret);
+               ret = setenv("GCOV_PREFIX_STRIP", "4096", 1);
+               _D("GCOV_PREFIX_STRIP : %d", ret);
+       } else if (strncmp(str, SDK_DYNAMIC_ANALYSIS, strlen(str)) == 0) {
+               ret = setenv("LD_PRELOAD", PATH_DA_SO, 1);
+               _D("LD_PRELOAD : %d", ret);
+       }
+}
 
-               _D("changed scale factor = %s", buf);
 
-               setenv("ELM_SCALE", buf, 1);
-               setenv("SCALE_FACTOR", buf, 1);
-       }
+_static_ void __set_env(app_info_from_db * menu_info, bundle * kb)
+{
+       const char *str;
+       const char **str_array;
+       int len;
+       int i;
 
        setenv("PKG_NAME", _get_pkgname(menu_info), 1);
 
@@ -158,27 +162,25 @@ _static_ void __set_env(app_info_from_db * menu_info, bundle * kb)
        if (str != NULL)
                setenv("APP_START_TIME", str, 1);
 
-       str = bundle_get_val(kb, AUL_K_SDK);
-       if(str != NULL) {
-               _D("key : %s / value : %s",AUL_K_SDK,str);
-               /* http://gcc.gnu.org/onlinedocs/gcc/Cross_002dprofiling.html*/
-               /* GCOV_PREFIX contains the prefix to add to the absolute paths in the object file. */
-               /*              Prefix can be absolute, or relative. The default is no prefix.  */
-               /* GCOV_PREFIX_STRIP indicates the how many initial directory names */
-               /*              to stripoff the hardwired absolute paths. Default value is 0. */
-               if (strncmp(str, SDK_CODE_COVERAGE, strlen(str)) == 0) {
-                       snprintf(buf, MAX_LOCAL_BUFSZ, PATH_APP_ROOT"/%s"PATH_DATA, _get_pkgname(menu_info));
-                       ret = setenv("GCOV_PREFIX", buf, 1);
-                       _D("GCOV_PREFIX : %d", ret);
-                       ret = setenv("GCOV_PREFIX_STRIP", "4096", 1);
-                       _D("GCOV_PREFIX_STRIP : %d", ret);
+       if(bundle_get_type(kb, AUL_K_SDK) & BUNDLE_TYPE_ARRAY) {
+               str_array = bundle_get_str_array(kb, AUL_K_SDK, &len);
+               if(str_array != NULL) {
+                       for (i = 0; i < len; i++) {
+                               _D("index : [%d]", i);
+                               __set_sdk_env(menu_info, str_array[i]);
+                       }
+               }
+       } else {
+               str = bundle_get_val(kb, AUL_K_SDK);
+               if(str != NULL) {
+                       __set_sdk_env(menu_info, str);
                }
        }
-
 }
 
-_static_ int __prepare_exec(const char *pkg_name, 
-       const char *app_path, app_info_from_db * menu_info, bundle * kb)
+_static_ int __prepare_exec(const char *pkg_name,
+                           const char *app_path, app_info_from_db * menu_info,
+                           bundle * kb)
 {
        char *file_name;
        char process_name[AUL_PR_NAME];
@@ -784,10 +786,10 @@ _static_ void __launchpad_main_loop(int main_fd)
                        PERF("prepare exec - first done");
                        _E("lock up test log(no error) : prepare exec - first done");
 
-                       if (__prepare_exec(pkg_name, app_path, 
-                               menu_info, kb) < 0) {
+                       if (__prepare_exec(pkg_name, app_path,
+                                          menu_info, kb) < 0) {
                                _E("preparing work fail to launch - "
-                                       "can not launch %s\n", pkg_name);
+                                  "can not launch %s\n", pkg_name);
                                exit(-1);
                        }
 
@@ -871,12 +873,6 @@ _static_ int __launchpad_post_init()
                return 0;
        }
 
-       x_util_init();
-
-       /* get root window size   */
-       x_util_get_default_size(&root_width, &root_height);
-       scale_factor_init = 1;
-
        preinit_init();
        if (__signal_set_sigchld() < 0)
                return -1;
index a0931af..13d6014 100755 (executable)
@@ -163,6 +163,16 @@ static int __app_launch_local(bundle *b)
                return AUL_R_ERROR;
 }
 
+static int __app_resume_local()
+{
+       if (!aul_is_initialized())
+               return AUL_R_ENOINIT;
+
+       app_resume();
+
+       return 0;
+}
+
 /**
  * @brief      start caller with kb
  * @return     callee's pid
@@ -186,8 +196,20 @@ int app_request_to_launchpad(int cmd, const char *pkgname, bundle *kb)
                _E("app_request_to_launchpad : Same Process Send Local");
                bundle *b;
 
-               b = bundle_dup(kb);
-               ret = __app_launch_local(b);
+               switch (cmd) {
+                       case APP_START:
+                       case APP_START_RES:
+                               b = bundle_dup(kb);
+                               ret = __app_launch_local(b);
+                               break;
+                       case APP_RESUME:
+                       case APP_RESUME_BY_PID:
+                               ret = __app_resume_local();
+                               break;
+                       default:
+                               _E("no support packet");
+               }
+
        }
 
        /* cleanup */
index 13f8fd3..62a5625 100755 (executable)
@@ -1,19 +1,23 @@
 /*
-Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved 
-PROPRIETARY/CONFIDENTIAL
-This software is the confidential and proprietary information of 
-SAMSUNG ELECTRONICS ("Confidential Information"). You agree and acknowledge that 
-this software is owned by Samsung and you 
-shall not disclose such Confidential Information and shall 
-use it only in accordance with the terms of the license agreement 
-you entered into with SAMSUNG ELECTRONICS.  SAMSUNG make no 
-representations or warranties about the suitability 
-of the software, either express or implied, including but not 
-limited to the implied warranties of merchantability, fitness for 
-a particular purpose, or non-infringement. 
-SAMSUNG shall not be liable for any damages suffered by licensee arising out of or 
-related to this software.
-*/
+ *  aul
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact: Jayoun Lee <airjany@samsung.com>, Sewook Park <sewook7.park@samsung.com>, Jaeho Lee <jaeho81.lee@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
 
 #include <stdio.h>
 #include <glib.h>
index bd004bc..9833824 100755 (executable)
@@ -1,19 +1,23 @@
 /*
-Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved 
-PROPRIETARY/CONFIDENTIAL
-This software is the confidential and proprietary information of 
-SAMSUNG ELECTRONICS ("Confidential Information"). You agree and acknowledge that 
-this software is owned by Samsung and you 
-shall not disclose such Confidential Information and shall 
-use it only in accordance with the terms of the license agreement 
-you entered into with SAMSUNG ELECTRONICS.  SAMSUNG make no 
-representations or warranties about the suitability 
-of the software, either express or implied, including but not 
-limited to the implied warranties of merchantability, fitness for 
-a particular purpose, or non-infringement. 
-SAMSUNG shall not be liable for any damages suffered by licensee arising out of or 
-related to this software.
-*/
+ *  aul
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact: Jayoun Lee <airjany@samsung.com>, Sewook Park <sewook7.park@samsung.com>, Jaeho Lee <jaeho81.lee@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
 
 #include <poll.h>
 #include <stdio.h>
index a6000a5..0d417b6 100755 (executable)
@@ -1,19 +1,23 @@
 /*
-Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved 
-PROPRIETARY/CONFIDENTIAL
-This software is the confidential and proprietary information of 
-SAMSUNG ELECTRONICS ("Confidential Information"). You agree and acknowledge that 
-this software is owned by Samsung and you 
-shall not disclose such Confidential Information and shall 
-use it only in accordance with the terms of the license agreement 
-you entered into with SAMSUNG ELECTRONICS.  SAMSUNG make no 
-representations or warranties about the suitability 
-of the software, either express or implied, including but not 
-limited to the implied warranties of merchantability, fitness for 
-a particular purpose, or non-infringement. 
-SAMSUNG shall not be liable for any damages suffered by licensee arising out of or 
-related to this software.
-*/
+ *  aul
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact: Jayoun Lee <airjany@samsung.com>, Sewook Park <sewook7.park@samsung.com>, Jaeho Lee <jaeho81.lee@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
 
 #include <glib.h>
 #include "aul_dbus.h"
index 730cbf7..82facae 100755 (executable)
@@ -1,19 +1,23 @@
 /*
-Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved 
-PROPRIETARY/CONFIDENTIAL
-This software is the confidential and proprietary information of 
-SAMSUNG ELECTRONICS ("Confidential Information"). You agree and acknowledge that 
-this software is owned by Samsung and you 
-shall not disclose such Confidential Information and shall 
-use it only in accordance with the terms of the license agreement 
-you entered into with SAMSUNG ELECTRONICS.  SAMSUNG make no 
-representations or warranties about the suitability 
-of the software, either express or implied, including but not 
-limited to the implied warranties of merchantability, fitness for 
-a particular purpose, or non-infringement. 
-SAMSUNG shall not be liable for any damages suffered by licensee arising out of or 
-related to this software.
-*/
+ *  aul
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact: Jayoun Lee <airjany@samsung.com>, Sewook Park <sewook7.park@samsung.com>, Jaeho Lee <jaeho81.lee@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
 
 #include <stdio.h>
 #include <dbus/dbus.h>
index 02bd6df..96c6a0b 100755 (executable)
@@ -1,19 +1,23 @@
 /*
-Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved 
-PROPRIETARY/CONFIDENTIAL
-This software is the confidential and proprietary information of 
-SAMSUNG ELECTRONICS ("Confidential Information"). You agree and acknowledge that 
-this software is owned by Samsung and you 
-shall not disclose such Confidential Information and shall 
-use it only in accordance with the terms of the license agreement 
-you entered into with SAMSUNG ELECTRONICS.  SAMSUNG make no 
-representations or warranties about the suitability 
-of the software, either express or implied, including but not 
-limited to the implied warranties of merchantability, fitness for 
-a particular purpose, or non-infringement. 
-SAMSUNG shall not be liable for any damages suffered by licensee arising out of or 
-related to this software.
-*/
+ *  aul
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact: Jayoun Lee <airjany@samsung.com>, Sewook Park <sewook7.park@samsung.com>, Jaeho Lee <jaeho81.lee@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
 
 #include <poll.h>
 #include <stdio.h>
index c5d7b7a..f6643ae 100755 (executable)
@@ -1,19 +1,23 @@
 /*
-Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved 
-PROPRIETARY/CONFIDENTIAL
-This software is the confidential and proprietary information of 
-SAMSUNG ELECTRONICS ("Confidential Information"). You agree and acknowledge that 
-this software is owned by Samsung and you 
-shall not disclose such Confidential Information and shall 
-use it only in accordance with the terms of the license agreement 
-you entered into with SAMSUNG ELECTRONICS.  SAMSUNG make no 
-representations or warranties about the suitability 
-of the software, either express or implied, including but not 
-limited to the implied warranties of merchantability, fitness for 
-a particular purpose, or non-infringement. 
-SAMSUNG shall not be liable for any damages suffered by licensee arising out of or 
-related to this software.
-*/
+ *  aul
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact: Jayoun Lee <airjany@samsung.com>, Sewook Park <sewook7.park@samsung.com>, Jaeho Lee <jaeho81.lee@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
 
 #include <stdio.h>
 #include <glib.h>
index a8acf06..20c62c7 100755 (executable)
@@ -1,19 +1,23 @@
 /*
-Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved 
-PROPRIETARY/CONFIDENTIAL
-This software is the confidential and proprietary information of 
-SAMSUNG ELECTRONICS ("Confidential Information"). You agree and acknowledge that 
-this software is owned by Samsung and you 
-shall not disclose such Confidential Information and shall 
-use it only in accordance with the terms of the license agreement 
-you entered into with SAMSUNG ELECTRONICS.  SAMSUNG make no 
-representations or warranties about the suitability 
-of the software, either express or implied, including but not 
-limited to the implied warranties of merchantability, fitness for 
-a particular purpose, or non-infringement. 
-SAMSUNG shall not be liable for any damages suffered by licensee arising out of or 
-related to this software.
-*/
+ *  aul
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact: Jayoun Lee <airjany@samsung.com>, Sewook Park <sewook7.park@samsung.com>, Jaeho Lee <jaeho81.lee@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
 
 #include <stdio.h>
 #include <stdlib.h>
@@ -33,13 +37,26 @@ static bundle *create_internal_bundle(int start)
 {
        bundle *kb;
        int i;
+       char arg[1024];
+       char* val_array[128];
 
        kb = bundle_create();
        for (i = start; i < gargc - 1; i++) {
                if ((i + 1) > gargc - 1)
                        bundle_add(kb, gargv[i], " ");
-               else
-                       bundle_add(kb, gargv[i], gargv[i + 1]);
+               else {
+                       int j = 1;
+                       strncpy(arg, gargv[i + 1], 1024);
+                       val_array[0] = strtok(arg,",");
+                       while(val_array[j] = strtok(NULL,","))
+                       {
+                               j++;
+                       }
+                       if(j==1)
+                               bundle_add(kb, gargv[i], gargv[i + 1]);
+                       else if(j>1)
+                               bundle_add_str_array(kb, gargv[i], val_array, j);
+               }
        }
 
        return kb;