aidl: power-libperfmgr: Re-implement interactive and DT2W hints
authorMichael Benedict <michaelbt@live.com>
Sun, 14 Mar 2021 05:19:23 +0000 (12:19 +0700)
committerMichael Benedict <michaelbt@live.com>
Sat, 20 Mar 2021 15:05:05 +0000 (22:05 +0700)
* also change NOT_INTERACTIVE to INTERACTIVE so it can be used with
fallthrough

Signed-off-by: Michael Benedict <michaelbt@live.com>
Change-Id: I1af27d2503b98bd873c8fe84a1028cd46e7a4a53

aidl/power-libperfmgr/Power.cpp
aidl/power-libperfmgr/powerhint.json.template

index 8bd8282ec5b6f5a2b12110501dc72571f9b0039d..b7a51d9fc89be0d4c875ede6c518873edabd39e6 100644 (file)
@@ -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();
index 359dad8245a5f9f937dc304bc8084944743a391f..b3d93c26a2a80087289b066301a9c0ae27707cba 100644 (file)
             "Name": "TouchscreenEnable",
             "Path": "/sys/class/input/input3/enabled",
             "Values": [
-                "0",
-                "1"
+                "1",
+                "0"
             ],
             "ResetOnInit": true
         },
             "Value": "585000000"
         },
         {
-            "PowerHint": "NOT_INTERACTIVE",
+            "PowerHint": "INTERACTIVE",
             "Node": "TouchscreenEnable",
             "Duration": 0,
-            "Value": "0"
+            "Value": "1"
         },
         {
             "PowerHint": "DOUBLE_TAP_TO_WAKE",