// TODO(p.sikorski) below property is only used in AppInstaller.
// maybe it should then be kept in AppInstaller
context_->pkg_type.set(package_type);
+ context_->installation_mode.set(pkgmgr->GetInstallationMode());
}
AppInstaller::~AppInstaller() {
#include <utility>
#include <vector>
+#include "common/pkgmgr_interface.h"
#include "common/recovery_file.h"
#include "common/request.h"
#include "common/utils/property.h"
* \brief request type received from pkgmgr_installer
*/
Property<RequestType> request_type;
+
+ /**
+ * \brief installation mode (ONLINE / OFFLINE)
+ */
+ Property<InstallationMode> installation_mode;
};
} // namespace common_installer
LOG(ERROR) << "Cannot create pkgmgr_installer object. Aborting.";
return ENOMEM;
}
+ install_mode_ = InstallationMode::OFFLINE;
+ } else {
+ install_mode_ = InstallationMode::ONLINE;
}
int result = pkgmgr_installer_receive_request(pi_, argc, argv);
namespace common_installer {
+enum class InstallationMode {
+ ONLINE,
+ OFFLINE
+};
+
class PkgMgrInterface;
typedef std::shared_ptr<PkgMgrInterface> PkgMgrPtr;
*/
DEPRECATED pkgmgr_installer *GetRawPi() const { return pi_; }
+ /**
+ * Returns installation mode
+ *
+ * \return 'ONLINE' for online installation, 'OFFLINE' otherwise
+ */
+ InstallationMode GetInstallationMode() const { return install_mode_; }
+
+
/** PkgMgrInstance destructor. */
~PkgMgrInterface();
private:
explicit PkgMgrInterface(AppQueryInterface* interface)
: pi_(nullptr),
+ install_mode_(InstallationMode::ONLINE),
is_app_installed_(false),
query_interface_(interface) {}
int InitInternal(int argc, char** argv);
pkgmgr_installer* pi_;
+ InstallationMode install_mode_;
bool is_app_installed_;
+
AppQueryInterface* query_interface_;
SCOPE_LOG_TAG(PkgMgrInterface)