adb shell dumpsys window windows output describing

南楼画角 提交于 2019-12-03 14:25:45

The explanation of the difference between mCurrentFocus and mFocusedApp stares right at you:

$ dumpsys window windows | grep -E 'mCurrentFocus|mFocusedApp'
    mCurrentFocus=Window{X uX package/.activity}
    mFocusedApp=AppWindowToken{X token=Token{X ActivityRecord{X uX package/.activity tX}}}

The mCurrentFocus is a Window (just a view which may or may not have an ActivityRecord associated with it)

The mFocusedApp is an AppWindowToken (an app Token which will always have an ActivityRecord)

So when input focus switches to a view with an activity - both mCurrentFocus and mFocusedApp would show the same activity. But sometimes focus switches to a view without an activity (like parts of SystemUI, etc) - then mCurrentFocus will be showing that view but mFocusedApp will still be showing the ActivityRecord of the app which had the focus before the last switch.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!