diff options
author | Eric Laurent <elaurent@google.com> | 2015-08-07 13:59:42 -0700 |
---|---|---|
committer | Eric Laurent <elaurent@google.com> | 2015-08-07 15:23:46 -0700 |
commit | 82db269d4797cb9909988b723d91fa2094a74b38 (patch) | |
tree | 77f2ff4451760a09704ab7676f9e680e9af0729a | |
parent | aa7a4eae1cc93ccf90e273b9634f3a125b0b3565 (diff) | |
download | frameworks_av-82db269d4797cb9909988b723d91fa2094a74b38.zip frameworks_av-82db269d4797cb9909988b723d91fa2094a74b38.tar.gz frameworks_av-82db269d4797cb9909988b723d91fa2094a74b38.tar.bz2 |
audio policy: protect capture from telephony RX path.
Add permission check if the capture device selected is telephony
RX path.
Bug: 23017158.
Change-Id: Iaa34d836e6cf46b7cbbf2483fcd4306dcd27ce90
-rw-r--r-- | services/audiopolicy/AudioPolicyInterface.h | 1 | ||||
-rw-r--r-- | services/audiopolicy/managerdefault/AudioPolicyManager.cpp | 2 | ||||
-rw-r--r-- | services/audiopolicy/service/AudioPolicyInterfaceImpl.cpp | 2 |
3 files changed, 5 insertions, 0 deletions
diff --git a/services/audiopolicy/AudioPolicyInterface.h b/services/audiopolicy/AudioPolicyInterface.h index 8523fc5..c1e7bc0 100644 --- a/services/audiopolicy/AudioPolicyInterface.h +++ b/services/audiopolicy/AudioPolicyInterface.h @@ -64,6 +64,7 @@ public: 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_TELEPHONY_RX, // used for capture from telephony RX path } input_type_t; public: diff --git a/services/audiopolicy/managerdefault/AudioPolicyManager.cpp b/services/audiopolicy/managerdefault/AudioPolicyManager.cpp index fc27789..e7f6864 100644 --- a/services/audiopolicy/managerdefault/AudioPolicyManager.cpp +++ b/services/audiopolicy/managerdefault/AudioPolicyManager.cpp @@ -1351,6 +1351,8 @@ status_t AudioPolicyManager::getInputForAttr(const audio_attributes_t *attr, } else if (audio_is_remote_submix_device(device)) { address = String8("0"); *inputType = API_INPUT_MIX_CAPTURE; + } else if (device == AUDIO_DEVICE_IN_TELEPHONY_RX) { + *inputType = API_INPUT_TELEPHONY_RX; } else { *inputType = API_INPUT_LEGACY; } diff --git a/services/audiopolicy/service/AudioPolicyInterfaceImpl.cpp b/services/audiopolicy/service/AudioPolicyInterfaceImpl.cpp index 65639c3..793c26a 100644 --- a/services/audiopolicy/service/AudioPolicyInterfaceImpl.cpp +++ b/services/audiopolicy/service/AudioPolicyInterfaceImpl.cpp @@ -303,6 +303,8 @@ status_t AudioPolicyService::getInputForAttr(const audio_attributes_t *attr, switch (inputType) { case AudioPolicyInterface::API_INPUT_LEGACY: break; + case AudioPolicyInterface::API_INPUT_TELEPHONY_RX: + // FIXME: use the same permission as for remote submix for now. case AudioPolicyInterface::API_INPUT_MIX_CAPTURE: if (!captureAudioOutputAllowed()) { ALOGE("getInputForAttr() permission denied: capture not allowed"); |