Check priv_id of item_info when update 92/233092/2
authormk5004.lee <mk5004.lee@samsung.com>
Tue, 12 May 2020 05:45:39 +0000 (14:45 +0900)
committerJusung Son <jusung07.son@samsung.com>
Tue, 12 May 2020 08:51:22 +0000 (17:51 +0900)
Change-Id: I9be31cf0a3431429691eeaef4cb6c8d3a4601d2f
Signed-off-by: mk5004.lee <mk5004.lee@samsung.com>
Signed-off-by: Jusung Son <jusung07.son@samsung.com>
notification-ex/db_manager.cc

index 325e8b4..7b308aa 100644 (file)
@@ -609,6 +609,7 @@ int DBManager::UpdateHideList(shared_ptr<item::AbstractItem> updatedItem,
 int DBManager::UpdateNotification(list<shared_ptr<item::AbstractItem>> updatedList) {
   int ret = ERROR_NONE;
   char* query;
+  int64_t priv_id;
   sqlite3* db = OpenDB();
   if (db == nullptr)
     return ERROR_FROM_DB;
@@ -630,6 +631,8 @@ int DBManager::UpdateNotification(list<shared_ptr<item::AbstractItem>> updatedLi
       break;
     }
 
+    priv_id = static_pointer_cast<IItemInfoInternal>(item_list.front()->GetInfo())->GetPrivateId();
+    static_pointer_cast<IItemInfoInternal>(i->GetInfo())->SetPrivateId(priv_id);
     Bundle b = i->Serialize();
     query = sqlite3_mprintf("UPDATE noti_ex_list SET"
         " pkg_id = %Q, channel = %Q, policy = %d, data = %Q, insert_time = %d"
@@ -639,7 +642,7 @@ int DBManager::UpdateNotification(list<shared_ptr<item::AbstractItem>> updatedLi
         static_cast<int>(i->GetPolicy()),
         reinterpret_cast<char*>(b.ToRaw().first.get()),
         static_pointer_cast<IItemInfo>(i->GetInfo())->GetTime(),
-        static_pointer_cast<IItemInfoInternal>(item_list.front()->GetInfo())->GetPrivateId());
+        priv_id);
     if (!query) {
       LOGE("OOM - sql query");
       ret = ERROR_OUT_OF_MEMORY;