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

Commit e66edb10 authored by Jorim Jaggi's avatar Jorim Jaggi
Browse files

Do not update Record.visible if not setting visibility

In resumeTopActivityInnerLocked we only update the visibility
if not already visible, to avoid a black flicker. However, in the
interaction when docking a task from recents, makeVisible was
called but the conditions weren't met to make it actually visible,
but Record.visible was still set, leading that we didn't call
WM.setAppVisibility in resumeTopActivityInnerLocked

Bug: 27041808
Change-Id: I400470a5b31881542fedd3edb6a97e524666a8a3
parent e161f08e
Loading
Loading
Loading
Loading
+23 −21
Original line number Diff line number Diff line
@@ -1564,7 +1564,7 @@ final class ActivityStack {
                            resumeNextActivity = false;
                        }
                    } else {
                        makeVisible(starting, r);
                        makeVisibleIfNeeded(starting, r);
                    }
                    // Aggregate current change flags.
                    configChanges |= r.configChangeFlags;
@@ -1722,10 +1722,13 @@ final class ActivityStack {
        return behindFullscreenActivity;
    }

    private void makeVisible(ActivityRecord starting, ActivityRecord r) {
    private void makeVisibleIfNeeded(ActivityRecord starting, ActivityRecord r) {

        // This activity is not currently visible, but is running. Tell it to become visible.
        r.visible = true;
        if (r.state != ActivityState.RESUMED && r != starting) {
        if (r.state == ActivityState.RESUMED || r == starting) {
            return;
        }

        // If this activity is paused, tell it to now show its window.
        if (DEBUG_VISIBILITY) Slog.v(TAG_VISIBILITY,
                "Making visible and scheduling visibility: " + r);
@@ -1745,7 +1748,6 @@ final class ActivityStack {
            Slog.w(TAG, "Exception thrown making visibile: " + r.intent.getComponent(), e);
        }
    }
    }

    private boolean handleAlreadyVisible(ActivityRecord r) {
        if (DEBUG_VISIBILITY) Slog.v(TAG_VISIBILITY, "Skipping: already visible at " + r);