Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9df5437f authored by Eric Laurent's avatar Eric Laurent Committed by Android Git Automerger
Browse files

am 123e0f44: Merge "audio policy: protect capture from telephony RX path." into mnc-dev

* commit '123e0f44':
  audio policy: protect capture from telephony RX path.
parents a00c77c2 123e0f44
Loading
Loading
Loading
Loading
+1 −0
Original line number Original line Diff line number Diff line
@@ -64,6 +64,7 @@ public:
        API_INPUT_MIX_EXT_POLICY_REROUTE,// used for platform audio rerouting, where mixes are
        API_INPUT_MIX_EXT_POLICY_REROUTE,// used for platform audio rerouting, where mixes are
                                         // handled by external and dynamically installed
                                         // handled by external and dynamically installed
                                         // policies which reroute audio mixes
                                         // policies which reroute audio mixes
        API_INPUT_TELEPHONY_RX, // used for capture from telephony RX path
    } input_type_t;
    } input_type_t;


public:
public:
+2 −0
Original line number Original line Diff line number Diff line
@@ -1351,6 +1351,8 @@ status_t AudioPolicyManager::getInputForAttr(const audio_attributes_t *attr,
        } else if (audio_is_remote_submix_device(device)) {
        } else if (audio_is_remote_submix_device(device)) {
            address = String8("0");
            address = String8("0");
            *inputType = API_INPUT_MIX_CAPTURE;
            *inputType = API_INPUT_MIX_CAPTURE;
        } else if (device == AUDIO_DEVICE_IN_TELEPHONY_RX) {
            *inputType = API_INPUT_TELEPHONY_RX;
        } else {
        } else {
            *inputType = API_INPUT_LEGACY;
            *inputType = API_INPUT_LEGACY;
        }
        }
+2 −0
Original line number Original line Diff line number Diff line
@@ -303,6 +303,8 @@ status_t AudioPolicyService::getInputForAttr(const audio_attributes_t *attr,
            switch (inputType) {
            switch (inputType) {
            case AudioPolicyInterface::API_INPUT_LEGACY:
            case AudioPolicyInterface::API_INPUT_LEGACY:
                break;
                break;
            case AudioPolicyInterface::API_INPUT_TELEPHONY_RX:
                // FIXME: use the same permission as for remote submix for now.
            case AudioPolicyInterface::API_INPUT_MIX_CAPTURE:
            case AudioPolicyInterface::API_INPUT_MIX_CAPTURE:
                if (!captureAudioOutputAllowed()) {
                if (!captureAudioOutputAllowed()) {
                    ALOGE("getInputForAttr() permission denied: capture not allowed");
                    ALOGE("getInputForAttr() permission denied: capture not allowed");