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"
19 #include "pkgmgrinfo_debug.h"
20 #include "pkgmgrinfo_internal.h"
22 namespace pkgmgr_common {
25 DepInfoGetDBHandler::DepInfoGetDBHandler(uid_t uid)
26 : AbstractDBHandler(uid), uid_(uid) {}
28 DepInfoGetDBHandler::~DepInfoGetDBHandler() {}
30 std::vector<dependency_x*> DepInfoGetDBHandler::GetDependencyList() {
31 return std::move(dependency_list_);
34 void DepInfoGetDBHandler::SetPkgID(const std::string& pkgid) {
38 int DepInfoGetDBHandler::Execute() {
39 SetOpType(OPERATION_TYPE_READ);
40 SetDBType(DB_TYPE_FILE_PKGDB);
43 _LOGE("Failed to connect database");
44 return PMINFO_R_ERROR;
46 GList *list = nullptr;
47 int ret = pkginfo_internal_filter_get_depends_on(
48 GetConnection(), pkgid_.c_str(), &list);
53 } // namespace database
54 } // namespace pkgmgr_common