summaryrefslogtreecommitdiff
path: root/PowerHintSession.cpp
blob: 3fec48c04e857de653a1c456c426ca44de2557a9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
/*
* Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
* SPDX-License-Identifier: BSD-3-Clause-Clear
*/

#include "PowerHintSession.h"
#include <android-base/logging.h>
#define LOG_TAG "QTI PowerHAL"

std::shared_ptr<aidl::android::hardware::power::IPowerHintSession> setPowerHintSession(){
    std::shared_ptr<aidl::android::hardware::power::IPowerHintSession> mPowerSession = ndk::SharedRefBase::make<PowerHintSessionImpl>();
    return mPowerSession;
}

int64_t getSessionPreferredRate(){
    return 16666666L;
}

ndk::ScopedAStatus PowerHintSessionImpl::updateTargetWorkDuration(int64_t in_targetDurationNanos){
        return ndk::ScopedAStatus::ok();
    }
ndk::ScopedAStatus PowerHintSessionImpl::reportActualWorkDuration(const std::vector<::aidl::android::hardware::power::WorkDuration>& in_durations){
        return ndk::ScopedAStatus::ok();
    }
ndk::ScopedAStatus PowerHintSessionImpl::pause(){
        return ndk::ScopedAStatus::ok();
    }
ndk::ScopedAStatus PowerHintSessionImpl::resume(){
        return ndk::ScopedAStatus::ok();
}
ndk::ScopedAStatus PowerHintSessionImpl::close(){
        return ndk::ScopedAStatus::ok();
}
ndk::ScopedAStatus PowerHintSessionImpl::sendHint(aidl::android::hardware::power::SessionHint hint){
        return ndk::ScopedAStatus::ok();
}
ndk::ScopedAStatus PowerHintSessionImpl::setThreads(const std::vector<int32_t>& threadIds){
    if (threadIds.size() == 0) {
        LOG(ERROR) << "Error: threadIds.size() shouldn't be " << threadIds.size();
        return ndk::ScopedAStatus::fromExceptionCode(EX_ILLEGAL_ARGUMENT);
    }
    return ndk::ScopedAStatus::ok();
}