Merge "Do not forward & register IME compat back callback in the app process." into udc-dev am: 46890aaa8b am: b1a5752ec9
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/21594438 Change-Id: I17d8c95039f7e5d7725b33b053486cf1bc8f965f Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -11382,6 +11382,10 @@ public final class ViewRootImpl implements ViewParent,
|
||||
sendBackKeyEvent(KeyEvent.ACTION_DOWN);
|
||||
sendBackKeyEvent(KeyEvent.ACTION_UP);
|
||||
};
|
||||
if (mOnBackInvokedDispatcher.hasImeOnBackInvokedDispatcher()) {
|
||||
Log.d(TAG, "Skip registering CompatOnBackInvokedCallback on IME dispatcher");
|
||||
return;
|
||||
}
|
||||
mOnBackInvokedDispatcher.registerOnBackInvokedCallback(
|
||||
OnBackInvokedDispatcher.PRIORITY_DEFAULT, mCompatOnBackInvokedCallback);
|
||||
}
|
||||
|
||||
@@ -357,6 +357,11 @@ public class WindowOnBackInvokedDispatcher implements OnBackInvokedDispatcher {
|
||||
mImeDispatcher = imeDispatcher;
|
||||
}
|
||||
|
||||
/** Returns true if a non-null {@link ImeOnBackInvokedDispatcher} has been set. **/
|
||||
public boolean hasImeOnBackInvokedDispatcher() {
|
||||
return mImeDispatcher != null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Class used to check whether a callback can be registered or not. This is meant to be
|
||||
* shared with {@link ProxyOnBackInvokedDispatcher} which needs to do the same checks.
|
||||
|
||||
Reference in New Issue
Block a user