Packaging : Merge UI App with Service app to launch the service normally 15/51415/1
authorJin Yoon <jinny.yoon@samsung.com>
Mon, 9 Nov 2015 10:48:01 +0000 (19:48 +0900)
committerJin Yoon <jinny.yoon@samsung.com>
Mon, 9 Nov 2015 10:48:01 +0000 (19:48 +0900)
Change-Id: I6b4b96582db175538241e5350f4a59adb5da25b3

TelegramTizen/.cproject
TelegramTizen/.gitignore [new file with mode: 0644]
TelegramTizen/.project
TelegramTizen/.tproject
TelegramTizen/inc/logger.h
TelegramTizen/res/res.xml [deleted file]
TelegramTizen/src/telegramtizen.c
TelegramTizen/tizen-manifest.xml
tg-engine-service/.gitignore [new file with mode: 0644]
tg-engine-service/shared/res/ic_launcher.png
tg-engine-service/tizen-manifest.xml

index 4cdbb91..9c4efe7 100644 (file)
@@ -37,6 +37,7 @@
                                                                        <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include&quot;"/>
                                                                        <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/appcore-agent&quot;"/>
                                                                        <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/appfw&quot;"/>
+                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/attach-panel&quot;"/>
                                                                        <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/badge&quot;"/>
                                                                        <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/base&quot;"/>
                                                                        <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/cairo&quot;"/>
                                                                        <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/device&quot;"/>
                                                                        <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/dlog&quot;"/>
                                                                        <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/ecore-1&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/ecore-audio-1&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/ecore-avahi-1&quot;"/>
                                                                        <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/ecore-con-1&quot;"/>
                                                                        <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/ecore-evas-1&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/ecore-fb-1&quot;"/>
                                                                        <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/ecore-file-1&quot;"/>
                                                                        <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/ecore-imf-1&quot;"/>
                                                                        <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/ecore-imf-evas-1&quot;"/>
@@ -87,6 +85,7 @@
                                                                        <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/geofence&quot;"/>
                                                                        <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/gio-unix-2.0&quot;"/>
                                                                        <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/glib-2.0&quot;"/>
+                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/harfbuzz&quot;"/>
                                                                        <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/json-glib-1.0&quot;"/>
                                                                        <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/location&quot;"/>
                                                                        <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/maps&quot;"/>
                                                                        <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include&quot;"/>
                                                                        <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/appcore-agent&quot;"/>
                                                                        <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/appfw&quot;"/>
+                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/attach-panel&quot;"/>
                                                                        <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/badge&quot;"/>
                                                                        <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/base&quot;"/>
                                                                        <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/cairo&quot;"/>
                                                                        <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/device&quot;"/>
                                                                        <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/dlog&quot;"/>
                                                                        <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/ecore-1&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/ecore-audio-1&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/ecore-avahi-1&quot;"/>
                                                                        <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/ecore-con-1&quot;"/>
                                                                        <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/ecore-evas-1&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/ecore-fb-1&quot;"/>
                                                                        <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/ecore-file-1&quot;"/>
                                                                        <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/ecore-imf-1&quot;"/>
                                                                        <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/ecore-imf-evas-1&quot;"/>
                                                                        <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/geofence&quot;"/>
                                                                        <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/gio-unix-2.0&quot;"/>
                                                                        <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/glib-2.0&quot;"/>
+                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/harfbuzz&quot;"/>
                                                                        <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/json-glib-1.0&quot;"/>
                                                                        <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/location&quot;"/>
                                                                        <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/maps&quot;"/>
                                                                        <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include&quot;"/>
                                                                        <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/appcore-agent&quot;"/>
                                                                        <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/appfw&quot;"/>
+                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/attach-panel&quot;"/>
                                                                        <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/badge&quot;"/>
                                                                        <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/base&quot;"/>
                                                                        <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/cairo&quot;"/>
                                                                        <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/device&quot;"/>
                                                                        <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/dlog&quot;"/>
                                                                        <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/ecore-1&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/ecore-audio-1&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/ecore-avahi-1&quot;"/>
                                                                        <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/ecore-con-1&quot;"/>
                                                                        <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/ecore-evas-1&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/ecore-fb-1&quot;"/>
                                                                        <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/ecore-file-1&quot;"/>
                                                                        <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/ecore-imf-1&quot;"/>
                                                                        <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/ecore-imf-evas-1&quot;"/>
                                                                        <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/geofence&quot;"/>
                                                                        <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/gio-unix-2.0&quot;"/>
                                                                        <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/glib-2.0&quot;"/>
+                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/harfbuzz&quot;"/>
                                                                        <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/json-glib-1.0&quot;"/>
                                                                        <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/location&quot;"/>
                                                                        <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/maps&quot;"/>
                                                                        <listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/db_manager}&quot;"/>
                                                                        <listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/inc}&quot;"/>
                                                                        <listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/tg_utils}&quot;"/>
