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

Commit d23995b6 authored by wilsonshih's avatar wilsonshih
Browse files

Fixes PB won't close sub-window of an activity as close_dialog.

Instead of check the hierarchy, check whether to close stand alone
window by it's type.

Flag: EXEMPT bugfix
Bug: 382292526
Test: atest BackNavigationControllerTests
Test: verify no matter the layer of a stand alone window is, it should
be close as TYPE_DIALOG_CLOSE.

Change-Id: Ibd4b5716aeffc37b50e61f5bf6dc26e6e20d217a
parent ec2652a9
Loading
Loading
Loading
Loading
+2 −6
Original line number Diff line number Diff line
@@ -275,12 +275,8 @@ class BackNavigationController {
            final boolean isOccluded = isKeyguardOccluded(window);
            if (!canAnimate) {
                backType = BackNavigationInfo.TYPE_CALLBACK;
            } else if ((window.getParent().getChildCount() > 1
                    && window.getParent().getChildAt(0) != window)) {
                // TODO Dialog window does not need to attach on activity, check
                // window.mAttrs.type != TYPE_BASE_APPLICATION
                // Are we the top window of our parent? If not, we are a window on top of the
                // activity, we won't close the activity.
            } else if (window.mAttrs.type != TYPE_BASE_APPLICATION) {
                // The focus window belongs to an activity and it's not the base window.
                backType = BackNavigationInfo.TYPE_DIALOG_CLOSE;
                removedWindowContainer = window;
            } else if (hasTranslucentActivity(currentActivity, prevActivities)) {