int pkgmgr_parser_update_app_label_info_in_usr_db(const char *appid, uid_t uid, const char *label);
/**
+ * @fn int pkgmgr_parser_update_app_icon_info_in_db(const char *appid, const char *icon_path)
+ * @brief This API updates icon info of application
+ *
+ * @par This API is only for internal usage
+ * @par Sync (or) Async : Synchronous API
+ *
+ * @param[in] appid application ID to change label
+ * @param[in] icon_path icon path to change
+ * @return 0 if success, error code(<0) if fail
+ */
+int pkgmgr_parser_update_app_icon_info_in_db(const char *appid, const char *icon_path);
+
+/**
+ * @fn int pkgmgr_parser_update_app_icon_info_in_usr_db(const char *appid, uid_t uid, const char *icon_path)
+ * @brief This API updates icon info of application for user specified by uid
+ *
+ * @par This API is only for internal usage
+ * @par Sync (or) Async : Synchronous API
+ *
+ * @param[in] appid application ID to change label
+ * @param[in] uid user ID
+ * @param[in] icon_path icon path to change
+ * @return 0 if success, error code(<0) if fail
+ */
+int pkgmgr_parser_update_app_icon_info_in_usr_db(const char *appid, uid_t uid, const char *icon_path);
+
+/**
* @fn int pkgmgr_parser_register_pkg_update_info_in_usr_db(pkgmgrinfo_updateinfo_h handle, uid_t uid)
* @brief This API registers update informations of given packages for user specified by uid
*
label);
}
+static int __set_app_icon(sqlite3 *db, const char *appid, const char *icon_path)
+{
+ static const char query[] =
+ "UPDATE package_app_localized_info SET app_icon=? "
+ "WHERE app_id=? AND app_icon IS NOT NULL";
+ int ret;
+ sqlite3_stmt *stmt;
+ int idx = 1;
+
+ ret = sqlite3_prepare_v2(db, query, strlen(query), &stmt, NULL);
+ if (ret != SQLITE_OK) {
+ _LOGE("prepare failed: %s", sqlite3_errmsg(db));
+ return -1;
+ }
+
+ __BIND_TEXT(db, stmt, idx++, icon_path);
+ __BIND_TEXT(db, stmt, idx++, appid);
+
+ ret = sqlite3_step(stmt);
+ if (ret != SQLITE_DONE) {
+ _LOGE("step failed: %s", sqlite3_errmsg(db));
+ sqlite3_finalize(stmt);
+ return -1;
+ }
+
+ sqlite3_finalize(stmt);
+
+ return 0;
+}
+
+API int pkgmgr_parser_update_app_icon_info_in_usr_db(const char *appid,
+ uid_t uid, const char *icon_path)
+{
+ int ret;
+ const char *dbpath;
+ sqlite3 *db;
+
+ if (appid == NULL) {
+ _LOGE("invalid parameter");
+ return PM_PARSER_R_EINVAL;
+ }
+
+ dbpath = __get_parser_db_path(uid);
+
+ ret = __open_db(uid, dbpath, &db, SQLITE_OPEN_READWRITE);
+ if (ret != SQLITE_OK) {
+ _LOGE("open db failed: %d", ret);
+ return PM_PARSER_R_ERROR;
+ }
+
+ __BEGIN_TRANSACTION(db);
+ __DO_TRANSACTION(db, __set_app_icon(db, appid, icon_path));
+ __END_TRANSACTION(db);
+
+ sqlite3_close_v2(db);
+
+ return PM_PARSER_R_OK;
+}
+
+API int pkgmgr_parser_update_app_icon_info_in_db(const char *appid,
+ const char *icon_path)
+{
+ return pkgmgr_parser_update_app_icon_info_in_usr_db(appid, __getuid(),
+ icon_path);
+}
+
static int __set_tep_path(sqlite3 *db, const char *pkgid, const char *tep_path)
{
static const char query[] =