* @return 0 if success, error code(<0) if fail\n
*/
int pkgmgr_pkginfo_get_list(pkgmgr_info_pkg_list_cb pkg_list_cb, void *user_data);
-
+int pkgmgr_pkginfo_get_usr_list(pkgmgr_info_pkg_list_cb pkg_list_cb, void *user_data, uid_t uid);
/**
* @brief This API get package info entry from db
*
*/
int pkgmgr_appinfo_get_list(pkgmgr_pkginfo_h handle, pkgmgr_app_component component,
pkgmgr_info_app_list_cb app_func, void *user_data);
-
+int pkgmgr_appinfo_get_usr_list(pkgmgr_pkginfo_h handle, pkgmgr_app_component component,
+ pkgmgr_info_app_list_cb app_func, void *user_data, uid_t uid);
/**
* @brief This API gets list of category for ui-application/service application.
*
}
if(uid != GLOBAL_USER)
ail_filter_list_usr_appinfo_foreach(filter, __appinfo_cb, &caller_appid,uid);
-
else
ail_filter_list_appinfo_foreach(filter, __appinfo_cb, &caller_appid);
tryvm_if(ret < 0, ret = PKGMGR_R_EINVAL, "pkgmgr_pkginfo_get_pkginfo fail");
tryvm_if(handle == NULL, ret = PKGMGR_R_EINVAL, "Pkgid(%s) can not find in installed pkg DB! \n", pkgid);
- /*check running app , terminate app if it is running*/
- ret = pkgmgr_appinfo_get_list(handle, PM_UI_APP, __app_list_cb, NULL);
- tryvm_if(ret < 0, ret = PKGMGR_R_EINVAL, "pkgmgr_appinfo_get_list : PM_UI_APP fail");
+ if (uid != GLOBAL_USER) {
+ /*check running app , terminate app if it is running*/
+ ret = pkgmgr_appinfo_get_usr_list(handle, PM_UI_APP, __app_list_cb, NULL, uid);
+ tryvm_if(ret < 0, ret = PKGMGR_R_EINVAL, "pkgmgr_appinfo_get_list : PM_UI_APP fail");
- /*check running app , terminate app if it is running*/
- ret = pkgmgr_appinfo_get_list(handle, PM_SVC_APP, __app_list_cb, NULL);
- tryvm_if(ret < 0, ret = PKGMGR_R_EINVAL, "pkgmgr_appinfo_get_list : PM_SVC_APP fail");
+ /*check running app , terminate app if it is running*/
+ ret = pkgmgr_appinfo_get_usr_list(handle, PM_SVC_APP, __app_list_cb, NULL, uid);
+ tryvm_if(ret < 0, ret = PKGMGR_R_EINVAL, "pkgmgr_appinfo_get_list : PM_SVC_APP fail");
+ } else {
+ /*check running app , terminate app if it is running*/
+ ret = pkgmgr_appinfo_get_list(handle, PM_UI_APP, __app_list_cb, NULL);
+ tryvm_if(ret < 0, ret = PKGMGR_R_EINVAL, "pkgmgr_appinfo_get_list : PM_UI_APP fail");
- /*check type */
+ /*check running app , terminate app if it is running*/
+ ret = pkgmgr_appinfo_get_list(handle, PM_SVC_APP, __app_list_cb, NULL);
+ tryvm_if(ret < 0, ret = PKGMGR_R_EINVAL, "pkgmgr_appinfo_get_list : PM_SVC_APP fail");
+ }
+ /*check type */
ret = pkgmgr_pkginfo_get_type(handle, &pkgtype);
tryvm_if(ret < 0, ret = PKGMGR_R_EINVAL, "pkgmgr_pkginfo_get_type fail");
tryvm_if(pkgtype == NULL, ret = PKGMGR_R_ERROR, "pkgtype is NULL");
retv_if(pkgid == NULL, PKGMGR_R_EINVAL);
pkgmgr_pkginfo_h handle;
- ret = pkgmgr_pkginfo_get_usr_pkginfo(pkgid, uid, &handle);
+ if (uid != GLOBAL_USER)
+ ret = pkgmgr_pkginfo_get_usr_pkginfo(pkgid, uid, &handle);
+ else
+ ret = pkgmgr_pkginfo_get_pkginfo(pkgid, &handle);
/*check package id */
tryvm_if(ret < 0, ret = PKGMGR_R_EINVAL, "pkgmgr_pkginfo_get_pkginfo fail");
tryvm_if(handle == NULL, ret = PKGMGR_R_EINVAL, "Pkgid(%s) can not find in installed pkg DB! \n", pkgid);
- /*check running app , terminate app if it is running*/
- ret = pkgmgr_appinfo_get_list(handle, PM_UI_APP, __app_list_cb, NULL);
- tryvm_if(ret < 0, ret = PKGMGR_R_EINVAL, "pkgmgr_appinfo_get_list : PM_UI_APP fail");
-
- /*check running app , terminate app if it is running*/
- ret = pkgmgr_appinfo_get_list(handle, PM_SVC_APP, __app_list_cb, NULL);
- tryvm_if(ret < 0, ret = PKGMGR_R_EINVAL, "pkgmgr_appinfo_get_list : PM_SVC_APP fail");
-
+ if (uid != GLOBAL_USER) {
+ /*check running app , terminate app if it is running*/
+ ret = pkgmgr_appinfo_get_usr_list(handle, PM_UI_APP, __app_list_cb, NULL, uid);
+ tryvm_if(ret < 0, ret = PKGMGR_R_EINVAL, "pkgmgr_appinfo_get_list : PM_UI_APP fail");
+
+ /*check running app , terminate app if it is running*/
+ ret = pkgmgr_appinfo_get_usr_list(handle, PM_SVC_APP, __app_list_cb, NULL, uid);
+ tryvm_if(ret < 0, ret = PKGMGR_R_EINVAL, "pkgmgr_appinfo_get_list : PM_SVC_APP fail");
+
+ } else {
+ /*check running app , terminate app if it is running*/
+ ret = pkgmgr_appinfo_get_list(handle, PM_UI_APP, __app_list_cb, NULL);
+ tryvm_if(ret < 0, ret = PKGMGR_R_EINVAL, "pkgmgr_appinfo_get_list : PM_UI_APP fail");
+ /*check running app , terminate app if it is running*/
+ ret = pkgmgr_appinfo_get_list(handle, PM_SVC_APP, __app_list_cb, NULL);
+ tryvm_if(ret < 0, ret = PKGMGR_R_EINVAL, "pkgmgr_appinfo_get_list : PM_SVC_APP fail");
+ }
/*check type */
ret = pkgmgr_pkginfo_get_type(handle, &pkgtype);
tryvm_if(ret < 0, ret = PKGMGR_R_EINVAL, "pkgmgr_pkginfo_get_type fail");
}
if(uid != GLOBAL_USER)
- {
ret = ail_filter_count_usr_appinfo(filter, &cnt, uid);
- }else
- {
+ else
ret = ail_filter_count_appinfo(filter, &cnt);
- }
if (ret != AIL_ERROR_OK) {
ail_filter_destroy(filter);
return PKGMGR_R_ERROR;
udata->data = data;
if(uid != GLOBAL_USER)
- {
ail_filter_list_usr_appinfo_foreach(filter, __appinfo_func, udata, uid);
- }else
- {
+ else
ail_filter_list_appinfo_foreach(filter, __appinfo_func, udata);
- }
free(udata);
ret = ail_filter_destroy(filter);
return ret;
}
+API int pkgmgr_pkginfo_get_usr_list(pkgmgr_info_pkg_list_cb pkg_list_cb, void *user_data, uid_t uid)
+{
+ int ret = 0;
+ ret = pkgmgrinfo_pkginfo_get_usr_list(pkg_list_cb, user_data, uid);
+ return ret;
+}
+
API int pkgmgr_pkginfo_get_pkginfo(const char *pkgid, pkgmgr_pkginfo_h *handle)
{
int ret = 0;
return ret;
}
+API int pkgmgr_appinfo_get_usr_list(pkgmgr_pkginfo_h handle, pkgmgr_app_component component,
+ pkgmgr_info_app_list_cb app_func, void *user_data, uid_t uid)
+{
+ int ret = 0;
+ ret = pkgmgrinfo_appinfo_get_usr_list(handle, component, app_func, user_data, uid);
+ return ret;
+}
+
API int pkgmgr_appinfo_foreach_category(pkgmgr_appinfo_h handle, pkgmgr_info_app_category_list_cb category_func,
void *user_data)
{
#define PKG_TOOL_VERSION "0.1"
#define APP_INSTALLATION_PATH_RW tzplatform_getenv(TZ_USER_APP)
-static int __process_request();
+static int __process_request(uid_t uid);
static void __print_usage();
static int __is_authorized();
static int __is_app_installed(char *pkgid, uid_t uid);
ail_error_e ret;
char *str = NULL;
if (uid != GLOBAL_USER)
- {
ret = ail_package_get_usr_appinfo(pkgid, &handle, uid);
- }else
- {
+ else
ret = ail_package_get_appinfo(pkgid, &handle);
- }
if (ret != AIL_ERROR_OK) {
return -1;
}
return ret;
}
-static int __pkg_list_cb (const pkgmgrinfo_pkginfo_h handle, void *user_data)
+static int __pkg_list_cb (const pkgmgrinfo_pkginfo_h handle, void *user_data, uid_t uid)
{
int ret = -1;
int size = 0;
if(ret < 0) {
printf("pkgmgr_pkginfo_get_pkgid() failed\n");
}
-
- ret = pkgmgr_client_request_service(PM_REQUEST_GET_SIZE, PM_GET_TOTAL_SIZE, (pkgmgr_client *)user_data, NULL, pkgid, NULL, NULL, NULL);
+ if (uid != GLOBAL_USER)
+ ret = pkgmgr_client_usr_request_service(PM_REQUEST_GET_SIZE, PM_GET_TOTAL_SIZE, (pkgmgr_client *)user_data, NULL, pkgid, uid, NULL, NULL, NULL);
+ else
+ ret = pkgmgr_client_request_service(PM_REQUEST_GET_SIZE, PM_GET_TOTAL_SIZE, (pkgmgr_client *)user_data, NULL, pkgid, NULL, NULL, NULL);
if (ret < 0){
printf("pkgmgr_client_request_service Failed\n");
return -1;
}
if(uid != GLOBAL_USER)
{
- ret = pkgmgr_client_clear_user_data(pc, data.pkg_type,
- data.pkgid, mode);
+ ret = pkgmgr_client_usr_clear_user_data(pc, data.pkg_type,
+ data.pkgid, mode, uid);
}else
{
ret = pkgmgr_client_clear_user_data(pc, data.pkg_type,
if ( strcmp(data.pkg_type, "app") == 0 ) {
if (strlen(data.label) == 0) {
if (uid != GLOBAL_USER)
- {
ret = pkgmgr_client_usr_activate_app(pc, data.pkgid, uid);
- }else
- {
+ else
ret = pkgmgr_client_activate_app(pc, data.pkgid);
- }
if (ret < 0)
break;
} else {
largv[0] = "-l";
largv[1] = data.label;
if(uid != GLOBAL_USER)
- {
ret = pkgmgr_client_usr_activate_appv(pc, data.pkgid, largv, uid);
- }else
- {
+ else
ret = pkgmgr_client_activate_appv(pc, data.pkgid, largv);
- }
if (ret < 0)
break;
}
} else {
if (uid != GLOBAL_USER)
- {
ret = pkgmgr_client_usr_activate(pc, data.pkg_type, data.pkgid, uid);
- }else
- {
+ else
ret = pkgmgr_client_activate(pc, data.pkg_type, data.pkgid);
- }
if (ret < 0)
break;
}
if ( strcmp(data.pkg_type, "app") == 0 ) {
if (uid != GLOBAL_USER)
- {
ret = pkgmgr_client_usr_deactivate_app(pc, data.pkgid, uid);
- }else
- {
+ else
ret = pkgmgr_client_deactivate_app(pc, data.pkgid);
- }
if (ret < 0)
break;
}else {
if(uid != GLOBAL_USER)
- {
ret = pkgmgr_client_usr_deactivate(pc, data.pkg_type, data.pkgid, uid);
- }else
- {
+ else
ret = pkgmgr_client_deactivate(pc, data.pkg_type, data.pkgid);
- }
if (ret < 0)
break;
}
if (data.quiet == 0)
{
if(uid != GLOBAL_USER)
- {
ret = pkgmgr_client_usr_move(pc, data.pkg_type, data.pkgid, data.type, mode, uid);
- }else
- {
+ else
ret = pkgmgr_client_move(pc, data.pkg_type, data.pkgid, data.type, mode);
- }
}else
- ret = pkgmgr_client_request_service(PM_REQUEST_MOVE, data.type, pc, NULL, data.pkgid, NULL, NULL, NULL);
-
+ {
+ if (uid != GLOBAL_USER)
+ ret = pkgmgr_client_usr_request_service(PM_REQUEST_MOVE, data.type, pc, NULL, data.pkgid, uid, NULL, NULL, NULL);
+ else
+ ret = pkgmgr_client_request_service(PM_REQUEST_MOVE, data.type, pc, NULL, data.pkgid, NULL, NULL, NULL);
+ }
printf("pkg[%s] move result = %d\n", data.pkgid, ret);
if (ret < 0)
}
if (data.request == KILLAPP_REQ) {
- ret = pkgmgr_client_request_service(PM_REQUEST_KILL_APP, NULL, pc, NULL, data.pkgid, NULL, NULL, &pid);
+ if (uid != GLOBAL_USER)
+ ret = pkgmgr_client_usr_request_service(PM_REQUEST_KILL_APP, NULL, pc, NULL, data.pkgid, uid, NULL, NULL, &pid);
+ else
+ ret = pkgmgr_client_request_service(PM_REQUEST_KILL_APP, NULL, pc, NULL, data.pkgid, NULL, NULL, &pid);
if (ret < 0){
data.result = PKGCMD_ERR_FATAL_ERROR;
break;
printf("Pkgid: %s is already Terminated\n", data.pkgid);
} else if (data.request == CHECKAPP_REQ) {
- ret = pkgmgr_client_request_service(PM_REQUEST_CHECK_APP, NULL, pc, NULL, data.pkgid, NULL, NULL, &pid);
+ if (uid != GLOBAL_USER)
+ ret = pkgmgr_client_usr_request_service(PM_REQUEST_CHECK_APP, NULL, pc, NULL, data.pkgid, uid, NULL, NULL, &pid);
+ else
+ ret = pkgmgr_client_request_service(PM_REQUEST_CHECK_APP, NULL, pc, NULL, data.pkgid, NULL, NULL, &pid);
if (ret < 0){
data.result = PKGCMD_ERR_FATAL_ERROR;
break;
case LIST_REQ:
if (data.pkg_type[0] == '\0') {
- ret = pkgmgr_pkginfo_get_list(__pkgmgr_list_cb, NULL);
+ if (uid != GLOBAL_USER)
+ ret = pkgmgr_pkginfo_get_usr_list(__pkgmgr_list_cb, NULL, uid);
+ else
+ ret = pkgmgr_pkginfo_get_list(__pkgmgr_list_cb, NULL);
if (ret == -1) {
printf("Failed to get package list\n");
break;
break;
case CSC_REQ:
- ret = pkgmgr_client_request_service(PM_REQUEST_CSC, 0, NULL, NULL, NULL, data.des_path, NULL, (void *)data.pkg_path);
+ if (uid != GLOBAL_USER)
+ ret = pkgmgr_client_usr_request_service(PM_REQUEST_CSC, 0, NULL, NULL, NULL, uid, data.des_path, NULL, (void *)data.pkg_path);
+ else
+ ret = pkgmgr_client_request_service(PM_REQUEST_CSC, 0, NULL, NULL, NULL, data.des_path, NULL, (void *)data.pkg_path);
if (ret < 0)
data.result = PKGCMD_ERR_FATAL_ERROR;
break;
}
if (data.type == 9) {
- ret = pkgmgrinfo_pkginfo_get_list(__pkg_list_cb, (void *)pc);
+ if (uid != GLOBAL_USER)
+ ret = pkgmgrinfo_pkginfo_get_usr_list(__pkg_list_cb, (void *)pc, uid);
+ else
+ ret = pkgmgrinfo_pkginfo_get_list(__pkg_list_cb, (void *)pc);
break;
}
-
- ret = pkgmgr_client_request_service(PM_REQUEST_GET_SIZE, data.type, pc, NULL, data.pkgid, NULL, NULL, NULL);
+ if (uid != GLOBAL_USER)
+ ret = pkgmgr_client_usr_request_service(PM_REQUEST_GET_SIZE, data.type, pc, NULL, data.pkgid, uid, NULL, NULL, NULL);
+ else
+ ret = pkgmgr_client_request_service(PM_REQUEST_GET_SIZE, data.type, pc, NULL, data.pkgid, NULL, NULL, NULL);
if (ret < 0){
data.result = PKGCMD_ERR_FATAL_ERROR;
break;
static int __get_app_category_list(char *appid);
static int __get_app_metadata_list(char *appid);
static int __get_app_control_list(char *appid);
-static int __get_pkg_list(void);
+static int __get_pkg_list(uid_t uid);
static int __get_installed_app_list(uid_t uid);
-static int __add_app_filter(void);
-static int __add_pkg_filter(void);
+static int __add_app_filter(uid_t uid);
+static int __add_pkg_filter(uid_t uid);
static int __insert_manifest_in_db(char *manifest, uid_t uid);
static int __remove_manifest_from_db(char *manifest, uid_t uid);
static int __set_pkginfo_in_db(char *pkgid, uid_t uid);
static int __del_certinfo_from_db(char *pkgid);
static int __get_integer_input_data(void);
char *__get_string_input_data(void);
-static int __pkg_list_cb (const pkgmgr_pkginfo_h handle, void *user_data);
+static int __pkg_list_cb (const pkgmgr_pkginfo_h handle, void *user_data, uid_t uid);
static int __app_category_list_cb(const char *category_name, void *user_data);
static int __app_control_list_cb(pkgmgrinfo_appcontrol_h handle, void *user_data);
static int __app_metadata_list_cb(const char *metadata_name, const char *metadata_value, void *user_data);
return ret;
}
-static int __add_app_filter()
+static int __add_app_filter(uid_t uid)
{
int ret = 0;
int choice = -1;
printf("App count = %d\n", count);
break;
case 1:
- ret = pkgmgrinfo_appinfo_filter_foreach_appinfo(handle, app_func, NULL);
+ if (uid != GLOBAL_USER)
+ ret = pkgmgrinfo_appinfo_usr_filter_foreach_appinfo(handle, app_func, NULL, uid);
+ else
+ ret = pkgmgrinfo_appinfo_filter_foreach_appinfo(handle, app_func, NULL);
if (ret < 0) {
printf("pkgmgrinfo_appinfo_filter_foreach_appinfo() failed\n");
ret = -1;
return ret;
}
-static int __add_pkg_filter()
+static int __add_pkg_filter(uid_t uid)
{
int ret = 0;
int choice = -1;
choice = __get_integer_input_data();
switch (choice) {
case 0:
- ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
+ if (uid != GLOBAL_USER)
+ ret = pkgmgrinfo_pkginfo_usr_filter_count(handle, &count, uid);
+ else
+ ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
if (ret < 0) {
printf("pkgmgrinfo_pkginfo_filter_count() failed\n");
ret = -1;
printf("Package count = %d\n", count);
break;
case 1:
- ret = pkgmgrinfo_pkginfo_filter_foreach_pkginfo(handle, __pkg_list_cb, NULL);
+ if (uid != GLOBAL_USER)
+ ret = pkgmgrinfo_pkginfo_usr_filter_foreach_pkginfo(handle, __pkg_list_cb, NULL, uid);
+ else
+ ret = pkgmgrinfo_pkginfo_filter_foreach_pkginfo(handle, __pkg_list_cb, NULL);
if (ret < 0) {
- printf("pkgmgrinfo_pkginfo_filter_foreach_pkginfo() failed\n");
+ printf("pkgmgrinfo_pkginfo_(usr)_filter_foreach_pkginfo() failed\n");
ret = -1;
goto err;
}
return ret;
}
-static int __add_arg_filter(char *key, char *value)
+static int __add_arg_filter(char *key, char *value, uid_t uid)
{
int ret = 0;
int choice = -1;
__print_arg_filter_usage();
goto err;
}
-
- ret = pkgmgrinfo_appinfo_filter_foreach_appinfo(handle, __get_app_id, NULL);
+ if (uid != GLOBAL_USER)
+ ret = pkgmgrinfo_appinfo_usr_filter_foreach_appinfo(handle, __get_app_id, NULL, uid);
+ else
+ ret = pkgmgrinfo_appinfo_filter_foreach_appinfo(handle, __get_app_id, NULL);
if (ret < 0) {
printf("pkgmgrinfo_appinfo_filter_foreach_appinfo() failed\n");
ret = -1;
return -1;
}
-static int __compare_pkg_certinfo_from_db(char *lhs_pkgid, char *rhs_pkgid)
+static int __compare_pkg_certinfo_from_db(char *lhs_pkgid, char *rhs_pkgid, uid_t uid)
{
if (lhs_pkgid == NULL || rhs_pkgid == NULL) {
printf("pkgid is NULL\n");
int ret = 0;
pkgmgrinfo_cert_compare_result_type_e result;
- ret = pkgmgrinfo_pkginfo_compare_pkg_cert_info(lhs_pkgid, rhs_pkgid, &result);
+ if (uid != GLOBAL_USER)
+ ret = pkgmgrinfo_pkginfo_compare_usr_pkg_cert_info(lhs_pkgid, rhs_pkgid, uid, &result);
+ else
+ ret = pkgmgrinfo_pkginfo_compare_pkg_cert_info(lhs_pkgid, rhs_pkgid, &result);
if (ret != PMINFO_R_OK) {
return -1;
}
INSTALL_LOCATION storage = 0;
if(uid != GLOBAL_USER)
- {
ret = pkgmgrinfo_create_pkgusrdbinfo(pkgid, uid, &handle);
- }else
- {
+ else
ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
- }
if (ret < 0) {
printf("pkgmgrinfo_create_pkgdbinfo failed\n");
return -1;
return -1;
}
if (uid != GLOBAL_USER)
- {
ret = pkgmgr_parser_parse_usr_manifest_for_installation(manifest, uid, NULL);
- }else
- {
+ else
ret = pkgmgr_parser_parse_manifest_for_installation(manifest, NULL);
- }
if (ret < 0) {
printf("insert in db failed\n");
return -1;
return -1;
}
if (uid != GLOBAL_USER)
- {
ret = pkgmgr_parser_parse_usr_manifest_for_installation(manifest, uid, NULL);
- }else
- {
+ else
ret = pkgmgr_parser_parse_manifest_for_installation(manifest, NULL);
- }
if (ret < 0) {
printf("insert in db failed\n");
return -1;
return -1;
}
if (uid != GLOBAL_USER)
- {
ret = pkgmgr_parser_parse_usr_manifest_for_uninstallation(manifest, uid, NULL);
- }else
- {
+ else
ret = pkgmgr_parser_parse_manifest_for_uninstallation(manifest, NULL);
- }
if (ret < 0) {
printf("remove from db failed\n");
return -1;
}
-static int __pkg_list_cb (const pkgmgr_pkginfo_h handle, void *user_data)
+static int __pkg_list_cb (const pkgmgr_pkginfo_h handle, void *user_data, uid_t uid)
{
char *test_data = "test data";
int ret = -1;
printf("pkg_type [%s]\tpkgid [%s]\tversion [%s]\tpreload [%d]\tinstalled_time [%d]\n", pkg_type,
pkgid, pkg_version, preload, installed_time);
- printf("**List of Ui-Apps**\n");
- ret = pkgmgr_appinfo_get_list(handle, PM_UI_APP, app_func, (void *)test_data);
- if (ret < 0) {
- printf("pkgmgr_get_info_app() failed\n");
- }
- printf("**List of Svc-Apps**\n");
- ret = pkgmgr_appinfo_get_list(handle, PM_SVC_APP, app_func, (void *)test_data);
- if (ret < 0) {
- printf("pkgmgr_get_info_app() failed\n");
+ if (uid != GLOBAL_USER) {
+ printf("**List of Ui-Apps**\n");
+ ret = pkgmgr_appinfo_get_usr_list(handle, PM_UI_APP, app_func, (void *)test_data, uid);
+ if (ret < 0) {
+ printf("pkgmgr_get_info_app() failed\n");
+ }
+ printf("**List of Svc-Apps**\n");
+ ret = pkgmgr_appinfo_get_usr_list(handle, PM_SVC_APP, app_func, (void *)test_data, uid);
+ if (ret < 0) {
+ printf("pkgmgr_get_info_app() failed\n");
+ }
+ } else {
+ printf("**List of Ui-Apps**\n");
+ ret = pkgmgr_appinfo_get_list(handle, PM_UI_APP, app_func, (void *)test_data);
+ if (ret < 0) {
+ printf("pkgmgr_get_info_app() failed\n");
+ }
+ printf("**List of Svc-Apps**\n");
+ ret = pkgmgr_appinfo_get_list(handle, PM_SVC_APP, app_func, (void *)test_data);
+ if (ret < 0) {
+ printf("pkgmgr_get_info_app() failed\n");
+ }
}
-
printf("---------------------------------------\n");
return 0;
}
-static int __get_pkg_list()
+static int __get_pkg_list(uid_t uid)
{
int ret = -1;
- ret = pkgmgr_pkginfo_get_list(__pkg_list_cb, NULL);
+ if (uid != GLOBAL_USER)
+ ret = pkgmgr_pkginfo_get_usr_list(__pkg_list_cb, NULL, uid);
+ else
+ ret = pkgmgr_pkginfo_get_list(__pkg_list_cb, NULL);
if (ret < 0) {
printf("pkgmgr_pkginfo_get_list() failed\n");
return -1;
{
if (metadata_name && metadata_value) {
printf("Name: %s\n", metadata_name);
- printf("Value: %s\n", metadata_value);
+ printf("Value: %s\n", metadata_value);
printf("\n");
}
return 0;
printf("Failed to get handle\n");
return -1;
}
- printf("List of Ui-Apps\n\n");
- ret = pkgmgr_appinfo_get_list(handle, PM_UI_APP, app_func, (void *)test_data);
- if (ret < 0) {
- printf("pkgmgr_appinfo_get_list() failed\n");
- }
- printf("List of Svc-Apps\n\n");
- ret = pkgmgr_appinfo_get_list(handle, PM_SVC_APP, app_func, (void *)test_data);
- if (ret < 0) {
- printf("pkgmgr_appinfo_get_list() failed\n");
+ if (uid != GLOBAL_USER) {
+ printf("List of Ui-Apps\n\n");
+ ret = pkgmgr_appinfo_get_usr_list(handle, PM_UI_APP, app_func, (void *)test_data, uid);
+ if (ret < 0) {
+ printf("pkgmgr_appinfo_get_list() failed\n");
+ }
+ printf("List of Svc-Apps\n\n");
+ ret = pkgmgr_appinfo_get_usr_list(handle, PM_SVC_APP, app_func, (void *)test_data, uid);
+ if (ret < 0) {
+ printf("pkgmgr_appinfo_get_list() failed\n");
+ }
+ } else {
+ printf("List of Ui-Apps\n\n");
+ ret = pkgmgr_appinfo_get_list(handle, PM_UI_APP, app_func, (void *)test_data);
+ if (ret < 0) {
+ printf("pkgmgr_appinfo_get_list() failed\n");
+ }
+ printf("List of Svc-Apps\n\n");
+ ret = pkgmgr_appinfo_get_list(handle, PM_SVC_APP, app_func, (void *)test_data);
+ if (ret < 0) {
+ printf("pkgmgr_appinfo_get_list() failed\n");
+ }
}
pkgmgr_pkginfo_destroy_pkginfo(handle);
return 0;
locale = NULL;
if (argc == 2) {
if (strcmp(argv[1], "--listpkg") == 0) {
- ret = __get_pkg_list();
+ ret = __get_pkg_list(getuid());
if (ret == -1) {
printf("get pkg list failed\n");
goto end;
goto end;
}
} else if (strcmp(argv[1], "--app-flt") == 0) {
- ret = __add_app_filter();
+ ret = __add_app_filter(getuid());
if (ret == -1) {
printf("Adding app filter failed\n");
goto end;
goto end;
}
} else if (strcmp(argv[1], "--pkg-flt") == 0) {
- ret = __add_pkg_filter();
+ ret = __add_pkg_filter(getuid());
if (ret == -1) {
printf("Adding pkg filter failed\n");
goto end;
}
goto end;
} else if (strcmp(argv[1], "--cmp-pkgcert") == 0) {
- ret = __compare_pkg_certinfo_from_db(argv[2], argv[3]);
+ ret = __compare_pkg_certinfo_from_db(argv[2], argv[3], getuid());
if (ret == -1) {
printf("compare certinfo from db failed\n");
goto end;
}
goto end;
} else if (strcmp(argv[1], "--arg-flt") == 0) {
- ret = __add_arg_filter(argv[2], argv[3]);
+ ret = __add_arg_filter(argv[2], argv[3], getuid());
if (ret == -1) {
printf("compare certinfo from db failed\n");
goto end;