char* query;
sqlite3_stmt* stmt = nullptr;
sqlite3_stmt* delete_stmt = nullptr;
- int uid = static_pointer_cast<IItemInfoInternal>(addedItem->GetInfo())->GetUid();
+ uid_t uid =
+ static_pointer_cast<IItemInfoInternal>(addedItem->GetInfo())->GetUid();
ret = GetCount(addedItem->GetSenderAppId(), uid, &count);
if (ret != ERROR_NONE || count <= NOTI_LIMIT)
(shared_ptr<item::AbstractItem> updatedItem, sqlite3* db) {
int ret;
char* query;
- int uid = static_pointer_cast<IItemInfoInternal>(updatedItem->GetInfo())->GetUid();
+ uid_t uid =
+ static_pointer_cast<IItemInfoInternal>(updatedItem->GetInfo())->GetUid();
query = sqlite3_mprintf("DELETE FROM receiver_list"
" WHERE root_id = %Q AND app_id = %Q AND uid = %d",
}
for (auto& i : addedItem) {
- int uid = static_pointer_cast<IItemInfoInternal>(i->GetInfo())->GetUid();
+ uid_t uid = static_pointer_cast<IItemInfoInternal>(i->GetInfo())->GetUid();
ret = GetCount(i->GetId(), i->GetSenderAppId(), uid, &count);
if (ret != ERROR_NONE)
break;
return hide_map;
}
-int DBManager::GetCount(const string& app_id, int uid, int* count) {
+int DBManager::GetCount(const string& app_id, uid_t uid, int* count) {
return GetCount(string(), app_id, uid, count);
}
int DBManager::GetCount(const string& root_id, const string& app_id,
- int uid, int* count) {
+ uid_t uid, int* count) {
int ret;
char* query;
sqlite3_stmt *stmt;
int DBManager::UpdateNotification(shared_ptr<item::AbstractItem> updatedItem) {
int count, ret;
char* query;
- int uid = static_pointer_cast<IItemInfoInternal>(updatedItem->GetInfo())->GetUid();
+ uid_t uid =
+ static_pointer_cast<IItemInfoInternal>(updatedItem->GetInfo())->GetUid();
- ret = GetCount(updatedItem->GetId(), updatedItem->GetSenderAppId(), uid, &count);
+ ret = GetCount(
+ updatedItem->GetId(), updatedItem->GetSenderAppId(), uid, &count);
if (ret != ERROR_NONE) {
LOGE("fail to get count");
return ret;
return item_list;
}
-list<shared_ptr<item::AbstractItem>> DBManager::GetNotificationList(string app_id, int uid) {
+list<shared_ptr<item::AbstractItem>> DBManager::GetNotificationList(
+ string app_id, uid_t uid) {
char* query;
list<shared_ptr<item::AbstractItem>> item_list;
}
list<shared_ptr<item::AbstractItem>> DBManager::GetNotificationList
- (string app_id, string root_id, int uid) {
+ (string app_id, string root_id, uid_t uid) {
char* query;
list<shared_ptr<item::AbstractItem>> item_list;
return item_list;
}
-list<shared_ptr<item::AbstractItem>> DBManager::GetNotificationList(int uid) {
+list<shared_ptr<item::AbstractItem>> DBManager::GetNotificationList(uid_t uid) {
int ret, sim_mode;
char* query;
list<shared_ptr<item::AbstractItem>> item_list;
int DBManager::DeleteNotification(shared_ptr<item::AbstractItem> deletedItem) {
int ret;
char* query;
- int uid = static_pointer_cast<IItemInfoInternal>(deletedItem->GetInfo())->GetUid();
+ uid_t uid =
+ static_pointer_cast<IItemInfoInternal>(deletedItem->GetInfo())->GetUid();
query = sqlite3_mprintf("DELETE FROM noti_ex_list"
" WHERE root_id = %Q AND app_id = %Q AND uid = %d",
return ret;
}
-string DBManager::GetPkgId(const string& app_id, int uid) {
+string DBManager::GetPkgId(const string& app_id, uid_t uid) {
pkgmgrinfo_pkginfo_h handle;
char *buf = nullptr;
string pkgid;
static std::map<std::string, std::string> GetHideMap();
static int UpdateHideList(std::shared_ptr<item::AbstractItem> updatedItem, const std::string& hide_list);
static int UpdateNotification(std::shared_ptr<item::AbstractItem> updatedItem);
- static int GetCount(const std::string& root_id, const std::string& app_id, int uid, int* count);
- static int GetCount(const std::string& app_id, int uid, int* count);
+ static int GetCount(const std::string& root_id, const std::string& app_id, uid_t uid, int* count);
+ static int GetCount(const std::string& app_id, uid_t uid, int* count);
static int DeleteNotification(std::shared_ptr<item::AbstractItem> deletedItem);
- static std::list<std::shared_ptr<item::AbstractItem>> GetNotificationList(int uid);
- static std::list<std::shared_ptr<item::AbstractItem>> GetNotificationList(std::string app_id, int uid);
- static std::list<std::shared_ptr<item::AbstractItem>> GetNotificationList(std::string app_id, std::string root_id, int uid);
+ static std::list<std::shared_ptr<item::AbstractItem>> GetNotificationList(uid_t uid);
+ static std::list<std::shared_ptr<item::AbstractItem>> GetNotificationList(std::string app_id, uid_t uid);
+ static std::list<std::shared_ptr<item::AbstractItem>> GetNotificationList(std::string app_id, std::string root_id, uid_t uid);
private:
DBManager(); /* LCOV_EXCL_LINE */
static int RecoverCorruptedDB(sqlite3* db);
static int ExecuteQuery(const char* query, int* num_changes);
static int ExecuteQuery(sqlite3* db, const char* query, int* num_changes);
- static std::string GetPkgId(const std::string& app_id, int uid);
+ static std::string GetPkgId(const std::string& app_id, uid_t uid);
static void CheckLimit(std::shared_ptr<item::AbstractItem> addedItem, sqlite3* db);
static int UpdateReceiverList(std::shared_ptr<item::AbstractItem> updatedItem, sqlite3* db);
static std::list<std::shared_ptr<item::AbstractItem>> ExecuteGetList(char* query);