add missing function body, package_manager_request_set_tep 60/64260/3 accepted/tizen/common/20160406.144152 accepted/tizen/ivi/20160406.071938 accepted/tizen/mobile/20160406.071832 accepted/tizen/tv/20160406.071853 accepted/tizen/wearable/20160406.071915 submit/tizen/20160406.013051
authorJunghyun Yeon <jungh.yeon@samsung.com>
Thu, 31 Mar 2016 05:18:59 +0000 (14:18 +0900)
committerJunghyun Yeon <jungh.yeon@samsung.com>
Wed, 6 Apr 2016 02:53:21 +0000 (19:53 -0700)
Change-Id: I46d1b952ea27fae46a1db0c0483891bd29147121
Signed-off-by: Junghyun Yeon <jungh.yeon@samsung.com>
src/package_manager.c

index 25f9258..8063adc 100644 (file)
@@ -55,9 +55,11 @@ struct package_manager_request_s {
        const char *pkg_type;
        const char *pkg_path;
        const char *pkg_name;
+       const char *tep_path;
        pkgmgr_mode mode;
        event_info *head;
        package_manager_request_event_cb event_cb;
+       bool tep_move;
        void *user_data;
 };
 
@@ -215,6 +217,34 @@ API int package_manager_request_set_mode(package_manager_request_h request,
        return PACKAGE_MANAGER_ERROR_NONE;
 }
 
+int package_manager_request_set_tep(package_manager_request_h request,
+                                    const char *tep_path)
+{
+       int retval = 0;
+
+       if (package_manager_client_validate_handle(request) || tep_path == NULL) {
+               return
+                       package_manager_error
+                       (PACKAGE_MANAGER_ERROR_INVALID_PARAMETER, __FUNCTION__,
+                        NULL);
+       }
+
+       retval = check_privilege(PRIVILEGE_PACKAGE_MANAGER_ADMIN);
+       if (retval != PACKAGE_MANAGER_ERROR_NONE)
+               return retval;
+
+       if (request->tep_path)
+               free((void *)request->tep_path);
+
+       request->tep_path = strdup(tep_path);
+       request->tep_move = true;
+
+       if (request ->tep_path == NULL)
+               return PACKAGE_MANAGER_ERROR_SYSTEM_ERROR;
+
+       return PACKAGE_MANAGER_ERROR_NONE;
+}
+
 static int package_manager_get_event_type(const char *key,
                                          package_manager_event_type_e *
                                          event_type)