-                                                                        <listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/contacts_utils}&quot;"/>
+                                                                       <listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/contacts_utils}&quot;"/>
                                                                </option>
                                                                <option id="sbi.gnu.cpp.compiler.option.frameworks.core.493027510" name="Tizen-Frameworks" superClass="sbi.gnu.cpp.compiler.option.frameworks.core" valueType="userObjs">
                                                                        <listOptionValue builtIn="false" value="Native_API"/>
                                                                        <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include&quot;"/>
                                                                        <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/appcore-agent&quot;"/>
                                                                        <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/appfw&quot;"/>
+                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/attach-panel&quot;"/>
                                                                        <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/badge&quot;"/>
                                                                        <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/base&quot;"/>
                                                                        <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/cairo&quot;"/>
                                                                        <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/device&quot;"/>
                                                                        <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/dlog&quot;"/>
                                                                        <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/ecore-1&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/ecore-audio-1&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/ecore-avahi-1&quot;"/>
                                                                        <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/ecore-con-1&quot;"/>
                                                                        <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/ecore-evas-1&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/ecore-fb-1&quot;"/>
                                                                        <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/ecore-file-1&quot;"/>
                                                                        <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/ecore-imf-1&quot;"/>
                                                                        <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/ecore-imf-evas-1&quot;"/>
                                                                        <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/geofence&quot;"/>
                                                                        <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/gio-unix-2.0&quot;"/>
                                                                        <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/glib-2.0&quot;"/>
+                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/harfbuzz&quot;"/>
                                                                        <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/json-glib-1.0&quot;"/>
                                                                        <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/location&quot;"/>
                                                                        <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/maps&quot;"/>
diff --git a/TelegramTizen/.gitignore b/TelegramTizen/.gitignore
new file mode 100644 (file)
index 0000000..65fa71e
--- /dev/null
@@ -0,0 +1,2 @@
+/Debug
+/SA_Report
index 7ad7f6d..0277952 100644 (file)
@@ -3,6 +3,7 @@
        <name>TelegramTizen</name>
        <comment></comment>
        <projects>
+               <project>tg-engine-service</project>
        </projects>
        <buildSpec>
                <buildCommand>
index 801d1ed..fb29c18 100644 (file)
@@ -7,5 +7,9 @@
     </platforms>
     <package>
         <blacklist/>
+        <resFallback autoGen="true"/>
+        <subProjects>
+            <tizenProject project="tg-engine-service"/>
+        </subProjects>
     </package>
 </tproject>
index d63c3d3..d9b4464 100644 (file)
     } \
 }
 
+#define retv_if(expr, val) do { \
+       if (expr) { \
+               ERR("(%s) -> %s() return", #expr, __FUNCTION__); \
+               return (val); \
+       } \
+} while (0)
+
+#define ret_if(expr) do { \
+       if (expr) { \
+               ERR("(%s) -> %s() return", #expr, __FUNCTION__); \
+               return; \
+       } \
+} while (0)
+
+#define goto_if(expr, val) do { \
+       if (expr) { \
+               ERR("(%s) -> goto", #expr); \
+               goto val; \
+       } \
+} while (0)
+
+#define break_if(expr) { \
+       if (expr) { \
+               ERR("(%s) -> break", #expr); \
+               break; \
+       } \
+}
+
+#define continue_if(expr) { \
+       if (expr) { \
+               ERR("(%s) -> continue", #expr); \
+               continue; \
+       } \
+}
+
+
+
 #endif /* __LOGGER_H__ */
diff --git a/TelegramTizen/res/res.xml b/TelegramTizen/res/res.xml
deleted file mode 100644 (file)
index e537eb7..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
-<res xmlns="http://tizen.org/ns/rm"/>
index 63368de..376f94a 100644 (file)
@@ -3275,7 +3275,6 @@ Eina_Bool on_load_main_view_requested(void *data)
     return ECORE_CALLBACK_CANCEL;
 }
 
-
 Eina_Bool on_init_view_requested(void *data)
 {
        appdata_s *ad = data;
@@ -3314,14 +3313,20 @@ void on_tg_service_result_cb(app_control_h request, app_control_h reply, app_con
 static void launch_tg_server(void *data)
 {
        appdata_s *ad = data;
-       app_control_h app_control;
-       int ret = app_control_create(&app_control);
-/*     ret = app_control_set_operation(app_control, "http://tizen.org/appcontrol/operation/launch_on_event");
-       ret = app_control_set_mime(app_control, "application/telegram");
-       ret = app_control_set_uri(app_control, "http://tizen.org/appcontrol/operation/telegram_start");*/
-       ret = app_control_set_app_id(app_control, "org.tizen.tg-engine-service");
+       app_control_h app_control = NULL;
+       int ret = APP_CONTROL_ERROR_NONE;
+
+       ret = app_control_create(&app_control);
+       ret_if(APP_CONTROL_ERROR_NONE != ret);
+
+       ret = app_control_set_app_id(app_control, TELEGRAM_SERVER_APP_NAME);
+       goto_if(APP_CONTROL_ERROR_NONE != ret, out);
+
        ret = app_control_send_launch_request(app_control, &on_tg_service_result_cb, ad);
-       ret = app_control_destroy(app_control);
+       goto_if(APP_CONTROL_ERROR_NONE != ret, out);
+
+out:
+       app_control_destroy(app_control);
 }
 
 static void create_base_gui(appdata_s *ad)
@@ -3389,7 +3394,7 @@ static void create_base_gui(appdata_s *ad)
                ad->chat_background = strdup(ui_utils_get_resource(TG_CHAT_DEFAULT_BG));
                preference_set_string(TG_CHAT_BG_PREFERENCE, ad->chat_background);
        }
-       launch_tg_server(ad);
+
        ecore_timer_add(5, on_init_view_requested, ad);
        ucol_init();
 }
