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

Commit 03782f43 authored by Rachel Lee's avatar Rachel Lee Committed by Automerger Merge Worker
Browse files

Merge "Add check for empty vsync data in Choreographer." into tm-dev am: c2c8ac85 am: c0b5c6cc

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/17920025



Change-Id: I71106d66c89c5d7198967b4a52a44e815e3d2395
Ignore-AOSP-First: this is an automerge
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 9afc35a3 c0b5c6cc
Loading
Loading
Loading
Loading
+17 −11
Original line number Diff line number Diff line
@@ -765,18 +765,24 @@ public final class Choreographer {
                startNanos = System.nanoTime();
                final long jitterNanos = startNanos - frameTimeNanos;
                if (jitterNanos >= frameIntervalNanos) {
                    final long lastFrameOffset = jitterNanos % frameIntervalNanos;
                    if (frameIntervalNanos == 0) {
                        Log.i(TAG, "Vsync data empty due to timeout");
                    } else {
                        final long skippedFrames = jitterNanos / frameIntervalNanos;
                        if (skippedFrames >= SKIPPED_FRAME_WARNING_LIMIT) {
                            Log.i(TAG, "Skipped " + skippedFrames + " frames!  "
                                + "The application may be doing too much work on its main thread.");
                                    + "The application may be doing too much work on its main "
                                    + "thread.");
                        }
                    final long lastFrameOffset = jitterNanos % frameIntervalNanos;
                        if (DEBUG_JANK) {
                            Log.d(TAG, "Missed vsync by " + (jitterNanos * 0.000001f) + " ms "
                                    + "which is more than the frame interval of "
                                    + (frameIntervalNanos * 0.000001f) + " ms!  "
                                    + "Skipping " + skippedFrames + " frames and setting frame "
                                + "time to " + (lastFrameOffset * 0.000001f) + " ms in the past.");
                                    + "time to " + (lastFrameOffset * 0.000001f)
                                    + " ms in the past.");
                        }
                    }
                    frameTimeNanos = startNanos - lastFrameOffset;
                    DisplayEventReceiver.VsyncEventData latestVsyncEventData =