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

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

Merge "Allow dispatcher to be idle after metrics push" into main

parents 41280697 e0226c5e
Loading
Loading
Loading
Loading
+2 −5
Original line number Diff line number Diff line
@@ -1031,8 +1031,7 @@ void InputDispatcher::dispatchOnce() {
        nextWakeupTime = std::min(nextWakeupTime, nextAnrCheck);

        if (mPerDeviceInputLatencyMetricsFlag) {
            const nsecs_t nextStatisticsPush = processLatencyStatisticsLocked();
            nextWakeupTime = std::min(nextWakeupTime, nextStatisticsPush);
            processLatencyStatisticsLocked();
        }

        // We are about to enter an infinitely long sleep, because we have no commands or
@@ -1117,9 +1116,8 @@ nsecs_t InputDispatcher::processAnrsLocked() {

/**
 * Check if enough time has passed since the last latency statistics push.
 * Return the time at which we should wake up next.
 */
nsecs_t InputDispatcher::processLatencyStatisticsLocked() {
void InputDispatcher::processLatencyStatisticsLocked() {
    const nsecs_t currentTime = now();
    // Log the atom recording latency statistics if more than 6 hours passed from the last
    // push
@@ -1127,7 +1125,6 @@ nsecs_t InputDispatcher::processLatencyStatisticsLocked() {
        mInputEventTimelineProcessor->pushLatencyStatistics();
        mLastStatisticPushTime = currentTime;
    }
    return mLastStatisticPushTime + LATENCY_STATISTICS_PUSH_INTERVAL;
}

std::chrono::nanoseconds InputDispatcher::getDispatchingTimeoutLocked(
+1 −1
Original line number Diff line number Diff line
@@ -329,7 +329,7 @@ private:
    std::chrono::nanoseconds mMonitorDispatchingTimeout GUARDED_BY(mLock);

    nsecs_t processAnrsLocked() REQUIRES(mLock);
    nsecs_t processLatencyStatisticsLocked() REQUIRES(mLock);
    void processLatencyStatisticsLocked() REQUIRES(mLock);
    std::chrono::nanoseconds getDispatchingTimeoutLocked(
            const std::shared_ptr<Connection>& connection) REQUIRES(mLock);