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

Commit a1d1481f authored by Vishnu Nair's avatar Vishnu Nair
Browse files

WM: Fix jumpcut animations

ROTATION_ANIMATION_JUMPCUT behaves like ROTATION_ANIMATION_SEAMLESS. In some cases we want to
simply freeze the screen while the app draws in the newrotation. This will revert back the
previous behavior.

Also fixes a flicker seen during jumpcut animation by fixing the inital position of the black
frame. The position was not set for Enter black frames when it was created.

Bug: 118169297
Test: atest FlickerTest:JumpcutAppRotationTest
Test: manually test with unity test app and verify jumpcut animation works
Change-Id: I87fd2b8536102e1c26adcf6ae16279aeb68d1e53
parent d9aa3fa6
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -7861,8 +7861,7 @@ public class PhoneWindowManager implements WindowManagerPolicy {
        // requires freezing various Surface states and won't work well
        // with animations, so we disable it in the animation case for now.
        if (w != null && !w.isAnimatingLw() &&
                ((w.getAttrs().rotationAnimation == ROTATION_ANIMATION_JUMPCUT) ||
                        (w.getAttrs().rotationAnimation == ROTATION_ANIMATION_SEAMLESS))) {
                w.getAttrs().rotationAnimation == ROTATION_ANIMATION_SEAMLESS) {
            return true;
        }
        return false;
+3 −5
Original line number Diff line number Diff line
@@ -16,21 +16,18 @@

package com.android.server.wm;

import static android.graphics.PixelFormat.OPAQUE;
import static android.view.SurfaceControl.FX_SURFACE_DIM;
import static com.android.server.wm.WindowManagerDebugConfig.SHOW_SURFACE_ALLOC;
import static com.android.server.wm.WindowManagerDebugConfig.SHOW_TRANSACTIONS;
import static com.android.server.wm.WindowManagerDebugConfig.TAG_WM;

import java.io.PrintWriter;

import android.graphics.Matrix;
import android.graphics.PixelFormat;
import android.graphics.Rect;
import android.util.Slog;
import android.view.Surface.OutOfResourcesException;
import android.view.SurfaceControl;

import java.io.PrintWriter;

/**
 * Four black surfaces put together to make a black frame.
 */
@@ -59,6 +56,7 @@ public class BlackFrame {
            transaction.setLayerStack(surface, dc.getDisplayId());
            transaction.setAlpha(surface, 1);
            transaction.setLayer(surface, layer);
            transaction.setPosition(surface, left, top);
            transaction.show(surface);
            if (SHOW_TRANSACTIONS || SHOW_SURFACE_ALLOC) Slog.i(TAG_WM,
                            "  BLACK " + surface + ": CREATE layer=" + layer);