int pkgmgr_client_get_pkg_restriction_mode(pkgmgr_client *pc, const char *pkgid, int *mode);
int pkgmgr_client_usr_get_pkg_restriction_mode(pkgmgr_client *pc, const char *pkgid, int *mode, uid_t uid);
+/**
+ * @brief Change application's label
+ *
+ * This API sets label of application specified.\n
+ *
+ * @param[in] pc The pointer to pkgmgr_client instance
+ * @param[in] appid app id to be changed.
+ * @param[in] label application's label to change.
+ * @param[out] mode restriction mode bit
+ * @return 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_set_app_label(pkgmgr_client *pc, char *appid, char *label);
+int pkgmgr_client_usr_set_app_label(pkgmgr_client *pc, char *appid, char *label, uid_t uid);
/** @} */
return PKGMGR_R_OK;
}
+
+API int pkgmgr_client_usr_set_app_label(pkgmgr_client *pc, char *appid,
+ char *label, uid_t uid)
+{
+ GVariant *result;
+ int ret = -1;
+ struct pkgmgr_client_t *client = (struct pkgmgr_client_t *)pc;
+
+ if (pc == NULL || appid == NULL || label == NULL) {
+ ERR("Invalid parameter");
+ return PKGMGR_R_EINVAL;
+ }
+
+ ret = pkgmgr_client_connection_send_request(client,
+ "set_app_label",
+ g_variant_new("(uss)", uid, appid, label), &result);
+ if (ret != PKGMGR_R_OK) {
+ ERR("Request failed: %d", ret);
+ return ret;
+ }
+
+ g_variant_get(result, "(i)", &ret);
+ g_variant_unref(result);
+
+ return ret;
+}
+
+API int pkgmgr_client_set_app_label(pkgmgr_client *pc, char *appid, char *label)
+{
+ return pkgmgr_client_usr_set_app_label(pc, appid, label, _getuid());
+}