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/inc/button_handler.hpp b/inc/button_handler.hpp
old mode 100644
new mode 100755
index 1f74f18..e398a0a
--- a/inc/button_handler.hpp
+++ b/inc/button_handler.hpp
@@ -9,10 +9,8 @@
enum class PowerEvent
{
powerPressed,
- longPowerPressed,
resetPressed,
powerReleased,
- longPowerReleased,
resetReleased
};
/**
@@ -47,24 +45,13 @@
/**
* @brief The handler for a power button press
*
- * It will power on the system if it's currently off,
- * else it will soft power it off.
+ * It will do power action according to the pressing duration.
*
* @param[in] msg - sdbusplus message from signal
*/
void powerReleased(sdbusplus::message_t& msg);
/**
- * @brief The handler for a long power button press
- *
- * If the system is currently powered on, it will
- * perform an immediate power off.
- *
- * @param[in] msg - sdbusplus message from signal
- */
- void longPowerPressed(sdbusplus::message_t& msg);
-
- /**
* @brief The handler for an ID button press
*
* Toggles the ID LED group
@@ -138,7 +125,8 @@
*
* @return void
*/
- void handlePowerEvent(PowerEvent powerEventType);
+ void handlePowerEvent(PowerEvent powerEventType,
+ std::chrono::microseconds duration);
/**
* @brief sdbusplus connection object