#define OPTVAL_FORCE_REMOVAL 1001
#define OPTVAL_PRELOAD_RW 1002
#define OPTVAL_NO_REMOVAL 1003
+#define OPTVAL_KEEP_RWDATA 1004
+#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";
{ "direct-manifest-install", 1, NULL, 'y' },
{ "mount-install", 1, NULL, 'w' },
{ "recovery", 1, NULL, 'b' },
- { "preload", 0, NULL, OPTVAL_PRELOAD },
- { "force-remove", 0, NULL, OPTVAL_FORCE_REMOVAL },
- { "preload-rw", 0, NULL, OPTVAL_PRELOAD_RW },
- { "no-remove", 0, NULL, OPTVAL_NO_REMOVAL },
+ { "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 */
+ { "no-remove", 0, NULL, OPTVAL_NO_REMOVAL }, /* for preload RW */
+ { "keep-rwdata", 0, NULL, OPTVAL_KEEP_RWDATA }, /* for preload RW */
+ { "partial-rw", 0, NULL, OPTVAL_PARTIAL_RW }, /* for preload RO */
{ 0, 0, 0, 0 } /* sentinel */
};
int force_removal;
int is_preload_rw;
int no_removal;
+ int keep_rwdata;
+ int partial_rw;
GDBusConnection *conn;
};
pi->no_removal = 1;
DBG("no-remove request [%d]", pi->no_removal);
break;
+ case OPTVAL_KEEP_RWDATA: /* request for keep-rwdata */
+ pi->keep_rwdata = 1;
+ DBG("keep-rwdata request [%d]", pi->keep_rwdata);
+ break;
+ case OPTVAL_PARTIAL_RW: /* request for partial-rw */
+ pi->partial_rw = 1;
+ DBG("partial-rw request [%d]", pi->partial_rw);
+ break;
case 'k': /* session id */
if (pi->session_id)
free(pi->session_id);
return pi->no_removal;
}
+API int pkgmgr_installer_get_keep_rwdata(pkgmgr_installer *pi)
+{
+ CHK_PI_RET(PKGMGR_REQ_INVALID);
+ return pi->keep_rwdata;
+}
+
+API int pkgmgr_installer_get_partial_rw(pkgmgr_installer *pi)
+{
+ CHK_PI_RET(PKGMGR_REQ_INVALID);
+ return pi->partial_rw;
+}
+
API int pkgmgr_installer_send_app_uninstall_signal(pkgmgr_installer *pi,
const char *pkg_type,
const char *pkgid,
int pkgmgr_installer_get_force_removal(pkgmgr_installer *pi);
int pkgmgr_installer_get_no_removal(pkgmgr_installer *pi);
+/**
+ @brief Get if the request is for keep-rwdata
+ @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 for keep-rwdata
+ @retval 1 if a request is for keep-rwdata
+ @remark Keep RW-data of updated RO pkg.
+ @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_keep_rwdata(pi);
+
+ // Do something...
+
+ pkgmgr_installer_free(pi);
+ return r;
+}
+ @endcode
+ */
+int pkgmgr_installer_get_keep_rwdata(pkgmgr_installer *pi);
+
+/**
+ @brief Get if the request is for partial-rw
+ @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 for partial-rw
+ @retval 1 if a request is for partial-rw
+ @remark For install/update/uninstall of stubs of RO pkg
+ on RW partitions
+ @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_partial_rw(pi);
+
+ // Do something...
+
+ pkgmgr_installer_free(pi);
+ return r;
+}
+ @endcode
+ */
+int pkgmgr_installer_get_partial_rw(pkgmgr_installer *pi);
+
/**
@brief Send a app status signal
@pre None