Loading media/audioaidlconversion/AidlConversionCppNdk.cpp +9 −1 Original line number Diff line number Diff line Loading @@ -1167,6 +1167,10 @@ ConversionResult<audio_input_flags_t> aidl2legacy_AudioInputFlags_audio_input_fl return AUDIO_INPUT_FLAG_DIRECT; case AudioInputFlags::ULTRASOUND: return AUDIO_INPUT_FLAG_ULTRASOUND; case AudioInputFlags::HOTWORD_TAP: return AUDIO_INPUT_FLAG_HOTWORD_TAP; case AudioInputFlags::HW_LOOKBACK: return AUDIO_INPUT_FLAG_HW_LOOKBACK; } return unexpected(BAD_VALUE); } Loading Loading @@ -1194,6 +1198,10 @@ ConversionResult<AudioInputFlags> legacy2aidl_audio_input_flags_t_AudioInputFlag return AudioInputFlags::DIRECT; case AUDIO_INPUT_FLAG_ULTRASOUND: return AudioInputFlags::ULTRASOUND; case AUDIO_INPUT_FLAG_HOTWORD_TAP: return AudioInputFlags::HOTWORD_TAP; case AUDIO_INPUT_FLAG_HW_LOOKBACK: return AudioInputFlags::HW_LOOKBACK; } return unexpected(BAD_VALUE); } Loading services/audiopolicy/managerdefault/AudioPolicyManager.cpp +6 −2 Original line number Diff line number Diff line Loading @@ -34,6 +34,7 @@ #include <map> #include <math.h> #include <set> #include <type_traits> #include <unordered_set> #include <vector> Loading Loading @@ -7439,8 +7440,11 @@ sp<IOProfile> AudioPolicyManager::getInputProfile(const sp<DeviceDescriptor> &de // TODO: perhaps isCompatibleProfile should return a "matching" score so we can return // the best matching profile, not the first one. const audio_input_flags_t mustMatchFlag = AUDIO_INPUT_FLAG_MMAP_NOIRQ; const audio_input_flags_t oriFlags = flags; using underlying_input_flag_t = std::underlying_type_t<audio_input_flags_t>; const underlying_input_flag_t mustMatchFlag = AUDIO_INPUT_FLAG_MMAP_NOIRQ | AUDIO_INPUT_FLAG_HOTWORD_TAP | AUDIO_INPUT_FLAG_HW_LOOKBACK; const underlying_input_flag_t oriFlags = flags; for (;;) { sp<IOProfile> firstInexact = nullptr; Loading services/audiopolicy/service/AudioPolicyInterfaceImpl.cpp +3 −1 Original line number Diff line number Diff line Loading @@ -667,7 +667,9 @@ Status AudioPolicyService::getInputForAttr(const media::AudioAttributesInternal& return binderStatusFromStatusT(PERMISSION_DENIED); } if (((flags & AUDIO_INPUT_FLAG_HW_HOTWORD) != 0) if (((flags & (AUDIO_INPUT_FLAG_HW_HOTWORD | AUDIO_INPUT_FLAG_HOTWORD_TAP | AUDIO_INPUT_FLAG_HW_LOOKBACK)) != 0) && !canCaptureHotword) { ALOGE("%s: permission denied: hotword mode not allowed" " for uid %d pid %d", __func__, attributionSource.uid, attributionSource.pid); Loading Loading
media/audioaidlconversion/AidlConversionCppNdk.cpp +9 −1 Original line number Diff line number Diff line Loading @@ -1167,6 +1167,10 @@ ConversionResult<audio_input_flags_t> aidl2legacy_AudioInputFlags_audio_input_fl return AUDIO_INPUT_FLAG_DIRECT; case AudioInputFlags::ULTRASOUND: return AUDIO_INPUT_FLAG_ULTRASOUND; case AudioInputFlags::HOTWORD_TAP: return AUDIO_INPUT_FLAG_HOTWORD_TAP; case AudioInputFlags::HW_LOOKBACK: return AUDIO_INPUT_FLAG_HW_LOOKBACK; } return unexpected(BAD_VALUE); } Loading Loading @@ -1194,6 +1198,10 @@ ConversionResult<AudioInputFlags> legacy2aidl_audio_input_flags_t_AudioInputFlag return AudioInputFlags::DIRECT; case AUDIO_INPUT_FLAG_ULTRASOUND: return AudioInputFlags::ULTRASOUND; case AUDIO_INPUT_FLAG_HOTWORD_TAP: return AudioInputFlags::HOTWORD_TAP; case AUDIO_INPUT_FLAG_HW_LOOKBACK: return AudioInputFlags::HW_LOOKBACK; } return unexpected(BAD_VALUE); } Loading
services/audiopolicy/managerdefault/AudioPolicyManager.cpp +6 −2 Original line number Diff line number Diff line Loading @@ -34,6 +34,7 @@ #include <map> #include <math.h> #include <set> #include <type_traits> #include <unordered_set> #include <vector> Loading Loading @@ -7439,8 +7440,11 @@ sp<IOProfile> AudioPolicyManager::getInputProfile(const sp<DeviceDescriptor> &de // TODO: perhaps isCompatibleProfile should return a "matching" score so we can return // the best matching profile, not the first one. const audio_input_flags_t mustMatchFlag = AUDIO_INPUT_FLAG_MMAP_NOIRQ; const audio_input_flags_t oriFlags = flags; using underlying_input_flag_t = std::underlying_type_t<audio_input_flags_t>; const underlying_input_flag_t mustMatchFlag = AUDIO_INPUT_FLAG_MMAP_NOIRQ | AUDIO_INPUT_FLAG_HOTWORD_TAP | AUDIO_INPUT_FLAG_HW_LOOKBACK; const underlying_input_flag_t oriFlags = flags; for (;;) { sp<IOProfile> firstInexact = nullptr; Loading
services/audiopolicy/service/AudioPolicyInterfaceImpl.cpp +3 −1 Original line number Diff line number Diff line Loading @@ -667,7 +667,9 @@ Status AudioPolicyService::getInputForAttr(const media::AudioAttributesInternal& return binderStatusFromStatusT(PERMISSION_DENIED); } if (((flags & AUDIO_INPUT_FLAG_HW_HOTWORD) != 0) if (((flags & (AUDIO_INPUT_FLAG_HW_HOTWORD | AUDIO_INPUT_FLAG_HOTWORD_TAP | AUDIO_INPUT_FLAG_HW_LOOKBACK)) != 0) && !canCaptureHotword) { ALOGE("%s: permission denied: hotword mode not allowed" " for uid %d pid %d", __func__, attributionSource.uid, attributionSource.pid); Loading