Remove power button long-press
So far, counting power button's pressing duration is supported.
There's no need to handle redundant case for button long-press.
Tested:
Press buttons and check corresponding behaviors.
Change-Id: I96d9160a10de6d4572148c55e2b7c2a9221d42e2
Signed-off-by: DelphineCCChiu <Delphine_CC_Chiu@wiwynn.com>
diff --git a/src/power_button.cpp b/src/power_button.cpp
index 195030a..80334a8 100644
--- a/src/power_button.cpp
+++ b/src/power_button.cpp
@@ -77,18 +77,9 @@
"POWER_BUTTON: released");
auto now = std::chrono::steady_clock::now();
- auto d = std::chrono::duration_cast<std::chrono::milliseconds>(
+ auto d = std::chrono::duration_cast<std::chrono::microseconds>(
now - getPressTime());
-
- if (d > std::chrono::milliseconds(LONG_PRESS_TIME_MS))
- {
- pressedLong();
- }
- else
- {
- // released
- released(std::chrono::duration_cast<std::chrono::microseconds>(d)
- .count());
- }
+ // released
+ released(d.count());
}
}