Merge "Respect the enforce flag for callback registration." into tm-qpr-dev am: a2c8daf7d1 am: fa21ec758e

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

Change-Id: Ib397a041f574fcd547ebb556ef56970087ce979c
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Shan Huang
2022-08-09 23:05:00 +00:00
committed by Automerger Merge Worker

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"