Wei Wang | 61c2a33 | 2020-01-08 16:51:47 -0800 | [diff] [blame] | 1 | /* |
| 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 Buckley | caac147 | 2023-12-12 03:55:50 +0000 | [diff] [blame] | 20 | #include "aidl/android/hardware/power/SessionTag.h" |
Wei Wang | 61c2a33 | 2020-01-08 16:51:47 -0800 | [diff] [blame] | 21 | |
| 22 | namespace aidl { |
| 23 | namespace android { |
| 24 | namespace hardware { |
| 25 | namespace power { |
| 26 | namespace impl { |
| 27 | namespace example { |
| 28 | |
| 29 | class Power : public BnPower { |
Peiyong Lin | 5851c3a | 2022-10-18 20:47:56 +0000 | [diff] [blame] | 30 | public: |
Wei Wang | 61c2a33 | 2020-01-08 16:51:47 -0800 | [diff] [blame] | 31 | 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 Wang | 0500341 | 2021-04-01 10:44:29 -0700 | [diff] [blame] | 35 | 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 Buckley | caac147 | 2023-12-12 03:55:50 +0000 | [diff] [blame] | 39 | 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 Wang | 0500341 | 2021-04-01 10:44:29 -0700 | [diff] [blame] | 43 | ndk::ScopedAStatus getHintSessionPreferredRate(int64_t* outNanoseconds) override; |
Matt Buckley | caac147 | 2023-12-12 03:55:50 +0000 | [diff] [blame] | 44 | 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 Buckley | 607720e | 2024-10-28 19:21:37 +0000 | [diff] [blame] | 47 | ndk::ScopedAStatus getSupportInfo(SupportInfo* _aidl_return) override; |
Peiyong Lin | 5851c3a | 2022-10-18 20:47:56 +0000 | [diff] [blame] | 48 | |
| 49 | private: |
| 50 | std::vector<std::shared_ptr<IPowerHintSession>> mPowerHintSessions; |
Wei Wang | 61c2a33 | 2020-01-08 16:51:47 -0800 | [diff] [blame] | 51 | }; |
| 52 | |
| 53 | } // namespace example |
| 54 | } // namespace impl |
| 55 | } // namespace power |
| 56 | } // namespace hardware |
| 57 | } // namespace android |
| 58 | } // namespace aidl |