From a8d2f2cec720722c18d2a4ae9d5389f7eedf9bec Mon Sep 17 00:00:00 2001 From: Michael Benedict Date: Sun, 14 Mar 2021 12:19:23 +0700 Subject: [PATCH] aidl: power-libperfmgr: Re-implement interactive and DT2W hints * also change NOT_INTERACTIVE to INTERACTIVE so it can be used with fallthrough Signed-off-by: Michael Benedict Change-Id: I1af27d2503b98bd873c8fe84a1028cd46e7a4a53 --- aidl/power-libperfmgr/Power.cpp | 16 +++++++++++++--- aidl/power-libperfmgr/powerhint.json.template | 8 ++++---- 2 files changed, 17 insertions(+), 7 deletions(-) diff --git a/aidl/power-libperfmgr/Power.cpp b/aidl/power-libperfmgr/Power.cpp index 8bd8282e..b7a51d9f 100644 --- a/aidl/power-libperfmgr/Power.cpp +++ b/aidl/power-libperfmgr/Power.cpp @@ -171,10 +171,20 @@ ndk::ScopedAStatus Power::setMode(Mode type, bool enabled) { ndk::ScopedAStatus Power::isModeSupported(Mode type, bool *_aidl_return) { bool supported = mHintManager->IsHintSupported(toString(type)); - // LOW_POWER handled insides PowerHAL specifically - if (type == Mode::LOW_POWER) { - supported = true; + switch (type) { + case Mode::LOW_POWER: // LOW_POWER handled insides PowerHAL specifically + supported = true; + break; + case Mode::DOUBLE_TAP_TO_WAKE: + supported = true; + break; + case Mode::INTERACTIVE: + supported = true; + break; + default: + break; } + LOG(INFO) << "Power mode " << toString(type) << " isModeSupported: " << supported; *_aidl_return = supported; return ndk::ScopedAStatus::ok(); diff --git a/aidl/power-libperfmgr/powerhint.json.template b/aidl/power-libperfmgr/powerhint.json.template index 359dad82..b3d93c26 100644 --- a/aidl/power-libperfmgr/powerhint.json.template +++ b/aidl/power-libperfmgr/powerhint.json.template @@ -111,8 +111,8 @@ "Name": "TouchscreenEnable", "Path": "/sys/class/input/input3/enabled", "Values": [ - "0", - "1" + "1", + "0" ], "ResetOnInit": true }, @@ -409,10 +409,10 @@ "Value": "585000000" }, { - "PowerHint": "NOT_INTERACTIVE", + "PowerHint": "INTERACTIVE", "Node": "TouchscreenEnable", "Duration": 0, - "Value": "0" + "Value": "1" }, { "PowerHint": "DOUBLE_TAP_TO_WAKE",