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
1 file changed