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

Commit 8f5a75cd authored by Winson Chung's avatar Winson Chung Committed by Android (Google) Code Review
Browse files

Merge "Add more context to Choreographer input callbacks" into main

parents f88a8463 be2bd817
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -29,6 +29,7 @@ public class BatchedInputEventReceiver extends InputEventReceiver {
    private Choreographer mChoreographer;
    private boolean mBatchingEnabled;
    private boolean mBatchedInputScheduled;
    private final String mTag;
    private final Handler mHandler;
    private final Runnable mConsumeBatchedInputEvents = new Runnable() {
        @Override
@@ -43,6 +44,7 @@ public class BatchedInputEventReceiver extends InputEventReceiver {
        super(inputChannel, looper);
        mChoreographer = choreographer;
        mBatchingEnabled = true;
        mTag = inputChannel.getName();
        traceBoolVariable("mBatchingEnabled", mBatchingEnabled);
        traceBoolVariable("mBatchedInputScheduled", mBatchedInputScheduled);
        mHandler = new Handler(looper);
@@ -123,7 +125,12 @@ public class BatchedInputEventReceiver extends InputEventReceiver {
    private final class BatchedInputRunnable implements Runnable {
        @Override
        public void run() {
            try {
                Trace.traceBegin(Trace.TRACE_TAG_INPUT, mTag);
                doConsumeBatchedInput(mChoreographer.getFrameTimeNanos());
            } finally {
                Trace.traceEnd(Trace.TRACE_TAG_INPUT);
            }
        }
    }
    private final BatchedInputRunnable mBatchedInputRunnable = new BatchedInputRunnable();
+12 −7
Original line number Diff line number Diff line
@@ -10173,6 +10173,8 @@ public final class ViewRootImpl implements ViewParent,
    final class ConsumeBatchedInputRunnable implements Runnable {
        @Override
        public void run() {
            Trace.traceBegin(TRACE_TAG_VIEW, mTag);
            try {
                mConsumeBatchedInputScheduled = false;
                if (doConsumeBatchedInput(mChoreographer.getFrameTimeNanos())) {
                    // If we consumed a batch here, we want to go ahead and schedule the
@@ -10181,6 +10183,9 @@ public final class ViewRootImpl implements ViewParent,
                    // things occurring in the process.
                    scheduleConsumeBatchedInput();
                }
            } finally {
                Trace.traceEnd(TRACE_TAG_VIEW);
            }
        }
    }
    final ConsumeBatchedInputRunnable mConsumedBatchedInputRunnable =