Skip to content

Commit dce984f

Browse files
Asmita PoddarAndroid (Google) Code Review
authored andcommitted
Merge "Allow dispatcher to be idle after metrics push" into main
2 parents 4128069 + e0226c5 commit dce984f

2 files changed

Lines changed: 3 additions & 6 deletions

File tree

services/inputflinger/dispatcher/InputDispatcher.cpp

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1031,8 +1031,7 @@ void InputDispatcher::dispatchOnce() {
10311031
nextWakeupTime = std::min(nextWakeupTime, nextAnrCheck);
10321032

10331033
if (mPerDeviceInputLatencyMetricsFlag) {
1034-
const nsecs_t nextStatisticsPush = processLatencyStatisticsLocked();
1035-
nextWakeupTime = std::min(nextWakeupTime, nextStatisticsPush);
1034+
processLatencyStatisticsLocked();
10361035
}
10371036

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

11181117
/**
11191118
* Check if enough time has passed since the last latency statistics push.
1120-
* Return the time at which we should wake up next.
11211119
*/
1122-
nsecs_t InputDispatcher::processLatencyStatisticsLocked() {
1120+
void InputDispatcher::processLatencyStatisticsLocked() {
11231121
const nsecs_t currentTime = now();
11241122
// Log the atom recording latency statistics if more than 6 hours passed from the last
11251123
// push
11261124
if (currentTime - mLastStatisticPushTime >= LATENCY_STATISTICS_PUSH_INTERVAL) {
11271125
mInputEventTimelineProcessor->pushLatencyStatistics();
11281126
mLastStatisticPushTime = currentTime;
11291127
}
1130-
return mLastStatisticPushTime + LATENCY_STATISTICS_PUSH_INTERVAL;
11311128
}
11321129

11331130
std::chrono::nanoseconds InputDispatcher::getDispatchingTimeoutLocked(

services/inputflinger/dispatcher/InputDispatcher.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,7 @@ class InputDispatcher : public android::InputDispatcherInterface {
329329
std::chrono::nanoseconds mMonitorDispatchingTimeout GUARDED_BY(mLock);
330330

331331
nsecs_t processAnrsLocked() REQUIRES(mLock);
332-
nsecs_t processLatencyStatisticsLocked() REQUIRES(mLock);
332+
void processLatencyStatisticsLocked() REQUIRES(mLock);
333333
std::chrono::nanoseconds getDispatchingTimeoutLocked(
334334
const std::shared_ptr<Connection>& connection) REQUIRES(mLock);
335335

0 commit comments

Comments
 (0)