DO NOT MERGE Add logging for when IOnBackInvokedCallback is null.

It should never be null. We had a bug where the IME callback can be
unexpectedly GC-ed and jam back nav. This is to verify if we need its
fix ag/21301891 in QPR as well.

Bug: 274911901
Test: atest WindowOnBackInvokedDispatcherTest
Change-Id: Ic2a576655ca16577ca35f3544f5b26d4a0db8f90
This commit is contained in:
Shan Huang
2023-04-04 01:32:16 +00:00
parent e3cbc37188
commit 306150025c

View File

@@ -291,6 +291,7 @@ public class WindowOnBackInvokedDispatcher implements OnBackInvokedDispatcher {
mProgressAnimator.reset();
final OnBackInvokedCallback callback = mCallback.get();
if (callback == null) {
Log.d(TAG, "Trying to call onBackInvoked() on a null callback reference.");
return;
}
callback.onBackInvoked();