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);
+/**
+ * @brief Set debug mode
+ *
+ * This API sets debug mode value for request.\n
+ *
+ * @param[in] pc The pointer to pkgmgr_client instance
+ * @param[in] debug_mode indicates the request is debug mode or not
+ * @return 0 if success, error code(<0) if fail\n
+ * @retval PKGMGR_R_OK success
+ * @retval PKGMGR_R_EINVAL invalid argument
+ */
+int pkgmgr_client_set_debug_mode(pkgmgr_client *pc, bool debug_mode);
+
/** @} */
g_variant_builder_add(builder, "s",
client->tep_move ? "tep_move" : "tep_copy");
}
+ if (client->debug_mode)
+ g_variant_builder_add(builder, "s", "-G");
args = g_variant_new("as", builder);
g_variant_builder_unref(builder);
{
return pkgmgr_client_usr_set_app_label(pc, appid, label, _getuid());
}
+
+API int pkgmgr_client_set_debug_mode(pkgmgr_client *pc, bool debug_mode)
+{
+ struct pkgmgr_client_t *client = (struct pkgmgr_client_t *)pc;
+
+ if (pc == NULL) {
+ ERR("invalid parameter");
+ return PKGMGR_R_EINVAL;
+ }
+
+ client->debug_mode = debug_mode;
+
+ return PKGMGR_R_OK;
+}
GList *cb_info_list;
char *tep_path;
bool tep_move;
+ bool debug_mode;
};
int pkgmgr_client_connection_connect(struct pkgmgr_client_t *pc);
#define OPTVAL_PARTIAL_RW 1005
/* Supported options */
-const char *short_opts = "k:l:i:d:c:m:t:o:r:p:s:b:e:M:y:u:w:D:A:q";
+const char *short_opts = "k:l:i:d:c:m:t:o:r:p:s:b:e:M:y:u:w:D:A:qG";
const struct option long_opts[] = {
{ "session-id", 1, NULL, 'k' },
{ "license-path", 1, NULL, 'l' },
{ "direct-manifest-install", 1, NULL, 'y' },
{ "mount-install", 1, NULL, 'w' },
{ "recovery", 1, NULL, 'b' },
+ { "debug-mode", 0, NULL, 'G' },
{ "preload", 0, NULL, OPTVAL_PRELOAD }, /* for preload RO */
{ "force-remove", 0, NULL, OPTVAL_FORCE_REMOVAL }, /* for preload RO/RW */
{ "preload-rw", 0, NULL, OPTVAL_PRELOAD_RW }, /* for preload RW */
int no_removal;
int keep_rwdata;
int partial_rw;
+ int debug_mode;
GDBusConnection *conn;
};
pi->target_uid = (uid_t)atoi(optarg);
break;
+ case 'G': /* debug mode */
+ pi->debug_mode = 1;
+ break;
+
/* Otherwise */
case '?': /* Not an option */
break;
return pi->partial_rw;
}
+API int pkgmgr_installer_get_debug_mode(pkgmgr_installer *pi)
+{
+ CHK_PI_RET(PKGMGR_REQ_INVALID);
+ return pi->debug_mode;
+}
+
API int pkgmgr_installer_send_app_uninstall_signal(pkgmgr_installer *pi,
const char *pkg_type,
const char *pkgid,
int pkgmgr_installer_get_partial_rw(pkgmgr_installer *pi);
/**
+ @brief Get debug mode value
+ @pre pkgmgr_installer_receive_request() must be called.
+ @post None
+ @see pkgmgr_installer_receive_request
+ @param[in] pi pkgmgr_installer object
+ @return Operation result
+ @retval 0 if a request is not debug mode
+ @retval 1 if a request is debug mode
+ @remark None
+ @code
+#include <pkgmgr_installer.h>
+int main(int argc, char **argv)
+{
+ pkgmgr_installer *pi;
+ int r = 0;
+ int force_remove = 0;
+
+ pi = pkgmgr_installer_new();
+ if(!pi) return -1;
+ if(pkgmgr_installer_receive_request(pi, argc, argv)) {
+ r = -1;
+ goto CLEANUP_RET;
+ }
+ force_remove = pkgmgr_installer_get_debug_mode(pi);
+
+ // Do something...
+
+ pkgmgr_installer_free(pi);
+ return r;
+}
+ @endcode
+*/
+int pkgmgr_installer_get_debug_mode(pkgmgr_installer *pi);
+
+/**
@brief Send a app status signal
@pre None
@post None