Merge "Allow IME to register system back callbacks in ImeOnBackInvokedDispatcher#switchRootView." into tm-qpr-dev
This commit is contained in:
@@ -220,16 +220,14 @@ public class ImeOnBackInvokedDispatcher implements OnBackInvokedDispatcher, Parc
|
|||||||
* @param previous the previously focused {@link ViewRootImpl}.
|
* @param previous the previously focused {@link ViewRootImpl}.
|
||||||
* @param current the currently focused {@link ViewRootImpl}.
|
* @param current the currently focused {@link ViewRootImpl}.
|
||||||
*/
|
*/
|
||||||
// TODO(b/232845902): Add CTS to test IME back behavior when there's root view change while
|
|
||||||
// IME is up.
|
|
||||||
public void switchRootView(ViewRootImpl previous, ViewRootImpl current) {
|
public void switchRootView(ViewRootImpl previous, ViewRootImpl current) {
|
||||||
for (ImeOnBackInvokedCallback imeCallback : mImeCallbacks) {
|
for (ImeOnBackInvokedCallback imeCallback : mImeCallbacks) {
|
||||||
if (previous != null) {
|
if (previous != null) {
|
||||||
previous.getOnBackInvokedDispatcher().unregisterOnBackInvokedCallback(imeCallback);
|
previous.getOnBackInvokedDispatcher().unregisterOnBackInvokedCallback(imeCallback);
|
||||||
}
|
}
|
||||||
if (current != null) {
|
if (current != null) {
|
||||||
current.getOnBackInvokedDispatcher().registerOnBackInvokedCallback(
|
current.getOnBackInvokedDispatcher().registerOnBackInvokedCallbackUnchecked(
|
||||||
imeCallback.mPriority, imeCallback);
|
imeCallback, imeCallback.mPriority);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user