#define AUL_K_RUA_PKGNAME "__K_RUA_PKGNAME"
/** AUL public key - To support rua delete */
#define AUL_K_RUA_APPPATH "__K_RUA_APPPATH"
-
+/** AUL public key - To support rua add */
+#define AUL_K_RUA_ARG "__K_RUA_ARG"
+/** AUL public key - To support rua add */
+#define AUL_K_RUA_TIME "__K_RUA_TIME"
/** AUL internal private key */
/**
* @par Description:
- * This function delete rua history.
+ * This function update rua stat.
*
- * @param[in] b Bundle object Target Package name or app path. If NULL or has no value, delete all rua history.
+ * @param[in] b Bundle object contains caller and tag information.
+ * @param[in] uid Target uid
+ *
+ * @return 0 if success, negative value(<0) if fail
+ * @see None
+ * @remarks This API is only for Appfw internally.
+ *
+ * @par Sample code:
+ * @code
+#include <aul.h>
+
+...
+{
+ int r;
+ bundle *b = bundle_create();
+ bundle_add_str(b, AUL_SVC_K_RUA_STAT_CALLER, caller);
+ bundle_add_str(b, AUL_SVC_K_RUA_STAT_TAG, tag);
+
+ r = aul_update_rua_stat_for_uid(b);
+}
+
+ * @endcode
+ **/
+int aul_update_rua_stat_for_uid(bundle *b, uid_t uid);
+
+/**
+ * @par Description:
+ * This function add rua history.
+ *
+ * @param[in] b Bundle object Target Package name or app path.
+ * @param[in] uid Target uid
*
* @return 0 if success, negative value(<0) if fail
* @see None
int r;
bundle *b = bundle_create();
if (pkg_name)
- bundle_add_str(b, AUL_K_RUA_PKGNAME, pkg_name);
+ bundle_add_str(b, AUL_K_RUA_PKGNAME, pkg_name);
else if (app_path)
- bundle_add_str(b, AUL_K_RUA_APPPATH, app_path);
+ bundle_add_str(b, AUL_K_RUA_APPPATH, app_path);
+
+ r = aul_add_rua_history_for_uid(b);
+}
+
+ * @endcode
+ **/
+int aul_add_rua_history_for_uid(bundle *b, uid_t uid);
+
+/**
+ * @par Description:
+ * This function delete rua history.
+ *
+ * @param[in] b Bundle object Target Package name. If NULL or has no value, delete all rua history.
+ * @param[in] uid Target uid
+ *
+ * @return 0 if success, negative value(<0) if fail
+ * @see None
+ * @remarks This API is only for Appfw internally.
+ *
+ * @par Sample code:
+ * @code
+#include <aul.h>
- r = aul_delete_rua_history(b);
+...
+{
+ int r;
+ bundle *b = NULL;
+ if (pkg_name) {
+ b = bundle_create();
+ bundle_add_str(b, AUL_K_RUA_PKGNAME, pkg_name);
+ }
+ r = aul_delete_rua_history_for_uid(b, getuid());
}
* @endcode
**/
-int aul_delete_rua_history(bundle *b);
+int aul_delete_rua_history_for_uid(bundle *b, uid_t uid);
/**
return aul_app_get_pkgid_bypid_for_uid(pid, pkgid, len, getuid());
}
-API int aul_delete_rua_history(bundle *b)
+API int aul_update_rua_stat_for_uid(bundle *b, uid_t uid)
+{
+ int ret;
+
+ ret = aul_sock_send_bundle(AUL_UTIL_PID, uid,
+ APP_UPDATE_RUA_STAT, b, AUL_SOCK_NONE);
+ return ret;
+}
+
+API int aul_add_rua_history_for_uid(bundle *b, uid_t uid)
+{
+ int ret;
+
+ if (b == NULL) {
+ SECURE_LOGE("invalid param");
+ return AUL_R_EINVAL;
+ }
+ ret = aul_sock_send_bundle(AUL_UTIL_PID, uid,
+ APP_ADD_HISTORY, b, AUL_SOCK_NONE);
+ return ret;
+}
+
+API int aul_delete_rua_history_for_uid(bundle *b, uid_t uid)
{
int ret;
bundle_raw *br = NULL;
if (b != NULL)
bundle_encode(b, &br, &datalen);
- ret = aul_sock_send_raw(AUL_UTIL_PID, getuid(),
+ ret = aul_sock_send_raw(AUL_UTIL_PID, uid,
APP_REMOVE_HISTORY, br, datalen, AUL_SOCK_NONE);
if (br != NULL)