AudioDeviceBroker: ignore communication route requests by idle apps

Monitor playback and recording activity for apps in the communication clients
stack. If the client is not the audio mode owner or not privileged,
do not take its routing request into account. The inactive client
remains in the stack.
Also track communication route clients by UID instead of PID to
facilitate matching with active players and recorders.

Bug: 286545833
Test: atest AudioCommunicationDeviceTest
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:385ca73d1a95de3ad3998d78a5f0a28b43c9e8f5)
Merged-In: I23f06b343efcc10c06a7eb482366c735da54da2d
Change-Id: I23f06b343efcc10c06a7eb482366c735da54da2d
3 files changed