2 * Copyright (c) 2021 Samsung Electronics Co., Ltd All Rights Reserved
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 #include "depinfo_db_handler.hh"
21 #include "pkgmgrinfo_debug.h"
22 #include "pkgmgrinfo_internal.h"
24 namespace pkgmgr_common {
27 DepInfoGetDBHandler::DepInfoGetDBHandler(uid_t uid, int pid)
28 : AbstractDBHandler(uid, pid), uid_(uid) {}
30 DepInfoGetDBHandler::~DepInfoGetDBHandler() {}
32 std::vector<dependency_x*> DepInfoGetDBHandler::GetDependencyList() {
33 return std::move(dependency_list_);
36 void DepInfoGetDBHandler::SetPkgID(const std::string& pkgid) {
40 int DepInfoGetDBHandler::Execute() {
41 SetOpType(OPERATION_TYPE_READ);
42 SetDBType(DB_TYPE_FILE_PKGDB);
45 _LOGE("Failed to connect database");
46 return PMINFO_R_ERROR;
48 GList *list = nullptr;
49 std::vector<sqlite3*> conn_list = GetConnection();
51 for (auto& conn : conn_list) {
52 ret = pkginfo_internal_filter_get_depends_on(
53 conn, pkgid_.c_str(), &list);
54 if (ret == PMINFO_R_ERROR)
60 } // namespace database
61 } // namespace pkgmgr_common