Adjust cancel back navigation conditions.
There will cancel back navigation when navigation window lose focus, for this change we also monitor when transition happens on navigation target. There are two shortcomings for monitor the navigation window lose focus. First is that it may cause misjudgment in multi-window mode. The navigation window can be the one in split screen, but if another task start a transition(e.g. start/finish activity), that should be irrelevant to the navigation target, but that task could gain focus for a short time. Another thing is that while back animating, the window can lose focus if the close animation applys alpha = 0 to the closing target, but that should be acceptable for animation. So for window focus change, there can only used to monitor when the new focus window is a stand alone winodw, or when the parent activity is navigating. And in order to cancel gesture for any change above window-level, monitor if a new transition happens which contains the navigation window. Bug: 131727607 Test: atest BackAnimationControllerTest BackNavigationControllerTests Test: manual, into split screen, start back animation on top task, and start an activity from bottom task, verify the back animation won't be canceled. Test: manual, during back-to-home animating, start another activity in the same task, and verify shell should cancel the navigation. Test: manual, verify ANR window can cancel back animation. Test: manual, animation won't be canceled while playing a cross activity animation with alpha=0. Change-Id: Ia7acd041ec7afd3d94482f0950003fea499ce82b
Loading
Please register or sign in to comment