wukong测试过程中控制中心,通知栏下拉可以强制跳回测试APP

Signed-off-by: 李延胜 <liyansheng4@huawei.com>
This commit is contained in:
李延胜
2024-12-18 15:13:06 +08:00
parent c1ca74edc3
commit 5e0fd2ff1c
3 changed files with 14 additions and 0 deletions
+2
View File
@@ -63,6 +63,8 @@ public:
*/
ErrCode BackToPrePage();
ErrCode BackToHome();
bool GetConnectStatus()
{
return connected_;
+4
View File
@@ -16,6 +16,7 @@
#include "app_manager.h"
#include "ability_manager_client.h"
#include "component_manager.h"
#include "element_name.h"
#include "wukong_define.h"
#include "wukong_util.h"
@@ -92,6 +93,7 @@ ErrCode AppManager::StartAbilityByBundleInfo(std::string abilityName, std::strin
} else {
AppExecFwk::ElementName element("", bundleName, abilityName);
want.SetElement(element);
ComponentManager::GetInstance()->BackToHome();
result = OHOS::AAFwk::AbilityManagerClient::GetInstance()->StartAbility(want);
if (result == OHOS::ERR_OK) {
output = STRING_START_ABILITY_OK;
@@ -111,6 +113,7 @@ ErrCode AppManager::StartAbilityByUriAndType(const std::string uri, const std::s
int result;
want.SetUri(uri);
want.SetType(typeVal);
ComponentManager::GetInstance()->BackToHome();
result = OHOS::AAFwk::AbilityManagerClient::GetInstance()->StartAbility(want);
if (result == OHOS::ERR_OK) {
INFO_LOG("The specified URI page is opened successfully.");
@@ -131,6 +134,7 @@ ErrCode AppManager::StartAbilityByAbilityAndUri(const std::string uri, const std
AppExecFwk::ElementName element("", allowList[0], abilityName[0]);
want.SetElement(element);
want.SetUri(uri);
ComponentManager::GetInstance()->BackToHome();
result = OHOS::AAFwk::AbilityManagerClient::GetInstance()->StartAbility(want);
if (result == OHOS::ERR_OK) {
INFO_LOG("The specified URI page is opened successfully.");
+8
View File
@@ -256,6 +256,14 @@ ErrCode ComponentManager::BackToPrePage()
return result;
}
ErrCode ComponentManager::BackToHome()
{
ErrCode result = ERR_OK;
int backKeyCode = OHOS::MMI::KeyEvent::KEYCODE_HOME;
result = MultimodeManager::GetInstance()->SingleKeyCodeInput(backKeyCode, DOWNTIME);
return result;
}
ErrCode ComponentManager::ComponentUpSwapInput(Accessibility::AccessibilityElementInfo& elementInfo)
{
// Calculate swap position