diff options
author | Scott Lobdell <slobdell@google.com> | 2021-04-08 04:26:21 +0000 |
---|---|---|
committer | Scott Lobdell <slobdell@google.com> | 2021-04-08 04:26:21 +0000 |
commit | 95a4eaee873adf20b90a1d3d74c650c96a9271f2 (patch) | |
tree | 47c85878a2730bd38bffb1ee4c138764e4a57479 /power/aidl/default/Power.cpp | |
parent | 0c2e5fb06bd4257044c4761e89705268421c77b3 (diff) | |
parent | aa0540c86a939e6c0f63e17d13d2aed3d9b53777 (diff) |
Merge SP1A.210407.002
Change-Id: I59c8a9fe4c458698011cf3ced77bcd2c4818a138
Diffstat (limited to 'power/aidl/default/Power.cpp')
-rw-r--r-- | power/aidl/default/Power.cpp | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/power/aidl/default/Power.cpp b/power/aidl/default/Power.cpp index 8610de35b8..7f08f44926 100644 --- a/power/aidl/default/Power.cpp +++ b/power/aidl/default/Power.cpp @@ -25,6 +25,10 @@ namespace power { namespace impl { namespace example { +const std::vector<Boost> BOOST_RANGE{ndk::enum_range<Boost>().begin(), + ndk::enum_range<Boost>().end()}; +const std::vector<Mode> MODE_RANGE{ndk::enum_range<Mode>().begin(), ndk::enum_range<Mode>().end()}; + ndk::ScopedAStatus Power::setMode(Mode type, bool enabled) { LOG(VERBOSE) << "Power setMode: " << static_cast<int32_t>(type) << " to: " << enabled; return ndk::ScopedAStatus::ok(); @@ -32,7 +36,7 @@ ndk::ScopedAStatus Power::setMode(Mode type, bool enabled) { ndk::ScopedAStatus Power::isModeSupported(Mode type, bool* _aidl_return) { LOG(INFO) << "Power isModeSupported: " << static_cast<int32_t>(type); - *_aidl_return = false; + *_aidl_return = type >= MODE_RANGE.front() && type <= MODE_RANGE.back(); return ndk::ScopedAStatus::ok(); } @@ -44,10 +48,21 @@ ndk::ScopedAStatus Power::setBoost(Boost type, int32_t durationMs) { ndk::ScopedAStatus Power::isBoostSupported(Boost type, bool* _aidl_return) { LOG(INFO) << "Power isBoostSupported: " << static_cast<int32_t>(type); - *_aidl_return = false; + *_aidl_return = type >= BOOST_RANGE.front() && type <= BOOST_RANGE.back(); return ndk::ScopedAStatus::ok(); } +ndk::ScopedAStatus Power::createHintSession(int32_t, int32_t, const std::vector<int32_t>&, int64_t, + std::shared_ptr<IPowerHintSession>* _aidl_return) { + *_aidl_return = nullptr; + return ndk::ScopedAStatus::fromExceptionCode(EX_UNSUPPORTED_OPERATION); +} + +ndk::ScopedAStatus Power::getHintSessionPreferredRate(int64_t* outNanoseconds) { + *outNanoseconds = -1; + return ndk::ScopedAStatus::fromExceptionCode(EX_UNSUPPORTED_OPERATION); +} + } // namespace example } // namespace impl } // namespace power |