for (auto& conn : conn_list) {
ret = execute_write_queries(conn.first, queries, query_.size());
- // TODO: error check?
+ if (ret != PMINFO_R_OK) {
+ _LOGE("Failed to execute");
+ break;
+ }
}
free(queries);
return ret;
#include "cert_set_db_handler.hh"
#include "parcelable_factory.hh"
+#include "pkgmgrinfo_debug.h"
+
namespace pcp = pkgmgr_common::parcel;
namespace pcd = pkgmgr_common::database;
if (abstract_parcel == nullptr ||
abstract_parcel->GetType() != pcp::ParcelableType::CertInfo) {
- // TODO: need to set result
+ _LOGE("Invalid parcel");
+ result_ = std::make_shared<pcp::ResultParcelable>(
+ PMINFO_R_ERROR, std::vector<std::vector<std::string>>{});
return false;
}
auto* parcel = dynamic_cast<pcp::CertInfoParcelable*>(abstract_parcel.get());
if (parcel == nullptr) {
- // TODO: need to set result
+ _LOGE("Parcel is empty");
+ result_ = std::make_shared<pcp::ResultParcelable>(
+ PMINFO_R_ERROR, std::vector<std::vector<std::string>>{});
return false;
}
int ret = db.Execute();
result_ = std::make_shared<pcp::ResultParcelable>(
ret, std::vector<std::vector<std::string>>{});
- // TODO: need to set result
return true;
}
ptr));
auto result_list = return_parcel->ExtractPkgInfo();
- // TODO: check noentry error has returned if size of result_list is 0
+ if (result_list.size() == 0) {
+ LOG(DEBUG) << "No packages meets given condition for user " << uid;
+ return PMINFO_R_ENOENT;
+ }
for (auto &pkginfo : result_list)
g_hash_table_insert(packages, (gpointer)pkginfo->package,
(gpointer)pkginfo);
if (list == NULL)
return PMINFO_R_ERROR;
- // TODO: need to use pkginfo-client APIs
ret = _appinfo_get_applications(uid, uid, filter,
PMINFO_APPINFO_GET_ALL, list);
if (ret != PMINFO_R_OK) {
}
}
- // TODO: use pkginfo-client APIs
*count = g_hash_table_size(list);
g_hash_table_destroy(list);
extern "C" {
#endif
-// TODO: should we get sqlite handle as parameter??
int pkginfo_internal_filter_get_list(sqlite3 *db, pkgmgrinfo_pkginfo_filter_h filter, uid_t uid, const char *locale, GHashTable *list);
int appinfo_internal_filter_get_list(sqlite3 *db, pkgmgrinfo_appinfo_filter_h filter, uid_t uid, const char *locale, GHashTable *list);
int certinfo_internal_get(sqlite3 *db, const char *pkgid, uid_t uid, pkgmgrinfo_certinfo_h certinfo);
pkgmgrinfo_basic_free_dependency(dep);
}
-// TODO: need to change this
API int pkgmgrinfo_pkginfo_foreach_depends_on(pkgmgrinfo_pkginfo_h handle,
pkgmgrinfo_pkg_dependency_list_cb dependency_cb,
void *user_data)