1 /* 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> 20 #include "android/binder_auto_utils.h" 21 22 namespace aidl::android::hardware::power::impl::example { 23 24 using ndk::ScopedAStatus; 25 PowerHintSession()26PowerHintSession::PowerHintSession() {} 27 updateTargetWorkDuration(int64_t targetDurationNanos)28ScopedAStatus PowerHintSession::updateTargetWorkDuration(int64_t targetDurationNanos) { 29 LOG(VERBOSE) << __func__ << "target duration in nanoseconds: " << targetDurationNanos; 30 return ScopedAStatus::ok(); 31 } 32 reportActualWorkDuration(const std::vector<WorkDuration> &)33ScopedAStatus PowerHintSession::reportActualWorkDuration( 34 const std::vector<WorkDuration>& /* durations */) { 35 LOG(VERBOSE) << __func__; 36 return ScopedAStatus::ok(); 37 } 38 pause()39ScopedAStatus PowerHintSession::pause() { 40 return ScopedAStatus::ok(); 41 } 42 resume()43ScopedAStatus PowerHintSession::resume() { 44 return ScopedAStatus::ok(); 45 } 46 close()47ScopedAStatus PowerHintSession::close() { 48 return ScopedAStatus::ok(); 49 } 50 sendHint(SessionHint)51ScopedAStatus PowerHintSession::sendHint(SessionHint /* hint */) { 52 return ScopedAStatus::ok(); 53 } 54 setThreads(const std::vector<int32_t> & threadIds)55ScopedAStatus 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 setMode(SessionMode,bool)63ScopedAStatus PowerHintSession::setMode(SessionMode /* mode */, bool /* enabled */) { 64 return ScopedAStatus::ok(); 65 } 66 getSessionConfig(SessionConfig * _aidl_return)67ScopedAStatus PowerHintSession::getSessionConfig(SessionConfig* _aidl_return) { 68 _aidl_return->id = 1; 69 return ScopedAStatus::ok(); 70 } 71 72 } // namespace aidl::android::hardware::power::impl::example 73