mirror of
https://gitee.com/openharmony/accessibility
synced 2024-11-27 00:51:07 +00:00
解决后台任务主动聚焦失败问题
Signed-off-by: fanzexuan <fanzexuan@huawei.com>
This commit is contained in:
parent
f7d3ce90b7
commit
e5f20a6b85
@ -56,6 +56,7 @@ public:
|
||||
int64_t GetSceneBoardElementId(const int32_t windowId, const int64_t elementId);
|
||||
int32_t GetRealWindowId(const sptr<Rosen::AccessibilityWindowInfo> windowInfo);
|
||||
bool IsSceneBoard(const sptr<Rosen::AccessibilityWindowInfo> windowInfo);
|
||||
bool IsScenePanel(const sptr<Rosen::AccessibilityWindowInfo> windowInfo);
|
||||
|
||||
// used for batch query, provide window and element id translation
|
||||
void GetRealWindowAndElementId(int32_t& windowId, int64_t& elementId);
|
||||
|
@ -28,6 +28,7 @@ namespace OHOS {
|
||||
namespace Accessibility {
|
||||
namespace {
|
||||
const std::string TIMER_GET_ACCESSIBILITY_WINDOWS = "accessibilty:getAccessibilityWindowInfo";
|
||||
const std::string SCB_SCENE_PANEL = "SCBScenePanel";
|
||||
constexpr int32_t WMS_TIMEOUT = 10; // s
|
||||
}
|
||||
|
||||
@ -333,6 +334,11 @@ bool AccessibilityWindowManager::IsSceneBoard(const sptr<Rosen::AccessibilityWin
|
||||
return false;
|
||||
}
|
||||
|
||||
bool AccessibilityWindowManager::IsScenePanel(const sptr<Rosen::AccessibilityWindowInfo> windowInfo)
|
||||
{
|
||||
return windowInfo->bundleName_.find(SCB_SCENE_PANEL) != std::string::npos;
|
||||
}
|
||||
|
||||
AccessibilityWindowInfo AccessibilityWindowManager::CreateAccessibilityWindowInfo(
|
||||
const sptr<Rosen::AccessibilityWindowInfo> windowInfo)
|
||||
{
|
||||
@ -830,7 +836,8 @@ void AccessibilityWindowManager::WindowUpdateAll(const std::vector<sptr<Rosen::A
|
||||
sceneBoardElementIdMap_.InsertPair(realWid, window->uiNodeId_);
|
||||
}
|
||||
|
||||
if (window->focused_) {
|
||||
// IsScenePanel for recent-task window
|
||||
if (window->focused_ || IsScenePanel(window)) {
|
||||
SetActiveWindow(realWid);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user