Merge "Respect the enforce flag for callback registration." into tm-qpr-dev

This commit is contained in:
Shan Huang
2022-08-09 22:34:23 +00:00
committed by Android (Google) Code Review

View File

@@ -325,7 +325,8 @@ public class WindowOnBackInvokedDispatcher implements OnBackInvokedDispatcher {
public boolean checkApplicationCallbackRegistration(int priority,
OnBackInvokedCallback callback) {
if (!mApplicationCallBackEnabled
&& !(callback instanceof CompatOnBackInvokedCallback)) {
&& !(callback instanceof CompatOnBackInvokedCallback)
&& !ALWAYS_ENFORCE_PREDICTIVE_BACK) {
Log.w("OnBackInvokedCallback",
"OnBackInvokedCallback is not enabled for the application."
+ "\nSet 'android:enableOnBackInvokedCallback=\"true\"' in the"