1 // Copyright (c) 2011 The Chromium OS Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef POWER_MANAGER_ACTIVITY_DETECTOR_INTERFACE_H_
6 #define POWER_MANAGER_ACTIVITY_DETECTOR_INTERFACE_H_
8 #include "base/basictypes.h"
10 namespace power_manager {
12 // Interface for detecting the presence of certain activity during user idle
14 class ActivityDetectorInterface {
16 // Sets |is_active| to true if audio activity has been detected, otherwise
17 // sets |is_active| to false. This is based on whether there has been any
18 // activity detected within the last |activity_threshold_ms| ms.
20 // On success, returns true; Returns false if the audio state could not be
21 // determined or the audio file could not be read
22 virtual bool GetActivity(int64 activity_threshold_ms,
23 int64* time_since_activity_ms,
26 // Turns activity detection on and off. This is useful for cases where the
27 // detection is polling-based, for example.
28 virtual bool Enable() = 0;
29 virtual bool Disable() = 0;
32 virtual ~ActivityDetectorInterface() {}
35 } // namespace power_manager
37 #endif // POWER_MANAGER_ACTIVITY_DETECTOR_INTERFACE_H_