Loading services/audiopolicy/service/AudioPolicyService.cpp +6 −5 Original line number Original line Diff line number Diff line Loading @@ -1006,10 +1006,11 @@ void AudioPolicyService::updateUidStates_l() // AND is on TOP or latest started // AND is on TOP or latest started // AND there is no active privacy sensitive capture or call // AND there is no active privacy sensitive capture or call // OR client has CAPTURE_AUDIO_OUTPUT privileged permission // OR client has CAPTURE_AUDIO_OUTPUT privileged permission bool allowSensitiveCapture = !isSensitiveActive || isTopOrLatestSensitive || current->canCaptureOutput; bool allowCapture = !isAssistantOnTop bool allowCapture = !isAssistantOnTop && (isTopOrLatestActive || isTopOrLatestSensitive) && (isTopOrLatestActive || isTopOrLatestSensitive) && !(isSensitiveActive && allowSensitiveCapture && !(isTopOrLatestSensitive || current->canCaptureOutput)) && canCaptureIfInCallOrCommunication(current); && canCaptureIfInCallOrCommunication(current); if (!current->hasOp()) { if (!current->hasOp()) { Loading @@ -1032,7 +1033,7 @@ void AudioPolicyService::updateUidStates_l() if (source == AUDIO_SOURCE_HOTWORD || source == AUDIO_SOURCE_VOICE_RECOGNITION) { if (source == AUDIO_SOURCE_HOTWORD || source == AUDIO_SOURCE_VOICE_RECOGNITION) { allowCapture = true; allowCapture = true; } } } else if (!(isSensitiveActive && !current->canCaptureOutput) } else if (allowSensitiveCapture && canCaptureIfInCallOrCommunication(current)) { && canCaptureIfInCallOrCommunication(current)) { if (isTopOrLatestAssistant if (isTopOrLatestAssistant && (source == AUDIO_SOURCE_VOICE_RECOGNITION && (source == AUDIO_SOURCE_VOICE_RECOGNITION Loading @@ -1053,7 +1054,7 @@ void AudioPolicyService::updateUidStates_l() if (source == AUDIO_SOURCE_HOTWORD || source == AUDIO_SOURCE_VOICE_RECOGNITION) { if (source == AUDIO_SOURCE_HOTWORD || source == AUDIO_SOURCE_VOICE_RECOGNITION) { allowCapture = true; allowCapture = true; } } } else if (!(isSensitiveActive && !current->canCaptureOutput) } else if (allowSensitiveCapture && canCaptureIfInCallOrCommunication(current)) { && canCaptureIfInCallOrCommunication(current)) { if ((source == AUDIO_SOURCE_VOICE_RECOGNITION) || (source == AUDIO_SOURCE_HOTWORD)) if ((source == AUDIO_SOURCE_VOICE_RECOGNITION) || (source == AUDIO_SOURCE_HOTWORD)) { { Loading @@ -1068,7 +1069,7 @@ void AudioPolicyService::updateUidStates_l() // OR // OR // Is on TOP AND the source is VOICE_RECOGNITION or HOTWORD // Is on TOP AND the source is VOICE_RECOGNITION or HOTWORD if (!isAssistantOnTop if (!isAssistantOnTop && !(isSensitiveActive && !current->canCaptureOutput) && allowSensitiveCapture && canCaptureIfInCallOrCommunication(current)) { && canCaptureIfInCallOrCommunication(current)) { allowCapture = true; allowCapture = true; } } Loading Loading
services/audiopolicy/service/AudioPolicyService.cpp +6 −5 Original line number Original line Diff line number Diff line Loading @@ -1006,10 +1006,11 @@ void AudioPolicyService::updateUidStates_l() // AND is on TOP or latest started // AND is on TOP or latest started // AND there is no active privacy sensitive capture or call // AND there is no active privacy sensitive capture or call // OR client has CAPTURE_AUDIO_OUTPUT privileged permission // OR client has CAPTURE_AUDIO_OUTPUT privileged permission bool allowSensitiveCapture = !isSensitiveActive || isTopOrLatestSensitive || current->canCaptureOutput; bool allowCapture = !isAssistantOnTop bool allowCapture = !isAssistantOnTop && (isTopOrLatestActive || isTopOrLatestSensitive) && (isTopOrLatestActive || isTopOrLatestSensitive) && !(isSensitiveActive && allowSensitiveCapture && !(isTopOrLatestSensitive || current->canCaptureOutput)) && canCaptureIfInCallOrCommunication(current); && canCaptureIfInCallOrCommunication(current); if (!current->hasOp()) { if (!current->hasOp()) { Loading @@ -1032,7 +1033,7 @@ void AudioPolicyService::updateUidStates_l() if (source == AUDIO_SOURCE_HOTWORD || source == AUDIO_SOURCE_VOICE_RECOGNITION) { if (source == AUDIO_SOURCE_HOTWORD || source == AUDIO_SOURCE_VOICE_RECOGNITION) { allowCapture = true; allowCapture = true; } } } else if (!(isSensitiveActive && !current->canCaptureOutput) } else if (allowSensitiveCapture && canCaptureIfInCallOrCommunication(current)) { && canCaptureIfInCallOrCommunication(current)) { if (isTopOrLatestAssistant if (isTopOrLatestAssistant && (source == AUDIO_SOURCE_VOICE_RECOGNITION && (source == AUDIO_SOURCE_VOICE_RECOGNITION Loading @@ -1053,7 +1054,7 @@ void AudioPolicyService::updateUidStates_l() if (source == AUDIO_SOURCE_HOTWORD || source == AUDIO_SOURCE_VOICE_RECOGNITION) { if (source == AUDIO_SOURCE_HOTWORD || source == AUDIO_SOURCE_VOICE_RECOGNITION) { allowCapture = true; allowCapture = true; } } } else if (!(isSensitiveActive && !current->canCaptureOutput) } else if (allowSensitiveCapture && canCaptureIfInCallOrCommunication(current)) { && canCaptureIfInCallOrCommunication(current)) { if ((source == AUDIO_SOURCE_VOICE_RECOGNITION) || (source == AUDIO_SOURCE_HOTWORD)) if ((source == AUDIO_SOURCE_VOICE_RECOGNITION) || (source == AUDIO_SOURCE_HOTWORD)) { { Loading @@ -1068,7 +1069,7 @@ void AudioPolicyService::updateUidStates_l() // OR // OR // Is on TOP AND the source is VOICE_RECOGNITION or HOTWORD // Is on TOP AND the source is VOICE_RECOGNITION or HOTWORD if (!isAssistantOnTop if (!isAssistantOnTop && !(isSensitiveActive && !current->canCaptureOutput) && allowSensitiveCapture && canCaptureIfInCallOrCommunication(current)) { && canCaptureIfInCallOrCommunication(current)) { allowCapture = true; allowCapture = true; } } Loading