blob: 2b5afc02f9e93af5bd8c6e4e69e41a5bf7280b4e [file] [log] [blame]
// Copyright 2018 The Chromium OS Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef POWER_MANAGER_POWERD_SYSTEM_WAKEUP_DEVICE_INTERFACE_H_
#define POWER_MANAGER_POWERD_SYSTEM_WAKEUP_DEVICE_INTERFACE_H_
#include <memory>
#include <base/files/file_path.h>
namespace power_manager {
namespace system {
// Per device object that helps in identifying if this device is one of the
// reasons for last wake.
class WakeupDeviceInterface {
public:
WakeupDeviceInterface() {}
virtual ~WakeupDeviceInterface() {}
// Records wakeup_count before suspending to identify if the
// device woke up the system after resume.
virtual void PrepareForSuspend() = 0;
// Reads wakeup_count after resume and compares it to the wakeup_count
// before suspending.
virtual void HandleResume() = 0;
// Returns true if the wakeup_count changed during last suspend/resume cycle.
virtual bool CausedLastWake() const = 0;
private:
DISALLOW_COPY_AND_ASSIGN(WakeupDeviceInterface);
};
} // namespace system
} // namespace power_manager
#endif // POWER_MANAGER_POWERD_SYSTEM_WAKEUP_DEVICE_INTERFACE_H_