Fix pointers pilfered when they shouldn't be
When onThresholdCrossed is called and mBackNavigationInfo==null, we should't pilfer pointers if onBackNavigationInfoReceived has not been called before. Because it is possible that onThresholdCrossed is called before onBackNavigationInfoReceived is called. In that case mBackNavigationInfo is always null even though it may be set shortly after when onBackNavigationInfoReceived is called.
The issue can be reproduced for example with the IME predictive back animation in the Google Photos app. When executing the back gesture extremely fast, there is sometimes no predictive back animation on the IME because onThresholdCrossed is called before onBackNavigationInfoReceived.
Therefore we should add an additional check that verifies that onBackNavigationInfoReceived was indeed already called.
Bug: 351763151
Flag: com.android.window.flags.predictive_back_system_anims
Test: Manual, i.e. verifying that very quick back swipes do not cause pointers to be pilfered when they shouldn't be.
Change-Id: Icadead2be06dad724bca7f27704edbe5627beeac
1 file changed