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
gugelfrei
Eric Laurent 5 years ago
parent 6733613929
commit c0c6074f55

@ -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));
}

Loading…
Cancel
Save