Loading media/libaudioclient/AudioProductStrategy.cpp +6 −2 Original line number Original line Diff line number Diff line Loading @@ -60,9 +60,13 @@ aidl2legacy_AudioProductStrategy(const media::AudioProductStrategy& aidl) { } } // Keep in sync with android/media/audiopolicy/AudioProductStrategy#attributeMatches // Keep in sync with android/media/audiopolicy/AudioProductStrategy#attributeMatches int AudioProductStrategy::attributesMatchesScore(const audio_attributes_t refAttributes, int AudioProductStrategy::attributesMatchesScore(audio_attributes_t refAttributes, const audio_attributes_t clientAttritubes) audio_attributes_t clientAttritubes) { { refAttributes.flags = static_cast<audio_flags_mask_t>( refAttributes.flags & AUDIO_FLAGS_AFFECT_STRATEGY_SELECTION); clientAttritubes.flags = static_cast<audio_flags_mask_t>( clientAttritubes.flags & AUDIO_FLAGS_AFFECT_STRATEGY_SELECTION); if (refAttributes == clientAttritubes) { if (refAttributes == clientAttritubes) { return MATCH_EQUALS; return MATCH_EQUALS; } } Loading media/libaudioclient/include/media/AudioProductStrategy.h +4 −4 Original line number Original line Diff line number Diff line Loading @@ -58,11 +58,11 @@ public: * @return {@code INVALID_SCORE} if not matching, {@code MATCH_ON_DEFAULT_SCORE} if matching * @return {@code INVALID_SCORE} if not matching, {@code MATCH_ON_DEFAULT_SCORE} if matching * to default strategy, non zero positive score if matching a strategy. * to default strategy, non zero positive score if matching a strategy. */ */ static int attributesMatchesScore(const audio_attributes_t refAttributes, static int attributesMatchesScore(audio_attributes_t refAttributes, const audio_attributes_t clientAttritubes); audio_attributes_t clientAttritubes); static bool attributesMatches(const audio_attributes_t refAttributes, static bool attributesMatches(audio_attributes_t refAttributes, const audio_attributes_t clientAttritubes) { audio_attributes_t clientAttritubes) { return attributesMatchesScore(refAttributes, clientAttritubes) > 0; return attributesMatchesScore(refAttributes, clientAttritubes) > 0; } } Loading Loading
media/libaudioclient/AudioProductStrategy.cpp +6 −2 Original line number Original line Diff line number Diff line Loading @@ -60,9 +60,13 @@ aidl2legacy_AudioProductStrategy(const media::AudioProductStrategy& aidl) { } } // Keep in sync with android/media/audiopolicy/AudioProductStrategy#attributeMatches // Keep in sync with android/media/audiopolicy/AudioProductStrategy#attributeMatches int AudioProductStrategy::attributesMatchesScore(const audio_attributes_t refAttributes, int AudioProductStrategy::attributesMatchesScore(audio_attributes_t refAttributes, const audio_attributes_t clientAttritubes) audio_attributes_t clientAttritubes) { { refAttributes.flags = static_cast<audio_flags_mask_t>( refAttributes.flags & AUDIO_FLAGS_AFFECT_STRATEGY_SELECTION); clientAttritubes.flags = static_cast<audio_flags_mask_t>( clientAttritubes.flags & AUDIO_FLAGS_AFFECT_STRATEGY_SELECTION); if (refAttributes == clientAttritubes) { if (refAttributes == clientAttritubes) { return MATCH_EQUALS; return MATCH_EQUALS; } } Loading
media/libaudioclient/include/media/AudioProductStrategy.h +4 −4 Original line number Original line Diff line number Diff line Loading @@ -58,11 +58,11 @@ public: * @return {@code INVALID_SCORE} if not matching, {@code MATCH_ON_DEFAULT_SCORE} if matching * @return {@code INVALID_SCORE} if not matching, {@code MATCH_ON_DEFAULT_SCORE} if matching * to default strategy, non zero positive score if matching a strategy. * to default strategy, non zero positive score if matching a strategy. */ */ static int attributesMatchesScore(const audio_attributes_t refAttributes, static int attributesMatchesScore(audio_attributes_t refAttributes, const audio_attributes_t clientAttritubes); audio_attributes_t clientAttritubes); static bool attributesMatches(const audio_attributes_t refAttributes, static bool attributesMatches(audio_attributes_t refAttributes, const audio_attributes_t clientAttritubes) { audio_attributes_t clientAttritubes) { return attributesMatchesScore(refAttributes, clientAttritubes) > 0; return attributesMatchesScore(refAttributes, clientAttritubes) > 0; } } Loading