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

Commit a52e6532 authored by Jerry Chang's avatar Jerry Chang Committed by Automerger Merge Worker
Browse files

Merge "Fix flicker while resizing split screen" into tm-dev am: b80800cc am: 8549f847

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/17751850



Change-Id: I4ac330bd73003f1341a1f72394edb44b4aa72cea
Ignore-AOSP-First: this is an automerge
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 5e19a955 8549f847
Loading
Loading
Loading
Loading
+9 −9
Original line number Original line Diff line number Diff line
@@ -5527,8 +5527,8 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
    }
    }


    /** @return {@code true} if this activity should be made visible. */
    /** @return {@code true} if this activity should be made visible. */
    private boolean shouldBeVisible(boolean behindFullscreenActivity, boolean ignoringKeyguard) {
    private boolean shouldBeVisible(boolean behindOccludedContainer, boolean ignoringKeyguard) {
        updateVisibilityIgnoringKeyguard(behindFullscreenActivity);
        updateVisibilityIgnoringKeyguard(behindOccludedContainer);


        if (ignoringKeyguard) {
        if (ignoringKeyguard) {
            return visibleIgnoringKeyguard;
            return visibleIgnoringKeyguard;
@@ -5586,20 +5586,20 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
        return differentUidOverlayActivity != null;
        return differentUidOverlayActivity != null;
    }
    }


    void updateVisibilityIgnoringKeyguard(boolean behindFullscreenActivity) {
    void updateVisibilityIgnoringKeyguard(boolean behindOccludedContainer) {
        visibleIgnoringKeyguard = (!behindFullscreenActivity || mLaunchTaskBehind)
        visibleIgnoringKeyguard = (!behindOccludedContainer || mLaunchTaskBehind)
                && showToCurrentUser();
                && showToCurrentUser();
    }
    }


    boolean shouldBeVisible() {
    boolean shouldBeVisible() {
        final Task rootTask = getRootTask();
        final Task task = getTask();
        if (rootTask == null) {
        if (task == null) {
            return false;
            return false;
        }
        }


        final boolean behindFullscreenActivity = !rootTask.shouldBeVisible(null /* starting */)
        final boolean behindOccludedContainer = !task.shouldBeVisible(null /* starting */)
                || rootTask.getOccludingActivityAbove(this) != null;
                || task.getOccludingActivityAbove(this) != null;
        return shouldBeVisible(behindFullscreenActivity, false /* ignoringKeyguard */);
        return shouldBeVisible(behindOccludedContainer, false /* ignoringKeyguard */);
    }
    }


    void makeVisibleIfNeeded(ActivityRecord starting, boolean reportToClient) {
    void makeVisibleIfNeeded(ActivityRecord starting, boolean reportToClient) {
+4 −18
Original line number Original line Diff line number Diff line
@@ -5053,22 +5053,10 @@ class Task extends TaskFragment {
            positionChildAtTop(rTask);
            positionChildAtTop(rTask);
        }
        }
        Task task = null;
        Task task = null;
        if (!newTask && isOrhasTask) {
        if (!newTask && isOrhasTask && !r.shouldBeVisible()) {
            // Starting activity cannot be occluding activity, otherwise starting window could be
            // remove immediately without transferring to starting activity.
            final ActivityRecord occludingActivity = getOccludingActivityAbove(r);
            if (occludingActivity != null) {
                // Here it is!  Now, if this is not yet visible (occluded by another task) to the
                // user, then just add it without starting; it will get started when the user
                // navigates back to it.
                ProtoLog.i(WM_DEBUG_ADD_REMOVE, "Adding activity %s to task %s "
                                + "callers: %s", r, task,
                        new RuntimeException("here").fillInStackTrace());
                rTask.positionChildAtTop(r);
            ActivityOptions.abort(options);
            ActivityOptions.abort(options);
            return;
            return;
        }
        }
        }


        // Place a new activity at top of root task, so it is next to interact with the user.
        // Place a new activity at top of root task, so it is next to interact with the user.


@@ -5697,9 +5685,7 @@ class Task extends TaskFragment {
            return false;
            return false;
        }
        }


        // See if there is an occluding activity on-top of this one.
        if (!r.shouldBeVisible()) return false;
        final ActivityRecord occludingActivity = getOccludingActivityAbove(r);
        if (occludingActivity != null) return false;


        if (r.finishing) Slog.e(TAG, "willActivityBeVisible: Returning false,"
        if (r.finishing) Slog.e(TAG, "willActivityBeVisible: Returning false,"
                + " would have returned true for r=" + r);
                + " would have returned true for r=" + r);