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

Commit f1a00e2b authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Prevent premature display of starting window." into oc-dev

parents 20d36c70 d334a051
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -283,6 +283,7 @@ final class ActivityRecord extends ConfigurationContainer implements AppWindowCo
    boolean visible;        // does this activity's window need to be shown?
    boolean visibleIgnoringKeyguard; // is this activity visible, ignoring the fact that Keyguard
                                     // might hide this activity?
    private boolean mLastSetWindowVisibility; // The last window visibility state that was set.
    private boolean mDeferHidingClient; // If true we told WM to defer reporting to the client
                                        // process that it is hidden.
    boolean sleeping;       // have we told the activity to sleep?
@@ -1581,6 +1582,10 @@ final class ActivityRecord extends ConfigurationContainer implements AppWindowCo
    }

    void setVisibility(boolean visible) {
        if (mLastSetWindowVisibility == visible) {
            return;
        }
        mLastSetWindowVisibility = visible;
        mWindowContainerController.setVisibility(visible, mDeferHidingClient);
        mStackSupervisor.mActivityMetricsLogger.notifyVisibilityChanged(this, visible);
    }
+1 −1
Original line number Diff line number Diff line
@@ -1933,7 +1933,7 @@ class ActivityStack<T extends StackWindowController> extends ConfigurationContai
     *
     * @return true if {@param r} is visible taken Keyguard state into account, false otherwise
     */
    private boolean checkKeyguardVisibility(ActivityRecord r, boolean shouldBeVisible,
    boolean checkKeyguardVisibility(ActivityRecord r, boolean shouldBeVisible,
            boolean isTop) {
        final boolean isInPinnedStack = r.getStack().getStackId() == PINNED_STACK_ID;
        final boolean keyguardShowing = mStackSupervisor.mKeyguardController.isKeyguardShowing();
+7 −1
Original line number Diff line number Diff line
@@ -1333,7 +1333,13 @@ public class ActivityStackSupervisor extends ConfigurationContainer implements D
        }

        r.startFreezingScreenLocked(app, 0);
        if (r.getStack().checkKeyguardVisibility(r, true /* shouldBeVisible */, true /* isTop */)) {
            // We only set the visibility to true if the activity is allowed to be visible based on
            // keyguard state. This avoids setting this into motion in window manager that is later
            // cancelled due to later calls to ensure visible activities that set visibility back to
            // false.
            r.setVisibility(true);
        }

        // schedule launch ticks to collect information about slow apps.
        r.startLaunchTickingLocked();