audio policy: add call redirection audio modes

Add two audio modes corresponding to a call redirection
scenario:
- AUDIO_MODE_CALL_REDIRECT: PSTN call redirection
- AUDIO_MODE_COMMUNICATION_REDIRECT: VoIP call redirection

When in call redirect mode, call audio uplink and downlink are not
routed to regular audio sinks (e.g. earpiece) or sources (e.g. built in
mic) but disconnected. A privileged app can use system APIs to inject
and extract call audio and redirect the call to another device.

All other media use cases operate as if no call was active.

Those modes are system only and not used by the audio HAL: the HAL
behavior when mode is AUDIO_MODE_CALL_REDIRECT is the same as for
AUDIO_MODE_CALL_SCREEN and when mode is AUDIO_MODE_COMMUNICATION_REDIRECT
is the same as AUDIO_MODE_NORMAL.

Bug: 189472651
Test: make
Change-Id: Ief82b74796e8d6452c3b669aa5a2ecd558c9b48e
diff --git a/services/audiopolicy/managerdefault/AudioPolicyManager.cpp b/services/audiopolicy/managerdefault/AudioPolicyManager.cpp
index 6221c05..a3f2e59 100644
--- a/services/audiopolicy/managerdefault/AudioPolicyManager.cpp
+++ b/services/audiopolicy/managerdefault/AudioPolicyManager.cpp
@@ -6134,11 +6134,11 @@
     uid_t uid;
     sp<RecordClientDescriptor> topClient = inputDesc->getHighestPriorityClient();
     if (topClient != nullptr) {
-      attributes = topClient->attributes();
-      uid = topClient->uid();
+        attributes = topClient->attributes();
+        uid = topClient->uid();
     } else {
-      attributes = { .source = AUDIO_SOURCE_DEFAULT };
-      uid = 0;
+        attributes = { .source = AUDIO_SOURCE_DEFAULT };
+        uid = 0;
     }
 
     if (attributes.source == AUDIO_SOURCE_DEFAULT && isInCall()) {
@@ -6938,8 +6938,8 @@
 {
     audio_mode_t mode = mEngine->getPhoneState();
     return (mode == AUDIO_MODE_IN_CALL)
-            || (mode == AUDIO_MODE_IN_COMMUNICATION)
-            || (mode == AUDIO_MODE_CALL_SCREEN);
+            || (mode == AUDIO_MODE_CALL_SCREEN)
+            || (mode == AUDIO_MODE_CALL_REDIRECT);
 }
 
 void AudioPolicyManager::cleanUpForDevice(const sp<DeviceDescriptor>& deviceDesc)