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

Commit 4ec5e6ec authored by Simon (Qiong) Sun's avatar Simon (Qiong) Sun
Browse files

Prevent Bubble hiding in Flex Split immersive status bar

Introduces a new API in SplitScreenController to query the Split Status Bar's immersive mode. This prevents the bubble from being hidden when the Split Status Bar is in immersive mode.

Bug: 424712007
Flag: com.android.wm.shell.enable_flexible_two_app_split
Test: Manual test
Change-Id: I5b9f61e69abdcaffd6e69778022f8edb87b9c198
parent ea666b27
Loading
Loading
Loading
Loading
+10 −3
Original line number Diff line number Diff line
@@ -781,11 +781,18 @@ public class BubbleController implements ConfigurationChangeListener,
     */
    private void onStatusBarVisibilityChanged(boolean visible) {
        if (mStackView != null) {
            //Checks if the status bar is currently immersive due to Split-Screen mode.
            final boolean isSplitStatusBarImmersive = mSplitScreenController.get()
                    .map(SplitScreenController::isStatusBarImmersive)
                    .orElse(false);
            // Hide the stack temporarily if the status bar has been made invisible, and the stack
            // is collapsed. An expanded stack should remain visible until collapsed.
            mStackView.setTemporarilyInvisible(!visible && !isStackExpanded());
            ProtoLog.d(WM_SHELL_BUBBLES, "onStatusBarVisibilityChanged=%b stackExpanded=%b",
                    visible, isStackExpanded());
            mStackView.setTemporarilyInvisible(!visible && !isStackExpanded()
                    && !isSplitStatusBarImmersive);
            ProtoLog.d(WM_SHELL_BUBBLES,
                    "onStatusBarVisibilityChanged=%b stackExpanded=%b "
                            + "isSplitStatusBarImmersive=%b",
                    visible, isStackExpanded(), isSplitStatusBarImmersive);
        }
    }

+8 −0
Original line number Diff line number Diff line
@@ -1042,6 +1042,14 @@ public class SplitScreenController implements SplitDragPolicy.Starter,
        }
    }

    /**
     * Returns whether the status bar is in immersive mode.
     * @return true if the status bar is in immersive mode.
     */
    public boolean isStatusBarImmersive() {
        return mStageCoordinator.isStatusBarImmersive();
    }

    /**
     * Return the {@param exitReason} as a string.
     */
+3 −2
Original line number Diff line number Diff line
@@ -93,6 +93,7 @@ class SplitStatusBarHider(
        updateStatusBarBehavior(currentSplitState, leftRightSplit, isSplitVisible)
    }

    fun isStatusBarImmersive(): Boolean = statusBarImmersiveForSplit
    /**
     * Determines if we want to put the status bar in immersive mode or not based on
     * [currentSplitState], [isLeftRightSplit], and [isSplitVisible].
+8 −0
Original line number Diff line number Diff line
@@ -4532,6 +4532,14 @@ public class StageCoordinator implements SplitLayout.SplitLayoutHandler,
        }
    }

    /**
     * Returns whether the status bar is in immersive mode.
     * @return true if the status bar is in immersive mode.
     */
    public boolean isStatusBarImmersive() {
        return mStatusBarHider.isStatusBarImmersive();
    }

    @NeverCompile
    @Override
    public void dump(@NonNull PrintWriter pw, String prefix) {