# package manager client library
-SET(SRCS src/pkgmgr-internal.c src/pkgmgr.c src/pkgmgr-dbinfo.c)
+SET(SRCS src/pkgmgr-internal.c src/pkgmgr.c)
pkg_check_modules(CLIENT_DEPS REQUIRED
dbus-glib-1
INSTALL(TARGETS ${PKGMGR_CLIENT} DESTINATION ${LIB_INSTALL_DIR} COMPONENT RuntimeLibraries)
INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/include/package-manager.h DESTINATION include)
-INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/include/pkgmgr-dbinfo.h DESTINATION include)
INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/pkgmgr.pc DESTINATION ${LIB_INSTALL_DIR}/pkgconfig)
INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/pkg_path.conf DESTINATION ${SYSCONFDIR}/package-manager/)
* @{
*/
-typedef void* pkgmgr_pkginfo_h;
-typedef void* pkgmgr_appinfo_h;
-typedef void* pkgmgr_certinfo_h;
-
typedef void pkgmgr_client;
typedef void pkgmgr_info;
const char *pkgid, const char *key,
const char *val, const void *pmsg, void *data);
-typedef int (*pkgmgr_info_pkg_list_cb ) (const pkgmgr_pkginfo_h handle,
- void *user_data);
-
-typedef int (*pkgmgr_info_app_list_cb ) (const pkgmgr_appinfo_h handle,
- void *user_data);
-
-typedef int (*pkgmgr_info_app_category_list_cb ) (const char *category_name,
- void *user_data);
-
typedef void (*pkgmgr_pkg_size_info_receive_cb)(pkgmgr_client *pc, const char *pkgid,
const pkg_size_info_t *size_info, void *user_data);
typedef void (*pkgmgr_total_pkg_size_info_receive_cb)(pkgmgr_client *pc,
const pkg_size_info_t *size_info, void *user_data);
-typedef void pkgmgr_client;
-
-typedef void pkgmgr_info;
-
typedef enum {
PC_REQUEST = 0,
PC_LISTENING,
}pkgmgr_mode;
typedef enum {
- PM_INSTALL_LOCATION_AUTO = 0,
- PM_INSTALL_LOCATION_INTERNAL_ONLY,
- PM_INSTALL_LOCATION_PREFER_EXTERNAL,
-}pkgmgr_install_location;
-
-typedef enum {
- PM_HWACCELERATION_NOT_USE_GL = 0,
- PM_HWACCELERATION_USE_GL = 1,
- PM_HWACCELERATION_USE_SYSTEM_SETTING = 2,
-}pkgmgr_hwacceleration_type;
-
-typedef enum {
- PM_ALL_APP = 0,
- PM_UI_APP,
- PM_SVC_APP
-}pkgmgr_app_component;
-
-typedef enum {
PM_MOVE_TO_INTERNAL = 0,
PM_MOVE_TO_SDCARD = 1,
}pkgmgr_move_type;
typedef enum {
- PM_INTERNAL_STORAGE = 0,
- PM_EXTERNAL_STORAGE = 1,
-}pkgmgr_installed_storage;
-
-typedef enum {
- PM_AUTHOR_ROOT_CERT = 0,
- PM_AUTHOR_INTERMEDIATE_CERT = 1,
- PM_AUTHOR_SIGNER_CERT = 2,
- PM_DISTRIBUTOR_ROOT_CERT = 3,
- PM_DISTRIBUTOR_INTERMEDIATE_CERT = 4,
- PM_DISTRIBUTOR_SIGNER_CERT = 5,
- PM_DISTRIBUTOR2_ROOT_CERT = 6,
- PM_DISTRIBUTOR2_INTERMEDIATE_CERT = 7,
- PM_DISTRIBUTOR2_SIGNER_CERT = 8,
-}pkgmgr_cert_type;
-
-typedef enum {
PM_REQUEST_CSC = 0,
PM_REQUEST_MOVE = 1,
PM_REQUEST_GET_SIZE = 2,
*/
int pkgmgr_info_free(pkgmgr_info * pkg_info);
-/**
- * @brief This API gets list of installed applications.
- *
- * This API is for package-manager client application.\n
- *
- * @param[in] pkg_list_cb iteration function for list
- * @param[in] user_data user data to be passed to callback function
- * @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
- *
- * This API is for package-manager client application.\n
- *
- * @param[in] pkgid pointer to package id
- * @param[out] handle pointer to the package info handle.
- * @return 0 if success, error code(<0) if fail\n
-*/
-int pkgmgr_pkginfo_get_pkginfo(const char *pkgid, pkgmgr_pkginfo_h *handle);
-int pkgmgr_pkginfo_get_usr_pkginfo(const char *pkgid, uid_t uid,pkgmgr_pkginfo_h *handle);
-
-/**
- * @brief This API gets type of the given package.
- *
- * This API is for package-manager client application.\n
- *
- * @param[in] handle pointer to package info handle
- * @param[out] type to hold package type.
- * @return 0 if success, error code(<0) if fail\n
-*/
-int pkgmgr_pkginfo_get_pkgname(pkgmgr_pkginfo_h handle, char **pkg_name);
-
-/**
- * @brief This API gets id of the given package.
- *
- * This API is for package-manager client application.\n
- *
- * @param[in] handle pointer to package info handle
- * @param[out]pkgid to hold package id.
- * @return 0 if success, error code(<0) if fail\n
-*/
-int pkgmgr_pkginfo_get_pkgid(pkgmgr_pkginfo_h handle, char **pkgid);
-
-/**
- * @brief This API gets type of the given package.
- *
- * This API is for package-manager client application.\n
- *
- * @param[in] handle pointer to package info handle
- * @param[out] type to hold package type.
- * @return 0 if success, error code(<0) if fail\n
-*/
-int pkgmgr_pkginfo_get_type(pkgmgr_pkginfo_h handle, char **type);
-
-/**
- * @brief This API gets version of the given package.
- *
- * This API is for package-manager client application.\n
- *
- * @param[in] handle pointer to package info handle
- * @param[out] version to hold package version.
- * @return 0 if success, error code(<0) if fail\n
-*/
-int pkgmgr_pkginfo_get_version(pkgmgr_pkginfo_h handle, char **version);
-
-/**
- * @brief This API gets install location of the given package.
- *
- * This API is for package-manager client application.\n
- *
- * @param[in] handle pointer to package info handle
- * @param[out] location to hold install location.
- * @return 0 if success, error code(<0) if fail\n
-*/
-int pkgmgr_pkginfo_get_install_location(pkgmgr_pkginfo_h handle, pkgmgr_install_location *location);
-
-/**
- * @brief This API gets package size of the given package in case of external installation.
- * size will be 0 if package install location is internal-only.
- * size will be 0 if package install location is prefer-external but size is not specified in manifest file.
- * Application should check the return value and use it distinguish the above cases.
- *
- * This API is for package-manager client application.\n
- *
- * @param[in] handle pointer to package info handle
- * @param[out] size to hold package size.
- * @return 0 if success, error code(<0) if fail\n
- * @return
-*/
-int pkgmgr_pkginfo_get_package_size(pkgmgr_pkginfo_h handle, int *size);
-
-/**
- * @brief This API gets icon of the given package.
- *
- * This API is for package-manager client application.\n
- *
- * @param[in] handle pointer to package info handle
- * @param[out] icon to hold package icon.
- * @return 0 if success, error code(<0) if fail\n
-*/
-int pkgmgr_pkginfo_get_icon(pkgmgr_pkginfo_h handle, char **icon);
-
-/**
- * @brief This API gets label of the given package.
- *
- * This API is for package-manager client application.\n
- *
- * @param[in] handle pointer to package info handle
- * @param[out] label to hold package label.
- * @return 0 if success, error code(<0) if fail\n
-*/
-int pkgmgr_pkginfo_get_label(pkgmgr_pkginfo_h handle, char **label);
-
-/**
- * @brief This API gets desription of the given package.
- *
- * This API is for package-manager client application.\n
- *
- * @param[in] handle pointer to package info handle
- * @param[out] description to hold package description.
- * @return 0 if success, error code(<0) if fail\n
-*/
-int pkgmgr_pkginfo_get_description(pkgmgr_pkginfo_h handle, char **description);
-
-/**
- * @brief This API gets author's name of the given package.
- *
- * This API is for package-manager client application.\n
- *
- * @param[in] handle pointer to package info handle
- * @param[out] author_name to hold author's name.
- * @return 0 if success, error code(<0) if fail\n
-*/
-int pkgmgr_pkginfo_get_author_name(pkgmgr_pkginfo_h handle, char **author_name);
-
-/**
- * @brief This API gets author's email of the given package.
- *
- * This API is for package-manager client application.\n
- *
- * @param[in] handle pointer to package info handle
- * @param[out] author_email to hold author's email id.
- * @return 0 if success, error code(<0) if fail\n
-*/
-int pkgmgr_pkginfo_get_author_email(pkgmgr_pkginfo_h handle, char **author_email);
-
-/**
- * @brief This API gets author's href of the given package.
- *
- * This API is for package-manager client application.\n
- *
- * @param[in] handle pointer to package info handle
- * @param[out] author_href to hold author's href.
- * @return 0 if success, error code(<0) if fail\n
-*/
-int pkgmgr_pkginfo_get_author_href(pkgmgr_pkginfo_h handle, char **author_href);
-
-/**
- * @brief This API gets removable of the given package.
- *
- * This API is for package-manager client application.\n
- *
- * @param[in] handle pointer to package info handle
- * @param[out] removable to hold removable value.
- * @return 0 if success, error code(<0) if fail\n
-*/
-int pkgmgr_pkginfo_is_removable(pkgmgr_pkginfo_h handle, bool *removable);
-
-/**
- * @brief This API gets preload of the given package.
- *
- * This API is for package-manager client application.\n
- *
- * @param[in] handle pointer to package info handle
- * @param[out] preload to hold preload value
- * @return 0 if success, error code(<0) if fail\n
-*/
-int pkgmgr_pkginfo_is_preload(pkgmgr_pkginfo_h handle, bool *preload);
-
-/**
- * @brief This API gets readonly value of the given package.
- *
- * This API is for package-manager client application.\n
- *
- * @param[in] handle pointer to package info handle
- * @param[out] readonly to hold readonly value
- * @return 0 if success, error code(<0) if fail\n
-*/
-int pkgmgr_pkginfo_is_readonly(pkgmgr_pkginfo_h handle, bool *readonly);
-
-/**
- * @brief This API gets accessible of the given package.
- *
- * This API is for package-manager client application.\n
- *
- * @param[in] pkgid id of package
- * @param[out]accessible accessible of package
- * @return 0 if success, error code(<0) if fail\n
-*/
-int pkgmgr_pkginfo_is_accessible(pkgmgr_pkginfo_h handle, bool *accessible);
-
-/**
- * @brief This API destroy the pacakge info handle
- *
- * This API is for package-manager client application.\n
- *
- * @param[in] handle pointer to package info handle
- * @return 0 if success, error code(<0) if fail\n
-*/
-int pkgmgr_pkginfo_destroy_pkginfo(pkgmgr_pkginfo_h handle);
-
-/**
- * @brief This API gets installed storage of the given package.
- *
- * This API is for package-manager client application.\n
- *
- * @param[in] pkgid id of package
- * @param[out] storage storage of package
- * @return 0 if success, error code(<0) if fail\n
-*/
-int pkgmgr_pkginfo_get_installed_storage(pkgmgr_pkginfo_h handle, pkgmgr_installed_storage *storage);
-
-/**
- * @brief This API gets installed time of the given package.
- *
- * This API is for package-manager client application.\n
- *
- * @param[in] handle pointer to package info handle
- * @param[out] installed_time installed time of package
- * @return 0 if success, error code(<0) if fail\n
-*/
-int pkgmgr_pkginfo_get_installed_time(pkgmgr_pkginfo_h handle, int *installed_time);
-
-/**
- * @brief This API gets list of ui-application/service application of the given package.
- *
- * This API is for package-manager client application.\n
- *
- * @param[in] handle pointer to package info handle
- * @param[in] component application component type.
- * @param[in] app_func application's callback function.
- * @param[in] user_data user data to be passed to callback function
- * @return 0 if success, error code(<0) if fail\n
-*/
-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.
- *
- * This API is for package-manager client application.\n
- *
- * @param[in] handle pointer to package info handle
- * @param[in] category_func callback function.
- * @param[in] user_data user data to be passed to callback function
- * @return 0 if success, error code(<0) if fail\n
-*/
-int pkgmgr_appinfo_foreach_category(pkgmgr_appinfo_h handle, pkgmgr_info_app_category_list_cb category_func,
- void *user_data);
-
-/**
- * @brief This API gets application info entry from db.
- *
- * This API is for package-manager client application.\n
- *
- * @param[in] appid application id
- * @param[out] handle pointer to app info handle
- * @return 0 if success, error code(<0) if fail\n
-*/
-int pkgmgr_appinfo_get_appinfo(const char *appid, pkgmgr_appinfo_h *handle);
-
-/**
- * @brief This API gets appid of the given appid.
- *
- * This API is for package-manager client application.\n
- *
- * @param[in] handle pointer to app info handle
- * @param[out] appid to hold appid value
- * @return 0 if success, error code(<0) if fail\n
-*/
-int pkgmgr_appinfo_get_appid(pkgmgr_appinfo_h handle, char **appid);
-
-/**
- * @brief This API gets pkgid of the given appid.
- *
- * This API is for package-manager client application.\n
- *
- * @param[in] handle pointer to app info handle
- * @param[out]pkg_name to hold pkgid value
- * @return 0 if success, error code(<0) if fail\n
-*/
-int pkgmgr_appinfo_get_pkgname(pkgmgr_appinfo_h handle, char **pkg_name);
-
-/**
- * @brief This API gets pkgid of the given appid.
- *
- * This API is for package-manager client application.\n
- *
- * @param[in] handle pointer to app info handle
- * @param[out] pkgid to hold pkgid value
- * @return 0 if success, error code(<0) if fail\n
-*/
-int pkgmgr_appinfo_get_pkgid(pkgmgr_appinfo_h handle, char **pkgid);
-
-/**
- * @brief This API gets exec of the given appid.
- *
- * This API is for package-manager client application.\n
- *
- * @param[in] handle pointer to app info handle
- * @param[out] exec to hold exec value
- * @return 0 if success, error code(<0) if fail\n
-*/
-int pkgmgr_appinfo_get_exec(pkgmgr_appinfo_h handle, char **exec);
-
-/**
- * @brief This API gets icon name of the given appid.
- *
- * This API is for package-manager client application.\n
- *
- * @param[in] handle pointer to app info handle
- * @param[out] icon to hold icon value
- * @return 0 if success, error code(<0) if fail\n
-*/
-int pkgmgr_appinfo_get_icon(pkgmgr_appinfo_h handle, char **icon);
-
-/**
- * @brief This API gets label of the given appid.
- *
- * This API is for package-manager client application.\n
- *
- * @param[in] handle pointer to app info handle
- * @param[out] label to hold label value
- * @return 0 if success, error code(<0) if fail\n
-*/
-int pkgmgr_appinfo_get_label(pkgmgr_appinfo_h handle, char **label);
-
-/**
- * @brief This API gets package name of the given appid.
- *
- * This API is for package-manager client application.\n
- *
- * @param[in] handle pointer to app info handle
- * @param[out] package to hold package value
- * @return 0 if success, error code(<0) if fail\n
-*/
-int pkgmgr_appinfo_get_package(pkgmgr_appinfo_h handle, char **package);
-
-/**
- * @brief This API gets component type of the given appid.
- *
- * This API is for package-manager client application.\n
- *
- * @param[in] handle pointer to app info handle
- * @param[out] component to hold component value
- * @return 0 if success, error code(<0) if fail\n
-*/
-int pkgmgr_appinfo_get_component(pkgmgr_appinfo_h handle, pkgmgr_app_component *component);
-
-/**
- * @brief This API gets app type of the given appid.
- *
- * This API is for package-manager client application.\n
- *
- * @param[in] handle pointer to app info handle
- * @param[out] app_type to hold the apptype.
- * @return 0 if success, error code(<0) if fail\n
-*/
-int pkgmgr_appinfo_get_apptype(pkgmgr_appinfo_h handle, char **app_type);
-
-/**
- * @brief This API gets nodisplay value of the given appid.
- *
- * This API is for package-manager client application.\n
- *
- * @param[in] handle pointer to app info handle
- * @param[out] nodisplay to hold the nodisplay value
- * @return 0 if success, error code(<0) if fail\n
-*/
-int pkgmgr_appinfo_is_nodisplay(pkgmgr_appinfo_h handle, bool *nodisplay);
-
-/**
- * @brief This API gets multiple value of the given appid.
- *
- * This API is for package-manager client application.\n
- *
- * @param[in] handle pointer to app info handle
- * @param[out] multiple to hold the multiple value
- * @return 0 if success, error code(<0) if fail\n
-*/
-int pkgmgr_appinfo_is_multiple(pkgmgr_appinfo_h handle, bool *multiple);
-
-/**
- * @brief This API gets taskmanage value of the given appid.
- *
- * This API is for package-manager client application.\n
- *
- * @param[in] handle pointer to app info handle
- * @param[out] taskmanage to hold the taskmanage value
- * @return 0 if success, error code(<0) if fail\n
-*/
-int pkgmgr_appinfo_is_taskmanage(pkgmgr_appinfo_h handle, bool *taskmanage);
-
-/**
- * @brief This API gets hwacceleration value of the given appid.
- *
- * This API is for package-manager client application.\n
- *
- * @param[in] handle pointer to app info handle
- * @param[out] hwacceleration to hold the hwacceleration value
- * @return 0 if success, error code(<0) if fail\n
-*/
-int pkgmgr_appinfo_get_hwacceleration(pkgmgr_appinfo_h handle, pkgmgr_hwacceleration_type *hwacceleration);
-
-/**
- * @brief This API gets onboot value of the given appid.
- *
- * This API is for package-manager client application.\n
- *
- * @param[in] handle pointer to app info handle
- * @param[out] onboot to hold the onboot value
- * @return 0 if success, error code(<0) if fail\n
-*/
-int pkgmgr_appinfo_is_onboot(pkgmgr_appinfo_h handle, bool *onboot);
-
-/**
- * @brief This API gets autorestart value of the given appid.
- *
- * This API is for package-manager client application.\n
- *
- * @param[in] handle pointer to app info handle
- * @param[out] autorestart to hold the autorestart value
- * @return 0 if success, error code(<0) if fail\n
-*/
-int pkgmgr_appinfo_is_autorestart(pkgmgr_appinfo_h handle, bool *autorestart);
-
-/**
- * @brief This API destroy the appinfo handle.
- *
- * This API is for package-manager client application.\n
- *
- * @param[in] handle pointer to app info handle
- * @return 0 if success, error code(<0) if fail\n
-*/
-int pkgmgr_appinfo_destroy_appinfo(pkgmgr_appinfo_h handle);
-
-/**
- * @brief This API creates the certinfo handle.
- *
- * This API is for package-manager client application.\n
- *
- * @param[out] handle pointer to cert info handle
- * @return 0 if success, error code(<0) if fail\n
-*/
-int pkgmgr_pkginfo_create_certinfo(pkgmgr_certinfo_h *handle);
-
-/**
- * @brief This API loads cert info in the handle.
- *
- * This API is for package-manager client application.\n
- *
- * @param[in] handle pointer to cert info handle
- * @param[in] pkgid package ID
- * @return 0 if success, error code(<0) if fail\n
-*/
-int pkgmgr_pkginfo_load_certinfo(const char *pkgid, pkgmgr_certinfo_h handle, uid_t uid);
-
-/**
- * @brief This API gets cert value for corresponding cert type.
- *
- * This API is for package-manager client application.\n
- *
- * @param[in] handle pointer to cert info handle
- * @param[in] cert_type enum value for certificate type
- * @param[out] cert_value pointer to store cert value
- * @return 0 if success, error code(<0) if fail\n
-*/
-int pkgmgr_pkginfo_get_cert_value(pkgmgr_certinfo_h handle, pkgmgr_cert_type cert_type, const char **cert_value);
-
-/**
- * @brief This API destroys cert info handle freeing all resources.
- *
- * This API is for package-manager client application.\n
- *
- * @param[in] handle pointer to cert info handle
- * @return 0 if success, error code(<0) if fail\n
-*/
-int pkgmgr_pkginfo_destroy_certinfo(pkgmgr_certinfo_h handle);
-
-/**
- * @brief This API gets datacontrol info entry from db.
- *
- * This API is for package-manager client application.\n
- *
- * @param[in] providerid pointer to providerid
- * @param[in] type pointer to type
- * @param[out] appid pointer to appid value
- * @param[out] access pointer to access value
- * @return 0 if success, error code(<0) if fail\n
-*/
-int pkgmgr_datacontrol_get_info(const char *providerid, const char * type, char **appid, char **access);
/** @} */
+++ /dev/null
-/*
- * slp-pkgmgr
- *
- * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
- *
- * Contact: Jayoun Lee <airjany@samsung.com>, Sewook Park <sewook7.park@samsung.com>,
- * Jaeho Lee <jaeho81.lee@samsung.com>, Shobhit Srivastava <shobhit.s@samsung.com>
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-
-
-
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-#include <dlfcn.h>
-#include <malloc.h>
-#include <sys/time.h>
-
-#include "package-manager.h"
-#include "package-manager-types.h"
-#include "pkgmgr-internal.h"
-#include "pkgmgr-api.h"
-#include "pkgmgr-dbinfo.h"
-#include <pkgmgr-info.h>
-
-API int pkgmgr_create_pkgdbinfo(const char *pkgid, pkgmgr_pkgdbinfo_h *handle)
-{
- int ret = 0;
- ret = pkgmgrinfo_create_pkgdbinfo(pkgid, handle);
- return ret;
-}
-API int pkgmgr_create_pkgusrdbinfo(const char *pkgid, uid_t uid, pkgmgr_pkgdbinfo_h *handle)
-{
- int ret = 0;
- ret = pkgmgrinfo_create_pkgusrdbinfo(pkgid, uid, handle);
- return ret;
-}
-
-API int pkgmgr_set_type_to_pkgdbinfo(pkgmgr_pkgdbinfo_h handle, const char *type)
-{
- int ret = 0;
- ret = pkgmgrinfo_set_type_to_pkgdbinfo(handle, type);
- return ret;
-}
-
-API int pkgmgr_set_version_to_pkgdbinfo(pkgmgr_pkgdbinfo_h handle, const char *version)
-{
- int ret = 0;
- ret = pkgmgrinfo_set_version_to_pkgdbinfo(handle, version);
- return ret;
-}
-
-API int pkgmgr_set_install_location_to_pkgdbinfo(pkgmgr_pkgdbinfo_h handle, PM_INSTALL_LOCATION location)
-{
- int ret = 0;
- ret = pkgmgrinfo_set_install_location_to_pkgdbinfo(handle, location);
- return ret;
-}
-
-API int pkgmgr_set_size_to_pkgdbinfo(pkgmgr_pkgdbinfo_h handle, const char *size)
-{
- int ret = 0;
- ret = pkgmgrinfo_set_size_to_pkgdbinfo(handle, size);
- return ret;
-}
-
-API int pkgmgr_set_label_to_pkgdbinfo(pkgmgr_pkgdbinfo_h handle, const char *label, const char *locale)
-{
- int ret = 0;
- ret = pkgmgrinfo_set_label_to_pkgdbinfo(handle, label, locale);
- return ret;
-}
-
-API int pkgmgr_set_icon_to_pkgdbinfo(pkgmgr_pkgdbinfo_h handle, const char *icon, const char *locale)
-{
- int ret = 0;
- ret = pkgmgrinfo_set_icon_to_pkgdbinfo(handle, icon, locale);
- return ret;
-}
-
-API int pkgmgr_set_description_to_pkgdbinfo(pkgmgr_pkgdbinfo_h handle, const char *description, const char *locale)
-{
- int ret = 0;
- ret = pkgmgrinfo_set_description_to_pkgdbinfo(handle, description, locale);
- return ret;
-}
-
-API int pkgmgr_set_author_to_pkgdbinfo(pkgmgr_pkgdbinfo_h handle, const char *author_name,
- const char *author_email, const char *author_href, const char *locale)
-{
- int ret = 0;
- ret = pkgmgrinfo_set_author_to_pkgdbinfo(handle, author_name, author_email, author_href, locale);
- return ret;
-}
-
-API int pkgmgr_set_removable_to_pkgdbinfo(pkgmgr_pkgdbinfo_h handle, int removable)
-{
- int ret = 0;
- ret = pkgmgrinfo_set_removable_to_pkgdbinfo(handle, removable);
- return ret;
-}
-
-API int pkgmgr_set_preload_to_pkgdbinfo(pkgmgr_pkgdbinfo_h handle, int preload)
-{
- int ret = 0;
- ret = pkgmgrinfo_set_preload_to_pkgdbinfo(handle, preload);
- return ret;
-}
-
-API int pkgmgr_save_pkgdbinfo(pkgmgr_pkgdbinfo_h handle)
-{
- int ret = 0;
- ret = pkgmgrinfo_save_pkgdbinfo(handle);
- return ret;
-}
-
-API int pkgmgr_save_pkgusrdbinfo(pkgmgr_pkgdbinfo_h handle, uid_t uid)
-{
- int ret = 0;
- ret = pkgmgrinfo_save_pkgusrdbinfo(handle, uid);
- return ret;
-}
-
-API int pkgmgr_destroy_pkgdbinfo(pkgmgr_pkgdbinfo_h handle)
-{
- int ret = 0;
- ret = pkgmgrinfo_destroy_pkgdbinfo(handle);
- return ret;
-}
-
#include <fcntl.h>
#include <sys/wait.h>
#include <sys/time.h>
+
#include <dbus/dbus.h>
#include <dbus/dbus-glib-lowlevel.h>
+
#include <ail.h>
#include <db-util.h>
#include <pkgmgr-info.h>
#include <iniparser.h>
-
/* For multi-user support */
#include <tzplatform_config.h>
}
-static int __app_list_cb (const pkgmgr_appinfo_h handle,
+static int __app_list_cb (const pkgmgrinfo_appinfo_h handle,
void *user_data)
{
char *exec = NULL;
- pkgmgr_appinfo_get_exec(handle, &exec);
+ pkgmgrinfo_appinfo_get_exec(handle, &exec);
__pkgmgr_proc_iter_kill_cmdline(exec);
ret = pkgmgrinfo_pkginfo_get_usr_pkginfo(pkgid, uid, &handle);
else
ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
- retvm_if(ret < 0, PKGMGR_R_ERROR, "pkgmgr_pkginfo_get_pkginfo failed");
+ retvm_if(ret < 0, PKGMGR_R_ERROR, "pkgmgrinfo_pkginfo_get_pkginfo failed");
ret = pkgmgrinfo_pkginfo_get_type(handle, &pkgtype);
- tryvm_if(ret < 0, ret = PKGMGR_R_ERROR, "pkgmgr_pkginfo_get_type failed");
+ tryvm_if(ret < 0, ret = PKGMGR_R_ERROR, "pkgmgrinfo_pkginfo_get_type failed");
installer_path = _get_backend_path_with_type(pkgtype);
req_key = __get_req_key(pkgid);
ret = pkgmgrinfo_pkginfo_get_usr_pkginfo(pkgid, uid, &handle);
else
ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
- retvm_if(ret < 0, PKGMGR_R_ERROR, "pkgmgr_pkginfo_get_pkginfo failed");
+ retvm_if(ret < 0, PKGMGR_R_ERROR, "pkgmgrinfo_pkginfo_get_pkginfo failed");
ret = pkgmgrinfo_pkginfo_get_type(handle, &pkgtype);
- tryvm_if(ret < 0, ret = PKGMGR_R_ERROR, "pkgmgr_pkginfo_get_type failed");
+ tryvm_if(ret < 0, ret = PKGMGR_R_ERROR, "pkgmgrinfo_pkginfo_get_type failed");
/* 2. generate req_key */
req_key = __get_req_key(pkgid);
/* 1. check argument */
retv_if(pkgid == NULL, PKGMGR_R_EINVAL);
- pkgmgr_pkginfo_h handle;
- ret = pkgmgr_pkginfo_get_usr_pkginfo(pkgid, uid, &handle);
+ pkgmgrinfo_pkginfo_h handle;
+ ret = pkgmgrinfo_pkginfo_get_usr_pkginfo(pkgid, uid, &handle);
/*check package id */
- tryvm_if(ret < 0, ret = PKGMGR_R_EINVAL, "pkgmgr_pkginfo_get_pkginfo fail");
+ tryvm_if(ret < 0, ret = PKGMGR_R_EINVAL, "pkgmgrinfo_pkginfo_get_pkginfo fail");
tryvm_if(handle == NULL, ret = PKGMGR_R_EINVAL, "Pkgid(%s) can not find in installed pkg DB! \n", pkgid);
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");
+ ret = pkgmgrinfo_appinfo_get_usr_list(handle, PMINFO_UI_APP, __app_list_cb, NULL, uid);
+ tryvm_if(ret < 0, ret = PKGMGR_R_EINVAL, "pkgmgrinfo_appinfo_get_list : PMINFO_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");
+ ret = pkgmgrinfo_appinfo_get_usr_list(handle, PMINFO_SVC_APP, __app_list_cb, NULL, uid);
+ tryvm_if(ret < 0, ret = PKGMGR_R_EINVAL, "pkgmgrinfo_appinfo_get_list : PMINFO_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");
+ ret = pkgmgrinfo_appinfo_get_list(handle, PMINFO_UI_APP, __app_list_cb, NULL);
+ tryvm_if(ret < 0, ret = PKGMGR_R_EINVAL, "pkgmgrinfo_appinfo_get_list : PMINFO_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");
+ ret = pkgmgrinfo_appinfo_get_list(handle, PMINFO_SVC_APP, __app_list_cb, NULL);
+ tryvm_if(ret < 0, ret = PKGMGR_R_EINVAL, "pkgmgrinfo_appinfo_get_list : PMINFO_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");
+ ret = pkgmgrinfo_pkginfo_get_type(handle, &pkgtype);
+ tryvm_if(ret < 0, ret = PKGMGR_R_EINVAL, "pkgmgrinfo_pkginfo_get_type fail");
tryvm_if(pkgtype == NULL, ret = PKGMGR_R_ERROR, "pkgtype is NULL");
/*check removable, execpt "rpm" type */
if (strcmp(pkgtype, "rpm")) {
- pkgmgr_pkginfo_is_removable(handle, &removable);
+ pkgmgrinfo_pkginfo_is_removable(handle, &removable);
tryvm_if(removable == false, ret = PKGMGR_R_ERROR, "Pkgid(%s) can not be removed, This is non-removalbe package...\n", pkgid);
}
if(args)
free(args);
- pkgmgr_pkginfo_destroy_pkginfo(handle);
+ pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
return ret;
}
/* 1. check argument */
retv_if(pkgid == NULL, PKGMGR_R_EINVAL);
- pkgmgr_pkginfo_h handle;
+ pkgmgrinfo_pkginfo_h handle;
if (uid != GLOBAL_USER)
- ret = pkgmgr_pkginfo_get_usr_pkginfo(pkgid, uid, &handle);
+ ret = pkgmgrinfo_pkginfo_get_usr_pkginfo(pkgid, uid, &handle);
else
- ret = pkgmgr_pkginfo_get_pkginfo(pkgid, &handle);
+ ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
/*check package id */
- tryvm_if(ret < 0, ret = PKGMGR_R_EINVAL, "pkgmgr_pkginfo_get_pkginfo fail");
+ tryvm_if(ret < 0, ret = PKGMGR_R_EINVAL, "pkgmgrinfo_pkginfo_get_pkginfo fail");
tryvm_if(handle == NULL, ret = PKGMGR_R_EINVAL, "Pkgid(%s) can not find in installed pkg DB! \n", pkgid);
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");
+ ret = pkgmgrinfo_appinfo_get_usr_list(handle, PMINFO_UI_APP, __app_list_cb, NULL, uid);
+ tryvm_if(ret < 0, ret = PKGMGR_R_EINVAL, "pkgmgrinfo_appinfo_get_list : PMINFO_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");
+ ret = pkgmgrinfo_appinfo_get_usr_list(handle, PMINFO_SVC_APP, __app_list_cb, NULL, uid);
+ tryvm_if(ret < 0, ret = PKGMGR_R_EINVAL, "pkgmgrinfo_appinfo_get_list : PMINFO_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");
+ ret = pkgmgrinfo_appinfo_get_list(handle, PMINFO_UI_APP, __app_list_cb, NULL);
+ tryvm_if(ret < 0, ret = PKGMGR_R_EINVAL, "pkgmgrinfo_appinfo_get_list : PMINFO_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");
+ ret = pkgmgrinfo_appinfo_get_list(handle, PMINFO_SVC_APP, __app_list_cb, NULL);
+ tryvm_if(ret < 0, ret = PKGMGR_R_EINVAL, "pkgmgrinfo_appinfo_get_list : PMINFO_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");
+ ret = pkgmgrinfo_pkginfo_get_type(handle, &pkgtype);
+ tryvm_if(ret < 0, ret = PKGMGR_R_EINVAL, "pkgmgrinfo_pkginfo_get_type fail");
tryvm_if(pkgtype == NULL, ret = PKGMGR_R_ERROR, "pkgtype is NULL");
/*check pkgid length */
if(args)
free(args);
- pkgmgr_pkginfo_destroy_pkginfo(handle);
+ pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
return ret;
}
if (strcmp(pkgid, PKG_CLEAR_ALL_CACHE) != 0)
{
ret = pkgmgrinfo_pkginfo_get_usr_pkginfo(pkgid, uid, &handle);
- tryvm_if(ret < 0, ret = PKGMGR_R_ENOPKG, "pkgmgr_pkginfo_get_pkginfo failed");
+ tryvm_if(ret < 0, ret = PKGMGR_R_ENOPKG, "pkgmgrinfo_pkginfo_get_pkginfo failed");
ret = pkgmgrinfo_pkginfo_get_type(handle, &pkg_type);
- tryvm_if(ret < 0, ret = PKGMGR_R_ESYSTEM, "pkgmgr_pkginfo_get_type failed");
+ tryvm_if(ret < 0, ret = PKGMGR_R_ESYSTEM, "pkgmgrinfo_pkginfo_get_type failed");
}
else
{
}
#define __END_OF_OLD_API
-
-API int pkgmgr_pkginfo_get_list(pkgmgr_info_pkg_list_cb pkg_list_cb, void *user_data)
-{
- int ret = 0;
- ret = pkgmgrinfo_pkginfo_get_list(pkg_list_cb, user_data);
- 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_usr_pkginfo(const char *pkgid, uid_t uid, pkgmgr_pkginfo_h *handle)
-{
- int ret = 0;
- ret = pkgmgrinfo_pkginfo_get_usr_pkginfo(pkgid, uid, handle);
- return ret;
-}
-
-
-API int pkgmgr_pkginfo_get_pkginfo(const char *pkgid, pkgmgr_pkginfo_h *handle)
-{
- int ret = 0;
- ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, handle);
- return ret;
-}
-
-
-
-API int pkgmgr_pkginfo_get_pkgname(pkgmgr_pkginfo_h handle, char **pkg_name)
-{
- int ret = 0;
- ret = pkgmgrinfo_pkginfo_get_pkgname(handle, pkg_name);
- return ret;
-}
-
-
-API int pkgmgr_pkginfo_get_pkgid(pkgmgr_pkginfo_h handle, char **pkgid)
-{
- int ret = 0;
- ret = pkgmgrinfo_pkginfo_get_pkgid(handle, pkgid);
- return ret;
-}
-
-API int pkgmgr_pkginfo_get_type(pkgmgr_pkginfo_h handle, char **type)
-{
- int ret = 0;
- ret = pkgmgrinfo_pkginfo_get_type(handle, type);
- return ret;
-}
-
-API int pkgmgr_pkginfo_get_version(pkgmgr_pkginfo_h handle, char **version)
-{
- int ret = 0;
- ret = pkgmgrinfo_pkginfo_get_version(handle, version);
- return ret;
-}
-
-API int pkgmgr_pkginfo_get_install_location(pkgmgr_pkginfo_h handle, pkgmgr_install_location *location)
-{
- int ret = 0;
- pkgmgrinfo_install_location loc;
- ret = pkgmgrinfo_pkginfo_get_install_location(handle, &loc);
- *location = loc;
- return ret;
-}
-
-API int pkgmgr_pkginfo_get_package_size(pkgmgr_pkginfo_h handle, int *size)
-{
- int ret = 0;
- ret = pkgmgrinfo_pkginfo_get_package_size(handle, size);
- return ret;
-}
-
-API int pkgmgr_pkginfo_get_icon(pkgmgr_pkginfo_h handle, char **icon)
-{
- int ret = 0;
- ret = pkgmgrinfo_pkginfo_get_icon(handle, icon);
- return ret;
-}
-
-API int pkgmgr_pkginfo_get_label(pkgmgr_pkginfo_h handle, char **label)
-{
- int ret = 0;
- ret = pkgmgrinfo_pkginfo_get_label(handle, label);
- return ret;
-}
-
-API int pkgmgr_pkginfo_get_description(pkgmgr_pkginfo_h handle, char **description)
-{
- int ret = 0;
- ret = pkgmgrinfo_pkginfo_get_description(handle, description);
- return ret;
-}
-
-API int pkgmgr_pkginfo_get_author_name(pkgmgr_pkginfo_h handle, char **author_name)
-{
- int ret = 0;
- ret = pkgmgrinfo_pkginfo_get_author_name(handle, author_name);
- return ret;
-}
-
-API int pkgmgr_pkginfo_get_author_email(pkgmgr_pkginfo_h handle, char **author_email)
-{
- int ret = 0;
- ret = pkgmgrinfo_pkginfo_get_author_email(handle, author_email);
- return ret;
-}
-
-API int pkgmgr_pkginfo_get_author_href(pkgmgr_pkginfo_h handle, char **author_href)
-{
- int ret = 0;
- ret = pkgmgrinfo_pkginfo_get_author_href(handle, author_href);
- return ret;
-}
-
-API int pkgmgr_pkginfo_is_removable(pkgmgr_pkginfo_h handle, bool *removable)
-{
- int ret = 0;
- ret = pkgmgrinfo_pkginfo_is_removable(handle, removable);
- return ret;
-}
-
-API int pkgmgr_pkginfo_is_preload(pkgmgr_pkginfo_h handle, bool *preload)
-{
- int ret = 0;
- ret = pkgmgrinfo_pkginfo_is_preload(handle, preload);
- return ret;
-}
-
-API int pkgmgr_pkginfo_is_readonly(pkgmgr_pkginfo_h handle, bool *readonly)
-{
- int ret = 0;
- ret = pkgmgrinfo_pkginfo_is_readonly(handle, readonly);
- return ret;
-}
-
-API int pkgmgr_pkginfo_is_for_all_users(pkgmgr_pkginfo_h handle, bool *for_all_users)
-{
- int ret = 0;
- ret = pkgmgrinfo_pkginfo_is_for_all_users(handle, for_all_users);
- return ret;
-}
-
-API int pkgmgr_pkginfo_is_accessible(pkgmgr_pkginfo_h handle, bool *accessible)
-{
- int ret = 0;
- ret = pkgmgrinfo_pkginfo_is_accessible(handle, accessible);
- return ret;
-}
-
-API int pkgmgr_pkginfo_destroy_pkginfo(pkgmgr_pkginfo_h handle)
-{
- int ret = 0;
- ret = pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
- return ret;
-}
-
-API int pkgmgr_pkginfo_get_installed_storage(pkgmgr_pkginfo_h handle, pkgmgr_installed_storage *storage)
-{
- int ret = 0;
- pkgmgrinfo_installed_storage sto;
- ret = pkgmgrinfo_pkginfo_get_installed_storage(handle, &sto);
- *storage = sto;
- return ret;
-}
-
-API int pkgmgr_pkginfo_get_installed_time(pkgmgr_pkginfo_h handle, int *installed_time)
-{
- int ret = 0;
- ret = pkgmgrinfo_pkginfo_get_installed_time(handle, installed_time);
- return ret;
-}
-
-API int pkgmgr_appinfo_get_list(pkgmgr_pkginfo_h handle, pkgmgr_app_component component,
- pkgmgr_info_app_list_cb app_func, void *user_data)
-{
- int ret = 0;
- ret = pkgmgrinfo_appinfo_get_list(handle, component, app_func, user_data);
- 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)
-{
- int ret = 0;
- ret = pkgmgrinfo_appinfo_foreach_category(handle, category_func, user_data);
- return ret;
-}
-
-API int pkgmgr_appinfo_get_appinfo(const char *appid, pkgmgr_appinfo_h *handle)
-{
- int ret = 0;
- ret = pkgmgrinfo_appinfo_get_appinfo(appid, handle);
- return ret;
-}
-
-API int pkgmgr_appinfo_get_appid(pkgmgr_appinfo_h handle, char **appid)
-{
- int ret = 0;
- ret = pkgmgrinfo_appinfo_get_appid(handle, appid);
- return ret;
-}
-
-API int pkgmgr_appinfo_get_pkgname(pkgmgr_appinfo_h handle, char **pkg_name)
-{
- int ret = 0;
- ret = pkgmgrinfo_appinfo_get_pkgname(handle, pkg_name);
- return ret;
-}
-
-API int pkgmgr_appinfo_get_pkgid(pkgmgr_appinfo_h handle, char **pkgid)
-{
- int ret = 0;
- ret = pkgmgrinfo_appinfo_get_pkgid(handle, pkgid);
- return ret;
-}
-
-API int pkgmgr_appinfo_get_icon(pkgmgr_appinfo_h handle, char **icon)
-{
- int ret = 0;
- ret = pkgmgrinfo_appinfo_get_icon(handle, icon);
- return ret;
-}
-
-API int pkgmgr_appinfo_get_label(pkgmgr_appinfo_h handle, char **label)
-{
- int ret = 0;
- ret = pkgmgrinfo_appinfo_get_label(handle, label);
- return ret;
-}
-
-API int pkgmgr_appinfo_get_exec(pkgmgr_appinfo_h handle, char **exec)
-{
- int ret = 0;
- ret = pkgmgrinfo_appinfo_get_exec(handle, exec);
- return ret;
-}
-
-API int pkgmgr_appinfo_get_component(pkgmgr_appinfo_h handle, pkgmgr_app_component *component)
-{
- int ret = 0;
- pkgmgrinfo_app_component comp;
- ret = pkgmgrinfo_appinfo_get_component(handle, &comp);
- *component = comp;
- return ret;
-}
-
-API int pkgmgr_appinfo_get_apptype(pkgmgr_appinfo_h handle, char **app_type)
-{
- int ret = 0;
- ret = pkgmgrinfo_appinfo_get_apptype(handle, app_type);
- return ret;
-}
-
-API int pkgmgr_appinfo_is_nodisplay(pkgmgr_appinfo_h handle, bool *nodisplay)
-{
- int ret = 0;
- ret = pkgmgrinfo_appinfo_is_nodisplay(handle, nodisplay);
- return ret;
-}
-
-API int pkgmgr_appinfo_is_multiple(pkgmgr_appinfo_h handle, bool *multiple)
-{
- int ret = 0;
- ret = pkgmgrinfo_appinfo_is_multiple(handle, multiple);
- return ret;
-}
-
-API int pkgmgr_appinfo_is_taskmanage(pkgmgr_appinfo_h handle, bool *taskmanage)
-{
- int ret = 0;
- ret = pkgmgrinfo_appinfo_is_taskmanage(handle, taskmanage);
- return ret;
-}
-
-API int pkgmgr_appinfo_get_hwacceleration(pkgmgr_appinfo_h handle, pkgmgr_hwacceleration_type *hwacceleration)
-{
- int ret = 0;
- pkgmgrinfo_app_hwacceleration hwacc;
- ret = pkgmgrinfo_appinfo_get_hwacceleration(handle, &hwacc);
- *hwacceleration = hwacc;
- return ret;
-}
-
-API int pkgmgr_appinfo_is_onboot(pkgmgr_appinfo_h handle, bool *onboot)
-{
- int ret = 0;
- ret = pkgmgrinfo_appinfo_is_onboot(handle, onboot);
- return ret;
-}
-
-API int pkgmgr_appinfo_is_autorestart(pkgmgr_appinfo_h handle, bool *autorestart)
-{
- int ret = 0;
- ret = pkgmgrinfo_appinfo_is_autorestart(handle, autorestart);
- return ret;
-}
-
-API int pkgmgr_appinfo_destroy_appinfo(pkgmgr_appinfo_h handle)
-{
- int ret = 0;
- ret = pkgmgrinfo_appinfo_destroy_appinfo(handle);
- return ret;
-}
-
-API int pkgmgr_pkginfo_create_certinfo(pkgmgr_certinfo_h *handle)
-{
- int ret = 0;
- ret = pkgmgrinfo_pkginfo_create_certinfo(handle);
- return ret;
-}
-
-API int pkgmgr_pkginfo_load_certinfo(const char *pkgid, pkgmgr_certinfo_h handle, uid_t uid)
-{
- int ret = 0;
- ret = pkgmgrinfo_pkginfo_load_certinfo(pkgid, handle, uid);
- return ret;
-}
-
-API int pkgmgr_pkginfo_get_cert_value(pkgmgr_certinfo_h handle, pkgmgr_cert_type cert_type, const char **cert_value)
-{
- int ret = 0;
- ret = pkgmgrinfo_pkginfo_get_cert_value(handle, cert_type, cert_value);
- return ret;
-}
-
-API int pkgmgr_pkginfo_destroy_certinfo(pkgmgr_certinfo_h handle)
-{
- int ret = 0;
- ret = pkgmgrinfo_pkginfo_destroy_certinfo(handle);
- return ret;
-}
-
-API int pkgmgr_datacontrol_get_info(const char *providerid, const char * type, char **appid, char **access)
-{
- int ret = 0;
- ret = pkgmgrinfo_datacontrol_get_info(providerid, type, appid, access);
- return ret;
-}
+++ /dev/null
-/*
- * slp-pkgmgr
- *
- * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
- *
- * Contact: Jayoun Lee <airjany@samsung.com>, Sewook Park <sewook7.park@samsung.com>,
- * Jaeho Lee <jaeho81.lee@samsung.com>, Shobhit Srivastava <shobhit.s@samsung.com>
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-
-
-
-
-/**
-
- *
- * @ingroup SLP_PG
- * @defgroup PackageManagerClient
-
-
-@par package manager Programming Guide
-
-<h1 class="pg"> Introduction</h1>
-<h2 class="pg"> Purpose of this document</h2>
-The purpose of this document is to describe how applications can usepackage manager APIs.\n
-This document gives only programming guidelines to application engineers.
-
-<h2 class="pg"> Scope</h2>
-The scope of this document is limited to Samsung platform package manager API usage.
-
-<h1 class="pg"> Architecture</h1>
-<h2 class="pg"> Architecture overview</h2>
-package manager is responsible for installing / uninstalling / activating application. It also support getting application list API \n
-
-Dbus is used for communication between frontend and package-server / package-server and client library..\n
-Each type of packages have been implemented and these are used for each type of operation.
-
-@image html high-level.png "High-Level Architure"
-
-<h2 class="pg"> SLP Features</h2>
-package manager has the following features:\n
-
- - Install /Uninstall /Activate Application (Primitive APIs)
- - It can install/uninstall an application
- - It can activate/deactivate application.
-
- - Application List
- - It provides the list of applications that are installed.
- - It provides the API to free the list.
-
- - Listen / Broadcast status
- - It can listen the status broadcasted by other application.
- - It can broadcast the status to other application.
-
-<h1 class="pg"> package manager API descriptions</h1>
-<b> SEE API manual </b>
-
-<h1 class="pg"> package manager features with sample code</h1>
-<h2 class="pg"> Install /Uninstall /Activate an application</h2>
-
-Client application
-- Install request with return callback function
-
-@code
-// the package path is "TZ_USER_APP/org.tizen.hello.deb"
-#include <package-manager.h>
-
-int static return_cb(pkg_request_id req_id, const char *pkg_type, const char *pkg_name, const char *key, const char *val, const void *pmsg, void *data)
-{
- pkgmgr_client *pc = (pkgmgr_client *)data;
-
- if( strcmp(key, "end") == 0) {
- pkgmgr_client_free(pc);
- exit(0);
- }
-}
-
-void install_func()
-{
- int result = 0;
- pkgmgr_client *pc = NULL;
-
- pc = pkgmgr_client_new(PC_REQUEST);
- if(pc == NULL) {
- printf("pc is NULL\n");
- return -1;
- }
-
- result = pkgmgr_client_install(pc, NULL, des, "TZ_USER_APP/org.tizen.hello.deb", NULL, PM_DEFAULT, return_cb, pc);
- if(result < 0) {
- fprintf(stderr, "Install failed! %d\n", result);
- return -1;
- }
-
-}
-@endcode
-
-
-- Uninstall request with return callback function
-
-@code
-// the package type is "deb", package name is "org.tizen.hello"
-#include <package-manager.h>
-
-int static return_cb(pkg_request_id req_id, const char *pkg_type, const char *pkg_name, const char *key, const char *val, const void *pmsg, void *data)
-{
- pkgmgr_client *pc = (pkgmgr_client *)data;
-
- if( strcmp(key, "end") == 0) {
- pkgmgr_client_free(pc);
- exit(0);
- }
-}
-
-void uninstall_func()
-{
- int result = 0;
- pkgmgr_client *pc = NULL;
-
- pc = pkgmgr_client_new(PC_REQUEST);
- if(pc == NULL) {
- printf("pc is NULL\n");
- return -1;
- }
-
- result = pkgmgr_client_uninstall(pc, "deb", des, "org.tizen.hello", PM_DEFAULT, return_cb, pc);
- if(result < 0) {
- fprintf(stderr, "Uninstall failed! %d\n", result);
- return -1;
- }
-
-}
-@endcode
-
-
-- Activate request with return callback function
-
-@code
-// the package type is "deb", package name is "org.tizen.hello"
-#include <package-manager.h>
-
-
-void activate_func()
-{
- int result = 0;
- pkgmgr_client *pc = NULL;
-
- pc = pkgmgr_client_new(PC_REQUEST);
- if(pc == NULL) {
- printf("pc is NULL\n");
- return -1;
- }
-
- result = pkgmgr_client_activate(pc, "deb", "org.tizen.hello");
- if(result < 0) {
- fprintf(stderr, "Activation failed! %d\n", result);
- return -1;
- }
-
- pkgmgr_client_free(pc);
-
-}
-@endcode
-
-
-
-<h2 class="pg"> Get Installed Application List </h2>
-
-- Get/free application list
-- This package manager function is used to get the list of all installed applications which can be removed.
-
-@code
-#include <package-manager.h>
-
-static int __iter_fn(const char* pkg_type, const char* pkg_name, const char* version, void *data)
-{
- printf("pkg_type %s, pkg_name %s, version %s\n", pkg_type, pkg_name, version);
-
- return 0;
-}
-
-void getlist_func()
-{
- pkgmgr_get_pkg_list(__iter_fn, NULL);
-}
-@endcode
-
-
-
-<h2 class="pg"> Listen and broadcast the status </h2>
-
-- Listen / broadcast the status
-- This package manager function is used to listen the status broadcasted by other application.
-
-@code
-#include <package-manager.h>
-
-int static return_cb(pkg_request_id req_id, const char *pkg_type, const char *pkg_name, const char *key, const char *val, const void *pmsg, void *data)
-{
- pkgmgr_client *pc = (pkgmgr_client *)data;
-
- if( strcmp(key, "end") == 0) {
- pkgmgr_client_free(pc);
- exit(0);
- }
-}
-
-void listen_func()
-{
- int result = 0;
- pkgmgr_client *pc = NULL;
-
- pc = pkgmgr_client_new(PC_LISTENING);
- if(pc == NULL) {
- printf("pc is NULL\n");
- return -1;
- }
-
- result = pkgmgr_client_listen_status(pc, return_cb, pc);
- if(result < 0)
- {
- fprintf(stderr, "status listen failed!\n");
- return -1;
- }
-}
-@endcode
-
-
-- This package manager function is used to listen the status broadcasted by other application.
-
-@code
-// the package type is "deb", package name is "org.tizen.hello", key is "key_string", val is "val_string"
-#include <package-manager.h>
-
-void broadcast_func()
-{
- int result = 0;
- pkgmgr_client *pc = NULL;
-
- pc= pkgmgr_client_new(PC_BROADCAST);
- if(pc == NULL) {
- printf("pc is NULL\n");
- return -1;
- }
-
- int result = pkgmgr_client_broadcast_status(pc, "deb", "org.tizen.hello", "key_string", "val_string");
- if(result < 0) {
- fprintf(stderr, "status broadcast failed!\n");
- return -1;
- }
-
- pkgmgr_client_free(pc);
-}
-@endcode
-
-
-*/
-
-/**
-@}
-*/
-
-
+++ /dev/null
-../client/include/pkgmgr-dbinfo.h
\ No newline at end of file
%manifest %{name}-client-devel.manifest
%defattr(-,root,root,-)
%{_includedir}/package-manager.h
-%{_includedir}/pkgmgr-dbinfo.h
%{_libdir}/pkgconfig/pkgmgr.pc
%{_libdir}/libpkgmgr-client.so
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
-#include <sqlite3.h>
#include <unistd.h>
#include <ctype.h>
#include <getopt.h>
#include <fcntl.h>
#include <dlfcn.h>
#include <sys/types.h>
+
#include <glib.h>
-#include <ail.h>
#include <glib-object.h>
-#include <pkgmgr-info.h>
+#include <sqlite3.h>
+#include <ail.h>
+#include <pkgmgr-info.h>
/* For multi-user support */
#include <tzplatform_config.h>
static int __is_app_installed(char *pkgid, uid_t uid)
{
- pkgmgr_pkginfo_h handle;
+ pkgmgrinfo_pkginfo_h handle;
int ret;
if (uid != GLOBAL_USER)
- ret = pkgmgr_pkginfo_get_usr_pkginfo(pkgid, uid, &handle);
+ ret = pkgmgrinfo_pkginfo_get_usr_pkginfo(pkgid, uid, &handle);
else
- ret = pkgmgr_pkginfo_get_pkginfo(pkgid, &handle);
+ ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
if(ret < 0) {
printf("package is not in pkgmgr_info DB\n");
return -1;
} else
- pkgmgr_pkginfo_destroy_pkginfo(handle);
+ pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
return 0;
}
}
}
-static int __pkgmgr_list_cb (const pkgmgr_pkginfo_h handle, void *user_data)
+static int __pkgmgr_list_cb (const pkgmgrinfo_pkginfo_h handle, void *user_data)
{
int ret = -1;
char *pkgid = NULL;
pkgmgrinfo_uidinfo_t *uid_info = (pkgmgrinfo_uidinfo_t *) handle;
- ret = pkgmgr_pkginfo_get_pkgid(handle, &pkgid);
+ ret = pkgmgrinfo_pkginfo_get_pkgid(handle, &pkgid);
if (ret == -1) {
- printf("Failed to get pkgmgr_pkginfo_get_pkgid\n");
+ printf("Failed to get pkgmgrinfo_pkginfo_get_pkgid\n");
return ret;
}
- ret = pkgmgr_pkginfo_get_type(handle, &pkg_type);
+ ret = pkgmgrinfo_pkginfo_get_type(handle, &pkg_type);
if (ret == -1) {
- printf("Failed to get pkgmgr_pkginfo_get_type\n");
+ printf("Failed to get pkgmgrinfo_pkginfo_get_type\n");
return ret;
}
- ret = pkgmgr_pkginfo_get_version(handle, &pkg_version);
+ ret = pkgmgrinfo_pkginfo_get_version(handle, &pkg_version);
if (ret == -1) {
- printf("Failed to get pkgmgr_pkginfo_get_version\n");
+ printf("Failed to get pkgmgrinfo_pkginfo_get_version\n");
return ret;
}
- ret = pkgmgr_pkginfo_get_label(handle, &pkg_label);
+ ret = pkgmgrinfo_pkginfo_get_label(handle, &pkg_label);
if (ret == -1)
pkg_label = "(null)";
- ret = pkgmgr_pkginfo_is_for_all_users(handle, &for_all_users);
+ ret = pkgmgrinfo_pkginfo_is_for_all_users(handle, &for_all_users);
if (ret == -1) {
- printf("Failed to get pkgmgr_pkginfo_is_for_all_users\n");
+ printf("Failed to get pkgmgrinfo_pkginfo_is_for_all_users\n");
return ret;
}
ret = pkgmgrinfo_pkginfo_get_pkgid(handle, &pkgid);
if(ret < 0) {
- printf("pkgmgr_pkginfo_get_pkgid() failed\n");
+ printf("pkgmgrinfo_pkginfo_get_pkgid() failed\n");
}
if (uid_info->uid != GLOBAL_USER)
ret = pkgmgr_client_usr_request_service(PM_REQUEST_GET_SIZE, PM_GET_TOTAL_SIZE, (pkgmgr_client *)user_data, NULL, pkgid, uid_info->uid, NULL, NULL, NULL);
if (data.pkg_type[0] == '\0') {
ret = 0;
if (uid != GLOBAL_USER) {
- ret = pkgmgr_pkginfo_get_usr_list(__pkgmgr_list_cb, NULL, uid);
+ ret = pkgmgrinfo_pkginfo_get_usr_list(__pkgmgr_list_cb, NULL, uid);
} else {
- ret = pkgmgr_pkginfo_get_list(__pkgmgr_list_cb, NULL);
+ ret = pkgmgrinfo_pkginfo_get_list(__pkgmgr_list_cb, NULL);
}
if (ret == -1)
printf("no packages found\n");
#include <stdlib.h>
#include <unistd.h>
#include <sys/types.h>
+
#include <vconf.h>
//Work around for https://bugs.tizen.org/jira/browse/TC-2399
#include <ail_vconf.h>
#include <pkgmgr_parser.h>
#include <pkgmgr-info.h>
+
#include "package-manager.h"
#include "package-manager-types.h"
-#include "pkgmgr-dbinfo.h"
#include "pkgmgr_installer.h"
#define OWNER_ROOT 0
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 __set_certinfo_in_db(char *pkgid, uid_t uid);
static int __get_certinfo_from_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 pkgmgrinfo_pkginfo_h handle, void *user_data);
static int __app_category_list_cb(const char *category_name, void *user_data);
static int __app_control_list_cb(const char *operation, const char *uri, const char *mime, void *user_data);
static int __app_metadata_list_cb(const char *metadata_name, const char *metadata_value, void *user_data);
-int app_func(const pkgmgr_appinfo_h handle, void *user_data);
+int app_func(const pkgmgrinfo_appinfo_h handle, void *user_data);
static void __get_pkgmgrinfo_pkginfo(const pkgmgrinfo_pkginfo_h handle, void *user_data)
{
char *author_href = NULL;
char *root_path = NULL;
char *mainappid = NULL;
- pkgmgr_install_location location = 0;
+ pkgmgrinfo_install_location location = 0;
char *icon = NULL;
char *label = NULL;
char *desc = NULL;
printf("\tpkginfo --appcontrol <appid>\n\n");
printf("To insert|remove manifest info in DB\n");
printf("\tpkginfo --[imd|rmd] <manifest file name>\n\n");
- printf("To set pkginfo in DB\n");
- printf("\tpkginfo --setdb <pkgid>\n\n");
printf("To set manifest validation\n");
printf("\tpkginfo --check <manifest file name>\n\n");
printf("To set cert info in DB\n");
int choice = -1;
int i = 0;
const char *value = NULL;
- pkgmgr_certinfo_h handle = NULL;
- ret = pkgmgr_pkginfo_create_certinfo(&handle);
+ pkgmgrinfo_certinfo_h handle = NULL;
+ ret = pkgmgrinfo_pkginfo_create_certinfo(&handle);
if (ret < 0) {
- printf("pkgmgr_pkginfo_create_certinfo failed\n");
+ printf("pkgmgrinfo_pkginfo_create_certinfo failed\n");
return -1;
}
- ret = pkgmgr_pkginfo_load_certinfo(pkgid, handle, uid);
+ ret = pkgmgrinfo_pkginfo_load_certinfo(pkgid, handle, uid);
if (ret < 0) {
- printf("pkgmgr_pkginfo_load_certinfo failed\n");
+ printf("pkgmgrinfo_pkginfo_load_certinfo failed\n");
return -1;
}
while (choice != 10)
case 0:
for (i = 0; i < 9; i++)
{
- pkgmgr_pkginfo_get_cert_value(handle, i, &value);
+ pkgmgrinfo_pkginfo_get_cert_value(handle, i, &value);
if (value)
printf("cert type[%d] value = %s\n", i, value);
}
- ret = pkgmgr_pkginfo_destroy_certinfo(handle);
+ ret = pkgmgrinfo_pkginfo_destroy_certinfo(handle);
if (ret < 0) {
- printf("pkgmgr_pkginfo_destroy_certinfo failed\n");
+ printf("pkgmgrinfo_pkginfo_destroy_certinfo failed\n");
return -1;
}
return 0;
case 7:
case 8:
case 9:
- ret = pkgmgr_pkginfo_get_cert_value(handle, choice - 1, &value);
+ ret = pkgmgrinfo_pkginfo_get_cert_value(handle, choice - 1, &value);
if (value)
printf("cert type[%d] value = %s\n", choice - 1, value);
break;
case 10:
- ret = pkgmgr_pkginfo_destroy_certinfo(handle);
+ ret = pkgmgrinfo_pkginfo_destroy_certinfo(handle);
if (ret < 0) {
- printf("pkgmgr_pkginfo_destroy_certinfo failed\n");
+ printf("pkgmgrinfo_pkginfo_destroy_certinfo failed\n");
return -1;
}
return 0;
return ret;
}
-static int __set_pkginfo_in_db(char *pkgid, uid_t uid)
-{
- if (pkgid == NULL) {
- printf("pkgid is NULL\n");
- return -1;
- }
- int ret = 0;
- int choice = -1;
- int preload = -1;
- int removable = -1;
- int location = -1;
- char *locale = NULL;
- pkgmgr_pkgdbinfo_h handle = NULL;
- INSTALL_LOCATION storage = 0;
-
- if(uid != GLOBAL_USER)
- ret = pkgmgrinfo_create_pkgusrdbinfo(pkgid, uid, &handle);
- else
- ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
- if (ret < 0) {
- printf("pkgmgrinfo_create_pkgdbinfo failed\n");
- return -1;
- }
- while (choice != 0)
- {
- printf("Enter the choice you want to set\n");
- printf("0 --> to set data in DB\n");
- printf("1 --> pkg type\n");
- printf("2 --> pkg version\n");
- printf("3 --> pkg instal location\n");
- printf("4 --> pkg label\n");
- printf("5 --> pkg icon\n");
- printf("6 --> pkg description\n");
- printf("7 --> pkg author\n");
- printf("8 --> pkg removable\n");
- printf("9 --> pkg preload\n");
- printf("10 --> pkg size\n");
- printf("11 --> pkg installed storage\n");
- choice = __get_integer_input_data();
- switch (choice) {
- case 0:
- ret = pkgmgrinfo_save_pkgdbinfo(handle);
- if (ret < 0) {
- printf("pkgmgrinfo_save_pkgdbinfo failed\n");
- pkgmgrinfo_destroy_pkgdbinfo(handle);
- return -1;
- }
- ret = pkgmgrinfo_destroy_pkgdbinfo(handle);
- if (ret < 0) {
- printf("pkgmgrinfo_destroy_pkgdbinfo failed\n");
- return -1;
- }
- break;
- case 1:
- printf("Enter type: \n");
- char *type = __get_string_input_data();
- ret = pkgmgrinfo_set_type_to_pkgdbinfo(handle, type);
- if (ret < 0) {
- printf("pkgmgrinfo_set_type_to_pkgdbinfo failed\n");
- pkgmgrinfo_destroy_pkgdbinfo(handle);
- free(type);
- return -1;
- }
- free(type);
- break;
- case 2:
- printf("Enter version: \n");
- char *version = __get_string_input_data();
- ret = pkgmgrinfo_set_version_to_pkgdbinfo(handle, version);
- if (ret < 0) {
- printf("pkgmgrinfo_set_version_to_pkgdbinfo failed\n");
- pkgmgrinfo_destroy_pkgdbinfo(handle);
- free(version);
- return -1;
- }
- free(version);
- break;
- case 3:
- printf("Enter install location [0:internal | 1:external]: \n");
- location = __get_integer_input_data();
- ret = pkgmgrinfo_set_install_location_to_pkgdbinfo(handle, location);
- if (ret < 0) {
- printf("pkgmgrinfo_set_install_location_to_pkgdbinfo failed\n");
- pkgmgrinfo_destroy_pkgdbinfo(handle);
- return -1;
- }
- break;
- case 4:
- printf("Enter label :\n");
- char *label = __get_string_input_data();
- printf("Enter locale ['def' for default]: \n");
- locale = __get_string_input_data();
- if (strcmp(locale, "def") == 0)
- ret = pkgmgrinfo_set_label_to_pkgdbinfo(handle, label, NULL);
- else
- ret = pkgmgrinfo_set_label_to_pkgdbinfo(handle, label, locale);
- if (ret < 0) {
- printf("pkgmgrinfo_set_label_to_pkgdbinfo failed\n");
- pkgmgrinfo_destroy_pkgdbinfo(handle);
- free(locale);
- free(label);
- return -1;
- }
- free(locale);
- free(label);
- break;
- case 5:
- printf("Enter icon: \n");
- char *icon = __get_string_input_data();
- printf("Enter locale ['def' for default]: \n");
- locale = __get_string_input_data();
- if (strcmp(locale, "def") == 0)
- ret = pkgmgrinfo_set_icon_to_pkgdbinfo(handle, icon, NULL);
- else
- ret = pkgmgrinfo_set_icon_to_pkgdbinfo(handle, icon, locale);
- if (ret < 0) {
- printf("pkgmgrinfo_set_icon_to_pkgdbinfo failed\n");
- pkgmgrinfo_destroy_pkgdbinfo(handle);
- free(locale);
- free(icon);
- return -1;
- }
- free(locale);
- free(icon);
- break;
- case 6:
- printf("Enter description: \n");
- char *description = __get_string_input_data();
- printf("Enter locale ['def' for default]: \n");
- locale = __get_string_input_data();
- if (strcmp(locale, "def") == 0)
- ret = pkgmgrinfo_set_description_to_pkgdbinfo(handle, description, NULL);
- else
- ret = pkgmgrinfo_set_description_to_pkgdbinfo(handle, description, locale);
- if (ret < 0) {
- printf("pkgmgrinfo_set_description_to_pkgdbinfo failed\n");
- pkgmgrinfo_destroy_pkgdbinfo(handle);
- free(locale);
- free(description);
- return -1;
- }
- free(locale);
- free(description);
- break;
- case 7:
- printf("Enter author name: \n");
- char *author_name = __get_string_input_data();
- printf("Enter locale ['def' for default]: \n");
- locale = __get_string_input_data();
- printf("Enter author email: \n");
- char *author_email = __get_string_input_data();
- printf("Enter author href: \n");
- char *author_href = __get_string_input_data();
- if (strcmp(locale, "def") == 0)
- ret = pkgmgrinfo_set_author_to_pkgdbinfo(handle, author_name, author_email, author_href, NULL);
- else
- ret = pkgmgrinfo_set_author_to_pkgdbinfo(handle, author_name, author_email, author_href, locale);
- if (ret < 0) {
- printf("pkgmgrinfo_set_author_to_pkgdbinfo failed\n");
- pkgmgrinfo_destroy_pkgdbinfo(handle);
- free(locale);
- free(author_name);
- free(author_email);
- free(author_href);
- return -1;
- }
- free(locale);
- free(author_name);
- free(author_email);
- free(author_href);
- break;
- case 8:
- printf("Enter removable [0:false | 1:true]: \n");
- removable = __get_integer_input_data();
- ret = pkgmgrinfo_set_removable_to_pkgdbinfo(handle, removable);
- if (ret < 0) {
- printf("pkgmgrinfo_set_removable_to_pkgdbinfo failed\n");
- pkgmgrinfo_destroy_pkgdbinfo(handle);
- return -1;
- }
- break;
- case 9:
- printf("Enter preload [0:false | 1:true]: \n");
- preload = __get_integer_input_data();
- ret = pkgmgrinfo_set_preload_to_pkgdbinfo(handle, preload);
- if (ret < 0) {
- printf("pkgmgrinfo_set_preload_to_pkgdbinfo failed\n");
- pkgmgrinfo_destroy_pkgdbinfo(handle);
- return -1;
- }
- break;
- case 10:
- printf("Enter size in MB \n");
- char *size = __get_string_input_data();
- ret = pkgmgrinfo_set_size_to_pkgdbinfo(handle, size);
- if (ret < 0) {
- printf("pkgmgrinfo_set_size_to_pkgdbinfo failed\n");
- pkgmgrinfo_destroy_pkgdbinfo(handle);
- free(size);
- return -1;
- }
- free(size);
- break;
- case 11:
- printf("Enter insatlled storage [ 0:INTERNAL | 1:EXTERNAL ] \n");
- storage = __get_integer_input_data();
- ret = pkgmgrinfo_set_installed_storage_to_pkgdbinfo(handle, storage);
- if (ret < 0) {
- printf("pkgmgrinfo_set_installed_storage_to_pkgdbinfo failed\n");
- pkgmgrinfo_destroy_pkgdbinfo(handle);
- return -1;
- }
- break;
- default:
- printf("Invalid number entered\n");
- continue;
- }
- }
- return 0;
-}
-
static int __insert_manifest_in_db(char *manifest, uid_t uid)
{
int ret = 0;
return 0;
}
-int app_func(const pkgmgr_appinfo_h handle, void *user_data)
+int app_func(const pkgmgrinfo_appinfo_h handle, void *user_data)
{
char *appid;
char *data = NULL;
char *exec = NULL;
char *icon = NULL;
char *label = NULL;
- pkgmgr_app_component component = 0;
+ pkgmgrinfo_app_component component = 0;
char *apptype = NULL;
bool nodisplay = 0;
bool multiple = 0;
bool taskmanage = 0;
- pkgmgr_hwacceleration_type hwacceleration;
+ pkgmgrinfo_app_hwacceleration hwacceleration;
pkgmgrinfo_app_screenreader screenreader;
bool onboot = 0;
bool autorestart = 0;
char *package = NULL;
- ret = pkgmgr_appinfo_get_appid(handle, &appid);
+ ret = pkgmgrinfo_appinfo_get_appid(handle, &appid);
if (ret < 0) {
printf("Failed to get appid\n");
}
if (appid)
printf("Appid: %s\n", appid);
- ret = pkgmgr_appinfo_get_pkgid(handle, &package);
+ ret = pkgmgrinfo_appinfo_get_pkgid(handle, &package);
if (ret < 0) {
printf("Failed to get package\n");
}
if (package)
printf("Package: %s\n", package);
- ret = pkgmgr_appinfo_get_exec(handle, &exec);
+ ret = pkgmgrinfo_appinfo_get_exec(handle, &exec);
if (ret < 0) {
printf("Failed to get exec\n");
}
if (exec)
printf("Exec: %s\n", exec);
- ret = pkgmgr_appinfo_get_icon(handle, &icon);
+ ret = pkgmgrinfo_appinfo_get_icon(handle, &icon);
if (ret < 0) {
printf("Failed to get icon\n");
}
if (icon)
printf("Icon: %s\n", icon);
- ret = pkgmgr_appinfo_get_label(handle, &label);
+ ret = pkgmgrinfo_appinfo_get_label(handle, &label);
if (ret < 0) {
printf("Failed to get label\n");
}
if (label)
printf("Label: %s\n", label);
- ret = pkgmgr_appinfo_get_component(handle, &component);
+ ret = pkgmgrinfo_appinfo_get_component(handle, &component);
if (ret < 0) {
printf("Failed to get component\n");
}
- ret = pkgmgr_appinfo_get_apptype(handle, &apptype);
+ ret = pkgmgrinfo_appinfo_get_apptype(handle, &apptype);
if (ret < 0) {
printf("Failed to get apptype\n");
}
if (apptype)
printf("Apptype: %s\n", apptype);
- if (component == PM_UI_APP) {
+ if (component == PMINFO_UI_APP) {
printf("component: uiapp\n");
- ret = pkgmgr_appinfo_is_multiple(handle, &multiple);
+ ret = pkgmgrinfo_appinfo_is_multiple(handle, &multiple);
if (ret < 0) {
printf("Failed to get multiple\n");
} else {
printf("Multiple: %d\n", multiple);
}
- ret = pkgmgr_appinfo_is_nodisplay(handle, &nodisplay);
+ ret = pkgmgrinfo_appinfo_is_nodisplay(handle, &nodisplay);
if (ret < 0) {
printf("Failed to get nodisplay\n");
} else {
printf("Nodisplay: %d \n", nodisplay);
}
- ret = pkgmgr_appinfo_is_taskmanage(handle, &taskmanage);
+ ret = pkgmgrinfo_appinfo_is_taskmanage(handle, &taskmanage);
if (ret < 0) {
printf("Failed to get taskmanage\n");
} else {
printf("Taskmanage: %d\n", taskmanage);
}
- ret = pkgmgr_appinfo_get_hwacceleration(handle, &hwacceleration);
+ ret = pkgmgrinfo_appinfo_get_hwacceleration(handle, &hwacceleration);
if (ret < 0) {
printf("Failed to get hwacceleration\n");
} else {
}
}
- if (component == PM_SVC_APP) {
+ if (component == PMINFO_SVC_APP) {
printf("component: svcapp\n");
- ret = pkgmgr_appinfo_is_onboot(handle, &onboot);
+ ret = pkgmgrinfo_appinfo_is_onboot(handle, &onboot);
if (ret < 0) {
printf("Failed to get onboot\n");
} else {
printf("Onboot: %d\n", onboot);
}
- ret = pkgmgr_appinfo_is_autorestart(handle, &autorestart);
+ ret = pkgmgrinfo_appinfo_is_autorestart(handle, &autorestart);
if (ret < 0) {
printf("Failed to get autorestart\n");
} else {
}
-static int __pkg_list_cb (const pkgmgr_pkginfo_h handle, void *user_data)
+static int __pkg_list_cb (const pkgmgrinfo_pkginfo_h handle, void *user_data)
{
char *test_data = "test data";
int ret = -1;
int installed_time = -1;
pkgmgrinfo_uidinfo_t *uid_info = (pkgmgrinfo_uidinfo_t *) handle;
- ret = pkgmgr_pkginfo_get_pkgid(handle, &pkgid);
+ ret = pkgmgrinfo_pkginfo_get_pkgid(handle, &pkgid);
if(ret < 0) {
- printf("pkgmgr_pkginfo_get_pkgid() failed\n");
+ printf("pkgmgrinfo_pkginfo_get_pkgid() failed\n");
}
- ret = pkgmgr_pkginfo_get_type(handle, &pkg_type);
+ ret = pkgmgrinfo_pkginfo_get_type(handle, &pkg_type);
if(ret < 0) {
- printf("pkgmgr_pkginfo_get_type() failed\n");
+ printf("pkgmgrinfo_pkginfo_get_type() failed\n");
}
- ret = pkgmgr_pkginfo_get_version(handle, &pkg_version);
+ ret = pkgmgrinfo_pkginfo_get_version(handle, &pkg_version);
if(ret < 0) {
- printf("pkgmgr_pkginfo_get_version() failed\n");
+ printf("pkgmgrinfo_pkginfo_get_version() failed\n");
}
- ret = pkgmgr_pkginfo_is_preload(handle, &preload);
+ ret = pkgmgrinfo_pkginfo_is_preload(handle, &preload);
if(ret < 0) {
- printf("pkgmgr_pkginfo_is_preload() failed\n");
+ printf("pkgmgrinfo_pkginfo_is_preload() failed\n");
}
- ret = pkgmgr_pkginfo_get_installed_time(handle, &installed_time);
+ ret = pkgmgrinfo_pkginfo_get_installed_time(handle, &installed_time);
if(ret < 0) {
- printf("pkgmgr_pkginfo_get_installed_time() failed\n");
+ printf("pkgmgrinfo_pkginfo_get_installed_time() failed\n");
}
if (uid_info->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_info->uid);
+ ret = pkgmgrinfo_appinfo_get_usr_list(handle, PMINFO_UI_APP, app_func, (void *)test_data, uid_info->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_info->uid);
+ ret = pkgmgrinfo_appinfo_get_usr_list(handle, PMINFO_SVC_APP, app_func, (void *)test_data, uid_info->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);
+ ret = pkgmgrinfo_appinfo_get_list(handle, PMINFO_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);
+ ret = pkgmgrinfo_appinfo_get_list(handle, PMINFO_SVC_APP, app_func, (void *)test_data);
if (ret < 0) {
printf("pkgmgr_get_info_app() failed\n");
}
{
int ret = -1;
if (uid != GLOBAL_USER)
- ret = pkgmgr_pkginfo_get_usr_list(__pkg_list_cb, NULL, uid);
+ ret = pkgmgrinfo_pkginfo_get_usr_list(__pkg_list_cb, NULL, uid);
else
- ret = pkgmgr_pkginfo_get_list(__pkg_list_cb, NULL);
+ ret = pkgmgrinfo_pkginfo_get_list(__pkg_list_cb, NULL);
if (ret < 0) {
- printf("pkgmgr_pkginfo_get_list() failed\n");
+ printf("pkgmgrinfo_pkginfo_get_list() failed\n");
return -1;
}
return 0;
static int __get_app_category_list(char *appid)
{
int ret = -1;
- pkgmgr_appinfo_h handle;
+ pkgmgrinfo_appinfo_h handle;
ret = pkgmgrinfo_appinfo_get_usr_appinfo(appid, getuid(), &handle);
if (ret < 0) {
printf("Failed to get handle\n");
return -1;
}
- ret = pkgmgr_appinfo_foreach_category(handle, __app_category_list_cb, NULL);
+ ret = pkgmgrinfo_appinfo_foreach_category(handle, __app_category_list_cb, NULL);
if (ret < 0) {
- printf("pkgmgr_appinfo_foreach_category() failed\n");
- pkgmgr_appinfo_destroy_appinfo(handle);
+ printf("pkgmgrinfo_appinfo_foreach_category() failed\n");
+ pkgmgrinfo_appinfo_destroy_appinfo(handle);
return -1;
}
- pkgmgr_appinfo_destroy_appinfo(handle);
+ pkgmgrinfo_appinfo_destroy_appinfo(handle);
return 0;
}
static int __get_app_metadata_list(char *appid)
{
int ret = -1;
- pkgmgr_appinfo_h handle;
+ pkgmgrinfo_appinfo_h handle;
ret = pkgmgrinfo_appinfo_get_usr_appinfo(appid, getuid(), &handle);
if (ret < 0) {
printf("Failed to get handle\n");
ret = pkgmgrinfo_appinfo_foreach_metadata(handle, __app_metadata_list_cb, NULL);
if (ret < 0) {
printf("pkgmgrinfo_appinfo_foreach_metadata() failed\n");
- pkgmgr_appinfo_destroy_appinfo(handle);
+ pkgmgrinfo_appinfo_destroy_appinfo(handle);
return -1;
}
- pkgmgr_appinfo_destroy_appinfo(handle);
+ pkgmgrinfo_appinfo_destroy_appinfo(handle);
return 0;
}
static int __get_app_control_list(char *appid)
{
int ret = -1;
- pkgmgr_appinfo_h handle;
+ pkgmgrinfo_appinfo_h handle;
ret = pkgmgrinfo_appinfo_get_usr_appinfo(appid, getuid(), &handle);
if (ret < 0) {
printf("Failed to get handle\n");
ret = pkgmgrinfo_appinfo_foreach_appcontrol(handle, __app_control_list_cb, NULL);
if (ret < 0) {
printf("pkgmgrinfo_appinfo_foreach_appcontrol() failed\n");
- pkgmgr_appinfo_destroy_appinfo(handle);
+ pkgmgrinfo_appinfo_destroy_appinfo(handle);
return -1;
}
- pkgmgr_appinfo_destroy_appinfo(handle);
+ pkgmgrinfo_appinfo_destroy_appinfo(handle);
return 0;
}
static int __get_app_list(char *pkgid, uid_t uid)
{
- pkgmgr_pkginfo_h handle;
+ pkgmgrinfo_pkginfo_h handle;
int ret = -1;
char *test_data = "test data";
if(uid != GLOBAL_USER)
- ret = pkgmgr_pkginfo_get_usr_pkginfo(pkgid, uid, &handle);
+ ret = pkgmgrinfo_pkginfo_get_usr_pkginfo(pkgid, uid, &handle);
else
- ret = pkgmgr_pkginfo_get_pkginfo(pkgid, &handle);
+ ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
if (ret < 0) {
printf("Failed to get handle\n");
return -1;
}
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);
+ ret = pkgmgrinfo_appinfo_get_usr_list(handle, PMINFO_UI_APP, app_func, (void *)test_data, uid);
if (ret < 0) {
- printf("pkgmgr_appinfo_get_list() failed\n");
+ printf("pkgmgrinfo_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);
+ ret = pkgmgrinfo_appinfo_get_usr_list(handle, PMINFO_SVC_APP, app_func, (void *)test_data, uid);
if (ret < 0) {
- printf("pkgmgr_appinfo_get_list() failed\n");
+ printf("pkgmgrinfo_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);
+ ret = pkgmgrinfo_appinfo_get_list(handle, PMINFO_UI_APP, app_func, (void *)test_data);
if (ret < 0) {
- printf("pkgmgr_appinfo_get_list() failed\n");
+ printf("pkgmgrinfo_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);
+ ret = pkgmgrinfo_appinfo_get_list(handle, PMINFO_SVC_APP, app_func, (void *)test_data);
if (ret < 0) {
- printf("pkgmgr_appinfo_get_list() failed\n");
+ printf("pkgmgrinfo_appinfo_get_list() failed\n");
}
}
- pkgmgr_pkginfo_destroy_pkginfo(handle);
+ pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
return 0;
}
char *icon = NULL;
char *label = NULL;
char *package = NULL;
- pkgmgr_app_component component = 0;
+ pkgmgrinfo_app_component component = 0;
bool nodisplay = 0;
bool multiple = 0;
bool taskmanage = 0;
- pkgmgr_hwacceleration_type hwacceleration;
+ pkgmgrinfo_app_hwacceleration hwacceleration;
pkgmgrinfo_app_screenreader screenreader;
bool onboot = 0;
bool autorestart = 0;
bool enabled = 0;
bool preload = 0;
- pkgmgr_appinfo_h handle;
+ pkgmgrinfo_appinfo_h handle;
int ret = -1;
ret = pkgmgrinfo_appinfo_get_usr_appinfo(appid, getuid(), &handle);
return -1;
}
- ret = pkgmgr_appinfo_get_pkgid(handle, &package);
+ ret = pkgmgrinfo_appinfo_get_pkgid(handle, &package);
if (ret < 0) {
printf("Failed to get package\n");
}
- ret = pkgmgr_appinfo_get_appid(handle, &app_id);
+ ret = pkgmgrinfo_appinfo_get_appid(handle, &app_id);
if (ret < 0) {
printf("Failed to get exec\n");
}
- ret = pkgmgr_appinfo_get_label(handle, &label);
+ ret = pkgmgrinfo_appinfo_get_label(handle, &label);
if (ret < 0) {
printf("Failed to get label\n");
}
- ret = pkgmgr_appinfo_get_icon(handle, &icon);
+ ret = pkgmgrinfo_appinfo_get_icon(handle, &icon);
if (ret < 0) {
printf("Failed to get icon\n");
}
- ret = pkgmgr_appinfo_get_exec(handle, &exec);
+ ret = pkgmgrinfo_appinfo_get_exec(handle, &exec);
if (ret < 0) {
printf("Failed to get exec\n");
}
- ret = pkgmgr_appinfo_get_component(handle, &component);
+ ret = pkgmgrinfo_appinfo_get_component(handle, &component);
if (ret < 0) {
printf("Failed to get component\n");
}
- ret = pkgmgr_appinfo_get_apptype(handle, &apptype);
+ ret = pkgmgrinfo_appinfo_get_apptype(handle, &apptype);
if (ret < 0) {
printf("Failed to get apptype\n");
}
- ret = pkgmgr_appinfo_is_nodisplay(handle, &nodisplay);
+ ret = pkgmgrinfo_appinfo_is_nodisplay(handle, &nodisplay);
if (ret < 0) {
printf("Failed to get nodisplay\n");
}
- ret = pkgmgr_appinfo_is_multiple(handle, &multiple);
+ ret = pkgmgrinfo_appinfo_is_multiple(handle, &multiple);
if (ret < 0) {
printf("Failed to get multiple\n");
}
- ret = pkgmgr_appinfo_is_taskmanage(handle, &taskmanage);
+ ret = pkgmgrinfo_appinfo_is_taskmanage(handle, &taskmanage);
if (ret < 0) {
printf("Failed to get taskmanage\n");
}
- ret = pkgmgr_appinfo_get_hwacceleration(handle, &hwacceleration);
+ ret = pkgmgrinfo_appinfo_get_hwacceleration(handle, &hwacceleration);
if (ret < 0) {
printf("Failed to get hwacceleration\n");
}
if (ret < 0) {
printf("Failed to get screenreader\n");
}
- ret = pkgmgr_appinfo_is_onboot(handle, &onboot);
+ ret = pkgmgrinfo_appinfo_is_onboot(handle, &onboot);
if (ret < 0) {
printf("Failed to get onboot\n");
}
- ret = pkgmgr_appinfo_is_autorestart(handle, &autorestart);
+ ret = pkgmgrinfo_appinfo_is_autorestart(handle, &autorestart);
if (ret < 0) {
printf("Failed to get autorestart\n");
}
if (apptype)
printf("Apptype: %s\n", apptype);
- if (component == PM_UI_APP) {
+ if (component == PMINFO_UI_APP) {
printf("component: uiapp\n");
if (icon)
printf("Taskmanage: %d\n", taskmanage);
printf("Hw-Acceleration: %d\n", hwacceleration);
printf("Screenreader: %d\n", screenreader);
- } else if (component == PM_SVC_APP) {
+ } else if (component == PMINFO_SVC_APP) {
printf("component: svcapp\n");
if (icon)
printf("Enabled: %d\n", enabled);
printf("Preload: %d\n", preload);
- pkgmgr_appinfo_destroy_appinfo(handle);
+ pkgmgrinfo_appinfo_destroy_appinfo(handle);
return 0;
}
printf("remove from db failed\n");
goto end;
}
- } else if (strcmp(argv[1], "--setdb") == 0) {
- ret = __set_pkginfo_in_db(argv[2], getuid());
- if (ret == -1) {
- printf("set pkginfo in db failed\n");
- goto end;
- }
} else if (strcmp(argv[1], "--setcert") == 0) {
ret = __set_certinfo_in_db(argv[2], getuid());
if (ret == -1) {