PkgMgrPtr PkgMgrInterface::Create(int argc, char** argv,
PkgmgrInstallerInterface* pkgmgr_installer_interface,
- AppQueryInterface* interface) {
+ std::shared_ptr<AppQueryInterface> interface) {
PkgMgrPtr instance(new PkgMgrInterface(pkgmgr_installer_interface,
interface));
int result = instance->InitInternal(argc, argv);
}
void PkgMgrInterface::AddAppQueryInterface(
- int idx, AppQueryInterface* interface) {
+ int idx, std::shared_ptr<AppQueryInterface> interface) {
query_interface_map_.emplace(idx, interface);
}
return RequestType::Move;
}
- AppQueryInterface* query_interface = query_interface_;
+ std::shared_ptr<AppQueryInterface> query_interface = query_interface_;
if (!query_interface) {
auto it = query_interface_map_.find(idx);
if (it == query_interface_map_.end())
* \param idx index of request
* \param interface AppQueryInterface for request
*/
- void AddAppQueryInterface(int idx, AppQueryInterface* interface);
+ void AddAppQueryInterface(int idx, std::shared_ptr<AppQueryInterface> interface);
/**
* Returns Request type passed from pkgmgr_installer
*/
static PkgMgrPtr Create(int argc, char** argv,
PkgmgrInstallerInterface* pkgmgr_installer_interface,
- AppQueryInterface* interface = nullptr);
+ std::shared_ptr<AppQueryInterface> interface = nullptr);
/**
* Returns TEP path passed from pkgmgr_installer
private:
explicit PkgMgrInterface(PkgmgrInstallerInterface* pkgmgr_installer_interface,
- AppQueryInterface* interface)
+ std::shared_ptr<AppQueryInterface> interface)
: pi_(nullptr),
install_mode_(InstallationMode::ONLINE),
is_app_installed_(boost::none),
mutable boost::optional<bool> is_app_installed_;
PkgmgrInstallerInterface* pkgmgr_installer_interface_;
- AppQueryInterface* query_interface_;
- std::map<int, AppQueryInterface*> query_interface_map_;
+ std::shared_ptr<AppQueryInterface> query_interface_;
+ std::map<int, std::shared_ptr<AppQueryInterface>> query_interface_map_;
SCOPE_LOG_TAG(PkgMgrInterface)
DISALLOW_COPY_AND_ASSIGN(PkgMgrInterface);
void BackendInterface::TestRollbackAfterEachStep(int argc, const char* argv[],
std::function<bool()> validator) const {
TestPkgmgrInstaller pkgmgr_installer;
- std::unique_ptr<ci::AppQueryInterface> query_interface =
+ std::shared_ptr<ci::AppQueryInterface> query_interface =
CreateQueryInterface();
auto pkgmgr =
ci::PkgMgrInterface::Create(argc, const_cast<char**>(argv),
&pkgmgr_installer,
- query_interface.get());
+ query_interface);
if (!pkgmgr) {
LOG(ERROR) << "Failed to initialize pkgmgr interface";
return;
auto pkgmgr =
ci::PkgMgrInterface::Create(args->size(), const_cast<char**>(argv.get()),
&pkgmgr_installer,
- query_interface.get());
+ query_interface);
if (!pkgmgr) {
LOG(ERROR) << "Failed to initialize pkgmgr interface";
return;
TestPkgmgrInstaller pkgmgr_installer;
auto query_interface = CreateQueryInterface();
auto pkgmgr = ci::PkgMgrInterface::Create(argc, const_cast<char**>(argv),
- &pkgmgr_installer, query_interface.get());
+ &pkgmgr_installer, query_interface);
if (!pkgmgr) {
LOG(ERROR) << "Failed to initialize pkgmgr interface";
return BackendInterface::CommandResult::UNKNOWN;
CommandResult CallBackend(int argc, const char* argv[]) const;
CommandResult CallBackendWithRunner(int argc, const char* argv[]) const;
using AppQueryInterfacePtr =
- std::unique_ptr<common_installer::AppQueryInterface>;
+ std::shared_ptr<common_installer::AppQueryInterface>;
using AppInstallerPtr = std::unique_ptr<common_installer::AppInstaller>;
SmokeInstallerFactoryPtr factory_;
std::string uid_str_;