Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit be080849 authored by Shan Huang's avatar Shan Huang
Browse files

Fix Dialog default callback registering at the wrong priority.

Bug:259602785
Test: In a standalone app, register a callback in Dialog#onCreate() with default priority. Make sure the dialog callback can be invoked.
Test: BackNavigationTests#registerCallback_dialog (run on master)

Change-Id: I9cfd596611fb341389cda44e3605c1e99ddc3791
parent b73cda83
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -458,8 +458,7 @@ public class Dialog implements DialogInterface, Window.Callback,
                && WindowOnBackInvokedDispatcher.isOnBackInvokedCallbackEnabled(mContext)) {
            // Add onBackPressed as default back behavior.
            mDefaultBackCallback = this::onBackPressed;
            getOnBackInvokedDispatcher().registerOnBackInvokedCallback(
                    OnBackInvokedDispatcher.PRIORITY_DEFAULT, mDefaultBackCallback);
            getOnBackInvokedDispatcher().registerSystemOnBackInvokedCallback(mDefaultBackCallback);
            mDefaultBackCallback = null;
        }
    }