Fix backup plugin info
[platform/core/appfw/app-installers.git] / src / common / step / backup / step_backup_plugin_info.cc
1 // Copyright (c) 2024 Samsung Electronics Co., Ltd All Rights Reserved
2 // Use of this source code is governed by a apache 2.0 license that can be
3 // found in the LICENSE file.
4
5 #include "common/step/backup/step_backup_plugin_info.h"
6
7 namespace common_installer {
8 namespace backup {
9
10 Step::Status StepBackupPluginInfo::precheck() {
11   if (context_->pkgid.get().empty()) {
12     LOG(ERROR) << "pkgid attribute is empty";
13     return Step::Status::INVALID_VALUE;
14   }
15
16   return Step::Status::OK;
17 }
18
19 Step::Status StepBackupPluginInfo::process() {
20   PkgQueryInterface pkg_query(context_->pkgid.get(), context_->uid.get());
21   if (!pkg_query.PluginExecutionInfo(&context_->backup_plugin_info.get()))
22     return Step::Status::PACKAGE_NOT_FOUND;
23
24   return Step::Status::OK;
25 }
26
27 }  // namespace backup
28 }  // namespace common_installer