Loading services/audioflinger/ServiceUtilities.cpp +7 −0 Original line number Diff line number Diff line Loading @@ -50,6 +50,13 @@ bool captureHotwordAllowed() { return ok; } bool captureFmTunerAllowed() { static const String16 sCaptureFmTunerAllowed("android.permission.ACCESS_FM_RADIO"); bool ok = checkCallingPermission(sCaptureFmTunerAllowed); if (!ok) ALOGE("android.permission.ACCESS_FM_RADIO"); return ok; } bool settingsAllowed() { if (getpid_cached == IPCThreadState::self()->getCallingPid()) return true; static const String16 sAudioSettings("android.permission.MODIFY_AUDIO_SETTINGS"); Loading services/audioflinger/ServiceUtilities.h +1 −0 Original line number Diff line number Diff line Loading @@ -23,6 +23,7 @@ extern pid_t getpid_cached; bool recordingAllowed(); bool captureAudioOutputAllowed(); bool captureHotwordAllowed(); bool captureFmTunerAllowed(); bool settingsAllowed(); bool modifyAudioRoutingAllowed(); bool dumpAllowed(); Loading services/audiopolicy/AudioPolicyInterfaceImpl.cpp +4 −2 Original line number Diff line number Diff line Loading @@ -238,11 +238,13 @@ audio_io_handle_t AudioPolicyService::getInput(audio_source_t inputSource, return 0; } // already checked by client, but double-check in case the client wrapper is bypassed if (inputSource >= AUDIO_SOURCE_CNT && inputSource != AUDIO_SOURCE_HOTWORD) { if (inputSource >= AUDIO_SOURCE_CNT && inputSource != AUDIO_SOURCE_HOTWORD && inputSource != AUDIO_SOURCE_FM_TUNER) { return 0; } if ((inputSource == AUDIO_SOURCE_HOTWORD) && !captureHotwordAllowed()) { if (((inputSource == AUDIO_SOURCE_HOTWORD) && !captureHotwordAllowed()) || ((inputSource == AUDIO_SOURCE_FM_TUNER) && !captureFmTunerAllowed())) { return 0; } audio_io_handle_t input; Loading services/audiopolicy/AudioPolicyInterfaceImplLegacy.cpp +4 −2 Original line number Diff line number Diff line Loading @@ -228,11 +228,13 @@ audio_io_handle_t AudioPolicyService::getInput(audio_source_t inputSource, return 0; } // already checked by client, but double-check in case the client wrapper is bypassed if (inputSource >= AUDIO_SOURCE_CNT && inputSource != AUDIO_SOURCE_HOTWORD) { if (inputSource >= AUDIO_SOURCE_CNT && inputSource != AUDIO_SOURCE_HOTWORD && inputSource != AUDIO_SOURCE_FM_TUNER) { return 0; } if ((inputSource == AUDIO_SOURCE_HOTWORD) && !captureHotwordAllowed()) { if (((inputSource == AUDIO_SOURCE_HOTWORD) && !captureHotwordAllowed()) || ((inputSource == AUDIO_SOURCE_FM_TUNER) && !captureFmTunerAllowed())) { return 0; } Loading Loading
services/audioflinger/ServiceUtilities.cpp +7 −0 Original line number Diff line number Diff line Loading @@ -50,6 +50,13 @@ bool captureHotwordAllowed() { return ok; } bool captureFmTunerAllowed() { static const String16 sCaptureFmTunerAllowed("android.permission.ACCESS_FM_RADIO"); bool ok = checkCallingPermission(sCaptureFmTunerAllowed); if (!ok) ALOGE("android.permission.ACCESS_FM_RADIO"); return ok; } bool settingsAllowed() { if (getpid_cached == IPCThreadState::self()->getCallingPid()) return true; static const String16 sAudioSettings("android.permission.MODIFY_AUDIO_SETTINGS"); Loading
services/audioflinger/ServiceUtilities.h +1 −0 Original line number Diff line number Diff line Loading @@ -23,6 +23,7 @@ extern pid_t getpid_cached; bool recordingAllowed(); bool captureAudioOutputAllowed(); bool captureHotwordAllowed(); bool captureFmTunerAllowed(); bool settingsAllowed(); bool modifyAudioRoutingAllowed(); bool dumpAllowed(); Loading
services/audiopolicy/AudioPolicyInterfaceImpl.cpp +4 −2 Original line number Diff line number Diff line Loading @@ -238,11 +238,13 @@ audio_io_handle_t AudioPolicyService::getInput(audio_source_t inputSource, return 0; } // already checked by client, but double-check in case the client wrapper is bypassed if (inputSource >= AUDIO_SOURCE_CNT && inputSource != AUDIO_SOURCE_HOTWORD) { if (inputSource >= AUDIO_SOURCE_CNT && inputSource != AUDIO_SOURCE_HOTWORD && inputSource != AUDIO_SOURCE_FM_TUNER) { return 0; } if ((inputSource == AUDIO_SOURCE_HOTWORD) && !captureHotwordAllowed()) { if (((inputSource == AUDIO_SOURCE_HOTWORD) && !captureHotwordAllowed()) || ((inputSource == AUDIO_SOURCE_FM_TUNER) && !captureFmTunerAllowed())) { return 0; } audio_io_handle_t input; Loading
services/audiopolicy/AudioPolicyInterfaceImplLegacy.cpp +4 −2 Original line number Diff line number Diff line Loading @@ -228,11 +228,13 @@ audio_io_handle_t AudioPolicyService::getInput(audio_source_t inputSource, return 0; } // already checked by client, but double-check in case the client wrapper is bypassed if (inputSource >= AUDIO_SOURCE_CNT && inputSource != AUDIO_SOURCE_HOTWORD) { if (inputSource >= AUDIO_SOURCE_CNT && inputSource != AUDIO_SOURCE_HOTWORD && inputSource != AUDIO_SOURCE_FM_TUNER) { return 0; } if ((inputSource == AUDIO_SOURCE_HOTWORD) && !captureHotwordAllowed()) { if (((inputSource == AUDIO_SOURCE_HOTWORD) && !captureHotwordAllowed()) || ((inputSource == AUDIO_SOURCE_FM_TUNER) && !captureFmTunerAllowed())) { return 0; } Loading