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

Commit e506b3ca authored by Eric Sum's avatar Eric Sum
Browse files

Fix desktop window resizing jank data collection.

In the current state, running `statsd_testdrive 305` while
resizing a window results in the DESKTOP_MODE_RESIZE_WINDOW
CUJ being recorded with 0 `total_frames`. This happens despite
resizing the window for a few seconds.

To fix, a timeline (i.e. target vsync id) must be set for each
frame rendered during the interaction. That causes surfaceflinger
to report jank stats for the interaction, which was missing before.

Flag: com.android.window.flags.sdk_desired_present_time
Bug: 385361072
Test: atest ResizeVeilTest
      Run `statsd_testdrive 305` with a desktop and check that
      DESKTOP_MODE_RESIZE_WINDOW is recorded with `total_frames`
      being a reasonable value.
Change-Id: I971e4dc520fbeaa597720db0cccee865dd789b37
parent 01e38b57
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -25,6 +25,7 @@ import android.graphics.PixelFormat
import android.graphics.PointF
import android.graphics.Rect
import android.os.Trace
import android.view.Choreographer
import android.view.Display
import android.view.LayoutInflater
import android.view.SurfaceControl
@@ -331,6 +332,7 @@ public class ResizeVeil @JvmOverloads constructor(
                .setPosition(icon, iconPosition.x, iconPosition.y)
                .setPosition(parentSurface, newBounds.left.toFloat(), newBounds.top.toFloat())
                .setWindowCrop(parentSurface, newBounds.width(), newBounds.height())
                .setFrameTimeline(Choreographer.getInstance().vsyncId)
    }

    /**