/**
* @mainpage
- *
+ *
* This is package manager
*
* Packaeg manager is used to install/uninstall the packages.\n
* package includes dpkg, java, widget, etc. and it can be added\n
* Security is considered on current package manager\n
- *
+ *
*/
/**
*/
/**
- * @brief pkgmgr info types.
+ * @brief pkgmgr info types.
*/
#define PKGMGR_INFO_STR_PKGTYPE "pkg_type"
#define PKGMGR_INFO_STR_PKGNAME "pkg_name"
#define PKG_SIZE_INFO_TOTAL "__TOTAL__"
#define PKG_CLEAR_ALL_CACHE "__ALL__"
/**
- * @brief Return values in pkgmgr.
+ * @brief Return values in pkgmgr.
*/
typedef enum _pkgmgr_return_val {
PKGMGR_R_ESYSTEM = -9, /**< Severe system error */
* @defgroup pkg_operate APIs to install /uninstall / activate application
* @ingroup pkgmgr
* @brief
- * APIs to install /uninstall / activate application
+ * APIs to install /uninstall / activate application
* - Install application using application package filepath
* - Uninstall application using application package name
* - Activate application using application package name
* @brief This API creates pkgmgr client.
*
* This API is for package-manager client application.\n
- *
- * @param[in] ctype client type - PC_REQUEST, PC_LISTENING, PC_BROADCAST
+ *
+ * @param[in] ctype client type - PC_REQUEST, PC_LISTENING, PC_BROADCAST
* @return pkgmgr_client object
* @retval NULL on failure creating an object
*/
* @brief This API deletes pkgmgr client.
*
* This API is for package-manager client application.\n
- *
+ *
* @param[in] pc pkgmgr_client
* @return Operation result;
* @retval PKGMGR_R_OK success
* @brief This API installs package.
*
* This API is for package-manager client application.\n
- *
- * @param[in] pc pkgmgr_client
- * @param[in] pkg_type package type
+ *
+ * @param[in] pc pkgmgr_client
+ * @param[in] pkg_type package type
* @param[in] descriptor_path full path that descriptor is located
* @param[in] pkg_path full path that package file is located
* @param[in] optional_file optional file which is used for installation
* @brief This API uninstalls package.
*
* This API is for package-manager client application.\n
- *
- * @param[in] pc pkgmgr_client
- * @param[in] pkg_type package type
+ *
+ * @param[in] pc pkgmgr_client
+ * @param[in] pkg_type package type
* @param[in] pkgid package id
* @param[in] mode installation mode - PM_DEFAULT, PM_QUIET
* @param[in] event_cb user callback
int pkgmgr_client_usr_uninstall(pkgmgr_client *pc, const char *pkg_type,
const char *pkgid, pkgmgr_mode mode,
pkgmgr_handler event_cb, void *data, uid_t uid);
-
+
/**
* @brief This API moves installed package to SD card or vice versa.
*
* @brief This API activates package.
*
* This API is for package-manager client application.\n
- *
- * @param[in] pc pkgmgr_client
- * @param[in] pkg_type package type
+ *
+ * @param[in] pc pkgmgr_client
+ * @param[in] pkg_type package type
* @param[in] pkgid package id
* @return request_id (>0) if success, error code(<0) if fail\n
* @retval PKGMGR_R_OK success
* @brief This API deactivates package.
*
* This API is for package-manager client application.\n
- *
- * @param[in] pc pkgmgr_client
- * @param[in] pkg_type package type
+ *
+ * @param[in] pc pkgmgr_client
+ * @param[in] pkg_type package type
* @param[in] pkgid package id
* @return request_id (>0) if success, error code(<0) if fail\n
* @retval PKGMGR_R_OK success
*/
int pkgmgr_client_deactivate_app(pkgmgr_client *pc, const char *appid);
int pkgmgr_client_usr_deactivate_app(pkgmgr_client *pc, const char *appid, uid_t uid);
+
+/**
+ * @brief This API deactivates global app for user specified by uid.
+ *
+ * This API is for package-manager client application.\n
+ *
+ * @param[in] pc pkgmgr_client
+ * @param[in] appid applicaiton id
+ * @param[in] uid user id
+ * @return request_id (>0) if success, error code(<0) if fail\n
+ * @retval PKGMGR_R_OK success
+ * @retval PKGMGR_R_EINVAL invalid argument
+ * @retval PKGMGR_R_ECOMM communication error
+*/
+int pkgmgr_client_usr_deactivate_global_app(pkgmgr_client *pc, const char *appid, uid_t uid);
+
+/**
+ * @brief This API deactivates global app for user specified by uid.
+ *
+ * This API is for package-manager client application.\n
+ *
+ * @param[in] pc pkgmgr_client
+ * @param[in] appid applicaiton id
+ * @param[in] uid user id
+ * @return request_id (>0) if success, error code(<0) if fail\n
+ * @retval PKGMGR_R_OK success
+ * @retval PKGMGR_R_EINVAL invalid argument
+ * @retval PKGMGR_R_ECOMM communication error
+*/
+int pkgmgr_client_usr_activate_global_app(pkgmgr_client *pc, const char *appid, uid_t uid);
+
/**
* @brief This API deletes application's private data.
*
* @brief This API request to listen the pkgmgr's broadcasting
*
* This API is for package-manager client application.\n
- *
- * @param[in] pc pkgmgr_client
+ *
+ * @param[in] pc pkgmgr_client
* @param[in] event_cb user callback
* @param[in] data user data
* @return request_id (>0) if success, error code(<0) if fail\n
* @brief This API broadcasts pkgmgr's status
*
* This API is for package-manager client application.\n
- *
- * @param[in] pc pkgmgr_client
- * @param[in] pkg_type package type
+ *
+ * @param[in] pc pkgmgr_client
+ * @param[in] pkg_type package type
* @param[in] pkgid package id
* @param[in] key key to broadcast
* @param[in] val value to broadcast
return pkgmgr_client_usr_deactivate_app(pc, appid, GLOBAL_USER);
}
+API int pkgmgr_client_usr_deactivate_global_app(pkgmgr_client *pc,
+ const char *appid, uid_t uid)
+{
+ GVariant *result;
+ int ret = PKGMGR_R_ECOMM;
+ pkgmgr_client_t *mpc = (pkgmgr_client_t *)pc;
+
+ if (pc == NULL || appid == NULL) {
+ ERR("invalid parameter");
+ return PKGMGR_R_EINVAL;
+ }
+
+ result = comm_client_request(mpc->info.request.cc, "disable_global_app",
+ g_variant_new("(us)", uid, appid));
+ if (result == NULL)
+ return PKGMGR_R_ECOMM;
+ g_variant_get(result, "(i)", &ret);
+ g_variant_unref(result);
+
+ return ret;
+}
+
+API int pkgmgr_client_usr_activate_global_app(pkgmgr_client *pc,
+ const char *appid, uid_t uid)
+{
+ GVariant *result;
+ int ret = PKGMGR_R_ECOMM;
+ pkgmgr_client_t *mpc = (pkgmgr_client_t *)pc;
+
+ if (pc == NULL || appid == NULL) {
+ ERR("invalid parameter");
+ return PKGMGR_R_EINVAL;
+ }
+
+ result = comm_client_request(mpc->info.request.cc, "enable_global_app",
+ g_variant_new("(us)", uid, appid));
+ if (result == NULL)
+ return PKGMGR_R_ECOMM;
+ g_variant_get(result, "(i)", &ret);
+ g_variant_unref(result);
+
+ return ret;
+}
+
API int pkgmgr_client_usr_clear_user_data(pkgmgr_client *pc,
const char *pkg_type, const char *appid, pkgmgr_mode mode,
uid_t uid)