Merge "AudioPolicy: allow recording on a APC dyn policy"

gugelfrei
Kevin Rocard 5 years ago committed by Android (Google) Code Review
commit 3f1962974d

@ -58,10 +58,12 @@ public:
typedef enum {
API_INPUT_INVALID = -1,
API_INPUT_LEGACY = 0,// e.g. audio recording from a microphone
API_INPUT_MIX_CAPTURE,// used for "remote submix", capture of the media to play it remotely
API_INPUT_MIX_CAPTURE,// used for "remote submix" legacy mode (no DAP),
// capture of the media to play it remotely
API_INPUT_MIX_EXT_POLICY_REROUTE,// used for platform audio rerouting, where mixes are
// handled by external and dynamically installed
// policies which reroute audio mixes
API_INPUT_MIX_PUBLIC_CAPTURE_PLAYBACK, // used for playback capture with a MediaProjection
API_INPUT_TELEPHONY_RX, // used for capture from telephony RX path
} input_type_t;

@ -1986,7 +1986,11 @@ status_t AudioPolicyManager::getInputForAttr(const audio_attributes_t *attr,
if (status != NO_ERROR) {
goto error;
}
*inputType = API_INPUT_MIX_EXT_POLICY_REROUTE;
if (is_mix_loopback_render(policyMix->mRouteFlags)) {
*inputType = API_INPUT_MIX_PUBLIC_CAPTURE_PLAYBACK;
} else {
*inputType = API_INPUT_MIX_EXT_POLICY_REROUTE;
}
device = mAvailableInputDevices.getDevice(AUDIO_DEVICE_IN_REMOTE_SUBMIX,
String8(attr->tags + strlen("addr=")),
AUDIO_FORMAT_DEFAULT);

@ -407,6 +407,9 @@ status_t AudioPolicyService::getInputForAttr(const audio_attributes_t *attr,
if (status == NO_ERROR) {
// enforce permission (if any) required for each type of input
switch (inputType) {
case AudioPolicyInterface::API_INPUT_MIX_PUBLIC_CAPTURE_PLAYBACK:
// this use case has been validated in audio service with a MediaProjection token,
// and doesn't rely on regular permissions
case AudioPolicyInterface::API_INPUT_LEGACY:
break;
case AudioPolicyInterface::API_INPUT_TELEPHONY_RX:

Loading…
Cancel
Save