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

Commit 537f9e50 authored by Asmita Poddar's avatar Asmita Poddar Committed by Android (Google) Code Review
Browse files

Merge "Cache flag value to prevent performance regressions" into main

parents 8072f42c 9213590a
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -1030,7 +1030,7 @@ void InputDispatcher::dispatchOnce() {
        const nsecs_t nextAnrCheck = processAnrsLocked();
        nextWakeupTime = std::min(nextWakeupTime, nextAnrCheck);

        if (input_flags::enable_per_device_input_latency_metrics()) {
        if (mPerDeviceInputLatencyMetricsFlag) {
            const nsecs_t nextStatisticsPush = processLatencyStatisticsLocked();
            nextWakeupTime = std::min(nextWakeupTime, nextStatisticsPush);
        }
@@ -4549,7 +4549,7 @@ void InputDispatcher::notifyKey(const NotifyKeyArgs& args) {
            newEntry->traceTracker = mTracer->traceInboundEvent(*newEntry);
        }

        if (input_flags::enable_per_device_input_latency_metrics()) {
        if (mPerDeviceInputLatencyMetricsFlag) {
            if (args.id != android::os::IInputConstants::INVALID_INPUT_EVENT_ID &&
                IdGenerator::getSource(args.id) == IdGenerator::Source::INPUT_READER &&
                !mInputFilterEnabled) {
+6 −0
Original line number Diff line number Diff line
@@ -16,6 +16,8 @@

#pragma once

#include <com_android_input_flags.h>

#include "AnrTracker.h"
#include "CancelationOptions.h"
#include "DragState.h"
@@ -741,6 +743,10 @@ private:

    sp<android::gui::WindowInfoHandle> findWallpaperWindowBelow(
            const sp<android::gui::WindowInfoHandle>& windowHandle) const REQUIRES(mLock);

    /** Stores the value of the input flag for per device input latency metrics. */
    const bool mPerDeviceInputLatencyMetricsFlag =
            com::android::input::flags::enable_per_device_input_latency_metrics();
};

} // namespace android::inputdispatcher