blob: 847a42e7c3db9e3c57432b307b1c9e0653df4491 [file] [log] [blame]
Peiyong Lin5851c3a2022-10-18 20:47:56 +00001/*
2 * Copyright (C) 2022 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#include "PowerHintSession.h"
18
19#include <android-base/logging.h>
Matt Buckleycaac1472023-12-12 03:55:50 +000020#include "android/binder_auto_utils.h"
Peiyong Lin5851c3a2022-10-18 20:47:56 +000021
22namespace aidl::android::hardware::power::impl::example {
23
24using ndk::ScopedAStatus;
25
26PowerHintSession::PowerHintSession() {}
27
28ScopedAStatus PowerHintSession::updateTargetWorkDuration(int64_t targetDurationNanos) {
29 LOG(VERBOSE) << __func__ << "target duration in nanoseconds: " << targetDurationNanos;
30 return ScopedAStatus::ok();
31}
32
33ScopedAStatus PowerHintSession::reportActualWorkDuration(
34 const std::vector<WorkDuration>& /* durations */) {
35 LOG(VERBOSE) << __func__;
36 return ScopedAStatus::ok();
37}
38
39ScopedAStatus PowerHintSession::pause() {
40 return ScopedAStatus::ok();
41}
42
43ScopedAStatus PowerHintSession::resume() {
44 return ScopedAStatus::ok();
45}
46
47ScopedAStatus PowerHintSession::close() {
48 return ScopedAStatus::ok();
49}
50
51ScopedAStatus PowerHintSession::sendHint(SessionHint /* hint */) {
52 return ScopedAStatus::ok();
53}
54
Peiyong Linc7854592022-10-13 00:10:31 +000055ScopedAStatus PowerHintSession::setThreads(const std::vector<int32_t>& threadIds) {
56 if (threadIds.size() == 0) {
57 LOG(ERROR) << "Error: threadIds.size() shouldn't be " << threadIds.size();
58 return ndk::ScopedAStatus::fromExceptionCode(EX_ILLEGAL_ARGUMENT);
59 }
60 return ScopedAStatus::ok();
61}
62
Matt Buckley1fde90c2023-06-28 19:55:26 +000063ScopedAStatus PowerHintSession::setMode(SessionMode /* mode */, bool /* enabled */) {
64 return ScopedAStatus::ok();
65}
66
Matt Buckleycaac1472023-12-12 03:55:50 +000067ScopedAStatus PowerHintSession::getSessionConfig(SessionConfig* _aidl_return) {
68 _aidl_return->id = 1;
69 return ScopedAStatus::ok();
70}
71
Peiyong Lin5851c3a2022-10-18 20:47:56 +000072} // namespace aidl::android::hardware::power::impl::example