blob: a78759076080fb4c7bf5fe46d649bcc7718cc72c [file] [log] [blame]
Ananth Raghavan Subramaniand39ec572018-09-08 19:47:41 -07001/*
2 * Copyright (c) 2019, The Linux Foundation. All rights reserved.
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are
6 * met:
7 * * Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
9 * * Redistributions in binary form must reproduce the above
10 * copyright notice, this list of conditions and the following
11 * disclaimer in the documentation and/or other materials provided
12 * with the distribution.
13 * * Neither the name of The Linux Foundation nor the names of its
14 * contributors may be used to endorse or promote products derived
15 * from this software without specific prior written permission.
16 *
17 * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
18 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
19 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
20 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
21 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
22 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
23 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
24 * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
25 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
26 * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
27 * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 */
29
30#ifndef ANDROID_HARDWARE_POWER_V1_2_POWER_H
31#define ANDROID_HARDWARE_POWER_V1_2_POWER_H
32
33#include <android/hardware/power/1.2/IPower.h>
34#include <hidl/MQDescriptor.h>
35#include <hidl/Status.h>
36#include <hardware/power.h>
37
38namespace android {
39namespace hardware {
40namespace power {
41namespace V1_2 {
42namespace implementation {
43
44using ::android::hardware::power::V1_0::Feature;
45using PowerHint_1_0 = ::android::hardware::power::V1_0::PowerHint;
46using PowerHint_1_2 = ::android::hardware::power::V1_2::PowerHint;
47using ::android::hardware::power::V1_2::IPower;
48using ::android::hardware::Return;
49using ::android::hardware::Void;
50
51struct Power : public IPower {
52 // Methods from ::android::hardware::power::V1_0::IPower follow.
53
54 Power();
55
56 Return<void> setInteractive(bool interactive) override;
57 Return<void> powerHint(PowerHint_1_0 hint, int32_t data) override;
58 Return<void> setFeature(Feature feature, bool activate) override;
59 Return<void> getPlatformLowPowerStats(getPlatformLowPowerStats_cb _hidl_cb) override;
60
61 // Methods from ::android::hardware::power::V1_1::IPower follow
62 Return<void> getSubsystemLowPowerStats(getSubsystemLowPowerStats_cb _hidl_cb) override;
63 Return<void> powerHintAsync(PowerHint_1_0 hint, int32_t data) override;
64 // Methods from ::android::hardware::power::V1_2::IPower follow
65 Return<void> powerHintAsync_1_2(PowerHint_1_2 hint, int32_t data) override;
66};
67
68} // namespace implementation
69} // namespace V1_2
70} // namespace power
71} // namespace hardware
72} // namespace android
73
74#endif // ANDROID_HARDWARE_POWER_V1_2_POWER_H