From 6e68f025eb97877318eb0e75b9acbfcd6fc93425 Mon Sep 17 00:00:00 2001 From: Jesse Chan Date: Tue, 30 Jun 2020 21:13:53 +0800 Subject: [PATCH] power-libperfmgr: add an updateHint function for simple hint ops Change-Id: I2e64f23b5435f7262b36acd52916b5ac795dd106 --- hidl/power-libperfmgr/Power.cpp | 12 ++++++++++++ hidl/power-libperfmgr/Power.h | 2 ++ 2 files changed, 14 insertions(+) diff --git a/hidl/power-libperfmgr/Power.cpp b/hidl/power-libperfmgr/Power.cpp index 4c29c264..5cb938f8 100644 --- a/hidl/power-libperfmgr/Power.cpp +++ b/hidl/power-libperfmgr/Power.cpp @@ -103,6 +103,18 @@ Power::Power() mInitThread.detach(); } +Return Power::updateHint(const char *hint, bool enable) { + if (!mReady) { + return Void(); + } + if (enable) { + mHintManager->DoHint(hint); + } else { + mHintManager->EndHint(hint); + } + return Void(); +} + // Methods from ::android::hardware::power::V1_0::IPower follow. Return Power::setInteractive(bool /* interactive */) { return Void(); diff --git a/hidl/power-libperfmgr/Power.h b/hidl/power-libperfmgr/Power.h index 1acabdb7..8922dfff 100644 --- a/hidl/power-libperfmgr/Power.h +++ b/hidl/power-libperfmgr/Power.h @@ -76,6 +76,8 @@ class Power : public IPower { std::atomic mCameraStreamingMode; std::atomic mReady; std::thread mInitThread; + + Return updateHint(const char *hint, bool enable); }; } // namespace implementation