Use the standard AIDL Delegator

Use the supported IApplicationThread.Delegator class instead of the
one-off ApplicationThreadFilter.  The Delegator class is created by
adding the @JavaDelegator annnotation to the IApplicationThread.aidl
specification.

ApplicationThreadDeferred extends IApplicationThread.Delegator with
one important change from normal Delegator use: the asBinder() method
must be overridden in this case.

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

Flag: com.android.server.am.defer_binders_when_paused
Bug: 327038797
Change-Id: Idc08df00a99521b7cbb3e54dc2045ddbaadaa67b
3 files changed