Change method name 04/269104/1
authorjh9216.park <jh9216.park@samsung.com>
Mon, 10 Jan 2022 01:38:37 +0000 (20:38 -0500)
committerjh9216.park <jh9216.park@samsung.com>
Mon, 10 Jan 2022 01:38:37 +0000 (20:38 -0500)
- I changed the method name from GetAppHandle to DetachAppHandle because it
moves container 'handle_list_'

Change-Id: I67868253c8b3527ef81a88380c28cee0559c65d3
Signed-off-by: jh9216.park <jh9216.park@samsung.com>
src/server/database/appinfo_db_handler.cc
src/server/database/appinfo_db_handler.hh
src/server/request_handler/get_appinfo_request_handler.cc
test/unit_tests/test_parser_db_handlers.cc

index fec4d2c..42195af 100644 (file)
@@ -48,7 +48,7 @@ AppInfoDBHandler::AppInfoDBHandler(uid_t uid, int pid)
 
 AppInfoDBHandler::~AppInfoDBHandler() {}
 
-std::vector<std::shared_ptr<application_x>> AppInfoDBHandler::GetAppHandle() {
+std::vector<std::shared_ptr<application_x>> AppInfoDBHandler::DetachAppHandle() {
   return std::move(handle_list_);
 }
 
index a095a58..1e68059 100644 (file)
@@ -37,7 +37,7 @@ class EXPORT_API AppInfoDBHandler : public AbstractDBHandler{
  public:
   AppInfoDBHandler(uid_t uid, int pid);
   virtual ~AppInfoDBHandler();
-  std::vector<std::shared_ptr<application_x>> GetAppHandle();
+  std::vector<std::shared_ptr<application_x>> DetachAppHandle();
   void SetFilter(pkgmgrinfo_filter_x* filter);
   virtual int Execute();
 
index bc3842c..f558a9e 100644 (file)
@@ -48,7 +48,7 @@ bool GetAppinfoRequestHandler::HandleRequest(unsigned char* data, int size,
   db.SetFilter(const_cast<pkgmgrinfo_filter_x*>(parcel->GetFilter()));
   int ret = db.Execute();
 
-  result_ = std::make_shared<pcp::AppInfoParcelable>(ret, db.GetAppHandle());
+  result_ = std::make_shared<pcp::AppInfoParcelable>(ret, db.DetachAppHandle());
 
   return true;
 }
index 7524bc1..f1fb3ef 100644 (file)
@@ -279,7 +279,7 @@ TEST_F(ParserDBHandlerTest, AppInfoDBHandlerTest) {
   appinfo_db_handler.SetLocale("test_lang");
   ASSERT_EQ(appinfo_db_handler.Execute(), 0);
 
-  auto lappinfo_list = appinfo_db_handler.GetAppHandle();
+  auto lappinfo_list = appinfo_db_handler.DetachAppHandle();
   ASSERT_EQ(lappinfo_list.size(), 1);
 
   auto test_appinfo = GetTestApplication(appid);