Migrate private appsvc apis to public api 22/195322/3
authorShubhojeet <shubhojeet.y@samsung.com>
Wed, 12 Dec 2018 20:04:18 +0000 (01:34 +0530)
committerShubhojeet <shubhojeet.y@samsung.com>
Wed, 12 Dec 2018 20:35:57 +0000 (02:05 +0530)
Change-Id: Id4dfc5ae90b8d9cd75bbac35e17b1a72fa6e9840

CMakeLists.txt
packaging/org.tizen.w-home.spec
src/clock.c
src/util.c

index 2c5465a834aaa2501ffa0b73a3c219548659191b..399737b565b64e911de301c52f0926ecbbc90570 100755 (executable)
@@ -13,7 +13,6 @@ MESSAGE("ARCH: ${ARCH}")
 INCLUDE(FindPkgConfig)
 pkg_check_modules(PKGS REQUIRED
        appcore-efl
-       aul
        badge
        bundle
        capi-appfw-application
@@ -46,7 +45,6 @@ pkg_check_modules(PKGS REQUIRED
        syspopup-caller
        rua
        vconf
-       appsvc
        capi-system-system-settings
        capi-media-image-util
        notification
index 9b040d9dbf82df55c11fb05f0f2fbd38bcf1c9c8..553218d364399fbc05a7363c194f2c594baae5fc 100755 (executable)
@@ -28,14 +28,12 @@ BuildRequires: pkgconfig(watch-control)
 BuildRequires: pkgconfig(pkgmgr)
 BuildRequires: pkgconfig(pkgmgr-info)
 BuildRequires: pkgconfig(syspopup-caller)
-BuildRequires: pkgconfig(appsvc)
 BuildRequires: pkgconfig(capi-base-utils-i18n)
 BuildRequires: pkgconfig(capi-system-system-settings)
 BuildRequires: pkgconfig(capi-message-port)
 BuildRequires: pkgconfig(capi-media-image-util)
 BuildRequires: pkgconfig(notification)
 BuildRequires: pkgconfig(rua)
-BuildRequires: pkgconfig(aul)
 BuildRequires: pkgconfig(capi-appfw-package-manager)
 BuildRequires: pkgconfig(capi-appfw-app-manager)
 BuildRequires: pkgconfig(capi-ui-efl-util)
index a2cf80f34fdc207051899051181b452276bd13a3..04ba4d926f96fd84ea5eec935518f2e62aab9775 100755 (executable)
 #include <vconf.h>
 #include <pkgmgr-info.h>
 #include <pkgmgrinfo_type.h>
-#include <appsvc.h>
 #include <app_control_internal.h>
 #include <time.h>
+#include <app_control.h>
+#include <app_manager.h>
 
 #include "conf.h"
 #include "clock_service.h"
@@ -379,19 +380,35 @@ static void _clock_view_exchange(Evas_Object *item)
 static int _try_to_launch(const char *clock_pkgname)
 {
        app_control_h watch_control = NULL;
-
-       int clock_app_pid = 0;
-       bundle *b;
-
+       app_context_h app_context = NULL;
+       pid_t clock_app_pid = 0;
+       int ret = 0;
        if (!clock_pkgname)
                clock_pkgname = "org.tizen.classic-watch";
 
        clock_info_s.launched = 0;
 
        watch_manager_get_app_control(clock_pkgname, &watch_control);
-       app_control_to_bundle(watch_control, &b);
-       clock_app_pid = appsvc_run_service(b, 0, NULL, NULL); /* Get pid of launched watch-app */
-       _D("appsvc_run_service returns [%d]", clock_app_pid);
+       ret = app_control_send_launch_request(watch_control, NULL, NULL);
+       if(ret != APP_CONTROL_ERROR_NONE) {
+               _E("app_control_send_launch_request failed!");
+               app_control_destroy(watch_control);
+               return ret;
+       }
+       ret = app_manager_get_app_context(clock_pkgname, &app_context);
+       if (ret != APP_MANAGER_ERROR_NONE) {
+               _E("fail to app_manager_get_app_context(%d)", ret);
+               app_control_destroy(watch_control);
+               return ret;
+       }
+       ret = app_context_get_pid(app_context, &clock_app_pid);
+       if (ret != APP_MANAGER_ERROR_NONE) {
+               _D("Invalid PID", clock_app_pid);
+               app_control_destroy(watch_control);
+               return ret;
+       }
+
+       _D("app_context_get_pid returns [%d]", clock_app_pid);
        clock_info_s.pid = clock_app_pid;
        app_control_destroy(watch_control);
 
index 2f6682caa10368ce363d1d05c5f3a0a6ed1de9e0..cafcc64ac88355334dbfe31f09ef6783d2d8c39f 100755 (executable)
@@ -16,7 +16,6 @@
  */
 
 #include <app.h>
-#include <appsvc.h>
 #include <bundle.h>
 #include <Elementary.h>
 #include <Evas.h>
@@ -283,13 +282,6 @@ void _evas_object_event_hide_cb(void *data, Evas *e, Evas_Object *obj, void *eve
 
 
 
-static Eina_Bool _unblock_cb(void *data)
-{
-       retv_if(NULL == data, EINA_FALSE);
-
-       return EINA_FALSE;
-}
-
 
 
 HAPI void apps_util_post_message_for_launch_fail(const char *name)
@@ -311,73 +303,6 @@ HAPI void apps_util_post_message_for_launch_fail(const char *name)
 
 
 
-static void _svc_cb(bundle *b, int request_code, appsvc_result_val result, void *data)
-{
-       _D("Request code : %d", request_code);
-
-       if (result != APPSVC_RES_OK) {
-               char* inform;
-               char* inform_with_ret;
-               int len;
-
-               const char *name = data;
-               ret_if(NULL == name);
-
-               // IDS_AT_TPOP_UNABLE_TO_OPEN_PS : "Unable to open %s"
-               len = strlen(_("IDS_AT_TPOP_UNABLE_TO_OPEN_PS")) + strlen(name) + SPARE_LEN;
-
-               inform = calloc(len, sizeof(char));
-               if (!inform) {
-                       _E("cannot calloc for information");
-                       return;
-               }
-               snprintf(inform, len, _("IDS_AT_TPOP_UNABLE_TO_OPEN_PS"), name);
-
-               inform_with_ret = calloc(len, sizeof(char));
-               if (!inform_with_ret) {
-                       _E("cannot calloc for information");
-                       free(inform);
-                       return;
-               }
-               snprintf(inform_with_ret, len, "%s(%d)", inform, result);
-               notification_status_message_post(inform_with_ret);
-
-               free(inform);
-               free(inform_with_ret);
-       }
-}
-
-
-
-#define LAUNCH_WITH_SPECIAL_ROUTINE false
-#define PACKAGE_ORANGE_WORLD "widgetMor.orangeMobile"
-static bool _launch_special_package(const char *package, const char *name)
-{
-       retv_if(NULL == package, false);
-       retv_if(NULL == name, false);
-
-       if (!strcmp(package, PACKAGE_ORANGE_WORLD)) {
-               _D("Special launch for %s", PACKAGE_ORANGE_WORLD);
-               bundle *b = bundle_create();
-               retv_if(NULL == b, false);
-
-               appsvc_set_operation(b, APPSVC_OPERATION_VIEW);
-               appsvc_set_uri(b, "http://m.orange.fr");
-               appsvc_run_service(b, 0, _svc_cb, (void *) name);
-
-               bundle_free(b);
-
-               return true;
-       }
-
-       return false;
-}
-
-
-
-#define LAYOUT_BLOCK_INTERVAL          1.0
-
-
 
 HAPI void apps_util_notify_to_home(int pid)
 {