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

Commit 15503c93 authored by Riddle Hsu's avatar Riddle Hsu Committed by Android (Google) Code Review
Browse files

Merge "Remove enabled flag respect_hierarchy_surface_visibility" into main

parents d40f9b88 1dba827b
Loading
Loading
Loading
Loading
+0 −11
Original line number Diff line number Diff line
@@ -29,17 +29,6 @@ flag {
  }
}

flag {
  name: "respect_hierarchy_surface_visibility"
  namespace: "windowing_frontend"
  description: "Ensure consistent surface visibility with window hierarchy"
  bug: "383241933"
  is_fixed_read_only: true
  metadata {
    purpose: PURPOSE_BUGFIX
  }
}

flag {
  name: "enforce_edge_to_edge"
  is_exported: true
+6 −51
Original line number Diff line number Diff line
@@ -106,7 +106,6 @@ import static android.internal.perfetto.protos.Windowmanagerservice.ActivityReco
import static android.internal.perfetto.protos.Windowmanagerservice.ActivityRecordProto.IS_ANIMATING;
import static android.internal.perfetto.protos.Windowmanagerservice.ActivityRecordProto.IS_USER_FULLSCREEN_OVERRIDE_ENABLED;
import static android.internal.perfetto.protos.Windowmanagerservice.ActivityRecordProto.LAST_DROP_INPUT_MODE;
import static android.internal.perfetto.protos.Windowmanagerservice.ActivityRecordProto.LAST_SURFACE_SHOWING;
import static android.internal.perfetto.protos.Windowmanagerservice.ActivityRecordProto.MIN_ASPECT_RATIO;
import static android.internal.perfetto.protos.Windowmanagerservice.ActivityRecordProto.NAME;
import static android.internal.perfetto.protos.Windowmanagerservice.ActivityRecordProto.NUM_DRAWN_WINDOWS;
@@ -221,7 +220,6 @@ import static com.android.server.wm.StartingData.AFTER_TRANSACTION_IDLE;
import static com.android.server.wm.StartingData.AFTER_TRANSACTION_REMOVE_DIRECTLY;
import static com.android.server.wm.StartingData.AFTER_TRANSITION_FINISH;
import static com.android.server.wm.SurfaceAnimator.ANIMATION_TYPE_APP_TRANSITION;
import static com.android.server.wm.SurfaceAnimator.ANIMATION_TYPE_PREDICT_BACK;
import static com.android.server.wm.SurfaceAnimator.ANIMATION_TYPE_WINDOW_ANIMATION;
import static com.android.server.wm.TaskFragment.TASK_FRAGMENT_VISIBILITY_VISIBLE;
import static com.android.server.wm.TaskPersister.DEBUG;
@@ -668,9 +666,6 @@ final class ActivityRecord extends WindowToken {
     */
    private boolean mCurrentLaunchCanTurnScreenOn = true;

    /** Whether our surface was set to be showing in the last call to {@link #prepareSurfaces} */
    boolean mLastSurfaceShowing;

    /**
     * The activity is opaque and fills the entire space of this task.
     * @see #occludesParent()
@@ -7178,38 +7173,12 @@ final class ActivityRecord extends WindowToken {

    @Override
    void prepareSurfaces() {
        if (mWmService.mFlags.mEnsureSurfaceVisibility) {
        // Input sink surface is not a part of animation, so apply in a steady state
        // (non-sync) with pending transaction.
        if (mVisible && mSyncState == SYNC_STATE_NONE) {
            mActivityRecordInputSink.applyChangesToSurfaceIfChanged(getPendingTransaction());
        }
        super.prepareSurfaces();
            return;
        }
        final boolean isDecorSurfaceBoosted =
                getTask() != null && getTask().isDecorSurfaceBoosted();
        final boolean show = (isVisible()
                // Ensure that the activity content is hidden when the decor surface is boosted to
                // prevent UI redressing attack.
                && !isDecorSurfaceBoosted)
                || isAnimating(PARENTS, ANIMATION_TYPE_APP_TRANSITION
                        | ANIMATION_TYPE_PREDICT_BACK);

        if (mSurfaceControl != null) {
            if (show && !mLastSurfaceShowing) {
                getSyncTransaction().show(mSurfaceControl);
            } else if (!show && mLastSurfaceShowing) {
                getSyncTransaction().hide(mSurfaceControl);
            }
            // Input sink surface is not a part of animation, so just apply in a steady state
            // (non-sync) with pending transaction.
            if (show && mSyncState == SYNC_STATE_NONE) {
                mActivityRecordInputSink.applyChangesToSurfaceIfChanged(getPendingTransaction());
            }
        }
        mLastSurfaceShowing = show;
        super.prepareSurfaces();
    }

    @Override
@@ -7221,13 +7190,6 @@ final class ActivityRecord extends WindowToken {
        t.setVisibility(mSurfaceControl, visible);
    }

    /**
     * @return Whether our {@link #getSurfaceControl} is currently showing.
     */
    boolean isSurfaceShowing() {
        return mLastSurfaceShowing;
    }

    public @TransitionOldType int getTransit() {
        return mTransit;
    }
@@ -9220,7 +9182,6 @@ final class ActivityRecord extends WindowToken {
    void dumpDebug(ProtoOutputStream proto, @WindowTracingLogLevel int logLevel) {
        writeNameToProto(proto, NAME);
        super.dumpDebug(proto, WINDOW_TOKEN, logLevel);
        proto.write(LAST_SURFACE_SHOWING, mLastSurfaceShowing);
        proto.write(IS_ANIMATING, isAnimating(PARENTS | CHILDREN,
                ANIMATION_TYPE_APP_TRANSITION | ANIMATION_TYPE_WINDOW_ANIMATION));
        proto.write(FILLS_PARENT, fillsParent());
@@ -9490,15 +9451,9 @@ final class ActivityRecord extends WindowToken {
    }

    boolean canCaptureSnapshot() {
        if (mWmService.mFlags.mEnsureSurfaceVisibility) {
        if (!mVisible) {
            return false;
        }
        } else {
            if (!isSurfaceShowing() || findMainWindow() == null) {
                return false;
            }
        }
        return forAllWindows(
                // Ensure at least one window for the top app is visible before attempting to
                // take a screenshot. Visible here means that the WSA surface is shown and has
+0 −7
Original line number Diff line number Diff line
@@ -1933,13 +1933,6 @@ class BackNavigationController {
                        openAnimationAdaptor.createStartingSurface(mSnapshot);
                    }
                }
                // Force update mLastSurfaceShowing for opening activity and its task.
                if (mWindowManagerService.mRoot.mTransitionController.isShellTransitionsEnabled()
                        && !mWindowManagerService.mFlags.mEnsureSurfaceVisibility) {
                    for (int i = visibleOpenActivities.length - 1; i >= 0; --i) {
                        WindowContainer.enforceSurfaceVisible(visibleOpenActivities[i]);
                    }
                }
            }

            @Nullable Runnable build() {
+3 −38
Original line number Diff line number Diff line
@@ -106,8 +106,6 @@ import static com.android.server.wm.LockTaskController.LOCK_TASK_AUTH_DONT_LOCK;
import static com.android.server.wm.LockTaskController.LOCK_TASK_AUTH_LAUNCHABLE;
import static com.android.server.wm.LockTaskController.LOCK_TASK_AUTH_LAUNCHABLE_PRIV;
import static com.android.server.wm.LockTaskController.LOCK_TASK_AUTH_PINNABLE;
import static com.android.server.wm.WindowContainer.AnimationFlags.CHILDREN;
import static com.android.server.wm.WindowContainer.AnimationFlags.PARENTS;
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.TAG_WM;
@@ -640,8 +638,6 @@ class Task extends TaskFragment {
     */
    ActivityRecord mChildPipActivity;

    boolean mLastSurfaceShowing;

    boolean mAlignActivityLocaleWithTask = false;

    /** @see #isForceExcludedFromRecents() */
@@ -3348,33 +3344,6 @@ class Task extends TaskFragment {
        if (mDimmer.hasDimState() && mDimmer.updateDims(t)) {
            scheduleAnimation();
        }

        if (mWmService.mFlags.mEnsureSurfaceVisibility) {
            return;
        }

        // Let organizer manage task visibility for shell transition. So don't change it's
        // visibility during collecting.
        if (mTransitionController.isCollecting() && mCreatedByOrganizer) {
            return;
        }

        // 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 visible = isVisible();
        final boolean show = visible || isAnimating(PARENTS | CHILDREN,
                SurfaceAnimator.ANIMATION_TYPE_ALL);
        if (mSurfaceControl != null) {
            if (show != mLastSurfaceShowing) {
                t.setVisibility(mSurfaceControl, show);
            }
        }
        // Only show the overlay if the task has other visible children
        if (mOverlayHost != null) {
            mOverlayHost.setVisibility(t, visible);
        }
        mLastSurfaceShowing = show;
    }

    @Override
@@ -4862,14 +4831,10 @@ class Task extends TaskFragment {
                    // rotation change) after leaving this scope, the visibility operation will be
                    // put in sync transaction, then it is not synced with reparent.
                    if (lastParentBeforePip.mSyncState == SYNC_STATE_NONE) {
                        if (mWmService.mFlags.mEnsureSurfaceVisibility) {
                        if (lastParentBeforePip.isVisible()) {
                            lastParentBeforePip.getPendingTransaction().show(
                                    lastParentBeforePip.mSurfaceControl);
                        }
                        } else {
                            lastParentBeforePip.prepareSurfaces();
                        }
                        // If the moveToFront is a part of finishing transition, then make sure
                        // the z-order of tasks are up-to-date.
                        if (topActivity.mTransitionController.inFinishingTransition(topActivity)) {
+0 −14
Original line number Diff line number Diff line
@@ -1127,20 +1127,6 @@ class TransitionController {
        final boolean isPlaying = !mPlayingTransitions.isEmpty();
        Slog.e(TAG, "Set visible without transition " + wc + " playing=" + isPlaying
                + " caller=" + caller);
        if (mAtm.mWindowManager.mFlags.mEnsureSurfaceVisibility) {
            return;
        }
        if (!isPlaying) {
            WindowContainer.enforceSurfaceVisible(wc);
            return;
        }
        // Update surface visibility after the playing transitions are finished, so the last
        // visibility won't be replaced by the finish transaction of transition.
        mStateValidators.add(() -> {
            if (wc.isVisibleRequested()) {
                WindowContainer.enforceSurfaceVisible(wc);
            }
        });
    }

    /**
Loading