diff options
| author | 2024-04-12 17:14:45 -0700 | |
|---|---|---|
| committer | 2024-04-17 09:56:52 -0700 | |
| commit | 47dbfaebe4361ed5f10de9a68ad29ad1c2fe4010 (patch) | |
| tree | 0e45e529692c3925d9fef07d58f5aadc6ffc3ad6 /libs/input/SpriteController.cpp | |
| parent | e6e2ada8f73ca3a8ce64c8f06544014649e58c31 (diff) | |
Correct AnrTimer use in ActiveServices
This fixes three places where the AnrTimer was being used incorrectly
in ActiveServices. In both cases, the error is in the location of
discard() and accept(), and these two functions are no-ops unless the
AnrTimer feature is flag-enabled (which it is not, at the moment).
The SERVICE_SHORT_FGS_ANR_TIMEOUT_MSG was being handled in the wrong
completion routine. The correct completion routine is
onShortFgsAnrTimeout().
The SERVICE_TIMEOUT_MSG was accept()ing the ANR too early. The call
to accept() is moved into the conditional that creates the
TimeoutRecord; the other branch of the conditional discards the timer.
The SERVICE_FOREGROUND_TIMEOUT_MSG call to accept() was too early.
The correct location is after the last possible call to discard().
Test: atest
* FrameworksServicesTests:com.android.server.am
* FrameworksMockingServicesTests:com.android.server.am
Flag: com.android.server.utils.anr_timer_service
Bug: 325594551
Change-Id: I75b16bd5339c755774da6a232f3513e3ca119293
Diffstat (limited to 'libs/input/SpriteController.cpp')
0 files changed, 0 insertions, 0 deletions