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

Commit d46ded88 authored by Michael Wright's avatar Michael Wright Committed by Android (Google) Code Review
Browse files

Merge "Add tracing for pending queue size" into jb-mr2-dev

parents 36fb0166 95ae9429
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -245,8 +245,10 @@ public final class ViewRootImpl implements ViewParent,

    // Input event queue.
    QueuedInputEvent mFirstPendingInputEvent;
    int mPendingInputEventCount;
    QueuedInputEvent mCurrentInputEvent;
    boolean mProcessInputEventsScheduled;
    String mPendingInputEventQueueLengthCounterName = "pq";

    boolean mWindowAttributesChanged = false;
    int mWindowAttributesChangesFlag = 0;
@@ -642,6 +644,8 @@ public final class ViewRootImpl implements ViewParent,
                if (view.getImportantForAccessibility() == View.IMPORTANT_FOR_ACCESSIBILITY_AUTO) {
                    view.setImportantForAccessibility(View.IMPORTANT_FOR_ACCESSIBILITY_YES);
                }

                mPendingInputEventQueueLengthCounterName = "pq:" + attrs.getTitle();
            }
        }
    }
@@ -4427,6 +4431,9 @@ public final class ViewRootImpl implements ViewParent,
            }
            last.mNext = q;
        }
        mPendingInputEventCount += 1;
        Trace.traceCounter(Trace.TRACE_TAG_INPUT, mPendingInputEventQueueLengthCounterName,
                mPendingInputEventCount);

        if (processImmediately) {
            doProcessInputEvents();
@@ -4451,6 +4458,10 @@ public final class ViewRootImpl implements ViewParent,
            q.mNext = null;
            mCurrentInputEvent = q;

            mPendingInputEventCount -= 1;
            Trace.traceCounter(Trace.TRACE_TAG_INPUT, mPendingInputEventQueueLengthCounterName,
                    mPendingInputEventCount);

            final int result = deliverInputEvent(q);
            if (result != EVENT_IN_PROGRESS) {
                finishCurrentInputEvent(result == EVENT_HANDLED);