xpower foucs window

Signed-off-by: wanc361 <bluesky7417@126.com>
Change-Id: I2d509346b4862db26d74834cc0997e5a1f3fca83
Signed-off-by: wanc361 <bluesky7417@126.com>
This commit is contained in:
wanc361 2023-05-31 10:04:39 +08:00
parent 934cc88938
commit 60423dec8c
2 changed files with 13 additions and 1 deletions

View File

@ -107,4 +107,9 @@ WM_REPORT_WINDOW_DESTORY:
WM_REPORT_HIDE_NAVIGATIONBAR:
__BASE: {type: STATISTIC, level: MINOR, desc: The navigation bar is hidden}
MSG: {type: STRING, desc: windowmanager event message}
MSG: {type: STRING, desc: windowmanager event message}
FOCUS_WINDOW:
__BASE: {type: BEHAVIOR, level: MINOR, tag: PowerStats, desc: Window focus changed}
PID: {type: INT32, desc: app pid}
UID: {type: INT32, desc: app uid}

View File

@ -38,6 +38,7 @@
#include "wm_common_inner.h"
#include "wm_math.h"
#include "perform_reporter.h"
#include <hisysevent.h>
namespace OHOS {
namespace Rosen {
@ -2785,6 +2786,12 @@ void WindowImpl::UpdateFocusStatus(bool focused)
{
WLOGFD("IsFocused: %{public}d, id: %{public}u", focused, property_->GetWindowId());
if (focused) {
HiSysEventWrite(
OHOS::HiviewDFX::HiSysEvent::Domain::WINDOW_MANAGER,
"FOCUS_WINDOW",
OHOS::HiviewDFX::HiSysEvent::EventType::BEHAVIOR,
"PID", getpid(),
"UID", getuid());
NotifyAfterFocused();
} else {
NotifyAfterUnfocused();