Small reflow of the AnrTimer class

The AnrTimer class is now abstract and requires two methods when
instantiated with a type V.  The methods extract a Linux pid and uid
from an object of type V.  The public start() method, which used to
take an explicit pid and uid now computes the necessary pid/uid from
the supplied instance of V.

It is permitted to for the pid/uid methods to simply return 0, to
indicate that there is no value.

This change allows AnrTimer clients to compute pid/uid as necessary,
without storing the information in the AnTimer system itself.

Test: atest
 * FrameworksServicesTests:com.android.server.am
 * FrameworksMockingServicesTests:com.android.server.am
 * FrameworksServicesTests:AnrTimerTest

Flag: com.android.server.utils.anr_timer_service
Bug: 325594551

Change-Id: Ifc7779ce23d0884a7943b52d16aadc1419db96b7
4 files changed