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

Commit fa2ddbe2 authored by Issei Suzuki's avatar Issei Suzuki Committed by Android (Google) Code Review
Browse files

Merge "Wait OCCLUDE transition until screen turning on activity becomes ready." into sc-dev

parents 7ecbda5d f8853f75
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -4492,8 +4492,8 @@ public class PhoneWindowManager implements WindowManagerPolicy {
    }

    @Override
    public boolean okToAnimate() {
        return mDefaultDisplayPolicy.isAwake() && !mDeviceGoingToSleep;
    public boolean okToAnimate(boolean ignoreScreenOn) {
        return (ignoreScreenOn || mDefaultDisplayPolicy.isAwake()) && !mDeviceGoingToSleep;
    }

    /** {@inheritDoc} */
+2 −1
Original line number Diff line number Diff line
@@ -897,12 +897,13 @@ public interface WindowManagerPolicy extends WindowManagerPolicyConstants {
    public boolean isScreenOn();

    /**
     * @param ignoreScreenOn {@code true} if screen state should be ignored.
     * @return whether the device is currently allowed to animate.
     *
     * Note: this can be true even if it is not appropriate to animate for reasons that are outside
     *       of the policy's authority.
     */
    boolean okToAnimate();
    boolean okToAnimate(boolean ignoreScreenOn);

    /**
     * Tell the policy that the lid switch has changed state.
+2 −1
Original line number Diff line number Diff line
@@ -4655,7 +4655,8 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
        // still check DC#okToAnimate again if the transition animation is fine to apply.
        // TODO(new-app-transition): Rewrite this logic using WM Shell.
        final boolean recentsAnimating = isAnimating(PARENTS, ANIMATION_TYPE_RECENTS);
        if (okToAnimate(true /* ignoreFrozen */) && (appTransition.isTransitionSet()
        if (okToAnimate(true /* ignoreFrozen */, canTurnScreenOn())
                && (appTransition.isTransitionSet()
                || (recentsAnimating && !isActivityTypeHome()))) {
            if (visible) {
                displayContent.mOpeningApps.add(this);
+13 −3
Original line number Diff line number Diff line
@@ -4436,9 +4436,14 @@ class DisplayContent extends RootDisplayArea implements WindowManagerPolicy.Disp
    }

    boolean okToDisplay(boolean ignoreFrozen) {
        return okToDisplay(ignoreFrozen, false /* ignoreScreenOn */);
    }

    boolean okToDisplay(boolean ignoreFrozen, boolean ignoreScreenOn) {
        if (mDisplayId == DEFAULT_DISPLAY) {
            return (!mWmService.mDisplayFrozen || ignoreFrozen)
                    && mWmService.mDisplayEnabled && mWmService.mPolicy.isScreenOn();
                    && mWmService.mDisplayEnabled
                    && (ignoreScreenOn || mWmService.mPolicy.isScreenOn());
        }
        return mDisplayInfo.state == Display.STATE_ON;
    }
@@ -4448,8 +4453,13 @@ class DisplayContent extends RootDisplayArea implements WindowManagerPolicy.Disp
    }

    boolean okToAnimate(boolean ignoreFrozen) {
        return okToDisplay(ignoreFrozen) &&
                (mDisplayId != DEFAULT_DISPLAY || mWmService.mPolicy.okToAnimate());
        return okToAnimate(ignoreFrozen, false /* ignoreScreenOn */);
    }

    boolean okToAnimate(boolean ignoreFrozen, boolean ignoreScreenOn) {
        return okToDisplay(ignoreFrozen, ignoreScreenOn)
                && (mDisplayId != DEFAULT_DISPLAY
                || mWmService.mPolicy.okToAnimate(ignoreScreenOn));
    }

    static final class TaskForResizePointSearchResult {
+1 −1
Original line number Diff line number Diff line
@@ -731,7 +731,7 @@ public class DisplayRotation {
    private RotationAnimationPair selectRotationAnimation() {
        // If the screen is off or non-interactive, force a jumpcut.
        final boolean forceJumpcut = !mDisplayPolicy.isScreenOnFully()
                || !mService.mPolicy.okToAnimate();
                || !mService.mPolicy.okToAnimate(false /* ignoreScreenOn */);
        final WindowState topFullscreen = mDisplayPolicy.getTopFullscreenOpaqueWindow();
        if (DEBUG_ANIM) Slog.i(TAG, "selectRotationAnimation topFullscreen="
                + topFullscreen + " rotationAnimation="
Loading