From dcf0a02b87b9159f1ca40bf28dda4c0eea440edc Mon Sep 17 00:00:00 2001 From: Woochan Lee Date: Thu, 1 Feb 2024 16:27:42 +0900 Subject: [PATCH] libaurum: Deprecate press* methods It does not defined at IDevice.h Addtional keys will be added in KeyType then use generateKey() method instead of press* Change-Id: I3726916bcf69c580d8d520455815bd7c7bc7c819 --- libaurum/inc/UiDevice.h | 16 ++++++++++++++++ libaurum/src/UiDevice.cc | 30 ++++++++++++++++++++++++++++++ 2 files changed, 46 insertions(+) diff --git a/libaurum/inc/UiDevice.h b/libaurum/inc/UiDevice.h index 344857c..d2e6ae5 100644 --- a/libaurum/inc/UiDevice.h +++ b/libaurum/inc/UiDevice.h @@ -385,6 +385,22 @@ public: */ bool generateKey(KeyType keyType, KeyRequestType keyReqestType); + /** + * @brief Simulates a hardware key. + * + * @param[in] type one of @KeyRequestType + * + * @return true if the press back succeeded else false + * + * @deprecated Since 9.0 + */ + bool pressBack(KeyRequestType type); + bool pressHome(KeyRequestType type); + bool pressMenu(KeyRequestType type); + bool pressVolUp(KeyRequestType type); + bool pressVolDown(KeyRequestType type); + bool pressPower(KeyRequestType type); + private: /** * @brief Waits process idle. diff --git a/libaurum/src/UiDevice.cc b/libaurum/src/UiDevice.cc index c53ee3f..98d98bc 100644 --- a/libaurum/src/UiDevice.cc +++ b/libaurum/src/UiDevice.cc @@ -349,6 +349,36 @@ bool UiDevice::generateKey(KeyType keyType, KeyRequestType keyReqestType) return result; } +bool UiDevice::pressBack(KeyRequestType type) +{ + return generateKey(KeyType::BACK, type); +} + +bool UiDevice::pressHome(KeyRequestType type) +{ + return generateKey(KeyType::HOME, type); +} + +bool UiDevice::pressMenu(KeyRequestType type) +{ + return generateKey(KeyType::MENU, type); +} + +bool UiDevice::pressVolUp(KeyRequestType type) +{ + return generateKey(KeyType::VOLUP, type); +} + +bool UiDevice::pressVolDown(KeyRequestType type) +{ + return generateKey(KeyType::VOLDOWN, type); +} + +bool UiDevice::pressPower(KeyRequestType type) +{ + return generateKey(KeyType::POWER, type); +} + bool UiDevice::pressKeyCode(std::string keycode, KeyRequestType type) { bool result = mDeviceImpl->pressKeyCode(keycode, type); -- 2.7.4