Add task focus change support to FocusTransitionListener
This change adds task focus change support to FocusTransitionListener to replace TaskInfo#isFocused with system-wide focus state. The ideal, long-term solution is to implement this with a unified task repository in WMShell, but as the project isn't ready yet, this change workarounds some pain points that come from the compatibility with existing APIs. With this change, instead of FocusTransitionObserver registering as TransitionObserver, focus state in FocusTransitionObserver is updated in FreeformTransitionObserver#onTransitionReady(). This is because focus state needs to be updated before FreeformTransitionObserver processes the transition. Having one observer should be simpler than having a order requirement between two observers, and this is effectively merging FocusTransitionObserver and FreeformTransitionObserver from the perspective of TransitionObserver, but keeps these classes seperately to both avoid circular dependency and isolate responsibilities. (Now FocusTransitionObserver no longer implements TransitionObserver.) Bug: 371143601 Flag: com.android.window.flags.enable_display_focus_in_shell_transitions Test: atest FocusTransitionObserverTest Change-Id: I68b6aaa44cf8578d3dcac3277c66e3d07738eef8
Loading
Please register or sign in to comment