Merge branch 'master' into fix_log
author연정현/Tizen Platform Lab(SR)/Staff Engineer/삼성전자 <jungh.yeon@samsung.com>
Mon, 8 Mar 2021 01:53:42 +0000 (10:53 +0900)
committerGitHub Enterprise <noreply-CODE@samsung.com>
Mon, 8 Mar 2021 01:53:42 +0000 (10:53 +0900)
1  2 
src/manager/pkginfo_manager.cc

@@@ -142,18 -145,20 +145,25 @@@ extern "C" EXPORT_API int _appinfo_get_
                return PMINFO_R_ERROR;
        }
  
 -      if (ptr->GetRequestResult() != PMINFO_R_OK) {
 -              LOG(ERROR) << "Request fail";
 -              return ptr->GetRequestResult();
 +      int ret = return_parcel->GetRequestResult();
 +      if (ret != PMINFO_R_OK) {
 +              if (ret == PMINFO_R_ENOENT) {
 +                      LOG(DEBUG) << "No such application";
 +              } else {
 +                      LOG(ERROR) << "Request fail";
 +              }
 +              return ret;
        }
  
-       tizen_base::Parcel parcel;
-       parcel.ReadParcelable(return_parcel.get());
+       if (ptr->GetType() != pkgmgr_common::parcel::ParcelableType::AppInfo) {
+               LOG(ERROR) << "Invalid parcelable type";
+               return PMINFO_R_ERROR;
+       }
+       std::shared_ptr<pkgmgr_common::parcel::AppInfoParcelable> return_parcel(
+                       std::static_pointer_cast<pkgmgr_common::parcel::AppInfoParcelable>(
+                                       ptr));
        auto result_list = return_parcel->GetAppInfo();
        for (auto& appinfo : result_list)
                g_hash_table_insert(packages, (gpointer)appinfo->appid,