blob: baabaa72713351c0480ba17206c22185ad9e36ce [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;
Peiyong Lin5851c3a2022-10-18 20:47:56 +000047
48 private:
49 std::vector<std::shared_ptr<IPowerHintSession>> mPowerHintSessions;
Wei Wang61c2a332020-01-08 16:51:47 -080050};
51
52} // namespace example
53} // namespace impl
54} // namespace power
55} // namespace hardware
56} // namespace android
57} // namespace aidl