From c0c6074f55a0775ff127814c58c56a748e1a1b50 Mon Sep 17 00:00:00 2001 From: Eric Laurent Date: Wed, 3 Apr 2019 16:46:37 -0700 Subject: [PATCH] fix AudioAttributes matching rule in AudioProductStrategy The matching rule on audio attributes flags must be that ALL flags set in the reference attributes are present in the compared attributes and not just some flags. Bug: 129721367 Test: change volume in Play Music Change-Id: I6b5ada937aa169dbf1b0315d56172ae3b7bb4f47 --- media/libaudioclient/AudioProductStrategy.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/media/libaudioclient/AudioProductStrategy.cpp b/media/libaudioclient/AudioProductStrategy.cpp index 1da1114709..0e1dfac023 100644 --- a/media/libaudioclient/AudioProductStrategy.cpp +++ b/media/libaudioclient/AudioProductStrategy.cpp @@ -86,7 +86,7 @@ bool AudioProductStrategy::attributesMatches(const audio_attributes_t refAttribu (clientAttritubes.content_type == refAttributes.content_type)) && ((refAttributes.flags == AUDIO_FLAG_NONE) || (clientAttritubes.flags != AUDIO_FLAG_NONE && - (clientAttritubes.flags & refAttributes.flags) == clientAttritubes.flags)) && + (clientAttritubes.flags & refAttributes.flags) == refAttributes.flags)) && ((strlen(refAttributes.tags) == 0) || (std::strcmp(clientAttritubes.tags, refAttributes.tags) == 0)); }