int pkgmgr_client_set_debug_mode(pkgmgr_client *pc, bool debug_mode);
/**
+ * @brief Set skip optimization
+ *
+ * This API sets skip optimization value for request.\n
+ *
+ * @param[in] pc The pointer to pkgmgr_client instance
+ * @param[in] skip_optimization indicates the request is skip optimization 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_skip_optimization(pkgmgr_client *pc, bool skip_optimization);
+
+/**
* @brief Migrate legacy external image which is generated under 3.0
*
* This API request the migration of external image.\n
}
if (client->debug_mode)
g_variant_builder_add(builder, "s", "-G");
+ if (client->skip_optimization)
+ g_variant_builder_add(builder, "s", "-S");
args = g_variant_new("as", builder);
g_variant_builder_unref(builder);
return PKGMGR_R_OK;
}
+API int pkgmgr_client_set_skip_optimization(pkgmgr_client *pc, bool skip_optimization)
+{
+ struct pkgmgr_client_t *client = (struct pkgmgr_client_t *)pc;
+
+ if (pc == NULL) {
+ ERR("invalid parameter");
+ return PKGMGR_R_EINVAL;
+ }
+
+ client->skip_optimization = skip_optimization;
+
+ return PKGMGR_R_OK;
+}
+
API int pkgmgr_client_usr_migrate_external_image(pkgmgr_client *pc,
const char *pkgid, uid_t uid)
{
#define OPTVAL_RECOVER_DB 1008
/* 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:qG";
+const char *short_opts = "k:l:i:d:c:m:t:o:r:p:s:b:e:M:y:u:w:D:A:qGS";
const struct option long_opts[] = {
{ "session-id", 1, NULL, 'k' },
{ "license-path", 1, NULL, 'l' },
{ "mount-install", 1, NULL, 'w' },
{ "recovery", 1, NULL, 'b' },
{ "debug-mode", 0, NULL, 'G' },
+ { "skip-optimization", 0, NULL, 'S' },
{ "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 partial_rw;
int debug_mode;
int skip_check_reference;
+ int skip_optimization;
GDBusConnection *conn;
};
static uid_t g_target_uid;
static int g_debug_mode;
+static int g_skip_optimization;
static pkgmgr_privilege_level g_privilege_level = PM_PRIVILEGE_UNKNOWN;
static const char *__get_signal_name(pkgmgr_installer *pi, const char *key,
pi->target_uid = getuid();
g_target_uid = pi->target_uid;
g_debug_mode = 0;
+ g_skip_optimization = 0;
while (1) {
c = getopt_long(argc, argv, short_opts, long_opts, &opt_idx);
/* printf("c=%d %c\n", c, c); //debug */
g_debug_mode = 1;
break;
+ case 'S': /* skip optimization */
+ pi->skip_optimization = 1;
+ g_skip_optimization = 1;
+ break;
+
/* Otherwise */
case '?': /* Not an option */
break;
return pi->skip_check_reference;
}
+API int pkgmgr_installer_get_skip_optimization(pkgmgr_installer *pi)
+{
+ CHK_PI_RET(PKGMGR_REQ_INVALID);
+ return pi->skip_optimization;
+}
+
API int pkgmgr_installer_send_app_uninstall_signal(pkgmgr_installer *pi,
const char *pkg_type,
const char *pkgid,
return 0;
}
+API int pkgmgr_installer_info_get_skip_optimization(int *skip_optimization)
+{
+ *skip_optimization = g_skip_optimization;
+ return 0;
+}
+
#define CASE_TO_STR(ERRCODE) case ERRCODE: return ERRCODE##_STR
API const char *pkgmgr_installer_error_to_string(int error_code)
{
int pkgmgr_installer_get_skip_check_reference(pkgmgr_installer *pi);
/**
+ @brief Get skip optimization 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 skip_optimization = 0;
+
+ pi = pkgmgr_installer_new();
+ if(!pi) return -1;
+ if(pkgmgr_installer_receive_request(pi, argc, argv)) {
+ r = -1;
+ goto CLEANUP_RET;
+ }
+ skip_optimization = pkgmgr_installer_get_skip_optimization(pi);
+
+ // Do something...
+
+ pkgmgr_installer_free(pi);
+ return r;
+}
+ @endcode
+*/
+int pkgmgr_installer_get_skip_optimization(pkgmgr_installer *pi);
+
+/**
@brief Send a app status signal
@pre None
@post None
*/
int pkgmgr_installer_info_get_debug_mode(int *debug_mode);
+/**
+ * @brief Get skip optimization flag
+ * @pre None
+ * @post None
+ * @param[out] int skip_optimization
+ * @return 0 if success, else retrun < 0
+ * @code
+ #include <pkgmgr_installer_info.h>
+ int main()
+ {
+ int skip_optimization;
+ if (pkgmgr_installer_info_get_skip_optimization(&skip_optimization) < 0) {
+ printf("failed to get skip optimization\n");
+ }
+ if (skip_optimization)) {
+ printf("skip optimization is enabled");
+ }
+ }
+ * @endcode
+ */
+int pkgmgr_installer_info_get_skip_optimization(int *skip_optimization);
+
#ifdef __cplusplus
}
#endif