Send launch request using app control 57/183157/1 accepted/tizen/4.0/unified/20180703.094828 submit/tizen_4.0/20180703.045006
authorhyunuktak <hyunuk.tak@samsung.com>
Tue, 3 Jul 2018 04:33:06 +0000 (13:33 +0900)
committerhyunuktak <hyunuk.tak@samsung.com>
Tue, 3 Jul 2018 04:33:11 +0000 (13:33 +0900)
Change-Id: Ic98426734687dddf4bf07d41bc9a10733833c96d
Signed-off-by: hyunuktak <hyunuk.tak@samsung.com>
packaging/stc-manager.spec
plugin/net.stc-popup/net.stc-popup.xml.in
plugin/net.stc-popup/src/stc-popup-ui.c

index 651f0cc..4facd80 100755 (executable)
@@ -1,6 +1,6 @@
 Name:       stc-manager
 Summary:    STC(Smart Traffic Control) manager
-Version:    0.0.51
+Version:    0.0.52
 Release:    0
 Group:      Network & Connectivity/Other
 License:    Apache-2.0
index ba4de28..1a2ede7 100644 (file)
@@ -9,5 +9,6 @@
        </ui-application>
        <privileges>
                <privilege>http://tizen.org/privilege/network.get</privilege>
+               <privilege>http://tizen.org/privilege/appmanager.launch</privilege>
        </privileges>
 </manifest>
index 694fe4b..39803a7 100755 (executable)
@@ -9,6 +9,8 @@
 #include "stc-popup-ui.h"
 #include "stc-popup-util.h"
 
+#define DATA_USAGE_APPID       "org.tizen.setting"
+
 static void win_delete_request_cb(void *data, Evas_Object *obj,
                                  void *event_info)
 {
@@ -34,10 +36,41 @@ static void _response_button1_cb(void *data, Evas_Object *obj, void *event_info)
        elm_exit();
 }
 
+static void _launch_app_control(const char *app_id)
+{
+       int ret = 0;
+       app_control_h app_control = NULL;
+
+       if (app_id == NULL)
+               return;
+
+       ret = app_control_create(&app_control);
+       if (ret != APP_CONTROL_ERROR_NONE)
+               goto error;
+
+       ret = app_control_set_app_id(app_control, app_id);
+       if (ret != APP_CONTROL_ERROR_NONE)
+               goto error;
+
+       ret = app_control_send_launch_request(app_control, NULL, NULL);
+       if (ret == APP_CONTROL_ERROR_NONE)
+               STC_LOGD("Successfully send launch request");
+       else
+               STC_LOGE("Failed to send launch request");
+
+error:
+       if (app_control)
+               app_control_destroy(app_control);
+
+       return;
+}
+
 static void _response_button2_cb(void *data, Evas_Object *obj, void *event_info)
 {
        Evas_Object *popup = (Evas_Object *)data;
 
+       _launch_app_control(DATA_USAGE_APPID);
+
        if (popup)
                evas_object_del(popup);
        if (obj)