freezer: add internal per-process callbacks

Add per-process frozen/unfrozen callbacks in ActivityManagerInternal
for use within system_server.  The callbacks are registered on a
per-process object; there is no way to unregister, so the callbacks
exist for the lifetime of the process.

Callbacks are executed when the frozen/unfrozen state changes.  Note
that if the callback is added with a HandlerExecutor, the callback
will be delivered to the end client some time later, possibly in a
different thread.

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

Bug: 326315985
Flag: EXEMPT refactor
Change-Id: I17e8f26633f70f6d54c742d58ba23f9a20fa3f64
6 files changed