blob: 118097ff2fa45872748b8b8bea0f765d3d557e59 [file] [log] [blame]
Wei Wang61c2a332020-01-08 16:51:47 -08001/*
2 * Copyright (C) 2020 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17#pragma once
18
19#include <aidl/android/hardware/power/BnPower.h>
Matt Buckleycaac1472023-12-12 03:55:50 +000020#include "aidl/android/hardware/power/SessionTag.h"
Wei Wang61c2a332020-01-08 16:51:47 -080021
22namespace aidl {
23namespace android {
24namespace hardware {
25namespace power {
26namespace impl {
27namespace example {
28
29class Power : public BnPower {
Peiyong Lin5851c3a2022-10-18 20:47:56 +000030 public:
Wei Wang61c2a332020-01-08 16:51:47 -080031 ndk::ScopedAStatus setMode(Mode type, bool enabled) override;
32 ndk::ScopedAStatus isModeSupported(Mode type, bool* _aidl_return) override;
33 ndk::ScopedAStatus setBoost(Boost type, int32_t durationMs) override;
34 ndk::ScopedAStatus isBoostSupported(Boost type, bool* _aidl_return) override;
Wei Wang05003412021-04-01 10:44:29 -070035 ndk::ScopedAStatus createHintSession(int32_t tgid, int32_t uid,
36 const std::vector<int32_t>& threadIds,
37 int64_t durationNanos,
38 std::shared_ptr<IPowerHintSession>* _aidl_return) override;
Matt Buckleycaac1472023-12-12 03:55:50 +000039 ndk::ScopedAStatus createHintSessionWithConfig(
40 int32_t tgid, int32_t uid, const std::vector<int32_t>& threadIds, int64_t durationNanos,
41 SessionTag tag, SessionConfig* config,
42 std::shared_ptr<IPowerHintSession>* _aidl_return) override;
Wei Wang05003412021-04-01 10:44:29 -070043 ndk::ScopedAStatus getHintSessionPreferredRate(int64_t* outNanoseconds) override;
Matt Buckleycaac1472023-12-12 03:55:50 +000044 ndk::ScopedAStatus getSessionChannel(int32_t tgid, int32_t uid,
45 ChannelConfig* _aidl_return) override;
46 ndk::ScopedAStatus closeSessionChannel(int32_t tgid, int32_t uid) override;
Matt Buckley607720e2024-10-28 19:21:37 +000047 ndk::ScopedAStatus getSupportInfo(SupportInfo* _aidl_return) override;
Xiang Wangaf052822024-10-21 23:18:29 +000048 ndk::ScopedAStatus getCpuHeadroom(const CpuHeadroomParams& params,
Xiang Wangb0d667e2024-11-16 06:19:21 +000049 CpuHeadroomResult* _aidl_return) override;
50
Xiang Wangaf052822024-10-21 23:18:29 +000051 ndk::ScopedAStatus getGpuHeadroom(const GpuHeadroomParams& params,
Xiang Wangb0d667e2024-11-16 06:19:21 +000052 GpuHeadroomResult* _aidl_return) override;
Matt Buckley0efc7482024-10-29 18:39:20 +000053 ndk::ScopedAStatus sendCompositionData(const std::vector<CompositionData>& in_data) override;
54 ndk::ScopedAStatus sendCompositionUpdate(const CompositionUpdate& in_update) override;
Peiyong Lin5851c3a2022-10-18 20:47:56 +000055
56 private:
57 std::vector<std::shared_ptr<IPowerHintSession>> mPowerHintSessions;
Wei Wang61c2a332020-01-08 16:51:47 -080058};
59
60} // namespace example
61} // namespace impl
62} // namespace power
63} // namespace hardware
64} // namespace android
65} // namespace aidl