This commit unifies states between multiple instances of
PkgmgrSignal objects (using static variable).
Change-Id: I698c509c60533534c49ba29f537aca0e56ae63a9
namespace common_installer {
+PkgmgrSignal::State PkgmgrSignal::state_ = PkgmgrSignal::State::NOT_SENT;
+
PkgmgrSignal::PkgmgrSignal(pkgmgr_installer* pi)
- : pi_(pi),
- state_(State::NOT_SENT) {
+ : pi_(pi) {
}
bool PkgmgrSignal::SendStarted(
//
// Utility for sending signal to pkgmgr
-//
-// One installation process should not create more than one instance of this
-// class. Object contains state of signaling and will report error if
-// used in wrong way.
-//
class PkgmgrSignal {
public:
enum class State {
const char* GetResultKey(Step::Status result) const;
pkgmgr_installer* pi_;
- State state_;
+ static State state_;
// TODO(t.iwanek): use DISALLOW_COPY_AND_ASSIGN
PkgmgrSignal(const PkgmgrSignal&) = delete;