Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7700039a authored by wilsonshih's avatar wilsonshih
Browse files

Forward back key events when no top onBackInvokedCallback registered.

This allows the event to propagate through the view hierarchy, for
instance, from a floating window that has not registered its own callback.

Bug: 415970831
Flag: EXEMPT bugfix
Test: create floating window by using FrameLayout, verify it can
receive back key even if no onBackInvokedCallback registered.

Change-Id: I106ba93d4a793a634535d2dcbbd4f145d7a3a4f0
parent 664cee66
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -7732,7 +7732,8 @@ public final class ViewRootImpl implements ViewParent,
                    }
                }
            }
            if (keyEvent.getAction() == KeyEvent.ACTION_UP) {
            // Do not cancel the keyEvent if no callback can handle the back event.
            if (topCallback != null && keyEvent.getAction() == KeyEvent.ACTION_UP) {
                // forward a cancelled event so that following stages cancel their back logic
                keyEvent.cancel();
            }