summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Shan Huang <shanh@google.com> 2023-01-04 21:39:56 +0000
committer Shan Huang <shanh@google.com> 2023-01-04 21:39:59 +0000
commit6577b62a5d89e73d9ce05423c72d2ff213ec0097 (patch)
tree89ce9456d94a2d0fef7e96241539142c0a728681
parenta9ad4038b3fe93bff19f8b5ebc51d3ca2af338c3 (diff)
Allow IME to register system back callbacks in
ImeOnBackInvokedDispatcher#switchRootView. This has the same purpose as ag/20766528, which only addressed one of the two occurances of IME registering callbacks. Bug: 262727745 Test: CtsInputMethodTestCases Test: KeyboardVisibilityControlTest Change-Id: I0ad892f17211a132d8a69b7f68a6c10f5740c457
-rw-r--r--core/java/android/window/ImeOnBackInvokedDispatcher.java6
1 files changed, 2 insertions, 4 deletions
diff --git a/core/java/android/window/ImeOnBackInvokedDispatcher.java b/core/java/android/window/ImeOnBackInvokedDispatcher.java
index 9152e7837b82..a0bd7f70ca58 100644
--- a/core/java/android/window/ImeOnBackInvokedDispatcher.java
+++ b/core/java/android/window/ImeOnBackInvokedDispatcher.java
@@ -220,16 +220,14 @@ public class ImeOnBackInvokedDispatcher implements OnBackInvokedDispatcher, Parc
* @param previous the previously 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) {
for (ImeOnBackInvokedCallback imeCallback : mImeCallbacks) {
if (previous != null) {
previous.getOnBackInvokedDispatcher().unregisterOnBackInvokedCallback(imeCallback);
}
if (current != null) {
- current.getOnBackInvokedDispatcher().registerOnBackInvokedCallback(
- imeCallback.mPriority, imeCallback);
+ current.getOnBackInvokedDispatcher().registerOnBackInvokedCallbackUnchecked(
+ imeCallback, imeCallback.mPriority);
}
}
}