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

Commit be51f0a0 authored by android-build-team Robot's avatar android-build-team Robot
Browse files

Merge cherrypicks of [3762957, 3762958] into pi-release

Change-Id: Ie30c41ea56133cb181b81113b7d4cf821d0125a4
parents f26f11b8 9ada6b69
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1413,7 +1413,7 @@ public final class AutofillManager {
     */
    public boolean isAutofillUiShowing() {
        final AutofillClient client = mContext.getAutofillClient();
        return client != null & client.autofillClientIsFillUiShowing();
        return client != null && client.autofillClientIsFillUiShowing();
    }

    /** @hide */
+1 −4
Original line number Diff line number Diff line
@@ -56,7 +56,7 @@ message GraphicsStatsJankSummaryProto {
    // Number of "missed vsync" events.
    optional int32 missed_vsync_count = 3;

    // Number of frames in triple-buffering scenario (high input latency)
    // Number of "high input latency" events.
    optional int32 high_input_latency_count = 4;

    // Number of "slow UI thread" events.
@@ -67,9 +67,6 @@ message GraphicsStatsJankSummaryProto {

    // Number of "slow draw" events.
    optional int32 slow_draw_count = 7;

    // Number of frames that missed their deadline (aka, visibly janked)
    optional int32 missed_deadline_count = 8;
}

message GraphicsStatsHistogramBucketProto {
+6 −26
Original line number Diff line number Diff line
@@ -129,42 +129,22 @@ void JankTracker::finishFrame(const FrameInfo& frame) {
            totalDuration -= forgiveAmount;
        }
    }

    LOG_ALWAYS_FATAL_IF(totalDuration <= 0, "Impossible totalDuration %" PRId64, totalDuration);
    mData->reportFrame(totalDuration);
    (*mGlobalData)->reportFrame(totalDuration);

    // Only things like Surface.lockHardwareCanvas() are exempt from tracking
    if (CC_UNLIKELY(frame[FrameInfoIndex::Flags] & EXEMPT_FRAMES_FLAGS)) {
    // Keep the fast path as fast as possible.
    if (CC_LIKELY(totalDuration < mFrameInterval)) {
        return;
    }

    if (totalDuration > mFrameInterval) {
        mData->reportJank();
        (*mGlobalData)->reportJank();
    }

    bool isTripleBuffered = mSwapDeadline > frame[FrameInfoIndex::IntendedVsync];

    mSwapDeadline = std::max(mSwapDeadline + mFrameInterval,
                             frame[FrameInfoIndex::IntendedVsync] + mFrameInterval);

    // If we hit the deadline, cool!
    if (frame[FrameInfoIndex::FrameCompleted] < mSwapDeadline) {
        if (isTripleBuffered) {
            mData->reportJankType(JankType::kHighInputLatency);
            (*mGlobalData)->reportJankType(JankType::kHighInputLatency);
        }
    // Only things like Surface.lockHardwareCanvas() are exempt from tracking
    if (frame[FrameInfoIndex::Flags] & EXEMPT_FRAMES_FLAGS) {
        return;
    }

    mData->reportJankType(JankType::kMissedDeadline);
    (*mGlobalData)->reportJankType(JankType::kMissedDeadline);

    // Janked, reset the swap deadline
    nsecs_t jitterNanos = frame[FrameInfoIndex::FrameCompleted] - frame[FrameInfoIndex::Vsync];
    nsecs_t lastFrameOffset = jitterNanos % mFrameInterval;
    mSwapDeadline = frame[FrameInfoIndex::FrameCompleted] - lastFrameOffset + mFrameInterval;
    mData->reportJank();
    (*mGlobalData)->reportJank();

    for (int i = 0; i < NUM_BUCKETS; i++) {
        int64_t delta = frame.duration(COMPARISONS[i].start, COMPARISONS[i].end);
+0 −1
Original line number Diff line number Diff line
@@ -75,7 +75,6 @@ private:

    std::array<int64_t, NUM_BUCKETS> mThresholds;
    int64_t mFrameInterval;
    nsecs_t mSwapDeadline;
    // The amount of time we will erase from the total duration to account
    // for SF vsync offsets with HWC2 blocking dequeueBuffers.
    // (Vsync + mDequeueBlockTolerance) is the point at which we expect
+2 −1
Original line number Diff line number Diff line
@@ -23,7 +23,8 @@ namespace uirenderer {

static const char* JANK_TYPE_NAMES[] = {
        "Missed Vsync",        "High input latency",       "Slow UI thread",
        "Slow bitmap uploads", "Slow issue draw commands", "Frame deadline missed"};
        "Slow bitmap uploads", "Slow issue draw commands",
};

// The bucketing algorithm controls so to speak
// If a frame is <= to this it goes in bucket 0
Loading