Fix onKeyPreIme not called when enableOnBackInvokedCallback=false
Currently, IME callbacks are registered regardless of enableOnBackInvokedCallback being false. That causes the whole logic of onKeyPreIme in ViewRootImpl to be skipped entirely, because back events are directly dispatched to the IME callback. Instead, we should not register the IME callback if the app has not set enableOnBackInvokedCallback=true. In that case, back events will be dispatched to the compat-callback from ViewRoot which will inject BACK_KEY events which are piped through the usual key handling (including onKeyPreIme). Bug: 336470108 Flag: NONE Test: atest FrameworksCoreTests:WindowOnBackInvokedDispatcherTest Test: Manual, i.e. verifying that onKeyPreIme is called when enableOnBackInvokedCallback=false Change-Id: I8222cbc94ec25a366ced1139e3f99831114efbd5
Loading
Please register or sign in to comment