Merge "Allow IME to register callbacks with negative priorities." into tm-qpr-dev am: 77bef7e1d5

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/20766528

Change-Id: If1f98148d0b1457fab3ea1852113e8f387e58807
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Shan Huang
2022-12-22 21:17:59 +00:00
committed by Automerger Merge Worker

View File

@@ -123,7 +123,7 @@ public class ImeOnBackInvokedDispatcher implements OnBackInvokedDispatcher, Parc
private void receive(
int resultCode, Bundle resultData,
@NonNull OnBackInvokedDispatcher receivingDispatcher) {
@NonNull WindowOnBackInvokedDispatcher receivingDispatcher) {
final int callbackId = resultData.getInt(RESULT_KEY_ID);
if (resultCode == RESULT_CODE_REGISTER) {
int priority = resultData.getInt(RESULT_KEY_PRIORITY);
@@ -140,11 +140,11 @@ public class ImeOnBackInvokedDispatcher implements OnBackInvokedDispatcher, Parc
@NonNull IOnBackInvokedCallback iCallback,
@OnBackInvokedDispatcher.Priority int priority,
int callbackId,
@NonNull OnBackInvokedDispatcher receivingDispatcher) {
@NonNull WindowOnBackInvokedDispatcher receivingDispatcher) {
final ImeOnBackInvokedCallback imeCallback =
new ImeOnBackInvokedCallback(iCallback, callbackId, priority);
mImeCallbacks.add(imeCallback);
receivingDispatcher.registerOnBackInvokedCallback(priority, imeCallback);
receivingDispatcher.registerOnBackInvokedCallbackUnchecked(imeCallback, priority);
}
private void unregisterReceivedCallback(