@@ -3433,7 +3438,7 @@ static bool app_create(void *data)
 
        }
        init_service(ad);
-
+       launch_tg_server(ad);
        return true;
 }
 
index 1adebaa..bdb8871 100644 (file)
@@ -11,8 +11,8 @@
         <privilege>http://tizen.org/privilege/network.get</privilege>
         <privilege>http://tizen.org/privilege/callhistory.read</privilege>
         <privilege>http://tizen.org/privilege/contact.write</privilege>
-        <privilege>http://tizen.org/privilege/message.write</privilege>
         <privilege>http://tizen.org/privilege/content.write</privilege>
+        <privilege>http://tizen.org/privilege/message.write</privilege>
         <privilege>http://tizen.org/privilege/push</privilege>
         <privilege>http://tizen.org/privilege/account.read</privilege>
         <privilege>http://tizen.org/privilege/externalstorage</privilege>
         <privilege>http://tizen.org/privilege/mediastorage</privilege>
         <privilege>http://tizen.org/privilege/internet</privilege>
         <privilege>http://tizen.org/privilege/callhistory.write</privilege>
-        <privilege>http://tizen.org/privilege/call</privilege>
         <privilege>http://tizen.org/privilege/email</privilege>
+        <privilege>http://tizen.org/privilege/call</privilege>
         <privilege>http://tizen.org/privilege/contact.read</privilege>
         <privilege>http://tizen.org/privilege/keymanager</privilege>
         <privilege>http://tizen.org/privilege/camera</privilege>
         <privilege>http://tizen.org/privilege/appmanager.launch</privilege>
-        <privilege>http://tizen.org/privilege/display</privilege>
         <privilege>http://tizen.org/privilege/network.profile</privilege>
+        <privilege>http://tizen.org/privilege/display</privilege>
         <privilege>http://tizen.org/privilege/account.write</privilege>
         <privilege>http://tizen.org/privilege/bluetooth</privilege>
-        <privilege>http://tizen.org/privilege/network.set</privilege>
         <privilege>http://tizen.org/privilege/notification</privilege>
+        <privilege>http://tizen.org/privilege/network.set</privilege>
         <privilege>http://tizen.org/privilege/externalstorage.appdata</privilege>
         <privilege>http://tizen.org/privilege/mapservice</privilege>
         <privilege>http://tizen.org/privilege/message.read</privilege>
diff --git a/tg-engine-service/.gitignore b/tg-engine-service/.gitignore
new file mode 100644 (file)
index 0000000..65fa71e
--- /dev/null
@@ -0,0 +1,2 @@
+/Debug
+/SA_Report
index 34d61ce..1e35414 100644 (file)
Binary files a/tg-engine-service/shared/res/ic_launcher.png and b/tg-engine-service/shared/res/ic_launcher.png differ
index a2917fe..5696611 100644 (file)
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8" standalone="no"?>
 <manifest xmlns="http://tizen.org/ns/packages" api-version="2.4" package="org.tizen.tg-engine-service" version="1.0.0">
     <profile name="mobile"/>
-    <service-application appid="org.tizen.tg-engine-service" exec="tg-engine-service" multiple="false" nodisplay="true" type="capp" taskmanage="false">
+    <service-application appid="org.tizen.tg-engine-service" exec="tg-engine-service" multiple="false" nodisplay="true" taskmanage="false" type="capp">
         <label>tg-engine-service</label>
         <icon>ic_launcher.png</icon>
         <background-category value="background-network"/>
@@ -29,8 +29,8 @@
         <privilege>http://tizen.org/privilege/bluetooth</privilege>
         <privilege>http://tizen.org/privilege/mediastorage</privilege>
         <privilege>http://tizen.org/privilege/internet</privilege>
-        <privilege>http://tizen.org/privilege/notification</privilege>
         <privilege>http://tizen.org/privilege/network.set</privilege>
+        <privilege>http://tizen.org/privilege/notification</privilege>
         <privilege>http://tizen.org/privilege/externalstorage.appdata</privilege>
         <privilege>http://tizen.org/privilege/apphistory.read</privilege>
         <privilege>http://tizen.org/privilege/contact.read</privilege>