audio: Add permission update barrier for tests
To avoid test flakiness, we need the equivalent of purgePermissionCache
for the new permission sync scheme: tests need to block until the
permission state change they trigger via shell perms is visible to the
audio system.
Migrate the permission update tasks to use an executor service, and keep
track of futures which are scheduled on it, allowing us to block until
these futures are complete. This also allows for true task conflation,
which enables dropping the delay duration lower. Move listener start to
later in the boot sequence for performance.
Test: perfetto for performance and ensuring dispatch
Test: atest CtsMediaAudioTestCases
Bug: 338089555
Flag: com.android.media.audio.audioserver_permissions
Change-Id: I56dadf11ad397896bd5f7757e6b12eb173d6e984
7 files changed