Refactor IME callback registration

This refactoring aims to slightly simplify the IME back callback registration. The alternate constructor for OnBackInvokedCallbackWrapper is removed and with it a number of back and forth communication between ImeOnBackInvokedDispatcher and WindowOnBackInvokedDispatcher. ImeOnBackInvokedDispatcher also no longer needs to hold its own touch tracker, handler and BackProgressAnimator.

It comes at the cost of one more layer of callback wrapping. This means that the OnBackInvokedCallback coming from the IME is wrapped once before sending it from the IME process to the app process. It is wrapped a second time when it is sent from the app process to WM (if it is the top callback).

Bug: 341013064
Test: atest FrameworksCoreTests:WindowOnBackInvokedDispatcherTest
Test: Manual, i.e. testing that registered ImeOnBackInvokedCallbacks work correctly.
Change-Id: I45744fb5c62786a437880c013427083f42562e55
3 files changed