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

Commit c200310e authored by Jerry Chang's avatar Jerry Chang Committed by Android (Google) Code Review
Browse files

Merge "Do not dismiss split if stages are not visible due to screen is sleeping" into sc-v2-dev

parents fce6b1c0 c04541c0
Loading
Loading
Loading
Loading
+11 −1
Original line number Diff line number Diff line
@@ -239,6 +239,12 @@ public class TaskInfo {
     */
    public boolean isVisible;

    /**
     * Whether this task is sleeping due to sleeping display.
     * @hide
     */
    public boolean isSleeping;

    TaskInfo() {
        // Do nothing
    }
@@ -342,7 +348,8 @@ public class TaskInfo {
                && getWindowingMode() == that.getWindowingMode()
                && Objects.equals(taskDescription, that.taskDescription)
                && isFocused == that.isFocused
                && isVisible == that.isVisible;
                && isVisible == that.isVisible
                && isSleeping == that.isSleeping;
    }

    /**
@@ -396,6 +403,7 @@ public class TaskInfo {
        parentTaskId = source.readInt();
        isFocused = source.readBoolean();
        isVisible = source.readBoolean();
        isSleeping = source.readBoolean();
        topActivityToken = source.readStrongBinder();
        topActivityInSizeCompat = source.readBoolean();
        mTopActivityLocusId = source.readTypedObject(LocusId.CREATOR);
@@ -434,6 +442,7 @@ public class TaskInfo {
        dest.writeInt(parentTaskId);
        dest.writeBoolean(isFocused);
        dest.writeBoolean(isVisible);
        dest.writeBoolean(isSleeping);
        dest.writeStrongBinder(topActivityToken);
        dest.writeBoolean(topActivityInSizeCompat);
        dest.writeTypedObject(mTopActivityLocusId, flags);
@@ -462,6 +471,7 @@ public class TaskInfo {
                + " parentTaskId=" + parentTaskId
                + " isFocused=" + isFocused
                + " isVisible=" + isVisible
                + " isSleeping=" + isSleeping
                + " topActivityToken=" + topActivityToken
                + " topActivityInSizeCompat=" + topActivityInSizeCompat
                + " locusId= " + mTopActivityLocusId
+8 −5
Original line number Diff line number Diff line
@@ -116,7 +116,7 @@ class StageCoordinator implements SplitLayout.SplitLayoutHandler,
    private final List<SplitScreen.SplitScreenListener> mListeners = new ArrayList<>();
    private final DisplayImeController mDisplayImeController;
    private final SplitScreenTransitions mSplitTransitions;
    private boolean mExitSplitScreenOnHide = true;
    private boolean mExitSplitScreenOnHide;
    private boolean mKeyguardOccluded;

    // TODO(b/187041611): remove this flag after totally deprecated legacy split
@@ -415,10 +415,13 @@ class StageCoordinator implements SplitLayout.SplitLayoutHandler,
        // Divider is only visible if both the main stage and side stages are visible
        setDividerVisibility(isSplitScreenVisible());

        if (mExitSplitScreenOnHide && !mainStageVisible && !sideStageVisible) {
            // Exit split-screen if both stage are not visible.
            // TODO: This is only a temporary request from UX and is likely to be removed soon...
        if (!mainStageVisible && !sideStageVisible) {
            if (mExitSplitScreenOnHide
            // Don't dismiss staged split when both stages are not visible due to sleeping display,
            // like the cases keyguard showing or screen off.
            || (!mMainStage.mRootTaskInfo.isSleeping && !mSideStage.mRootTaskInfo.isSleeping)) {
                exitSplitScreen();
            }
        } else if (mKeyguardOccluded) {
            // At least one of the stages is visible while keyguard occluded. Dismiss split because
            // there's show-when-locked activity showing on top of keyguard. Also make sure the
+1 −0
Original line number Diff line number Diff line
@@ -4136,6 +4136,7 @@ class Task extends WindowContainer<WindowContainer> {
                : INVALID_TASK_ID;
        info.isFocused = isFocused();
        info.isVisible = hasVisibleChildren();
        info.isSleeping = shouldSleepActivities();
        ActivityRecord topRecord = getTopNonFinishingActivity();
        info.mTopActivityLocusId = topRecord != null ? topRecord.getLocusId() : null;
    }