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

Commit 349f014c authored by Shan Huang's avatar Shan Huang
Browse files

Clear application / system callback when the other one is set

Bug: 222675481
Test: In BackTestApp make sure activities can go back correctly after
opening & closing widgets.

Change-Id: I17abde2a87b059ccd0797931e172c22b54ec859c
parent 7c722ca4
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -859,6 +859,7 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP
    /**
     * @see #setOnBackInvokedCallback(IOnBackInvokedCallback)
     */
    // TODO(b/224856664): Consolidate application and system callback into one.
    private IOnBackInvokedCallback mApplicationOnBackInvokedCallback;
    private IOnBackInvokedCallback mSystemOnBackInvokedCallback;

@@ -1124,7 +1125,9 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP
                this, onBackInvokedCallback);
        if (priority >= 0) {
            mApplicationOnBackInvokedCallback = onBackInvokedCallback;
            mSystemOnBackInvokedCallback = null;
        } else {
            mApplicationOnBackInvokedCallback = null;
            mSystemOnBackInvokedCallback = onBackInvokedCallback;
        }
    }