Freeze processes that ANR

Processes are frozen if their ANR timer expires.  The process is
unfrozen if the ANR is discarded.  Otherwise, the process is unfrozen
when the ANR handler (in AnrHelper) starts.

The freeze/thaw logic is outside of the control and knowledge of the
cached app freezer.

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

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

Change-Id: I129ce97b6cd7b242272fbc834afc584188866ef0
7 files changed