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

Commit ee078ede authored by Eric Laurent's avatar Eric Laurent Committed by Android (Google) Code Review
Browse files

Merge changes from topic "pfwk_64"

* changes:
  libaudiofoundation: get rid of convertion of device type from mask
  AudioPolicy: EngineConfigurable: PFW 64 bits inclusive criterion
  Revert "AudioPolicy: engineconfigurable: WA to 32bits limit criterion"
parents 187097e8 df40c962
Loading
Loading
Loading
Loading
+0 −20
Original line number Diff line number Diff line
@@ -111,26 +111,6 @@ static inline audio_devices_t deviceTypesToBitMask(const DeviceTypeSet& deviceTy
    return types;
}

// FIXME: This is temporary helper function. Remove this when getting rid of all
//  bit mask usages of audio device types.
static inline DeviceTypeSet deviceTypesFromBitMask(audio_devices_t types) {
    DeviceTypeSet deviceTypes;
    if ((types & AUDIO_DEVICE_BIT_IN) == 0) {
        for (auto deviceType : AUDIO_DEVICE_OUT_ALL_ARRAY) {
            if ((types & deviceType) == deviceType) {
                deviceTypes.insert(deviceType);
            }
        }
    } else {
        for (auto deviceType : AUDIO_DEVICE_IN_ALL_ARRAY) {
            if ((types & deviceType) == deviceType) {
                deviceTypes.insert(deviceType);
            }
        }
    }
    return deviceTypes;
}

std::string deviceTypesToString(const DeviceTypeSet& deviceTypes);

bool deviceTypesToString(const DeviceTypeSet& deviceTypes, std::string &str);
+1 −1
Original line number Diff line number Diff line
@@ -70,7 +70,7 @@ struct ProductStrategy {

using ProductStrategies = std::vector<ProductStrategy>;

using ValuePair = std::pair<uint32_t, std::string>;
using ValuePair = std::tuple<uint64_t, uint32_t, std::string>;
using ValuePairs = std::vector<ValuePair>;

struct CriterionType
+12 −2
Original line number Diff line number Diff line
@@ -80,6 +80,7 @@ struct ValueTraits : public BaseSerializerTraits<ValuePair, ValuePairs> {
    struct Attributes {
        static constexpr const char *literal = "literal";
        static constexpr const char *numerical = "numerical";
        static constexpr const char *androidType = "android_type";
    };

    static android::status_t deserialize(_xmlDoc *doc, const _xmlNode *root,
@@ -349,7 +350,16 @@ status_t ValueTraits::deserialize(_xmlDoc */*doc*/, const _xmlNode *child, Colle
        ALOGE("%s: No attribute %s found", __FUNCTION__, Attributes::literal);
        return BAD_VALUE;
    }
    uint32_t numerical = 0;
    uint32_t androidType = 0;
    std::string androidTypeliteral = getXmlAttribute(child, Attributes::androidType);
    if (!androidTypeliteral.empty()) {
        ALOGV("%s: androidType %s", __FUNCTION__, androidTypeliteral.c_str());
        if (!convertTo(androidTypeliteral, androidType)) {
            ALOGE("%s: : Invalid typeset value(%s)", __FUNCTION__, androidTypeliteral.c_str());
            return BAD_VALUE;
        }
    }
    uint64_t numerical = 0;
    std::string numericalTag = getXmlAttribute(child, Attributes::numerical);
    if (numericalTag.empty()) {
        ALOGE("%s: No attribute %s found", __FUNCTION__, Attributes::literal);
@@ -359,7 +369,7 @@ status_t ValueTraits::deserialize(_xmlDoc */*doc*/, const _xmlNode *child, Colle
        ALOGE("%s: : Invalid value(%s)", __FUNCTION__, numericalTag.c_str());
        return BAD_VALUE;
    }
    values.push_back({numerical, literal});
    values.push_back({numerical,  androidType, literal});
    return NO_ERROR;
}

+4 −4
Original line number Diff line number Diff line
@@ -77,12 +77,12 @@ public:
     * Set the input device to be used by an input source.
     *
     * @param[in] inputSource: name of the input source for which the device to use has to be set
     * @param[in] devices; mask of devices to be used for the given input source.
     * @param[in] devices: mask of devices to be used for the given input source.
     *
     * @return true if the devices were set correclty for this input source, false otherwise.
     */
    virtual bool setDeviceForInputSource(const audio_source_t &inputSource,
                                         audio_devices_t device) = 0;
                                         uint64_t device) = 0;

    virtual void setDeviceAddressForProductStrategy(product_strategy_t strategy,
                                                    const std::string &address) = 0;
@@ -91,12 +91,12 @@ public:
     * Set the device to be used by a product strategy.
     *
     * @param[in] strategy: name of the product strategy for which the device to use has to be set
     * @param[in] devices; mask of devices to be used for the given strategy.
     * @param[in] devices: mask of devices to be used for the given strategy.
     *
     * @return true if the devices were set correclty for this strategy, false otherwise.
     */
    virtual bool setDeviceTypesForProductStrategy(product_strategy_t strategy,
                                                  audio_devices_t devices) = 0;
                                                  uint64_t devices) = 0;

    virtual product_strategy_t getProductStrategyByName(const std::string &address) = 0;

+4 −4
Original line number Diff line number Diff line
@@ -10,8 +10,8 @@
     <!--#################### GLOBAL COMPONENTS END ####################-->

    <!-- Automatically filled from audio-base.h file -->
    <ComponentType Name="OutputDevicesMask" Description="32th bit is not allowed as dedicated for input devices detection">
        <BitParameterBlock Name="mask" Size="32">
    <ComponentType Name="OutputDevicesMask" Description="64bit representation of devices">
        <BitParameterBlock Name="mask" Size="64">
        </BitParameterBlock>
    </ComponentType>

@@ -19,8 +19,8 @@
    profile. It must match with the Input device enum parameter.
    -->
    <!-- Automatically filled from audio-base.h file -->
    <ComponentType Name="InputDevicesMask">
        <BitParameterBlock Name="mask" Size="32">
    <ComponentType Name="InputDevicesMask" Description="64bit representation of devices">
        <BitParameterBlock Name="mask" Size="64">
        </BitParameterBlock>
    </ComponentType>

Loading