Skip to content

Commit

Permalink
fixup! audioflinger: Fix audio for WifiDisplay
Browse files Browse the repository at this point in the history
Required after 23f552f

Change-Id: I716fb3290b1a3249c3b4fb896efb7954afe31fbb
[Jprimero15: This fully replace the fix i made earlier]
Signed-off-by: Jprimero15 <[email protected]>
  • Loading branch information
mikeNG authored and fazilsheik96 committed Mar 1, 2025
1 parent 5c0b353 commit 9474e9d
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions services/audiopolicy/service/AudioPolicyInterfaceImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -654,7 +654,8 @@ Status AudioPolicyService::getInputForAttr(const media::audio::common::AudioAttr
// type is API_INPUT_MIX_EXT_POLICY_REROUTE and by AudioService if a media projection
// is used and input type is API_INPUT_MIX_PUBLIC_CAPTURE_PLAYBACK
// - ECHO_REFERENCE source is controlled by captureAudioOutputAllowed()
if (!isAudioServerOrMediaServerUid(IPCThreadState::self()->getCallingUid()) && !(recordingAllowed(attributionSource, inputSource)
if (!isAudioServerOrMediaServerUid(attributionSource.uid)
&& !(recordingAllowed(attributionSource, inputSource)
|| inputSource == AUDIO_SOURCE_FM_TUNER
|| inputSource == AUDIO_SOURCE_REMOTE_SUBMIX
|| inputSource == AUDIO_SOURCE_ECHO_REFERENCE)) {
Expand Down Expand Up @@ -738,7 +739,7 @@ Status AudioPolicyService::getInputForAttr(const media::audio::common::AudioAttr
// FIXME: use the same permission as for remote submix for now.
FALLTHROUGH_INTENDED;
case AudioPolicyInterface::API_INPUT_MIX_CAPTURE:
if (!isAudioServerOrMediaServerUid(IPCThreadState::self()->getCallingUid()) && !canCaptureOutput) {
if (!isAudioServerOrMediaServerUid(attributionSource.uid) && !canCaptureOutput) {
if (property_get_bool("vendor.audio.enable.mirrorlink", false)) {
media::AudioPolicyDeviceState aidlRet;
AudioDevice deviceAidl;
Expand Down Expand Up @@ -845,7 +846,7 @@ Status AudioPolicyService::startInput(int32_t portIdAidl)
msg << "Audio recording on session " << client->session;

// check calling permissions
if (!isAudioServerOrMediaServerUid(IPCThreadState::self()->getCallingUid()) && !(startRecording(client->attributionSource, client->virtualDeviceId,
if (!isAudioServerOrMediaServerUid(client->attributionSource.uid) && !(startRecording(client->attributionSource, client->virtualDeviceId,
String16(msg.str().c_str()), client->attributes.source)
|| client->attributes.source == AUDIO_SOURCE_FM_TUNER
|| client->attributes.source == AUDIO_SOURCE_REMOTE_SUBMIX
Expand Down

0 comments on commit 9474e9d

Please sign in to comment.