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

Commit 84a60628 authored by Robert Carr's avatar Robert Carr Committed by Rob Carr
Browse files

WindowManager Task: Update surface visibility

Currently task never updates it's Surface visibility
and it relies on its children becoming invisible. This has been ok
as activity visibility was always managed correctly. As we move towards
attaching overlays to tasks though, we need to fix this issue so that
overlays will automatically be made invisible when the task is
dismissed.

Bug: 213603716
Test: Existing tests pass
Change-Id: I5806d69d34cfbad7717c405852e025634f3947a2
parent 188675b2
Loading
Loading
Loading
Loading
+15 −0
Original line number Original line Diff line number Diff line
@@ -125,6 +125,8 @@ import static com.android.server.wm.TaskProto.SURFACE_HEIGHT;
import static com.android.server.wm.TaskProto.SURFACE_WIDTH;
import static com.android.server.wm.TaskProto.SURFACE_WIDTH;
import static com.android.server.wm.TaskProto.TASK_FRAGMENT;
import static com.android.server.wm.TaskProto.TASK_FRAGMENT;
import static com.android.server.wm.WindowContainer.AnimationFlags.CHILDREN;
import static com.android.server.wm.WindowContainer.AnimationFlags.CHILDREN;
import static com.android.server.wm.WindowContainer.AnimationFlags.PARENTS;
import static com.android.server.wm.WindowContainer.AnimationFlags.TRANSITION;
import static com.android.server.wm.WindowContainerChildProto.TASK;
import static com.android.server.wm.WindowContainerChildProto.TASK;
import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_ROOT_TASK;
import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_ROOT_TASK;
import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_TASK_MOVEMENT;
import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_TASK_MOVEMENT;
@@ -609,6 +611,8 @@ class Task extends TaskFragment {
     */
     */
    ActivityRecord mChildPipActivity;
    ActivityRecord mChildPipActivity;


    boolean mLastSurfaceShowing = true;

    private Task(ActivityTaskManagerService atmService, int _taskId, Intent _intent,
    private Task(ActivityTaskManagerService atmService, int _taskId, Intent _intent,
            Intent _affinityIntent, String _affinity, String _rootAffinity,
            Intent _affinityIntent, String _affinity, String _rootAffinity,
            ComponentName _realActivity, ComponentName _origActivity, boolean _rootWasReset,
            ComponentName _realActivity, ComponentName _origActivity, boolean _rootWasReset,
@@ -3308,6 +3312,17 @@ class Task extends TaskFragment {
        if (mDimmer.updateDims(getPendingTransaction(), mTmpDimBoundsRect)) {
        if (mDimmer.updateDims(getPendingTransaction(), mTmpDimBoundsRect)) {
            scheduleAnimation();
            scheduleAnimation();
        }
        }

        // We intend to let organizer manage task visibility but it doesn't
        // have enough information until we finish shell transitions.
        // In the mean time we do an easy fix here.
        final boolean show = isVisible() || isAnimating(TRANSITION | PARENTS);
        if (mSurfaceControl != null) {
            if (show != mLastSurfaceShowing) {
                getSyncTransaction().setVisibility(mSurfaceControl, show);
            }
        }
        mLastSurfaceShowing = show;
    }
    }


    @Override
    @Override